grommet 2.48.0 → 2.50.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.
Files changed (157) hide show
  1. package/components/AccordionPanel/AccordionPanel.js +3 -6
  2. package/components/Anchor/StyledAnchor.js +1 -1
  3. package/components/Box/StyledBox.js +1 -1
  4. package/components/Button/BusyAnimation.js +5 -1
  5. package/components/Button/Button.js +3 -1
  6. package/components/Calendar/Calendar.js +7 -10
  7. package/components/Cards/Cards.js +3 -4
  8. package/components/Chart/Chart.js +11 -9
  9. package/components/Chart/calcs.js +21 -13
  10. package/components/CheckBox/CheckBox.js +1 -1
  11. package/components/CheckBoxGroup/CheckBoxGroup.js +2 -3
  12. package/components/Data/Data.js +5 -1
  13. package/components/Data/DataForm.js +6 -4
  14. package/components/Data/stories/Infinite.stories.js +10 -15
  15. package/components/Data/stories/OnSelect.stories.js +10 -15
  16. package/components/Data/stories/SpaceX.stories.js +10 -15
  17. package/components/Data/stories/StarWars.stories.js +6 -8
  18. package/components/DataChart/DataChart.js +14 -12
  19. package/components/DataChart/Detail.js +2 -2
  20. package/components/DataChart/Legend.js +8 -9
  21. package/components/DataChart/utils.js +15 -8
  22. package/components/DataFilter/DataFilter.js +10 -9
  23. package/components/DataFilters/DataFilters.js +9 -10
  24. package/components/DataSearch/DataSearch.js +5 -4
  25. package/components/DataSort/DataSort.js +4 -3
  26. package/components/DataSummary/DataSummary.js +6 -6
  27. package/components/DataTable/ExpanderCell.js +6 -3
  28. package/components/DataTable/Footer.js +6 -3
  29. package/components/DataTable/Header.js +6 -3
  30. package/components/DataTable/Resizer.js +22 -8
  31. package/components/DataTable/Searcher.js +5 -7
  32. package/components/DataTable/stories/ResizePinned.stories.js +321 -0
  33. package/components/DataTable/stories/SpaceX.stories.js +15 -16
  34. package/components/DataTable/stories/SpaceXUngrouped.stories.js +7 -7
  35. package/components/DataTable/stories/rowDetails.stories.js +6 -8
  36. package/components/DataTableColumns/DataTableColumns.js +24 -22
  37. package/components/DateInput/DateInput.js +7 -6
  38. package/components/Distribution/Distribution.js +8 -5
  39. package/components/FileInput/FileInput.js +41 -36
  40. package/components/Footer/Footer.js +5 -1
  41. package/components/Header/Header.js +2 -2
  42. package/components/Layer/Layer.js +10 -5
  43. package/components/Layer/StyledLayer.js +2 -2
  44. package/components/List/List.js +5 -4
  45. package/components/MaskedInput/MaskedInput.js +6 -1
  46. package/components/Menu/Menu.js +13 -1
  47. package/components/Meter/Bar.js +38 -17
  48. package/components/Meter/Circle.js +31 -46
  49. package/components/Meter/stories/Circle.stories.js +6 -8
  50. package/components/Meter/utils.js +15 -1
  51. package/components/Nav/Nav.js +5 -1
  52. package/components/Notification/Notification.js +6 -8
  53. package/components/Pagination/Pagination.js +5 -10
  54. package/components/Pagination/PaginationStep.js +2 -1
  55. package/components/Paragraph/ParagraphSkeleton.js +2 -1
  56. package/components/RadioButton/RadioButton.js +1 -1
  57. package/components/RadioButtonGroup/RadioButtonGroup.js +2 -2
  58. package/components/RangeSelector/RangeSelector.js +2 -6
  59. package/components/Select/SelectContainer.js +2 -1
  60. package/components/SelectMultiple/SelectMultipleContainer.js +8 -4
  61. package/components/SelectMultiple/SelectMultipleValue.js +5 -7
  62. package/components/SelectMultiple/SelectionSummary.js +7 -8
  63. package/components/Sidebar/Sidebar.js +6 -3
  64. package/components/Spinner/Spinner.js +7 -4
  65. package/components/StarRating/StarRating.js +8 -5
  66. package/components/Tab/Tab.js +2 -1
  67. package/components/Table/StyledTable.js +2 -2
  68. package/components/Tabs/Tabs.js +8 -12
  69. package/components/Tag/StyledTag.js +9 -1
  70. package/components/TextInput/CopyButton.js +3 -2
  71. package/components/TextInput/TextInput.js +5 -0
  72. package/components/ThumbsRating/ThumbsRating.js +15 -10
  73. package/components/Toolbar/Toolbar.js +15 -11
  74. package/components/Video/Video.js +3 -5
  75. package/es6/components/AccordionPanel/AccordionPanel.js +3 -6
  76. package/es6/components/Anchor/StyledAnchor.js +2 -2
  77. package/es6/components/Box/StyledBox.js +1 -1
  78. package/es6/components/Button/BusyAnimation.js +5 -1
  79. package/es6/components/Button/Button.js +3 -1
  80. package/es6/components/Calendar/Calendar.js +7 -10
  81. package/es6/components/Cards/Cards.js +3 -4
  82. package/es6/components/Chart/Chart.js +11 -9
  83. package/es6/components/Chart/calcs.js +21 -13
  84. package/es6/components/CheckBox/CheckBox.js +1 -1
  85. package/es6/components/CheckBoxGroup/CheckBoxGroup.js +2 -3
  86. package/es6/components/Data/Data.js +5 -1
  87. package/es6/components/Data/DataForm.js +6 -4
  88. package/es6/components/Data/stories/Infinite.stories.js +10 -15
  89. package/es6/components/Data/stories/OnSelect.stories.js +10 -15
  90. package/es6/components/Data/stories/SpaceX.stories.js +10 -15
  91. package/es6/components/Data/stories/StarWars.stories.js +6 -8
  92. package/es6/components/DataChart/DataChart.js +14 -12
  93. package/es6/components/DataChart/Detail.js +2 -2
  94. package/es6/components/DataChart/Legend.js +8 -9
  95. package/es6/components/DataChart/utils.js +15 -8
  96. package/es6/components/DataFilter/DataFilter.js +10 -9
  97. package/es6/components/DataFilters/DataFilters.js +9 -10
  98. package/es6/components/DataSearch/DataSearch.js +5 -4
  99. package/es6/components/DataSort/DataSort.js +4 -3
  100. package/es6/components/DataSummary/DataSummary.js +6 -6
  101. package/es6/components/DataTable/ExpanderCell.js +4 -1
  102. package/es6/components/DataTable/Footer.js +4 -1
  103. package/es6/components/DataTable/Header.js +6 -3
  104. package/es6/components/DataTable/Resizer.js +22 -8
  105. package/es6/components/DataTable/Searcher.js +5 -7
  106. package/es6/components/DataTable/stories/ResizePinned.stories.js +316 -0
  107. package/es6/components/DataTable/stories/SpaceX.stories.js +15 -16
  108. package/es6/components/DataTable/stories/SpaceXUngrouped.stories.js +7 -7
  109. package/es6/components/DataTable/stories/rowDetails.stories.js +6 -8
  110. package/es6/components/DataTableColumns/DataTableColumns.js +23 -21
  111. package/es6/components/DateInput/DateInput.js +6 -5
  112. package/es6/components/Distribution/Distribution.js +8 -5
  113. package/es6/components/FileInput/FileInput.js +42 -37
  114. package/es6/components/Footer/Footer.js +5 -1
  115. package/es6/components/Header/Header.js +2 -2
  116. package/es6/components/Layer/Layer.js +10 -5
  117. package/es6/components/Layer/StyledLayer.js +3 -3
  118. package/es6/components/List/List.js +5 -4
  119. package/es6/components/MaskedInput/MaskedInput.js +6 -1
  120. package/es6/components/Menu/Menu.js +13 -1
  121. package/es6/components/Meter/Bar.js +39 -18
  122. package/es6/components/Meter/Circle.js +33 -48
  123. package/es6/components/Meter/stories/Circle.stories.js +7 -9
  124. package/es6/components/Meter/utils.js +14 -0
  125. package/es6/components/Nav/Nav.js +5 -1
  126. package/es6/components/Notification/Notification.js +6 -8
  127. package/es6/components/Pagination/Pagination.js +5 -10
  128. package/es6/components/Pagination/PaginationStep.js +2 -1
  129. package/es6/components/Paragraph/ParagraphSkeleton.js +2 -1
  130. package/es6/components/RadioButton/RadioButton.js +1 -1
  131. package/es6/components/RadioButtonGroup/RadioButtonGroup.js +2 -2
  132. package/es6/components/RangeSelector/RangeSelector.js +2 -6
  133. package/es6/components/Select/SelectContainer.js +2 -1
  134. package/es6/components/SelectMultiple/SelectMultipleContainer.js +8 -4
  135. package/es6/components/SelectMultiple/SelectMultipleValue.js +5 -7
  136. package/es6/components/SelectMultiple/SelectionSummary.js +7 -8
  137. package/es6/components/Sidebar/Sidebar.js +6 -3
  138. package/es6/components/Spinner/Spinner.js +6 -3
  139. package/es6/components/StarRating/StarRating.js +8 -5
  140. package/es6/components/Tab/Tab.js +2 -1
  141. package/es6/components/Table/StyledTable.js +2 -2
  142. package/es6/components/Tabs/Tabs.js +8 -12
  143. package/es6/components/Tag/StyledTag.js +10 -2
  144. package/es6/components/TextInput/CopyButton.js +3 -2
  145. package/es6/components/TextInput/TextInput.js +5 -0
  146. package/es6/components/ThumbsRating/ThumbsRating.js +15 -10
  147. package/es6/components/Toolbar/Toolbar.js +15 -11
  148. package/es6/components/Video/Video.js +3 -5
  149. package/es6/themes/base.d.ts +284 -4
  150. package/es6/themes/base.js +369 -21
  151. package/es6/utils/graphics.js +123 -0
  152. package/grommet.min.js +1 -1
  153. package/grommet.min.js.map +1 -1
  154. package/package.json +46 -46
  155. package/themes/base.d.ts +284 -4
  156. package/themes/base.js +369 -21
  157. package/utils/graphics.js +124 -1
@@ -0,0 +1,316 @@
1
+ import React from 'react';
2
+ import { Box, DataTable, Heading, Text } from 'grommet';
3
+ var data = [{
4
+ id: 'b0:2a:43:52:48:c5',
5
+ macAddress: 'b0:2a:43:52:48:c5',
6
+ ipAddress: '192.168.0.20',
7
+ hostname: 'wh7-dureal50',
8
+ connectionType: 'Wireless',
9
+ category: 'Network',
10
+ status: 'Active',
11
+ deviceName: 'Chromecast',
12
+ networkBand: {
13
+ value: 2.4,
14
+ unit: 'GHz'
15
+ },
16
+ linkRate: {
17
+ value: 72,
18
+ unit: 'Mbps'
19
+ }
20
+ }, {
21
+ id: '00:d0:2d:32:b6:cd',
22
+ macAddress: '00:d0:2d:32:b6:cd',
23
+ ipAddress: '192.168.0.24',
24
+ hostname: 'wh7-dureal50',
25
+ connectionType: 'Wireless',
26
+ category: 'Network',
27
+ status: 'Active',
28
+ deviceName: 'Gateway32B6CD',
29
+ networkBand: {
30
+ value: 2.4,
31
+ unit: 'GHz'
32
+ },
33
+ linkRate: {
34
+ value: 72,
35
+ unit: 'Mbps'
36
+ }
37
+ }, {
38
+ id: 'd8:6c:63:46:13:03',
39
+ macAddress: 'd8:6c:63:46:13:03',
40
+ ipAddress: '192.168.0.19',
41
+ hostname: 'wh7-dureal50',
42
+ connectionType: 'Wireless',
43
+ category: 'Network',
44
+ status: 'Active',
45
+ deviceName: 'Amazon-Firestick',
46
+ networkBand: {
47
+ value: 2.4,
48
+ unit: 'GHz'
49
+ },
50
+ linkRate: {
51
+ value: 72,
52
+ unit: 'Mbps'
53
+ }
54
+ }, {
55
+ id: 'f4:f5:d8:c0:e2:9c',
56
+ macAddress: 'f4:f5:d8:c0:e2:9c',
57
+ ipAddress: '192.168.0.21',
58
+ hostname: 'wh7-dureal50',
59
+ connectionType: 'Wireless',
60
+ category: 'Network',
61
+ status: 'Active',
62
+ deviceName: 'Google-Home',
63
+ networkBand: {
64
+ value: 2.4,
65
+ unit: 'GHz'
66
+ },
67
+ linkRate: {
68
+ value: 72,
69
+ unit: 'Mbps'
70
+ }
71
+ }, {
72
+ id: '38:f9:d3:b7:09:4e',
73
+ macAddress: '38:f9:d3:b7:09:4e',
74
+ ipAddress: '192.168.0.21',
75
+ hostname: 'wh7-dureal50',
76
+ connectionType: 'Wireless',
77
+ category: 'Network',
78
+ status: 'Active',
79
+ deviceName: 'Daras-MBP',
80
+ networkBand: {
81
+ value: 5,
82
+ unit: 'GHz'
83
+ },
84
+ linkRate: {
85
+ value: 702,
86
+ unit: 'Mbps'
87
+ }
88
+ }, {
89
+ id: '10:40:f3:85:67:44',
90
+ macAddress: '10:40:f3:85:67:44',
91
+ ipAddress: '192.168.0.13',
92
+ hostname: 'wh7-dureal50',
93
+ connectionType: 'Wireless',
94
+ category: 'Network',
95
+ status: 'Active',
96
+ deviceName: 'Daras-Air',
97
+ networkBand: {
98
+ value: 2.4,
99
+ unit: 'GHz'
100
+ },
101
+ linkRate: {
102
+ value: 78,
103
+ unit: 'Mbps'
104
+ }
105
+ }, {
106
+ id: 'a4:f1:e8:27:e7:1c',
107
+ macAddress: 'a4:f1:e8:27:e7:1c',
108
+ ipAddress: '192.168.0.11',
109
+ hostname: 'wh7-dureal50',
110
+ connectionType: 'Wireless',
111
+ category: 'Network',
112
+ status: 'Active',
113
+ deviceName: 'iPhone',
114
+ networkBand: {
115
+ value: 2.4,
116
+ unit: 'GHz'
117
+ },
118
+ linkRate: {
119
+ value: 24,
120
+ unit: 'Mbps'
121
+ }
122
+ }, {
123
+ id: '10:e7:c6:cb:f8:58',
124
+ macAddress: '10:e7:c6:cb:f8:58',
125
+ ipAddress: '192.168.0.22',
126
+ hostname: 'wh7-dureal50',
127
+ connectionType: 'Wireless',
128
+ category: 'Network',
129
+ status: 'Active',
130
+ deviceName: 'HPCBF857',
131
+ networkBand: {
132
+ value: 2.4,
133
+ unit: 'GHz'
134
+ },
135
+ linkRate: {
136
+ value: 24,
137
+ unit: 'Mbps'
138
+ }
139
+ }, {
140
+ id: '44:07:0b:ba:1e:eb',
141
+ macAddress: '44:07:0b:ba:1e:eb',
142
+ ipAddress: '192.168.0.18',
143
+ hostname: 'wh7-dureal50',
144
+ connectionType: 'Wireless',
145
+ category: 'Network',
146
+ status: 'Active',
147
+ deviceName: 'Google-Home-Mini',
148
+ networkBand: {
149
+ value: 2.4,
150
+ unit: 'GHz'
151
+ },
152
+ linkRate: {
153
+ value: 72,
154
+ unit: 'Mbps'
155
+ }
156
+ }, {
157
+ id: '00:f6:20:60:15:d0',
158
+ macAddress: '00:f6:20:60:15:d0',
159
+ ipAddress: '192.168.0.17',
160
+ hostname: 'wh7-dureal50',
161
+ connectionType: 'Wireless',
162
+ category: 'Network',
163
+ status: 'Active',
164
+ deviceName: 'Amazon-Alexa',
165
+ networkBand: {
166
+ value: 2.4,
167
+ unit: 'GHz'
168
+ },
169
+ linkRate: {
170
+ value: 72,
171
+ unit: 'Mbps'
172
+ }
173
+ }, {
174
+ id: '30:fd:38:88:49:f4',
175
+ macAddress: '30:fd:38:88:49:f4',
176
+ ipAddress: '192.168.0.16',
177
+ hostname: 'wh7-dureal50',
178
+ connectionType: 'Wireless',
179
+ category: 'Network',
180
+ status: 'Active',
181
+ deviceName: 'Google-Home-Mini',
182
+ networkBand: {
183
+ value: 2.4,
184
+ unit: 'GHz'
185
+ },
186
+ linkRate: {
187
+ value: 292,
188
+ unit: 'Mbps'
189
+ }
190
+ }, {
191
+ id: '7c:b0:c2:5c:94:a5',
192
+ macAddress: '7c:b0:c2:5c:94:a5',
193
+ ipAddress: '192.168.0.26',
194
+ hostname: 'wh7-dureal50',
195
+ connectionType: 'Wireless',
196
+ category: 'Network',
197
+ status: 'Active',
198
+ deviceName: 'N/A',
199
+ networkBand: {
200
+ value: 2.4,
201
+ unit: 'GHz'
202
+ },
203
+ linkRate: {
204
+ value: 6,
205
+ unit: 'Mbps'
206
+ }
207
+ }, {
208
+ id: 'E0:5F:45:96:F4:DD',
209
+ macAddress: 'E0:5F:45:96:F4:DD',
210
+ ipAddress: '192.168.0.25',
211
+ hostname: 'wh7-dureal50',
212
+ connectionType: 'Wireless',
213
+ category: 'Network',
214
+ status: 'Active',
215
+ deviceName: 'N/A',
216
+ networkBand: {
217
+ value: 2.4,
218
+ unit: 'GHz'
219
+ },
220
+ linkRate: {
221
+ value: 1,
222
+ unit: 'Mbps'
223
+ }
224
+ }];
225
+ var columns = [{
226
+ primary: true,
227
+ property: 'macAddress',
228
+ header: 'MAC address',
229
+ render: function render(datum) {
230
+ return datum.macAddress;
231
+ },
232
+ pin: true
233
+ }, {
234
+ property: 'ipAddress',
235
+ header: 'IP V4',
236
+ render: function render(datum) {
237
+ return /*#__PURE__*/React.createElement(Text, {
238
+ truncate: "tip"
239
+ }, datum.ipAddress);
240
+ },
241
+ size: 'xsmall',
242
+ align: 'end'
243
+ }, {
244
+ property: 'hostname',
245
+ header: 'Hostname',
246
+ render: function render(datum) {
247
+ return /*#__PURE__*/React.createElement(Text, {
248
+ truncate: "tip"
249
+ }, datum.hostname);
250
+ },
251
+ size: 'xsmall'
252
+ }, {
253
+ property: 'connectionType',
254
+ header: 'Connection type'
255
+ }, {
256
+ property: 'category',
257
+ header: 'Category'
258
+ }, {
259
+ property: 'deviceName',
260
+ header: 'Device name',
261
+ render: function render(datum) {
262
+ return /*#__PURE__*/React.createElement(Text, {
263
+ truncate: "tip"
264
+ }, datum.deviceName);
265
+ },
266
+ size: 'xsmall'
267
+ }, {
268
+ property: 'status',
269
+ header: 'Status'
270
+ }, {
271
+ property: 'networkBand.value',
272
+ header: 'Network band',
273
+ units: 'GHz',
274
+ render: function render(datum) {
275
+ return datum.networkBand.value;
276
+ },
277
+ align: 'end'
278
+ }, {
279
+ property: 'linkRate.value',
280
+ header: 'Link rate',
281
+ units: 'Mbps',
282
+ render: function render(datum) {
283
+ return datum.linkRate.value;
284
+ },
285
+ align: 'end'
286
+ }];
287
+ export var ResizablePinnedDataTable = function ResizablePinnedDataTable() {
288
+ return /*#__PURE__*/React.createElement(Box, {
289
+ align: "center",
290
+ pad: "large"
291
+ }, /*#__PURE__*/React.createElement(Heading, {
292
+ level: "3"
293
+ }, "Table with resizable & column sizes"), /*#__PURE__*/React.createElement(Box, {
294
+ align: "start",
295
+ height: "medium"
296
+ // restricting width to demonstrate pinned column behavior
297
+ ,
298
+ width: {
299
+ width: 'xxlarge',
300
+ max: '100%'
301
+ },
302
+ overflow: "auto"
303
+ }, /*#__PURE__*/React.createElement(DataTable, {
304
+ "aria-describedby": "connected-heading",
305
+ data: data,
306
+ columns: columns,
307
+ pin: true,
308
+ resizeable: true
309
+ })))
310
+ // </Grommet>
311
+ ;
312
+ };
313
+ ResizablePinnedDataTable.storyName = 'Resizable pinned columns';
314
+ export default {
315
+ title: 'Visualizations/DataTable/Resizable pinned columns'
316
+ };
@@ -1,4 +1,5 @@
1
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return r; }; var t, r = {}, e = Object.prototype, n = e.hasOwnProperty, o = "function" == typeof Symbol ? Symbol : {}, i = o.iterator || "@@iterator", a = o.asyncIterator || "@@asyncIterator", u = o.toStringTag || "@@toStringTag"; function c(t, r, e, n) { return Object.defineProperty(t, r, { value: e, enumerable: !n, configurable: !n, writable: !n }); } try { c({}, ""); } catch (t) { c = function c(t, r, e) { return t[r] = e; }; } function h(r, e, n, o) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype); return c(a, "_invoke", function (r, e, n) { var o = 1; return function (i, a) { if (3 === o) throw Error("Generator is already running"); if (4 === o) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var u = n.delegate; if (u) { var c = d(u, n); if (c) { if (c === f) continue; return c; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (1 === o) throw o = 4, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = 3; var h = s(r, e, n); if ("normal" === h.type) { if (o = n.done ? 4 : 2, h.arg === f) continue; return { value: h.arg, done: n.done }; } "throw" === h.type && (o = 4, n.method = "throw", n.arg = h.arg); } }; }(r, n, new Context(o || [])), !0), a; } function s(t, r, e) { try { return { type: "normal", arg: t.call(r, e) }; } catch (t) { return { type: "throw", arg: t }; } } r.wrap = h; var f = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var l = {}; c(l, i, function () { return this; }); var p = Object.getPrototypeOf, y = p && p(p(x([]))); y && y !== e && n.call(y, i) && (l = y); var v = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(l); function g(t) { ["next", "throw", "return"].forEach(function (r) { c(t, r, function (t) { return this._invoke(r, t); }); }); } function AsyncIterator(t, r) { function e(o, i, a, u) { var c = s(t[o], t, i); if ("throw" !== c.type) { var h = c.arg, f = h.value; return f && "object" == typeof f && n.call(f, "__await") ? r.resolve(f.__await).then(function (t) { e("next", t, a, u); }, function (t) { e("throw", t, a, u); }) : r.resolve(f).then(function (t) { h.value = t, a(h); }, function (t) { return e("throw", t, a, u); }); } u(c.arg); } var o; c(this, "_invoke", function (t, n) { function i() { return new r(function (r, o) { e(t, n, r, o); }); } return o = o ? o.then(i, i) : i(); }, !0); } function d(r, e) { var n = e.method, o = r.i[n]; if (o === t) return e.delegate = null, "throw" === n && r.i["return"] && (e.method = "return", e.arg = t, d(r, e), "throw" === e.method) || "return" !== n && (e.method = "throw", e.arg = new TypeError("The iterator does not provide a '" + n + "' method")), f; var i = s(o, r.i, e.arg); if ("throw" === i.type) return e.method = "throw", e.arg = i.arg, e.delegate = null, f; var a = i.arg; return a ? a.done ? (e[r.r] = a.value, e.next = r.n, "return" !== e.method && (e.method = "next", e.arg = t), e.delegate = null, f) : a : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, f); } function w(t) { this.tryEntries.push(t); } function m(r) { var e = r[4] || {}; e.type = "normal", e.arg = t, r[4] = e; } function Context(t) { this.tryEntries = [[-1]], t.forEach(w, this), this.reset(!0); } function x(r) { if (null != r) { var e = r[i]; if (e) return e.call(r); if ("function" == typeof r.next) return r; if (!isNaN(r.length)) { var o = -1, a = function e() { for (; ++o < r.length;) if (n.call(r, o)) return e.value = r[o], e.done = !1, e; return e.value = t, e.done = !0, e; }; return a.next = a; } } throw new TypeError(typeof r + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, c(v, "constructor", GeneratorFunctionPrototype), c(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = c(GeneratorFunctionPrototype, u, "GeneratorFunction"), r.isGeneratorFunction = function (t) { var r = "function" == typeof t && t.constructor; return !!r && (r === GeneratorFunction || "GeneratorFunction" === (r.displayName || r.name)); }, r.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, c(t, u, "GeneratorFunction")), t.prototype = Object.create(v), t; }, r.awrap = function (t) { return { __await: t }; }, g(AsyncIterator.prototype), c(AsyncIterator.prototype, a, function () { return this; }), r.AsyncIterator = AsyncIterator, r.async = function (t, e, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(h(t, e, n, o), i); return r.isGeneratorFunction(e) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, g(v), c(v, u, "Generator"), c(v, i, function () { return this; }), c(v, "toString", function () { return "[object Generator]"; }), r.keys = function (t) { var r = Object(t), e = []; for (var n in r) e.unshift(n); return function t() { for (; e.length;) if ((n = e.pop()) in r) return t.value = n, t.done = !1, t; return t.done = !0, t; }; }, r.values = x, Context.prototype = { constructor: Context, reset: function reset(r) { if (this.prev = this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(m), !r) for (var e in this) "t" === e.charAt(0) && n.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0][4]; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(r) { if (this.done) throw r; var e = this; function n(t) { a.type = "throw", a.arg = r, e.next = t; } for (var o = e.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i[4], u = this.prev, c = i[1], h = i[2]; if (-1 === i[0]) return n("end"), !1; if (!c && !h) throw Error("try statement without catch or finally"); if (null != i[0] && i[0] <= u) { if (u < c) return this.method = "next", this.arg = t, n(c), !0; if (u < h) return n(h), !1; } } }, abrupt: function abrupt(t, r) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var n = this.tryEntries[e]; if (n[0] > -1 && n[0] <= this.prev && this.prev < n[2]) { var o = n; break; } } o && ("break" === t || "continue" === t) && o[0] <= r && r <= o[2] && (o = null); var i = o ? o[4] : {}; return i.type = t, i.arg = r, o ? (this.method = "next", this.next = o[2], f) : this.complete(i); }, complete: function complete(t, r) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && r && (this.next = r), f; }, finish: function finish(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[2] === t) return this.complete(e[4], e[3]), m(e), f; } }, "catch": function _catch(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[0] === t) { var n = e[4]; if ("throw" === n.type) { var o = n.arg; m(e); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(r, e, n) { return this.delegate = { i: x(r), r: e, n: n }, "next" === this.method && (this.arg = t), f; } }, r; }
1
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
2
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
2
3
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
3
4
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
4
5
  import React, { useEffect, useMemo, useState } from 'react';
@@ -120,10 +121,10 @@ export var SpaceX = function SpaceX() {
120
121
  };
121
122
  useEffect(function () {
122
123
  var fetchData = /*#__PURE__*/function () {
123
- var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
124
+ var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
124
125
  var query;
125
- return _regeneratorRuntime().wrap(function _callee$(_context) {
126
- while (1) switch (_context.prev = _context.next) {
126
+ return _regenerator().w(function (_context) {
127
+ while (1) switch (_context.n) {
127
128
  case 0:
128
129
  query = {
129
130
  options: {
@@ -143,9 +144,8 @@ export var SpaceX = function SpaceX() {
143
144
  })["catch"](function (error) {
144
145
  return console.error('Unable to get groups:', error);
145
146
  });
146
- case 2:
147
- case "end":
148
- return _context.stop();
147
+ case 1:
148
+ return _context.a(2);
149
149
  }
150
150
  }, _callee);
151
151
  }));
@@ -157,14 +157,14 @@ export var SpaceX = function SpaceX() {
157
157
  }, []);
158
158
  useEffect(function () {
159
159
  var fetchData = /*#__PURE__*/function () {
160
- var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
160
+ var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
161
161
  var _sort;
162
162
  var query;
163
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
164
- while (1) switch (_context2.prev = _context2.next) {
163
+ return _regenerator().w(function (_context2) {
164
+ while (1) switch (_context2.n) {
165
165
  case 0:
166
166
  if (!(groups.length === 0 || expanded.length === 0)) {
167
- _context2.next = 3;
167
+ _context2.n = 1;
168
168
  break;
169
169
  }
170
170
  setData(processData({
@@ -172,8 +172,8 @@ export var SpaceX = function SpaceX() {
172
172
  show: 0,
173
173
  count: limit
174
174
  }, groups, []));
175
- return _context2.abrupt("return");
176
- case 3:
175
+ return _context2.a(2);
176
+ case 1:
177
177
  query = {
178
178
  options: {
179
179
  populate: [{
@@ -211,9 +211,8 @@ export var SpaceX = function SpaceX() {
211
211
  })["catch"](function (error) {
212
212
  return console.error('Unable to get data:', error);
213
213
  });
214
- case 5:
215
- case "end":
216
- return _context2.stop();
214
+ case 2:
215
+ return _context2.a(2);
217
216
  }
218
217
  }, _callee2);
219
218
  }));
@@ -1,4 +1,5 @@
1
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return r; }; var t, r = {}, e = Object.prototype, n = e.hasOwnProperty, o = "function" == typeof Symbol ? Symbol : {}, i = o.iterator || "@@iterator", a = o.asyncIterator || "@@asyncIterator", u = o.toStringTag || "@@toStringTag"; function c(t, r, e, n) { return Object.defineProperty(t, r, { value: e, enumerable: !n, configurable: !n, writable: !n }); } try { c({}, ""); } catch (t) { c = function c(t, r, e) { return t[r] = e; }; } function h(r, e, n, o) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype); return c(a, "_invoke", function (r, e, n) { var o = 1; return function (i, a) { if (3 === o) throw Error("Generator is already running"); if (4 === o) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var u = n.delegate; if (u) { var c = d(u, n); if (c) { if (c === f) continue; return c; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (1 === o) throw o = 4, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = 3; var h = s(r, e, n); if ("normal" === h.type) { if (o = n.done ? 4 : 2, h.arg === f) continue; return { value: h.arg, done: n.done }; } "throw" === h.type && (o = 4, n.method = "throw", n.arg = h.arg); } }; }(r, n, new Context(o || [])), !0), a; } function s(t, r, e) { try { return { type: "normal", arg: t.call(r, e) }; } catch (t) { return { type: "throw", arg: t }; } } r.wrap = h; var f = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var l = {}; c(l, i, function () { return this; }); var p = Object.getPrototypeOf, y = p && p(p(x([]))); y && y !== e && n.call(y, i) && (l = y); var v = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(l); function g(t) { ["next", "throw", "return"].forEach(function (r) { c(t, r, function (t) { return this._invoke(r, t); }); }); } function AsyncIterator(t, r) { function e(o, i, a, u) { var c = s(t[o], t, i); if ("throw" !== c.type) { var h = c.arg, f = h.value; return f && "object" == typeof f && n.call(f, "__await") ? r.resolve(f.__await).then(function (t) { e("next", t, a, u); }, function (t) { e("throw", t, a, u); }) : r.resolve(f).then(function (t) { h.value = t, a(h); }, function (t) { return e("throw", t, a, u); }); } u(c.arg); } var o; c(this, "_invoke", function (t, n) { function i() { return new r(function (r, o) { e(t, n, r, o); }); } return o = o ? o.then(i, i) : i(); }, !0); } function d(r, e) { var n = e.method, o = r.i[n]; if (o === t) return e.delegate = null, "throw" === n && r.i["return"] && (e.method = "return", e.arg = t, d(r, e), "throw" === e.method) || "return" !== n && (e.method = "throw", e.arg = new TypeError("The iterator does not provide a '" + n + "' method")), f; var i = s(o, r.i, e.arg); if ("throw" === i.type) return e.method = "throw", e.arg = i.arg, e.delegate = null, f; var a = i.arg; return a ? a.done ? (e[r.r] = a.value, e.next = r.n, "return" !== e.method && (e.method = "next", e.arg = t), e.delegate = null, f) : a : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, f); } function w(t) { this.tryEntries.push(t); } function m(r) { var e = r[4] || {}; e.type = "normal", e.arg = t, r[4] = e; } function Context(t) { this.tryEntries = [[-1]], t.forEach(w, this), this.reset(!0); } function x(r) { if (null != r) { var e = r[i]; if (e) return e.call(r); if ("function" == typeof r.next) return r; if (!isNaN(r.length)) { var o = -1, a = function e() { for (; ++o < r.length;) if (n.call(r, o)) return e.value = r[o], e.done = !1, e; return e.value = t, e.done = !0, e; }; return a.next = a; } } throw new TypeError(typeof r + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, c(v, "constructor", GeneratorFunctionPrototype), c(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = c(GeneratorFunctionPrototype, u, "GeneratorFunction"), r.isGeneratorFunction = function (t) { var r = "function" == typeof t && t.constructor; return !!r && (r === GeneratorFunction || "GeneratorFunction" === (r.displayName || r.name)); }, r.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, c(t, u, "GeneratorFunction")), t.prototype = Object.create(v), t; }, r.awrap = function (t) { return { __await: t }; }, g(AsyncIterator.prototype), c(AsyncIterator.prototype, a, function () { return this; }), r.AsyncIterator = AsyncIterator, r.async = function (t, e, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(h(t, e, n, o), i); return r.isGeneratorFunction(e) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, g(v), c(v, u, "Generator"), c(v, i, function () { return this; }), c(v, "toString", function () { return "[object Generator]"; }), r.keys = function (t) { var r = Object(t), e = []; for (var n in r) e.unshift(n); return function t() { for (; e.length;) if ((n = e.pop()) in r) return t.value = n, t.done = !1, t; return t.done = !0, t; }; }, r.values = x, Context.prototype = { constructor: Context, reset: function reset(r) { if (this.prev = this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(m), !r) for (var e in this) "t" === e.charAt(0) && n.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0][4]; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(r) { if (this.done) throw r; var e = this; function n(t) { a.type = "throw", a.arg = r, e.next = t; } for (var o = e.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i[4], u = this.prev, c = i[1], h = i[2]; if (-1 === i[0]) return n("end"), !1; if (!c && !h) throw Error("try statement without catch or finally"); if (null != i[0] && i[0] <= u) { if (u < c) return this.method = "next", this.arg = t, n(c), !0; if (u < h) return n(h), !1; } } }, abrupt: function abrupt(t, r) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var n = this.tryEntries[e]; if (n[0] > -1 && n[0] <= this.prev && this.prev < n[2]) { var o = n; break; } } o && ("break" === t || "continue" === t) && o[0] <= r && r <= o[2] && (o = null); var i = o ? o[4] : {}; return i.type = t, i.arg = r, o ? (this.method = "next", this.next = o[2], f) : this.complete(i); }, complete: function complete(t, r) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && r && (this.next = r), f; }, finish: function finish(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[2] === t) return this.complete(e[4], e[3]), m(e), f; } }, "catch": function _catch(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[0] === t) { var n = e[4]; if ("throw" === n.type) { var o = n.arg; m(e); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(r, e, n) { return this.delegate = { i: x(r), r: e, n: n }, "next" === this.method && (this.arg = t), f; } }, r; }
1
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
2
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
2
3
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
3
4
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
4
5
  import React, { useEffect, useState } from 'react';
@@ -64,11 +65,11 @@ export var SpaceXUngrouped = function SpaceXUngrouped() {
64
65
  setLimit = _useState3[1];
65
66
  useEffect(function () {
66
67
  var fetchData = /*#__PURE__*/function () {
67
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
68
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
68
69
  var _sort;
69
70
  var query;
70
- return _regeneratorRuntime().wrap(function _callee$(_context) {
71
- while (1) switch (_context.prev = _context.next) {
71
+ return _regenerator().w(function (_context) {
72
+ while (1) switch (_context.n) {
72
73
  case 0:
73
74
  query = {
74
75
  options: {
@@ -97,9 +98,8 @@ export var SpaceXUngrouped = function SpaceXUngrouped() {
97
98
  })["catch"](function (error) {
98
99
  return console.error('Unable to get data:', error);
99
100
  });
100
- case 2:
101
- case "end":
102
- return _context.stop();
101
+ case 1:
102
+ return _context.a(2);
103
103
  }
104
104
  }, _callee);
105
105
  }));
@@ -1,4 +1,5 @@
1
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return r; }; var t, r = {}, e = Object.prototype, n = e.hasOwnProperty, o = "function" == typeof Symbol ? Symbol : {}, i = o.iterator || "@@iterator", a = o.asyncIterator || "@@asyncIterator", u = o.toStringTag || "@@toStringTag"; function c(t, r, e, n) { return Object.defineProperty(t, r, { value: e, enumerable: !n, configurable: !n, writable: !n }); } try { c({}, ""); } catch (t) { c = function c(t, r, e) { return t[r] = e; }; } function h(r, e, n, o) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype); return c(a, "_invoke", function (r, e, n) { var o = 1; return function (i, a) { if (3 === o) throw Error("Generator is already running"); if (4 === o) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var u = n.delegate; if (u) { var c = d(u, n); if (c) { if (c === f) continue; return c; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (1 === o) throw o = 4, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = 3; var h = s(r, e, n); if ("normal" === h.type) { if (o = n.done ? 4 : 2, h.arg === f) continue; return { value: h.arg, done: n.done }; } "throw" === h.type && (o = 4, n.method = "throw", n.arg = h.arg); } }; }(r, n, new Context(o || [])), !0), a; } function s(t, r, e) { try { return { type: "normal", arg: t.call(r, e) }; } catch (t) { return { type: "throw", arg: t }; } } r.wrap = h; var f = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var l = {}; c(l, i, function () { return this; }); var p = Object.getPrototypeOf, y = p && p(p(x([]))); y && y !== e && n.call(y, i) && (l = y); var v = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(l); function g(t) { ["next", "throw", "return"].forEach(function (r) { c(t, r, function (t) { return this._invoke(r, t); }); }); } function AsyncIterator(t, r) { function e(o, i, a, u) { var c = s(t[o], t, i); if ("throw" !== c.type) { var h = c.arg, f = h.value; return f && "object" == typeof f && n.call(f, "__await") ? r.resolve(f.__await).then(function (t) { e("next", t, a, u); }, function (t) { e("throw", t, a, u); }) : r.resolve(f).then(function (t) { h.value = t, a(h); }, function (t) { return e("throw", t, a, u); }); } u(c.arg); } var o; c(this, "_invoke", function (t, n) { function i() { return new r(function (r, o) { e(t, n, r, o); }); } return o = o ? o.then(i, i) : i(); }, !0); } function d(r, e) { var n = e.method, o = r.i[n]; if (o === t) return e.delegate = null, "throw" === n && r.i["return"] && (e.method = "return", e.arg = t, d(r, e), "throw" === e.method) || "return" !== n && (e.method = "throw", e.arg = new TypeError("The iterator does not provide a '" + n + "' method")), f; var i = s(o, r.i, e.arg); if ("throw" === i.type) return e.method = "throw", e.arg = i.arg, e.delegate = null, f; var a = i.arg; return a ? a.done ? (e[r.r] = a.value, e.next = r.n, "return" !== e.method && (e.method = "next", e.arg = t), e.delegate = null, f) : a : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, f); } function w(t) { this.tryEntries.push(t); } function m(r) { var e = r[4] || {}; e.type = "normal", e.arg = t, r[4] = e; } function Context(t) { this.tryEntries = [[-1]], t.forEach(w, this), this.reset(!0); } function x(r) { if (null != r) { var e = r[i]; if (e) return e.call(r); if ("function" == typeof r.next) return r; if (!isNaN(r.length)) { var o = -1, a = function e() { for (; ++o < r.length;) if (n.call(r, o)) return e.value = r[o], e.done = !1, e; return e.value = t, e.done = !0, e; }; return a.next = a; } } throw new TypeError(typeof r + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, c(v, "constructor", GeneratorFunctionPrototype), c(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = c(GeneratorFunctionPrototype, u, "GeneratorFunction"), r.isGeneratorFunction = function (t) { var r = "function" == typeof t && t.constructor; return !!r && (r === GeneratorFunction || "GeneratorFunction" === (r.displayName || r.name)); }, r.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, c(t, u, "GeneratorFunction")), t.prototype = Object.create(v), t; }, r.awrap = function (t) { return { __await: t }; }, g(AsyncIterator.prototype), c(AsyncIterator.prototype, a, function () { return this; }), r.AsyncIterator = AsyncIterator, r.async = function (t, e, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(h(t, e, n, o), i); return r.isGeneratorFunction(e) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, g(v), c(v, u, "Generator"), c(v, i, function () { return this; }), c(v, "toString", function () { return "[object Generator]"; }), r.keys = function (t) { var r = Object(t), e = []; for (var n in r) e.unshift(n); return function t() { for (; e.length;) if ((n = e.pop()) in r) return t.value = n, t.done = !1, t; return t.done = !0, t; }; }, r.values = x, Context.prototype = { constructor: Context, reset: function reset(r) { if (this.prev = this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(m), !r) for (var e in this) "t" === e.charAt(0) && n.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0][4]; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(r) { if (this.done) throw r; var e = this; function n(t) { a.type = "throw", a.arg = r, e.next = t; } for (var o = e.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i[4], u = this.prev, c = i[1], h = i[2]; if (-1 === i[0]) return n("end"), !1; if (!c && !h) throw Error("try statement without catch or finally"); if (null != i[0] && i[0] <= u) { if (u < c) return this.method = "next", this.arg = t, n(c), !0; if (u < h) return n(h), !1; } } }, abrupt: function abrupt(t, r) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var n = this.tryEntries[e]; if (n[0] > -1 && n[0] <= this.prev && this.prev < n[2]) { var o = n; break; } } o && ("break" === t || "continue" === t) && o[0] <= r && r <= o[2] && (o = null); var i = o ? o[4] : {}; return i.type = t, i.arg = r, o ? (this.method = "next", this.next = o[2], f) : this.complete(i); }, complete: function complete(t, r) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && r && (this.next = r), f; }, finish: function finish(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[2] === t) return this.complete(e[4], e[3]), m(e), f; } }, "catch": function _catch(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[0] === t) { var n = e[4]; if ("throw" === n.type) { var o = n.arg; m(e); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(r, e, n) { return this.delegate = { i: x(r), r: e, n: n }, "next" === this.method && (this.arg = t), f; } }, r; }
1
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
2
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
2
3
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
3
4
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
4
5
  import React, { useEffect, useMemo, useState } from 'react';
@@ -7,13 +8,13 @@ import { Box, Data, DataTable, NameValueList, NameValuePair, Pagination, Text }
7
8
  // Uses the StarWars API for starships, see https://swapi.info
8
9
 
9
10
  var fetchData = /*#__PURE__*/function () {
10
- var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
11
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
11
12
  var url;
12
- return _regeneratorRuntime().wrap(function _callee$(_context) {
13
- while (1) switch (_context.prev = _context.next) {
13
+ return _regenerator().w(function (_context) {
14
+ while (1) switch (_context.n) {
14
15
  case 0:
15
16
  url = "https://swapi.info/api/starships";
16
- return _context.abrupt("return", fetch(url, {
17
+ return _context.a(2, fetch(url, {
17
18
  method: 'GET',
18
19
  headers: {
19
20
  'Content-Type': 'application/json'
@@ -24,9 +25,6 @@ var fetchData = /*#__PURE__*/function () {
24
25
  if (err.name !== 'AbortError') throw err;
25
26
  return {};
26
27
  }));
27
- case 2:
28
- case "end":
29
- return _context.stop();
30
28
  }
31
29
  }, _callee);
32
30
  }));