@parca/profile 0.19.144 → 0.19.146

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 (28) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/MatchersInput/SuggestionsList.d.ts.map +1 -1
  3. package/dist/MatchersInput/SuggestionsList.js +73 -63
  4. package/dist/MatchersInput/index.d.ts.map +1 -1
  5. package/dist/MatchersInput/index.js +4 -5
  6. package/dist/ProfileTypeSelector/index.d.ts.map +1 -1
  7. package/dist/ProfileTypeSelector/index.js +33 -52
  8. package/dist/ProfileView/components/ColorStackLegend.d.ts.map +1 -1
  9. package/dist/ProfileView/components/ColorStackLegend.js +70 -118
  10. package/dist/ProfileView/components/ProfileFilters/index.d.ts.map +1 -1
  11. package/dist/ProfileView/components/ProfileFilters/index.js +0 -1
  12. package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.d.ts.map +1 -1
  13. package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.js +319 -123
  14. package/dist/SelectWithRefresh/index.js +38 -33
  15. package/dist/SimpleMatchers/Select.d.ts.map +1 -1
  16. package/dist/SimpleMatchers/Select.js +63 -68
  17. package/dist/SourceView/Highlighter.d.ts.map +1 -1
  18. package/dist/SourceView/Highlighter.js +1 -1
  19. package/package.json +6 -6
  20. package/src/MatchersInput/SuggestionsList.tsx +71 -86
  21. package/src/MatchersInput/index.tsx +61 -74
  22. package/src/ProfileTypeSelector/index.tsx +4 -7
  23. package/src/ProfileView/components/ColorStackLegend.tsx +15 -23
  24. package/src/ProfileView/components/ProfileFilters/index.tsx +8 -13
  25. package/src/ProfileView/components/Toolbars/TableColumnsDropdown.tsx +113 -115
  26. package/src/SelectWithRefresh/index.tsx +28 -28
  27. package/src/SimpleMatchers/Select.tsx +29 -37
  28. package/src/SourceView/Highlighter.tsx +2 -2
@@ -24,7 +24,6 @@ import { c as _c } from "react-compiler-runtime";
24
24
  // See the License for the specific language governing permissions and
25
25
  // limitations under the License.
26
26
 
27
- import { useCallback } from 'react';
28
27
  import { Icon } from '@iconify/react';
29
28
  import cx from 'classnames';
30
29
  import { Button, Input, Select } from '@parca/components';
@@ -1 +1 @@
1
- {"version":3,"file":"TableColumnsDropdown.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/Toolbars/TableColumnsDropdown.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAS1C,UAAU,KAAK;IACb,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,QAAA,MAAM,oBAAoB,GAAI,kCAAgC,KAAK,KAAG,GAAG,CAAC,OA6KzE,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"TableColumnsDropdown.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/Toolbars/TableColumnsDropdown.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAS1C,UAAU,KAAK;IACb,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,QAAA,MAAM,oBAAoB,GAAI,kCAAgC,KAAK,KAAG,GAAG,CAAC,OA2KzE,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -10,6 +10,7 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
10
10
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
11
11
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
12
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
13
+ import { c as _c } from "react-compiler-runtime";
13
14
  // Copyright 2022 The Parca Authors
14
15
  // Licensed under the Apache License, Version 2.0 (the "License");
15
16
  // you may not use this file except in compliance with the License.
@@ -23,7 +24,7 @@ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
23
24
  // See the License for the specific language governing permissions and
24
25
  // limitations under the License.
25
26
 
26
- import { useEffect, useMemo, useState } from 'react';
27
+ import { useEffect, useState } from 'react';
27
28
  import { createColumnHelper } from '@tanstack/table-core';
28
29
  import { useQueryState } from 'nuqs';
29
30
  import { valueFormatter } from '@parca/utilities';
@@ -32,138 +33,269 @@ import { addPlusSign, getRatioString } from '../../../Table/utils/functions';
32
33
  import { tableColumnsParser } from '../../../hooks/urlParsers';
33
34
  import { useProfileViewContext } from '../../context/ProfileViewContext';
34
35
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
35
- var TableColumnsDropdown = function TableColumnsDropdown(_ref) {
36
- var profileType = _ref.profileType,
37
- total = _ref.total,
38
- filtered = _ref.filtered;
36
+ var TableColumnsDropdown = function TableColumnsDropdown(t0) {
37
+ var $ = _c(63);
38
+ var profileType = t0.profileType,
39
+ total = t0.total,
40
+ filtered = t0.filtered;
39
41
  var _useProfileViewContex = useProfileViewContext(),
40
42
  compareMode = _useProfileViewContex.compareMode;
41
- var _useQueryState = useQueryState('table_columns', tableColumnsParser),
43
+ var _useQueryState = useQueryState("table_columns", tableColumnsParser),
42
44
  _useQueryState2 = _slicedToArray(_useQueryState, 2),
43
45
  tableColumns = _useQueryState2[0],
44
46
  setTableColumns = _useQueryState2[1];
45
- var columnHelper = createColumnHelper();
46
- var unit = useMemo(function () {
47
+ var t1;
48
+ var t10;
49
+ var t11;
50
+ var t12;
51
+ var t2;
52
+ var t3;
53
+ var t4;
54
+ var t5;
55
+ var t6;
56
+ var t7;
57
+ var t8;
58
+ var t9;
59
+ if ($[0] !== filtered || $[1] !== (profileType === null || profileType === void 0 ? void 0 : profileType.sampleUnit) || $[2] !== total) {
47
60
  var _profileType$sampleUn;
48
- return (_profileType$sampleUn = profileType === null || profileType === void 0 ? void 0 : profileType.sampleUnit) !== null && _profileType$sampleUn !== void 0 ? _profileType$sampleUn : '';
49
- }, [profileType === null || profileType === void 0 ? void 0 : profileType.sampleUnit]);
50
- var columns = useMemo(function () {
51
- return [columnHelper.accessor('flat', {
52
- id: 'flat',
53
- header: 'Flat',
54
- cell: function cell(info) {
61
+ var columnHelper = createColumnHelper();
62
+ var unit = (_profileType$sampleUn = profileType === null || profileType === void 0 ? void 0 : profileType.sampleUnit) !== null && _profileType$sampleUn !== void 0 ? _profileType$sampleUn : "";
63
+ var _t;
64
+ if ($[15] !== unit) {
65
+ _t = function _t(info) {
55
66
  return valueFormatter(info.getValue(), unit, 2);
56
- },
67
+ };
68
+ $[15] = unit;
69
+ $[16] = _t;
70
+ } else {
71
+ _t = $[16];
72
+ }
73
+ t1 = columnHelper.accessor("flat", {
74
+ id: "flat",
75
+ header: "Flat",
76
+ cell: _t,
57
77
  size: 80,
58
78
  meta: {
59
- align: 'right'
79
+ align: "right"
60
80
  },
61
81
  invertSorting: true
62
- }), columnHelper.accessor('flat', {
63
- id: 'flatPercentage',
64
- header: 'Flat (%)',
65
- cell: function cell(info) {
66
- return getRatioString(info.getValue(), total, filtered);
67
- },
82
+ });
83
+ var _t2;
84
+ if ($[17] !== filtered || $[18] !== total) {
85
+ _t2 = function _t2(info_0) {
86
+ return getRatioString(info_0.getValue(), total, filtered);
87
+ };
88
+ $[17] = filtered;
89
+ $[18] = total;
90
+ $[19] = _t2;
91
+ } else {
92
+ _t2 = $[19];
93
+ }
94
+ t2 = columnHelper.accessor("flat", {
95
+ id: "flatPercentage",
96
+ header: "Flat (%)",
97
+ cell: _t2,
68
98
  size: 120,
69
99
  meta: {
70
- align: 'right'
100
+ align: "right"
71
101
  },
72
102
  invertSorting: true
73
- }), columnHelper.accessor('flatDiff', {
74
- id: 'flatDiff',
75
- header: 'Flat Diff',
76
- cell: function cell(info) {
77
- return addPlusSign(valueFormatter(info.getValue(), unit, 2));
78
- },
103
+ });
104
+ var _t3;
105
+ if ($[20] !== unit) {
106
+ _t3 = function _t3(info_1) {
107
+ return addPlusSign(valueFormatter(info_1.getValue(), unit, 2));
108
+ };
109
+ $[20] = unit;
110
+ $[21] = _t3;
111
+ } else {
112
+ _t3 = $[21];
113
+ }
114
+ t3 = columnHelper.accessor("flatDiff", {
115
+ id: "flatDiff",
116
+ header: "Flat Diff",
117
+ cell: _t3,
79
118
  size: 120,
80
119
  meta: {
81
- align: 'right'
120
+ align: "right"
82
121
  },
83
122
  invertSorting: true
84
- }), columnHelper.accessor('flatDiff', {
85
- id: 'flatDiffPercentage',
86
- header: 'Flat Diff (%)',
87
- cell: function cell(info) {
88
- return getRatioString(info.getValue(), total, filtered);
89
- },
123
+ });
124
+ var _t4;
125
+ if ($[22] !== filtered || $[23] !== total) {
126
+ _t4 = function _t4(info_2) {
127
+ return getRatioString(info_2.getValue(), total, filtered);
128
+ };
129
+ $[22] = filtered;
130
+ $[23] = total;
131
+ $[24] = _t4;
132
+ } else {
133
+ _t4 = $[24];
134
+ }
135
+ t4 = columnHelper.accessor("flatDiff", {
136
+ id: "flatDiffPercentage",
137
+ header: "Flat Diff (%)",
138
+ cell: _t4,
90
139
  size: 120,
91
140
  meta: {
92
- align: 'right'
141
+ align: "right"
93
142
  },
94
143
  invertSorting: true
95
- }), columnHelper.accessor('cumulative', {
96
- id: 'cumulative',
97
- header: 'Cumulative',
98
- cell: function cell(info) {
99
- return valueFormatter(info.getValue(), unit, 2);
100
- },
144
+ });
145
+ var _t5;
146
+ if ($[25] !== unit) {
147
+ _t5 = function _t5(info_3) {
148
+ return valueFormatter(info_3.getValue(), unit, 2);
149
+ };
150
+ $[25] = unit;
151
+ $[26] = _t5;
152
+ } else {
153
+ _t5 = $[26];
154
+ }
155
+ t5 = columnHelper.accessor("cumulative", {
156
+ id: "cumulative",
157
+ header: "Cumulative",
158
+ cell: _t5,
101
159
  size: 150,
102
160
  meta: {
103
- align: 'right'
161
+ align: "right"
104
162
  },
105
163
  invertSorting: true
106
- }), columnHelper.accessor('cumulative', {
107
- id: 'cumulativePercentage',
108
- header: 'Cumulative (%)',
109
- cell: function cell(info) {
110
- return getRatioString(info.getValue(), total, filtered);
111
- },
164
+ });
165
+ var _t6;
166
+ if ($[27] !== filtered || $[28] !== total) {
167
+ _t6 = function _t6(info_4) {
168
+ return getRatioString(info_4.getValue(), total, filtered);
169
+ };
170
+ $[27] = filtered;
171
+ $[28] = total;
172
+ $[29] = _t6;
173
+ } else {
174
+ _t6 = $[29];
175
+ }
176
+ t6 = columnHelper.accessor("cumulative", {
177
+ id: "cumulativePercentage",
178
+ header: "Cumulative (%)",
179
+ cell: _t6,
112
180
  size: 150,
113
181
  meta: {
114
- align: 'right'
182
+ align: "right"
115
183
  },
116
184
  invertSorting: true
117
- }), columnHelper.accessor('cumulativeDiff', {
118
- id: 'cumulativeDiff',
119
- header: 'Cumulative Diff',
120
- cell: function cell(info) {
121
- return addPlusSign(valueFormatter(info.getValue(), unit, 2));
122
- },
185
+ });
186
+ var _t7;
187
+ if ($[30] !== unit) {
188
+ _t7 = function _t7(info_5) {
189
+ return addPlusSign(valueFormatter(info_5.getValue(), unit, 2));
190
+ };
191
+ $[30] = unit;
192
+ $[31] = _t7;
193
+ } else {
194
+ _t7 = $[31];
195
+ }
196
+ t7 = columnHelper.accessor("cumulativeDiff", {
197
+ id: "cumulativeDiff",
198
+ header: "Cumulative Diff",
199
+ cell: _t7,
123
200
  size: 170,
124
201
  meta: {
125
- align: 'right'
202
+ align: "right"
126
203
  },
127
204
  invertSorting: true
128
- }), columnHelper.accessor('cumulativeDiff', {
129
- id: 'cumulativeDiffPercentage',
130
- header: 'Cumulative Diff (%)',
131
- cell: function cell(info) {
132
- return getRatioString(info.getValue(), total, filtered);
133
- },
205
+ });
206
+ var _t8;
207
+ if ($[32] !== filtered || $[33] !== total) {
208
+ _t8 = function _t8(info_6) {
209
+ return getRatioString(info_6.getValue(), total, filtered);
210
+ };
211
+ $[32] = filtered;
212
+ $[33] = total;
213
+ $[34] = _t8;
214
+ } else {
215
+ _t8 = $[34];
216
+ }
217
+ t8 = columnHelper.accessor("cumulativeDiff", {
218
+ id: "cumulativeDiffPercentage",
219
+ header: "Cumulative Diff (%)",
220
+ cell: _t8,
134
221
  size: 170,
135
222
  meta: {
136
- align: 'right'
223
+ align: "right"
137
224
  },
138
225
  invertSorting: true
139
- }), columnHelper.accessor('name', {
140
- id: 'name',
141
- header: 'Name',
142
- cell: function cell(info) {
143
- return info.getValue();
144
- }
145
- }), columnHelper.accessor('functionSystemName', {
146
- id: 'functionSystemName',
147
- header: 'Function System Name',
148
- cell: function cell(info) {
149
- return info.getValue();
150
- }
151
- }), columnHelper.accessor('functionFileName', {
152
- id: 'functionFileName',
153
- header: 'Function File Name',
154
- cell: function cell(info) {
155
- return info.getValue();
156
- }
157
- }), columnHelper.accessor('mappingFile', {
158
- id: 'mappingFile',
159
- header: 'Mapping File',
160
- cell: function cell(info) {
161
- return info.getValue();
162
- }
163
- })];
164
- // eslint-disable-next-line react-hooks/exhaustive-deps
165
- }, [profileType, unit]);
166
- var _useState = useState(function () {
226
+ });
227
+ t9 = columnHelper.accessor("name", {
228
+ id: "name",
229
+ header: "Name",
230
+ cell: _temp
231
+ });
232
+ t10 = columnHelper.accessor("functionSystemName", {
233
+ id: "functionSystemName",
234
+ header: "Function System Name",
235
+ cell: _temp2
236
+ });
237
+ t11 = columnHelper.accessor("functionFileName", {
238
+ id: "functionFileName",
239
+ header: "Function File Name",
240
+ cell: _temp3
241
+ });
242
+ t12 = columnHelper.accessor("mappingFile", {
243
+ id: "mappingFile",
244
+ header: "Mapping File",
245
+ cell: _temp4
246
+ });
247
+ $[0] = filtered;
248
+ $[1] = profileType === null || profileType === void 0 ? void 0 : profileType.sampleUnit;
249
+ $[2] = total;
250
+ $[3] = t1;
251
+ $[4] = t10;
252
+ $[5] = t11;
253
+ $[6] = t12;
254
+ $[7] = t2;
255
+ $[8] = t3;
256
+ $[9] = t4;
257
+ $[10] = t5;
258
+ $[11] = t6;
259
+ $[12] = t7;
260
+ $[13] = t8;
261
+ $[14] = t9;
262
+ } else {
263
+ t1 = $[3];
264
+ t10 = $[4];
265
+ t11 = $[5];
266
+ t12 = $[6];
267
+ t2 = $[7];
268
+ t3 = $[8];
269
+ t4 = $[9];
270
+ t5 = $[10];
271
+ t6 = $[11];
272
+ t7 = $[12];
273
+ t8 = $[13];
274
+ t9 = $[14];
275
+ }
276
+ var t13;
277
+ if ($[35] !== t1 || $[36] !== t10 || $[37] !== t11 || $[38] !== t12 || $[39] !== t2 || $[40] !== t3 || $[41] !== t4 || $[42] !== t5 || $[43] !== t6 || $[44] !== t7 || $[45] !== t8 || $[46] !== t9) {
278
+ t13 = [t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12];
279
+ $[35] = t1;
280
+ $[36] = t10;
281
+ $[37] = t11;
282
+ $[38] = t12;
283
+ $[39] = t2;
284
+ $[40] = t3;
285
+ $[41] = t4;
286
+ $[42] = t5;
287
+ $[43] = t6;
288
+ $[44] = t7;
289
+ $[45] = t8;
290
+ $[46] = t9;
291
+ $[47] = t13;
292
+ } else {
293
+ t13 = $[47];
294
+ }
295
+ var columns = t13;
296
+ var t14;
297
+ if ($[48] !== compareMode) {
298
+ t14 = function t14() {
167
299
  return {
168
300
  color: true,
169
301
  flat: true,
@@ -179,40 +311,104 @@ var TableColumnsDropdown = function TableColumnsDropdown(_ref) {
179
311
  functionFileName: false,
180
312
  mappingFile: false
181
313
  };
182
- }),
314
+ };
315
+ $[48] = compareMode;
316
+ $[49] = t14;
317
+ } else {
318
+ t14 = $[49];
319
+ }
320
+ var _useState = useState(t14),
183
321
  _useState2 = _slicedToArray(_useState, 2),
184
322
  columnVisibility = _useState2[0],
185
323
  setColumnVisibility = _useState2[1];
186
- useEffect(function () {
187
- if (Array.isArray(tableColumns)) {
188
- setColumnVisibility(function (prevState) {
189
- var newState = _objectSpread({}, prevState);
190
- Object.keys(newState).forEach(function (column) {
191
- newState[column] = tableColumns.includes(column);
324
+ var t15;
325
+ var t16;
326
+ if ($[50] !== tableColumns) {
327
+ t15 = function t15() {
328
+ if (Array.isArray(tableColumns)) {
329
+ setColumnVisibility(function (prevState) {
330
+ var newState = _objectSpread({}, prevState);
331
+ Object.keys(newState).forEach(function (column) {
332
+ newState[column] = tableColumns.includes(column);
333
+ });
334
+ return newState;
192
335
  });
193
- return newState;
336
+ }
337
+ };
338
+ t16 = [tableColumns];
339
+ $[50] = tableColumns;
340
+ $[51] = t15;
341
+ $[52] = t16;
342
+ } else {
343
+ t15 = $[51];
344
+ t16 = $[52];
345
+ }
346
+ useEffect(t15, t16);
347
+ var t17;
348
+ if ($[53] !== columnVisibility || $[54] !== setTableColumns) {
349
+ t17 = function t17(column_0, isVisible) {
350
+ var updatedColumns = _objectSpread(_objectSpread({}, columnVisibility), {}, _defineProperty({}, column_0, isVisible));
351
+ var newTableColumns = Object.keys(updatedColumns).filter(function (col) {
352
+ return updatedColumns[col];
194
353
  });
195
- }
196
- }, [tableColumns]);
197
- var updateColumnVisibility = function updateColumnVisibility(column, isVisible) {
198
- var updatedColumns = _objectSpread(_objectSpread({}, columnVisibility), {}, _defineProperty({}, column, isVisible));
199
- var newTableColumns = Object.keys(updatedColumns).filter(function (col) {
200
- return updatedColumns[col];
201
- });
202
- void setTableColumns(newTableColumns);
203
- };
204
- return /*#__PURE__*/_jsxs("div", {
205
- className: "flex flex-col gap-1",
206
- children: [/*#__PURE__*/_jsx("label", {
354
+ setTableColumns(newTableColumns);
355
+ };
356
+ $[53] = columnVisibility;
357
+ $[54] = setTableColumns;
358
+ $[55] = t17;
359
+ } else {
360
+ t17 = $[55];
361
+ }
362
+ var updateColumnVisibility = t17;
363
+ var t18;
364
+ if ($[56] === Symbol["for"]("react.memo_cache_sentinel")) {
365
+ t18 = /*#__PURE__*/_jsx("label", {
207
366
  className: "text-sm",
208
367
  children: "Table Columns"
209
- }), /*#__PURE__*/_jsx(ColumnsVisibility, {
210
- columns: columns,
211
- visibility: columnVisibility,
212
- setVisibility: function setVisibility(id, visible) {
213
- updateColumnVisibility(id, visible);
214
- }
215
- })]
216
- });
368
+ });
369
+ $[56] = t18;
370
+ } else {
371
+ t18 = $[56];
372
+ }
373
+ var t19;
374
+ if ($[57] !== updateColumnVisibility) {
375
+ t19 = function t19(id, visible) {
376
+ updateColumnVisibility(id, visible);
377
+ };
378
+ $[57] = updateColumnVisibility;
379
+ $[58] = t19;
380
+ } else {
381
+ t19 = $[58];
382
+ }
383
+ var t20;
384
+ if ($[59] !== columnVisibility || $[60] !== columns || $[61] !== t19) {
385
+ t20 = /*#__PURE__*/_jsxs("div", {
386
+ className: "flex flex-col gap-1",
387
+ children: [t18, /*#__PURE__*/_jsx(ColumnsVisibility, {
388
+ columns: columns,
389
+ visibility: columnVisibility,
390
+ setVisibility: t19
391
+ })]
392
+ });
393
+ $[59] = columnVisibility;
394
+ $[60] = columns;
395
+ $[61] = t19;
396
+ $[62] = t20;
397
+ } else {
398
+ t20 = $[62];
399
+ }
400
+ return t20;
217
401
  };
218
- export default TableColumnsDropdown;
402
+ export default TableColumnsDropdown;
403
+ function _temp(info_7) {
404
+ return info_7.getValue();
405
+ }
406
+ function _temp2(info_8) {
407
+ return info_8.getValue();
408
+ }
409
+ function _temp3(info_9) {
410
+ return info_9.getValue();
411
+ }
412
+ function _temp4(info_10) {
413
+ return info_10.getValue();
414
+ }
@@ -30,7 +30,7 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
30
30
  // See the License for the specific language governing permissions and
31
31
  // limitations under the License.
32
32
 
33
- import { useCallback, useState } from 'react';
33
+ import { useState } from 'react';
34
34
  import ReactSelect from 'react-select';
35
35
  import { RefreshButton } from '@parca/components';
36
36
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -48,38 +48,43 @@ export function SelectWithRefresh(props) {
48
48
  _useState2 = _slicedToArray(_useState, 2),
49
49
  isRefreshing = _useState2[0],
50
50
  setIsRefreshing = _useState2[1];
51
- var handleRefetch = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
52
- var _t;
53
- return _regenerator().w(function (_context) {
54
- while (1) switch (_context.p = _context.n) {
55
- case 0:
56
- if (!(onRefresh == null || isRefreshing)) {
57
- _context.n = 1;
51
+ var handleRefetch = /*#__PURE__*/function () {
52
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
53
+ var _t;
54
+ return _regenerator().w(function (_context) {
55
+ while (1) switch (_context.p = _context.n) {
56
+ case 0:
57
+ if (!(onRefresh == null || isRefreshing)) {
58
+ _context.n = 1;
59
+ break;
60
+ }
61
+ return _context.a(2);
62
+ case 1:
63
+ setIsRefreshing(true);
64
+ _context.p = 2;
65
+ _context.n = 3;
66
+ return onRefresh();
67
+ case 3:
68
+ _context.n = 5;
58
69
  break;
59
- }
60
- return _context.a(2);
61
- case 1:
62
- setIsRefreshing(true);
63
- _context.p = 2;
64
- _context.n = 3;
65
- return onRefresh();
66
- case 3:
67
- _context.n = 5;
68
- break;
69
- case 4:
70
- _context.p = 4;
71
- _t = _context.v;
72
- console.error('Error during refresh:', _t);
73
- case 5:
74
- _context.p = 5;
75
- setIsRefreshing(false);
76
- return _context.f(5);
77
- case 6:
78
- return _context.a(2);
79
- }
80
- }, _callee, null, [[2, 4, 5, 6]]);
81
- })), [onRefresh, isRefreshing]);
82
- var MenuListWithRefresh = useCallback(function (_ref2) {
70
+ case 4:
71
+ _context.p = 4;
72
+ _t = _context.v;
73
+ console.error('Error during refresh:', _t);
74
+ case 5:
75
+ _context.p = 5;
76
+ setIsRefreshing(false);
77
+ return _context.f(5);
78
+ case 6:
79
+ return _context.a(2);
80
+ }
81
+ }, _callee, null, [[2, 4, 5, 6]]);
82
+ }));
83
+ return function handleRefetch() {
84
+ return _ref.apply(this, arguments);
85
+ };
86
+ }();
87
+ var MenuListWithRefresh = function MenuListWithRefresh(_ref2) {
83
88
  var children = _ref2.children,
84
89
  innerProps = _ref2.innerProps;
85
90
  var testIdProps = menuTestId != null ? {
@@ -106,7 +111,7 @@ export function SelectWithRefresh(props) {
106
111
  testId: refreshTestId
107
112
  })]
108
113
  });
109
- }, [onRefresh, isRefreshing, handleRefetch, refreshTitle, refreshTestId, menuTestId]);
114
+ };
110
115
  var combinedLoadingState = isRefreshing || ((_selectProps$isLoadin = selectProps.isLoading) !== null && _selectProps$isLoadin !== void 0 ? _selectProps$isLoadin : false);
111
116
  return /*#__PURE__*/_jsx(ReactSelect, _objectSpread(_objectSpread({}, selectProps), {}, {
112
117
  isLoading: combinedLoadingState,
@@ -1 +1 @@
1
- {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../src/SimpleMatchers/Select.tsx"],"names":[],"mappings":"AAaA,OAAO,KAA0D,MAAM,OAAO,CAAC;AAU/E,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC;IACpB,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,aAAa,CAAC;CACxB;AAED,MAAM,WAAW,eAAgB,SAAQ,UAAU;IACjD,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,UAAU,EAAE,CAAC;CACtB;AAED,UAAU,iBAAiB;IACzB,KAAK,EAAE,iBAAiB,EAAE,GAAG,UAAU,EAAE,CAAC;IAC1C,WAAW,EAA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