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,94 +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 _Fab = _interopRequireDefault(require("@material-ui/core/Fab"));
35
-
36
21
  var _SettingsOutlined = _interopRequireDefault(require("@material-ui/icons/SettingsOutlined"));
37
-
38
22
  var _ArrowDownward = _interopRequireDefault(require("@material-ui/icons/ArrowDownward"));
39
-
40
23
  var _ArrowUpward = _interopRequireDefault(require("@material-ui/icons/ArrowUpward"));
41
-
42
24
  var _FileCopy = _interopRequireDefault(require("@material-ui/icons/FileCopy"));
43
-
44
25
  var _Settings = _interopRequireDefault(require("@material-ui/icons/Settings"));
45
-
46
26
  var _Delete = _interopRequireDefault(require("@material-ui/icons/Delete"));
47
-
48
27
  var _Add = _interopRequireDefault(require("@material-ui/icons/Add"));
49
-
50
28
  var _reactIntl = require("react-intl");
51
-
52
29
  var _versacallCoreLibraryReact = require("versacall-core-library-react");
53
-
54
30
  var _DashboardsCellGlobalStyles = _interopRequireDefault(require("../DashboardsCellGlobalStyles"));
55
-
56
31
  var _DashboardsCellContent = _interopRequireDefault(require("../DashboardsCellContent"));
57
-
58
32
  var _DashboardsCellStyle = _interopRequireDefault(require("../DashboardsCellStyle"));
59
-
60
33
  var _DashboardsPreview = _interopRequireDefault(require("../DashboardsPreview"));
61
-
62
34
  var _DashboardsCell = _interopRequireDefault(require("../DashboardsCell"));
63
-
64
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
65
-
66
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
67
-
68
- 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; }
69
-
70
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
71
-
72
- 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."); }
73
-
74
- 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); }
75
-
76
- 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; }
77
-
78
- 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; }
79
-
80
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
81
-
82
- 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; }
83
-
84
- 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; }
85
-
86
- 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; }
87
-
88
- var muiStyles = () => ({
35
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
36
+ 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); }
37
+ 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; }
38
+ 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; }
39
+ 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; }
40
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
41
+ 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); }
42
+ const muiStyles = () => ({
89
43
  dialog: {
90
44
  backgroundColor: '#eff4f8'
91
45
  }
92
46
  });
93
-
94
- var style = {
47
+ const style = {
95
48
  root: {
96
49
  position: 'relative',
97
50
  display: 'flex',
@@ -155,7 +108,7 @@ var style = {
155
108
  textTransform: 'uppercase'
156
109
  }
157
110
  };
158
- var operatorOptions = [{
111
+ const operatorOptions = [{
159
112
  value: '===',
160
113
  label: '='
161
114
  }, {
@@ -174,47 +127,45 @@ var operatorOptions = [{
174
127
  value: '<=',
175
128
  label: "".concat(String.fromCharCode(0x2264))
176
129
  }];
177
-
178
- var tabStyle = active => ({
130
+ const tabStyle = active => ({
179
131
  border: active ? '2px solid #008bcc' : '',
180
132
  borderRadius: '3px'
181
133
  });
182
-
183
- var contentPreviewCustomCell = ({
184
- row
185
- }) => /*#__PURE__*/_react.default.createElement("div", {
186
- style: {
187
- width: 120
188
- }
189
- }, /*#__PURE__*/_react.default.createElement(_DashboardsPreview.default, {
190
- width: "120px",
191
- height: "100px",
192
- padding: "10px"
193
- }, /*#__PURE__*/_react.default.createElement(_DashboardsCell.default, {
194
- cell: {
195
- content: row.content,
196
- custom: {
197
- viewWidth: 120,
198
- viewHeight: 100,
199
- style: {}
134
+ const contentPreviewCustomCell = _ref => {
135
+ let {
136
+ row
137
+ } = _ref;
138
+ return /*#__PURE__*/_react.default.createElement("div", {
139
+ style: {
140
+ width: 120
200
141
  }
201
- }
202
- })));
203
-
204
- var conditionCustomCell = ({
205
- row
206
- }) => {
207
- var newCondition = row.condition;
208
-
142
+ }, /*#__PURE__*/_react.default.createElement(_DashboardsPreview.default, {
143
+ width: "120px",
144
+ height: "100px",
145
+ padding: "10px"
146
+ }, /*#__PURE__*/_react.default.createElement(_DashboardsCell.default, {
147
+ cell: {
148
+ content: row.content,
149
+ custom: {
150
+ viewWidth: 120,
151
+ viewHeight: 100,
152
+ style: {}
153
+ }
154
+ }
155
+ })));
156
+ };
157
+ const conditionCustomCell = _ref2 => {
158
+ let {
159
+ row
160
+ } = _ref2;
161
+ let newCondition = row.condition;
209
162
  if (newCondition.split(' ').length === 3) {
210
163
  operatorOptions.forEach(option => {
211
164
  newCondition = newCondition.replace(new RegExp(option.value, 'g'), option.label);
212
165
  });
213
166
  }
214
-
215
167
  return newCondition;
216
168
  };
217
-
218
169
  class DashboardsCellGlobalConditions extends _react.Component {
219
170
  constructor(props) {
220
171
  super(props);
@@ -291,33 +242,24 @@ class DashboardsCellGlobalConditions extends _react.Component {
291
242
  }]
292
243
  };
293
244
  }
294
-
295
- stylePreviewCustomCell({
296
- row
297
- }) {
298
- var _this = this;
299
-
300
- var newCell = JSON.parse(JSON.stringify(row));
245
+ stylePreviewCustomCell(_ref3) {
246
+ let {
247
+ row
248
+ } = _ref3;
249
+ const newCell = JSON.parse(JSON.stringify(row));
301
250
  newCell.custom = {
302
251
  viewWidth: 120,
303
252
  viewHeight: 120,
304
253
  style: {}
305
254
  };
306
-
307
255
  if (this.props.styles.length > 0 && row.styleIds.length > 0) {
308
- var _loop = function _loop(i) {
309
- var findStyle = _this.props.styles.find(searchStyle => searchStyle.id === newCell.styleIds[i]);
310
-
256
+ for (let i = 0; i < newCell.styleIds.length; i++) {
257
+ const findStyle = this.props.styles.find(searchStyle => searchStyle.id === newCell.styleIds[i]);
311
258
  if (findStyle) {
312
259
  newCell.custom.style = _objectSpread(_objectSpread({}, newCell.custom.style), findStyle.options);
313
260
  }
314
- };
315
-
316
- for (var i = 0; i < newCell.styleIds.length; i++) {
317
- _loop(i);
318
261
  }
319
262
  }
320
-
321
263
  newCell.custom.style = _objectSpread(_objectSpread({}, newCell.custom.style), newCell.style);
322
264
  return /*#__PURE__*/_react.default.createElement("div", {
323
265
  style: {
@@ -337,18 +279,18 @@ class DashboardsCellGlobalConditions extends _react.Component {
337
279
  }
338
280
  })));
339
281
  }
340
-
341
- contentTypeCustomCell({
342
- row
343
- }) {
282
+ contentTypeCustomCell(_ref4) {
283
+ let {
284
+ row
285
+ } = _ref4;
344
286
  return /*#__PURE__*/_react.default.createElement("span", null, this.props.intl.formatMessage({
345
287
  id: "__".concat(row.content.type)
346
288
  }));
347
289
  }
348
-
349
- actionsCustomCell({
350
- row
351
- }) {
290
+ actionsCustomCell(_ref5) {
291
+ let {
292
+ row
293
+ } = _ref5;
352
294
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, row.index !== '0' && /*#__PURE__*/_react.default.createElement(_IconButton.default, {
353
295
  onClick: e => {
354
296
  e.stopPropagation();
@@ -379,50 +321,40 @@ class DashboardsCellGlobalConditions extends _react.Component {
379
321
  })
380
322
  }, /*#__PURE__*/_react.default.createElement(_Delete.default, null))));
381
323
  }
382
-
383
324
  updateCondition(change) {
384
- var conditions = JSON.parse(JSON.stringify(this.props.value["".concat(this.state.typeCondition, "Conditions")]));
385
-
325
+ const conditions = JSON.parse(JSON.stringify(this.props.value["".concat(this.state.typeCondition, "Conditions")]));
386
326
  if (this.state.advanced) {
387
327
  conditions[this.state.conditionIndex].condition = change.value;
388
328
  } else {
389
- var split = conditions[this.state.conditionIndex].condition.split(/[ ,]+/);
390
-
329
+ const split = conditions[this.state.conditionIndex].condition.split(/[ ,]+/);
391
330
  switch (change.stringIndex) {
392
331
  case 0:
393
332
  conditions[this.state.conditionIndex].condition = "".concat(change.value, " ").concat(split[1], " ").concat(split[2]);
394
333
  break;
395
-
396
334
  case 1:
397
335
  conditions[this.state.conditionIndex].condition = "".concat(split[0], " ").concat(change.value, " ").concat(split[2]);
398
336
  break;
399
-
400
337
  case 2:
401
338
  conditions[this.state.conditionIndex].condition = "".concat(split[0], " ").concat(split[1], " ").concat(change.value);
402
339
  break;
403
-
404
340
  default:
405
341
  conditions[this.state.conditionIndex].condition = '1 > 0';
406
342
  break;
407
343
  }
408
344
  }
409
-
410
345
  this.props.updateValue({
411
346
  ["".concat(this.state.typeCondition, "Conditions")]: conditions
412
347
  });
413
348
  }
414
-
415
349
  updateStyleIds(value) {
416
- var styleConditions = JSON.parse(JSON.stringify(this.props.value.styleConditions));
350
+ const styleConditions = JSON.parse(JSON.stringify(this.props.value.styleConditions));
417
351
  styleConditions[this.state.conditionIndex].styleIds = value.styleIds;
418
352
  this.props.updateValue({
419
353
  styleConditions: styleConditions
420
354
  });
421
355
  }
422
-
423
356
  updateStyle(value) {
424
- var styleConditions = JSON.parse(JSON.stringify(this.props.value.styleConditions));
425
-
357
+ const styleConditions = JSON.parse(JSON.stringify(this.props.value.styleConditions));
426
358
  if (Object.keys(value.style).length > 0) {
427
359
  styleConditions[this.state.conditionIndex].style = _objectSpread(_objectSpread({}, styleConditions[this.state.conditionIndex].style), value.style);
428
360
  Object.keys(styleConditions[this.state.conditionIndex].style).forEach(key => {
@@ -433,25 +365,21 @@ class DashboardsCellGlobalConditions extends _react.Component {
433
365
  } else {
434
366
  styleConditions[this.state.conditionIndex].style = {};
435
367
  }
436
-
437
368
  this.props.updateValue({
438
369
  styleConditions: styleConditions
439
370
  });
440
371
  }
441
-
442
372
  updateContent(value) {
443
- var contentConditions = JSON.parse(JSON.stringify(this.props.value.contentConditions));
373
+ const contentConditions = JSON.parse(JSON.stringify(this.props.value.contentConditions));
444
374
  contentConditions[this.state.conditionIndex].content = value.content;
445
375
  this.props.updateValue({
446
376
  contentConditions: contentConditions
447
377
  });
448
378
  }
449
-
450
379
  addCondition() {
451
- var conditions = JSON.parse(JSON.stringify(this.props.value));
452
- var typeCondition = '';
453
- var index = null;
454
-
380
+ const conditions = JSON.parse(JSON.stringify(this.props.value));
381
+ let typeCondition = '';
382
+ let index = null;
455
383
  if (this.state.tabIndex === 0) {
456
384
  conditions.styleConditions.push({
457
385
  condition: '1 > 0',
@@ -471,7 +399,6 @@ class DashboardsCellGlobalConditions extends _react.Component {
471
399
  index = conditions.contentConditions.length - 1;
472
400
  typeCondition = 'content';
473
401
  }
474
-
475
402
  this.props.updateValue({
476
403
  styleConditions: conditions.styleConditions,
477
404
  contentConditions: conditions.contentConditions
@@ -482,10 +409,9 @@ class DashboardsCellGlobalConditions extends _react.Component {
482
409
  typeCondition: typeCondition
483
410
  });
484
411
  }
485
-
486
412
  copyCondition(condition) {
487
- var conditions = JSON.parse(JSON.stringify(this.props.value));
488
- var newCondition = JSON.parse(JSON.stringify(condition));
413
+ const conditions = JSON.parse(JSON.stringify(this.props.value));
414
+ const newCondition = JSON.parse(JSON.stringify(condition));
489
415
  delete newCondition.index;
490
416
  conditions[this.state.tabIndex === 0 ? 'styleConditions' : 'contentConditions'].push(newCondition);
491
417
  this.props.updateValue({
@@ -497,9 +423,8 @@ class DashboardsCellGlobalConditions extends _react.Component {
497
423
  advanced: false
498
424
  }));
499
425
  }
500
-
501
426
  deleteCondition(index) {
502
- var conditions = JSON.parse(JSON.stringify(this.props.value));
427
+ const conditions = JSON.parse(JSON.stringify(this.props.value));
503
428
  conditions[this.state.tabIndex === 0 ? 'styleConditions' : 'contentConditions'].splice(Number(index), 1);
504
429
  this.props.updateValue({
505
430
  styleConditions: conditions.styleConditions,
@@ -510,14 +435,9 @@ class DashboardsCellGlobalConditions extends _react.Component {
510
435
  advanced: false
511
436
  });
512
437
  }
513
-
514
438
  moveCondition(index, direction) {
515
- var conditions = JSON.parse(JSON.stringify(this.props.value));
516
-
517
- var _conditions$splice = conditions[this.state.tabIndex === 0 ? 'styleConditions' : 'contentConditions'].splice(Number(index), 1),
518
- _conditions$splice2 = _slicedToArray(_conditions$splice, 1),
519
- removed = _conditions$splice2[0];
520
-
439
+ const conditions = JSON.parse(JSON.stringify(this.props.value));
440
+ const [removed] = conditions[this.state.tabIndex === 0 ? 'styleConditions' : 'contentConditions'].splice(Number(index), 1);
521
441
  conditions[this.state.tabIndex === 0 ? 'styleConditions' : 'contentConditions'].splice(Number(index) + direction, 0, removed);
522
442
  this.props.updateValue({
523
443
  styleConditions: conditions.styleConditions,
@@ -528,30 +448,29 @@ class DashboardsCellGlobalConditions extends _react.Component {
528
448
  advanced: false
529
449
  });
530
450
  }
531
-
532
451
  render() {
533
- var _this$props = this.props,
534
- classes = _this$props.classes,
535
- intl = _this$props.intl,
536
- value = _this$props.value,
537
- images = _this$props.images,
538
- styles = _this$props.styles,
539
- widgets = _this$props.widgets,
540
- variables = _this$props.variables;
541
- var _this$state = this.state,
542
- open = _this$state.open,
543
- tabIndex = _this$state.tabIndex,
544
- conditionIndex = _this$state.conditionIndex,
545
- advanced = _this$state.advanced,
546
- styleColumns = _this$state.styleColumns,
547
- conditionColumns = _this$state.conditionColumns;
548
- var currentCondition = null;
549
-
452
+ const {
453
+ classes,
454
+ intl,
455
+ value,
456
+ images,
457
+ styles,
458
+ widgets,
459
+ variables
460
+ } = this.props;
461
+ const {
462
+ open,
463
+ tabIndex,
464
+ conditionIndex,
465
+ advanced,
466
+ styleColumns,
467
+ conditionColumns
468
+ } = this.state;
469
+ let currentCondition = null;
550
470
  if (conditionIndex) {
551
471
  currentCondition = tabIndex === 0 ? value.styleConditions[conditionIndex] : value.contentConditions[conditionIndex];
552
472
  }
553
-
554
- var totalConditions = value.styleConditions.length + value.contentConditions.length;
473
+ const totalConditions = value.styleConditions.length + value.contentConditions.length;
555
474
  return /*#__PURE__*/_react.default.createElement(_Grid.default, {
556
475
  xs: 6,
557
476
  item: true
@@ -641,7 +560,7 @@ class DashboardsCellGlobalConditions extends _react.Component {
641
560
  activeRow: conditionIndex,
642
561
  columns: tabIndex === 0 ? styleColumns : conditionColumns,
643
562
  onRowClick: row => {
644
- var currentConditionCheck = tabIndex === 0 ? value.styleConditions[row.index] : value.contentConditions[row.index];
563
+ const currentConditionCheck = tabIndex === 0 ? value.styleConditions[row.index] : value.contentConditions[row.index];
645
564
  this.setState({
646
565
  conditionIndex: row.index,
647
566
  advanced: currentConditionCheck.condition.split(' ').length !== 3,
@@ -791,9 +710,7 @@ class DashboardsCellGlobalConditions extends _react.Component {
791
710
  updateValue: content => this.updateContent(content)
792
711
  })))))))))));
793
712
  }
794
-
795
713
  }
796
-
797
714
  DashboardsCellGlobalConditions.propTypes = {
798
715
  classes: _propTypes.default.shape().isRequired,
799
716
  intl: _propTypes.default.shape().isRequired,
@@ -810,7 +727,4 @@ DashboardsCellGlobalConditions.defaultProps = {
810
727
  widgets: [],
811
728
  variables: []
812
729
  };
813
-
814
- var _default = (0, _reactIntl.injectIntl)((0, _styles.withStyles)(muiStyles)(DashboardsCellGlobalConditions));
815
-
816
- exports.default = _default;
730
+ var _default = exports.default = (0, _reactIntl.injectIntl)((0, _styles.withStyles)(muiStyles)(DashboardsCellGlobalConditions));
@@ -5,11 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  Object.defineProperty(exports, "default", {
7
7
  enumerable: true,
8
- get: function get() {
8
+ get: function () {
9
9
  return _DashboardsCellGlobalConditions.default;
10
10
  }
11
11
  });
12
-
13
12
  var _DashboardsCellGlobalConditions = _interopRequireDefault(require("./DashboardsCellGlobalConditions"));
14
-
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }