@genesislcap/foundation-ui 15.71.0 → 15.72.0-FUI-2629.7

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.
@@ -0,0 +1,60 @@
1
+ import { css } from '@microsoft/fast-element';
2
+ /**
3
+ * Styles a menu to match AG Grid's own menu (ag-menu / ag-menu-list / ag-menu-option), so a menu
4
+ * drawn over a grid looks like the grid's. AG Grid's `--ag-*` variables apply where they are set;
5
+ * elsewhere the design system's tokens do, with fallbacks for when neither is in scope.
6
+ *
7
+ * @remarks Shared by the vertical actions menu and grid-pro's right-click menu. Each adds its own
8
+ * layout (display, sizing) around these rules.
9
+ *
10
+ * @param menuSelector - Selects the menu surface. May be a selector list.
11
+ * @param itemSelector - Selects a menu item. Must be a single selector, as states are appended to it.
12
+ * @returns The menu surface and item styles.
13
+ * @public
14
+ */
15
+ export const agMenuStyles = (menuSelector, itemSelector) => css `
16
+ ${menuSelector} {
17
+ box-sizing: border-box;
18
+ padding: var(--ag-spacing, 4px) 0;
19
+ background-color: var(--ag-menu-background-color, var(--fill-color));
20
+ border: var(
21
+ --ag-menu-border,
22
+ calc(var(--stroke-width, 1) * 1px) solid var(--neutral-stroke-rest, transparent)
23
+ );
24
+ border-radius: var(--ag-border-radius, calc(var(--control-corner-radius, 2) * 1px));
25
+ box-shadow: var(--ag-menu-shadow, var(--ag-popup-shadow, 0 2px 8px rgb(0 0 0 / 30%)));
26
+ color: var(--ag-menu-text-color, var(--neutral-foreground-rest));
27
+ font-family: var(--ag-font-family, var(--body-font));
28
+ }
29
+
30
+ ${itemSelector} {
31
+ box-sizing: border-box;
32
+ height: calc(var(--ag-icon-size, 16px) + (var(--ag-spacing, 4px) + 2px) * 2);
33
+ margin: 0;
34
+ background: transparent;
35
+ border: none;
36
+ border-radius: 0;
37
+ color: inherit;
38
+ font-family: inherit;
39
+ font-size: var(--ag-font-size, var(--type-ramp-base-font-size));
40
+ font-weight: 500;
41
+ }
42
+
43
+ ${itemSelector}:hover, ${itemSelector}:focus {
44
+ background: var(--ag-row-hover-color, var(--neutral-fill-stealth-hover));
45
+ border: none;
46
+ }
47
+
48
+ ${itemSelector}[disabled] {
49
+ background: transparent;
50
+ cursor: default;
51
+ opacity: 50%;
52
+ }
53
+
54
+ /* AG's trailing shortcut and popup-pointer cells add 2 more spacings on the right. */
55
+ ${itemSelector}::part(content) {
56
+ margin-inline: 0;
57
+ padding-inline: calc(var(--ag-spacing, 4px) * 2) calc(var(--ag-spacing, 4px) * 4);
58
+ line-height: var(--ag-icon-size, 16px);
59
+ }
60
+ `;
@@ -1,3 +1,4 @@
1
1
  export * from './actions-menu.styles';
2
2
  export * from './actions-menu.template';
3
3
  export * from './actions-menu';
4
+ export * from './ag-menu.styles';
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Keeps a Popover-API element anchored to its trigger, and reports back when the trigger has been
3
+ * removed from the DOM (e.g. AG Grid row virtualization recycling the row that owns it).
4
+ * @remarks Checks the trigger once per animation frame while started, and repositions only when
5
+ * the trigger or the viewport moved. Events alone miss moves: native `scroll` events don't cross
6
+ * shadow-DOM boundaries, and a grid re-sort moves a row by `transform`, which fires nothing on the
7
+ * rows that didn't change. Callers start it when the popover opens and stop it when it closes.
8
+ * @internal
9
+ */
10
+ export class AnchoredPopoverPositionTracker {
11
+ constructor(anchor, onReposition, onAnchorDetached) {
12
+ this.anchor = anchor;
13
+ this.onReposition = onReposition;
14
+ this.onAnchorDetached = onAnchorDetached;
15
+ this.check = () => {
16
+ if (!this.anchor.isConnected) {
17
+ this.stop();
18
+ this.onAnchorDetached();
19
+ return;
20
+ }
21
+ const { top, right, bottom } = this.anchor.getBoundingClientRect();
22
+ const position = `${top},${right},${bottom},${this.view.innerWidth},${this.view.innerHeight}`;
23
+ // The first check only records where the caller already positioned the popover.
24
+ if (this.lastPosition !== undefined && position !== this.lastPosition) {
25
+ this.onReposition();
26
+ // onReposition may have stopped the tracker; don't schedule past that.
27
+ if (!this.view)
28
+ return;
29
+ }
30
+ this.lastPosition = position;
31
+ this.frame = this.view.requestAnimationFrame(this.check);
32
+ };
33
+ }
34
+ start() {
35
+ this.stop();
36
+ this.view = this.anchor.ownerDocument.defaultView;
37
+ if (!this.view)
38
+ return;
39
+ this.check();
40
+ }
41
+ stop() {
42
+ var _a;
43
+ if (this.frame !== undefined) {
44
+ (_a = this.view) === null || _a === void 0 ? void 0 : _a.cancelAnimationFrame(this.frame);
45
+ }
46
+ this.frame = undefined;
47
+ this.lastPosition = undefined;
48
+ this.view = undefined;
49
+ }
50
+ }
@@ -279,7 +279,25 @@
279
279
  },
280
280
  {
281
281
  "kind": "Content",
282
- "text": "{\n name: string | ((rowData: any) => string);\n callback: (rowData: any) => void | any;\n isDisabled?: (rowData: any) => boolean;\n color?: string;\n}"
282
+ "text": "{\n name: string | ((rowData: any) => string);\n callback: (rowData: any) => void | any;\n isDisabled?: (rowData: any) => boolean;\n color?: string;\n icon?: {\n variant?: "
283
+ },
284
+ {
285
+ "kind": "Reference",
286
+ "text": "IconStyle",
287
+ "canonicalReference": "@fortawesome/fontawesome-common-types!IconStyle:type"
288
+ },
289
+ {
290
+ "kind": "Content",
291
+ "text": ";\n name: string;\n size?: "
292
+ },
293
+ {
294
+ "kind": "Reference",
295
+ "text": "FaSize",
296
+ "canonicalReference": "@genesislcap/foundation-ui!FaSize:type"
297
+ },
298
+ {
299
+ "kind": "Content",
300
+ "text": ";\n };\n}"
283
301
  },
284
302
  {
285
303
  "kind": "Content",
@@ -291,7 +309,78 @@
291
309
  "name": "ActionMenuItem",
292
310
  "typeTokenRange": {
293
311
  "startIndex": 1,
294
- "endIndex": 2
312
+ "endIndex": 6
313
+ }
314
+ },
315
+ {
316
+ "kind": "TypeAlias",
317
+ "canonicalReference": "@genesislcap/foundation-ui!ActionMenuItems:type",
318
+ "docComment": "/**\n * The actions a grid column's Actions Menu shows: a fixed array, or a resolver per row.\n *\n * @public\n */\n",
319
+ "excerptTokens": [
320
+ {
321
+ "kind": "Content",
322
+ "text": "export type ActionMenuItems = "
323
+ },
324
+ {
325
+ "kind": "Reference",
326
+ "text": "ActionMenuItem",
327
+ "canonicalReference": "@genesislcap/foundation-ui!ActionMenuItem:type"
328
+ },
329
+ {
330
+ "kind": "Content",
331
+ "text": "[] | "
332
+ },
333
+ {
334
+ "kind": "Reference",
335
+ "text": "ActionMenuItemsResolver",
336
+ "canonicalReference": "@genesislcap/foundation-ui!ActionMenuItemsResolver:type"
337
+ },
338
+ {
339
+ "kind": "Content",
340
+ "text": ";"
341
+ }
342
+ ],
343
+ "fileUrlPath": "src/actions-menu/actions-menu.ts",
344
+ "releaseTag": "Public",
345
+ "name": "ActionMenuItems",
346
+ "typeTokenRange": {
347
+ "startIndex": 1,
348
+ "endIndex": 4
349
+ }
350
+ },
351
+ {
352
+ "kind": "TypeAlias",
353
+ "canonicalReference": "@genesislcap/foundation-ui!ActionMenuItemsResolver:type",
354
+ "docComment": "/**\n * A function of the row data returning the actions for that row (for row-scoped eligibility/permission filtering).\n *\n * @public\n */\n",
355
+ "excerptTokens": [
356
+ {
357
+ "kind": "Content",
358
+ "text": "export type ActionMenuItemsResolver = "
359
+ },
360
+ {
361
+ "kind": "Content",
362
+ "text": "(rowData: any) => "
363
+ },
364
+ {
365
+ "kind": "Reference",
366
+ "text": "ActionMenuItem",
367
+ "canonicalReference": "@genesislcap/foundation-ui!ActionMenuItem:type"
368
+ },
369
+ {
370
+ "kind": "Content",
371
+ "text": "[]"
372
+ },
373
+ {
374
+ "kind": "Content",
375
+ "text": ";"
376
+ }
377
+ ],
378
+ "fileUrlPath": "src/actions-menu/actions-menu.ts",
379
+ "releaseTag": "Public",
380
+ "name": "ActionMenuItemsResolver",
381
+ "typeTokenRange": {
382
+ "startIndex": 1,
383
+ "endIndex": 4
295
384
  }
296
385
  },
297
386
  {
@@ -416,6 +505,37 @@
416
505
  "isProtected": false,
417
506
  "isAbstract": false
418
507
  },
508
+ {
509
+ "kind": "Property",
510
+ "canonicalReference": "@genesislcap/foundation-ui!ActionsMenu#actionsResolver:member",
511
+ "docComment": "/**\n * Resolves the actions per row instead of `actions`, from the row data in `definition`.\n *\n * @remarks\n *\n * Set from a function passed as the cell params' `actions`.\n */\n",
512
+ "excerptTokens": [
513
+ {
514
+ "kind": "Content",
515
+ "text": "actionsResolver?: "
516
+ },
517
+ {
518
+ "kind": "Reference",
519
+ "text": "ActionMenuItemsResolver",
520
+ "canonicalReference": "@genesislcap/foundation-ui!ActionMenuItemsResolver:type"
521
+ },
522
+ {
523
+ "kind": "Content",
524
+ "text": ";"
525
+ }
526
+ ],
527
+ "isReadonly": false,
528
+ "isOptional": true,
529
+ "releaseTag": "Public",
530
+ "name": "actionsResolver",
531
+ "propertyTypeTokenRange": {
532
+ "startIndex": 1,
533
+ "endIndex": 2
534
+ },
535
+ "isStatic": false,
536
+ "isProtected": false,
537
+ "isAbstract": false
538
+ },
419
539
  {
420
540
  "kind": "Property",
421
541
  "canonicalReference": "@genesislcap/foundation-ui!ActionsMenu#addDefaultActions:member",
@@ -810,6 +930,36 @@
810
930
  "isAbstract": false,
811
931
  "name": "getTemplate"
812
932
  },
933
+ {
934
+ "kind": "Property",
935
+ "canonicalReference": "@genesislcap/foundation-ui!ActionsMenu#hasVisibleActions:member",
936
+ "docComment": "/**\n * Whether the row has an action to show: an enabled one, or any when disabled ones show.\n */\n",
937
+ "excerptTokens": [
938
+ {
939
+ "kind": "Content",
940
+ "text": "get hasVisibleActions(): "
941
+ },
942
+ {
943
+ "kind": "Content",
944
+ "text": "boolean"
945
+ },
946
+ {
947
+ "kind": "Content",
948
+ "text": ";"
949
+ }
950
+ ],
951
+ "isReadonly": true,
952
+ "isOptional": false,
953
+ "releaseTag": "Public",
954
+ "name": "hasVisibleActions",
955
+ "propertyTypeTokenRange": {
956
+ "startIndex": 1,
957
+ "endIndex": 2
958
+ },
959
+ "isStatic": false,
960
+ "isProtected": false,
961
+ "isAbstract": false
962
+ },
813
963
  {
814
964
  "kind": "Property",
815
965
  "canonicalReference": "@genesislcap/foundation-ui!ActionsMenu#hideDisabled:member",
@@ -870,6 +1020,85 @@
870
1020
  "isProtected": false,
871
1021
  "isAbstract": false
872
1022
  },
1023
+ {
1024
+ "kind": "Property",
1025
+ "canonicalReference": "@genesislcap/foundation-ui!ActionsMenu#iconName:member",
1026
+ "docComment": "/**\n * When set, the opener renders this icon instead of the `name` text (e.g. `ellipsis` for an icon-only \"kebab\" opener).\n */\n",
1027
+ "excerptTokens": [
1028
+ {
1029
+ "kind": "Content",
1030
+ "text": "iconName: "
1031
+ },
1032
+ {
1033
+ "kind": "Content",
1034
+ "text": "string"
1035
+ },
1036
+ {
1037
+ "kind": "Content",
1038
+ "text": ";"
1039
+ }
1040
+ ],
1041
+ "isReadonly": false,
1042
+ "isOptional": false,
1043
+ "releaseTag": "Public",
1044
+ "name": "iconName",
1045
+ "propertyTypeTokenRange": {
1046
+ "startIndex": 1,
1047
+ "endIndex": 2
1048
+ },
1049
+ "isStatic": false,
1050
+ "isProtected": false,
1051
+ "isAbstract": false
1052
+ },
1053
+ {
1054
+ "kind": "Method",
1055
+ "canonicalReference": "@genesislcap/foundation-ui!ActionsMenu#isActionDisabled:member(1)",
1056
+ "docComment": "/**\n * Resolves an action's `isDisabled` for the current row.\n */\n",
1057
+ "excerptTokens": [
1058
+ {
1059
+ "kind": "Content",
1060
+ "text": "isActionDisabled(action: "
1061
+ },
1062
+ {
1063
+ "kind": "Reference",
1064
+ "text": "ActionMenuItem",
1065
+ "canonicalReference": "@genesislcap/foundation-ui!ActionMenuItem:type"
1066
+ },
1067
+ {
1068
+ "kind": "Content",
1069
+ "text": "): "
1070
+ },
1071
+ {
1072
+ "kind": "Content",
1073
+ "text": "boolean"
1074
+ },
1075
+ {
1076
+ "kind": "Content",
1077
+ "text": ";"
1078
+ }
1079
+ ],
1080
+ "isStatic": false,
1081
+ "returnTypeTokenRange": {
1082
+ "startIndex": 3,
1083
+ "endIndex": 4
1084
+ },
1085
+ "releaseTag": "Public",
1086
+ "isProtected": false,
1087
+ "overloadIndex": 1,
1088
+ "parameters": [
1089
+ {
1090
+ "parameterName": "action",
1091
+ "parameterTypeTokenRange": {
1092
+ "startIndex": 1,
1093
+ "endIndex": 2
1094
+ },
1095
+ "isOptional": false
1096
+ }
1097
+ ],
1098
+ "isOptional": false,
1099
+ "isAbstract": false,
1100
+ "name": "isActionDisabled"
1101
+ },
873
1102
  {
874
1103
  "kind": "Property",
875
1104
  "canonicalReference": "@genesislcap/foundation-ui!ActionsMenu#isVertical:member",
@@ -978,6 +1207,104 @@
978
1207
  "isAbstract": false,
979
1208
  "name": "onActionMenuItemClick"
980
1209
  },
1210
+ {
1211
+ "kind": "Method",
1212
+ "canonicalReference": "@genesislcap/foundation-ui!ActionsMenu#onIconOpenerKeydown:member(1)",
1213
+ "docComment": "/**\n * Opens the icon-only opener from the keyboard, as a native button would.\n */\n",
1214
+ "excerptTokens": [
1215
+ {
1216
+ "kind": "Content",
1217
+ "text": "onIconOpenerKeydown(event: "
1218
+ },
1219
+ {
1220
+ "kind": "Reference",
1221
+ "text": "KeyboardEvent",
1222
+ "canonicalReference": "!KeyboardEvent:interface"
1223
+ },
1224
+ {
1225
+ "kind": "Content",
1226
+ "text": "): "
1227
+ },
1228
+ {
1229
+ "kind": "Content",
1230
+ "text": "boolean"
1231
+ },
1232
+ {
1233
+ "kind": "Content",
1234
+ "text": ";"
1235
+ }
1236
+ ],
1237
+ "isStatic": false,
1238
+ "returnTypeTokenRange": {
1239
+ "startIndex": 3,
1240
+ "endIndex": 4
1241
+ },
1242
+ "releaseTag": "Public",
1243
+ "isProtected": false,
1244
+ "overloadIndex": 1,
1245
+ "parameters": [
1246
+ {
1247
+ "parameterName": "event",
1248
+ "parameterTypeTokenRange": {
1249
+ "startIndex": 1,
1250
+ "endIndex": 2
1251
+ },
1252
+ "isOptional": false
1253
+ }
1254
+ ],
1255
+ "isOptional": false,
1256
+ "isAbstract": false,
1257
+ "name": "onIconOpenerKeydown"
1258
+ },
1259
+ {
1260
+ "kind": "Method",
1261
+ "canonicalReference": "@genesislcap/foundation-ui!ActionsMenu#onPopoverToggle:member(1)",
1262
+ "docComment": "/**\n * Syncs `open` when the native `popover=\"auto\"` light-dismiss (outside click / Escape) closes the vertical menu without going through `toggleActionsMenuVisibility()`.\n */\n",
1263
+ "excerptTokens": [
1264
+ {
1265
+ "kind": "Content",
1266
+ "text": "onPopoverToggle(event: "
1267
+ },
1268
+ {
1269
+ "kind": "Reference",
1270
+ "text": "Event",
1271
+ "canonicalReference": "!Event:interface"
1272
+ },
1273
+ {
1274
+ "kind": "Content",
1275
+ "text": "): "
1276
+ },
1277
+ {
1278
+ "kind": "Content",
1279
+ "text": "void"
1280
+ },
1281
+ {
1282
+ "kind": "Content",
1283
+ "text": ";"
1284
+ }
1285
+ ],
1286
+ "isStatic": false,
1287
+ "returnTypeTokenRange": {
1288
+ "startIndex": 3,
1289
+ "endIndex": 4
1290
+ },
1291
+ "releaseTag": "Public",
1292
+ "isProtected": false,
1293
+ "overloadIndex": 1,
1294
+ "parameters": [
1295
+ {
1296
+ "parameterName": "event",
1297
+ "parameterTypeTokenRange": {
1298
+ "startIndex": 1,
1299
+ "endIndex": 2
1300
+ },
1301
+ "isOptional": false
1302
+ }
1303
+ ],
1304
+ "isOptional": false,
1305
+ "isAbstract": false,
1306
+ "name": "onPopoverToggle"
1307
+ },
981
1308
  {
982
1309
  "kind": "Property",
983
1310
  "canonicalReference": "@genesislcap/foundation-ui!ActionsMenu#open:member",
@@ -1039,6 +1366,41 @@
1039
1366
  "isAbstract": false,
1040
1367
  "name": "openChanged"
1041
1368
  },
1369
+ {
1370
+ "kind": "Property",
1371
+ "canonicalReference": "@genesislcap/foundation-ui!ActionsMenu#resolvedActions:member",
1372
+ "docComment": "/**\n * The actions for the current row: from `actionsResolver` when set, else `actions`.\n */\n",
1373
+ "excerptTokens": [
1374
+ {
1375
+ "kind": "Content",
1376
+ "text": "get resolvedActions(): "
1377
+ },
1378
+ {
1379
+ "kind": "Reference",
1380
+ "text": "ActionMenuItem",
1381
+ "canonicalReference": "@genesislcap/foundation-ui!ActionMenuItem:type"
1382
+ },
1383
+ {
1384
+ "kind": "Content",
1385
+ "text": "[]"
1386
+ },
1387
+ {
1388
+ "kind": "Content",
1389
+ "text": ";"
1390
+ }
1391
+ ],
1392
+ "isReadonly": true,
1393
+ "isOptional": false,
1394
+ "releaseTag": "Public",
1395
+ "name": "resolvedActions",
1396
+ "propertyTypeTokenRange": {
1397
+ "startIndex": 1,
1398
+ "endIndex": 3
1399
+ },
1400
+ "isStatic": false,
1401
+ "isProtected": false,
1402
+ "isAbstract": false
1403
+ },
1042
1404
  {
1043
1405
  "kind": "Property",
1044
1406
  "canonicalReference": "@genesislcap/foundation-ui!ActionsMenu#rowData:member",
@@ -1278,6 +1640,64 @@
1278
1640
  ],
1279
1641
  "name": "AffixMixin"
1280
1642
  },
1643
+ {
1644
+ "kind": "Function",
1645
+ "canonicalReference": "@genesislcap/foundation-ui!agMenuStyles:function(1)",
1646
+ "docComment": "/**\n * Styles a menu to match AG Grid's own menu (ag-menu / ag-menu-list / ag-menu-option), so a menu drawn over a grid looks like the grid's. AG Grid's `--ag-*` variables apply where they are set; elsewhere the design system's tokens do, with fallbacks for when neither is in scope.\n *\n * @remarks\n *\n * Shared by the vertical actions menu and grid-pro's right-click menu. Each adds its own layout (display, sizing) around these rules.\n *\n * @param menuSelector - Selects the menu surface. May be a selector list.\n *\n * @param itemSelector - Selects a menu item. Must be a single selector, as states are appended to it.\n *\n * @returns The menu surface and item styles.\n *\n * @public\n */\n",
1647
+ "excerptTokens": [
1648
+ {
1649
+ "kind": "Content",
1650
+ "text": "agMenuStyles: (menuSelector: "
1651
+ },
1652
+ {
1653
+ "kind": "Content",
1654
+ "text": "string"
1655
+ },
1656
+ {
1657
+ "kind": "Content",
1658
+ "text": ", itemSelector: "
1659
+ },
1660
+ {
1661
+ "kind": "Content",
1662
+ "text": "string"
1663
+ },
1664
+ {
1665
+ "kind": "Content",
1666
+ "text": ") => "
1667
+ },
1668
+ {
1669
+ "kind": "Reference",
1670
+ "text": "ElementStyles",
1671
+ "canonicalReference": "@microsoft/fast-element!ElementStyles:class"
1672
+ }
1673
+ ],
1674
+ "fileUrlPath": "src/actions-menu/ag-menu.styles.ts",
1675
+ "returnTypeTokenRange": {
1676
+ "startIndex": 5,
1677
+ "endIndex": 6
1678
+ },
1679
+ "releaseTag": "Public",
1680
+ "overloadIndex": 1,
1681
+ "parameters": [
1682
+ {
1683
+ "parameterName": "menuSelector",
1684
+ "parameterTypeTokenRange": {
1685
+ "startIndex": 1,
1686
+ "endIndex": 2
1687
+ },
1688
+ "isOptional": false
1689
+ },
1690
+ {
1691
+ "parameterName": "itemSelector",
1692
+ "parameterTypeTokenRange": {
1693
+ "startIndex": 3,
1694
+ "endIndex": 4
1695
+ },
1696
+ "isOptional": false
1697
+ }
1698
+ ],
1699
+ "name": "agMenuStyles"
1700
+ },
1281
1701
  {
1282
1702
  "kind": "Class",
1283
1703
  "canonicalReference": "@genesislcap/foundation-ui!AiCriteriaSearch:class",
@@ -54125,7 +54545,7 @@
54125
54545
  },
54126
54546
  {
54127
54547
  "kind": "Content",
54128
- "text": "\"boolean\" | \"number\" | \"date\" | \"text\" | \"enum\""
54548
+ "text": "\"boolean\" | \"number\" | \"text\" | \"date\" | \"enum\""
54129
54549
  }
54130
54550
  ],
54131
54551
  "fileUrlPath": "src/filter-bar/filter-bar.utils.ts",
@@ -54527,7 +54947,7 @@
54527
54947
  },
54528
54948
  {
54529
54949
  "kind": "Content",
54530
- "text": ", any>"
54950
+ "text": ">"
54531
54951
  }
54532
54952
  ],
54533
54953
  "fileUrlPath": "src/actions-menu/actions-menu.template.ts",
@@ -66682,7 +67102,7 @@
66682
67102
  },
66683
67103
  {
66684
67104
  "kind": "Content",
66685
- "text": ", any>"
67105
+ "text": ">"
66686
67106
  }
66687
67107
  ],
66688
67108
  "fileUrlPath": "src/actions-menu/actions-menu.template.ts",