logitude-dashboard-library 1.4.51 → 1.4.53
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/dist/Utils/General.d.ts +2 -0
- package/dist/assets/images/delete-icon.svg +3 -0
- package/dist/assets/images/edit-icon.svg +3 -0
- package/dist/assets/styles/dl-dashboard.scss +69 -14
- package/dist/delete-icon~HsiaSdfs.svg +3 -0
- package/dist/delete-icon~eciVlkBl.svg +3 -0
- package/dist/delete-icon~fYbwNrdz.svg +3 -0
- package/dist/edit-icon~binDxVAt.svg +3 -0
- package/dist/edit-icon~roheEGno.svg +3 -0
- package/dist/edit-icon~xptiVoWp.svg +3 -0
- package/dist/features/Dashboard/DashboardDesigner.d.ts +8 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +161 -60
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +161 -60
- package/dist/index.modern.js.map +1 -1
- package/dist/types/DashboardDataBinding.d.ts +2 -0
- package/dist/types/widget.d.ts +6 -0
- package/package.json +1 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M8.99983 3.51152H11.9998V4.7757H10.7998V12.9929C10.7998 13.1605 10.7366 13.3213 10.6241 13.4398C10.5116 13.5584 10.359 13.625 10.1998 13.625H1.79983C1.6407 13.625 1.48809 13.5584 1.37557 13.4398C1.26305 13.3213 1.19983 13.1605 1.19983 12.9929V4.7757H-0.000167847V3.51152H2.99983V1.61525C2.99983 1.4476 3.06305 1.28683 3.17557 1.16829C3.28809 1.04975 3.4407 0.983154 3.59983 0.983154H8.39983C8.55896 0.983154 8.71158 1.04975 8.8241 1.16829C8.93662 1.28683 8.99983 1.4476 8.99983 1.61525V3.51152ZM9.59983 4.7757H2.39983V12.3608H9.59983V4.7757ZM4.19983 6.67197H5.39983V10.4645H4.19983V6.67197ZM6.59983 6.67197H7.79983V10.4645H6.59983V6.67197ZM4.19983 2.24734V3.51152H7.79983V2.24734H4.19983Z" fill="#5FAFDA"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M8.48527 5.38322L7.54247 4.4404L1.33333 10.6496V11.5924H2.27614L8.48527 5.38322ZM9.42807 4.4404L10.3709 3.4976L9.42807 2.55479L8.48527 3.4976L9.42807 4.4404ZM2.82843 12.9257H0V10.0973L8.95667 1.14058C9.21707 0.880224 9.63913 0.880224 9.89947 1.14058L11.7851 3.02619C12.0455 3.28654 12.0455 3.70865 11.7851 3.969L2.82843 12.9257Z" fill="#5FAFDA"/>
|
|
3
|
+
</svg>
|
|
@@ -271,22 +271,78 @@ $dark-grey: #717585;
|
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
274
|
+
.widget-titles-container {
|
|
275
|
+
display: flex;
|
|
276
|
+
flex-wrap: wrap;
|
|
277
|
+
width: calc(100% - 4rem);
|
|
278
|
+
padding: 0px 12px 12px 12px;
|
|
279
|
+
|
|
280
|
+
.title-container {
|
|
281
|
+
display: flex;
|
|
282
|
+
align-items: center;
|
|
283
|
+
justify-content: left;
|
|
284
|
+
flex: 1;
|
|
285
|
+
white-space: nowrap;
|
|
286
|
+
overflow: hidden;
|
|
287
|
+
text-overflow: ellipsis;
|
|
288
|
+
min-width: 1px;
|
|
289
|
+
|
|
290
|
+
.title {
|
|
291
|
+
text-transform: capitalize;
|
|
292
|
+
font-family: 'Manrope', sans-serif;
|
|
293
|
+
font-style: normal;
|
|
294
|
+
color: #292D30;
|
|
295
|
+
padding-top: 12px;
|
|
296
|
+
margin-top: 0;
|
|
297
|
+
margin-bottom: 0;
|
|
298
|
+
font-size: 12px;
|
|
299
|
+
font-weight: 600;
|
|
300
|
+
white-space: nowrap;
|
|
301
|
+
overflow: hidden;
|
|
302
|
+
text-overflow: ellipsis;
|
|
303
|
+
width: auto;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.subtitle {
|
|
308
|
+
font-family: 'Manrope', sans-serif;
|
|
309
|
+
font-style: normal;
|
|
310
|
+
color: #292D30;
|
|
311
|
+
margin-top: 4px;
|
|
312
|
+
font-size: 12px;
|
|
313
|
+
font-weight: 600;
|
|
314
|
+
white-space: nowrap;
|
|
315
|
+
overflow: hidden;
|
|
316
|
+
text-overflow: ellipsis;
|
|
317
|
+
width: 100%;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.widget-options-container {
|
|
322
|
+
display: flex;
|
|
323
|
+
align-items: center;
|
|
324
|
+
width: 60px;
|
|
325
|
+
column-gap: 6px;
|
|
326
|
+
|
|
327
|
+
svg {
|
|
328
|
+
width: 20px;
|
|
329
|
+
height: 20px;
|
|
330
|
+
transform: scale(1.2);
|
|
331
|
+
|
|
332
|
+
&:hover {
|
|
333
|
+
cursor: pointer;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
287
336
|
}
|
|
288
337
|
}
|
|
289
338
|
|
|
339
|
+
.margin-top-6 {
|
|
340
|
+
margin-top: 6px;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.margin-top-4 {
|
|
344
|
+
margin-top: 4px;
|
|
345
|
+
}
|
|
290
346
|
|
|
291
347
|
#container {
|
|
292
348
|
width: 100%;
|
|
@@ -313,7 +369,6 @@ $dark-grey: #717585;
|
|
|
313
369
|
align-items: flex-start;
|
|
314
370
|
}
|
|
315
371
|
|
|
316
|
-
|
|
317
372
|
.filter-label {
|
|
318
373
|
font-size: 12px;
|
|
319
374
|
color: $dark-grey;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M8.99983 3.51152H11.9998V4.7757H10.7998V12.9929C10.7998 13.1605 10.7366 13.3213 10.6241 13.4398C10.5116 13.5584 10.359 13.625 10.1998 13.625H1.79983C1.6407 13.625 1.48809 13.5584 1.37557 13.4398C1.26305 13.3213 1.19983 13.1605 1.19983 12.9929V4.7757H-0.000167847V3.51152H2.99983V1.61525C2.99983 1.4476 3.06305 1.28683 3.17557 1.16829C3.28809 1.04975 3.4407 0.983154 3.59983 0.983154H8.39983C8.55896 0.983154 8.71158 1.04975 8.8241 1.16829C8.93662 1.28683 8.99983 1.4476 8.99983 1.61525V3.51152ZM9.59983 4.7757H2.39983V12.3608H9.59983V4.7757ZM4.19983 6.67197H5.39983V10.4645H4.19983V6.67197ZM6.59983 6.67197H7.79983V10.4645H6.59983V6.67197ZM4.19983 2.24734V3.51152H7.79983V2.24734H4.19983Z" fill="#5FAFDA"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="12" height="14" viewBox="0 0 12 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M8.99983 3.51152H11.9998V4.7757H10.7998V12.9929C10.7998 13.1605 10.7366 13.3213 10.6241 13.4398C10.5116 13.5584 10.359 13.625 10.1998 13.625H1.79983C1.6407 13.625 1.48809 13.5584 1.37557 13.4398C1.26305 13.3213 1.19983 13.1605 1.19983 12.9929V4.7757H-0.000167847V3.51152H2.99983V1.61525C2.99983 1.4476 3.06305 1.28683 3.17557 1.16829C3.28809 1.04975 3.4407 0.983154 3.59983 0.983154H8.39983C8.55896 0.983154 8.71158 1.04975 8.8241 1.16829C8.93662 1.28683 8.99983 1.4476 8.99983 1.61525V3.51152ZM9.59983 4.7757H2.39983V12.3608H9.59983V4.7757ZM4.19983 6.67197H5.39983V10.4645H4.19983V6.67197ZM6.59983 6.67197H7.79983V10.4645H6.59983V6.67197ZM4.19983 2.24734V3.51152H7.79983V2.24734H4.19983Z" fill="#5FAFDA"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M8.99983 3.51152H11.9998V4.7757H10.7998V12.9929C10.7998 13.1605 10.7366 13.3213 10.6241 13.4398C10.5116 13.5584 10.359 13.625 10.1998 13.625H1.79983C1.6407 13.625 1.48809 13.5584 1.37557 13.4398C1.26305 13.3213 1.19983 13.1605 1.19983 12.9929V4.7757H-0.000167847V3.51152H2.99983V1.61525C2.99983 1.4476 3.06305 1.28683 3.17557 1.16829C3.28809 1.04975 3.4407 0.983154 3.59983 0.983154H8.39983C8.55896 0.983154 8.71158 1.04975 8.8241 1.16829C8.93662 1.28683 8.99983 1.4476 8.99983 1.61525V3.51152ZM9.59983 4.7757H2.39983V12.3608H9.59983V4.7757ZM4.19983 6.67197H5.39983V10.4645H4.19983V6.67197ZM6.59983 6.67197H7.79983V10.4645H6.59983V6.67197ZM4.19983 2.24734V3.51152H7.79983V2.24734H4.19983Z" fill="#5FAFDA"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M8.48527 5.38322L7.54247 4.4404L1.33333 10.6496V11.5924H2.27614L8.48527 5.38322ZM9.42807 4.4404L10.3709 3.4976L9.42807 2.55479L8.48527 3.4976L9.42807 4.4404ZM2.82843 12.9257H0V10.0973L8.95667 1.14058C9.21707 0.880224 9.63913 0.880224 9.89947 1.14058L11.7851 3.02619C12.0455 3.28654 12.0455 3.70865 11.7851 3.969L2.82843 12.9257Z" fill="#5FAFDA"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M8.48527 5.38322L7.54247 4.4404L1.33333 10.6496V11.5924H2.27614L8.48527 5.38322ZM9.42807 4.4404L10.3709 3.4976L9.42807 2.55479L8.48527 3.4976L9.42807 4.4404ZM2.82843 12.9257H0V10.0973L8.95667 1.14058C9.21707 0.880224 9.63913 0.880224 9.89947 1.14058L11.7851 3.02619C12.0455 3.28654 12.0455 3.70865 11.7851 3.969L2.82843 12.9257Z" fill="#5FAFDA"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="12" height="13" viewBox="0 0 12 13" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M8.48527 5.38322L7.54247 4.4404L1.33333 10.6496V11.5924H2.27614L8.48527 5.38322ZM9.42807 4.4404L10.3709 3.4976L9.42807 2.55479L8.48527 3.4976L9.42807 4.4404ZM2.82843 12.9257H0V10.0973L8.95667 1.14058C9.21707 0.880224 9.63913 0.880224 9.89947 1.14058L11.7851 3.02619C12.0455 3.28654 12.0455 3.70865 11.7851 3.969L2.82843 12.9257Z" fill="#5FAFDA"/>
|
|
3
|
+
</svg>
|
|
@@ -3,6 +3,13 @@ import React from "react";
|
|
|
3
3
|
import { ReactWidgetPM } from "../../types/widget";
|
|
4
4
|
import { DataPointSelection } from "../../types/SeriesMeasure";
|
|
5
5
|
import { DashboardDataBinding } from "../../types/DashboardDataBinding";
|
|
6
|
+
export declare type DeleteWidgetProps = {
|
|
7
|
+
id: string;
|
|
8
|
+
layouts: any;
|
|
9
|
+
widgets: {
|
|
10
|
+
lg: ReactWidgetPM[];
|
|
11
|
+
};
|
|
12
|
+
};
|
|
6
13
|
declare type DashboardDesignerProps = {
|
|
7
14
|
editMode: boolean;
|
|
8
15
|
Widgetlayouts: {
|
|
@@ -10,6 +17,7 @@ declare type DashboardDesignerProps = {
|
|
|
10
17
|
};
|
|
11
18
|
openEditWidget: (widget: ReactWidgetPM) => void;
|
|
12
19
|
onLayoutChange: (layouts: Layouts) => void;
|
|
20
|
+
onWidgetDelete: (deleteProps: DeleteWidgetProps) => void;
|
|
13
21
|
dataBinding: DashboardDataBinding;
|
|
14
22
|
onSelectDataPoint: (dataPointSelection: DataPointSelection) => void;
|
|
15
23
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { DeleteWidgetProps } from './features/Dashboard/DashboardDesigner';
|
|
2
3
|
import "./styles.module.css";
|
|
3
4
|
import { ReactWidgetPM } from './types/widget';
|
|
4
5
|
import { DashboardDataBinding } from './types/DashboardDataBinding';
|
|
@@ -14,6 +15,7 @@ declare type DashboardProps = {
|
|
|
14
15
|
lg: ReactWidgetPM[];
|
|
15
16
|
}) => void;
|
|
16
17
|
openEditWidget: (Widget: ReactWidgetPM) => void;
|
|
18
|
+
openDeleteWidgetConfirmWindow: (deleteProps: DeleteWidgetProps) => void;
|
|
17
19
|
onSelectDataPoint: (dataPointSelection: DataPointSelection) => void;
|
|
18
20
|
};
|
|
19
21
|
declare const Dashboard: (props: DashboardProps) => React.JSX.Element;
|
package/dist/index.js
CHANGED
|
@@ -3,8 +3,6 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var React__default = _interopDefault(React);
|
|
5
5
|
var reactGridLayout = require('react-grid-layout');
|
|
6
|
-
var button = require('primereact/button');
|
|
7
|
-
var overlaypanel = require('primereact/overlaypanel');
|
|
8
6
|
var progressspinner = require('primereact/progressspinner');
|
|
9
7
|
var axios = _interopDefault(require('axios'));
|
|
10
8
|
var tooltip = require('primereact/tooltip');
|
|
@@ -661,11 +659,11 @@ function getBarObject(seriesMeasures, widget) {
|
|
|
661
659
|
chartInfo.scrollPadding = "8";
|
|
662
660
|
chartInfo.flatScrollBars = "1";
|
|
663
661
|
chartInfo.showPercentValues = "1";
|
|
664
|
-
chartInfo.showLegend =
|
|
662
|
+
chartInfo.showLegend = widget.ShowLegend ? '1' : '0';
|
|
665
663
|
setLineDash(chartInfo);
|
|
666
664
|
chartInfo.chartTopMargin = "10";
|
|
667
665
|
chartInfo.chartBottomMargin = "10";
|
|
668
|
-
chartInfo.legendPosition = widget
|
|
666
|
+
chartInfo.legendPosition = getWidgetLegendPosition(widget);
|
|
669
667
|
chart.dataSource = getCategoriesBasedDataSource(chartInfo, seriesMeasures, widget);
|
|
670
668
|
return chart;
|
|
671
669
|
}
|
|
@@ -676,12 +674,11 @@ function getStackedBarObject(seriesMeasures, widget) {
|
|
|
676
674
|
chartInfo.scrollPadding = "8";
|
|
677
675
|
chartInfo.flatScrollBars = "1";
|
|
678
676
|
chartInfo.showPercentValues = "1";
|
|
679
|
-
chartInfo.showLegend =
|
|
677
|
+
chartInfo.showLegend = widget.ShowLegend ? '1' : '0';
|
|
680
678
|
setLineDash(chartInfo);
|
|
681
679
|
chartInfo.chartTopMargin = "10";
|
|
682
680
|
chartInfo.chartBottomMargin = "10";
|
|
683
|
-
chartInfo.
|
|
684
|
-
chartInfo.legendPosition = widget.LegendPosition ? widget.LegendPosition : "bottom";
|
|
681
|
+
chartInfo.legendPosition = getWidgetLegendPosition(widget);
|
|
685
682
|
chart.dataSource = getStackedDataSource(chartInfo, seriesMeasures, widget);
|
|
686
683
|
return chart;
|
|
687
684
|
}
|
|
@@ -692,12 +689,11 @@ function getClusteredColumnObject(seriesMeasures, widget) {
|
|
|
692
689
|
chartInfo.scrollPadding = "8";
|
|
693
690
|
chartInfo.flatScrollBars = "1";
|
|
694
691
|
chartInfo.showPercentValues = "1";
|
|
695
|
-
chartInfo.showLegend =
|
|
692
|
+
chartInfo.showLegend = widget.ShowLegend ? '1' : '0';
|
|
696
693
|
setLineDash(chartInfo);
|
|
697
694
|
chartInfo.chartTopMargin = "10";
|
|
698
695
|
chartInfo.chartBottomMargin = "10";
|
|
699
|
-
chartInfo.
|
|
700
|
-
chartInfo.legendPosition = widget.LegendPosition ? widget.LegendPosition : "bottom";
|
|
696
|
+
chartInfo.legendPosition = getWidgetLegendPosition(widget);
|
|
701
697
|
chart.dataSource = getStackedDataSource(chartInfo, seriesMeasures, widget);
|
|
702
698
|
return chart;
|
|
703
699
|
}
|
|
@@ -708,12 +704,11 @@ function getClusteredLineObject(seriesMeasures, widget) {
|
|
|
708
704
|
chartInfo.scrollPadding = "8";
|
|
709
705
|
chartInfo.flatScrollBars = "1";
|
|
710
706
|
chartInfo.showPercentValues = "1";
|
|
711
|
-
chartInfo.showLegend =
|
|
707
|
+
chartInfo.showLegend = widget.ShowLegend ? '1' : '0';
|
|
712
708
|
setLineDash(chartInfo);
|
|
713
709
|
chartInfo.chartTopMargin = "10";
|
|
714
710
|
chartInfo.chartBottomMargin = "10";
|
|
715
|
-
chartInfo.
|
|
716
|
-
chartInfo.legendPosition = widget.LegendPosition ? widget.LegendPosition : "bottom";
|
|
711
|
+
chartInfo.legendPosition = getWidgetLegendPosition(widget);
|
|
717
712
|
chart.dataSource = getStackedDataSource(chartInfo, seriesMeasures, widget);
|
|
718
713
|
return chart;
|
|
719
714
|
}
|
|
@@ -724,7 +719,7 @@ function getLineObject(seriesMeasures, widget) {
|
|
|
724
719
|
chartInfo.scrollPadding = "8";
|
|
725
720
|
chartInfo.flatScrollBars = "1";
|
|
726
721
|
chartInfo.showPercentValues = "1";
|
|
727
|
-
chartInfo.showLegend =
|
|
722
|
+
chartInfo.showLegend = widget.ShowLegend ? '1' : '0';
|
|
728
723
|
setLineDash(chartInfo);
|
|
729
724
|
chartInfo.chartTopMargin = "20";
|
|
730
725
|
chartInfo.chartBottomMargin = "10";
|
|
@@ -733,7 +728,7 @@ function getLineObject(seriesMeasures, widget) {
|
|
|
733
728
|
chartInfo.anchorradius = "5";
|
|
734
729
|
chartInfo.canvasBottomPadding = "10";
|
|
735
730
|
chartInfo.canvasTopPadding = "10";
|
|
736
|
-
chartInfo.legendPosition = widget
|
|
731
|
+
chartInfo.legendPosition = getWidgetLegendPosition(widget);
|
|
737
732
|
chart.dataSource = getCategoriesBasedDataSource(chartInfo, seriesMeasures, widget);
|
|
738
733
|
return chart;
|
|
739
734
|
}
|
|
@@ -746,7 +741,7 @@ function getDonutObject(seriesMeasures, widget) {
|
|
|
746
741
|
chartInfo.manageLabelOverflow = "1";
|
|
747
742
|
chartInfo.useEllipsesWhenOverflow = "1";
|
|
748
743
|
chartInfo.enableSmartLabels = "1";
|
|
749
|
-
chartInfo.legendPosition = widget
|
|
744
|
+
chartInfo.legendPosition = getWidgetLegendPosition(widget);
|
|
750
745
|
setPieDonutLegends(chartInfo, widget);
|
|
751
746
|
chart.dataSource = getSimpleDataSource(chartInfo, seriesMeasures, widget);
|
|
752
747
|
return chart;
|
|
@@ -762,7 +757,7 @@ function getPieObject(seriesMeasures, widget) {
|
|
|
762
757
|
chartInfo.enableSmartLabels = "1";
|
|
763
758
|
setPieDonutLegends(chartInfo, widget);
|
|
764
759
|
chart.dataSource = getSimpleDataSource(chartInfo, seriesMeasures, widget);
|
|
765
|
-
chartInfo.legendPosition = widget
|
|
760
|
+
chartInfo.legendPosition = getWidgetLegendPosition(widget);
|
|
766
761
|
return chart;
|
|
767
762
|
}
|
|
768
763
|
function getColumnObject(seriesMeasures, widget) {
|
|
@@ -772,7 +767,7 @@ function getColumnObject(seriesMeasures, widget) {
|
|
|
772
767
|
chartInfo.scrollPadding = "8";
|
|
773
768
|
chartInfo.flatScrollBars = "1";
|
|
774
769
|
chartInfo.showPercentValues = "1";
|
|
775
|
-
chartInfo.showLegend =
|
|
770
|
+
chartInfo.showLegend = widget.ShowLegend ? '1' : '0';
|
|
776
771
|
setLineDash(chartInfo);
|
|
777
772
|
chartInfo.chartTopMargin = "20";
|
|
778
773
|
chartInfo.chartBottomMargin = "10";
|
|
@@ -781,7 +776,7 @@ function getColumnObject(seriesMeasures, widget) {
|
|
|
781
776
|
chartInfo.canvasBottomPadding = "10";
|
|
782
777
|
setDualyAxis(chartInfo, widget, seriesMeasures);
|
|
783
778
|
chart.dataSource = getCategoriesBasedDataSource(chartInfo, seriesMeasures, widget);
|
|
784
|
-
chartInfo.legendPosition = widget
|
|
779
|
+
chartInfo.legendPosition = getWidgetLegendPosition(widget);
|
|
785
780
|
return chart;
|
|
786
781
|
}
|
|
787
782
|
function setLineDash(chartInfo) {
|
|
@@ -800,6 +795,18 @@ function getDefaultChartobject() {
|
|
|
800
795
|
chart.dataFormat = "json";
|
|
801
796
|
return chart;
|
|
802
797
|
}
|
|
798
|
+
var getXaxisTitle = function getXaxisTitle(widget) {
|
|
799
|
+
if (widget.TypeCode == 'bar') {
|
|
800
|
+
return widget.ShowYAxisTitle ? widget.YAxisTitle || "" : "";
|
|
801
|
+
}
|
|
802
|
+
return widget.XAxisTitle || "";
|
|
803
|
+
};
|
|
804
|
+
var getYaxisTitle = function getYaxisTitle(widget) {
|
|
805
|
+
if (widget.TypeCode == 'bar') {
|
|
806
|
+
return widget.ShowXAxisTitle ? widget.XAxisTitle || "" : "";
|
|
807
|
+
}
|
|
808
|
+
return widget.YAxisTitle || "";
|
|
809
|
+
};
|
|
803
810
|
function getDefaultChartInfo(widget) {
|
|
804
811
|
var chart = {};
|
|
805
812
|
chart.theme = "fusion";
|
|
@@ -825,8 +832,8 @@ function getDefaultChartInfo(widget) {
|
|
|
825
832
|
chart.yAxisNameFont = defautFont;
|
|
826
833
|
chart.yAxisNameFontSize = defautFontSize;
|
|
827
834
|
chart.yAxisNameFontColor = defautColor;
|
|
828
|
-
chart.xAxisName = widget.ShowXAxisTitle && widget.XAxisTitle ? widget
|
|
829
|
-
chart.yAxisName = widget.ShowYAxisTitle && widget.YAxisTitle ? widget
|
|
835
|
+
chart.xAxisName = widget.ShowXAxisTitle && widget.XAxisTitle ? getXaxisTitle(widget) : "";
|
|
836
|
+
chart.yAxisName = widget.ShowYAxisTitle && widget.YAxisTitle ? getYaxisTitle(widget) : "";
|
|
830
837
|
chart.labelDisplay = widget.XAxisLabelsDisplay ? widget.XAxisLabelsDisplay : "Auto";
|
|
831
838
|
chart.slantLabel = "1";
|
|
832
839
|
chart.labelFontSize = widget.XAxisLabelsFontSize ? widget.XAxisLabelsFontSize + "" : "10";
|
|
@@ -846,16 +853,17 @@ function getDefaultChartInfo(widget) {
|
|
|
846
853
|
function setPieDonutLegends(chart, widget) {
|
|
847
854
|
chart.showValues = "0";
|
|
848
855
|
chart.showLabels = widget.LabelsPosition == 'InLegend' ? '0' : '1';
|
|
849
|
-
chart.showLegend = widget.
|
|
856
|
+
chart.showLegend = widget.ShowLegend ? '1' : '0';
|
|
850
857
|
setOnChartLegend(chart, widget);
|
|
851
858
|
setChartInLegend(chart, widget);
|
|
852
859
|
}
|
|
853
|
-
function
|
|
860
|
+
function getWidgetLegendPosition(widget) {
|
|
861
|
+
if (widget.LegendPosition) return widget.LegendPosition;
|
|
854
862
|
return widget.TypeCode == 'pie' || widget.TypeCode == 'donut' ? "right" : "bottom";
|
|
855
863
|
}
|
|
856
864
|
function setOnChartLegend(chart, widget) {
|
|
857
865
|
if (widget.LabelsPosition != 'InLegend') return;
|
|
858
|
-
chart.legendPosition =
|
|
866
|
+
chart.legendPosition = getWidgetLegendPosition(widget);
|
|
859
867
|
chart.legendScrollBgColor = "#ffffff";
|
|
860
868
|
chart.legendIconScale = 0.75;
|
|
861
869
|
chart.scrollShowButtons = "0";
|
|
@@ -1088,19 +1096,75 @@ var FusionChart = React.forwardRef(function (props, comRef) {
|
|
|
1088
1096
|
}, error)));
|
|
1089
1097
|
});
|
|
1090
1098
|
|
|
1099
|
+
var isNullOrUndefined = function isNullOrUndefined(val) {
|
|
1100
|
+
return val == null || val == undefined;
|
|
1101
|
+
};
|
|
1102
|
+
|
|
1103
|
+
var _path$1;
|
|
1104
|
+
function _extends$2() {
|
|
1105
|
+
_extends$2 = Object.assign ? Object.assign.bind() : function (target) {
|
|
1106
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
1107
|
+
var source = arguments[i];
|
|
1108
|
+
for (var key in source) {
|
|
1109
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1110
|
+
target[key] = source[key];
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
return target;
|
|
1115
|
+
};
|
|
1116
|
+
return _extends$2.apply(this, arguments);
|
|
1117
|
+
}
|
|
1118
|
+
function SvgDeleteIcon(props) {
|
|
1119
|
+
return /*#__PURE__*/React.createElement("svg", _extends$2({
|
|
1120
|
+
viewBox: "0 0 20 20",
|
|
1121
|
+
fill: "none",
|
|
1122
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1123
|
+
}, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
|
|
1124
|
+
d: "M9 3.512h3v1.264h-1.2v8.217a.65.65 0 01-.176.447.585.585 0 01-.424.185H1.8a.585.585 0 01-.424-.185.65.65 0 01-.176-.447V4.776H0V3.512h3V1.615a.65.65 0 01.176-.447A.585.585 0 013.6.983h4.8c.159 0 .312.067.424.185A.65.65 0 019 1.615v1.897zm.6 1.264H2.4v7.585h7.2V4.776zM4.2 6.672h1.2v3.792H4.2V6.672zm2.4 0h1.2v3.792H6.6V6.672zM4.2 2.247v1.265h3.6V2.247H4.2z",
|
|
1125
|
+
fill: "#5FAFDA"
|
|
1126
|
+
})));
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
var _path$2;
|
|
1130
|
+
function _extends$3() {
|
|
1131
|
+
_extends$3 = Object.assign ? Object.assign.bind() : function (target) {
|
|
1132
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
1133
|
+
var source = arguments[i];
|
|
1134
|
+
for (var key in source) {
|
|
1135
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1136
|
+
target[key] = source[key];
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
return target;
|
|
1141
|
+
};
|
|
1142
|
+
return _extends$3.apply(this, arguments);
|
|
1143
|
+
}
|
|
1144
|
+
function SvgEditIcon(props) {
|
|
1145
|
+
return /*#__PURE__*/React.createElement("svg", _extends$3({
|
|
1146
|
+
viewBox: "0 0 20 20",
|
|
1147
|
+
fill: "none",
|
|
1148
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1149
|
+
}, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
|
|
1150
|
+
d: "M8.485 5.383l-.943-.943-6.209 6.21v.942h.943l6.21-6.209zm.943-.943l.943-.942-.943-.943-.943.943.943.942zm-6.6 8.486H0v-2.829l8.957-8.956c.26-.26.682-.26.942 0l1.886 1.885c.26.26.26.683 0 .943l-8.957 8.957z",
|
|
1151
|
+
fill: "#5FAFDA"
|
|
1152
|
+
})));
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1091
1155
|
var WidgetCard = React.forwardRef(function (props, comRef) {
|
|
1092
|
-
var _widget$current2, _widget$current3;
|
|
1093
|
-
var moreBtnToggle = React.useRef(null);
|
|
1156
|
+
var _widget$current2, _widget$current3, _widget$current4, _widget$current5, _widget$current6, _widget$current7, _widget$current8;
|
|
1094
1157
|
var widget = React.useRef();
|
|
1095
1158
|
var _useState = React.useState(false),
|
|
1096
1159
|
isLoading = _useState[0],
|
|
1097
1160
|
setIsLoading = _useState[1];
|
|
1098
1161
|
var _useState2 = React.useState(false),
|
|
1099
|
-
|
|
1162
|
+
isWidgetHovered = _useState2[0],
|
|
1163
|
+
setIsWidgetHovered = _useState2[1];
|
|
1164
|
+
var _useState3 = React.useState(false),
|
|
1165
|
+
showTooltip = _useState3[1];
|
|
1100
1166
|
var fusionChartRef = React.useRef(null);
|
|
1101
1167
|
var editWidget = function editWidget() {
|
|
1102
|
-
var _moreBtnToggle$curren;
|
|
1103
|
-
(_moreBtnToggle$curren = moreBtnToggle.current) === null || _moreBtnToggle$curren === void 0 ? void 0 : _moreBtnToggle$curren.hide();
|
|
1104
1168
|
props.editBtnClicked(widget.current);
|
|
1105
1169
|
};
|
|
1106
1170
|
React.useEffect(function () {
|
|
@@ -1122,23 +1186,45 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
|
|
|
1122
1186
|
}
|
|
1123
1187
|
};
|
|
1124
1188
|
});
|
|
1189
|
+
var getCSSPropertyValue = function getCSSPropertyValue(widgetData, propName, propUnit, propDefaultVal) {
|
|
1190
|
+
if (propUnit === void 0) {
|
|
1191
|
+
propUnit = "";
|
|
1192
|
+
}
|
|
1193
|
+
if (propDefaultVal === void 0) {
|
|
1194
|
+
propDefaultVal = "";
|
|
1195
|
+
}
|
|
1196
|
+
return widgetData && propName && !isNullOrUndefined(widgetData[propName]) ? widgetData[propName] + propUnit : propDefaultVal || "";
|
|
1197
|
+
};
|
|
1125
1198
|
return React__default.createElement("div", {
|
|
1126
1199
|
className: "dl-panel",
|
|
1127
1200
|
key: props.el.i,
|
|
1128
1201
|
style: {
|
|
1129
1202
|
cursor: props.isInEditMode ? 'move' : 'default'
|
|
1203
|
+
},
|
|
1204
|
+
onMouseEnter: function onMouseEnter() {
|
|
1205
|
+
return setIsWidgetHovered(true);
|
|
1206
|
+
},
|
|
1207
|
+
onMouseLeave: function onMouseLeave() {
|
|
1208
|
+
setIsWidgetHovered(false);
|
|
1130
1209
|
}
|
|
1131
1210
|
}, React__default.createElement("header", null, React__default.createElement("div", {
|
|
1211
|
+
className: "widget-titles-container"
|
|
1212
|
+
}, React__default.createElement("div", {
|
|
1213
|
+
className: "title-container",
|
|
1132
1214
|
style: {
|
|
1133
|
-
|
|
1134
|
-
width: 'calc(100% - 3rem)'
|
|
1215
|
+
justifyContent: getCSSPropertyValue(widget === null || widget === void 0 ? void 0 : widget.current, 'TitleAlignment', '', undefined)
|
|
1135
1216
|
}
|
|
1136
1217
|
}, React__default.createElement(tooltip.Tooltip, {
|
|
1137
|
-
target: ".
|
|
1138
|
-
}), React__default.createElement("
|
|
1218
|
+
target: ".title"
|
|
1219
|
+
}), React__default.createElement("div", {
|
|
1220
|
+
className: "title",
|
|
1221
|
+
style: {
|
|
1222
|
+
fontSize: getCSSPropertyValue(widget.current, 'TitleFontSize', 'px'),
|
|
1223
|
+
color: getCSSPropertyValue(widget.current, 'TitleFontColor', ''),
|
|
1224
|
+
textAlign: getCSSPropertyValue(widget === null || widget === void 0 ? void 0 : widget.current, 'TitleAlignment', '', undefined)
|
|
1225
|
+
},
|
|
1139
1226
|
"data-pr-tooltip": (_widget$current2 = widget.current) === null || _widget$current2 === void 0 ? void 0 : _widget$current2.Title,
|
|
1140
1227
|
"data-pr-position": "top",
|
|
1141
|
-
className: "h-tool-tip",
|
|
1142
1228
|
onMouseEnter: function onMouseEnter() {
|
|
1143
1229
|
return showTooltip(true);
|
|
1144
1230
|
},
|
|
@@ -1148,29 +1234,25 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
|
|
|
1148
1234
|
return showTooltip(true);
|
|
1149
1235
|
}, 50);
|
|
1150
1236
|
}
|
|
1151
|
-
}, (_widget$current3 = widget.current) === null || _widget$current3 === void 0 ? void 0 : _widget$current3.Title)),
|
|
1152
|
-
|
|
1153
|
-
className: "p-button-rounded p-button-text",
|
|
1154
|
-
onClick: function onClick(e) {
|
|
1155
|
-
var _moreBtnToggle$curren2;
|
|
1156
|
-
return (_moreBtnToggle$curren2 = moreBtnToggle.current) === null || _moreBtnToggle$curren2 === void 0 ? void 0 : _moreBtnToggle$curren2.toggle(e);
|
|
1157
|
-
},
|
|
1237
|
+
}, (_widget$current3 = widget.current) === null || _widget$current3 === void 0 ? void 0 : _widget$current3.Title)), React__default.createElement("div", {
|
|
1238
|
+
className: (_widget$current4 = widget.current) !== null && _widget$current4 !== void 0 && _widget$current4.Subtitle && ((_widget$current5 = widget.current) === null || _widget$current5 === void 0 ? void 0 : _widget$current5.Subtitle.length) > 0 ? "subtitle" : "subtitle margin-top-4",
|
|
1158
1239
|
style: {
|
|
1159
|
-
|
|
1240
|
+
fontSize: getCSSPropertyValue(widget.current, 'SubtitleFontSize', 'px'),
|
|
1241
|
+
textAlign: getCSSPropertyValue(widget === null || widget === void 0 ? void 0 : widget.current, 'TitleAlignment', '', undefined),
|
|
1242
|
+
color: getCSSPropertyValue(widget.current, 'TitleFontColor', '')
|
|
1160
1243
|
}
|
|
1161
|
-
}) :
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
}, " Edit "), React__default.createElement("div", {
|
|
1244
|
+
}, (_widget$current6 = widget.current) === null || _widget$current6 === void 0 ? void 0 : _widget$current6.Subtitle)), props.isInEditMode && isWidgetHovered ? React__default.createElement("div", {
|
|
1245
|
+
className: (_widget$current7 = widget.current) !== null && _widget$current7 !== void 0 && _widget$current7.Title && ((_widget$current8 = widget.current) === null || _widget$current8 === void 0 ? void 0 : _widget$current8.Title.length) > 0 ? "widget-options-container" : "widget-options-container margin-top-6"
|
|
1246
|
+
}, React__default.createElement(SvgEditIcon, {
|
|
1247
|
+
onClick: function onClick() {
|
|
1248
|
+
return editWidget();
|
|
1249
|
+
}
|
|
1250
|
+
}), React__default.createElement(SvgDeleteIcon, {
|
|
1169
1251
|
onClick: function onClick() {
|
|
1170
1252
|
var _props$widget;
|
|
1171
1253
|
return props.deleteBtnClicked((_props$widget = props.widget) === null || _props$widget === void 0 ? void 0 : _props$widget.key);
|
|
1172
1254
|
}
|
|
1173
|
-
}
|
|
1255
|
+
})) : null), React__default.createElement("div", {
|
|
1174
1256
|
style: {
|
|
1175
1257
|
width: '100%'
|
|
1176
1258
|
}
|
|
@@ -1180,9 +1262,9 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
|
|
|
1180
1262
|
className: "dl-dashboard-widget"
|
|
1181
1263
|
}, " ", GetChartComponent(), " "));
|
|
1182
1264
|
function GetChartComponent() {
|
|
1183
|
-
var _widget$
|
|
1184
|
-
if (isLoading || !((_widget$
|
|
1185
|
-
if (((_widget$
|
|
1265
|
+
var _widget$current9, _widget$current10;
|
|
1266
|
+
if (isLoading || !((_widget$current9 = widget.current) !== null && _widget$current9 !== void 0 && _widget$current9.TypeCode)) return null;
|
|
1267
|
+
if (((_widget$current10 = widget.current) === null || _widget$current10 === void 0 ? void 0 : _widget$current10.TypeCode) == "kpi") return React__default.createElement(CustomChart, {
|
|
1186
1268
|
dataBinding: props.dataBinding,
|
|
1187
1269
|
widget: widget.current,
|
|
1188
1270
|
widgetRef: props.widgetRef,
|
|
@@ -1235,6 +1317,14 @@ var DashboardDesigner = function DashboardDesigner(props) {
|
|
|
1235
1317
|
React.useEffect(function () {
|
|
1236
1318
|
FillLayout(props.Widgetlayouts);
|
|
1237
1319
|
}, [props.Widgetlayouts]);
|
|
1320
|
+
React.useEffect(function () {
|
|
1321
|
+
var _props$dataBinding;
|
|
1322
|
+
(_props$dataBinding = props.dataBinding) === null || _props$dataBinding === void 0 ? void 0 : _props$dataBinding.onDeleteWidgetConfirmed.subscribe(function (deleteProps) {
|
|
1323
|
+
if (deleteProps) {
|
|
1324
|
+
deletePanel(deleteProps);
|
|
1325
|
+
}
|
|
1326
|
+
});
|
|
1327
|
+
}, []);
|
|
1238
1328
|
var FillLayout = function FillLayout(dashboardLayouts) {
|
|
1239
1329
|
var clone = deepClone(dashboardLayouts);
|
|
1240
1330
|
var layout = createLayout(clone);
|
|
@@ -1287,16 +1377,24 @@ var DashboardDesigner = function DashboardDesigner(props) {
|
|
|
1287
1377
|
}
|
|
1288
1378
|
}
|
|
1289
1379
|
}
|
|
1290
|
-
function
|
|
1380
|
+
var confirmDeleteWidget = function confirmDeleteWidget(id) {
|
|
1381
|
+
var deleteWidgetProps = {
|
|
1382
|
+
id: id,
|
|
1383
|
+
layouts: layouts,
|
|
1384
|
+
widgets: widgets
|
|
1385
|
+
};
|
|
1386
|
+
props.onWidgetDelete(deleteWidgetProps);
|
|
1387
|
+
};
|
|
1388
|
+
function deletePanel(deleteProps) {
|
|
1291
1389
|
var newLayouts = {
|
|
1292
|
-
lg: layouts.lg.filter(function (e) {
|
|
1293
|
-
return e.i != id;
|
|
1390
|
+
lg: deleteProps.layouts.lg.filter(function (e) {
|
|
1391
|
+
return e.i != deleteProps.id;
|
|
1294
1392
|
})
|
|
1295
1393
|
};
|
|
1296
1394
|
setLayouts(newLayouts);
|
|
1297
1395
|
var newWidgets = {
|
|
1298
|
-
lg: widgets.lg.filter(function (e) {
|
|
1299
|
-
return e.key != id;
|
|
1396
|
+
lg: deleteProps.widgets.lg.filter(function (e) {
|
|
1397
|
+
return e.key != deleteProps.id;
|
|
1300
1398
|
})
|
|
1301
1399
|
};
|
|
1302
1400
|
FillWidgetDictionary(newWidgets);
|
|
@@ -1363,7 +1461,7 @@ var DashboardDesigner = function DashboardDesigner(props) {
|
|
|
1363
1461
|
dataBinding: props.dataBinding,
|
|
1364
1462
|
dateFilter: dateFilter,
|
|
1365
1463
|
editBtnClicked: editWidget,
|
|
1366
|
-
deleteBtnClicked:
|
|
1464
|
+
deleteBtnClicked: confirmDeleteWidget,
|
|
1367
1465
|
onSelectDataPoint: props.onSelectDataPoint,
|
|
1368
1466
|
ref: function ref(el) {
|
|
1369
1467
|
var _widget$Layout3;
|
|
@@ -1490,6 +1588,9 @@ var Dashboard = function Dashboard(props) {
|
|
|
1490
1588
|
dataBinding: props.dataBinding,
|
|
1491
1589
|
editMode: isInEditMode,
|
|
1492
1590
|
onLayoutChange: updateWidgets,
|
|
1591
|
+
onWidgetDelete: function onWidgetDelete(deleteProps) {
|
|
1592
|
+
return props.openDeleteWidgetConfirmWindow(deleteProps);
|
|
1593
|
+
},
|
|
1493
1594
|
openEditWidget: function openEditWidget(widget) {
|
|
1494
1595
|
return props.openEditWidget(widget);
|
|
1495
1596
|
}
|