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,29 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _versacallCoreLibraryReact = require("versacall-core-library-react");
11
-
12
9
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
- 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; }
17
-
18
- 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; }
19
-
20
- 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; }
21
-
22
- function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
23
-
24
- 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); }
25
-
26
- 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; }
27
-
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ 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; }
12
+ 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; }
13
+ 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; }
14
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
15
+ 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); }
28
16
  // import BackgroundTransparencyImage from '../../images/BackgroundTransparency.png';
29
- var style = {
17
+
18
+ const style = {
30
19
  root: {
31
20
  display: 'block',
32
21
  boxSizing: 'border-box',
@@ -39,106 +28,83 @@ var style = {
39
28
  height: '100%'
40
29
  }
41
30
  };
42
-
43
31
  function formatAnimationName(name) {
44
32
  /* let nameAdjusted = name.split(' ').join('_');
45
33
  nameAdjusted = nameAdjusted.toLowerCase();
46
34
  nameAdjusted = nameAdjusted.split('');
47
35
  let newName = '';
48
36
  nameAdjusted.forEach(character => { if (/[a-z0-9_]+/.exec(character) !== null) newName += character; }); */
49
- var code = '';
50
- var addUnderscore = false;
51
- var haveLetterOrDigit = false; // const isLetter = char => (/[a-zA-Z]+/.exec(char) !== null);
52
- // const isDigit = char => (/[0-9]+/.exec(char) !== null);
37
+ let code = '';
38
+ let addUnderscore = false;
39
+ let haveLetterOrDigit = false;
53
40
 
54
- var isLetterOrDigit = char => /[a-zA-Z0-9]+/.exec(char) !== null; // eslint-disable-next-line no-restricted-syntax
55
-
56
-
57
- var _iterator = _createForOfIteratorHelper(name),
58
- _step;
59
-
60
- try {
61
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
62
- var char = _step.value;
63
-
64
- if (isLetterOrDigit(char)) {
65
- haveLetterOrDigit = true;
66
-
67
- if (addUnderscore) {
68
- addUnderscore = false;
69
- code += '_';
70
- }
71
-
72
- code += char;
73
- } else if (haveLetterOrDigit) {
74
- addUnderscore = true;
41
+ // const isLetter = char => (/[a-zA-Z]+/.exec(char) !== null);
42
+ // const isDigit = char => (/[0-9]+/.exec(char) !== null);
43
+ const isLetterOrDigit = char => /[a-zA-Z0-9]+/.exec(char) !== null;
44
+
45
+ // eslint-disable-next-line no-restricted-syntax
46
+ for (const char of name) {
47
+ if (isLetterOrDigit(char)) {
48
+ haveLetterOrDigit = true;
49
+ if (addUnderscore) {
50
+ addUnderscore = false;
51
+ code += '_';
75
52
  }
53
+ code += char;
54
+ } else if (haveLetterOrDigit) {
55
+ addUnderscore = true;
76
56
  }
77
- } catch (err) {
78
- _iterator.e(err);
79
- } finally {
80
- _iterator.f();
81
57
  }
82
-
83
58
  return code.toLowerCase();
84
59
  }
85
-
86
60
  function DashboardsCell(props) {
87
- var widget = props.widget,
88
- viewer = props.viewer,
89
- cell = props.cell,
90
- core = props.core,
91
- showEditor = props.showEditor;
92
-
93
- var spanStyle = _objectSpread(_objectSpread({}, style.root), {}, {
61
+ const {
62
+ widget,
63
+ viewer,
64
+ cell,
65
+ core,
66
+ showEditor
67
+ } = props;
68
+ const spanStyle = _objectSpread(_objectSpread({}, style.root), {}, {
94
69
  gridColumn: "span ".concat(cell.columnSpan),
95
70
  gridRow: "span ".concat(cell.rowSpan)
96
71
  });
97
-
98
- var styles = _objectSpread({}, cell.custom.style);
99
-
100
- var backgroundColorFadeStyle = {}; // NOTE: Definitely don't want this when viewing... It is debatable if we want it will editing. Could
72
+ const styles = _objectSpread({}, cell.custom.style);
73
+ let backgroundColorFadeStyle = {};
74
+ // NOTE: Definitely don't want this when viewing... It is debatable if we want it will editing. Could
101
75
  // through an "&& showEditor" in the below condition if we want it to show in edit mode.
102
-
103
76
  /* if (!styles.backgroundColor) {
104
77
  styles.backgroundImage = `url(${BackgroundTransparencyImage})`;
105
78
  } */
106
-
107
79
  if (styles.backgroundColor && styles.backgroundColorFade && styles.backgroundColorFade !== 'none') {
108
80
  // const name = `backgroundColorFade${styles.backgroundColor.replace(/[., ()]+/g, '')}${styles.backgroundColorFade.replace(/[., ()]+/g, '')}`;
109
- var name = formatAnimationName("backgroundColorFade_".concat(styles.backgroundColor, "_").concat(styles.backgroundColorFade));
110
- var canAddRule = true;
111
-
112
- for (var i = 0; i < document.styleSheets[0].cssRules.length; i++) {
81
+ const name = formatAnimationName("backgroundColorFade_".concat(styles.backgroundColor, "_").concat(styles.backgroundColorFade));
82
+ let canAddRule = true;
83
+ for (let i = 0; i < document.styleSheets[0].cssRules.length; i++) {
113
84
  if (document.styleSheets[0].cssRules[i].name === name) {
114
85
  canAddRule = false;
115
86
  break;
116
87
  }
117
88
  }
118
-
119
89
  if (canAddRule) {
120
90
  document.styleSheets[0].insertRule("@-webkit-keyframes ".concat(name, " {\n 0% {\n background-color: ").concat(styles.backgroundColor, ";\n }\n 50% {\n background-color: ").concat(styles.backgroundColorFade, ";\n }\n 100% {\n background-color: ").concat(styles.backgroundColor, ";\n }\n }"), document.styleSheets[0].cssRules.length);
121
91
  }
122
-
123
92
  backgroundColorFadeStyle = {
124
93
  animationName: name,
125
94
  animationDuration: styles.fadeDuration ? styles.fadeDuration : '1s',
126
95
  animationIterationCount: 'infinite'
127
96
  };
128
97
  }
129
-
130
- var prepareMainStyle = _objectSpread(_objectSpread(_objectSpread({}, style.root), {}, {
98
+ const prepareMainStyle = _objectSpread(_objectSpread(_objectSpread({}, style.root), {}, {
131
99
  borderWidth: (cell.custom.viewWidth <= cell.custom.viewHeight ? cell.custom.viewWidth : cell.custom.viewHeight) / 200 * Number(styles.borderSize ? styles.borderSize : 2)
132
100
  }, backgroundColorFadeStyle), {}, {
133
101
  padding: "".concat(styles.paddingVertical ? cell.custom.viewHeight / 200 * styles.paddingVertical : 0, "px ").concat(styles.paddingHorizontal ? cell.custom.viewWidth / 200 * styles.paddingHorizontal : 0, "px"),
134
102
  fontSize: styles.fontSize ? styles.fontSize : '12%'
135
103
  });
136
-
137
104
  if (cell.content.type !== 'text') {
138
105
  prepareMainStyle.fontSize = '0%';
139
106
  }
140
-
141
- var flexStyle = {
107
+ const flexStyle = {
142
108
  display: 'flex',
143
109
  width: '100%',
144
110
  height: '100%',
@@ -146,33 +112,27 @@ function DashboardsCell(props) {
146
112
  justifyContent: styles.justifyContent ? styles.justifyContent : 'flex-start',
147
113
  alignItems: styles.alignItems ? styles.alignItems : 'flex-start'
148
114
  };
149
- var colorFadeStyle = {};
150
-
115
+ let colorFadeStyle = {};
151
116
  if (styles.color && styles.colorFade && styles.colorFade !== 'none') {
152
117
  // const name = `colorFade${styles.color.replace(/[., ()]+/g, '')}${styles.colorFade.replace(/[., ()]+/g, '')}`;
153
- var _name = formatAnimationName("colorFade_".concat(styles.color, "_").concat(styles.colorFade));
154
-
155
- var _canAddRule = true;
156
-
157
- for (var _i = 0; _i < document.styleSheets[0].cssRules.length; _i++) {
158
- if (document.styleSheets[0].cssRules[_i].name === _name) {
159
- _canAddRule = false;
118
+ const name = formatAnimationName("colorFade_".concat(styles.color, "_").concat(styles.colorFade));
119
+ let canAddRule = true;
120
+ for (let i = 0; i < document.styleSheets[0].cssRules.length; i++) {
121
+ if (document.styleSheets[0].cssRules[i].name === name) {
122
+ canAddRule = false;
160
123
  break;
161
124
  }
162
125
  }
163
-
164
- if (_canAddRule) {
165
- document.styleSheets[0].insertRule("@-webkit-keyframes ".concat(_name, " {\n 0% {\n color: ").concat(styles.color, ";\n }\n 50% {\n color: ").concat(styles.colorFade, ";\n }\n 100% {\n color: ").concat(styles.color, ";\n }\n }"), document.styleSheets[0].cssRules.length);
126
+ if (canAddRule) {
127
+ document.styleSheets[0].insertRule("@-webkit-keyframes ".concat(name, " {\n 0% {\n color: ").concat(styles.color, ";\n }\n 50% {\n color: ").concat(styles.colorFade, ";\n }\n 100% {\n color: ").concat(styles.color, ";\n }\n }"), document.styleSheets[0].cssRules.length);
166
128
  }
167
-
168
129
  colorFadeStyle = {
169
- animationName: _name,
130
+ animationName: name,
170
131
  animationDuration: styles.fadeDuration ? styles.fadeDuration : '1s',
171
132
  animationIterationCount: 'infinite'
172
133
  };
173
134
  }
174
-
175
- var contentStyle = _objectSpread(_objectSpread({
135
+ const contentStyle = _objectSpread(_objectSpread({
176
136
  display: 'block',
177
137
  boxSizing: 'border-box',
178
138
  overflow: 'hidden',
@@ -183,22 +143,18 @@ function DashboardsCell(props) {
183
143
  height: cell.content.type === 'text' ? 'auto' : '100%',
184
144
  textAlign: 'left'
185
145
  });
186
-
187
146
  if (styles.justifyContent) {
188
147
  switch (styles.justifyContent) {
189
148
  case 'center':
190
149
  contentStyle.textAlign = 'center';
191
150
  break;
192
-
193
151
  case 'flex-end':
194
152
  contentStyle.textAlign = 'right';
195
153
  break;
196
-
197
154
  default:
198
155
  }
199
156
  }
200
-
201
- var imageStyle = {
157
+ const imageStyle = {
202
158
  width: '100%',
203
159
  height: '100%',
204
160
  objectFit: styles.objectFit ? styles.objectFit : 'none',
@@ -215,9 +171,7 @@ function DashboardsCell(props) {
215
171
  delete styles.colorFade;
216
172
  delete styles.textDecoration;
217
173
  delete styles.objectFit;
218
-
219
- var mainStyle = _objectSpread(_objectSpread({}, prepareMainStyle), styles);
220
-
174
+ const mainStyle = _objectSpread(_objectSpread({}, prepareMainStyle), styles);
221
175
  return /*#__PURE__*/_react.default.createElement("div", {
222
176
  style: spanStyle
223
177
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -248,7 +202,6 @@ function DashboardsCell(props) {
248
202
  withOrganization: true
249
203
  })))));
250
204
  }
251
-
252
205
  DashboardsCell.propTypes = {
253
206
  viewer: _propTypes.default.shape(),
254
207
  widget: _propTypes.default.shape(),
@@ -261,7 +214,4 @@ DashboardsCell.defaultProps = {
261
214
  widget: null,
262
215
  showEditor: false
263
216
  };
264
-
265
- var _default = (0, _versacallCoreLibraryReact.withCore)(DashboardsCell);
266
-
267
- exports.default = _default;
217
+ var _default = exports.default = (0, _versacallCoreLibraryReact.withCore)(DashboardsCell);
@@ -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 _DashboardsCell.default;
10
10
  }
11
11
  });
12
-
13
12
  var _DashboardsCell = _interopRequireDefault(require("./DashboardsCell"));
14
-
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -4,44 +4,29 @@ 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 _versacallCoreLibraryReact = require("versacall-core-library-react");
11
-
12
9
  var _Settings = _interopRequireDefault(require("@material-ui/icons/Settings"));
13
-
14
10
  var _TextField = _interopRequireDefault(require("@material-ui/core/TextField"));
15
-
16
11
  var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
17
-
18
12
  var _Dialog = _interopRequireDefault(require("@material-ui/core/Dialog"));
19
-
20
13
  var _Grid = _interopRequireDefault(require("@material-ui/core/Grid"));
21
-
22
14
  var _reactIntl = require("react-intl");
23
-
24
15
  var _propTypes = _interopRequireDefault(require("prop-types"));
25
-
26
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
-
28
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
29
-
30
- 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; }
31
-
32
- 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; }
33
-
34
- 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; }
35
-
36
- 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; }
37
-
38
- var style = {
16
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
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
+ const style = {
39
24
  widget: {
40
25
  width: '100%',
41
26
  height: '60vh',
42
- overflowY: 'auto' // minHeight: '60vh',
27
+ overflowY: 'auto'
28
+ // minHeight: '60vh',
43
29
  // maxHeight: '80vh',
44
-
45
30
  },
46
31
  styleBox: {
47
32
  position: 'relative',
@@ -68,7 +53,6 @@ var style = {
68
53
  borderColor: 'rgba(0, 0, 0, 0.54)'
69
54
  }
70
55
  };
71
-
72
56
  class DashboardsCellContent extends _react.Component {
73
57
  constructor(props) {
74
58
  super(props);
@@ -76,35 +60,28 @@ class DashboardsCellContent extends _react.Component {
76
60
  open: false
77
61
  };
78
62
  }
79
-
80
63
  updateType(type) {
81
- var value = {
64
+ const value = {
82
65
  content: {
83
66
  type: type
84
67
  }
85
68
  };
86
-
87
69
  switch (type) {
88
70
  case 'url':
89
71
  value.content.url = '';
90
72
  break;
91
-
92
73
  case 'image':
93
74
  value.content.id = '';
94
75
  break;
95
-
96
76
  case 'widget':
97
77
  value.content.id = '';
98
78
  value.content.properties = '';
99
79
  break;
100
-
101
80
  default:
102
81
  value.content.text = '';
103
82
  }
104
-
105
83
  this.props.updateValue(value);
106
84
  }
107
-
108
85
  updateWidget(widgetId) {
109
86
  this.props.updateValue({
110
87
  content: {
@@ -114,41 +91,37 @@ class DashboardsCellContent extends _react.Component {
114
91
  }
115
92
  });
116
93
  }
117
-
118
94
  updateProperties(value) {
119
- var newContent = JSON.parse(JSON.stringify(value));
120
-
95
+ const newContent = JSON.parse(JSON.stringify(value));
121
96
  if (Object.keys(newContent.content.properties).every(key => newContent.content.properties[key] === '')) {
122
97
  newContent.content.properties = '';
123
98
  } else {
124
99
  newContent.content.properties = JSON.stringify(newContent.content.properties);
125
100
  }
126
-
127
101
  this.props.updateValue(newContent);
128
102
  }
129
-
130
103
  render() {
131
- var _this$props = this.props,
132
- core = _this$props.core,
133
- intl = _this$props.intl,
134
- value = _this$props.value,
135
- images = _this$props.images,
136
- tags = _this$props.tags,
137
- widgets = _this$props.widgets,
138
- variables = _this$props.variables;
139
- var open = this.state.open;
140
- var currentWidget = null;
141
- var currentWidgetProperties = {};
142
-
104
+ const {
105
+ core,
106
+ intl,
107
+ value,
108
+ images,
109
+ tags,
110
+ widgets,
111
+ variables
112
+ } = this.props;
113
+ const {
114
+ open
115
+ } = this.state;
116
+ let currentWidget = null;
117
+ const currentWidgetProperties = {};
143
118
  if (value.type === 'widget' && value.id && open) {
144
119
  currentWidget = widgets.find(widget => widget.id === value.id);
145
-
146
120
  if (currentWidget) {
147
- var valueProperties = value.properties ? JSON.parse(value.properties) : {};
121
+ const valueProperties = value.properties ? JSON.parse(value.properties) : {};
148
122
  currentWidget.parameters.forEach(parameter => {
149
123
  if (valueProperties[parameter.name]) {
150
- var valueProperty = JSON.parse(JSON.stringify(valueProperties[parameter.name]));
151
-
124
+ const valueProperty = JSON.parse(JSON.stringify(valueProperties[parameter.name]));
152
125
  if (typeof valueProperty === 'object') {
153
126
  currentWidgetProperties[parameter.name] = parameter.type === 'tag' ? valueProperty : '';
154
127
  } else {
@@ -178,7 +151,6 @@ class DashboardsCellContent extends _react.Component {
178
151
  });
179
152
  }
180
153
  }
181
-
182
154
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Grid.default, {
183
155
  xs: 4,
184
156
  item: true
@@ -413,9 +385,7 @@ class DashboardsCellContent extends _react.Component {
413
385
  filter: currentWidgetProperties[parameter.name]
414
386
  })))))))))));
415
387
  }
416
-
417
388
  }
418
-
419
389
  DashboardsCellContent.propTypes = {
420
390
  tags: _propTypes.default.shape(),
421
391
  core: _propTypes.default.shape().isRequired,
@@ -432,7 +402,4 @@ DashboardsCellContent.defaultProps = {
432
402
  widgets: [],
433
403
  variables: []
434
404
  };
435
-
436
- var _default = (0, _versacallCoreLibraryReact.withCore)((0, _reactIntl.injectIntl)(DashboardsCellContent));
437
-
438
- exports.default = _default;
405
+ var _default = exports.default = (0, _versacallCoreLibraryReact.withCore)((0, _reactIntl.injectIntl)(DashboardsCellContent));
@@ -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 _DashboardsCellContent.default;
10
10
  }
11
11
  });
12
-
13
12
  var _DashboardsCellContent = _interopRequireDefault(require("./DashboardsCellContent"));
14
-
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -4,32 +4,18 @@ 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 _versacallCoreLibraryReact = require("versacall-core-library-react");
11
-
12
9
  var _FindReplace = _interopRequireDefault(require("@material-ui/icons/FindReplace"));
13
-
14
10
  var _IconButton = _interopRequireDefault(require("@material-ui/core/IconButton"));
15
-
16
11
  var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
17
-
18
12
  var _Dialog = _interopRequireDefault(require("@material-ui/core/Dialog"));
19
-
20
13
  var _Grid = _interopRequireDefault(require("@material-ui/core/Grid"));
21
-
22
14
  var _reactIntl = require("react-intl");
23
-
24
15
  var _propTypes = _interopRequireDefault(require("prop-types"));
25
-
26
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
-
28
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
29
-
30
- 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; }
31
-
32
- var style = {
16
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
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
+ const style = {
33
19
  root: {
34
20
  padding: 16
35
21
  },
@@ -37,13 +23,11 @@ var style = {
37
23
  textAlign: 'right'
38
24
  }
39
25
  };
40
-
41
26
  function replaceText(find, replace, text) {
42
- var newText = String(text);
27
+ let newText = String(text);
43
28
  newText = newText.replace(new RegExp(find), replace);
44
29
  return newText;
45
30
  }
46
-
47
31
  class DashboardsCellFindAndReplace extends _react.Component {
48
32
  constructor(props) {
49
33
  super(props);
@@ -53,59 +37,50 @@ class DashboardsCellFindAndReplace extends _react.Component {
53
37
  replace: ''
54
38
  };
55
39
  }
56
-
57
40
  updateValue() {
58
- var _this = this;
59
-
60
41
  if (this.props.updateValue) {
61
- var cells = JSON.parse(JSON.stringify(this.props.value));
42
+ let cells = JSON.parse(JSON.stringify(this.props.value));
62
43
  cells = cells.map(cell => {
63
- var newCell = JSON.parse(JSON.stringify(cell));
64
-
44
+ const newCell = JSON.parse(JSON.stringify(cell));
65
45
  if (newCell.content.type === 'text') {
66
46
  newCell.content.text = replaceText(this.state.find, this.state.replace, newCell.content.text);
67
47
  } else if (newCell.content.type === 'widget') {
68
- var newProperties = JSON.parse(newCell.content.properties);
48
+ const newProperties = JSON.parse(newCell.content.properties);
69
49
  Object.keys(newProperties).forEach(key => {
70
50
  newProperties[key] = replaceText(this.state.find, this.state.replace, newProperties[key]);
71
51
  });
72
52
  newCell.content.properties = JSON.stringify(newProperties);
73
53
  }
74
-
75
- for (var i = 0; i < newCell.styleConditions.length; i++) {
54
+ for (let i = 0; i < newCell.styleConditions.length; i++) {
76
55
  newCell.styleConditions[i].condition = replaceText(this.state.find, this.state.replace, newCell.styleConditions[i].condition);
77
56
  }
78
-
79
- for (var _i = 0; _i < newCell.contentConditions.length; _i++) {
80
- newCell.contentConditions[_i].condition = replaceText(this.state.find, this.state.replace, newCell.contentConditions[_i].condition);
81
-
82
- if (newCell.contentConditions[_i].content.type === 'text') {
83
- newCell.contentConditions[_i].content.text = replaceText(this.state.find, this.state.replace, newCell.contentConditions[_i].content.text);
57
+ for (let i = 0; i < newCell.contentConditions.length; i++) {
58
+ newCell.contentConditions[i].condition = replaceText(this.state.find, this.state.replace, newCell.contentConditions[i].condition);
59
+ if (newCell.contentConditions[i].content.type === 'text') {
60
+ newCell.contentConditions[i].content.text = replaceText(this.state.find, this.state.replace, newCell.contentConditions[i].content.text);
84
61
  } else if (newCell.content.type === 'widget') {
85
- (function () {
86
- var newProperties = JSON.parse(newCell.contentConditions[_i].content.properties);
87
- Object.keys(newProperties).forEach(key => {
88
- newProperties[key] = replaceText(_this.state.find, _this.state.replace, newProperties[key]);
89
- });
90
- newCell.contentConditions[_i].content.properties = JSON.stringify(newProperties);
91
- })();
62
+ const newProperties = JSON.parse(newCell.contentConditions[i].content.properties);
63
+ Object.keys(newProperties).forEach(key => {
64
+ newProperties[key] = replaceText(this.state.find, this.state.replace, newProperties[key]);
65
+ });
66
+ newCell.contentConditions[i].content.properties = JSON.stringify(newProperties);
92
67
  }
93
68
  }
94
-
95
69
  return newCell;
96
70
  });
97
71
  this.props.updateValue(cells);
98
72
  }
99
73
  }
100
-
101
74
  render() {
102
- var _this$props = this.props,
103
- variables = _this$props.variables,
104
- intl = _this$props.intl;
105
- var _this$state = this.state,
106
- open = _this$state.open,
107
- find = _this$state.find,
108
- replace = _this$state.replace;
75
+ const {
76
+ variables,
77
+ intl
78
+ } = this.props;
79
+ const {
80
+ open,
81
+ find,
82
+ replace
83
+ } = this.state;
109
84
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
110
85
  onClick: () => this.setState({
111
86
  open: true
@@ -175,16 +150,11 @@ class DashboardsCellFindAndReplace extends _react.Component {
175
150
  id: '__replace'
176
151
  })))))));
177
152
  }
178
-
179
153
  }
180
-
181
154
  DashboardsCellFindAndReplace.propTypes = {
182
155
  intl: _propTypes.default.shape().isRequired,
183
156
  updateValue: _propTypes.default.func.isRequired,
184
157
  value: _propTypes.default.arrayOf(_propTypes.default.shape()).isRequired,
185
158
  variables: _propTypes.default.arrayOf(_propTypes.default.shape()).isRequired
186
159
  };
187
-
188
- var _default = (0, _reactIntl.injectIntl)(DashboardsCellFindAndReplace);
189
-
190
- exports.default = _default;
160
+ var _default = exports.default = (0, _reactIntl.injectIntl)(DashboardsCellFindAndReplace);