versacall-dashboards-library-react 2.0.43 → 2.0.45

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.
Files changed (34) hide show
  1. package/dist/components/DashboardsCell/DashboardsCell.js +48 -26
  2. package/dist/components/DashboardsCellContent/DashboardsCellContent.js +40 -31
  3. package/dist/components/DashboardsCellFindAndReplace/DashboardsCellFindAndReplace.js +2 -2
  4. package/dist/components/DashboardsCellGlobalActions/DashboardsCellGlobalActions.js +4 -6
  5. package/dist/components/DashboardsCellGlobalConditions/DashboardsCellGlobalConditions.js +268 -158
  6. package/dist/components/DashboardsCellGlobalConditions/DashboardsCellGlobalConditionsNestable.js +59 -39
  7. package/dist/components/DashboardsCellGlobalConditions/DashboardsCellGlobalConditionsOld.js +57 -39
  8. package/dist/components/DashboardsCellGlobalStyles/DashboardsCellGlobalStyles.js +52 -32
  9. package/dist/components/DashboardsCellStyle/DashboardsCellStyle.js +1 -2
  10. package/dist/components/DashboardsCellStyleAlignItems/DashboardsCellStyleAlignItems.js +3 -7
  11. package/dist/components/DashboardsCellStyleBackgroundColor/DashboardsCellStyleBackgroundColor.js +9 -11
  12. package/dist/components/DashboardsCellStyleColor/DashboardsCellStyleColor.js +9 -11
  13. package/dist/components/DashboardsCellStyleDisplay/DashboardsCellStyleDisplay.js +4 -4
  14. package/dist/components/DashboardsCellStyleFontSize/DashboardsCellStyleFontSize.js +1 -1
  15. package/dist/components/DashboardsCellStyleJustifyContent/DashboardsCellStyleJustifyContent.js +3 -7
  16. package/dist/components/DashboardsCellStyleWeightStyleDecoration/DashboardsCellStyleWeightStyleDecoration.js +3 -7
  17. package/dist/components/DashboardsCopyAndPaste/DashboardsCopyAndPaste.js +3 -6
  18. package/dist/components/DashboardsEditor/DashboardsEditor.js +32 -27
  19. package/dist/components/DashboardsGlobalStylesPicker/DashboardsGlobalStylesPicker.js +3 -7
  20. package/dist/components/DashboardsGrid/DashboardsGrid.js +5 -9
  21. package/dist/components/DashboardsMainFreehand/DashboardsMainFreehand.js +39 -28
  22. package/dist/components/DashboardsMainMessaging/DashboardsMainMessaging.js +45 -32
  23. package/dist/components/DashboardsMainTable/DashboardsMainTable.js +41 -26
  24. package/dist/components/DashboardsPreview/DashboardsPreview.js +4 -8
  25. package/dist/components/DashboardsRatio/DashboardsRatio.js +20 -16
  26. package/dist/components/DashboardsRatio/DashboardsRatioOld.js +23 -22
  27. package/dist/components/DashboardsStatusBar/DashboardsStatusBar.js +6 -9
  28. package/dist/components/DashboardsViewer/DashboardsViewer.js +1 -1
  29. package/dist/components/WidgetParameters/WidgetParameters.js +27 -24
  30. package/dist/functions/addTranslations.js +11 -8
  31. package/dist/functions/calculateDashboardVariables.js +12 -15
  32. package/dist/functions/convertColorObject.js +1 -1
  33. package/dist/functions/convertSecondsToElapsedTime.js +5 -5
  34. package/package.json +4 -3
@@ -9,11 +9,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _functions = require("../../functions");
10
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
11
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
12
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
14
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
15
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
16
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
17
12
  class DashboardsGrid extends _react.Component {
18
13
  updateSelected(event, select) {
19
14
  if (this.props.updateSelected && this.props.showEditor) {
@@ -73,11 +68,12 @@ class DashboardsGrid extends _react.Component {
73
68
  role: "button",
74
69
  tabIndex: 0,
75
70
  key: String(index),
76
- style: _objectSpread(_objectSpread({}, style.root), {}, {
71
+ style: {
72
+ ...style.root,
77
73
  borderStyle: isSelected ? 'dashed' : 'none',
78
- gridColumn: "span ".concat(child.props.cell.columnSpan),
79
- gridRow: "span ".concat(child.props.cell.rowSpan)
80
- }),
74
+ gridColumn: `span ${child.props.cell.columnSpan}`,
75
+ gridRow: `span ${child.props.cell.rowSpan}`
76
+ },
81
77
  onClick: event => this.updateSelected(event, [{
82
78
  row: row,
83
79
  column: column,
@@ -15,11 +15,6 @@ var _DashboardsViewer = _interopRequireDefault(require("../DashboardsViewer"));
15
15
  var _DashboardsCell = _interopRequireDefault(require("../DashboardsCell"));
16
16
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
17
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
18
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
19
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
20
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
21
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
22
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
23
18
  const namespace = 'DashboardsMainFreehand';
24
19
  const style = {
25
20
  root: {
@@ -50,7 +45,7 @@ function findDependencies(text) {
50
45
  };
51
46
  }
52
47
  if (acc.found && /[A-Z0-9_]/.test(curr)) {
53
- acc.list[acc.list.length - 1] = "".concat(acc.list[acc.list.length - 1]).concat(curr);
48
+ acc.list[acc.list.length - 1] = `${acc.list[acc.list.length - 1]}${curr}`;
54
49
  return acc;
55
50
  }
56
51
  acc.found = false;
@@ -66,7 +61,7 @@ function replaceText(text, variables) {
66
61
  if (dependencies.length > 0) {
67
62
  variables.filter(variable => dependencies.includes(variable.name)).forEach(variable => {
68
63
  // newText = newText.replace(new RegExp(`~${variable.name}`), `${calculated && variable.calculated !== '' ? variable.calculated : variable.value}`);
69
- newText = newText.split("~".concat(variable.name)).join("".concat(calculated && variable.calculated !== '' ? variable.calculated : variable.value));
64
+ newText = newText.split(`~${variable.name}`).join(`${calculated && variable.calculated !== '' ? variable.calculated : variable.value}`);
70
65
  missingDependencies = missingDependencies.filter(missingDependency => missingDependency !== variable.name);
71
66
  });
72
67
  }
@@ -114,10 +109,11 @@ class DashboardsMainFreehand extends _react.Component {
114
109
  if (prevState.previewWidth !== Math.floor(size.width) || prevState.previewHeight !== Math.floor(size.height)) {
115
110
  const previewWidth = Math.floor(size.width);
116
111
  const previewHeight = Math.floor(size.height);
117
- return _objectSpread({
112
+ return {
118
113
  previewWidth: previewWidth,
119
- previewHeight: previewHeight
120
- }, this.updateViewDimensions(previewWidth, previewHeight));
114
+ previewHeight: previewHeight,
115
+ ...this.updateViewDimensions(previewWidth, previewHeight)
116
+ };
121
117
  }
122
118
  return null;
123
119
  });
@@ -143,7 +139,9 @@ class DashboardsMainFreehand extends _react.Component {
143
139
  };
144
140
  }
145
141
  updateViewDimensionsToState() {
146
- this.setState(prevState => _objectSpread({}, this.updateViewDimensions(prevState.previewWidth, prevState.previewHeight)));
142
+ this.setState(prevState => ({
143
+ ...this.updateViewDimensions(prevState.previewWidth, prevState.previewHeight)
144
+ }));
147
145
  }
148
146
  updateFreehandDashboard(values) {
149
147
  if (this.props.updateFreehandDashboard) {
@@ -164,11 +162,11 @@ class DashboardsMainFreehand extends _react.Component {
164
162
  newCellIndex
165
163
  } = this.state;
166
164
  const cells = JSON.parse(JSON.stringify(this.props.freehandDashboard.cells));
167
- cells.push((0, _functions.generateFreehandCell)(10, 10, 10, 50, 50, "New Cell ".concat(newCellIndex)));
165
+ cells.push((0, _functions.generateFreehandCell)(10, 10, 10, 50, 50, `New Cell ${newCellIndex}`));
168
166
  this.updateFreehandDashboard({
169
167
  cells: cells
170
168
  });
171
- this.updateSelected(["".concat(cells.length - 1)]);
169
+ this.updateSelected([`${cells.length - 1}`]);
172
170
  this.setState({
173
171
  newCellIndex: newCellIndex + 1
174
172
  });
@@ -227,11 +225,17 @@ class DashboardsMainFreehand extends _react.Component {
227
225
  for (let i = 0; i < newCell.styleIds.length; i++) {
228
226
  const findStyle = styles.find(searchStyle => searchStyle.id === newCell.styleIds[i]);
229
227
  if (findStyle) {
230
- newCell.custom.style = _objectSpread(_objectSpread({}, newCell.custom.style), findStyle.options);
228
+ newCell.custom.style = {
229
+ ...newCell.custom.style,
230
+ ...findStyle.options
231
+ };
231
232
  }
232
233
  }
233
234
  }
234
- newCell.custom.style = _objectSpread(_objectSpread({}, newCell.custom.style), newCell.style);
235
+ newCell.custom.style = {
236
+ ...newCell.custom.style,
237
+ ...newCell.style
238
+ };
235
239
  if (!showEditor) {
236
240
  for (let i = 0; i < newCell.styleConditions.length; i++) {
237
241
  const replacedText = replaceText(newCell.styleConditions[i].condition, variablesProcessed);
@@ -242,14 +246,20 @@ class DashboardsMainFreehand extends _react.Component {
242
246
  newCell.styleConditions[i].styleIds.forEach(styleId => {
243
247
  const findStyle = styles.find(aStyle => aStyle.id === styleId);
244
248
  if (findStyle) {
245
- newCell.custom.style = _objectSpread(_objectSpread({}, newCell.custom.style), findStyle.options);
249
+ newCell.custom.style = {
250
+ ...newCell.custom.style,
251
+ ...findStyle.options
252
+ };
246
253
  }
247
254
  });
248
- newCell.custom.style = _objectSpread(_objectSpread({}, newCell.custom.style), newCell.styleConditions[i].style);
255
+ newCell.custom.style = {
256
+ ...newCell.custom.style,
257
+ ...newCell.styleConditions[i].style
258
+ };
249
259
  break;
250
260
  }
251
261
  } catch (error) {
252
- core.log('error', namespace, methodName, "Error window.eval(".concat(replacedText.text, ")"));
262
+ core.log('error', namespace, methodName, `Error window.eval(${replacedText.text})`);
253
263
  }
254
264
  }
255
265
  }
@@ -263,7 +273,7 @@ class DashboardsMainFreehand extends _react.Component {
263
273
  break;
264
274
  }
265
275
  } catch (error) {
266
- core.log('error', namespace, methodName, "Error window.eval(".concat(replacedText.text, ")"));
276
+ core.log('error', namespace, methodName, `Error window.eval(${replacedText.text})`);
267
277
  }
268
278
  }
269
279
  }
@@ -298,9 +308,10 @@ class DashboardsMainFreehand extends _react.Component {
298
308
  updateSelected: _selected => this.updateSelected(_selected),
299
309
  showSelected: true
300
310
  }, /*#__PURE__*/_react.default.createElement("div", {
301
- style: _objectSpread(_objectSpread({}, style.preview), {}, {
311
+ style: {
312
+ ...style.preview,
302
313
  height: freehandDashboard.showFooter ? '95%' : '100%'
303
- }),
314
+ },
304
315
  ref: element => {
305
316
  this.updateElementDimensions(element);
306
317
  }
@@ -313,7 +324,7 @@ class DashboardsMainFreehand extends _react.Component {
313
324
  justifyContent: freehandDashboard.ratio.horizontalAlignment,
314
325
  showEditor: showEditor
315
326
  }, /*#__PURE__*/_react.default.createElement("div", null, freehandDashboardProcessed.cells.map((cell, index) => {
316
- const isSelected = showEditor && selected.cells.includes("".concat(index));
327
+ const isSelected = showEditor && selected.cells.includes(`${index}`);
317
328
  const widget = cell.content.type === 'widget' ? widgets.find(aWidget => aWidget.id === cell.content.id) : null;
318
329
  let viewer = null;
319
330
  if (widget && widget.plugInType !== 'component') {
@@ -325,20 +336,20 @@ class DashboardsMainFreehand extends _react.Component {
325
336
  key: String(index),
326
337
  style: {
327
338
  position: 'absolute',
328
- width: "".concat(cell.width, "%"),
329
- height: "".concat(cell.height, "%"),
330
- top: "".concat(cell.y, "%"),
331
- left: "".concat(cell.x, "%"),
339
+ width: `${cell.width}%`,
340
+ height: `${cell.height}%`,
341
+ top: `${cell.y}%`,
342
+ left: `${cell.x}%`,
332
343
  zIndex: cell.z
333
344
  },
334
345
  onClick: event => {
335
- this.updateSelected(["".concat(index)]);
346
+ this.updateSelected([`${index}`]);
336
347
  if (!showEditor && cell.actionType && this.props.onCellAction) {
337
348
  event.stopPropagation();
338
349
  this.props.onCellAction(event, index, cell);
339
350
  }
340
351
  },
341
- onKeyPress: event => this.updateSelected(["".concat(index)])
352
+ onKeyPress: event => this.updateSelected([`${index}`])
342
353
  }, /*#__PURE__*/_react.default.createElement(_DashboardsCell.default, {
343
354
  cell: cell,
344
355
  widget: widget,
@@ -14,11 +14,6 @@ var _DashboardsCell = _interopRequireDefault(require("../DashboardsCell"));
14
14
  var _DashboardsGrid = _interopRequireDefault(require("../DashboardsGrid"));
15
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
16
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
17
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
18
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
19
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
20
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
21
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
22
17
  const style = {
23
18
  root: {
24
19
  position: 'absolute',
@@ -76,10 +71,11 @@ class DashboardsMainMessaging extends _react.Component {
76
71
  if (prevState.previewWidth !== Math.floor(size.width) || prevState.previewHeight !== Math.floor(size.height)) {
77
72
  const previewWidth = Math.floor(size.width);
78
73
  const previewHeight = Math.floor(size.height);
79
- return _objectSpread({
74
+ return {
80
75
  previewWidth: previewWidth,
81
- previewHeight: previewHeight
82
- }, this.updateViewDimensions(previewWidth, previewHeight));
76
+ previewHeight: previewHeight,
77
+ ...this.updateViewDimensions(previewWidth, previewHeight)
78
+ };
83
79
  }
84
80
  return null;
85
81
  });
@@ -105,7 +101,9 @@ class DashboardsMainMessaging extends _react.Component {
105
101
  };
106
102
  }
107
103
  updateViewDimensionsToState() {
108
- this.setState(prevState => _objectSpread({}, this.updateViewDimensions(prevState.previewWidth, prevState.previewHeight)));
104
+ this.setState(prevState => ({
105
+ ...this.updateViewDimensions(prevState.previewWidth, prevState.previewHeight)
106
+ }));
109
107
  }
110
108
  getParentEvents(eventId) {
111
109
  const {
@@ -217,7 +215,14 @@ class DashboardsMainMessaging extends _react.Component {
217
215
  default:
218
216
  break;
219
217
  }
220
- processedEvent.custom.style = _objectSpread(_objectSpread({}, defaultActiveStyleId ? _objectSpread({}, defaultActiveStyleId.options) : {}), newStyle ? _objectSpread({}, newStyle.options) : {});
218
+ processedEvent.custom.style = {
219
+ ...(defaultActiveStyleId ? {
220
+ ...defaultActiveStyleId.options
221
+ } : {}),
222
+ ...(newStyle ? {
223
+ ...newStyle.options
224
+ } : {})
225
+ };
221
226
  let newMessageProceessed = String(processedEvent.messageProceessed);
222
227
  let textVariables = {
223
228
  active: false,
@@ -234,14 +239,14 @@ class DashboardsMainMessaging extends _react.Component {
234
239
  }
235
240
  if (acc.active) {
236
241
  if (/[A-Z0-9_(]/.test(curr)) {
237
- acc.list[acc.list.length - 1] = "".concat(acc.list[acc.list.length - 1]).concat(curr === '(' ? "\\".concat(curr) : curr);
242
+ acc.list[acc.list.length - 1] = `${acc.list[acc.list.length - 1]}${curr === '(' ? `\\${curr}` : curr}`;
238
243
  if (curr === '(') {
239
244
  acc.activeInput = true;
240
245
  }
241
246
  return acc;
242
247
  }
243
248
  if (acc.activeInput && /[A-Z0-9a-z )]/.test(curr)) {
244
- acc.list[acc.list.length - 1] = "".concat(acc.list[acc.list.length - 1]).concat(curr === ')' ? "\\".concat(curr) : curr);
249
+ acc.list[acc.list.length - 1] = `${acc.list[acc.list.length - 1]}${curr === ')' ? `\\${curr}` : curr}`;
245
250
  if (curr !== ')') {
246
251
  return acc;
247
252
  }
@@ -274,7 +279,7 @@ class DashboardsMainMessaging extends _react.Component {
274
279
  case 'DATE_TIME':
275
280
  {
276
281
  const datetime = new Date(processedEvent.respondDateTime ? processedEvent.respondDateTime : processedEvent.startDateTime);
277
- replaceValue = "".concat(intl.formatDate(datetime), " ").concat(intl.formatTime(datetime));
282
+ replaceValue = `${intl.formatDate(datetime)} ${intl.formatTime(datetime)}`;
278
283
  break;
279
284
  }
280
285
  case 'DATE':
@@ -286,7 +291,7 @@ class DashboardsMainMessaging extends _react.Component {
286
291
  case 'START_DATE_TIME':
287
292
  {
288
293
  const datetime = new Date(processedEvent.startDateTime);
289
- replaceValue = "".concat(intl.formatDate(datetime), " ").concat(intl.formatTime(datetime));
294
+ replaceValue = `${intl.formatDate(datetime)} ${intl.formatTime(datetime)}`;
290
295
  break;
291
296
  }
292
297
  case 'ELAPSED_TIME':
@@ -354,7 +359,7 @@ class DashboardsMainMessaging extends _react.Component {
354
359
  }
355
360
  }
356
361
  if (canReplace) {
357
- newMessageProceessed = newMessageProceessed.replace(new RegExp("~".concat(textVariable)), "".concat(replaceValue));
362
+ newMessageProceessed = newMessageProceessed.replace(new RegExp(`~${textVariable}`), `${replaceValue}`);
358
363
  }
359
364
  }
360
365
  processedEvent.messageProceessed = newMessageProceessed;
@@ -395,9 +400,10 @@ class DashboardsMainMessaging extends _react.Component {
395
400
  return /*#__PURE__*/_react.default.createElement("div", {
396
401
  style: style.root
397
402
  }, /*#__PURE__*/_react.default.createElement("div", {
398
- style: _objectSpread(_objectSpread({}, style.preview), {}, {
403
+ style: {
404
+ ...style.preview,
399
405
  height: messagingDashboard.showFooter ? '95%' : '100%'
400
- }),
406
+ },
401
407
  ref: element => {
402
408
  this.updateElementDimensions(element);
403
409
  }
@@ -423,7 +429,7 @@ class DashboardsMainMessaging extends _react.Component {
423
429
  }, []).map((event, index) => {
424
430
  if (messagingDashboardProcessed.showElapsedTime && index % 2 !== 0) {
425
431
  return /*#__PURE__*/_react.default.createElement(_DashboardsCell.default, {
426
- key: String("1-".concat(index)),
432
+ key: String(`1-${index}`),
427
433
  cell: {
428
434
  columnSpan: 1,
429
435
  rowSpan: 1,
@@ -431,18 +437,20 @@ class DashboardsMainMessaging extends _react.Component {
431
437
  type: 'text',
432
438
  text: event.startDateTimeFormatted
433
439
  },
434
- custom: _objectSpread(_objectSpread({}, event.custom), {}, {
435
- style: _objectSpread({
440
+ custom: {
441
+ ...event.custom,
442
+ style: {
436
443
  backgroundColor: 'white',
437
444
  justifyContent: 'center',
438
- alignItems: 'center'
439
- }, event.custom.style)
440
- })
445
+ alignItems: 'center',
446
+ ...event.custom.style
447
+ }
448
+ }
441
449
  }
442
450
  });
443
451
  }
444
452
  return /*#__PURE__*/_react.default.createElement(_DashboardsCell.default, {
445
- key: String("1-".concat(index)),
453
+ key: String(`1-${index}`),
446
454
  cell: {
447
455
  columnSpan: 1,
448
456
  rowSpan: 1,
@@ -450,12 +458,14 @@ class DashboardsMainMessaging extends _react.Component {
450
458
  type: 'text',
451
459
  text: event.messageProceessed
452
460
  },
453
- custom: _objectSpread(_objectSpread({}, event.custom), {}, {
454
- style: _objectSpread({
461
+ custom: {
462
+ ...event.custom,
463
+ style: {
455
464
  backgroundColor: 'white',
456
- alignItems: 'center'
457
- }, event.custom.style)
458
- })
465
+ alignItems: 'center',
466
+ ...event.custom.style
467
+ }
468
+ }
459
469
  }
460
470
  });
461
471
  }) : Array.from({
@@ -470,11 +480,14 @@ class DashboardsMainMessaging extends _react.Component {
470
480
  custom: {
471
481
  viewWidth: viewWidth,
472
482
  viewHeight: viewHeight,
473
- style: _objectSpread({
483
+ style: {
474
484
  backgroundColor: 'white',
475
485
  justifyContent: 'center',
476
- alignItems: 'center'
477
- }, styleId ? _objectSpread({}, styleId.options) : {})
486
+ alignItems: 'center',
487
+ ...(styleId ? {
488
+ ...styleId.options
489
+ } : {})
490
+ }
478
491
  }
479
492
  }
480
493
  }))))), messagingDashboard.showFooter ? /*#__PURE__*/_react.default.createElement("div", {
@@ -15,11 +15,6 @@ var _DashboardsCell = _interopRequireDefault(require("../DashboardsCell"));
15
15
  var _DashboardsGrid = _interopRequireDefault(require("../DashboardsGrid"));
16
16
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
17
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
18
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
19
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
20
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
21
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
22
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
23
18
  const namespace = 'DashboardsMainTable';
24
19
  const style = {
25
20
  root: {
@@ -50,7 +45,7 @@ function findDependencies(text) {
50
45
  };
51
46
  }
52
47
  if (acc.found && /[A-Z0-9_]/.test(curr)) {
53
- acc.list[acc.list.length - 1] = "".concat(acc.list[acc.list.length - 1]).concat(curr);
48
+ acc.list[acc.list.length - 1] = `${acc.list[acc.list.length - 1]}${curr}`;
54
49
  return acc;
55
50
  }
56
51
  acc.found = false;
@@ -66,7 +61,7 @@ function replaceText(text, variables) {
66
61
  if (dependencies.length > 0) {
67
62
  variables.filter(variable => dependencies.includes(variable.name)).forEach(variable => {
68
63
  // newText = newText.replace(new RegExp(`~${variable.name}`), `${calculated && variable.calculated !== '' ? variable.calculated : variable.value}`);
69
- newText = newText.split("~".concat(variable.name)).join("".concat(calculated && variable.calculated !== '' ? variable.calculated : variable.value));
64
+ newText = newText.split(`~${variable.name}`).join(`${calculated && variable.calculated !== '' ? variable.calculated : variable.value}`);
70
65
  missingDependencies = missingDependencies.filter(missingDependency => missingDependency !== variable.name);
71
66
  });
72
67
  }
@@ -119,10 +114,11 @@ class DashboardsMainTable extends _react.Component {
119
114
  if (prevState.previewWidth !== Math.floor(size.width) || prevState.previewHeight !== Math.floor(size.height)) {
120
115
  const previewWidth = Math.floor(size.width);
121
116
  const previewHeight = Math.floor(size.height);
122
- return _objectSpread({
117
+ return {
123
118
  previewWidth: previewWidth,
124
- previewHeight: previewHeight
125
- }, this.updateViewDimensions(previewWidth, previewHeight));
119
+ previewHeight: previewHeight,
120
+ ...this.updateViewDimensions(previewWidth, previewHeight)
121
+ };
126
122
  }
127
123
  return null;
128
124
  });
@@ -148,12 +144,14 @@ class DashboardsMainTable extends _react.Component {
148
144
  };
149
145
  }
150
146
  updateViewDimensionsToState() {
151
- this.setState(prevState => _objectSpread({}, this.updateViewDimensions(prevState.previewWidth, prevState.previewHeight)));
147
+ this.setState(prevState => ({
148
+ ...this.updateViewDimensions(prevState.previewWidth, prevState.previewHeight)
149
+ }));
152
150
  }
153
151
  updateRowsAndColumns() {
154
152
  this.setState({
155
- gridTemplateRows: this.props.tableDashboard.rowProperties.reduce((acc, row) => "".concat(acc, " ").concat(row.height, "fr"), ''),
156
- gridTemplateColumns: this.props.tableDashboard.columnProperties.reduce((acc, column) => "".concat(acc, " ").concat(column.width, "fr"), '')
153
+ gridTemplateRows: this.props.tableDashboard.rowProperties.reduce((acc, row) => `${acc} ${row.height}fr`, ''),
154
+ gridTemplateColumns: this.props.tableDashboard.columnProperties.reduce((acc, column) => `${acc} ${column.width}fr`, '')
157
155
  });
158
156
  }
159
157
  updateTableDashboard(values) {
@@ -211,7 +209,8 @@ class DashboardsMainTable extends _react.Component {
211
209
  switch (direction) {
212
210
  case 'up':
213
211
  if (index > 0) {
214
- selected.cells = selected.cells.map(cell => _objectSpread(_objectSpread({}, cell), {}, {
212
+ selected.cells = selected.cells.map(cell => ({
213
+ ...cell,
215
214
  row: cell.row - 1,
216
215
  index: cell.index - columnProperties.length
217
216
  }));
@@ -221,7 +220,8 @@ class DashboardsMainTable extends _react.Component {
221
220
  break;
222
221
  case 'down':
223
222
  if (index < rowProperties.length) {
224
- selected.cells = selected.cells.map(cell => _objectSpread(_objectSpread({}, cell), {}, {
223
+ selected.cells = selected.cells.map(cell => ({
224
+ ...cell,
225
225
  row: cell.row + 1,
226
226
  index: cell.index + columnProperties.length
227
227
  }));
@@ -238,7 +238,8 @@ class DashboardsMainTable extends _react.Component {
238
238
  switch (direction) {
239
239
  case 'left':
240
240
  if (index > 0) {
241
- selected.cells = selected.cells.map(cell => _objectSpread(_objectSpread({}, cell), {}, {
241
+ selected.cells = selected.cells.map(cell => ({
242
+ ...cell,
242
243
  column: cell.column - 1,
243
244
  index: cell.index - 1
244
245
  }));
@@ -248,7 +249,8 @@ class DashboardsMainTable extends _react.Component {
248
249
  break;
249
250
  case 'right':
250
251
  if (index < columnProperties.length) {
251
- selected.cells = selected.cells.map(cell => _objectSpread(_objectSpread({}, cell), {}, {
252
+ selected.cells = selected.cells.map(cell => ({
253
+ ...cell,
252
254
  column: cell.column + 1,
253
255
  index: cell.index + 1
254
256
  }));
@@ -353,11 +355,17 @@ class DashboardsMainTable extends _react.Component {
353
355
  for (let i = 0; i < newCell.styleIds.length; i++) {
354
356
  const findStyle = styles.find(searchStyle => searchStyle.id === newCell.styleIds[i]);
355
357
  if (findStyle) {
356
- newCell.custom.style = _objectSpread(_objectSpread({}, newCell.custom.style), findStyle.options);
358
+ newCell.custom.style = {
359
+ ...newCell.custom.style,
360
+ ...findStyle.options
361
+ };
357
362
  }
358
363
  }
359
364
  }
360
- newCell.custom.style = _objectSpread(_objectSpread({}, newCell.custom.style), newCell.style);
365
+ newCell.custom.style = {
366
+ ...newCell.custom.style,
367
+ ...newCell.style
368
+ };
361
369
  if (!showEditor) {
362
370
  for (let i = 0; i < newCell.styleConditions.length; i++) {
363
371
  const replacedText = replaceText(newCell.styleConditions[i].condition, variablesProcessed);
@@ -368,14 +376,20 @@ class DashboardsMainTable extends _react.Component {
368
376
  newCell.styleConditions[i].styleIds.forEach(styleId => {
369
377
  const findStyle = styles.find(aStyle => aStyle.id === styleId);
370
378
  if (findStyle) {
371
- newCell.custom.style = _objectSpread(_objectSpread({}, newCell.custom.style), findStyle.options);
379
+ newCell.custom.style = {
380
+ ...newCell.custom.style,
381
+ ...findStyle.options
382
+ };
372
383
  }
373
384
  });
374
- newCell.custom.style = _objectSpread(_objectSpread({}, newCell.custom.style), newCell.styleConditions[i].style);
385
+ newCell.custom.style = {
386
+ ...newCell.custom.style,
387
+ ...newCell.styleConditions[i].style
388
+ };
375
389
  break;
376
390
  }
377
391
  } catch (error) {
378
- core.log('error', namespace, methodName, "Error window.eval(".concat(replacedText.text, ")"));
392
+ core.log('error', namespace, methodName, `Error window.eval(${replacedText.text})`);
379
393
  }
380
394
  }
381
395
  }
@@ -389,7 +403,7 @@ class DashboardsMainTable extends _react.Component {
389
403
  break;
390
404
  }
391
405
  } catch (error) {
392
- core.log('error', namespace, methodName, "Error window.eval(".concat(replacedText.text, ")"));
406
+ core.log('error', namespace, methodName, `Error window.eval(${replacedText.text})`);
393
407
  }
394
408
  }
395
409
  }
@@ -425,9 +439,10 @@ class DashboardsMainTable extends _react.Component {
425
439
  showSelectRows: true,
426
440
  showSelectAll: true
427
441
  }, /*#__PURE__*/_react.default.createElement("div", {
428
- style: _objectSpread(_objectSpread({}, style.preview), {}, {
442
+ style: {
443
+ ...style.preview,
429
444
  height: tableDashboard.showFooter ? '95%' : '100%'
430
- }),
445
+ },
431
446
  ref: element => {
432
447
  this.updateElementDimensions(element);
433
448
  }
@@ -459,7 +474,7 @@ class DashboardsMainTable extends _react.Component {
459
474
  widget: widget,
460
475
  viewer: viewer,
461
476
  showEditor: showEditor,
462
- key: "".concat(cell.column, "-").concat(cell.row)
477
+ key: `${cell.column}-${cell.row}`
463
478
  });
464
479
  })))), tableDashboard.showFooter ? /*#__PURE__*/_react.default.createElement("div", {
465
480
  style: {
@@ -9,11 +9,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _BackgroundTransparency = _interopRequireDefault(require("../../images/BackgroundTransparency.png"));
10
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
11
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
12
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
14
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
15
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
16
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
17
12
  const style = {
18
13
  outside: {
19
14
  position: 'relative',
@@ -22,7 +17,7 @@ const style = {
22
17
  backgroundRepeat: 'repeat',
23
18
  overflow: 'hidden',
24
19
  backgroundColor: '#ffffff',
25
- backgroundImage: "url(".concat(_BackgroundTransparency.default, ")")
20
+ backgroundImage: `url(${_BackgroundTransparency.default})`
26
21
  },
27
22
  inside: {
28
23
  position: 'relative',
@@ -70,13 +65,14 @@ class DashboardsPreview extends _react.Component {
70
65
  this.element = element;
71
66
  return this.element;
72
67
  },
73
- style: _objectSpread(_objectSpread({}, style.outside), {}, {
68
+ style: {
69
+ ...style.outside,
74
70
  width: width,
75
71
  height: height,
76
72
  margin: margin,
77
73
  padding: padding,
78
74
  fontSize: fontSize
79
- })
75
+ }
80
76
  }, /*#__PURE__*/_react.default.createElement("div", {
81
77
  style: style.inside
82
78
  }, this.props.children));