logitude-dashboard-library 1.2.75 → 1.2.78

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.
@@ -28,17 +28,55 @@ $dark-grey: #717585;
28
28
  justify-content: space-between;
29
29
 
30
30
  }
31
- .dl-flex-row{
31
+
32
+ .dl-flex-row {
32
33
  display: flex;
33
-
34
+
34
35
  flex-direction: row;
35
36
  }
36
- .dl-flex-row-end{
37
+
38
+ .dl-flex-row-end {
37
39
  display: flex;
38
40
  justify-content: flex-end;
39
41
 
40
42
  }
41
- .dl-title-1{
43
+
44
+ .dl-flex-content-center {
45
+ display: flex;
46
+ align-content: center;
47
+ align-items: center;
48
+
49
+ }
50
+
51
+ .spinner-custome {
52
+
53
+ @keyframes p-progress-spinner-color {
54
+
55
+ 100%,
56
+ 0% {
57
+ stroke: #6EB2D6;
58
+ }
59
+
60
+ 40% {
61
+ stroke: #6EB2D6;
62
+ }
63
+
64
+ 66% {
65
+ stroke: #6EB2D6;
66
+ }
67
+
68
+ 80%,
69
+ 90% {
70
+ stroke :#6EB2D6;
71
+ }
72
+ }
73
+
74
+ }
75
+
76
+
77
+
78
+
79
+ .dl-title-1 {
42
80
  text-transform: capitalize;
43
81
  font-size: 20px;
44
82
  font-family: "Roboto Flex";
@@ -49,14 +87,15 @@ $dark-grey: #717585;
49
87
  font-weight: bolder;
50
88
  padding: 0px 0px 0 13px;
51
89
  }
52
- .dl-heder-row{
90
+
91
+ .dl-heder-row {
53
92
  width: 100%;
54
93
  display: flex;
55
94
  padding: 0px 11px;
56
95
  flex-direction: row-reverse;
57
96
  }
58
97
 
59
- .dl-full-hight{
98
+ .dl-full-hight {
60
99
  height: 100%;
61
100
  }
62
101
 
@@ -74,6 +113,7 @@ $dark-grey: #717585;
74
113
  }
75
114
 
76
115
  }
116
+
77
117
  .dl-grid-container {
78
118
  position: relative;
79
119
 
@@ -83,19 +123,20 @@ $dark-grey: #717585;
83
123
  width: 100%;
84
124
  }
85
125
  }
86
- .dl-custom-btn{
87
- .p-button.p-button-lg{
88
-
89
- }
126
+
127
+ .dl-custom-btn {
128
+ .p-button.p-button-lg {}
90
129
  }
91
- .dl-relativ-container{
92
-
130
+
131
+ .dl-relativ-container {
132
+
93
133
  position: relative;
94
134
  width: 100%;
95
135
  height: 100%;
96
136
 
97
137
  }
98
- .dl-scroll-container{
138
+
139
+ .dl-scroll-container {
99
140
  position: absolute;
100
141
  left: 0;
101
142
  top: 0;
@@ -104,7 +145,7 @@ $dark-grey: #717585;
104
145
  overflow-y: scroll;
105
146
  }
106
147
 
107
- .dl-flex-stretch{
148
+ .dl-flex-stretch {
108
149
  height: 100%;
109
150
  flex-direction: row;
110
151
  box-sizing: border-box;
@@ -118,27 +159,27 @@ $dark-grey: #717585;
118
159
  display: flex;
119
160
  flex-flow: column;
120
161
  height: 100%;
121
- }
122
-
162
+ }
163
+
164
+
123
165
 
124
-
125
- .dl-box .dl-row.dl-header {
166
+ .dl-box .dl-row.dl-header {
126
167
  flex: 0 1 auto;
127
168
  /* The above is shorthand for:
128
169
  flex-grow: 0,
129
170
  flex-shrink: 1,
130
171
  flex-basis: auto
131
172
  */
132
- }
133
-
134
- .dl-box .dl-row.dl-content {
173
+ }
174
+
175
+ .dl-box .dl-row.dl-content {
135
176
  flex: 1 1 auto;
136
177
  overflow-y: scroll;
137
- }
138
-
139
- .dl-box .dl-row.dl-footer {
178
+ }
179
+
180
+ .dl-box .dl-row.dl-footer {
140
181
  flex: 0 1 40px;
141
- }
182
+ }
142
183
 
143
184
 
144
185
 
@@ -266,7 +307,7 @@ $dark-grey: #717585;
266
307
  height: calc(100% - 40px);
267
308
  box-sizing: border-box;
268
309
 
269
-
310
+
270
311
  }
271
312
 
272
313
 
@@ -294,25 +335,27 @@ $dark-grey: #717585;
294
335
  display: none;
295
336
  }
296
337
 
297
- .dl-dashboard-add{
338
+ .dl-dashboard-add {
298
339
  //height: 40px !important;
299
340
  margin: 3px 3px 0px 8px !important;
300
341
  //width: 40px !important ;
301
342
  }
302
343
 
303
- .dl-card{
344
+ .dl-card {
304
345
  border-radius: 19px;
305
346
  background-color: #f5f6fb;
306
347
  padding: 6px 0px 0px 0px;
307
348
  margin: 0px 0px 10px 0px;
308
349
  }
309
350
 
310
- .dl-m-t-s{
351
+ .dl-m-t-s {
311
352
  margin-top: 10px;
312
353
  }
313
- .dl-m-r-s{
354
+
355
+ .dl-m-r-s {
314
356
  margin-right: 10px;
315
357
  }
316
- .dl-m-t-8{
358
+
359
+ .dl-m-t-8 {
317
360
  margin-top: 8px;
318
361
  }
package/dist/index.js CHANGED
@@ -7,6 +7,7 @@ var reactGridLayout = require('react-grid-layout');
7
7
  var ReactApexChart = _interopDefault(require('react-apexcharts'));
8
8
  var axios = _interopDefault(require('axios'));
9
9
  var overlaypanel = require('primereact/overlaypanel');
10
+ var progressspinner = require('primereact/progressspinner');
10
11
  var dropdown = require('primereact/dropdown');
11
12
  var dialog = require('primereact/dialog');
12
13
  var ripple = require('primereact/ripple');
@@ -129,21 +130,40 @@ var DashboardAnalyticsService = /*#__PURE__*/function () {
129
130
  var ApexChart = function ApexChart(props) {
130
131
  var _props$widget, _props$widget2, _props$widget3, _props$widget5;
131
132
 
132
- var _useState = React.useState({
133
+ var _useState = React.useState(false),
134
+ isView = _useState[0],
135
+ setisView = _useState[1];
136
+
137
+ var isDataLoaded = React.useRef(false);
138
+
139
+ var _useState2 = React.useState({
133
140
  series: [],
134
141
  options: {}
135
142
  }),
136
- args = _useState[0],
137
- serArgs = _useState[1];
143
+ args = _useState2[0],
144
+ serArgs = _useState2[1];
138
145
 
146
+ var isLoadingDrow = React.useRef(true);
147
+ React.useEffect(function () {
148
+ setTimeout(function () {
149
+ isLoadingDrow.current = false;
150
+ updateView();
151
+ }, 500);
152
+ }, []);
139
153
  React.useEffect(function () {
140
154
  console.log('useEffect ApexChart', props.widget);
141
155
  var dashboardAnalyticsService = new DashboardAnalyticsService();
142
156
  dashboardAnalyticsService.getData(props.widget).then(function (result) {
143
157
  var data = getChartOptions(result.data);
144
158
  serArgs(data);
159
+ isDataLoaded.current = true;
160
+ updateView();
145
161
  });
146
- }, [props.widget, (_props$widget = props.widget) === null || _props$widget === void 0 ? void 0 : _props$widget.EntityId, (_props$widget2 = props.widget) === null || _props$widget2 === void 0 ? void 0 : _props$widget2.Filters, (_props$widget3 = props.widget) === null || _props$widget3 === void 0 ? void 0 : _props$widget3.WidgetMeasures]);
162
+ }, [(_props$widget = props.widget) === null || _props$widget === void 0 ? void 0 : _props$widget.EntityId, (_props$widget2 = props.widget) === null || _props$widget2 === void 0 ? void 0 : _props$widget2.Filters, (_props$widget3 = props.widget) === null || _props$widget3 === void 0 ? void 0 : _props$widget3.WidgetMeasures]);
163
+
164
+ var updateView = function updateView() {
165
+ if (isDataLoaded.current && !isLoadingDrow.current) setisView(true);
166
+ };
147
167
 
148
168
  var lineOptoins = function lineOptoins(values) {
149
169
  var series = [];
@@ -296,12 +316,18 @@ var ApexChart = function ApexChart(props) {
296
316
  });
297
317
  }
298
318
 
299
- return {
319
+ var result = {
300
320
  series: series,
301
321
  options: {
302
322
  chart: {
303
323
  width: 380,
304
- type: 'donut'
324
+ type: 'donut',
325
+ events: {
326
+ markerClick: markerClick,
327
+ legendClick: legendClick,
328
+ click: chartClick,
329
+ dataPointSelection: dataPointSelection
330
+ }
305
331
  },
306
332
  dataLabels: {
307
333
  enabled: false
@@ -325,6 +351,7 @@ var ApexChart = function ApexChart(props) {
325
351
  labels: labels
326
352
  }
327
353
  };
354
+ return result;
328
355
  };
329
356
 
330
357
  var handelNullLabels = function handelNullLabels(values) {
@@ -335,6 +362,22 @@ var ApexChart = function ApexChart(props) {
335
362
  });
336
363
  };
337
364
 
365
+ var markerClick = function markerClick(e, chart, options) {
366
+ console.log('markerClick e: any, chart?: any, options?: any', e, chart, options);
367
+ };
368
+
369
+ var chartClick = function chartClick(e, chart, options) {
370
+ console.log('chartClick e: any, chart?: any, options?: any', e, chart, options);
371
+ };
372
+
373
+ var legendClick = function legendClick(chart, seriesIndex, options) {
374
+ console.log('legendClick chart: any, seriesIndex?: number, options?: any', chart, seriesIndex, options);
375
+ };
376
+
377
+ var dataPointSelection = function dataPointSelection(e, chart, options) {
378
+ console.log('dataPointSelection e: any, chart?: any, options?: any', e, chart, options);
379
+ };
380
+
338
381
  var getChartOptions = function getChartOptions(values) {
339
382
  var _props$widget4;
340
383
 
@@ -357,13 +400,22 @@ var ApexChart = function ApexChart(props) {
357
400
  return barOptoins(values);
358
401
  };
359
402
 
360
- return React__default.createElement(ReactApexChart, {
403
+ return isView ? React__default.createElement(ReactApexChart, {
361
404
  options: args === null || args === void 0 ? void 0 : args.options,
362
405
  series: args === null || args === void 0 ? void 0 : args.series,
363
406
  type: (_props$widget5 = props.widget) === null || _props$widget5 === void 0 ? void 0 : _props$widget5.TypeCode,
364
407
  height: "100%",
365
408
  width: "100%"
366
- });
409
+ }) : React__default.createElement("div", {
410
+ className: 'dl-full-hight dl-flex-content-center spinner-custome'
411
+ }, React__default.createElement(progressspinner.ProgressSpinner, {
412
+ style: {
413
+ width: '100px',
414
+ height: '100px'
415
+ },
416
+ strokeWidth: "4",
417
+ animationDuration: "2s"
418
+ }));
367
419
  };
368
420
 
369
421
  var WidgetCard = function WidgetCard(props, state) {
@@ -371,16 +423,6 @@ var WidgetCard = function WidgetCard(props, state) {
371
423
 
372
424
  var moreBtnToggle = React.useRef(null);
373
425
 
374
- var _useState = React.useState(true),
375
- loading = _useState[0],
376
- setLoading = _useState[1];
377
-
378
- React.useEffect(function () {
379
- setTimeout(function () {
380
- setLoading(false);
381
- }, 500);
382
- }, []);
383
-
384
426
  var editWidget = function editWidget() {
385
427
  var _moreBtnToggle$curren;
386
428
 
@@ -414,7 +456,7 @@ var WidgetCard = function WidgetCard(props, state) {
414
456
  }
415
457
  }, "Remove")))), React__default.createElement("div", {
416
458
  className: "dl-dashboard-widget"
417
- }, loading ? null : React__default.createElement(ApexChart, {
459
+ }, React__default.createElement(ApexChart, {
418
460
  widget: props.widget
419
461
  })));
420
462
  };
@@ -458,7 +500,6 @@ var DashboardDesigner = function DashboardDesigner(props) {
458
500
 
459
501
  React.useEffect(function () {
460
502
  setFirstChange(true);
461
- console.log('useEffect setLayouts');
462
503
  setLayouts({});
463
504
  setLayouts(createLayout());
464
505
  setWidgets(props.dashboardLayouts);
@@ -478,11 +519,10 @@ var DashboardDesigner = function DashboardDesigner(props) {
478
519
 
479
520
  React.useEffect(function () {
480
521
  setisInEditMode(props.editMode);
522
+ console.log(' setisInEditMode(props.editMode);');
481
523
  }, [props.editMode]);
482
524
 
483
525
  function _onLayoutChange(layout, changedLayouts) {
484
- console.log(layout, layouts);
485
-
486
526
  if (firstChange) {
487
527
  setFirstChange(false);
488
528
  return;
@@ -494,7 +534,6 @@ var DashboardDesigner = function DashboardDesigner(props) {
494
534
  }
495
535
 
496
536
  function deletePanel(id) {
497
- console.log('deletePanel(id)', id);
498
537
  var newLayouts = {
499
538
  lg: layouts.lg.filter(function (e) {
500
539
  return e.i != id;
@@ -518,7 +557,6 @@ var DashboardDesigner = function DashboardDesigner(props) {
518
557
  function UpdatePlaceholderDimensions() {
519
558
  var _gridLayout$;
520
559
 
521
- console.log('UpdatePlaceholderDimensions', layouts);
522
560
  var gridLayout = document.getElementsByClassName('react-grid-layout');
523
561
  if (!gridLayout) return;
524
562
  var gridElementHeight = (_gridLayout$ = gridLayout[0]) === null || _gridLayout$ === void 0 ? void 0 : _gridLayout$.clientHeight;
@@ -539,7 +577,7 @@ var DashboardDesigner = function DashboardDesigner(props) {
539
577
  className: "dl-grid-container"
540
578
  }, React__default.createElement("div", {
541
579
  className: "dl-grid dl-grid--bordered"
542
- }, props.editMode ? placeholderRowsArray.map(function (e, i) {
580
+ }, isInEditMode ? placeholderRowsArray.map(function (e, i) {
543
581
  return array12.map(function (e, i) {
544
582
  return React__default.createElement("div", {
545
583
  key: i,
@@ -548,7 +586,7 @@ var DashboardDesigner = function DashboardDesigner(props) {
548
586
  }
549
587
  });
550
588
  });
551
- }) : null), React__default.createElement(ResponsiveReactGridLayout, Object.assign({}, layoutGridProps, {
589
+ }) : React__default.createElement("div", null, "no layout")), React__default.createElement(ResponsiveReactGridLayout, Object.assign({}, layoutGridProps, {
552
590
  layouts: layouts,
553
591
  compactType: "vertical",
554
592
  isDraggable: isInEditMode,