@pingux/astro 2.214.0 → 2.215.0-alpha.0

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.
@@ -14,6 +14,7 @@ var _reverseInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/in
14
14
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
15
15
  var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
16
16
  var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice"));
17
+ var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
17
18
  var _sort2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/sort"));
18
19
  var _parseInt2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/parse-int"));
19
20
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncToGenerator"));
@@ -860,6 +861,401 @@ describe('Resizable columns', function () {
860
861
  });
861
862
  });
862
863
  });
864
+ describe('onRowAction behavior', function () {
865
+ test('clicking a cell fires onRowAction with the correct row key', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
866
+ var onRowAction, rows, firstBodyRowCells;
867
+ return _regeneratorRuntime().wrap(function _callee12$(_context14) {
868
+ while (1) switch (_context14.prev = _context14.next) {
869
+ case 0:
870
+ onRowAction = jest.fn();
871
+ getComponent({
872
+ onRowAction: onRowAction
873
+ });
874
+ rows = _react2.screen.getAllByRole('row');
875
+ firstBodyRowCells = rows[1].querySelectorAll('td');
876
+ _context14.next = 6;
877
+ return _userEvent["default"].click(firstBodyRowCells[0]);
878
+ case 6:
879
+ expect(onRowAction).toHaveBeenCalledTimes(1);
880
+ expect(onRowAction).toHaveBeenCalledWith('1');
881
+ case 8:
882
+ case "end":
883
+ return _context14.stop();
884
+ }
885
+ }, _callee12);
886
+ })));
887
+ test('rows receive has-actions class when onRowAction is provided', function () {
888
+ var _context15;
889
+ var onRowAction = jest.fn();
890
+ getComponent({
891
+ onRowAction: onRowAction
892
+ });
893
+ var rows = _react2.screen.getAllByRole('row');
894
+
895
+ // All body rows (skip the header row at index 0) should have the has-actions class
896
+ (0, _forEach["default"])(_context15 = (0, _slice["default"])(rows).call(rows, 1)).call(_context15, function (row) {
897
+ expect(row).toHaveClass('has-actions');
898
+ });
899
+ });
900
+ test('rows do not receive has-actions class when onRowAction is absent', function () {
901
+ var _context16;
902
+ getComponent();
903
+ var rows = _react2.screen.getAllByRole('row');
904
+ (0, _forEach["default"])(_context16 = (0, _slice["default"])(rows).call(rows, 1)).call(_context16, function (row) {
905
+ expect(row).not.toHaveClass('has-actions');
906
+ });
907
+ });
908
+ test('pressing Enter on a focused row fires onRowAction when selectionMode is none', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
909
+ var onRowAction, rows;
910
+ return _regeneratorRuntime().wrap(function _callee13$(_context17) {
911
+ while (1) switch (_context17.prev = _context17.next) {
912
+ case 0:
913
+ onRowAction = jest.fn();
914
+ getComponent({
915
+ selectionMode: 'none',
916
+ onRowAction: onRowAction
917
+ });
918
+ rows = _react2.screen.getAllByRole('row');
919
+ _context17.next = 5;
920
+ return _userEvent["default"].tab();
921
+ case 5:
922
+ expect(rows[1]).toHaveFocus();
923
+
924
+ // React Aria's usePress fires the action on keyUp (press completion),
925
+ // so both keyDown and keyUp must be fired.
926
+ _react2.fireEvent.keyDown(rows[1], {
927
+ key: 'Enter'
928
+ });
929
+ _react2.fireEvent.keyUp(rows[1], {
930
+ key: 'Enter'
931
+ });
932
+ expect(onRowAction).toHaveBeenCalledTimes(1);
933
+ expect(onRowAction).toHaveBeenCalledWith('1');
934
+ case 10:
935
+ case "end":
936
+ return _context17.stop();
937
+ }
938
+ }, _callee13);
939
+ })));
940
+ test('clicking an action row applies is-focused class to that row', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
941
+ var onRowAction, rows, firstBodyRowCells, secondBodyRowCells;
942
+ return _regeneratorRuntime().wrap(function _callee14$(_context18) {
943
+ while (1) switch (_context18.prev = _context18.next) {
944
+ case 0:
945
+ onRowAction = jest.fn();
946
+ getComponent({
947
+ onRowAction: onRowAction
948
+ });
949
+ rows = _react2.screen.getAllByRole('row'); // Click a cell in the first body row (rows[0] is the header row)
950
+ firstBodyRowCells = rows[1].querySelectorAll('td');
951
+ _context18.next = 6;
952
+ return _userEvent["default"].click(firstBodyRowCells[0]);
953
+ case 6:
954
+ // First body row should have is-focused; all other body rows should not
955
+ expect(rows[1]).toHaveClass('is-focused');
956
+ expect(rows[2]).not.toHaveClass('is-focused');
957
+ expect(rows[3]).not.toHaveClass('is-focused');
958
+ expect(rows[4]).not.toHaveClass('is-focused');
959
+
960
+ // Click a cell in the second body row — highlight should move
961
+ secondBodyRowCells = rows[2].querySelectorAll('td');
962
+ _context18.next = 13;
963
+ return _userEvent["default"].click(secondBodyRowCells[0]);
964
+ case 13:
965
+ expect(rows[2]).toHaveClass('is-focused');
966
+ expect(rows[1]).not.toHaveClass('is-focused');
967
+ case 15:
968
+ case "end":
969
+ return _context18.stop();
970
+ }
971
+ }, _callee14);
972
+ })));
973
+ test('no row has is-focused before any click with onRowAction', function () {
974
+ var _context19;
975
+ var onRowAction = jest.fn();
976
+ getComponent({
977
+ onRowAction: onRowAction
978
+ });
979
+ var rows = _react2.screen.getAllByRole('row');
980
+
981
+ // At mount time, no body row should have is-focused from active-row state
982
+ (0, _forEach["default"])(_context19 = (0, _slice["default"])(rows).call(rows, 1)).call(_context19, function (row) {
983
+ expect(row).not.toHaveClass('is-focused');
984
+ });
985
+ });
986
+ test('clicking a row without onRowAction does not apply is-focused', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
987
+ var rows, firstBodyRowCells;
988
+ return _regeneratorRuntime().wrap(function _callee15$(_context20) {
989
+ while (1) switch (_context20.prev = _context20.next) {
990
+ case 0:
991
+ getComponent();
992
+ rows = _react2.screen.getAllByRole('row');
993
+ firstBodyRowCells = rows[1].querySelectorAll('td');
994
+ _context20.next = 5;
995
+ return _userEvent["default"].click(firstBodyRowCells[0]);
996
+ case 5:
997
+ // Without onRowAction the active-row path is not triggered
998
+ expect(rows[1]).not.toHaveClass('is-focused');
999
+ case 6:
1000
+ case "end":
1001
+ return _context20.stop();
1002
+ }
1003
+ }, _callee15);
1004
+ })));
1005
+ test('keyboard-focused row receives is-focused when onRowAction is present (AC4)', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
1006
+ var onRowAction, rows;
1007
+ return _regeneratorRuntime().wrap(function _callee16$(_context21) {
1008
+ while (1) switch (_context21.prev = _context21.next) {
1009
+ case 0:
1010
+ onRowAction = jest.fn();
1011
+ getComponent({
1012
+ selectionMode: 'none',
1013
+ onRowAction: onRowAction
1014
+ });
1015
+ rows = _react2.screen.getAllByRole('row'); // Tab into the table so the first body row has keyboard focus
1016
+ _context21.next = 5;
1017
+ return _userEvent["default"].tab();
1018
+ case 5:
1019
+ expect(rows[1]).toHaveFocus();
1020
+
1021
+ // The row must have is-focused from keyboard focus (isFocusVisible path unchanged)
1022
+ expect(rows[1]).toHaveClass('is-focused');
1023
+ case 7:
1024
+ case "end":
1025
+ return _context21.stop();
1026
+ }
1027
+ }, _callee16);
1028
+ })));
1029
+ test('is-focused class appears only once when keyboard-focused row is also the active row (AC5)', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
1030
+ var _context22;
1031
+ var onRowAction, rows, firstBodyRowCells, isFocusedCount;
1032
+ return _regeneratorRuntime().wrap(function _callee17$(_context23) {
1033
+ while (1) switch (_context23.prev = _context23.next) {
1034
+ case 0:
1035
+ onRowAction = jest.fn();
1036
+ getComponent({
1037
+ selectionMode: 'none',
1038
+ onRowAction: onRowAction
1039
+ });
1040
+ rows = _react2.screen.getAllByRole('row'); // Click the first body row to set activeRowKey
1041
+ firstBodyRowCells = rows[1].querySelectorAll('td');
1042
+ _context23.next = 6;
1043
+ return _userEvent["default"].click(firstBodyRowCells[0]);
1044
+ case 6:
1045
+ expect(rows[1]).toHaveClass('is-focused');
1046
+
1047
+ // Count occurrences of the class — must be exactly 1
1048
+ isFocusedCount = (0, _filter["default"])(_context22 = rows[1].className.split(/\s+/)).call(_context22, function (cls) {
1049
+ return cls === 'is-focused';
1050
+ }).length;
1051
+ expect(isFocusedCount).toBe(1);
1052
+ case 9:
1053
+ case "end":
1054
+ return _context23.stop();
1055
+ }
1056
+ }, _callee17);
1057
+ })));
1058
+ test('clicking a row focuses the row <tr> so arrow keys work via React Aria', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
1059
+ var onRowAction, rows, firstBodyRowCells;
1060
+ return _regeneratorRuntime().wrap(function _callee18$(_context24) {
1061
+ while (1) switch (_context24.prev = _context24.next) {
1062
+ case 0:
1063
+ onRowAction = jest.fn();
1064
+ getComponent({
1065
+ onRowAction: onRowAction
1066
+ });
1067
+ rows = _react2.screen.getAllByRole('row'); // Click a cell in the first body row
1068
+ firstBodyRowCells = rows[1].querySelectorAll('td');
1069
+ _context24.next = 6;
1070
+ return _userEvent["default"].click(firstBodyRowCells[0]);
1071
+ case 6:
1072
+ // The <tr> for the clicked row should now have DOM focus
1073
+ expect(rows[1]).toHaveFocus();
1074
+
1075
+ // Arrow keys should then navigate via React Aria
1076
+ _react2.fireEvent.keyDown(rows[1], {
1077
+ key: 'ArrowDown'
1078
+ });
1079
+ _react2.fireEvent.keyUp(rows[1], {
1080
+ key: 'ArrowDown'
1081
+ });
1082
+ expect(rows[2]).toHaveFocus();
1083
+ case 10:
1084
+ case "end":
1085
+ return _context24.stop();
1086
+ }
1087
+ }, _callee18);
1088
+ })));
1089
+ test('is-focused (active border) clears when focus leaves the table', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
1090
+ var onRowAction, rows, firstBodyRowCells;
1091
+ return _regeneratorRuntime().wrap(function _callee19$(_context25) {
1092
+ while (1) switch (_context25.prev = _context25.next) {
1093
+ case 0:
1094
+ onRowAction = jest.fn();
1095
+ getComponent({
1096
+ onRowAction: onRowAction
1097
+ });
1098
+ rows = _react2.screen.getAllByRole('row'); // Click a cell in the first body row to set activeRowKey
1099
+ firstBodyRowCells = rows[1].querySelectorAll('td');
1100
+ _context25.next = 6;
1101
+ return _userEvent["default"].click(firstBodyRowCells[0]);
1102
+ case 6:
1103
+ expect(rows[1]).toHaveClass('is-focused');
1104
+
1105
+ // Flush the setTimeout(0) that resets actionJustFired so the blur handler
1106
+ // can proceed normally for genuine focus-out events.
1107
+ (0, _react2.act)(function () {
1108
+ jest.runAllTimers();
1109
+ });
1110
+
1111
+ // Use focusOut (which bubbles) to reach the onBlur handler on the scroll
1112
+ // container, simulating focus leaving the table entirely.
1113
+ _react2.fireEvent.focusOut(rows[1], {
1114
+ relatedTarget: null
1115
+ });
1116
+
1117
+ // is-focused should be cleared
1118
+ expect(rows[1]).not.toHaveClass('is-focused');
1119
+ case 10:
1120
+ case "end":
1121
+ return _context25.stop();
1122
+ }
1123
+ }, _callee19);
1124
+ })));
1125
+ test('clicking an already-active row toggles activeRowKey off (clears is-focused)', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
1126
+ var onRowAction, rows, firstBodyRowCells;
1127
+ return _regeneratorRuntime().wrap(function _callee20$(_context26) {
1128
+ while (1) switch (_context26.prev = _context26.next) {
1129
+ case 0:
1130
+ onRowAction = jest.fn();
1131
+ getComponent({
1132
+ onRowAction: onRowAction
1133
+ });
1134
+ rows = _react2.screen.getAllByRole('row');
1135
+ firstBodyRowCells = rows[1].querySelectorAll('td'); // First click sets the row as active
1136
+ _context26.next = 6;
1137
+ return _userEvent["default"].click(firstBodyRowCells[0]);
1138
+ case 6:
1139
+ expect(rows[1]).toHaveClass('is-focused');
1140
+
1141
+ // Second click on the same row should toggle it off
1142
+ _context26.next = 9;
1143
+ return _userEvent["default"].click(firstBodyRowCells[0]);
1144
+ case 9:
1145
+ expect(rows[1]).not.toHaveClass('is-focused');
1146
+ case 10:
1147
+ case "end":
1148
+ return _context26.stop();
1149
+ }
1150
+ }, _callee20);
1151
+ })));
1152
+ test('active-row highlight does not clear when focus moves to an overlay panel', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
1153
+ var onRowAction, rows, firstBodyRowCells, panelButton;
1154
+ return _regeneratorRuntime().wrap(function _callee21$(_context27) {
1155
+ while (1) switch (_context27.prev = _context27.next) {
1156
+ case 0:
1157
+ onRowAction = jest.fn();
1158
+ getComponent({
1159
+ onRowAction: onRowAction
1160
+ });
1161
+ rows = _react2.screen.getAllByRole('row'); // Click the first body row — sets activeRowKey and fires onRowAction
1162
+ firstBodyRowCells = rows[1].querySelectorAll('td');
1163
+ _context27.next = 6;
1164
+ return _userEvent["default"].click(firstBodyRowCells[0]);
1165
+ case 6:
1166
+ expect(rows[1]).toHaveClass('is-focused');
1167
+
1168
+ // Simulate OverlayPanel FocusScope stealing focus to an element outside the table.
1169
+ // The actionJustFired guard (set synchronously in wrappedOnRowAction) should
1170
+ // absorb this blur and keep the active-row highlight intact.
1171
+ panelButton = document.createElement('button');
1172
+ document.body.appendChild(panelButton);
1173
+ _react2.fireEvent.focusOut(rows[1], {
1174
+ relatedTarget: panelButton
1175
+ });
1176
+
1177
+ // Highlight must survive the focus-steal
1178
+ expect(rows[1]).toHaveClass('is-focused');
1179
+ document.body.removeChild(panelButton);
1180
+ case 12:
1181
+ case "end":
1182
+ return _context27.stop();
1183
+ }
1184
+ }, _callee21);
1185
+ })));
1186
+ test('Enter key on a focused action row applies is-focused to that row', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
1187
+ var onRowAction, rows;
1188
+ return _regeneratorRuntime().wrap(function _callee22$(_context28) {
1189
+ while (1) switch (_context28.prev = _context28.next) {
1190
+ case 0:
1191
+ onRowAction = jest.fn();
1192
+ getComponent({
1193
+ selectionMode: 'none',
1194
+ onRowAction: onRowAction
1195
+ });
1196
+ rows = _react2.screen.getAllByRole('row'); // Tab to put keyboard focus on the first body row
1197
+ _context28.next = 5;
1198
+ return _userEvent["default"].tab();
1199
+ case 5:
1200
+ expect(rows[1]).toHaveFocus();
1201
+
1202
+ // Press Enter to trigger onRowAction via keyboard
1203
+ _react2.fireEvent.keyDown(rows[1], {
1204
+ key: 'Enter'
1205
+ });
1206
+ _react2.fireEvent.keyUp(rows[1], {
1207
+ key: 'Enter'
1208
+ });
1209
+ expect(onRowAction).toHaveBeenCalledWith('1');
1210
+
1211
+ // The row should carry is-focused (active-row state set from keyboard action)
1212
+ expect(rows[1]).toHaveClass('is-focused');
1213
+ case 10:
1214
+ case "end":
1215
+ return _context28.stop();
1216
+ }
1217
+ }, _callee22);
1218
+ })));
1219
+ test('active-row highlight clears when arrow keys move focus to another row', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
1220
+ var onRowAction, rows, firstBodyRowCells;
1221
+ return _regeneratorRuntime().wrap(function _callee23$(_context29) {
1222
+ while (1) switch (_context29.prev = _context29.next) {
1223
+ case 0:
1224
+ onRowAction = jest.fn();
1225
+ getComponent({
1226
+ onRowAction: onRowAction
1227
+ });
1228
+ rows = _react2.screen.getAllByRole('row'); // Click row 1 to set it as active (simulates opening a panel)
1229
+ firstBodyRowCells = rows[1].querySelectorAll('td');
1230
+ _context29.next = 6;
1231
+ return _userEvent["default"].click(firstBodyRowCells[0]);
1232
+ case 6:
1233
+ // Flush the setTimeout(0) guard so subsequent focus events are not swallowed
1234
+ (0, _react2.act)(function () {
1235
+ jest.runAllTimers();
1236
+ });
1237
+ expect(rows[1]).toHaveClass('is-focused');
1238
+
1239
+ // Simulate the panel closing by returning focus to the row
1240
+ _react2.fireEvent.focus(rows[1]);
1241
+
1242
+ // Arrow Down moves focus to row 2 — row 1 should lose is-focused
1243
+ _react2.fireEvent.keyDown(rows[1], {
1244
+ key: 'ArrowDown'
1245
+ });
1246
+ _react2.fireEvent.keyUp(rows[1], {
1247
+ key: 'ArrowDown'
1248
+ });
1249
+ _react2.fireEvent.focus(rows[2]);
1250
+ expect(rows[1]).not.toHaveClass('is-focused');
1251
+ expect(rows[2]).toHaveFocus();
1252
+ case 14:
1253
+ case "end":
1254
+ return _context29.stop();
1255
+ }
1256
+ }, _callee23);
1257
+ })));
1258
+ });
863
1259
  describe('Sortable Table with useAsyncList', function () {
864
1260
  var dataTestId = 'sortableTable';
865
1261
  var defaultTableProps = {
@@ -872,18 +1268,18 @@ describe('Sortable Table with useAsyncList', function () {
872
1268
  return _load.apply(this, arguments);
873
1269
  }
874
1270
  function _load() {
875
- _load = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
876
- return _regeneratorRuntime().wrap(function _callee20$(_context24) {
877
- while (1) switch (_context24.prev = _context24.next) {
1271
+ _load = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee32() {
1272
+ return _regeneratorRuntime().wrap(function _callee32$(_context40) {
1273
+ while (1) switch (_context40.prev = _context40.next) {
878
1274
  case 0:
879
- return _context24.abrupt("return", {
1275
+ return _context40.abrupt("return", {
880
1276
  items: objects
881
1277
  });
882
1278
  case 1:
883
1279
  case "end":
884
- return _context24.stop();
1280
+ return _context40.stop();
885
1281
  }
886
- }, _callee20);
1282
+ }, _callee32);
887
1283
  }));
888
1284
  return _load.apply(this, arguments);
889
1285
  }
@@ -891,13 +1287,13 @@ describe('Sortable Table with useAsyncList', function () {
891
1287
  return _sort.apply(this, arguments);
892
1288
  }
893
1289
  function _sort() {
894
- _sort = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee21(list) {
895
- var _context25;
896
- return _regeneratorRuntime().wrap(function _callee21$(_context26) {
897
- while (1) switch (_context26.prev = _context26.next) {
1290
+ _sort = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee33(list) {
1291
+ var _context41;
1292
+ return _regeneratorRuntime().wrap(function _callee33$(_context42) {
1293
+ while (1) switch (_context42.prev = _context42.next) {
898
1294
  case 0:
899
1295
  // eslint-disable-next-line no-param-reassign
900
- list.items = (0, _sort2["default"])(_context25 = list.items).call(_context25, function (a, b) {
1296
+ list.items = (0, _sort2["default"])(_context41 = list.items).call(_context41, function (a, b) {
901
1297
  var first = a[list.sortDescriptor.column];
902
1298
  var second = b[list.sortDescriptor.column];
903
1299
  var cmp = ((0, _parseInt2["default"])(first) || first) < ((0, _parseInt2["default"])(second) || second) // eslint-disable-line
@@ -907,17 +1303,17 @@ describe('Sortable Table with useAsyncList', function () {
907
1303
  }
908
1304
  return cmp;
909
1305
  });
910
- return _context26.abrupt("return", list);
1306
+ return _context42.abrupt("return", list);
911
1307
  case 2:
912
1308
  case "end":
913
- return _context26.stop();
1309
+ return _context42.stop();
914
1310
  }
915
- }, _callee21);
1311
+ }, _callee33);
916
1312
  }));
917
1313
  return _sort.apply(this, arguments);
918
1314
  }
919
- var sortableDataTable = function sortableDataTable(_ref12) {
920
- var result = _ref12.result;
1315
+ var sortableDataTable = function sortableDataTable(_ref24) {
1316
+ var result = _ref24.result;
921
1317
  return (0, _react2.render)((0, _react3.jsx)(_TableBase["default"], (0, _extends2["default"])({}, defaultTableProps, {
922
1318
  sortDescriptor: result.current.sortDescriptor
923
1319
  }), (0, _react3.jsx)(_index.THead, {
@@ -934,10 +1330,10 @@ describe('Sortable Table with useAsyncList', function () {
934
1330
  });
935
1331
  })));
936
1332
  };
937
- test('sort by country column A => Z', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
1333
+ test('sort by country column A => Z', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee27() {
938
1334
  var _renderHook, result, sortableTable, rowgroups, thead, headerCells, tRows;
939
- return _regeneratorRuntime().wrap(function _callee15$(_context18) {
940
- while (1) switch (_context18.prev = _context18.next) {
1335
+ return _regeneratorRuntime().wrap(function _callee27$(_context34) {
1336
+ while (1) switch (_context34.prev = _context34.next) {
941
1337
  case 0:
942
1338
  _renderHook = (0, _react2.renderHook)(function () {
943
1339
  return (0, _reactStately.useAsyncList)({
@@ -949,47 +1345,47 @@ describe('Sortable Table with useAsyncList', function () {
949
1345
  }
950
1346
  });
951
1347
  }), result = _renderHook.result;
952
- _context18.next = 3;
953
- return (0, _react2.act)(/*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
954
- return _regeneratorRuntime().wrap(function _callee12$(_context14) {
955
- while (1) switch (_context14.prev = _context14.next) {
1348
+ _context34.next = 3;
1349
+ return (0, _react2.act)(/*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
1350
+ return _regeneratorRuntime().wrap(function _callee24$(_context30) {
1351
+ while (1) switch (_context30.prev = _context30.next) {
956
1352
  case 0:
957
1353
  jest.runOnlyPendingTimers();
958
1354
  case 1:
959
1355
  case "end":
960
- return _context14.stop();
1356
+ return _context30.stop();
961
1357
  }
962
- }, _callee12);
1358
+ }, _callee24);
963
1359
  })));
964
1360
  case 3:
965
- _context18.next = 5;
966
- return (0, _react2.act)(/*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
967
- var _context15;
968
- return _regeneratorRuntime().wrap(function _callee13$(_context16) {
969
- while (1) switch (_context16.prev = _context16.next) {
1361
+ _context34.next = 5;
1362
+ return (0, _react2.act)(/*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
1363
+ var _context31;
1364
+ return _regeneratorRuntime().wrap(function _callee25$(_context32) {
1365
+ while (1) switch (_context32.prev = _context32.next) {
970
1366
  case 0:
971
- (0, _sort2["default"])(_context15 = result.current).call(_context15, {
1367
+ (0, _sort2["default"])(_context31 = result.current).call(_context31, {
972
1368
  column: 'country',
973
1369
  direction: 'ascending'
974
1370
  });
975
1371
  case 1:
976
1372
  case "end":
977
- return _context16.stop();
1373
+ return _context32.stop();
978
1374
  }
979
- }, _callee13);
1375
+ }, _callee25);
980
1376
  })));
981
1377
  case 5:
982
- _context18.next = 7;
983
- return (0, _react2.act)(/*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
984
- return _regeneratorRuntime().wrap(function _callee14$(_context17) {
985
- while (1) switch (_context17.prev = _context17.next) {
1378
+ _context34.next = 7;
1379
+ return (0, _react2.act)(/*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
1380
+ return _regeneratorRuntime().wrap(function _callee26$(_context33) {
1381
+ while (1) switch (_context33.prev = _context33.next) {
986
1382
  case 0:
987
1383
  jest.runOnlyPendingTimers();
988
1384
  case 1:
989
1385
  case "end":
990
- return _context17.stop();
1386
+ return _context33.stop();
991
1387
  }
992
- }, _callee14);
1388
+ }, _callee26);
993
1389
  })));
994
1390
  case 7:
995
1391
  sortableDataTable({
@@ -1017,14 +1413,14 @@ describe('Sortable Table with useAsyncList', function () {
1017
1413
  expect(tRows[3]).toHaveTextContent('USA');
1018
1414
  case 28:
1019
1415
  case "end":
1020
- return _context18.stop();
1416
+ return _context34.stop();
1021
1417
  }
1022
- }, _callee15);
1418
+ }, _callee27);
1023
1419
  })));
1024
- test('sort by country column Z => A', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
1420
+ test('sort by country column Z => A', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee31() {
1025
1421
  var _renderHook2, result, sortableTable, rowgroups, tRows;
1026
- return _regeneratorRuntime().wrap(function _callee19$(_context23) {
1027
- while (1) switch (_context23.prev = _context23.next) {
1422
+ return _regeneratorRuntime().wrap(function _callee31$(_context39) {
1423
+ while (1) switch (_context39.prev = _context39.next) {
1028
1424
  case 0:
1029
1425
  _renderHook2 = (0, _react2.renderHook)(function () {
1030
1426
  return (0, _reactStately.useAsyncList)({
@@ -1036,47 +1432,47 @@ describe('Sortable Table with useAsyncList', function () {
1036
1432
  }
1037
1433
  });
1038
1434
  }), result = _renderHook2.result;
1039
- _context23.next = 3;
1040
- return (0, _react2.act)(/*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
1041
- return _regeneratorRuntime().wrap(function _callee16$(_context19) {
1042
- while (1) switch (_context19.prev = _context19.next) {
1435
+ _context39.next = 3;
1436
+ return (0, _react2.act)(/*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee28() {
1437
+ return _regeneratorRuntime().wrap(function _callee28$(_context35) {
1438
+ while (1) switch (_context35.prev = _context35.next) {
1043
1439
  case 0:
1044
1440
  jest.runOnlyPendingTimers();
1045
1441
  case 1:
1046
1442
  case "end":
1047
- return _context19.stop();
1443
+ return _context35.stop();
1048
1444
  }
1049
- }, _callee16);
1445
+ }, _callee28);
1050
1446
  })));
1051
1447
  case 3:
1052
- _context23.next = 5;
1053
- return (0, _react2.act)(/*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
1054
- var _context20;
1055
- return _regeneratorRuntime().wrap(function _callee17$(_context21) {
1056
- while (1) switch (_context21.prev = _context21.next) {
1448
+ _context39.next = 5;
1449
+ return (0, _react2.act)(/*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
1450
+ var _context36;
1451
+ return _regeneratorRuntime().wrap(function _callee29$(_context37) {
1452
+ while (1) switch (_context37.prev = _context37.next) {
1057
1453
  case 0:
1058
- (0, _sort2["default"])(_context20 = result.current).call(_context20, {
1454
+ (0, _sort2["default"])(_context36 = result.current).call(_context36, {
1059
1455
  column: 'country',
1060
1456
  direction: 'descending'
1061
1457
  });
1062
1458
  case 1:
1063
1459
  case "end":
1064
- return _context21.stop();
1460
+ return _context37.stop();
1065
1461
  }
1066
- }, _callee17);
1462
+ }, _callee29);
1067
1463
  })));
1068
1464
  case 5:
1069
- _context23.next = 7;
1070
- return (0, _react2.act)(/*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
1071
- return _regeneratorRuntime().wrap(function _callee18$(_context22) {
1072
- while (1) switch (_context22.prev = _context22.next) {
1465
+ _context39.next = 7;
1466
+ return (0, _react2.act)(/*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
1467
+ return _regeneratorRuntime().wrap(function _callee30$(_context38) {
1468
+ while (1) switch (_context38.prev = _context38.next) {
1073
1469
  case 0:
1074
1470
  jest.runOnlyPendingTimers();
1075
1471
  case 1:
1076
1472
  case "end":
1077
- return _context22.stop();
1473
+ return _context38.stop();
1078
1474
  }
1079
- }, _callee18);
1475
+ }, _callee30);
1080
1476
  })));
1081
1477
  case 7:
1082
1478
  sortableDataTable({
@@ -1100,8 +1496,8 @@ describe('Sortable Table with useAsyncList', function () {
1100
1496
  expect(tRows[3]).toHaveTextContent('Canada');
1101
1497
  case 24:
1102
1498
  case "end":
1103
- return _context23.stop();
1499
+ return _context39.stop();
1104
1500
  }
1105
- }, _callee19);
1501
+ }, _callee31);
1106
1502
  })));
1107
1503
  });
@@ -30,4 +30,5 @@ export declare const tableBaseArgTypes: {
30
30
  };
31
31
  onSortChange: any;
32
32
  onSelectionChange: any;
33
+ onRowAction: any;
33
34
  };
@@ -58,5 +58,8 @@ var tableBaseArgTypes = exports.tableBaseArgTypes = {
58
58
  }),
59
59
  onSelectionChange: _objectSpread(_objectSpread({}, _docArgTypes.funcArg), {}, {
60
60
  description: 'Callback invoked when the selection state changes.'
61
+ }),
62
+ onRowAction: _objectSpread(_objectSpread({}, _docArgTypes.funcArg), {}, {
63
+ description: 'Callback fired when a row is pressed (pointer or Enter key), receiving the key of the pressed row.'
61
64
  })
62
65
  };