@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,3 +1,6 @@
|
|
|
1
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
2
|
+
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; } }
|
|
3
|
+
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; }
|
|
1
4
|
// Copyright 2022 The Parca Authors
|
|
2
5
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
6
|
// you may not use this file except in compliance with the License.
|
|
@@ -10,20 +13,31 @@
|
|
|
10
13
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
14
|
// See the License for the specific language governing permissions and
|
|
12
15
|
// limitations under the License.
|
|
16
|
+
|
|
13
17
|
import * as hljsLangs from 'react-syntax-highlighter/dist/cjs/languages/hljs';
|
|
14
18
|
import _extLangMap from './ext-to-lang.json';
|
|
15
|
-
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
const langs = extLangMap[extension];
|
|
22
|
-
for (const lang of langs) {
|
|
23
|
-
// eslint-disable-next-line import/namespace
|
|
24
|
-
if (hljsLangs[lang] != null) {
|
|
25
|
-
return lang;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
19
|
+
var extLangMap = _extLangMap;
|
|
20
|
+
export var langaugeFromFile = function langaugeFromFile(file) {
|
|
21
|
+
var _file$split$pop;
|
|
22
|
+
var extension = (_file$split$pop = file.split('.').pop()) !== null && _file$split$pop !== void 0 ? _file$split$pop : '';
|
|
23
|
+
if (extLangMap[extension] == null) {
|
|
28
24
|
return 'text';
|
|
29
|
-
}
|
|
25
|
+
}
|
|
26
|
+
var langs = extLangMap[extension];
|
|
27
|
+
var _iterator = _createForOfIteratorHelper(langs),
|
|
28
|
+
_step;
|
|
29
|
+
try {
|
|
30
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
31
|
+
var lang = _step.value;
|
|
32
|
+
// eslint-disable-next-line import/namespace
|
|
33
|
+
if (hljsLangs[lang] != null) {
|
|
34
|
+
return lang;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
} catch (err) {
|
|
38
|
+
_iterator.e(err);
|
|
39
|
+
} finally {
|
|
40
|
+
_iterator.f();
|
|
41
|
+
}
|
|
42
|
+
return 'text';
|
|
43
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSelectedLineRange.d.ts","sourceRoot":"","sources":["../../src/SourceView/useSelectedLineRange.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSelectedLineRange.d.ts","sourceRoot":"","sources":["../../src/SourceView/useSelectedLineRange.ts"],"names":[],"mappings":"AAiBA,UAAU,SAAS;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACpD;AAED,QAAA,MAAM,YAAY,QAAO,SAmBxB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
+
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."); }
|
|
3
|
+
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; } }
|
|
4
|
+
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; }
|
|
5
|
+
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; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
|
+
import { c as _c } from "react-compiler-runtime";
|
|
1
8
|
// Copyright 2022 The Parca Authors
|
|
2
9
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
10
|
// you may not use this file except in compliance with the License.
|
|
@@ -10,28 +17,97 @@
|
|
|
10
17
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
18
|
// See the License for the specific language governing permissions and
|
|
12
19
|
// limitations under the License.
|
|
13
|
-
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
20
|
+
|
|
21
|
+
import { useMemo } from 'react';
|
|
22
|
+
import { useURLState } from '@parca/components';
|
|
23
|
+
var useLineRange = function useLineRange() {
|
|
24
|
+
var $ = _c(15);
|
|
25
|
+
var _useURLState = useURLState("source_line"),
|
|
26
|
+
_useURLState2 = _slicedToArray(_useURLState, 2),
|
|
27
|
+
sourceLine = _useURLState2[0],
|
|
28
|
+
setSourceLine = _useURLState2[1];
|
|
29
|
+
var t0;
|
|
30
|
+
bb0: {
|
|
31
|
+
if (sourceLine == null) {
|
|
32
|
+
var _t;
|
|
33
|
+
if ($[0] === Symbol["for"]("react.memo_cache_sentinel")) {
|
|
34
|
+
_t = [-1, -1];
|
|
35
|
+
$[0] = _t;
|
|
36
|
+
} else {
|
|
37
|
+
_t = $[0];
|
|
38
|
+
}
|
|
39
|
+
t0 = _t;
|
|
40
|
+
break bb0;
|
|
41
|
+
}
|
|
42
|
+
var _t2;
|
|
43
|
+
if ($[1] !== sourceLine) {
|
|
44
|
+
_t2 = sourceLine.split("-");
|
|
45
|
+
$[1] = sourceLine;
|
|
46
|
+
$[2] = _t2;
|
|
47
|
+
} else {
|
|
48
|
+
_t2 = $[2];
|
|
49
|
+
}
|
|
50
|
+
var _t3 = _t2,
|
|
51
|
+
_t4 = _slicedToArray(_t3, 2),
|
|
52
|
+
start = _t4[0],
|
|
53
|
+
end = _t4[1];
|
|
54
|
+
if (end === undefined) {
|
|
55
|
+
var _t5 = parseInt(start, 10);
|
|
56
|
+
var _t6 = parseInt(start, 10);
|
|
57
|
+
var _t7;
|
|
58
|
+
if ($[3] !== _t5 || $[4] !== _t6) {
|
|
59
|
+
_t7 = [_t5, _t6];
|
|
60
|
+
$[3] = _t5;
|
|
61
|
+
$[4] = _t6;
|
|
62
|
+
$[5] = _t7;
|
|
63
|
+
} else {
|
|
64
|
+
_t7 = $[5];
|
|
65
|
+
}
|
|
66
|
+
t0 = _t7;
|
|
67
|
+
break bb0;
|
|
68
|
+
}
|
|
69
|
+
var _t8 = parseInt(start, 10);
|
|
70
|
+
var t3 = parseInt(end, 10);
|
|
71
|
+
var t4;
|
|
72
|
+
if ($[6] !== _t8 || $[7] !== t3) {
|
|
73
|
+
t4 = [_t8, t3];
|
|
74
|
+
$[6] = _t8;
|
|
75
|
+
$[7] = t3;
|
|
76
|
+
$[8] = t4;
|
|
77
|
+
} else {
|
|
78
|
+
t4 = $[8];
|
|
79
|
+
}
|
|
80
|
+
t0 = t4;
|
|
81
|
+
}
|
|
82
|
+
var _t9 = t0,
|
|
83
|
+
_t0 = _slicedToArray(_t9, 2),
|
|
84
|
+
startLine = _t0[0],
|
|
85
|
+
endLine = _t0[1];
|
|
86
|
+
var t1;
|
|
87
|
+
if ($[9] !== setSourceLine) {
|
|
88
|
+
t1 = function t1(start_0, end_0) {
|
|
89
|
+
setSourceLine("".concat(start_0, "-").concat(end_0));
|
|
35
90
|
};
|
|
91
|
+
$[9] = setSourceLine;
|
|
92
|
+
$[10] = t1;
|
|
93
|
+
} else {
|
|
94
|
+
t1 = $[10];
|
|
95
|
+
}
|
|
96
|
+
var setLineRange = t1;
|
|
97
|
+
var t2;
|
|
98
|
+
if ($[11] !== endLine || $[12] !== setLineRange || $[13] !== startLine) {
|
|
99
|
+
t2 = {
|
|
100
|
+
startLine: startLine,
|
|
101
|
+
endLine: endLine,
|
|
102
|
+
setLineRange: setLineRange
|
|
103
|
+
};
|
|
104
|
+
$[11] = endLine;
|
|
105
|
+
$[12] = setLineRange;
|
|
106
|
+
$[13] = startLine;
|
|
107
|
+
$[14] = t2;
|
|
108
|
+
} else {
|
|
109
|
+
t2 = $[14];
|
|
110
|
+
}
|
|
111
|
+
return t2;
|
|
36
112
|
};
|
|
37
|
-
export default useLineRange;
|
|
113
|
+
export default useLineRange;
|
package/dist/Table/ColorCell.js
CHANGED
|
@@ -1,2 +1,43 @@
|
|
|
1
|
+
import { c as _c } from "react-compiler-runtime"; // Copyright 2022 The Parca Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
1
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
export
|
|
14
|
+
export var ColorCell = function ColorCell(t0) {
|
|
15
|
+
var $ = _c(5);
|
|
16
|
+
var color = t0.color,
|
|
17
|
+
mappingFile = t0.mappingFile;
|
|
18
|
+
var t1;
|
|
19
|
+
if ($[0] !== color) {
|
|
20
|
+
t1 = {
|
|
21
|
+
backgroundColor: color
|
|
22
|
+
};
|
|
23
|
+
$[0] = color;
|
|
24
|
+
$[1] = t1;
|
|
25
|
+
} else {
|
|
26
|
+
t1 = $[1];
|
|
27
|
+
}
|
|
28
|
+
var t2;
|
|
29
|
+
if ($[2] !== mappingFile || $[3] !== t1) {
|
|
30
|
+
t2 = /*#__PURE__*/_jsx("div", {
|
|
31
|
+
className: "w-4 h-4 rounded-[4px]",
|
|
32
|
+
style: t1,
|
|
33
|
+
"data-tooltip-id": "table-color-tooltip",
|
|
34
|
+
"data-tooltip-content": mappingFile
|
|
35
|
+
});
|
|
36
|
+
$[2] = mappingFile;
|
|
37
|
+
$[3] = t1;
|
|
38
|
+
$[4] = t2;
|
|
39
|
+
} else {
|
|
40
|
+
t2 = $[4];
|
|
41
|
+
}
|
|
42
|
+
return t2;
|
|
43
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react-compiler-runtime";
|
|
2
2
|
// Copyright 2022 The Parca Authors
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -11,12 +11,120 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
11
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
|
+
|
|
14
15
|
import { Fragment } from 'react';
|
|
15
16
|
import { Menu, Transition } from '@headlessui/react';
|
|
16
17
|
import { Icon } from '@iconify/react';
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
+
var ColumnsVisibility = function ColumnsVisibility(t0) {
|
|
20
|
+
var $ = _c(11);
|
|
21
|
+
var columns = t0.columns,
|
|
22
|
+
visibility = t0.visibility,
|
|
23
|
+
setVisibility = t0.setVisibility;
|
|
24
|
+
var t1;
|
|
25
|
+
if ($[0] === Symbol["for"]("react.memo_cache_sentinel")) {
|
|
26
|
+
t1 = /*#__PURE__*/_jsx("span", {
|
|
27
|
+
className: "block overflow-x-hidden text-ellipsis",
|
|
28
|
+
children: "Multiple"
|
|
29
|
+
});
|
|
30
|
+
$[0] = t1;
|
|
31
|
+
} else {
|
|
32
|
+
t1 = $[0];
|
|
33
|
+
}
|
|
34
|
+
var t2;
|
|
35
|
+
if ($[1] === Symbol["for"]("react.memo_cache_sentinel")) {
|
|
36
|
+
t2 = /*#__PURE__*/_jsx("div", {
|
|
37
|
+
children: /*#__PURE__*/_jsxs(Menu.Button, {
|
|
38
|
+
className: "relative w-full cursor-default rounded-md border bg-white py-2 pl-3 pr-10 text-left text-sm shadow-sm focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500 dark:border-gray-600 dark:bg-gray-900 sm:text-sm",
|
|
39
|
+
children: [t1, /*#__PURE__*/_jsx("span", {
|
|
40
|
+
className: "pointer-events-none absolute inset-y-0 right-0 ml-3 flex items-center pr-2 text-gray-400",
|
|
41
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
42
|
+
icon: "heroicons:chevron-down-20-solid",
|
|
43
|
+
"aria-hidden": "true"
|
|
44
|
+
})
|
|
45
|
+
})]
|
|
46
|
+
})
|
|
47
|
+
});
|
|
48
|
+
$[1] = t2;
|
|
49
|
+
} else {
|
|
50
|
+
t2 = $[1];
|
|
51
|
+
}
|
|
52
|
+
var t3;
|
|
53
|
+
if ($[2] !== columns || $[3] !== setVisibility || $[4] !== visibility) {
|
|
54
|
+
var _t;
|
|
55
|
+
if ($[6] !== setVisibility || $[7] !== visibility) {
|
|
56
|
+
_t = function _t(col) {
|
|
57
|
+
var _visibility, _col$id;
|
|
58
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
59
|
+
className: "relative flex items-start",
|
|
60
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
61
|
+
className: "flex h-6 items-center",
|
|
62
|
+
children: /*#__PURE__*/_jsx("input", {
|
|
63
|
+
id: col.id,
|
|
64
|
+
name: col.id,
|
|
65
|
+
type: "checkbox",
|
|
66
|
+
className: "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600",
|
|
67
|
+
checked: (_visibility = visibility[(_col$id = col.id) !== null && _col$id !== void 0 ? _col$id : ""]) !== null && _visibility !== void 0 ? _visibility : false,
|
|
68
|
+
onChange: function onChange() {
|
|
69
|
+
var _col$id2, _col$id3;
|
|
70
|
+
setVisibility((_col$id2 = col.id) !== null && _col$id2 !== void 0 ? _col$id2 : "", !visibility[(_col$id3 = col.id) !== null && _col$id3 !== void 0 ? _col$id3 : ""]);
|
|
71
|
+
}
|
|
72
|
+
})
|
|
73
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
74
|
+
className: "ml-3 text-sm leading-6",
|
|
75
|
+
children: /*#__PURE__*/_jsx("label", {
|
|
76
|
+
htmlFor: col.id,
|
|
77
|
+
className: "font-medium text-gray-900 dark:text-gray-200",
|
|
78
|
+
children: col.header
|
|
79
|
+
})
|
|
80
|
+
})]
|
|
81
|
+
}, col.id);
|
|
82
|
+
};
|
|
83
|
+
$[6] = setVisibility;
|
|
84
|
+
$[7] = visibility;
|
|
85
|
+
$[8] = _t;
|
|
86
|
+
} else {
|
|
87
|
+
_t = $[8];
|
|
88
|
+
}
|
|
89
|
+
t3 = columns.map(_t);
|
|
90
|
+
$[2] = columns;
|
|
91
|
+
$[3] = setVisibility;
|
|
92
|
+
$[4] = visibility;
|
|
93
|
+
$[5] = t3;
|
|
94
|
+
} else {
|
|
95
|
+
t3 = $[5];
|
|
96
|
+
}
|
|
97
|
+
var t4;
|
|
98
|
+
if ($[9] !== t3) {
|
|
99
|
+
t4 = /*#__PURE__*/_jsx("div", {
|
|
100
|
+
children: /*#__PURE__*/_jsxs(Menu, {
|
|
101
|
+
as: "div",
|
|
102
|
+
className: "relative text-left",
|
|
103
|
+
children: [t2, /*#__PURE__*/_jsx(Transition, {
|
|
104
|
+
as: Fragment,
|
|
105
|
+
leave: "transition ease-in duration-100",
|
|
106
|
+
leaveFrom: "opacity-100",
|
|
107
|
+
leaveTo: "opacity-0",
|
|
108
|
+
children: /*#__PURE__*/_jsx(Menu.Items, {
|
|
109
|
+
className: "absolute left-0 z-10 mt-1 min-w-[400px] 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",
|
|
110
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
111
|
+
className: "p-4",
|
|
112
|
+
children: /*#__PURE__*/_jsx("fieldset", {
|
|
113
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
114
|
+
className: "space-y-5",
|
|
115
|
+
children: t3
|
|
116
|
+
})
|
|
117
|
+
})
|
|
118
|
+
})
|
|
119
|
+
})
|
|
120
|
+
})]
|
|
121
|
+
})
|
|
122
|
+
});
|
|
123
|
+
$[9] = t3;
|
|
124
|
+
$[10] = t4;
|
|
125
|
+
} else {
|
|
126
|
+
t4 = $[10];
|
|
127
|
+
}
|
|
128
|
+
return t4;
|
|
21
129
|
};
|
|
22
|
-
export default ColumnsVisibility;
|
|
130
|
+
export default ColumnsVisibility;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoreDropdown.d.ts","sourceRoot":"","sources":["../../src/Table/MoreDropdown.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MoreDropdown.d.ts","sourceRoot":"","sources":["../../src/Table/MoreDropdown.tsx"],"names":[],"mappings":"AAkBA,QAAA,MAAM,YAAY,GAAI,kBAAgB;IAAC,YAAY,EAAE,MAAM,CAAA;CAAC,KAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAgElF,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
|
|
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";
|
|
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,34 +21,121 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } 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 { Menu } from '@headlessui/react';
|
|
15
26
|
import { Icon } from '@iconify/react';
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
import { useParcaContext, useURLState, useURLStateBatch } from '@parca/components';
|
|
28
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
29
|
+
var MoreDropdown = function MoreDropdown(t0) {
|
|
30
|
+
var $ = _c(14);
|
|
31
|
+
var functionName = t0.functionName;
|
|
32
|
+
var _useURLState = useURLState("sandwich_function_name"),
|
|
33
|
+
_useURLState2 = _slicedToArray(_useURLState, 2),
|
|
34
|
+
setSandwichFunctionName = _useURLState2[1];
|
|
35
|
+
var t1;
|
|
36
|
+
if ($[0] === Symbol["for"]("react.memo_cache_sentinel")) {
|
|
37
|
+
t1 = {
|
|
38
|
+
alwaysReturnArray: true
|
|
27
39
|
};
|
|
28
|
-
|
|
40
|
+
$[0] = t1;
|
|
41
|
+
} else {
|
|
42
|
+
t1 = $[0];
|
|
43
|
+
}
|
|
44
|
+
var _useURLState3 = useURLState("dashboard_items", t1),
|
|
45
|
+
_useURLState4 = _slicedToArray(_useURLState3, 2),
|
|
46
|
+
dashboardItems = _useURLState4[0],
|
|
47
|
+
setDashboardItems = _useURLState4[1];
|
|
48
|
+
var _useParcaContext = useParcaContext(),
|
|
49
|
+
enableSandwichView = _useParcaContext.enableSandwichView;
|
|
50
|
+
var batchUpdates = useURLStateBatch();
|
|
51
|
+
var t2;
|
|
52
|
+
if ($[1] !== batchUpdates || $[2] !== dashboardItems || $[3] !== functionName || $[4] !== setDashboardItems || $[5] !== setSandwichFunctionName) {
|
|
53
|
+
t2 = function t2() {
|
|
54
|
+
batchUpdates(function () {
|
|
55
|
+
setSandwichFunctionName(functionName.trim());
|
|
56
|
+
setDashboardItems([].concat(_toConsumableArray(dashboardItems), ["sandwich"]));
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
$[1] = batchUpdates;
|
|
60
|
+
$[2] = dashboardItems;
|
|
61
|
+
$[3] = functionName;
|
|
62
|
+
$[4] = setDashboardItems;
|
|
63
|
+
$[5] = setSandwichFunctionName;
|
|
64
|
+
$[6] = t2;
|
|
65
|
+
} else {
|
|
66
|
+
t2 = $[6];
|
|
67
|
+
}
|
|
68
|
+
var onSandwichViewSelect = t2;
|
|
69
|
+
var menuItems;
|
|
70
|
+
if ($[7] !== enableSandwichView || $[8] !== onSandwichViewSelect) {
|
|
71
|
+
menuItems = [];
|
|
29
72
|
if (enableSandwichView === true) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
73
|
+
var _t;
|
|
74
|
+
if ($[10] !== onSandwichViewSelect) {
|
|
75
|
+
_t = {
|
|
76
|
+
label: "Show in Sandwich view",
|
|
77
|
+
action: function action() {
|
|
78
|
+
return onSandwichViewSelect();
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
$[10] = onSandwichViewSelect;
|
|
82
|
+
$[11] = _t;
|
|
83
|
+
} else {
|
|
84
|
+
_t = $[11];
|
|
85
|
+
}
|
|
86
|
+
menuItems.push(_t);
|
|
37
87
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
88
|
+
$[7] = enableSandwichView;
|
|
89
|
+
$[8] = onSandwichViewSelect;
|
|
90
|
+
$[9] = menuItems;
|
|
91
|
+
} else {
|
|
92
|
+
menuItems = $[9];
|
|
93
|
+
}
|
|
94
|
+
if (menuItems.length === 0) {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
var t3;
|
|
98
|
+
if ($[12] !== menuItems) {
|
|
99
|
+
t3 = /*#__PURE__*/_jsx("div", {
|
|
100
|
+
className: "relative",
|
|
101
|
+
children: /*#__PURE__*/_jsx(Menu, {
|
|
102
|
+
children: function children(t4) {
|
|
103
|
+
var open = t4.open,
|
|
104
|
+
close = t4.close;
|
|
105
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
106
|
+
children: [/*#__PURE__*/_jsx(Menu.Button, {
|
|
107
|
+
onClick: function onClick() {
|
|
108
|
+
if (open) {
|
|
109
|
+
close();
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
className: "inline-flex font-sans dark:bg-gray-900 dark:border-gray-600 justify-center w-full text-sm font-normal text-gray-600 dark:text-gray-200 bg-white rounded-md focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75",
|
|
113
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
114
|
+
icon: "mdi:dots-horizontal"
|
|
115
|
+
})
|
|
116
|
+
}), open && /*#__PURE__*/_jsxs(Menu.Items, {
|
|
117
|
+
className: "font-sans absolute z-30 left-0 w-56 mt-2 py-2 origin-top-right bg-white rounded-md shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none border dark:bg-gray-900 dark:border-gray-600",
|
|
118
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
119
|
+
className: "text-xs text-gray-400 capitalize px-4 py-3",
|
|
120
|
+
children: "actions"
|
|
121
|
+
}), menuItems.map(_temp)]
|
|
122
|
+
})]
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
})
|
|
126
|
+
});
|
|
127
|
+
$[12] = menuItems;
|
|
128
|
+
$[13] = t3;
|
|
129
|
+
} else {
|
|
130
|
+
t3 = $[13];
|
|
131
|
+
}
|
|
132
|
+
return t3;
|
|
43
133
|
};
|
|
44
134
|
export default MoreDropdown;
|
|
135
|
+
function _temp(item) {
|
|
136
|
+
return /*#__PURE__*/_jsx(Menu.Button, {
|
|
137
|
+
className: "group mb-px flex w-full items-center rounded-md px-4 py-2 text-sm text-gray-900 dark:text-white hover:bg-indigo-500 hover:text-white focus:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500",
|
|
138
|
+
onClick: item.action,
|
|
139
|
+
children: item.label
|
|
140
|
+
}, item.label);
|
|
141
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableContextMenu.d.ts","sourceRoot":"","sources":["../../src/Table/TableContextMenu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TableContextMenu.d.ts","sourceRoot":"","sources":["../../src/Table/TableContextMenu.tsx"],"names":[],"mappings":"AAiBA,OAAO,yCAAyC,CAAC;AAKjD,OAAO,EAAC,KAAK,GAAG,EAAC,MAAM,GAAG,CAAC;AAG3B,OAAO,EAAC,KAAK,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAElD,UAAU,qBAAqB;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,GAAG,GAAG,IAAI,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;CAChD;AAED,QAAA,MAAM,gBAAgB,GAAI,kEAOvB,qBAAqB,KAAG,KAAK,CAAC,GAAG,CAAC,OAmMpC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|