versacall-dashboards-library-react 2.0.39 → 2.0.41

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 (99) hide show
  1. package/dist/components/DashboardsCell/DashboardsCell.js +54 -104
  2. package/dist/components/DashboardsCell/index.js +2 -4
  3. package/dist/components/DashboardsCellContent/DashboardsCellContent.js +29 -62
  4. package/dist/components/DashboardsCellContent/index.js +2 -4
  5. package/dist/components/DashboardsCellFindAndReplace/DashboardsCellFindAndReplace.js +27 -57
  6. package/dist/components/DashboardsCellFindAndReplace/index.js +2 -4
  7. package/dist/components/DashboardsCellGlobalActions/DashboardsCellGlobalActions.js +151 -155
  8. package/dist/components/DashboardsCellGlobalActions/index.js +2 -4
  9. package/dist/components/DashboardsCellGlobalConditions/DashboardsCellGlobalConditions.js +463 -563
  10. package/dist/components/DashboardsCellGlobalConditions/DashboardsCellGlobalConditionsNestable.js +109 -199
  11. package/dist/components/DashboardsCellGlobalConditions/DashboardsCellGlobalConditionsOld.js +87 -173
  12. package/dist/components/DashboardsCellGlobalConditions/index.js +2 -4
  13. package/dist/components/DashboardsCellGlobalStyles/DashboardsCellGlobalStyles.js +28 -78
  14. package/dist/components/DashboardsCellGlobalStyles/index.js +2 -4
  15. package/dist/components/DashboardsCellMergeUnmerge/DashboardsCellMergeUnmerge.js +33 -65
  16. package/dist/components/DashboardsCellMergeUnmerge/index.js +2 -4
  17. package/dist/components/DashboardsCellPosition/DashboardsCellPosition.js +5 -11
  18. package/dist/components/DashboardsCellPosition/index.js +2 -4
  19. package/dist/components/DashboardsCellSize/DashboardsCellSize.js +7 -16
  20. package/dist/components/DashboardsCellSize/index.js +2 -4
  21. package/dist/components/DashboardsCellStyle/DashboardsCellStyle.js +5 -21
  22. package/dist/components/DashboardsCellStyle/index.js +2 -4
  23. package/dist/components/DashboardsCellStyleAlignItems/DashboardsCellStyleAlignItems.js +12 -28
  24. package/dist/components/DashboardsCellStyleAlignItems/index.js +2 -4
  25. package/dist/components/DashboardsCellStyleBackgroundColor/DashboardsCellStyleBackgroundColor.js +15 -52
  26. package/dist/components/DashboardsCellStyleBackgroundColor/index.js +2 -4
  27. package/dist/components/DashboardsCellStyleClear/DashboardsCellStyleClear.js +4 -12
  28. package/dist/components/DashboardsCellStyleClear/index.js +2 -4
  29. package/dist/components/DashboardsCellStyleColor/DashboardsCellStyleColor.js +15 -52
  30. package/dist/components/DashboardsCellStyleColor/index.js +2 -4
  31. package/dist/components/DashboardsCellStyleDisplay/DashboardsCellStyleDisplay.js +6 -15
  32. package/dist/components/DashboardsCellStyleDisplay/index.js +2 -4
  33. package/dist/components/DashboardsCellStyleFontFamily/DashboardsCellStyleFontFamily.js +6 -15
  34. package/dist/components/DashboardsCellStyleFontFamily/index.js +2 -4
  35. package/dist/components/DashboardsCellStyleFontSize/DashboardsCellStyleFontSize.js +8 -19
  36. package/dist/components/DashboardsCellStyleFontSize/index.js +2 -4
  37. package/dist/components/DashboardsCellStyleJustifyContent/DashboardsCellStyleJustifyContent.js +12 -28
  38. package/dist/components/DashboardsCellStyleJustifyContent/index.js +2 -4
  39. package/dist/components/DashboardsCellStyleObjectFit/DashboardsCellStyleObjectFit.js +6 -15
  40. package/dist/components/DashboardsCellStyleObjectFit/index.js +2 -4
  41. package/dist/components/DashboardsCellStylePadding/DashboardsCellStylePadding.js +7 -16
  42. package/dist/components/DashboardsCellStylePadding/index.js +2 -4
  43. package/dist/components/DashboardsCellStyleWeightStyleDecoration/DashboardsCellStyleWeightStyleDecoration.js +12 -28
  44. package/dist/components/DashboardsCellStyleWeightStyleDecoration/index.js +2 -4
  45. package/dist/components/DashboardsCopyAndPaste/DashboardsCopyAndPaste.js +19 -40
  46. package/dist/components/DashboardsCopyAndPaste/index.js +2 -4
  47. package/dist/components/DashboardsEditor/DashboardsEditor.js +34 -68
  48. package/dist/components/DashboardsEditor/index.js +2 -4
  49. package/dist/components/DashboardsGlobalStylesPicker/DashboardsGlobalStylesPicker.js +13 -25
  50. package/dist/components/DashboardsGlobalStylesPicker/index.js +2 -4
  51. package/dist/components/DashboardsGrid/DashboardsGrid.js +21 -33
  52. package/dist/components/DashboardsGrid/index.js +2 -4
  53. package/dist/components/DashboardsMainFreehand/DashboardsMainFreehand.js +65 -130
  54. package/dist/components/DashboardsMainFreehand/index.js +2 -4
  55. package/dist/components/DashboardsMainMessaging/DashboardsMainMessaging.js +86 -203
  56. package/dist/components/DashboardsMainMessaging/index.js +2 -4
  57. package/dist/components/DashboardsMainTable/DashboardsMainTable.js +94 -208
  58. package/dist/components/DashboardsMainTable/index.js +2 -4
  59. package/dist/components/DashboardsPreview/DashboardsPreview.js +18 -32
  60. package/dist/components/DashboardsPreview/index.js +2 -4
  61. package/dist/components/DashboardsRatio/DashboardsRatio.js +18 -64
  62. package/dist/components/DashboardsRatio/DashboardsRatioOld.js +12 -27
  63. package/dist/components/DashboardsRatio/index.js +2 -4
  64. package/dist/components/DashboardsStatusBar/DashboardsStatusBar.js +16 -30
  65. package/dist/components/DashboardsStatusBar/index.js +2 -4
  66. package/dist/components/DashboardsUndoRedo/DashboardsUndoRedo.js +13 -42
  67. package/dist/components/DashboardsUndoRedo/index.js +2 -4
  68. package/dist/components/DashboardsViewer/DashboardsViewer.js +12 -19
  69. package/dist/components/DashboardsViewer/index.js +2 -4
  70. package/dist/components/DashboardsWidthHeight/DashboardsWidthHeight.js +8 -18
  71. package/dist/components/DashboardsWidthHeight/index.js +2 -4
  72. package/dist/components/WidgetParameters/WidgetParameters.js +32 -74
  73. package/dist/components/WidgetParameters/index.js +2 -4
  74. package/dist/components/index.js +41 -77
  75. package/dist/constants/defaultFreehandCell.js +2 -3
  76. package/dist/constants/defaultFreehandDashboard.js +2 -3
  77. package/dist/constants/defaultMessagingDashboard.js +2 -3
  78. package/dist/constants/defaultStyle.js +2 -3
  79. package/dist/constants/defaultTableCell.js +2 -3
  80. package/dist/constants/defaultTableDashboard.js +2 -3
  81. package/dist/constants/index.js +7 -14
  82. package/dist/functions/addTranslations.js +7 -14
  83. package/dist/functions/calculateDashboardVariables.js +24 -48
  84. package/dist/functions/convertColorObject.js +0 -1
  85. package/dist/functions/convertColorString.js +2 -4
  86. package/dist/functions/convertPercentToInt.js +0 -1
  87. package/dist/functions/convertSecondsToElapsedTime.js +8 -13
  88. package/dist/functions/generateFreehandCell.js +3 -6
  89. package/dist/functions/generateFreehandDashboard.js +2 -6
  90. package/dist/functions/generateMessagingDashboard.js +1 -3
  91. package/dist/functions/generateSelected.js +1 -4
  92. package/dist/functions/generateTableCell.js +1 -3
  93. package/dist/functions/generateTableDashboard.js +7 -15
  94. package/dist/functions/index.js +15 -30
  95. package/dist/functions/mergeSelected.js +3 -5
  96. package/dist/functions/sortCells.js +0 -5
  97. package/dist/index.js +3 -9
  98. package/dist/translations/en.json +2 -1
  99. package/package.json +2 -2
@@ -4,98 +4,47 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireWildcard(require("react"));
9
-
10
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
9
  var _styles = require("@material-ui/core/styles");
13
-
14
10
  var _CardActionArea = _interopRequireDefault(require("@material-ui/core/CardActionArea"));
15
-
16
11
  var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
17
-
18
12
  var _IconButton = _interopRequireDefault(require("@material-ui/core/IconButton"));
19
-
20
13
  var _TextField = _interopRequireDefault(require("@material-ui/core/TextField"));
21
-
22
14
  var _Tooltip = _interopRequireDefault(require("@material-ui/core/Tooltip"));
23
-
24
15
  var _Dialog = _interopRequireDefault(require("@material-ui/core/Dialog"));
25
-
26
16
  var _Paper = _interopRequireDefault(require("@material-ui/core/Paper"));
27
-
28
17
  var _Grid = _interopRequireDefault(require("@material-ui/core/Grid"));
29
-
30
18
  var _Tabs = _interopRequireDefault(require("@material-ui/core/Tabs"));
31
-
32
19
  var _Tab = _interopRequireDefault(require("@material-ui/core/Tab"));
33
-
34
20
  var _Menu = _interopRequireDefault(require("@material-ui/core/Menu"));
35
-
36
21
  var _MenuItem = _interopRequireDefault(require("@material-ui/core/MenuItem"));
37
-
38
22
  var _SettingsOutlined = _interopRequireDefault(require("@material-ui/icons/SettingsOutlined"));
39
-
40
23
  var _ArrowDownward = _interopRequireDefault(require("@material-ui/icons/ArrowDownward"));
41
-
42
24
  var _ArrowUpward = _interopRequireDefault(require("@material-ui/icons/ArrowUpward"));
43
-
44
25
  var _FileCopy = _interopRequireDefault(require("@material-ui/icons/FileCopy"));
45
-
46
26
  var _Settings = _interopRequireDefault(require("@material-ui/icons/Settings"));
47
-
48
27
  var _Delete = _interopRequireDefault(require("@material-ui/icons/Delete"));
49
-
50
28
  var _Add = _interopRequireDefault(require("@material-ui/icons/Add"));
51
-
52
29
  var _MoreVert = _interopRequireDefault(require("@material-ui/icons/MoreVert"));
53
-
54
30
  var _OpenWith = _interopRequireDefault(require("@material-ui/icons/OpenWith"));
55
-
56
31
  var _reactNestableFork = _interopRequireDefault(require("react-nestable-fork"));
57
-
58
32
  var _reactIntl = require("react-intl");
59
-
60
33
  var _versacallCoreLibraryReact = require("versacall-core-library-react");
61
-
62
34
  var _DashboardsCellGlobalStyles = _interopRequireDefault(require("../DashboardsCellGlobalStyles"));
63
-
64
35
  var _DashboardsCellContent = _interopRequireDefault(require("../DashboardsCellContent"));
65
-
66
36
  var _DashboardsCellStyle = _interopRequireDefault(require("../DashboardsCellStyle"));
67
-
68
37
  var _DashboardsPreview = _interopRequireDefault(require("../DashboardsPreview"));
69
-
70
38
  var _DashboardsCell = _interopRequireDefault(require("../DashboardsCell"));
71
-
72
39
  require("react-nestable-fork/dist/Nestable/Nestable.css");
73
-
74
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
75
-
76
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
77
-
78
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
79
-
80
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
81
-
82
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
83
-
84
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
85
-
86
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
87
-
88
- function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
89
-
90
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
91
-
92
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
93
-
94
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
95
-
96
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
97
-
98
- var muiStyles = () => ({
40
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
41
+ 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); }
42
+ 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; }
43
+ 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; }
44
+ 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; }
45
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
46
+ 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); } // import Fab from '@material-ui/core/Fab';
47
+ const muiStyles = () => ({
99
48
  dialog: {
100
49
  backgroundColor: '#eff4f8'
101
50
  },
@@ -115,8 +64,7 @@ var muiStyles = () => ({
115
64
  }
116
65
  }
117
66
  });
118
-
119
- var style = {
67
+ const style = {
120
68
  root: {
121
69
  position: 'relative',
122
70
  display: 'flex',
@@ -181,7 +129,7 @@ var style = {
181
129
  textTransform: 'uppercase'
182
130
  }
183
131
  };
184
- var operatorOptions = [{
132
+ const operatorOptions = [{
185
133
  value: '===',
186
134
  label: '='
187
135
  }, {
@@ -200,9 +148,8 @@ var operatorOptions = [{
200
148
  value: '<=',
201
149
  label: "".concat(String.fromCharCode(0x2264))
202
150
  }];
203
-
204
- var formatCondition = original => {
205
- var formatted = original;
151
+ const formatCondition = original => {
152
+ let formatted = original;
206
153
  formatted = formatted.replace('===', '=');
207
154
  formatted = formatted.replace('!==', String.fromCharCode(0x2260));
208
155
  formatted = formatted.replace('>=', String.fromCharCode(0x2265));
@@ -211,49 +158,47 @@ var formatCondition = original => {
211
158
  formatted = formatted.replace('||', 'OR');
212
159
  return formatted;
213
160
  };
214
-
215
- var tabStyle = active => ({
161
+ const tabStyle = active => ({
216
162
  // border: active ? '2px solid #008bcc' : '',
217
163
  color: active ? 'black' : 'white',
218
- backgroundColor: active ? '#55b7dc' : '#496b78' // borderRadius: '3px',
219
-
164
+ backgroundColor: active ? '#55b7dc' : '#496b78'
165
+ // borderRadius: '3px',
220
166
  });
221
-
222
- var contentPreviewCustomCell = ({
223
- row
224
- }) => /*#__PURE__*/_react.default.createElement("div", {
225
- style: {
226
- width: 120
227
- }
228
- }, /*#__PURE__*/_react.default.createElement(_DashboardsPreview.default, {
229
- width: "120px",
230
- height: "100px",
231
- padding: "10px"
232
- }, /*#__PURE__*/_react.default.createElement(_DashboardsCell.default, {
233
- cell: {
234
- content: row.content,
235
- custom: {
236
- viewWidth: 120,
237
- viewHeight: 100,
238
- style: {}
167
+ const contentPreviewCustomCell = _ref => {
168
+ let {
169
+ row
170
+ } = _ref;
171
+ return /*#__PURE__*/_react.default.createElement("div", {
172
+ style: {
173
+ width: 120
239
174
  }
240
- }
241
- })));
242
-
243
- var conditionCustomCell = ({
244
- row
245
- }) => {
246
- var newCondition = row.condition;
247
-
175
+ }, /*#__PURE__*/_react.default.createElement(_DashboardsPreview.default, {
176
+ width: "120px",
177
+ height: "100px",
178
+ padding: "10px"
179
+ }, /*#__PURE__*/_react.default.createElement(_DashboardsCell.default, {
180
+ cell: {
181
+ content: row.content,
182
+ custom: {
183
+ viewWidth: 120,
184
+ viewHeight: 100,
185
+ style: {}
186
+ }
187
+ }
188
+ })));
189
+ };
190
+ const conditionCustomCell = _ref2 => {
191
+ let {
192
+ row
193
+ } = _ref2;
194
+ let newCondition = row.condition;
248
195
  if (newCondition.split(' ').length === 3) {
249
196
  operatorOptions.forEach(option => {
250
197
  newCondition = newCondition.replace(new RegExp(option.value, 'g'), option.label);
251
198
  });
252
199
  }
253
-
254
200
  return newCondition;
255
201
  };
256
-
257
202
  class DashboardsCellGlobalConditions extends _react.Component {
258
203
  constructor(props) {
259
204
  super(props);
@@ -332,33 +277,24 @@ class DashboardsCellGlobalConditions extends _react.Component {
332
277
  }]
333
278
  };
334
279
  }
335
-
336
- stylePreviewCustomCell({
337
- row
338
- }) {
339
- var _this = this;
340
-
341
- var newCell = JSON.parse(JSON.stringify(row));
280
+ stylePreviewCustomCell(_ref3) {
281
+ let {
282
+ row
283
+ } = _ref3;
284
+ const newCell = JSON.parse(JSON.stringify(row));
342
285
  newCell.custom = {
343
286
  viewWidth: 120,
344
287
  viewHeight: 120,
345
288
  style: {}
346
289
  };
347
-
348
290
  if (this.props.styles.length > 0 && row.styleIds && row.styleIds.length > 0) {
349
- var _loop = function _loop(i) {
350
- var findStyle = _this.props.styles.find(searchStyle => searchStyle.id === newCell.styleIds[i]);
351
-
291
+ for (let i = 0; i < newCell.styleIds.length; i++) {
292
+ const findStyle = this.props.styles.find(searchStyle => searchStyle.id === newCell.styleIds[i]);
352
293
  if (findStyle) {
353
294
  newCell.custom.style = _objectSpread(_objectSpread({}, newCell.custom.style), findStyle.options);
354
295
  }
355
- };
356
-
357
- for (var i = 0; i < newCell.styleIds.length; i++) {
358
- _loop(i);
359
296
  }
360
297
  }
361
-
362
298
  newCell.custom.style = _objectSpread(_objectSpread({}, newCell.custom.style), newCell.style);
363
299
  return /*#__PURE__*/_react.default.createElement("div", {
364
300
  style: {
@@ -378,18 +314,18 @@ class DashboardsCellGlobalConditions extends _react.Component {
378
314
  }
379
315
  })));
380
316
  }
381
-
382
- contentTypeCustomCell({
383
- row
384
- }) {
317
+ contentTypeCustomCell(_ref4) {
318
+ let {
319
+ row
320
+ } = _ref4;
385
321
  return /*#__PURE__*/_react.default.createElement("span", null, this.props.intl.formatMessage({
386
322
  id: "__".concat(row.content.type)
387
323
  }));
388
324
  }
389
-
390
- actionsCustomCell({
391
- row
392
- }) {
325
+ actionsCustomCell(_ref5) {
326
+ let {
327
+ row
328
+ } = _ref5;
393
329
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, row.index !== '0' && /*#__PURE__*/_react.default.createElement(_IconButton.default, {
394
330
  onClick: e => {
395
331
  e.stopPropagation();
@@ -420,50 +356,40 @@ class DashboardsCellGlobalConditions extends _react.Component {
420
356
  })
421
357
  }, /*#__PURE__*/_react.default.createElement(_Delete.default, null))));
422
358
  }
423
-
424
359
  updateCondition(change) {
425
- var conditions = JSON.parse(JSON.stringify(this.props.value["".concat(this.state.typeCondition, "Conditions")]));
426
-
360
+ const conditions = JSON.parse(JSON.stringify(this.props.value["".concat(this.state.typeCondition, "Conditions")]));
427
361
  if (this.state.advanced) {
428
362
  conditions[this.state.conditionIndex].condition = change.value;
429
363
  } else {
430
- var split = conditions[this.state.conditionIndex].condition.split(/[ ,]+/);
431
-
364
+ const split = conditions[this.state.conditionIndex].condition.split(/[ ,]+/);
432
365
  switch (change.stringIndex) {
433
366
  case 0:
434
367
  conditions[this.state.conditionIndex].condition = "".concat(change.value, " ").concat(split[1], " ").concat(split[2]);
435
368
  break;
436
-
437
369
  case 1:
438
370
  conditions[this.state.conditionIndex].condition = "".concat(split[0], " ").concat(change.value, " ").concat(split[2]);
439
371
  break;
440
-
441
372
  case 2:
442
373
  conditions[this.state.conditionIndex].condition = "".concat(split[0], " ").concat(split[1], " ").concat(change.value);
443
374
  break;
444
-
445
375
  default:
446
376
  conditions[this.state.conditionIndex].condition = '1 > 0';
447
377
  break;
448
378
  }
449
379
  }
450
-
451
380
  this.props.updateValue({
452
381
  ["".concat(this.state.typeCondition, "Conditions")]: conditions
453
382
  });
454
383
  }
455
-
456
384
  updateStyleIds(value) {
457
- var styleConditions = JSON.parse(JSON.stringify(this.props.value.styleConditions));
385
+ const styleConditions = JSON.parse(JSON.stringify(this.props.value.styleConditions));
458
386
  styleConditions[this.state.conditionIndex].styleIds = value.styleIds;
459
387
  this.props.updateValue({
460
388
  styleConditions: styleConditions
461
389
  });
462
390
  }
463
-
464
391
  updateStyle(value) {
465
- var styleConditions = JSON.parse(JSON.stringify(this.props.value.styleConditions));
466
-
392
+ const styleConditions = JSON.parse(JSON.stringify(this.props.value.styleConditions));
467
393
  if (Object.keys(value.style).length > 0) {
468
394
  styleConditions[this.state.conditionIndex].style = _objectSpread(_objectSpread({}, styleConditions[this.state.conditionIndex].style), value.style);
469
395
  Object.keys(styleConditions[this.state.conditionIndex].style).forEach(key => {
@@ -474,25 +400,21 @@ class DashboardsCellGlobalConditions extends _react.Component {
474
400
  } else {
475
401
  styleConditions[this.state.conditionIndex].style = {};
476
402
  }
477
-
478
403
  this.props.updateValue({
479
404
  styleConditions: styleConditions
480
405
  });
481
406
  }
482
-
483
407
  updateContent(value) {
484
- var contentConditions = JSON.parse(JSON.stringify(this.props.value.contentConditions));
408
+ const contentConditions = JSON.parse(JSON.stringify(this.props.value.contentConditions));
485
409
  contentConditions[this.state.conditionIndex].content = value.content;
486
410
  this.props.updateValue({
487
411
  contentConditions: contentConditions
488
412
  });
489
413
  }
490
-
491
414
  addCondition() {
492
- var conditions = JSON.parse(JSON.stringify(this.props.value));
493
- var typeCondition = '';
494
- var index = null;
495
-
415
+ const conditions = JSON.parse(JSON.stringify(this.props.value));
416
+ let typeCondition = '';
417
+ let index = null;
496
418
  if (this.state.tabIndex === 0) {
497
419
  conditions.styleConditions.push({
498
420
  condition: '1 > 0',
@@ -512,7 +434,6 @@ class DashboardsCellGlobalConditions extends _react.Component {
512
434
  index = conditions.contentConditions.length - 1;
513
435
  typeCondition = 'content';
514
436
  }
515
-
516
437
  this.props.updateValue({
517
438
  styleConditions: conditions.styleConditions,
518
439
  contentConditions: conditions.contentConditions
@@ -523,10 +444,9 @@ class DashboardsCellGlobalConditions extends _react.Component {
523
444
  typeCondition: typeCondition
524
445
  });
525
446
  }
526
-
527
447
  copyCondition(condition) {
528
- var conditions = JSON.parse(JSON.stringify(this.props.value));
529
- var newCondition = JSON.parse(JSON.stringify(condition));
448
+ const conditions = JSON.parse(JSON.stringify(this.props.value));
449
+ const newCondition = JSON.parse(JSON.stringify(condition));
530
450
  delete newCondition.index;
531
451
  conditions[this.state.tabIndex === 0 ? 'styleConditions' : 'contentConditions'].push(newCondition);
532
452
  this.props.updateValue({
@@ -538,9 +458,8 @@ class DashboardsCellGlobalConditions extends _react.Component {
538
458
  advanced: false
539
459
  }));
540
460
  }
541
-
542
461
  deleteCondition(index) {
543
- var conditions = JSON.parse(JSON.stringify(this.props.value));
462
+ const conditions = JSON.parse(JSON.stringify(this.props.value));
544
463
  conditions[this.state.tabIndex === 0 ? 'styleConditions' : 'contentConditions'].splice(Number(index), 1);
545
464
  this.props.updateValue({
546
465
  styleConditions: conditions.styleConditions,
@@ -551,14 +470,9 @@ class DashboardsCellGlobalConditions extends _react.Component {
551
470
  advanced: false
552
471
  });
553
472
  }
554
-
555
473
  moveCondition(index, direction) {
556
- var conditions = JSON.parse(JSON.stringify(this.props.value));
557
-
558
- var _conditions$splice = conditions[this.state.tabIndex === 0 ? 'styleConditions' : 'contentConditions'].splice(Number(index), 1),
559
- _conditions$splice2 = _slicedToArray(_conditions$splice, 1),
560
- removed = _conditions$splice2[0];
561
-
474
+ const conditions = JSON.parse(JSON.stringify(this.props.value));
475
+ const [removed] = conditions[this.state.tabIndex === 0 ? 'styleConditions' : 'contentConditions'].splice(Number(index), 1);
562
476
  conditions[this.state.tabIndex === 0 ? 'styleConditions' : 'contentConditions'].splice(Number(index) + direction, 0, removed);
563
477
  this.props.updateValue({
564
478
  styleConditions: conditions.styleConditions,
@@ -569,17 +483,20 @@ class DashboardsCellGlobalConditions extends _react.Component {
569
483
  advanced: false
570
484
  });
571
485
  }
572
-
573
486
  renderConditionCard(obj) {
574
- var item = obj.item,
575
- handler = obj.handler;
576
- var _this$props = this.props,
577
- classes = _this$props.classes,
578
- intl = _this$props.intl;
579
- var _this$state = this.state,
580
- tabIndex = _this$state.tabIndex,
581
- conditionIndex = _this$state.conditionIndex;
582
- var divStyle = {
487
+ const {
488
+ item,
489
+ handler
490
+ } = obj;
491
+ const {
492
+ classes,
493
+ intl
494
+ } = this.props;
495
+ const {
496
+ tabIndex,
497
+ conditionIndex
498
+ } = this.state;
499
+ const divStyle = {
583
500
  border: '1px solid black',
584
501
  padding: 10,
585
502
  margin: 2,
@@ -617,39 +534,38 @@ class DashboardsCellGlobalConditions extends _react.Component {
617
534
  }
618
535
  }, /*#__PURE__*/_react.default.createElement(_MoreVert.default, null)));
619
536
  }
620
-
621
537
  renderConditionProperties() {
622
- var conditionIndex = this.state.conditionIndex;
538
+ const {
539
+ conditionIndex
540
+ } = this.state;
623
541
  return /*#__PURE__*/_react.default.createElement(_Paper.default, null, "Properties go here");
624
542
  }
625
-
626
543
  render() {
627
- var _this$props2 = this.props,
628
- classes = _this$props2.classes,
629
- intl = _this$props2.intl,
630
- value = _this$props2.value,
631
- images = _this$props2.images,
632
- styles = _this$props2.styles,
633
- widgets = _this$props2.widgets,
634
- variables = _this$props2.variables;
635
- var _this$state2 = this.state,
636
- open = _this$state2.open,
637
- tabIndex = _this$state2.tabIndex,
638
- conditionIndex = _this$state2.conditionIndex,
639
- menuIndex = _this$state2.menuIndex,
640
- menuAnchorEl = _this$state2.menuAnchorEl,
641
- advanced = _this$state2.advanced,
642
- styleColumns = _this$state2.styleColumns,
643
- conditionColumns = _this$state2.conditionColumns;
644
- var currentCondition = null;
645
-
544
+ const {
545
+ classes,
546
+ intl,
547
+ value,
548
+ images,
549
+ styles,
550
+ widgets,
551
+ variables
552
+ } = this.props;
553
+ const {
554
+ open,
555
+ tabIndex,
556
+ conditionIndex,
557
+ menuIndex,
558
+ menuAnchorEl,
559
+ advanced,
560
+ styleColumns,
561
+ conditionColumns
562
+ } = this.state;
563
+ let currentCondition = null;
646
564
  if (conditionIndex !== null) {
647
565
  currentCondition = tabIndex === 0 ? value.styleConditions[conditionIndex] : value.contentConditions[conditionIndex];
648
566
  }
649
-
650
- var totalConditions = value.styleConditions.length + value.contentConditions.length;
651
- var nestItems = [];
652
-
567
+ const totalConditions = value.styleConditions.length + value.contentConditions.length;
568
+ const nestItems = [];
653
569
  if (tabIndex === 0) {
654
570
  value.styleConditions.forEach((condition, index) => {
655
571
  nestItems.push(_objectSpread(_objectSpread({}, condition), {}, {
@@ -663,7 +579,6 @@ class DashboardsCellGlobalConditions extends _react.Component {
663
579
  }));
664
580
  });
665
581
  }
666
-
667
582
  return /*#__PURE__*/_react.default.createElement(_Grid.default, {
668
583
  xs: 6,
669
584
  item: true
@@ -902,9 +817,7 @@ class DashboardsCellGlobalConditions extends _react.Component {
902
817
  id: "__delete"
903
818
  })))));
904
819
  }
905
-
906
820
  }
907
-
908
821
  DashboardsCellGlobalConditions.propTypes = {
909
822
  classes: _propTypes.default.shape().isRequired,
910
823
  intl: _propTypes.default.shape().isRequired,
@@ -921,7 +834,4 @@ DashboardsCellGlobalConditions.defaultProps = {
921
834
  widgets: [],
922
835
  variables: []
923
836
  };
924
-
925
- var _default = (0, _reactIntl.injectIntl)((0, _styles.withStyles)(muiStyles)(DashboardsCellGlobalConditions));
926
-
927
- exports.default = _default;
837
+ var _default = exports.default = (0, _reactIntl.injectIntl)((0, _styles.withStyles)(muiStyles)(DashboardsCellGlobalConditions));