@parca/profile 0.19.140 → 0.19.142
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.
- package/CHANGELOG.md +5 -1
- package/dist/GraphTooltipArrow/Content.js +224 -30
- package/dist/GraphTooltipArrow/DockedGraphTooltip/index.js +192 -33
- package/dist/GraphTooltipArrow/ExpandOnHoverValue.js +53 -3
- package/dist/GraphTooltipArrow/index.d.ts.map +1 -1
- package/dist/GraphTooltipArrow/index.js +86 -56
- package/dist/GraphTooltipArrow/useGraphTooltip/index.js +37 -37
- package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.d.ts.map +1 -1
- package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.js +104 -72
- package/dist/MatchersInput/SuggestionItem.js +91 -12
- package/dist/MatchersInput/SuggestionsList.d.ts +2 -1
- package/dist/MatchersInput/SuggestionsList.d.ts.map +1 -1
- package/dist/MatchersInput/SuggestionsList.js +371 -157
- package/dist/MatchersInput/SuggestionsList.test.d.ts +2 -0
- package/dist/MatchersInput/SuggestionsList.test.d.ts.map +1 -0
- package/dist/MatchersInput/index.js +308 -115
- package/dist/MetricsCircle/index.js +39 -3
- package/dist/MetricsGraph/MetricsContextMenu/index.js +119 -19
- package/dist/MetricsGraph/MetricsInfoPanel/index.js +81 -20
- package/dist/MetricsGraph/MetricsTooltip/index.d.ts.map +1 -1
- package/dist/MetricsGraph/MetricsTooltip/index.js +107 -74
- package/dist/MetricsGraph/index.js +552 -203
- package/dist/MetricsGraph/useMetricsGraphDimensions.js +46 -25
- package/dist/MetricsGraph/utils/colorMapping.js +24 -17
- package/dist/MetricsSeries/index.js +70 -7
- package/dist/PreSelectedMatchers/index.d.ts.map +1 -1
- package/dist/PreSelectedMatchers/index.js +249 -102
- package/dist/ProfileExplorer/ProfileExplorerCompare.d.ts.map +1 -1
- package/dist/ProfileExplorer/ProfileExplorerCompare.js +241 -45
- package/dist/ProfileExplorer/ProfileExplorerSingle.js +98 -11
- package/dist/ProfileExplorer/index.js +183 -32
- package/dist/ProfileFlameChart/SamplesStrips/SamplesGraph/index.js +333 -148
- package/dist/ProfileFlameChart/SamplesStrips/SamplesStrips.stories.js +69 -35
- package/dist/ProfileFlameChart/SamplesStrips/index.d.ts +2 -2
- package/dist/ProfileFlameChart/SamplesStrips/index.d.ts.map +1 -1
- package/dist/ProfileFlameChart/SamplesStrips/index.js +645 -134
- package/dist/ProfileFlameChart/SamplesStrips/labelSetUtils.js +114 -55
- package/dist/ProfileFlameChart/index.d.ts.map +1 -1
- package/dist/ProfileFlameChart/index.js +267 -129
- package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.js +288 -89
- package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenuWrapper.js +56 -20
- package/dist/ProfileFlameGraph/FlameGraphArrow/FlameGraphNodes.js +211 -140
- package/dist/ProfileFlameGraph/FlameGraphArrow/MemoizedTooltip.js +133 -38
- package/dist/ProfileFlameGraph/FlameGraphArrow/MiniMap.js +261 -216
- package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.js +72 -47
- package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.js +58 -28
- package/dist/ProfileFlameGraph/FlameGraphArrow/ZoomControls.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/ZoomControls.js +59 -8
- package/dist/ProfileFlameGraph/FlameGraphArrow/index.js +396 -179
- package/dist/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.js +68 -50
- package/dist/ProfileFlameGraph/FlameGraphArrow/useMappingList.js +62 -38
- package/dist/ProfileFlameGraph/FlameGraphArrow/useNodeColor.js +14 -6
- package/dist/ProfileFlameGraph/FlameGraphArrow/useScrollViewport.js +124 -82
- package/dist/ProfileFlameGraph/FlameGraphArrow/useVisibleNodes.js +160 -98
- package/dist/ProfileFlameGraph/FlameGraphArrow/useZoom.js +232 -112
- package/dist/ProfileFlameGraph/FlameGraphArrow/utils.js +137 -114
- package/dist/ProfileFlameGraph/benchmarks/benchdata/populateData.js +85 -0
- package/dist/ProfileFlameGraph/index.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/index.js +324 -150
- package/dist/ProfileMetricsGraph/hooks/useQueryRange.js +140 -32
- package/dist/ProfileMetricsGraph/index.d.ts.map +1 -1
- package/dist/ProfileMetricsGraph/index.js +519 -258
- package/dist/ProfileSelector/CompareButton.js +132 -12
- package/dist/ProfileSelector/MetricsGraphSection.d.ts.map +1 -1
- package/dist/ProfileSelector/MetricsGraphSection.js +236 -64
- package/dist/ProfileSelector/index.d.ts.map +1 -1
- package/dist/ProfileSelector/index.js +727 -141
- package/dist/ProfileSelector/useAutoQuerySelector.js +249 -130
- package/dist/ProfileSource.js +230 -163
- package/dist/ProfileTypeSelector/index.js +214 -125
- package/dist/ProfileView/components/ActionButtons/GroupByDropdown.js +50 -4
- package/dist/ProfileView/components/ActionButtons/SortByDropdown.d.ts.map +1 -1
- package/dist/ProfileView/components/ActionButtons/SortByDropdown.js +141 -35
- package/dist/ProfileView/components/ColorStackLegend.d.ts.map +1 -1
- package/dist/ProfileView/components/ColorStackLegend.js +185 -55
- package/dist/ProfileView/components/DashboardItems/index.js +87 -28
- package/dist/ProfileView/components/DashboardLayout/index.js +108 -16
- package/dist/ProfileView/components/DiffLegend.js +172 -29
- package/dist/ProfileView/components/GroupByLabelsDropdown/index.js +199 -55
- package/dist/ProfileView/components/InvertCallStack/index.d.ts.map +1 -1
- package/dist/ProfileView/components/InvertCallStack/index.js +100 -12
- package/dist/ProfileView/components/ProfileFilters/filterPresets.js +260 -315
- package/dist/ProfileView/components/ProfileFilters/index.js +518 -215
- package/dist/ProfileView/components/ProfileFilters/useProfileFilters.js +370 -306
- package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.d.ts +2 -1
- package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.d.ts.map +1 -1
- package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.js +188 -118
- package/dist/ProfileView/components/ProfileHeader/index.js +105 -11
- package/dist/ProfileView/components/ShareButton/ResultBox.js +119 -16
- package/dist/ProfileView/components/ShareButton/index.js +352 -62
- package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.d.ts.map +1 -1
- package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.js +678 -194
- package/dist/ProfileView/components/Toolbars/SwitchMenuItem.js +94 -7
- package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.d.ts.map +1 -1
- package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.js +199 -157
- package/dist/ProfileView/components/Toolbars/index.d.ts +2 -2
- package/dist/ProfileView/components/Toolbars/index.d.ts.map +1 -1
- package/dist/ProfileView/components/Toolbars/index.js +441 -21
- package/dist/ProfileView/components/ViewSelector/Dropdown.js +233 -22
- package/dist/ProfileView/components/ViewSelector/index.d.ts.map +1 -1
- package/dist/ProfileView/components/ViewSelector/index.js +212 -86
- package/dist/ProfileView/components/VisualizationContainer/index.d.ts.map +1 -1
- package/dist/ProfileView/components/VisualizationContainer/index.js +52 -7
- package/dist/ProfileView/components/VisualizationPanel.js +185 -8
- package/dist/ProfileView/context/DashboardContext.d.ts.map +1 -1
- package/dist/ProfileView/context/DashboardContext.js +85 -29
- package/dist/ProfileView/context/ProfileViewContext.js +56 -15
- package/dist/ProfileView/hooks/useAutoSelectDimension.js +71 -41
- package/dist/ProfileView/hooks/useProfileMetadata.js +50 -18
- package/dist/ProfileView/hooks/useResetFlameGraphState.d.ts.map +1 -1
- package/dist/ProfileView/hooks/useResetFlameGraphState.js +32 -12
- package/dist/ProfileView/hooks/useResetStateOnProfileTypeChange.d.ts.map +1 -1
- package/dist/ProfileView/hooks/useResetStateOnProfileTypeChange.js +71 -27
- package/dist/ProfileView/hooks/useResetStateOnSeriesChange.d.ts.map +1 -1
- package/dist/ProfileView/hooks/useResetStateOnSeriesChange.js +40 -19
- package/dist/ProfileView/hooks/useVisualizationState.d.ts +3 -3
- package/dist/ProfileView/hooks/useVisualizationState.d.ts.map +1 -1
- package/dist/ProfileView/hooks/useVisualizationState.js +258 -67
- package/dist/ProfileView/index.js +383 -45
- package/dist/ProfileView/types/visualization.js +1 -13
- package/dist/ProfileView/utils/colorUtils.js +8 -7
- package/dist/ProfileViewWithData.d.ts.map +1 -1
- package/dist/ProfileViewWithData.js +332 -228
- package/dist/QueryControls/index.js +418 -47
- package/dist/Sandwich/components/CalleesSection.js +54 -4
- package/dist/Sandwich/components/CallersSection.js +97 -27
- package/dist/Sandwich/components/TableSection.js +77 -4
- package/dist/Sandwich/index.d.ts.map +1 -1
- package/dist/Sandwich/index.js +126 -14
- package/dist/Sandwich/utils/processRowData.js +48 -39
- package/dist/SelectWithRefresh/index.js +102 -28
- package/dist/SimpleMatchers/Select.js +520 -187
- package/dist/SimpleMatchers/index.js +590 -288
- package/dist/SourceView/Highlighter.js +230 -70
- package/dist/SourceView/LineNo.js +72 -17
- package/dist/SourceView/index.d.ts.map +1 -1
- package/dist/SourceView/index.js +178 -104
- package/dist/SourceView/lang-detector/ext-to-lang.json +798 -798
- package/dist/SourceView/lang-detector/index.js +28 -14
- package/dist/SourceView/useSelectedLineRange.d.ts.map +1 -1
- package/dist/SourceView/useSelectedLineRange.js +99 -23
- package/dist/Table/ColorCell.js +42 -1
- package/dist/Table/ColumnsVisibility.js +114 -6
- package/dist/Table/MoreDropdown.d.ts.map +1 -1
- package/dist/Table/MoreDropdown.js +122 -25
- package/dist/Table/TableContextMenu.d.ts.map +1 -1
- package/dist/Table/TableContextMenu.js +151 -137
- package/dist/Table/TableContextMenuWrapper.js +59 -14
- package/dist/Table/hooks/useColorManagement.js +58 -16
- package/dist/Table/hooks/useTableConfiguration.d.ts.map +1 -1
- package/dist/Table/hooks/useTableConfiguration.js +333 -169
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.js +222 -128
- package/dist/Table/utils/functions.js +169 -144
- package/dist/Table/utils/topAndBottomExpandedRowModel.js +69 -52
- package/dist/TimelineGuide/index.js +209 -16
- package/dist/TopTable/benchmarks/benchdata/populateData.js +91 -0
- package/dist/TopTable/index.d.ts.map +1 -1
- package/dist/TopTable/index.js +342 -123
- package/dist/contexts/LabelsQueryProvider.js +94 -32
- package/dist/contexts/UnifiedLabelsContext.js +114 -49
- package/dist/contexts/utils.js +37 -15
- package/dist/hooks/useCompareModeMeta.d.ts.map +1 -1
- package/dist/hooks/useCompareModeMeta.js +158 -64
- package/dist/hooks/useLabels.js +295 -52
- package/dist/hooks/useQueryState.d.ts +3 -3
- package/dist/hooks/useQueryState.d.ts.map +1 -1
- package/dist/hooks/useQueryState.js +373 -332
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -8
- package/dist/testdata/fg-diff.json +3750 -0
- package/dist/testdata/fg-simple.json +1879 -0
- package/dist/testdata/link_data.json +56 -0
- package/dist/testdata/tabular.json +30 -0
- package/dist/testdata/test_flamegraph.json +26846 -0
- package/dist/testdata/test_graph.json +53 -0
- package/dist/useDelayedLoader.js +32 -18
- package/dist/useGrpcQuery/index.js +71 -11
- package/dist/useHasProfileData.js +90 -12
- package/dist/useQuery.js +205 -64
- package/dist/useSumBy.d.ts +1 -1
- package/dist/useSumBy.d.ts.map +1 -1
- package/dist/useSumBy.js +294 -138
- package/dist/utils.js +62 -30
- package/package.json +9 -10
- package/src/GraphTooltipArrow/index.tsx +3 -0
- package/src/GraphTooltipArrow/useGraphTooltipMetaInfo/index.ts +13 -11
- package/src/MatchersInput/SuggestionsList.test.tsx +70 -0
- package/src/MatchersInput/SuggestionsList.tsx +11 -10
- package/src/MatchersInput/index.tsx +1 -1
- package/src/MetricsGraph/MetricsTooltip/index.tsx +22 -34
- package/src/PreSelectedMatchers/index.tsx +3 -0
- package/src/ProfileExplorer/ProfileExplorerCompare.tsx +9 -4
- package/src/ProfileFlameChart/SamplesStrips/index.tsx +2 -2
- package/src/ProfileFlameChart/index.tsx +28 -21
- package/src/ProfileFlameGraph/FlameGraphArrow/ContextMenu.tsx +9 -10
- package/src/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.tsx +6 -5
- package/src/ProfileFlameGraph/FlameGraphArrow/TooltipContext.tsx +3 -0
- package/src/ProfileFlameGraph/FlameGraphArrow/ZoomControls.tsx +3 -0
- package/src/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.ts +3 -0
- package/src/ProfileFlameGraph/index.tsx +9 -6
- package/src/ProfileMetricsGraph/index.tsx +8 -6
- package/src/ProfileSelector/MetricsGraphSection.tsx +10 -5
- package/src/ProfileSelector/index.tsx +61 -39
- package/src/ProfileView/components/ActionButtons/SortByDropdown.tsx +6 -10
- package/src/ProfileView/components/ColorStackLegend.tsx +4 -2
- package/src/ProfileView/components/InvertCallStack/index.tsx +4 -5
- package/src/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.test.tsx +192 -94
- package/src/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.ts +21 -21
- package/src/ProfileView/components/Toolbars/MultiLevelDropdown.tsx +28 -24
- package/src/ProfileView/components/Toolbars/TableColumnsDropdown.tsx +5 -4
- package/src/ProfileView/components/Toolbars/index.tsx +3 -3
- package/src/ProfileView/components/ViewSelector/index.tsx +16 -9
- package/src/ProfileView/components/VisualizationContainer/index.tsx +3 -0
- package/src/ProfileView/context/DashboardContext.tsx +6 -6
- package/src/ProfileView/hooks/useResetFlameGraphState.ts +4 -6
- package/src/ProfileView/hooks/useResetStateOnProfileTypeChange.ts +26 -24
- package/src/ProfileView/hooks/useResetStateOnSeriesChange.ts +8 -16
- package/src/ProfileView/hooks/useVisualizationState.ts +69 -61
- package/src/ProfileViewWithData.tsx +35 -29
- package/src/Sandwich/index.tsx +3 -4
- package/src/SourceView/index.tsx +2 -4
- package/src/SourceView/useSelectedLineRange.ts +19 -34
- package/src/Table/MoreDropdown.tsx +11 -9
- package/src/Table/TableContextMenu.tsx +13 -10
- package/src/Table/hooks/useTableConfiguration.tsx +11 -16
- package/src/Table/index.tsx +21 -12
- package/src/TopTable/index.tsx +4 -3
- package/src/hooks/useCompareModeMeta.ts +91 -61
- package/src/hooks/useQueryState.test.tsx +345 -275
- package/src/hooks/useQueryState.ts +118 -136
- package/src/index.tsx +15 -16
- package/src/useDelayedLoader.ts +10 -10
- package/src/useSumBy.ts +15 -21
- package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.test.js +0 -455
- package/dist/hooks/urlParsers.d.ts +0 -18
- package/dist/hooks/urlParsers.d.ts.map +0 -1
- package/dist/hooks/urlParsers.js +0 -32
- package/dist/hooks/useColorBy.d.ts +0 -5
- package/dist/hooks/useColorBy.d.ts.map +0 -1
- package/dist/hooks/useColorBy.js +0 -26
- package/dist/hooks/useDashboardItems.d.ts +0 -5
- package/dist/hooks/useDashboardItems.d.ts.map +0 -1
- package/dist/hooks/useDashboardItems.js +0 -27
- package/dist/hooks/useQueryState.test.js +0 -868
- package/src/hooks/urlParsers.ts +0 -38
- package/src/hooks/useColorBy.ts +0 -42
- package/src/hooks/useDashboardItems.ts +0 -46
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
3
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
5
|
+
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; }
|
|
6
|
+
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; } }
|
|
7
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
8
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
9
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
10
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
11
|
+
import { c as _c } from "react-compiler-runtime";
|
|
2
12
|
// Copyright 2022 The Parca Authors
|
|
3
13
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
14
|
// you may not use this file except in compliance with the License.
|
|
@@ -11,35 +21,236 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
11
21
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
22
|
// See the License for the specific language governing permissions and
|
|
13
23
|
// limitations under the License.
|
|
24
|
+
|
|
14
25
|
import { Fragment, useState } from 'react';
|
|
15
26
|
import { Listbox, Transition } from '@headlessui/react';
|
|
16
27
|
import { Icon } from '@iconify/react';
|
|
17
28
|
import cx from 'classnames';
|
|
18
29
|
import { Button, useParcaContext } from '@parca/components';
|
|
30
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
31
|
export function contructItemsFromArray(items) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
32
|
+
return items.map(function (item) {
|
|
33
|
+
return {
|
|
34
|
+
key: item.key,
|
|
35
|
+
element: {
|
|
36
|
+
active: /*#__PURE__*/_jsx(_Fragment, {
|
|
37
|
+
children: item.label
|
|
38
|
+
}),
|
|
39
|
+
expanded: /*#__PURE__*/_jsx(_Fragment, {
|
|
40
|
+
children: item.label
|
|
41
|
+
})
|
|
42
|
+
},
|
|
43
|
+
innerAction: item.innerAction
|
|
44
|
+
};
|
|
45
|
+
});
|
|
25
46
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
47
|
+
var Dropdown = function Dropdown(t0) {
|
|
48
|
+
var $ = _c(20);
|
|
49
|
+
var items = t0.items,
|
|
50
|
+
selectedKey = t0.selectedKey,
|
|
51
|
+
onSelection = t0.onSelection,
|
|
52
|
+
placeholder = t0.placeholder,
|
|
53
|
+
width = t0.width,
|
|
54
|
+
t1 = t0.className,
|
|
55
|
+
loading = t0.loading,
|
|
56
|
+
t2 = t0.primary,
|
|
57
|
+
t3 = t0.disabled,
|
|
58
|
+
icon = t0.icon,
|
|
59
|
+
id = t0.id,
|
|
60
|
+
t4 = t0.optionsClassName;
|
|
61
|
+
var className = t1 === undefined ? "" : t1;
|
|
62
|
+
var primary = t2 === undefined ? false : t2;
|
|
63
|
+
var disabled = t3 === undefined ? false : t3;
|
|
64
|
+
var optionsClassName = t4 === undefined ? "" : t4;
|
|
65
|
+
var t5;
|
|
66
|
+
if ($[0] !== items || $[1] !== selectedKey) {
|
|
67
|
+
var _items$find;
|
|
68
|
+
t5 = (_items$find = items.find(function (v) {
|
|
69
|
+
return v.key === selectedKey;
|
|
70
|
+
})) !== null && _items$find !== void 0 ? _items$find : {
|
|
71
|
+
key: selectedKey,
|
|
72
|
+
element: {
|
|
73
|
+
active: /*#__PURE__*/_jsx(_Fragment, {
|
|
74
|
+
children: selectedKey
|
|
75
|
+
}),
|
|
76
|
+
expanded: /*#__PURE__*/_jsx(_Fragment, {
|
|
77
|
+
children: selectedKey
|
|
78
|
+
})
|
|
79
|
+
}
|
|
30
80
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
81
|
+
$[0] = items;
|
|
82
|
+
$[1] = selectedKey;
|
|
83
|
+
$[2] = t5;
|
|
84
|
+
} else {
|
|
85
|
+
t5 = $[2];
|
|
86
|
+
}
|
|
87
|
+
var selection = t5;
|
|
88
|
+
var _useParcaContext = useParcaContext(),
|
|
89
|
+
loader = _useParcaContext.loader;
|
|
90
|
+
var t6;
|
|
91
|
+
if ($[3] !== className || $[4] !== disabled || $[5] !== icon || $[6] !== id || $[7] !== items || $[8] !== loader || $[9] !== loading || $[10] !== optionsClassName || $[11] !== placeholder || $[12] !== primary || $[13] !== selection || $[14] !== width) {
|
|
92
|
+
t6 = function t6(t7) {
|
|
93
|
+
var open = t7.open;
|
|
94
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
95
|
+
className: "relative",
|
|
96
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
97
|
+
id: id,
|
|
98
|
+
children: /*#__PURE__*/_jsxs(Listbox.Button, {
|
|
99
|
+
className: cx("relative border rounded-md shadow-sm px-4 py-2 text-left cursor-default focus:outline-none focus:ring-1 items-center focus:ring-indigo-500 focus:border-indigo-500 text-sm flex gap-2 flex items-center justify-between", width !== undefined ? "w-".concat(width) : "w-full", disabled ? "cursor-not-allowed opacity-50 pointer-events-none" : "", primary ? "text-gray-100 dark:gray-900 bg-indigo-600 border-indigo-500 font-medium py-2 px-4" : "bg-white dark:bg-gray-900 dark:border-gray-600", _defineProperty({}, className, className.length > 0)),
|
|
100
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
101
|
+
className: cx(icon != null ? "" : "block overflow-x-hidden text-ellipsis"),
|
|
102
|
+
children: (selection === null || selection === void 0 ? void 0 : selection.key) !== "" ? selection.element.active : placeholder
|
|
103
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
104
|
+
className: cx(icon != null ? "" : "pointer-events-none text-gray-400"),
|
|
105
|
+
children: icon !== null && icon !== void 0 ? icon : /*#__PURE__*/_jsx(Icon, {
|
|
106
|
+
icon: "heroicons:chevron-up-down-20-solid",
|
|
107
|
+
"aria-hidden": "true"
|
|
108
|
+
})
|
|
109
|
+
})]
|
|
110
|
+
})
|
|
111
|
+
}), /*#__PURE__*/_jsx(Transition, {
|
|
112
|
+
show: open,
|
|
113
|
+
as: Fragment,
|
|
114
|
+
leave: "transition ease-in duration-100",
|
|
115
|
+
leaveFrom: "opacity-100",
|
|
116
|
+
leaveTo: "opacity-0",
|
|
117
|
+
children: /*#__PURE__*/_jsx(Listbox.Options, {
|
|
118
|
+
className: cx(optionsClassName, "absolute w-[246px] right-0 z-50 mt-1 max-h-[50vh] overflow-auto rounded-md bg-gray-50 py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none dark:border-gray-600 dark:bg-gray-900 dark:ring-white dark:ring-opacity-20 sm:text-sm"),
|
|
119
|
+
children: loading === true ? /*#__PURE__*/_jsx("div", {
|
|
120
|
+
className: "w-[270px]",
|
|
121
|
+
children: loader
|
|
122
|
+
}) : items.length > 0 && items.map(_temp)
|
|
123
|
+
})
|
|
124
|
+
})]
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
$[3] = className;
|
|
128
|
+
$[4] = disabled;
|
|
129
|
+
$[5] = icon;
|
|
130
|
+
$[6] = id;
|
|
131
|
+
$[7] = items;
|
|
132
|
+
$[8] = loader;
|
|
133
|
+
$[9] = loading;
|
|
134
|
+
$[10] = optionsClassName;
|
|
135
|
+
$[11] = placeholder;
|
|
136
|
+
$[12] = primary;
|
|
137
|
+
$[13] = selection;
|
|
138
|
+
$[14] = width;
|
|
139
|
+
$[15] = t6;
|
|
140
|
+
} else {
|
|
141
|
+
t6 = $[15];
|
|
142
|
+
}
|
|
143
|
+
var t7;
|
|
144
|
+
if ($[16] !== onSelection || $[17] !== selectedKey || $[18] !== t6) {
|
|
145
|
+
t7 = /*#__PURE__*/_jsx(Listbox, {
|
|
146
|
+
value: selectedKey,
|
|
147
|
+
onChange: onSelection,
|
|
148
|
+
children: t6
|
|
149
|
+
});
|
|
150
|
+
$[16] = onSelection;
|
|
151
|
+
$[17] = selectedKey;
|
|
152
|
+
$[18] = t6;
|
|
153
|
+
$[19] = t7;
|
|
154
|
+
} else {
|
|
155
|
+
t7 = $[19];
|
|
156
|
+
}
|
|
157
|
+
return t7;
|
|
37
158
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
159
|
+
var DropdownOption = function DropdownOption(t0) {
|
|
160
|
+
var _option$id, _option$disabled;
|
|
161
|
+
var $ = _c(10);
|
|
162
|
+
var option = t0.option;
|
|
163
|
+
var _useState = useState(false),
|
|
164
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
165
|
+
isMouseOver = _useState2[0],
|
|
166
|
+
setIsMouseOver = _useState2[1];
|
|
167
|
+
var t1 = (_option$id = option.id) !== null && _option$id !== void 0 ? _option$id : "h-select-option-".concat(option.key);
|
|
168
|
+
var t2 = (_option$disabled = option.disabled) !== null && _option$disabled !== void 0 ? _option$disabled : false;
|
|
169
|
+
var t3;
|
|
170
|
+
if ($[0] !== isMouseOver || $[1] !== option.disabledText || $[2] !== option.element.expanded || $[3] !== option.innerAction) {
|
|
171
|
+
t3 = function t3(t4) {
|
|
172
|
+
var _option$innerAction2;
|
|
173
|
+
var selected = t4.selected,
|
|
174
|
+
active_0 = t4.active,
|
|
175
|
+
disabled = t4.disabled;
|
|
176
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
177
|
+
className: "relative flex items-center w-full justify-between",
|
|
178
|
+
onMouseEnter: function onMouseEnter() {
|
|
179
|
+
return setIsMouseOver(true);
|
|
180
|
+
},
|
|
181
|
+
onMouseLeave: function onMouseLeave() {
|
|
182
|
+
return setIsMouseOver(false);
|
|
183
|
+
},
|
|
184
|
+
children: [isMouseOver && disabled && option.disabledText != null ? /*#__PURE__*/_jsxs("div", {
|
|
185
|
+
className: "absolute top-[-60px] text-gray-500 dark:text-gray-400 text-xs bg-white dark:bg-black border rounded p-2 z-100 w-52 text-center",
|
|
186
|
+
onMouseEnter: function onMouseEnter() {
|
|
187
|
+
return setIsMouseOver(false);
|
|
188
|
+
},
|
|
189
|
+
children: [option.disabledText, /*#__PURE__*/_jsx("div", {
|
|
190
|
+
className: "absolute left-1/2 -translate-x-1/2 top-full h-0 w-0 border-l-4 border-r-4 border-t-4 border-l-transparent border-r-transparent"
|
|
191
|
+
})]
|
|
192
|
+
}) : null, /*#__PURE__*/_jsx("div", {
|
|
193
|
+
className: "flex items-center",
|
|
194
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
195
|
+
className: cx(selected ? "font-semibold" : "font-normal", disabled && "opacity-50"),
|
|
196
|
+
children: option.element.expanded
|
|
197
|
+
})
|
|
198
|
+
}), option.innerAction !== undefined && /*#__PURE__*/_jsxs(Button, {
|
|
199
|
+
variant: "neutral",
|
|
200
|
+
className: "p-[6px]",
|
|
201
|
+
onClick: function onClick(e) {
|
|
202
|
+
var _option$innerAction;
|
|
203
|
+
e.stopPropagation();
|
|
204
|
+
(_option$innerAction = option.innerAction) === null || _option$innerAction === void 0 || _option$innerAction.onClick();
|
|
205
|
+
},
|
|
206
|
+
disabled: (_option$innerAction2 = option.innerAction) === null || _option$innerAction2 === void 0 ? void 0 : _option$innerAction2.isDisabled,
|
|
207
|
+
children: [option.innerAction.text, option.innerAction.text === "Add Panel" && /*#__PURE__*/_jsx(Icon, {
|
|
208
|
+
icon: "ic:baseline-plus",
|
|
209
|
+
className: "w-[14px] h-[14px] ml-2"
|
|
210
|
+
})]
|
|
211
|
+
}), selected ? /*#__PURE__*/_jsx("span", {
|
|
212
|
+
className: cx(active_0 ? "text-white" : "text-indigo-600", "absolute inset-y-0 right-0 flex items-center pr-4"),
|
|
213
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
214
|
+
icon: "heroicons:check-20-solid",
|
|
215
|
+
"aria-hidden": "true"
|
|
216
|
+
})
|
|
217
|
+
}) : null]
|
|
218
|
+
});
|
|
219
|
+
};
|
|
220
|
+
$[0] = isMouseOver;
|
|
221
|
+
$[1] = option.disabledText;
|
|
222
|
+
$[2] = option.element.expanded;
|
|
223
|
+
$[3] = option.innerAction;
|
|
224
|
+
$[4] = t3;
|
|
225
|
+
} else {
|
|
226
|
+
t3 = $[4];
|
|
227
|
+
}
|
|
228
|
+
var t4;
|
|
229
|
+
if ($[5] !== option.key || $[6] !== t1 || $[7] !== t2 || $[8] !== t3) {
|
|
230
|
+
t4 = /*#__PURE__*/_jsx(Listbox.Option, {
|
|
231
|
+
id: t1,
|
|
232
|
+
disabled: t2,
|
|
233
|
+
className: _temp2,
|
|
234
|
+
value: option.key,
|
|
235
|
+
children: t3
|
|
236
|
+
}, option.key);
|
|
237
|
+
$[5] = option.key;
|
|
238
|
+
$[6] = t1;
|
|
239
|
+
$[7] = t2;
|
|
240
|
+
$[8] = t3;
|
|
241
|
+
$[9] = t4;
|
|
242
|
+
} else {
|
|
243
|
+
t4 = $[9];
|
|
244
|
+
}
|
|
245
|
+
return t4;
|
|
44
246
|
};
|
|
45
247
|
export default Dropdown;
|
|
248
|
+
function _temp(option) {
|
|
249
|
+
return /*#__PURE__*/_jsx(DropdownOption, {
|
|
250
|
+
option: option
|
|
251
|
+
}, option.key);
|
|
252
|
+
}
|
|
253
|
+
function _temp2(t0) {
|
|
254
|
+
var active = t0.active;
|
|
255
|
+
return cx(active && "bg-indigo-600 text-white", "relative flex cursor-default select-none py-2 px-3");
|
|
256
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/ViewSelector/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/ViewSelector/index.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAGrD,UAAU,KAAK;IACb,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED,QAAA,MAAM,YAAY,GAAI,mBAAiB,KAAK,KAAG,GAAG,CAAC,OA+JlD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,95 +1,221 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
2
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
4
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
5
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
6
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
8
|
+
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; }
|
|
9
|
+
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; } }
|
|
10
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
11
|
+
import { c as _c } from "react-compiler-runtime"; // Copyright 2022 The Parca Authors
|
|
12
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
13
|
+
// you may not use this file except in compliance with the License.
|
|
14
|
+
// You may obtain a copy of the License at
|
|
15
|
+
//
|
|
16
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
+
//
|
|
18
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
19
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
20
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21
|
+
// See the License for the specific language governing permissions and
|
|
22
|
+
// limitations under the License.
|
|
23
|
+
import { useParcaContext, useURLState, useURLStateBatch } from '@parca/components';
|
|
6
24
|
import Dropdown from './Dropdown';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
];
|
|
25
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
26
|
+
var ViewSelector = function ViewSelector(t0) {
|
|
27
|
+
var $ = _c(21);
|
|
28
|
+
var profileSource = t0.profileSource;
|
|
29
|
+
var t1;
|
|
30
|
+
if ($[0] === Symbol["for"]("react.memo_cache_sentinel")) {
|
|
31
|
+
t1 = {
|
|
32
|
+
alwaysReturnArray: true
|
|
33
|
+
};
|
|
34
|
+
$[0] = t1;
|
|
35
|
+
} else {
|
|
36
|
+
t1 = $[0];
|
|
37
|
+
}
|
|
38
|
+
var _useURLState = useURLState("dashboard_items", t1),
|
|
39
|
+
_useURLState2 = _slicedToArray(_useURLState, 2),
|
|
40
|
+
t2 = _useURLState2[0],
|
|
41
|
+
setDashboardItems = _useURLState2[1];
|
|
42
|
+
var t3;
|
|
43
|
+
if ($[1] !== t2) {
|
|
44
|
+
t3 = t2 === undefined ? ["flamegraph"] : t2;
|
|
45
|
+
$[1] = t2;
|
|
46
|
+
$[2] = t3;
|
|
47
|
+
} else {
|
|
48
|
+
t3 = $[2];
|
|
49
|
+
}
|
|
50
|
+
var dashboardItems = t3;
|
|
51
|
+
var _useURLState3 = useURLState("sandwich_function_name"),
|
|
52
|
+
_useURLState4 = _slicedToArray(_useURLState3, 2),
|
|
53
|
+
setSandwichFunctionName = _useURLState4[1];
|
|
54
|
+
var _useParcaContext = useParcaContext(),
|
|
55
|
+
enableSourcesView = _useParcaContext.enableSourcesView,
|
|
56
|
+
enableSandwichView = _useParcaContext.enableSandwichView;
|
|
57
|
+
var batchUpdates = useURLStateBatch();
|
|
58
|
+
var t4;
|
|
59
|
+
if ($[3] !== dashboardItems) {
|
|
60
|
+
t4 = dashboardItems.includes("flamegraph");
|
|
61
|
+
$[3] = dashboardItems;
|
|
62
|
+
$[4] = t4;
|
|
63
|
+
} else {
|
|
64
|
+
t4 = $[4];
|
|
65
|
+
}
|
|
66
|
+
var t5 = !t4;
|
|
67
|
+
var t6;
|
|
68
|
+
if ($[5] !== batchUpdates || $[6] !== dashboardItems || $[7] !== enableSandwichView || $[8] !== enableSourcesView || $[9] !== profileSource || $[10] !== setDashboardItems || $[11] !== setSandwichFunctionName || $[12] !== t5) {
|
|
69
|
+
var allItems = [{
|
|
70
|
+
key: "flamegraph",
|
|
71
|
+
label: "Flame Graph",
|
|
72
|
+
canBeSelected: t5
|
|
73
|
+
}, {
|
|
74
|
+
key: "table",
|
|
75
|
+
label: "Table",
|
|
76
|
+
canBeSelected: !dashboardItems.includes("table")
|
|
77
|
+
}, {
|
|
78
|
+
key: "flamechart",
|
|
79
|
+
label: /*#__PURE__*/_jsxs("span", {
|
|
80
|
+
className: "relative",
|
|
81
|
+
children: ["Flame Chart", /*#__PURE__*/_jsx("span", {
|
|
82
|
+
className: "absolute top-[-2px] text-xs lowercase text-red-500",
|
|
83
|
+
children: "\xA0alpha"
|
|
84
|
+
})]
|
|
85
|
+
}),
|
|
86
|
+
canBeSelected: !dashboardItems.includes("flamechart") && (profileSource === null || profileSource === void 0 ? void 0 : profileSource.ProfileType().delta) === true,
|
|
87
|
+
disabledText: !dashboardItems.includes("flamechart") && (profileSource === null || profileSource === void 0 ? void 0 : profileSource.ProfileType().delta) !== true ? "Flamechart is not available for non-delta profiles" : undefined
|
|
88
|
+
}];
|
|
27
89
|
if (enableSandwichView === true) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
90
|
+
allItems.push({
|
|
91
|
+
key: "sandwich",
|
|
92
|
+
label: /*#__PURE__*/_jsxs("span", {
|
|
93
|
+
className: "relative",
|
|
94
|
+
children: ["Sandwich", /*#__PURE__*/_jsx("span", {
|
|
95
|
+
className: "absolute top-[-2px] text-xs lowercase text-red-500",
|
|
96
|
+
children: "\xA0alpha"
|
|
97
|
+
})]
|
|
98
|
+
}),
|
|
99
|
+
canBeSelected: !dashboardItems.includes("sandwich")
|
|
100
|
+
});
|
|
33
101
|
}
|
|
34
102
|
if (enableSourcesView === true) {
|
|
35
|
-
|
|
103
|
+
allItems.push({
|
|
104
|
+
key: "source",
|
|
105
|
+
label: "Source",
|
|
106
|
+
canBeSelected: false
|
|
107
|
+
});
|
|
36
108
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
void setSandwichFunctionName(null);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
isDisabled: dashboardItems.length === 1 && dashboardItems.includes('sandwich'),
|
|
71
|
-
};
|
|
109
|
+
var getOption = _temp;
|
|
110
|
+
var getInnerActionForItem = function getInnerActionForItem(item) {
|
|
111
|
+
if (dashboardItems.length === 1 && item.key === dashboardItems[0]) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
if (dashboardItems.length >= 2 && !dashboardItems.includes(item.key)) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
return {
|
|
118
|
+
text: !item.canBeSelected && item.key === "source" ? "Add Panel" : item.canBeSelected ? "Add Panel" : dashboardItems.includes(item.key) ? "Close Panel" : "Add Panel",
|
|
119
|
+
onClick: function onClick() {
|
|
120
|
+
if (item.canBeSelected) {
|
|
121
|
+
setDashboardItems([].concat(_toConsumableArray(dashboardItems), [item.key]));
|
|
122
|
+
} else {
|
|
123
|
+
var newDashboardItems = dashboardItems.filter(function (v) {
|
|
124
|
+
return v !== item.key;
|
|
125
|
+
});
|
|
126
|
+
if (item.key === "sandwich") {
|
|
127
|
+
batchUpdates(function () {
|
|
128
|
+
setDashboardItems(newDashboardItems);
|
|
129
|
+
setSandwichFunctionName(undefined);
|
|
130
|
+
});
|
|
131
|
+
} else {
|
|
132
|
+
setDashboardItems(newDashboardItems);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
isDisabled: dashboardItems.length === 1 && dashboardItems.includes("sandwich")
|
|
137
|
+
};
|
|
72
138
|
};
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
139
|
+
t6 = allItems.map(function (item_0) {
|
|
140
|
+
return {
|
|
141
|
+
key: item_0.key,
|
|
142
|
+
disabled: !item_0.canBeSelected,
|
|
143
|
+
disabledText: item_0.disabledText,
|
|
144
|
+
element: getOption(item_0),
|
|
145
|
+
innerAction: getInnerActionForItem(item_0)
|
|
146
|
+
};
|
|
147
|
+
});
|
|
148
|
+
$[5] = batchUpdates;
|
|
149
|
+
$[6] = dashboardItems;
|
|
150
|
+
$[7] = enableSandwichView;
|
|
151
|
+
$[8] = enableSourcesView;
|
|
152
|
+
$[9] = profileSource;
|
|
153
|
+
$[10] = setDashboardItems;
|
|
154
|
+
$[11] = setSandwichFunctionName;
|
|
155
|
+
$[12] = t5;
|
|
156
|
+
$[13] = t6;
|
|
157
|
+
} else {
|
|
158
|
+
t6 = $[13];
|
|
159
|
+
}
|
|
160
|
+
var items = t6;
|
|
161
|
+
var t7;
|
|
162
|
+
if ($[14] !== dashboardItems || $[15] !== setDashboardItems) {
|
|
163
|
+
t7 = function t7(value) {
|
|
164
|
+
var isOnlyChart = dashboardItems.length === 1;
|
|
165
|
+
if (isOnlyChart && value === "sandwich") {
|
|
166
|
+
setDashboardItems([].concat(_toConsumableArray(dashboardItems), [value]));
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
if (isOnlyChart) {
|
|
170
|
+
setDashboardItems([value]);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
var newDashboardItems_0 = [dashboardItems[0], value];
|
|
174
|
+
setDashboardItems(newDashboardItems_0);
|
|
92
175
|
};
|
|
93
|
-
|
|
176
|
+
$[14] = dashboardItems;
|
|
177
|
+
$[15] = setDashboardItems;
|
|
178
|
+
$[16] = t7;
|
|
179
|
+
} else {
|
|
180
|
+
t7 = $[16];
|
|
181
|
+
}
|
|
182
|
+
var onSelection = t7;
|
|
183
|
+
var t8 = dashboardItems.length >= 2 ? "Multiple" : dashboardItems[0];
|
|
184
|
+
var t9;
|
|
185
|
+
if ($[17] !== items || $[18] !== onSelection || $[19] !== t8) {
|
|
186
|
+
t9 = /*#__PURE__*/_jsx(Dropdown, {
|
|
187
|
+
className: "h-view-selector",
|
|
188
|
+
items: items,
|
|
189
|
+
selectedKey: t8,
|
|
190
|
+
onSelection: onSelection,
|
|
191
|
+
placeholder: "Select view type...",
|
|
192
|
+
id: "h-view-selector",
|
|
193
|
+
optionsClassName: "min-w-[260px]"
|
|
194
|
+
});
|
|
195
|
+
$[17] = items;
|
|
196
|
+
$[18] = onSelection;
|
|
197
|
+
$[19] = t8;
|
|
198
|
+
$[20] = t9;
|
|
199
|
+
} else {
|
|
200
|
+
t9 = $[20];
|
|
201
|
+
}
|
|
202
|
+
return t9;
|
|
94
203
|
};
|
|
95
204
|
export default ViewSelector;
|
|
205
|
+
function _temp(t0) {
|
|
206
|
+
var label = t0.label,
|
|
207
|
+
supportingText = t0.supportingText;
|
|
208
|
+
var title = /*#__PURE__*/_jsx("span", {
|
|
209
|
+
className: "capitalize whitespace-nowrap",
|
|
210
|
+
children: typeof label === "string" ? label.replaceAll("-", " ") : label
|
|
211
|
+
});
|
|
212
|
+
return {
|
|
213
|
+
active: title,
|
|
214
|
+
expanded: /*#__PURE__*/_jsxs(_Fragment, {
|
|
215
|
+
children: [title, supportingText !== null && /*#__PURE__*/_jsx("span", {
|
|
216
|
+
className: "text-xs",
|
|
217
|
+
children: supportingText
|
|
218
|
+
})]
|
|
219
|
+
})
|
|
220
|
+
};
|
|
221
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/VisualizationContainer/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/VisualizationContainer/index.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAC,EAAE,EAAC,MAAM,OAAO,CAAC;AAGzB,OAAO,KAAK,EAAC,iBAAiB,EAAE,sBAAsB,EAAC,MAAM,qBAAqB,CAAC;AAGnF,OAAO,EAAC,iBAAiB,EAAC,MAAM,2BAA2B,CAAC;AAG5D,UAAU,2BAA2B;IACnC,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,QAAQ,EAAE,sBAAsB,CAAC;IACjC,aAAa,EAAE,iBAAiB,CAAC;IACjC,sBAAsB,EAAE,CAAC,KAAK,EAAE;QAAC,IAAI,EAAE,iBAAiB,CAAC;QAAC,YAAY,EAAE,OAAO,CAAA;KAAC,KAAK,GAAG,CAAC,OAAO,CAAC;IACjG,gBAAgB,EAAE,OAAO,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE;QACb,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC;QACnB,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC;KACpB,CAAC;CACH;AAED,eAAO,MAAM,sBAAsB,EAAE,EAAE,CAAC,2BAA2B,CAuClE,CAAC"}
|