@splunk/visualizations 27.5.0 → 28.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Area.config.js +19 -21
- package/Area.config.js.map +3 -3
- package/Area.js +55 -33
- package/Area.js.map +3 -3
- package/Bar.config.js +18 -21
- package/Bar.config.js.map +3 -3
- package/Bar.js +49 -32
- package/Bar.js.map +3 -3
- package/Bubble.config.js +39 -44
- package/Bubble.config.js.map +4 -4
- package/Bubble.js +70 -52
- package/Bubble.js.map +4 -4
- package/CHANGELOG.external.md +63 -7
- package/ChoroplethSvg.config.js +47 -43
- package/ChoroplethSvg.config.js.map +4 -4
- package/ChoroplethSvg.js +85 -54
- package/ChoroplethSvg.js.map +4 -4
- package/Column.config.js +15 -20
- package/Column.config.js.map +3 -3
- package/Column.js +43 -30
- package/Column.js.map +3 -3
- package/Ellipse.config.js +16 -7
- package/Ellipse.config.js.map +2 -2
- package/Ellipse.js +46 -20
- package/Ellipse.js.map +2 -2
- package/Events.config.js +38 -27
- package/Events.config.js.map +4 -4
- package/Events.js +114 -98
- package/Events.js.map +4 -4
- package/FEATUREFLAGS.md +9 -9
- package/FillerGauge.config.js +144 -16
- package/FillerGauge.config.js.map +3 -3
- package/FillerGauge.js +891 -101
- package/FillerGauge.js.map +4 -4
- package/Image.config.js +5 -6
- package/Image.config.js.map +2 -2
- package/Image.js +30 -15
- package/Image.js.map +2 -2
- package/Line.config.js +15 -20
- package/Line.config.js.map +3 -3
- package/Line.js +51 -32
- package/Line.js.map +3 -3
- package/LinkGraph.config.js +39 -46
- package/LinkGraph.config.js.map +3 -3
- package/LinkGraph.js +72 -52
- package/LinkGraph.js.map +3 -3
- package/MIGRATION.md +169 -40
- package/Map.config.js +83 -16
- package/Map.config.js.map +4 -4
- package/Map.js +218 -109
- package/Map.js.map +4 -4
- package/Markdown.config.js +4 -5
- package/Markdown.config.js.map +2 -2
- package/Markdown.js +122 -74
- package/Markdown.js.map +3 -3
- package/MarkerGauge.config.js +14 -12
- package/MarkerGauge.config.js.map +3 -3
- package/MarkerGauge.js +108 -70
- package/MarkerGauge.js.map +4 -4
- package/ParallelCoordinates.config.js +14 -12
- package/ParallelCoordinates.config.js.map +3 -3
- package/ParallelCoordinates.js +114 -60
- package/ParallelCoordinates.js.map +3 -3
- package/Pie.config.js +51 -38
- package/Pie.config.js.map +4 -4
- package/Pie.js +110 -86
- package/Pie.js.map +4 -4
- package/Punchcard.config.js +36 -34
- package/Punchcard.config.js.map +4 -4
- package/Punchcard.js +154 -88
- package/Punchcard.js.map +4 -4
- package/README.internal.md +15 -15
- package/README.md +10 -10
- package/Rectangle.config.js +16 -7
- package/Rectangle.config.js.map +2 -2
- package/Rectangle.js +46 -20
- package/Rectangle.js.map +2 -2
- package/Sankey.config.js +69 -17
- package/Sankey.config.js.map +4 -4
- package/Sankey.js +179 -50
- package/Sankey.js.map +4 -4
- package/Scatter.config.js +37 -42
- package/Scatter.config.js.map +3 -3
- package/Scatter.js +71 -54
- package/Scatter.js.map +3 -3
- package/SingleValue.config.js +32 -18
- package/SingleValue.config.js.map +4 -4
- package/SingleValue.js +240 -94
- package/SingleValue.js.map +4 -4
- package/SingleValueBasic.js +1 -0
- package/SingleValueBasic.js.map +2 -2
- package/SingleValueIcon.config.js +22 -11
- package/SingleValueIcon.config.js.map +2 -2
- package/SingleValueIcon.js +85 -29
- package/SingleValueIcon.js.map +2 -2
- package/SingleValueRadial.config.js +34 -23
- package/SingleValueRadial.config.js.map +3 -3
- package/SingleValueRadial.js +90 -49
- package/SingleValueRadial.js.map +4 -4
- package/SparkLine.js +153 -49
- package/SparkLine.js.map +2 -2
- package/TRELLIS.md +2 -2
- package/Table.config.js +93 -52
- package/Table.config.js.map +3 -3
- package/Table.js +513 -202
- package/Table.js.map +4 -4
- package/Timeline.config.js +36 -34
- package/Timeline.config.js.map +4 -4
- package/Timeline.js +131 -83
- package/Timeline.js.map +4 -4
- package/common/Charting.js +1 -0
- package/common/Charting.js.map +2 -2
- package/common/ChartingApi.js +1 -0
- package/common/ChartingApi.js.map +1 -1
- package/common/DocExampleWithVizSandbox.js +7 -2
- package/common/DocExampleWithVizSandbox.js.map +2 -2
- package/common/EventsDoc.js +31 -5
- package/common/EventsDoc.js.map +4 -4
- package/common/GaugeMajorTicks.js +4 -1
- package/common/GaugeMajorTicks.js.map +2 -2
- package/common/GaugeValueMarker.js +31 -3
- package/common/GaugeValueMarker.js.map +4 -4
- package/common/OptionsDoc.js +4 -1
- package/common/OptionsDoc.js.map +2 -2
- package/common/OverviewDoc.js +66 -50
- package/common/OverviewDoc.js.map +4 -4
- package/common/SplunkVisualization.js +1 -0
- package/common/SplunkVisualization.js.map +1 -1
- package/common/SplunkVisualizationApi.js +1 -0
- package/common/SplunkVisualizationApi.js.map +1 -1
- package/common/ThemedDefaults.js +67 -0
- package/common/ThemedDefaults.js.map +7 -0
- package/common/ThemesDoc.js +6 -9
- package/common/ThemesDoc.js.map +2 -2
- package/common/chartingUtils.js +1 -0
- package/common/chartingUtils.js.map +2 -2
- package/common/docUtils.js +6 -1
- package/common/docUtils.js.map +2 -2
- package/common/gaugeUtils.js +6 -1
- package/common/gaugeUtils.js.map +2 -2
- package/common/shapeUtils.js +6 -4
- package/common/shapeUtils.js.map +2 -2
- package/common/utils/configUtils.js +4 -5
- package/common/utils/configUtils.js.map +2 -2
- package/common/utils/dataUtils.js +1 -0
- package/common/utils/dataUtils.js.map +2 -2
- package/common/utils/featureFlagUtils.js +1 -0
- package/common/utils/featureFlagUtils.js.map +1 -1
- package/common/utils/hocUtils.js +1 -0
- package/common/utils/hocUtils.js.map +1 -1
- package/common/utils/mapUtils.js +35 -22
- package/common/utils/mapUtils.js.map +4 -4
- package/common/utils/singleValueUtils.js +8 -2
- package/common/utils/singleValueUtils.js.map +2 -2
- package/common/utils/styleUtils.js +1 -0
- package/common/utils/styleUtils.js.map +1 -1
- package/common/utils/tableUtils.js +59 -0
- package/common/utils/tableUtils.js.map +7 -0
- package/common/utils/testHelper.js +1 -0
- package/common/utils/testHelper.js.map +1 -1
- package/common/utils/trellisUtils.js +1 -0
- package/common/utils/trellisUtils.js.map +1 -1
- package/common/utils/urlUtils.js +1 -0
- package/common/utils/urlUtils.js.map +1 -1
- package/common/withDashboardViz.js +26 -9
- package/common/withDashboardViz.js.map +2 -2
- package/package.json +41 -39
package/Table.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* Copyright © 2020 Splunk Inc.
|
|
2
2
|
SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
|
|
3
3
|
in part without a valid written license from Splunk Inc. is PROHIBITED. */
|
|
4
|
+
"use strict";
|
|
4
5
|
var __create = Object.create;
|
|
5
6
|
var __defProp = Object.defineProperty;
|
|
6
7
|
var __defProps = Object.defineProperties;
|
|
@@ -71,131 +72,138 @@ __export(Table_exports2, {
|
|
|
71
72
|
});
|
|
72
73
|
module.exports = __toCommonJS(Table_exports2);
|
|
73
74
|
|
|
75
|
+
// esm-externals:react
|
|
76
|
+
var react_exports = {};
|
|
77
|
+
__export(react_exports, {
|
|
78
|
+
default: () => react_default
|
|
79
|
+
});
|
|
80
|
+
var defaultImport = __toESM(require("react"));
|
|
81
|
+
__reExport(react_exports, require("react"));
|
|
82
|
+
var react_default = "default" in defaultImport ? defaultImport.default : defaultImport;
|
|
83
|
+
|
|
74
84
|
// esm-externals:lodash
|
|
75
85
|
var lodash_exports = {};
|
|
76
86
|
__export(lodash_exports, {
|
|
77
87
|
default: () => lodash_default
|
|
78
88
|
});
|
|
79
|
-
var
|
|
89
|
+
var defaultImport2 = __toESM(require("lodash"));
|
|
80
90
|
__reExport(lodash_exports, require("lodash"));
|
|
81
|
-
var lodash_default = "default" in
|
|
91
|
+
var lodash_default = "default" in defaultImport2 ? defaultImport2.default : defaultImport2;
|
|
82
92
|
|
|
83
93
|
// esm-externals:@splunk/visualizations-shared/colorUtils
|
|
84
94
|
var colorUtils_exports = {};
|
|
85
95
|
__export(colorUtils_exports, {
|
|
86
96
|
default: () => colorUtils_default
|
|
87
97
|
});
|
|
88
|
-
var
|
|
98
|
+
var defaultImport3 = __toESM(require("@splunk/visualizations-shared/colorUtils"));
|
|
89
99
|
__reExport(colorUtils_exports, require("@splunk/visualizations-shared/colorUtils"));
|
|
90
|
-
var colorUtils_default = "default" in
|
|
100
|
+
var colorUtils_default = "default" in defaultImport3 ? defaultImport3.default : defaultImport3;
|
|
91
101
|
|
|
92
102
|
// esm-externals:@splunk/ui-utils/i18n
|
|
93
103
|
var i18n_exports = {};
|
|
94
104
|
__export(i18n_exports, {
|
|
95
105
|
default: () => i18n_default
|
|
96
106
|
});
|
|
97
|
-
var
|
|
107
|
+
var defaultImport4 = __toESM(require("@splunk/ui-utils/i18n"));
|
|
98
108
|
__reExport(i18n_exports, require("@splunk/ui-utils/i18n"));
|
|
99
|
-
var i18n_default = "default" in
|
|
109
|
+
var i18n_default = "default" in defaultImport4 ? defaultImport4.default : defaultImport4;
|
|
100
110
|
|
|
101
111
|
// esm-externals:@splunk/visualization-schemas
|
|
102
112
|
var visualization_schemas_exports = {};
|
|
103
113
|
__export(visualization_schemas_exports, {
|
|
104
114
|
default: () => visualization_schemas_default
|
|
105
115
|
});
|
|
106
|
-
var
|
|
116
|
+
var defaultImport5 = __toESM(require("@splunk/visualization-schemas"));
|
|
107
117
|
__reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
|
|
108
|
-
var visualization_schemas_default = "default" in
|
|
118
|
+
var visualization_schemas_default = "default" in defaultImport5 ? defaultImport5.default : defaultImport5;
|
|
109
119
|
|
|
110
120
|
// esm-externals:@splunk/visualizations-shared/colorConstants
|
|
111
121
|
var colorConstants_exports = {};
|
|
112
122
|
__export(colorConstants_exports, {
|
|
113
123
|
default: () => colorConstants_default
|
|
114
124
|
});
|
|
115
|
-
var
|
|
125
|
+
var defaultImport6 = __toESM(require("@splunk/visualizations-shared/colorConstants"));
|
|
116
126
|
__reExport(colorConstants_exports, require("@splunk/visualizations-shared/colorConstants"));
|
|
117
|
-
var colorConstants_default = "default" in
|
|
127
|
+
var colorConstants_default = "default" in defaultImport6 ? defaultImport6.default : defaultImport6;
|
|
118
128
|
|
|
119
129
|
// esm-externals:@splunk/visualization-icons
|
|
120
130
|
var visualization_icons_exports = {};
|
|
121
131
|
__export(visualization_icons_exports, {
|
|
122
132
|
default: () => visualization_icons_default
|
|
123
133
|
});
|
|
124
|
-
var
|
|
134
|
+
var defaultImport7 = __toESM(require("@splunk/visualization-icons"));
|
|
125
135
|
__reExport(visualization_icons_exports, require("@splunk/visualization-icons"));
|
|
126
|
-
var visualization_icons_default = "default" in
|
|
136
|
+
var visualization_icons_default = "default" in defaultImport7 ? defaultImport7.default : defaultImport7;
|
|
127
137
|
|
|
128
138
|
// esm-externals:@splunk/visualization-icons/placeholders
|
|
129
139
|
var placeholders_exports = {};
|
|
130
140
|
__export(placeholders_exports, {
|
|
131
141
|
default: () => placeholders_default
|
|
132
142
|
});
|
|
133
|
-
var
|
|
143
|
+
var defaultImport8 = __toESM(require("@splunk/visualization-icons/placeholders"));
|
|
134
144
|
__reExport(placeholders_exports, require("@splunk/visualization-icons/placeholders"));
|
|
135
|
-
var placeholders_default = "default" in
|
|
145
|
+
var placeholders_default = "default" in defaultImport8 ? defaultImport8.default : defaultImport8;
|
|
136
146
|
|
|
137
147
|
// esm-externals:@splunk/themes/variables
|
|
138
148
|
var variables_exports = {};
|
|
139
149
|
__export(variables_exports, {
|
|
140
150
|
default: () => variables_default
|
|
141
151
|
});
|
|
142
|
-
var
|
|
152
|
+
var defaultImport9 = __toESM(require("@splunk/themes/variables"));
|
|
143
153
|
__reExport(variables_exports, require("@splunk/themes/variables"));
|
|
144
|
-
var variables_default = "default" in
|
|
154
|
+
var variables_default = "default" in defaultImport9 ? defaultImport9.default : defaultImport9;
|
|
145
155
|
|
|
146
156
|
// esm-externals:@splunk/themes/pick
|
|
147
157
|
var pick_exports = {};
|
|
148
158
|
__export(pick_exports, {
|
|
149
159
|
default: () => pick_default
|
|
150
160
|
});
|
|
151
|
-
var
|
|
161
|
+
var defaultImport10 = __toESM(require("@splunk/themes/pick"));
|
|
152
162
|
__reExport(pick_exports, require("@splunk/themes/pick"));
|
|
153
|
-
var pick_default = "default" in
|
|
163
|
+
var pick_default = "default" in defaultImport10 ? defaultImport10.default : defaultImport10;
|
|
154
164
|
|
|
155
165
|
// esm-externals:@splunk/react-icons/TextAlignCenter
|
|
156
166
|
var TextAlignCenter_exports = {};
|
|
157
167
|
__export(TextAlignCenter_exports, {
|
|
158
168
|
default: () => TextAlignCenter_default
|
|
159
169
|
});
|
|
160
|
-
var
|
|
170
|
+
var defaultImport11 = __toESM(require("@splunk/react-icons/TextAlignCenter"));
|
|
161
171
|
__reExport(TextAlignCenter_exports, require("@splunk/react-icons/TextAlignCenter"));
|
|
162
|
-
var TextAlignCenter_default = "default" in
|
|
172
|
+
var TextAlignCenter_default = "default" in defaultImport11 ? defaultImport11.default : defaultImport11;
|
|
163
173
|
|
|
164
174
|
// esm-externals:@splunk/react-icons/TextAlignLeft
|
|
165
175
|
var TextAlignLeft_exports = {};
|
|
166
176
|
__export(TextAlignLeft_exports, {
|
|
167
177
|
default: () => TextAlignLeft_default
|
|
168
178
|
});
|
|
169
|
-
var
|
|
179
|
+
var defaultImport12 = __toESM(require("@splunk/react-icons/TextAlignLeft"));
|
|
170
180
|
__reExport(TextAlignLeft_exports, require("@splunk/react-icons/TextAlignLeft"));
|
|
171
|
-
var TextAlignLeft_default = "default" in
|
|
181
|
+
var TextAlignLeft_default = "default" in defaultImport12 ? defaultImport12.default : defaultImport12;
|
|
172
182
|
|
|
173
183
|
// esm-externals:@splunk/react-icons/TextAlignRight
|
|
174
184
|
var TextAlignRight_exports = {};
|
|
175
185
|
__export(TextAlignRight_exports, {
|
|
176
186
|
default: () => TextAlignRight_default
|
|
177
187
|
});
|
|
178
|
-
var
|
|
188
|
+
var defaultImport13 = __toESM(require("@splunk/react-icons/TextAlignRight"));
|
|
179
189
|
__reExport(TextAlignRight_exports, require("@splunk/react-icons/TextAlignRight"));
|
|
180
|
-
var TextAlignRight_default = "default" in
|
|
190
|
+
var TextAlignRight_default = "default" in defaultImport13 ? defaultImport13.default : defaultImport13;
|
|
181
191
|
|
|
182
192
|
// esm-externals:@splunk/visualizations-shared/configUtils
|
|
183
193
|
var configUtils_exports = {};
|
|
184
194
|
__export(configUtils_exports, {
|
|
185
195
|
default: () => configUtils_default
|
|
186
196
|
});
|
|
187
|
-
var
|
|
197
|
+
var defaultImport14 = __toESM(require("@splunk/visualizations-shared/configUtils"));
|
|
188
198
|
__reExport(configUtils_exports, require("@splunk/visualizations-shared/configUtils"));
|
|
189
|
-
var configUtils_default = "default" in
|
|
199
|
+
var configUtils_default = "default" in defaultImport14 ? defaultImport14.default : defaultImport14;
|
|
190
200
|
|
|
191
201
|
// src/common/utils/configUtils.ts
|
|
192
202
|
function enhanceConfig(vizConfig) {
|
|
193
203
|
const enhancedConfig = __spreadValues({}, vizConfig);
|
|
194
|
-
enhancedConfig.editorConfig = vizConfig.editorConfig.map(
|
|
195
|
-
(config2)
|
|
196
|
-
|
|
197
|
-
}
|
|
198
|
-
);
|
|
204
|
+
enhancedConfig.editorConfig = vizConfig.editorConfig.map((config2) => {
|
|
205
|
+
return __spreadProps(__spreadValues({}, config2), { open: config2.open || false });
|
|
206
|
+
});
|
|
199
207
|
return enhancedConfig;
|
|
200
208
|
}
|
|
201
209
|
function generatePrecisionValues(numPrecisionValues) {
|
|
@@ -208,6 +216,15 @@ function generatePrecisionValues(numPrecisionValues) {
|
|
|
208
216
|
);
|
|
209
217
|
}
|
|
210
218
|
|
|
219
|
+
// src/common/ThemedDefaults.tsx
|
|
220
|
+
var defaultBackgroundColor = (props) => pick_default({
|
|
221
|
+
enterprise: {
|
|
222
|
+
dark: variables_default.black(props),
|
|
223
|
+
light: variables_default.white(props)
|
|
224
|
+
},
|
|
225
|
+
prisma: variables_default.backgroundColorSection(props)
|
|
226
|
+
})(props);
|
|
227
|
+
|
|
211
228
|
// src/Table/config.ts
|
|
212
229
|
var dataContract = {
|
|
213
230
|
requiredDataSources: [
|
|
@@ -221,7 +238,8 @@ var dataContract = {
|
|
|
221
238
|
primary: (options = {}) => ({
|
|
222
239
|
offset: 0,
|
|
223
240
|
count: options.count ? options.count : 10,
|
|
224
|
-
requestTotalCount: true
|
|
241
|
+
requestTotalCount: true,
|
|
242
|
+
add_summary_to_metadata: true
|
|
225
243
|
})
|
|
226
244
|
}
|
|
227
245
|
};
|
|
@@ -314,7 +332,10 @@ var textAlignConfigTable = {
|
|
|
314
332
|
option: "tableFormat.align",
|
|
315
333
|
editorProps: {
|
|
316
334
|
values: [
|
|
317
|
-
{
|
|
335
|
+
{
|
|
336
|
+
label: (0, i18n_exports._)("Auto"),
|
|
337
|
+
value: "> table | type() | matchValue(tableAlignByType)"
|
|
338
|
+
},
|
|
318
339
|
{ label: (0, i18n_exports._)("Left"), value: "left", icon: TextAlignLeft_default },
|
|
319
340
|
{ label: (0, i18n_exports._)("Center"), value: "center", icon: TextAlignCenter_default },
|
|
320
341
|
{ label: (0, i18n_exports._)("Right"), value: "right", icon: TextAlignRight_default }
|
|
@@ -365,13 +386,7 @@ var sequentialColorConfig = [
|
|
|
365
386
|
];
|
|
366
387
|
var matchColorConfig = [{ match: "", value: "#5C33FF" }];
|
|
367
388
|
var themes = {
|
|
368
|
-
defaultBackgroundColor
|
|
369
|
-
enterprise: {
|
|
370
|
-
dark: variables_default.black(props),
|
|
371
|
-
light: variables_default.backgroundColor(props)
|
|
372
|
-
},
|
|
373
|
-
prisma: variables_default.backgroundColorSidebar(props)
|
|
374
|
-
})(props),
|
|
389
|
+
defaultBackgroundColor,
|
|
375
390
|
defaultHeaderBackgroundColor: (props) => pick_default({
|
|
376
391
|
enterprise: {
|
|
377
392
|
dark: variables_default.gray20(props),
|
|
@@ -391,7 +406,7 @@ var themes = {
|
|
|
391
406
|
dark: "#0D1012",
|
|
392
407
|
light: variables_default.backgroundColor(props)
|
|
393
408
|
},
|
|
394
|
-
prisma: variables_default.backgroundColorSidebar(props)
|
|
409
|
+
prisma: { dark: variables_default.backgroundColorSidebar(props), light: variables_default.white(props) }
|
|
395
410
|
})(props),
|
|
396
411
|
textColor: (props) => pick_default({
|
|
397
412
|
enterprise: variables_default.textColor(props),
|
|
@@ -407,10 +422,7 @@ var themes = {
|
|
|
407
422
|
prisma: variables_default.contentColorInverted(props)
|
|
408
423
|
})(props)
|
|
409
424
|
};
|
|
410
|
-
var backgroundColorPaletteSet = /* @__PURE__ */ new Set([
|
|
411
|
-
...colorConstants_exports.COLOR_EDITOR_PALETTE,
|
|
412
|
-
...(0, lodash_exports.map)(themes, (t) => (0, lodash_exports.get)(t, "defaultBackgroundColor"))
|
|
413
|
-
]);
|
|
425
|
+
var backgroundColorPaletteSet = /* @__PURE__ */ new Set([...colorConstants_exports.COLOR_EDITOR_PALETTE]);
|
|
414
426
|
var EDITOR_LABEL_WIDTH = 100;
|
|
415
427
|
var editorConfig = [
|
|
416
428
|
{
|
|
@@ -461,6 +473,26 @@ var editorConfig = [
|
|
|
461
473
|
labelWidth: EDITOR_LABEL_WIDTH
|
|
462
474
|
}
|
|
463
475
|
}
|
|
476
|
+
],
|
|
477
|
+
[
|
|
478
|
+
{
|
|
479
|
+
label: (0, i18n_exports._)("Footer totals row"),
|
|
480
|
+
option: "showFooterTotals",
|
|
481
|
+
editor: "editor.checkbox",
|
|
482
|
+
editorProps: {
|
|
483
|
+
labelWidth: EDITOR_LABEL_WIDTH
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
],
|
|
487
|
+
[
|
|
488
|
+
{
|
|
489
|
+
label: (0, i18n_exports._)("Footer percentages row"),
|
|
490
|
+
option: "showFooterPercentages",
|
|
491
|
+
editor: "editor.checkbox",
|
|
492
|
+
editorProps: {
|
|
493
|
+
labelWidth: EDITOR_LABEL_WIDTH
|
|
494
|
+
}
|
|
495
|
+
}
|
|
464
496
|
]
|
|
465
497
|
]
|
|
466
498
|
},
|
|
@@ -486,7 +518,10 @@ var editorConfig = [
|
|
|
486
518
|
editor: "editor.select",
|
|
487
519
|
editorProps: {
|
|
488
520
|
values: [
|
|
489
|
-
{
|
|
521
|
+
{
|
|
522
|
+
label: (0, i18n_exports._)("Proportional (Default)"),
|
|
523
|
+
value: "proportional"
|
|
524
|
+
},
|
|
490
525
|
{ label: (0, i18n_exports._)("Monospace"), value: "monospace" }
|
|
491
526
|
],
|
|
492
527
|
labelPosition: "top",
|
|
@@ -501,10 +536,22 @@ var editorConfig = [
|
|
|
501
536
|
editor: "editor.select",
|
|
502
537
|
editorProps: {
|
|
503
538
|
values: [
|
|
504
|
-
{
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
539
|
+
{
|
|
540
|
+
label: (0, i18n_exports._)("Extra Small (font 10px, row 24px)"),
|
|
541
|
+
value: "extraSmall"
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
label: (0, i18n_exports._)("Small (font 12px, row 24px)"),
|
|
545
|
+
value: "small"
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
label: (0, i18n_exports._)("Default (font 14px, row 32px)"),
|
|
549
|
+
value: "default"
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
label: (0, i18n_exports._)("Large (font 16px, row 36px)"),
|
|
553
|
+
value: "large"
|
|
554
|
+
}
|
|
508
555
|
],
|
|
509
556
|
labelPosition: "top",
|
|
510
557
|
labelWidth: EDITOR_LABEL_WIDTH
|
|
@@ -602,7 +649,10 @@ var editorConfig = [
|
|
|
602
649
|
editor: "editor.radioBar",
|
|
603
650
|
editorProps: {
|
|
604
651
|
values: [
|
|
605
|
-
{
|
|
652
|
+
{
|
|
653
|
+
label: (0, i18n_exports._)("Off"),
|
|
654
|
+
value: false
|
|
655
|
+
},
|
|
606
656
|
{ label: (0, i18n_exports._)("On"), value: true }
|
|
607
657
|
]
|
|
608
658
|
}
|
|
@@ -672,15 +722,6 @@ var config = {
|
|
|
672
722
|
};
|
|
673
723
|
var config_default = enhanceConfig(config);
|
|
674
724
|
|
|
675
|
-
// esm-externals:react
|
|
676
|
-
var react_exports = {};
|
|
677
|
-
__export(react_exports, {
|
|
678
|
-
default: () => react_default
|
|
679
|
-
});
|
|
680
|
-
var defaultImport14 = __toESM(require("react"));
|
|
681
|
-
__reExport(react_exports, require("react"));
|
|
682
|
-
var react_default = "default" in defaultImport14 ? defaultImport14.default : defaultImport14;
|
|
683
|
-
|
|
684
725
|
// esm-externals:@splunk/themes/getSettingsFromThemedProps
|
|
685
726
|
var getSettingsFromThemedProps_exports = {};
|
|
686
727
|
__export(getSettingsFromThemedProps_exports, {
|
|
@@ -1026,9 +1067,14 @@ var Item = styled_components_default.div.attrs(({ width }) => ({
|
|
|
1026
1067
|
position: relative;
|
|
1027
1068
|
background-color: ${(props) => (0, colorUtils_exports.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor}};
|
|
1028
1069
|
`;
|
|
1029
|
-
var FixSizeItem = styled_components_default.div.attrs(
|
|
1030
|
-
|
|
1031
|
-
|
|
1070
|
+
var FixSizeItem = styled_components_default.div.attrs(
|
|
1071
|
+
({
|
|
1072
|
+
width,
|
|
1073
|
+
height
|
|
1074
|
+
}) => ({
|
|
1075
|
+
style: __spreadValues(__spreadValues({}, width && { width: (0, style_exports.toPx)(width) }), height && { height: (0, style_exports.toPx)(height) })
|
|
1076
|
+
})
|
|
1077
|
+
)`
|
|
1032
1078
|
position: relative;
|
|
1033
1079
|
flex-direction: column;
|
|
1034
1080
|
flex: 1;
|
|
@@ -1062,7 +1108,7 @@ var withFixedSizeContainer = (Viz) => {
|
|
|
1062
1108
|
FixSizeItem,
|
|
1063
1109
|
{
|
|
1064
1110
|
"data-test": "fix-size-item",
|
|
1065
|
-
"data-splunk-visualization-version": "
|
|
1111
|
+
"data-splunk-visualization-version": "28.1.0 - 4a1bff08b",
|
|
1066
1112
|
width,
|
|
1067
1113
|
height,
|
|
1068
1114
|
backgroundColor
|
|
@@ -1128,7 +1174,7 @@ var Cover = styled_components_default.div`
|
|
|
1128
1174
|
bottom: 0;
|
|
1129
1175
|
`;
|
|
1130
1176
|
var Blocker = styled_components_default.div.attrs({
|
|
1131
|
-
"data-splunk-visualization-version": "
|
|
1177
|
+
"data-splunk-visualization-version": "28.1.0 - 4a1bff08b"
|
|
1132
1178
|
})`
|
|
1133
1179
|
position: relative;
|
|
1134
1180
|
width: 100%;
|
|
@@ -1497,7 +1543,12 @@ var useGetXAndYFields = ({
|
|
|
1497
1543
|
y2Fields: options.y2 ? "> y2 | getField()" : void 0,
|
|
1498
1544
|
fieldTypes: "> primary | getType()"
|
|
1499
1545
|
};
|
|
1500
|
-
const {
|
|
1546
|
+
const {
|
|
1547
|
+
xField = "",
|
|
1548
|
+
yFields = [],
|
|
1549
|
+
y2Fields = [],
|
|
1550
|
+
fieldTypes
|
|
1551
|
+
} = Options_exports.Options.evaluate(
|
|
1501
1552
|
{ options: optionsToEvaluate, context },
|
|
1502
1553
|
dataSourcesWithOnlyOnePoint,
|
|
1503
1554
|
() => {
|
|
@@ -1778,7 +1829,9 @@ var withDashboardViz = (opts) => {
|
|
|
1778
1829
|
return result;
|
|
1779
1830
|
}
|
|
1780
1831
|
} catch (e) {
|
|
1781
|
-
|
|
1832
|
+
if (e instanceof Error) {
|
|
1833
|
+
console.error(`unexpected error evaluating options: ${e.message}`);
|
|
1834
|
+
}
|
|
1782
1835
|
return {};
|
|
1783
1836
|
}
|
|
1784
1837
|
return {};
|
|
@@ -1835,9 +1888,13 @@ var withDashboardViz = (opts) => {
|
|
|
1835
1888
|
}
|
|
1836
1889
|
eventCallbackProps[eventCallbackPropName] = (ev) => {
|
|
1837
1890
|
if (ev && ev.payload) {
|
|
1838
|
-
payload = ev.payload;
|
|
1891
|
+
payload = __spreadValues({}, ev.payload);
|
|
1839
1892
|
}
|
|
1840
|
-
return onEventTrigger({
|
|
1893
|
+
return onEventTrigger({
|
|
1894
|
+
originalEvent: ev,
|
|
1895
|
+
payload,
|
|
1896
|
+
type: eventName
|
|
1897
|
+
});
|
|
1841
1898
|
};
|
|
1842
1899
|
if (parentKeys) {
|
|
1843
1900
|
for (let i = parentKeys.length - 1; i >= 0; i -= 1) {
|
|
@@ -1934,6 +1991,36 @@ var defaultImport36 = __toESM(require("@splunk/react-ui/Message"));
|
|
|
1934
1991
|
__reExport(Message_exports2, require("@splunk/react-ui/Message"));
|
|
1935
1992
|
var Message_default2 = "default" in defaultImport36 ? defaultImport36.default : defaultImport36;
|
|
1936
1993
|
|
|
1994
|
+
// src/common/utils/tableUtils.ts
|
|
1995
|
+
var hasSummarySum = (fields) => {
|
|
1996
|
+
return fields.some((field) => typeof field === "object" && field["summary.sum"] !== void 0);
|
|
1997
|
+
};
|
|
1998
|
+
var updateSumTotalValues = (primaryDataSource) => {
|
|
1999
|
+
const { data } = primaryDataSource;
|
|
2000
|
+
const { columns, fields } = data;
|
|
2001
|
+
if (!data || !columns || !fields) {
|
|
2002
|
+
return primaryDataSource;
|
|
2003
|
+
}
|
|
2004
|
+
if (hasSummarySum(fields)) {
|
|
2005
|
+
fields.forEach((field, idx) => {
|
|
2006
|
+
let footerTotal = "";
|
|
2007
|
+
if (typeof field === "object" && field["summary.sum"] !== void 0) {
|
|
2008
|
+
footerTotal = field["summary.sum"];
|
|
2009
|
+
}
|
|
2010
|
+
if (columns[idx]) {
|
|
2011
|
+
columns[idx] = [...columns[idx], footerTotal];
|
|
2012
|
+
}
|
|
2013
|
+
});
|
|
2014
|
+
}
|
|
2015
|
+
return primaryDataSource;
|
|
2016
|
+
};
|
|
2017
|
+
var findFooterTotal = (headersMetadata) => {
|
|
2018
|
+
return headersMetadata.reduce((total, field) => {
|
|
2019
|
+
const value = field["summary.sum"] ? +field["summary.sum"] : 0;
|
|
2020
|
+
return total + value;
|
|
2021
|
+
}, 0);
|
|
2022
|
+
};
|
|
2023
|
+
|
|
1937
2024
|
// src/Table/hooks.tsx
|
|
1938
2025
|
var isArray = (v) => Array.isArray(v);
|
|
1939
2026
|
var textOverflowStyles = {
|
|
@@ -1955,11 +2042,11 @@ var empty = {};
|
|
|
1955
2042
|
var getOverflowStyles = ({ textOverflow }) => {
|
|
1956
2043
|
return textOverflowStyles[textOverflow] || empty;
|
|
1957
2044
|
};
|
|
1958
|
-
var generateKey = (
|
|
2045
|
+
var generateKey = (i = "", value = "") => `${value}-${i}`;
|
|
1959
2046
|
var getTextOverflowType = (columnFormat, columnId, currentColumn) => getAttributeFromColumnFormat("textOverflow", columnFormat, columnId, currentColumn);
|
|
1960
2047
|
var generateHeader = (value, columnId, i, columnFormat, tableFormat, showInternalFields) => {
|
|
1961
2048
|
const ret = {
|
|
1962
|
-
key: generateKey(value, i),
|
|
2049
|
+
key: generateKey(value, String(i)),
|
|
1963
2050
|
value,
|
|
1964
2051
|
align: "left",
|
|
1965
2052
|
columnId,
|
|
@@ -2218,6 +2305,7 @@ var validValueSelector = (v1, v2, v3, defaultValue) => {
|
|
|
2218
2305
|
};
|
|
2219
2306
|
var useTable = (tableArgs = {}) => {
|
|
2220
2307
|
let { table = [], headers = [], columnIds = [] } = tableArgs;
|
|
2308
|
+
const { headersMetadata = [] } = tableArgs;
|
|
2221
2309
|
const {
|
|
2222
2310
|
headerVisibility = "inline",
|
|
2223
2311
|
showRowNumbers = false,
|
|
@@ -2288,21 +2376,19 @@ var useTable = (tableArgs = {}) => {
|
|
|
2288
2376
|
}
|
|
2289
2377
|
const tableHeader = {
|
|
2290
2378
|
visibility: visualization_schemas_exports.validHeaderVisibilities.indexOf(headerVisibility) >= 0 ? headerVisibility : "inline",
|
|
2291
|
-
cells: table.map(
|
|
2292
|
-
(
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
);
|
|
2302
|
-
}
|
|
2303
|
-
return generateHeader("", "", i, columnFormat, tableFormat, showInternalFields);
|
|
2379
|
+
cells: table.map((f, i) => {
|
|
2380
|
+
if (i < headers.length) {
|
|
2381
|
+
return generateHeader(
|
|
2382
|
+
headers[i],
|
|
2383
|
+
columnIds[i],
|
|
2384
|
+
i,
|
|
2385
|
+
columnFormat,
|
|
2386
|
+
tableFormat,
|
|
2387
|
+
showInternalFields
|
|
2388
|
+
);
|
|
2304
2389
|
}
|
|
2305
|
-
|
|
2390
|
+
return generateHeader("", "", i, columnFormat, tableFormat, showInternalFields);
|
|
2391
|
+
}),
|
|
2306
2392
|
style: {
|
|
2307
2393
|
backgroundColor: (0, lodash_exports.has)(tableFormat, "headerBackgroundColor") && (0, colorUtils_exports.isColor)(tableFormat.headerBackgroundColor) && tableFormat.headerBackgroundColor || void 0,
|
|
2308
2394
|
color: (0, lodash_exports.has)(tableFormat, "headerColor") && (0, colorUtils_exports.isColor)(tableFormat.headerColor) && tableFormat.headerColor || void 0
|
|
@@ -2311,6 +2397,9 @@ var useTable = (tableArgs = {}) => {
|
|
|
2311
2397
|
const tableBody = {
|
|
2312
2398
|
rows: []
|
|
2313
2399
|
};
|
|
2400
|
+
const tableFooter = {
|
|
2401
|
+
rows: []
|
|
2402
|
+
};
|
|
2314
2403
|
for (let currentRow = 0; currentRow < longestColumnLength; currentRow += 1) {
|
|
2315
2404
|
const row = {
|
|
2316
2405
|
key: `row-${currentRow}`,
|
|
@@ -2363,11 +2452,53 @@ var useTable = (tableArgs = {}) => {
|
|
|
2363
2452
|
showCell
|
|
2364
2453
|
});
|
|
2365
2454
|
});
|
|
2366
|
-
|
|
2455
|
+
if (hasSummarySum(headersMetadata) && currentRow === longestColumnLength - 1) {
|
|
2456
|
+
row.key = "footer-totals";
|
|
2457
|
+
tableFooter.rows.push(row);
|
|
2458
|
+
row.cells = row.cells.map((cell, i) => {
|
|
2459
|
+
const headerCell = tableHeader.cells[i];
|
|
2460
|
+
let newCell = __spreadValues({}, cell);
|
|
2461
|
+
if (headerCell) {
|
|
2462
|
+
newCell = __spreadProps(__spreadValues({}, newCell), {
|
|
2463
|
+
style: __spreadProps(__spreadValues({}, newCell.style), {
|
|
2464
|
+
backgroundColor: tableFormat.headerBackgroundColor
|
|
2465
|
+
})
|
|
2466
|
+
});
|
|
2467
|
+
}
|
|
2468
|
+
if (i === 0 && showRowNumbers) {
|
|
2469
|
+
newCell = __spreadProps(__spreadValues({}, newCell), {
|
|
2470
|
+
value: "",
|
|
2471
|
+
rawValue: ""
|
|
2472
|
+
});
|
|
2473
|
+
}
|
|
2474
|
+
return newCell;
|
|
2475
|
+
});
|
|
2476
|
+
} else {
|
|
2477
|
+
tableBody.rows.push(row);
|
|
2478
|
+
}
|
|
2479
|
+
}
|
|
2480
|
+
if (tableFooter.rows.length === 1 && hasSummarySum(headersMetadata)) {
|
|
2481
|
+
const totalRowIndex = tableFooter.rows[0].index;
|
|
2482
|
+
const footerTotal = findFooterTotal(headersMetadata);
|
|
2483
|
+
const percentageRow = {
|
|
2484
|
+
key: "footer-percentage",
|
|
2485
|
+
index: totalRowIndex + 1,
|
|
2486
|
+
cells: tableFooter.rows[0].cells.map((cell) => {
|
|
2487
|
+
let percentageValue = "";
|
|
2488
|
+
if (cell.rawValue !== "") {
|
|
2489
|
+
percentageValue = footerTotal ? `${(0, numberUtils_exports.formatNumber)(+cell.rawValue / footerTotal * 100, 2)}%` : "";
|
|
2490
|
+
}
|
|
2491
|
+
return __spreadProps(__spreadValues({}, cell), {
|
|
2492
|
+
value: percentageValue
|
|
2493
|
+
});
|
|
2494
|
+
})
|
|
2495
|
+
};
|
|
2496
|
+
tableFooter.rows.push(percentageRow);
|
|
2367
2497
|
}
|
|
2368
2498
|
return {
|
|
2369
2499
|
tableHeader,
|
|
2370
|
-
tableBody
|
|
2500
|
+
tableBody,
|
|
2501
|
+
tableFooter
|
|
2371
2502
|
};
|
|
2372
2503
|
};
|
|
2373
2504
|
|
|
@@ -2442,6 +2573,7 @@ var StyledTooltip = styled_components_default.div`
|
|
|
2442
2573
|
padding: 3px 8px;
|
|
2443
2574
|
font-size: 12px;
|
|
2444
2575
|
`;
|
|
2576
|
+
var preventDefault = (e) => e.preventDefault();
|
|
2445
2577
|
var _SparkLine = class _SparkLine extends react_exports.Component {
|
|
2446
2578
|
constructor(props, ...rest) {
|
|
2447
2579
|
super(props, ...rest);
|
|
@@ -2452,21 +2584,99 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
|
|
|
2452
2584
|
});
|
|
2453
2585
|
this.state = {
|
|
2454
2586
|
anchor: null,
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
tooltip: null
|
|
2587
|
+
activeIndex: 0,
|
|
2588
|
+
hoveredIndex: null,
|
|
2589
|
+
componentIsFocused: false
|
|
2459
2590
|
};
|
|
2460
|
-
this.titleId = (0, id_exports.createDOMID)();
|
|
2591
|
+
this.titleId = (0, id_exports.createDOMID)("sparkline-title");
|
|
2592
|
+
this.pointRefs = [];
|
|
2593
|
+
this.containerRef = react_default.createRef();
|
|
2594
|
+
this.handleKeyDown = this.handleKeyDown.bind(this);
|
|
2595
|
+
this.handleMouseOver = this.handleMouseOver.bind(this);
|
|
2596
|
+
this.handleMouseLeave = this.handleMouseLeave.bind(this);
|
|
2597
|
+
this.handleFocus = this.handleFocus.bind(this);
|
|
2598
|
+
this.handleBlur = this.handleBlur.bind(this);
|
|
2599
|
+
}
|
|
2600
|
+
handleFocus(event) {
|
|
2601
|
+
const { target } = event;
|
|
2602
|
+
const { pointIndex: pointIndexStr } = target.dataset || {};
|
|
2603
|
+
const { activeIndex, componentIsFocused, hoveredIndex } = this.state;
|
|
2604
|
+
if (pointIndexStr !== void 0) {
|
|
2605
|
+
const pointIndex = parseInt(pointIndexStr, 10);
|
|
2606
|
+
if (activeIndex !== pointIndex || !componentIsFocused || hoveredIndex !== null) {
|
|
2607
|
+
this.setState({
|
|
2608
|
+
activeIndex: pointIndex,
|
|
2609
|
+
hoveredIndex: null,
|
|
2610
|
+
componentIsFocused: true
|
|
2611
|
+
});
|
|
2612
|
+
}
|
|
2613
|
+
} else if (this.pointRefs.length > 0) {
|
|
2614
|
+
const indexToFocus = activeIndex ? Math.min(this.pointRefs.length - 1, activeIndex) : 0;
|
|
2615
|
+
this.pointRefs[indexToFocus].focus();
|
|
2616
|
+
}
|
|
2617
|
+
}
|
|
2618
|
+
handleBlur(event) {
|
|
2619
|
+
if (this.containerRef.current && !this.containerRef.current.contains(event.relatedTarget)) {
|
|
2620
|
+
this.setState({ componentIsFocused: false });
|
|
2621
|
+
}
|
|
2622
|
+
}
|
|
2623
|
+
handleKeyDown(event) {
|
|
2624
|
+
const { data } = this.props;
|
|
2625
|
+
const { activeIndex } = this.state;
|
|
2626
|
+
const numPoints = data.length;
|
|
2627
|
+
if (numPoints === 0) {
|
|
2628
|
+
return;
|
|
2629
|
+
}
|
|
2630
|
+
const allowedKeys = ["ArrowLeft", "ArrowRight", "Home", "End"];
|
|
2631
|
+
if (!allowedKeys.includes(event.key)) {
|
|
2632
|
+
return;
|
|
2633
|
+
}
|
|
2634
|
+
let newIndex = activeIndex;
|
|
2635
|
+
switch (event.key) {
|
|
2636
|
+
case "Home":
|
|
2637
|
+
newIndex = 0;
|
|
2638
|
+
break;
|
|
2639
|
+
case "End":
|
|
2640
|
+
newIndex = numPoints - 1;
|
|
2641
|
+
break;
|
|
2642
|
+
case "ArrowLeft":
|
|
2643
|
+
newIndex = Math.max(0, activeIndex - 1);
|
|
2644
|
+
break;
|
|
2645
|
+
case "ArrowRight":
|
|
2646
|
+
newIndex = Math.min(numPoints - 1, activeIndex + 1);
|
|
2647
|
+
break;
|
|
2648
|
+
default:
|
|
2649
|
+
return;
|
|
2650
|
+
}
|
|
2651
|
+
if (newIndex !== activeIndex) {
|
|
2652
|
+
event.preventDefault();
|
|
2653
|
+
if (this.pointRefs[newIndex]) {
|
|
2654
|
+
this.pointRefs[newIndex].focus();
|
|
2655
|
+
}
|
|
2656
|
+
}
|
|
2657
|
+
}
|
|
2658
|
+
handleMouseOver(event) {
|
|
2659
|
+
const pointIndexStr = event.target.dataset && event.target.dataset.pointIndex;
|
|
2660
|
+
if (pointIndexStr !== void 0) {
|
|
2661
|
+
const pointIndex = parseInt(pointIndexStr, 10);
|
|
2662
|
+
if (this.state.hoveredIndex !== pointIndex) {
|
|
2663
|
+
this.setState({ hoveredIndex: pointIndex });
|
|
2664
|
+
}
|
|
2665
|
+
}
|
|
2666
|
+
}
|
|
2667
|
+
handleMouseLeave() {
|
|
2668
|
+
if (this.state.hoveredIndex !== null) {
|
|
2669
|
+
this.setState({ hoveredIndex: null });
|
|
2670
|
+
}
|
|
2461
2671
|
}
|
|
2462
2672
|
getMax() {
|
|
2463
2673
|
const { data, acceptNull, yMax } = this.props;
|
|
2464
|
-
const dataMax = () => acceptNull ? (0, lodash_exports.max)(this.fillNull(
|
|
2674
|
+
const dataMax = () => acceptNull ? (0, lodash_exports.max)(this.fillNull()) : (0, lodash_exports.max)(data);
|
|
2465
2675
|
return yMax !== void 0 ? yMax : dataMax();
|
|
2466
2676
|
}
|
|
2467
2677
|
getMin() {
|
|
2468
2678
|
const { data, acceptNull, yMin } = this.props;
|
|
2469
|
-
const dataMin = () => acceptNull ? (0, lodash_exports.min)(this.fillNull(
|
|
2679
|
+
const dataMin = () => acceptNull ? (0, lodash_exports.min)(this.fillNull()) : (0, lodash_exports.min)(data);
|
|
2470
2680
|
return yMin !== void 0 ? yMin : dataMin();
|
|
2471
2681
|
}
|
|
2472
2682
|
/**
|
|
@@ -2546,15 +2756,14 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
|
|
|
2546
2756
|
})).map((p) => [p.x, p.y]);
|
|
2547
2757
|
}
|
|
2548
2758
|
/**
|
|
2549
|
-
* Renders rect area for
|
|
2550
|
-
* render related cursor and tooltip.
|
|
2759
|
+
* Renders rect area for each datapoint for interactions and screen reader support
|
|
2551
2760
|
* @param {Array} points - array of points coordination.
|
|
2552
2761
|
* @param {Number} xMargin - margin of x axis.
|
|
2553
2762
|
* @return {Array} array of svg rect objects
|
|
2554
2763
|
* @private
|
|
2555
2764
|
*/
|
|
2556
2765
|
renderRect(points, xMargin) {
|
|
2557
|
-
const { data, height } = this.props;
|
|
2766
|
+
const { data, height, showTooltip } = this.props;
|
|
2558
2767
|
const xUnit = this.getXUnit(xMargin);
|
|
2559
2768
|
return points.map((p, i) => (
|
|
2560
2769
|
/* eslint-disable react/no-array-index-key */
|
|
@@ -2562,20 +2771,20 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
|
|
|
2562
2771
|
"rect",
|
|
2563
2772
|
{
|
|
2564
2773
|
key: `${i}_${p[0]}`,
|
|
2774
|
+
role: "img",
|
|
2775
|
+
"aria-label": `Value: ${data[i] === null ? "N/A" : data[i]}, point ${i + 1} of ${data.length}`,
|
|
2565
2776
|
"data-test": `rect-${i}`,
|
|
2777
|
+
"data-point-index": i,
|
|
2778
|
+
tabIndex: showTooltip && this.state.activeIndex === i ? 0 : -1,
|
|
2779
|
+
ref: (el) => {
|
|
2780
|
+
this.pointRefs[i] = el;
|
|
2781
|
+
},
|
|
2566
2782
|
x: p[0] - xUnit / 2 <= 0 ? 0 : p[0] - xUnit / 2,
|
|
2567
2783
|
y: 0,
|
|
2568
2784
|
width: i === 0 && data.length !== 1 ? xUnit / 2 : xUnit,
|
|
2569
2785
|
height,
|
|
2570
2786
|
style: { fillOpacity: 0 },
|
|
2571
|
-
|
|
2572
|
-
this.setState({
|
|
2573
|
-
open: data[i] !== null,
|
|
2574
|
-
rectArea: data[i] === null ? null : e.target,
|
|
2575
|
-
tooltip: data[i],
|
|
2576
|
-
currentPointX: p[0]
|
|
2577
|
-
});
|
|
2578
|
-
}
|
|
2787
|
+
onMouseDown: preventDefault
|
|
2579
2788
|
}
|
|
2580
2789
|
)
|
|
2581
2790
|
));
|
|
@@ -2611,22 +2820,16 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
|
|
|
2611
2820
|
}
|
|
2612
2821
|
)));
|
|
2613
2822
|
}
|
|
2614
|
-
renderCursor() {
|
|
2615
|
-
const {
|
|
2616
|
-
|
|
2617
|
-
cursorStrokeWidth,
|
|
2618
|
-
cursorStrokeLinecap,
|
|
2619
|
-
cursorStrokeDasharray,
|
|
2620
|
-
height
|
|
2621
|
-
} = this.props;
|
|
2622
|
-
return this.state.rectArea !== null && /* @__PURE__ */ react_default.createElement(
|
|
2823
|
+
renderCursor(currentPointX, shouldRender) {
|
|
2824
|
+
const { cursorStroke, cursorStrokeWidth, cursorStrokeLinecap, cursorStrokeDasharray, height } = this.props;
|
|
2825
|
+
return shouldRender && /* @__PURE__ */ react_default.createElement(
|
|
2623
2826
|
"line",
|
|
2624
2827
|
{
|
|
2625
2828
|
"data-test": "cursor",
|
|
2626
2829
|
ref: this.handleCursorMount,
|
|
2627
|
-
x1:
|
|
2830
|
+
x1: currentPointX,
|
|
2628
2831
|
y1: 0,
|
|
2629
|
-
x2:
|
|
2832
|
+
x2: currentPointX,
|
|
2630
2833
|
y2: height,
|
|
2631
2834
|
style: {
|
|
2632
2835
|
stroke: cursorStroke,
|
|
@@ -2637,19 +2840,20 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
|
|
|
2637
2840
|
}
|
|
2638
2841
|
);
|
|
2639
2842
|
}
|
|
2640
|
-
renderTooltip() {
|
|
2641
|
-
|
|
2843
|
+
renderTooltip(tooltipValue, isOpen) {
|
|
2844
|
+
const { anchor } = this.state;
|
|
2845
|
+
return /* @__PURE__ */ react_default.createElement(
|
|
2642
2846
|
Popover_default,
|
|
2643
2847
|
{
|
|
2644
2848
|
"data-test": "tooltip",
|
|
2645
|
-
open:
|
|
2646
|
-
anchor
|
|
2647
|
-
"data-test-value":
|
|
2849
|
+
open: isOpen,
|
|
2850
|
+
anchor,
|
|
2851
|
+
"data-test-value": tooltipValue,
|
|
2648
2852
|
appearance: "inverted",
|
|
2649
2853
|
defaultPlacement: "above",
|
|
2650
2854
|
animation: false
|
|
2651
2855
|
},
|
|
2652
|
-
/* @__PURE__ */ react_default.createElement(StyledTooltip, null,
|
|
2856
|
+
/* @__PURE__ */ react_default.createElement(StyledTooltip, null, tooltipValue)
|
|
2653
2857
|
);
|
|
2654
2858
|
}
|
|
2655
2859
|
/**
|
|
@@ -2720,39 +2924,69 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
|
|
|
2720
2924
|
width,
|
|
2721
2925
|
title
|
|
2722
2926
|
} = this.props;
|
|
2927
|
+
const { activeIndex, hoveredIndex, componentIsFocused } = this.state;
|
|
2723
2928
|
if (data.length === 0) {
|
|
2724
2929
|
return null;
|
|
2725
2930
|
}
|
|
2931
|
+
if (this.pointRefs.length !== data.length) {
|
|
2932
|
+
this.pointRefs.length = data.length;
|
|
2933
|
+
}
|
|
2726
2934
|
const xMargin = endDotRadius + endDotStrokeWidth / 2;
|
|
2727
2935
|
const yMargin = Math.max(lineStrokeWidth / 2, endDotRadius + endDotStrokeWidth / 2);
|
|
2728
2936
|
const points = this.dataToPoints(xMargin, yMargin);
|
|
2729
2937
|
const dotsToShow = Math.max(showEndDot && 1, (0, lodash_exports.isFinite)(endDotCount) && endDotCount > 0 && endDotCount);
|
|
2938
|
+
let currentPointX = null;
|
|
2939
|
+
let tooltipValue = null;
|
|
2940
|
+
let showCursorAndTooltip = false;
|
|
2941
|
+
let interactiveProps = {};
|
|
2942
|
+
if (showTooltip) {
|
|
2943
|
+
const isHovered = hoveredIndex !== null;
|
|
2944
|
+
const shouldDisplayInteractiveElements = (isHovered || componentIsFocused) && data.length > 0;
|
|
2945
|
+
if (shouldDisplayInteractiveElements) {
|
|
2946
|
+
const displayIndex = isHovered ? hoveredIndex : activeIndex;
|
|
2947
|
+
if (displayIndex !== null && displayIndex >= 0 && data.length > displayIndex && points.length > displayIndex) {
|
|
2948
|
+
const displayPointCoords = points[displayIndex];
|
|
2949
|
+
if (displayPointCoords) {
|
|
2950
|
+
[currentPointX] = displayPointCoords;
|
|
2951
|
+
}
|
|
2952
|
+
tooltipValue = data[displayIndex];
|
|
2953
|
+
showCursorAndTooltip = currentPointX !== null;
|
|
2954
|
+
}
|
|
2955
|
+
}
|
|
2956
|
+
interactiveProps = {
|
|
2957
|
+
onKeyDown: this.handleKeyDown,
|
|
2958
|
+
onMouseOver: this.handleMouseOver,
|
|
2959
|
+
onMouseLeave: this.handleMouseLeave,
|
|
2960
|
+
onFocus: this.handleFocus,
|
|
2961
|
+
onBlur: this.handleBlur
|
|
2962
|
+
};
|
|
2963
|
+
}
|
|
2964
|
+
const ariaLabel = title || (0, i18n_exports._)("Source count over time sparkline trend");
|
|
2730
2965
|
return /* @__PURE__ */ react_default.createElement(
|
|
2731
2966
|
"div",
|
|
2732
|
-
__spreadValues({
|
|
2967
|
+
__spreadValues(__spreadValues({
|
|
2733
2968
|
"data-test": "line",
|
|
2734
2969
|
"data-test-type": isArea ? "area" : "line",
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
}, (0, lodash_exports.omit)(this.props, (0, lodash_exports.keys)(_SparkLine.propTypes))),
|
|
2970
|
+
role: "group",
|
|
2971
|
+
ref: (el) => {
|
|
2972
|
+
this.containerRef.current = el;
|
|
2973
|
+
if (typeof elementRef === "function") {
|
|
2974
|
+
elementRef(el);
|
|
2975
|
+
} else if (elementRef && typeof elementRef === "object") {
|
|
2976
|
+
elementRef.current = el;
|
|
2977
|
+
}
|
|
2978
|
+
}
|
|
2979
|
+
}, interactiveProps), (0, lodash_exports.omit)(this.props, (0, lodash_exports.keys)(_SparkLine.propTypes))),
|
|
2745
2980
|
/* @__PURE__ */ react_default.createElement(
|
|
2746
2981
|
StyledSvg,
|
|
2747
2982
|
{
|
|
2748
2983
|
height,
|
|
2749
2984
|
width,
|
|
2750
|
-
role: "img",
|
|
2751
2985
|
"aria-labelledby": this.titleId,
|
|
2752
2986
|
"data-test": "sparkline-svg"
|
|
2753
2987
|
},
|
|
2754
|
-
/* @__PURE__ */ react_default.createElement("title", { id: this.titleId, "data-test": "sparkline-title" },
|
|
2755
|
-
/* @__PURE__ */ react_default.createElement("g", null, this.renderCursor(), this.renderPolyline(points), this.renderArea(points), dotsToShow ? this.renderEndDots(points, dotsToShow, xMargin) : null,
|
|
2988
|
+
/* @__PURE__ */ react_default.createElement("title", { id: this.titleId, "data-test": "sparkline-title" }, ariaLabel),
|
|
2989
|
+
/* @__PURE__ */ react_default.createElement("g", null, showTooltip ? this.renderCursor(currentPointX, showCursorAndTooltip) : null, this.renderPolyline(points), this.renderArea(points), dotsToShow ? this.renderEndDots(points, dotsToShow, xMargin) : null, this.renderRect(points, xMargin), showTooltip ? this.renderTooltip(tooltipValue, showCursorAndTooltip) : null)
|
|
2756
2990
|
)
|
|
2757
2991
|
);
|
|
2758
2992
|
}
|
|
@@ -2871,7 +3105,7 @@ var SparklineCell = ({
|
|
|
2871
3105
|
data = data.slice(1);
|
|
2872
3106
|
}
|
|
2873
3107
|
react_exports.useLayoutEffect(() => {
|
|
2874
|
-
setHeight(cellEl == null ? void 0 : cellEl.offsetHeight);
|
|
3108
|
+
setHeight((cellEl == null ? void 0 : cellEl.offsetHeight) || 20);
|
|
2875
3109
|
}, [cellEl]);
|
|
2876
3110
|
const cellStyle = react_exports.useMemo(
|
|
2877
3111
|
() => __spreadProps(__spreadValues({}, cell.style), {
|
|
@@ -2886,6 +3120,7 @@ var SparklineCell = ({
|
|
|
2886
3120
|
() => ({
|
|
2887
3121
|
paddingLeft: `${paddingLeftRight}px`,
|
|
2888
3122
|
paddingTop: `${paddingTopBottom}px`,
|
|
3123
|
+
// eslint-disable-next-line no-unsafe-optional-chaining
|
|
2889
3124
|
width: width === "auto" ? `${(cellEl == null ? void 0 : cellEl.offsetWidth) - paddingLeftRight * 2}px` : `${width}px`,
|
|
2890
3125
|
height: `${height - paddingTopBottom * 2}px`
|
|
2891
3126
|
}),
|
|
@@ -2921,14 +3156,12 @@ var SparklineCell = ({
|
|
|
2921
3156
|
SparklineCell.displayName = "SparklineCell";
|
|
2922
3157
|
|
|
2923
3158
|
// src/Table/PureTable.tsx
|
|
2924
|
-
var MINIMUM_COLUMN_SIZE =
|
|
3159
|
+
var MINIMUM_COLUMN_SIZE = 60;
|
|
2925
3160
|
var INITIAL_UNSET_COLUMN_WIDTH = 90;
|
|
2926
3161
|
var NonVisibleTableHead = styled_components_default(Table_default.Head)`
|
|
2927
3162
|
pointer-events: none;
|
|
2928
3163
|
& [data-test='head-cell'] > div {
|
|
2929
|
-
|
|
2930
|
-
padding: 0;
|
|
2931
|
-
margin: 0;
|
|
3164
|
+
display: none;
|
|
2932
3165
|
}
|
|
2933
3166
|
`;
|
|
2934
3167
|
var FixedTableHead = styled_components_default(Table_default.Head)`
|
|
@@ -2945,10 +3178,7 @@ var TableHeadCell = styled_components_default(Table_default.HeadCell)`
|
|
|
2945
3178
|
`;
|
|
2946
3179
|
var VizTableContainer = styled_components_default.div`
|
|
2947
3180
|
box-sizing: border-box;
|
|
2948
|
-
padding: ${
|
|
2949
|
-
enterprise: variables_default.spacingHalf,
|
|
2950
|
-
prisma: variables_default.spacingSmall
|
|
2951
|
-
})};
|
|
3181
|
+
padding: ${variables_default.spacingSmall};
|
|
2952
3182
|
background-color: ${(props) => (0, colorUtils_exports.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor};
|
|
2953
3183
|
display: flex;
|
|
2954
3184
|
flex-flow: column nowrap;
|
|
@@ -2958,6 +3188,19 @@ var VizTableContainer = styled_components_default.div`
|
|
|
2958
3188
|
* > td:hover {
|
|
2959
3189
|
color: ${({ isCellClickable }) => isCellClickable ? variables_default.linkColor : variables_default.textColor};
|
|
2960
3190
|
}
|
|
3191
|
+
|
|
3192
|
+
/* footer totals row styling */
|
|
3193
|
+
tr[data-test='footer-row-totals'] td[data-test='cell'] {
|
|
3194
|
+
color: ${variables_default.contentColorActive} !important;
|
|
3195
|
+
cursor: default;
|
|
3196
|
+
font-weight: bold;
|
|
3197
|
+
}
|
|
3198
|
+
|
|
3199
|
+
/* footer percentage row styling */
|
|
3200
|
+
tr[data-test='footer-row-percentages'] td[data-test='cell'] {
|
|
3201
|
+
color: ${variables_default.contentColorDefault} !important;
|
|
3202
|
+
cursor: default;
|
|
3203
|
+
}
|
|
2961
3204
|
`;
|
|
2962
3205
|
VizTableContainer.displayName = "VizTableContainer";
|
|
2963
3206
|
var PAGINATOR_CONTAINER_HEIGHT = 38;
|
|
@@ -2971,11 +3214,9 @@ var SUITableContainer = styled_components_default.div`
|
|
|
2971
3214
|
box-sizing: border-box;
|
|
2972
3215
|
flex-grow: 1;
|
|
2973
3216
|
overflow: hidden;
|
|
3217
|
+
|
|
2974
3218
|
${({ width, height, isPaging, theme }) => {
|
|
2975
|
-
const padding =
|
|
2976
|
-
enterprise: variables_default.spacingHalf({ theme }),
|
|
2977
|
-
prisma: variables_default.spacingSmall({ theme })
|
|
2978
|
-
})({ theme });
|
|
3219
|
+
const padding = variables_default.spacingSmall({ theme });
|
|
2979
3220
|
const paddingOffset = parseInt(padding, 10) * 2;
|
|
2980
3221
|
return (0, style_exports.toDimension)({
|
|
2981
3222
|
width: width - paddingOffset,
|
|
@@ -2995,7 +3236,7 @@ var SUITableContainer = styled_components_default.div`
|
|
|
2995
3236
|
`}
|
|
2996
3237
|
|
|
2997
3238
|
${({ headerStyle }) => headerStyle && headerStyle.color && styled_components_exports.css`
|
|
2998
|
-
& [data-test='head-cell'] > button > span {
|
|
3239
|
+
& [data-test='head-cell'] > div > button > span {
|
|
2999
3240
|
color: ${headerStyle.color};
|
|
3000
3241
|
}
|
|
3001
3242
|
`}
|
|
@@ -3030,16 +3271,24 @@ var withEmptyTableMessage = (Viz) => {
|
|
|
3030
3271
|
tableFormat,
|
|
3031
3272
|
columnFormat,
|
|
3032
3273
|
paginatorParams,
|
|
3033
|
-
count
|
|
3274
|
+
count,
|
|
3275
|
+
headersMetadata
|
|
3034
3276
|
} = props;
|
|
3035
|
-
const { tableHeader, tableBody } = useTable({
|
|
3277
|
+
const { tableHeader, tableBody, tableFooter } = useTable({
|
|
3036
3278
|
headers,
|
|
3037
3279
|
columnIds,
|
|
3038
3280
|
table,
|
|
3039
3281
|
headerVisibility,
|
|
3040
3282
|
showRowNumbers,
|
|
3041
3283
|
showInternalFields,
|
|
3042
|
-
|
|
3284
|
+
headersMetadata,
|
|
3285
|
+
tableFormat: __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, tableFormat), (tableFormat == null ? void 0 : tableFormat.headerAlign) && {
|
|
3286
|
+
headerAlign: (0, lodash_exports.cloneDeep)(tableFormat.headerAlign)
|
|
3287
|
+
}), (tableFormat == null ? void 0 : tableFormat.align) && {
|
|
3288
|
+
align: (0, lodash_exports.cloneDeep)(tableFormat.align)
|
|
3289
|
+
}), (tableFormat == null ? void 0 : tableFormat.cellTypes) && {
|
|
3290
|
+
cellTypes: (0, lodash_exports.cloneDeep)(tableFormat.cellTypes)
|
|
3291
|
+
}), (tableFormat == null ? void 0 : tableFormat.data) && { data: (0, lodash_exports.cloneDeep)(tableFormat.data) }),
|
|
3043
3292
|
columnFormat,
|
|
3044
3293
|
paginationOffset: paginatorParams == null ? void 0 : paginatorParams.current,
|
|
3045
3294
|
count
|
|
@@ -3047,7 +3296,7 @@ var withEmptyTableMessage = (Viz) => {
|
|
|
3047
3296
|
if (tableBody.rows.length === 0) {
|
|
3048
3297
|
return /* @__PURE__ */ react_exports.createElement(Message_default2, { type: "warning" }, (0, i18n_exports._)("No data!"));
|
|
3049
3298
|
}
|
|
3050
|
-
return /* @__PURE__ */ react_exports.createElement(Viz, __spreadProps(__spreadValues({}, props), { tableHeader, tableBody }));
|
|
3299
|
+
return /* @__PURE__ */ react_exports.createElement(Viz, __spreadProps(__spreadValues({}, props), { tableHeader, tableBody, tableFooter }));
|
|
3051
3300
|
};
|
|
3052
3301
|
Wrapper.displayName = "PureTableWrapper";
|
|
3053
3302
|
return Wrapper;
|
|
@@ -3091,7 +3340,10 @@ var PureTable = (props) => {
|
|
|
3091
3340
|
backgroundColor,
|
|
3092
3341
|
tableHeader,
|
|
3093
3342
|
tableBody,
|
|
3343
|
+
tableFooter,
|
|
3094
3344
|
showRowNumbers,
|
|
3345
|
+
showFooterTotals,
|
|
3346
|
+
showFooterPercentages,
|
|
3095
3347
|
sortParams: { currentSortKey, currentSortDir, onSort },
|
|
3096
3348
|
paginatorParams: _b
|
|
3097
3349
|
} = _a, _c = _b, { isPaging, onChange: paginatorOnChange } = _c, paginatorProps = __objRest(_c, ["isPaging", "onChange"]), {
|
|
@@ -3137,7 +3389,11 @@ var PureTable = (props) => {
|
|
|
3137
3389
|
);
|
|
3138
3390
|
const drilldownHandler = react_exports.useCallback(
|
|
3139
3391
|
(e) => {
|
|
3140
|
-
|
|
3392
|
+
var _a2;
|
|
3393
|
+
const element = (_a2 = e.target) == null ? void 0 : _a2.closest("[data-row-index]");
|
|
3394
|
+
if (!element) {
|
|
3395
|
+
return;
|
|
3396
|
+
}
|
|
3141
3397
|
const row = element.getAttribute("data-row-index");
|
|
3142
3398
|
const col = element.getAttribute("data-col-index");
|
|
3143
3399
|
const arrayIndex = element.getAttribute("data-array-index") || -1;
|
|
@@ -3191,9 +3447,6 @@ var PureTable = (props) => {
|
|
|
3191
3447
|
e.stopPropagation();
|
|
3192
3448
|
}
|
|
3193
3449
|
}, []);
|
|
3194
|
-
const handleEventHeadCellMouseUp = react_exports.useCallback(() => {
|
|
3195
|
-
setResizing(false);
|
|
3196
|
-
}, [setResizing]);
|
|
3197
3450
|
const handleKeyDown = (e) => {
|
|
3198
3451
|
if (e.keyCode !== 13) {
|
|
3199
3452
|
return;
|
|
@@ -3219,7 +3472,6 @@ var PureTable = (props) => {
|
|
|
3219
3472
|
if (mode === "edit") {
|
|
3220
3473
|
debouncedOnColumnFormatChange(updatedCF);
|
|
3221
3474
|
}
|
|
3222
|
-
setResizing(false);
|
|
3223
3475
|
};
|
|
3224
3476
|
const fontMapped = fontMap[font] || fontMap.proportional;
|
|
3225
3477
|
const fontSizeMapped = fontSizeMap[fontSize] || fontSizeMap.default;
|
|
@@ -3235,6 +3487,7 @@ var PureTable = (props) => {
|
|
|
3235
3487
|
}).length;
|
|
3236
3488
|
const isFullyFixed = visibleHeaderCells.length === numberOfFixedHeaders;
|
|
3237
3489
|
const isHeaderHidden = headerVisibility === "none";
|
|
3490
|
+
const onSortToUse = isResizing ? lodash_exports.noop : onSort;
|
|
3238
3491
|
return /* @__PURE__ */ react_exports.createElement(
|
|
3239
3492
|
VizTableContainer,
|
|
3240
3493
|
{
|
|
@@ -3297,9 +3550,8 @@ var PureTable = (props) => {
|
|
|
3297
3550
|
sortDir: sortKey === currentSortKey ? currentSortDir : "none",
|
|
3298
3551
|
width: (_b2 = (_a2 = columns[value]) == null ? void 0 : _a2.width) != null ? _b2 : INITIAL_UNSET_COLUMN_WIDTH,
|
|
3299
3552
|
onMouseDown: handleEventHeadCellMouseDown,
|
|
3300
|
-
onMouseUp: handleEventHeadCellMouseUp,
|
|
3301
3553
|
value,
|
|
3302
|
-
onSort:
|
|
3554
|
+
onSort: showRowNumbers && value === "#" || isHeaderHidden ? null : onSortToUse,
|
|
3303
3555
|
resizable: !isHeaderHidden,
|
|
3304
3556
|
style: showRowNumbers && value === "#" ? __spreadProps(__spreadValues({}, style), { cursor: "auto" }) : style,
|
|
3305
3557
|
headerVisibility
|
|
@@ -3308,32 +3560,66 @@ var PureTable = (props) => {
|
|
|
3308
3560
|
}
|
|
3309
3561
|
)),
|
|
3310
3562
|
/* @__PURE__ */ react_exports.createElement(Table_default.Body, null, tableBody.rows.map(
|
|
3311
|
-
(row) => /* @__PURE__ */ react_exports.createElement(Table_default.Row, { key: row.key }, row.cells.filter((c) => c.showCell).map(
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3563
|
+
(row) => /* @__PURE__ */ react_exports.createElement(Table_default.Row, { key: row.key }, row.cells.filter((c) => c.showCell).map((cell) => {
|
|
3564
|
+
var _a2, _b2;
|
|
3565
|
+
return /* @__PURE__ */ react_exports.createElement(SwitchTableCell, { key: cell.key, type: cell.cellType }, /* @__PURE__ */ react_exports.createElement(
|
|
3566
|
+
TextCell,
|
|
3567
|
+
{
|
|
3568
|
+
cell,
|
|
3569
|
+
useMouseOverEffect: !!onCellClick
|
|
3570
|
+
}
|
|
3571
|
+
), /* @__PURE__ */ react_exports.createElement(
|
|
3572
|
+
SparklineCell,
|
|
3573
|
+
{
|
|
3574
|
+
cell,
|
|
3575
|
+
useMouseOverEffect: !!onCellClick,
|
|
3576
|
+
width: (_b2 = (_a2 = columns[cell.header]) == null ? void 0 : _a2.width) != null ? _b2 : "auto"
|
|
3577
|
+
}
|
|
3578
|
+
), /* @__PURE__ */ react_exports.createElement(
|
|
3579
|
+
ArrayCell,
|
|
3580
|
+
{
|
|
3581
|
+
cell,
|
|
3582
|
+
useMouseOverEffect: !!onCellClick
|
|
3583
|
+
}
|
|
3584
|
+
));
|
|
3585
|
+
}))
|
|
3586
|
+
), tableFooter && /* @__PURE__ */ react_exports.createElement(react_exports.Fragment, null, showFooterTotals && tableFooter.rows[0] && /* @__PURE__ */ react_exports.createElement(
|
|
3587
|
+
Table_default.Row,
|
|
3588
|
+
{
|
|
3589
|
+
key: tableFooter.rows[0].key,
|
|
3590
|
+
"data-test": "footer-row-totals",
|
|
3591
|
+
"data-row-index": "0"
|
|
3592
|
+
},
|
|
3593
|
+
tableFooter.rows[0].cells.filter((c) => c.showCell).map(
|
|
3594
|
+
(c) => /* @__PURE__ */ react_exports.createElement(
|
|
3595
|
+
TextCell,
|
|
3596
|
+
{
|
|
3597
|
+
key: `footer-total-cell-${c.key}`,
|
|
3598
|
+
cell: c,
|
|
3599
|
+
useMouseOverEffect: false,
|
|
3600
|
+
"data-test": "footer-total-cell"
|
|
3601
|
+
}
|
|
3602
|
+
)
|
|
3603
|
+
)
|
|
3604
|
+
), showFooterPercentages && tableFooter.rows[1] && /* @__PURE__ */ react_exports.createElement(
|
|
3605
|
+
Table_default.Row,
|
|
3606
|
+
{
|
|
3607
|
+
key: tableFooter.rows[1].key,
|
|
3608
|
+
"data-test": "footer-row-percentages",
|
|
3609
|
+
"data-row-index": "1"
|
|
3610
|
+
},
|
|
3611
|
+
tableFooter.rows[1].cells.filter((c) => c.showCell).map(
|
|
3612
|
+
(c) => /* @__PURE__ */ react_exports.createElement(
|
|
3613
|
+
TextCell,
|
|
3614
|
+
{
|
|
3615
|
+
key: `footer-percent-cell-${c.key}`,
|
|
3616
|
+
cell: c,
|
|
3617
|
+
useMouseOverEffect: false,
|
|
3618
|
+
"data-test": "footer-percent-cell"
|
|
3619
|
+
}
|
|
3620
|
+
)
|
|
3621
|
+
)
|
|
3622
|
+
)))
|
|
3337
3623
|
)
|
|
3338
3624
|
),
|
|
3339
3625
|
isPaging ? /* @__PURE__ */ react_exports.createElement(PaginatorContainer, null, /* @__PURE__ */ react_exports.createElement(Paginator_default, __spreadValues({ onChange: paginatorOnChange }, paginatorProps))) : null
|
|
@@ -3363,6 +3649,7 @@ PureTable.propTypes = {
|
|
|
3363
3649
|
onCellClick: prop_types_exports.func,
|
|
3364
3650
|
paginatorParams: PaginatorParamsPropTypes,
|
|
3365
3651
|
showRowNumbers: prop_types_exports.bool,
|
|
3652
|
+
showFooterTotals: prop_types_exports.bool,
|
|
3366
3653
|
sortParams: SortParamsPropTypes,
|
|
3367
3654
|
table: prop_types_exports.arrayOf(prop_types_exports.arrayOf(cellDataType)),
|
|
3368
3655
|
tableFormat: prop_types_exports.shape({
|
|
@@ -3396,6 +3683,8 @@ PureTable.defaultProps = {
|
|
|
3396
3683
|
onChange: lodash_exports.noop
|
|
3397
3684
|
},
|
|
3398
3685
|
showRowNumbers: false,
|
|
3686
|
+
showFooterTotals: false,
|
|
3687
|
+
showFooterPercentages: false,
|
|
3399
3688
|
sortParams: {
|
|
3400
3689
|
onSort: lodash_exports.noop
|
|
3401
3690
|
},
|
|
@@ -3413,8 +3702,16 @@ var PureTable_default = withEmptyTableMessage(FixedSizeContainer_default(PureTab
|
|
|
3413
3702
|
// src/Table/Table.tsx
|
|
3414
3703
|
var computeVizProps = (_a) => {
|
|
3415
3704
|
var props = __objRest(_a, []);
|
|
3416
|
-
var _a2, _b, _c, _d;
|
|
3705
|
+
var _a2, _b, _c, _d, _e, _f, _g;
|
|
3417
3706
|
const vizProps = __spreadValues({}, props);
|
|
3707
|
+
vizProps.columnIds = (_d = (_c = (_b = (_a2 = vizProps.dataSources) == null ? void 0 : _a2.primary) == null ? void 0 : _b.data) == null ? void 0 : _c.fields.map((field) => {
|
|
3708
|
+
var _a3;
|
|
3709
|
+
return (_a3 = field.name) != null ? _a3 : field;
|
|
3710
|
+
})) != null ? _d : [];
|
|
3711
|
+
if (vizProps.columnIds.length === 0) {
|
|
3712
|
+
vizProps.columnIds = vizProps.headers;
|
|
3713
|
+
}
|
|
3714
|
+
vizProps.headersMetadata = (_g = (_f = (_e = vizProps.dataSources) == null ? void 0 : _e.primary) == null ? void 0 : _f.data) == null ? void 0 : _g.fields;
|
|
3418
3715
|
if (vizProps.columnFormat) {
|
|
3419
3716
|
const columns = vizProps.columnFormat;
|
|
3420
3717
|
const themeRowBackgroundColorOdd = vizProps.themeFunc("rowBackgroundColorOdd");
|
|
@@ -3436,15 +3733,10 @@ var computeVizProps = (_a) => {
|
|
|
3436
3733
|
(color) => color || themeTextColor
|
|
3437
3734
|
);
|
|
3438
3735
|
}
|
|
3439
|
-
vizProps.columnFormat[columnKey] = __spreadValues(__spreadValues(__spreadValues({}, vizProps.columnFormat[columnKey]), columnProperties.rowBackgroundColors && {
|
|
3736
|
+
vizProps.columnFormat[columnKey] = __spreadValues(__spreadValues(__spreadValues({}, vizProps.columnFormat[columnKey]), columnProperties.rowBackgroundColors && {
|
|
3737
|
+
rowBackgroundColors
|
|
3738
|
+
}), columnProperties.rowColors && { rowColors });
|
|
3440
3739
|
});
|
|
3441
|
-
vizProps.columnIds = (_d = (_c = (_b = (_a2 = vizProps.dataSources) == null ? void 0 : _a2.primary) == null ? void 0 : _b.data) == null ? void 0 : _c.fields.map((field) => {
|
|
3442
|
-
var _a3;
|
|
3443
|
-
return (_a3 = field.name) != null ? _a3 : field;
|
|
3444
|
-
})) != null ? _d : [];
|
|
3445
|
-
if (vizProps.columnIds.length === 0) {
|
|
3446
|
-
vizProps.columnIds = vizProps.headers;
|
|
3447
|
-
}
|
|
3448
3740
|
}
|
|
3449
3741
|
if (vizProps.onOptionsChange) {
|
|
3450
3742
|
const handleColumnFormatChange = (updatedColumnFormat) => {
|
|
@@ -3469,12 +3761,31 @@ var computeVizProps = (_a) => {
|
|
|
3469
3761
|
}
|
|
3470
3762
|
return vizProps;
|
|
3471
3763
|
};
|
|
3472
|
-
var
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
});
|
|
3764
|
+
var withTableFooter = (Viz) => {
|
|
3765
|
+
const VizWithTableFooter = (_a) => {
|
|
3766
|
+
var _b = _a, { dataSources } = _b, otherProps = __objRest(_b, ["dataSources"]);
|
|
3767
|
+
var _a2;
|
|
3768
|
+
if (!((_a2 = dataSources == null ? void 0 : dataSources.primary) == null ? void 0 : _a2.data)) {
|
|
3769
|
+
return /* @__PURE__ */ react_exports.createElement(Viz, __spreadValues({}, otherProps));
|
|
3770
|
+
}
|
|
3771
|
+
const clonedDataSources = (0, lodash_exports.cloneDeep)(dataSources);
|
|
3772
|
+
const { primary } = clonedDataSources;
|
|
3773
|
+
clonedDataSources.primary = updateSumTotalValues(primary);
|
|
3774
|
+
return /* @__PURE__ */ react_exports.createElement(Viz, __spreadValues({ dataSources: clonedDataSources }, otherProps));
|
|
3775
|
+
};
|
|
3776
|
+
VizWithTableFooter.propTypes = Viz.propTypes;
|
|
3777
|
+
VizWithTableFooter.defaultProps = Viz.defaultProps;
|
|
3778
|
+
VizWithTableFooter.config = Viz.config;
|
|
3779
|
+
return VizWithTableFooter;
|
|
3780
|
+
};
|
|
3781
|
+
var Table = withTableFooter(
|
|
3782
|
+
withDashboardViz_default({
|
|
3783
|
+
ReactViz: PureTable_default,
|
|
3784
|
+
vizConfig: config_default,
|
|
3785
|
+
disableEditModeCover: true,
|
|
3786
|
+
computeVizProps
|
|
3787
|
+
})
|
|
3788
|
+
);
|
|
3478
3789
|
var { themes: themes2 } = config_default;
|
|
3479
3790
|
var Table_default2 = Table;
|
|
3480
3791
|
//# sourceMappingURL=Table.js.map
|