versacall-dashboards-library-react 2.0.39 → 2.0.40

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 (102) hide show
  1. package/package.json +2 -2
  2. package/dist/components/DashboardsCell/DashboardsCell.js +0 -267
  3. package/dist/components/DashboardsCell/index.js +0 -15
  4. package/dist/components/DashboardsCellContent/DashboardsCellContent.js +0 -438
  5. package/dist/components/DashboardsCellContent/index.js +0 -15
  6. package/dist/components/DashboardsCellFindAndReplace/DashboardsCellFindAndReplace.js +0 -190
  7. package/dist/components/DashboardsCellFindAndReplace/index.js +0 -15
  8. package/dist/components/DashboardsCellGlobalActions/DashboardsCellGlobalActions.js +0 -218
  9. package/dist/components/DashboardsCellGlobalActions/index.js +0 -15
  10. package/dist/components/DashboardsCellGlobalConditions/DashboardsCellGlobalConditions.js +0 -1043
  11. package/dist/components/DashboardsCellGlobalConditions/DashboardsCellGlobalConditionsNestable.js +0 -927
  12. package/dist/components/DashboardsCellGlobalConditions/DashboardsCellGlobalConditionsOld.js +0 -816
  13. package/dist/components/DashboardsCellGlobalConditions/index.js +0 -15
  14. package/dist/components/DashboardsCellGlobalStyles/DashboardsCellGlobalStyles.js +0 -394
  15. package/dist/components/DashboardsCellGlobalStyles/index.js +0 -15
  16. package/dist/components/DashboardsCellMergeUnmerge/DashboardsCellMergeUnmerge.js +0 -152
  17. package/dist/components/DashboardsCellMergeUnmerge/index.js +0 -15
  18. package/dist/components/DashboardsCellPosition/DashboardsCellPosition.js +0 -85
  19. package/dist/components/DashboardsCellPosition/index.js +0 -15
  20. package/dist/components/DashboardsCellSize/DashboardsCellSize.js +0 -89
  21. package/dist/components/DashboardsCellSize/index.js +0 -15
  22. package/dist/components/DashboardsCellStyle/DashboardsCellStyle.js +0 -83
  23. package/dist/components/DashboardsCellStyle/index.js +0 -15
  24. package/dist/components/DashboardsCellStyleAlignItems/DashboardsCellStyleAlignItems.js +0 -152
  25. package/dist/components/DashboardsCellStyleAlignItems/index.js +0 -15
  26. package/dist/components/DashboardsCellStyleBackgroundColor/DashboardsCellStyleBackgroundColor.js +0 -198
  27. package/dist/components/DashboardsCellStyleBackgroundColor/index.js +0 -15
  28. package/dist/components/DashboardsCellStyleClear/DashboardsCellStyleClear.js +0 -50
  29. package/dist/components/DashboardsCellStyleClear/index.js +0 -15
  30. package/dist/components/DashboardsCellStyleColor/DashboardsCellStyleColor.js +0 -198
  31. package/dist/components/DashboardsCellStyleColor/index.js +0 -15
  32. package/dist/components/DashboardsCellStyleDisplay/DashboardsCellStyleDisplay.js +0 -65
  33. package/dist/components/DashboardsCellStyleDisplay/index.js +0 -15
  34. package/dist/components/DashboardsCellStyleFontFamily/DashboardsCellStyleFontFamily.js +0 -64
  35. package/dist/components/DashboardsCellStyleFontFamily/index.js +0 -15
  36. package/dist/components/DashboardsCellStyleFontSize/DashboardsCellStyleFontSize.js +0 -89
  37. package/dist/components/DashboardsCellStyleFontSize/index.js +0 -15
  38. package/dist/components/DashboardsCellStyleJustifyContent/DashboardsCellStyleJustifyContent.js +0 -152
  39. package/dist/components/DashboardsCellStyleJustifyContent/index.js +0 -15
  40. package/dist/components/DashboardsCellStyleObjectFit/DashboardsCellStyleObjectFit.js +0 -81
  41. package/dist/components/DashboardsCellStyleObjectFit/index.js +0 -15
  42. package/dist/components/DashboardsCellStylePadding/DashboardsCellStylePadding.js +0 -105
  43. package/dist/components/DashboardsCellStylePadding/index.js +0 -15
  44. package/dist/components/DashboardsCellStyleWeightStyleDecoration/DashboardsCellStyleWeightStyleDecoration.js +0 -154
  45. package/dist/components/DashboardsCellStyleWeightStyleDecoration/index.js +0 -15
  46. package/dist/components/DashboardsCopyAndPaste/DashboardsCopyAndPaste.js +0 -112
  47. package/dist/components/DashboardsCopyAndPaste/index.js +0 -15
  48. package/dist/components/DashboardsEditor/DashboardsEditor.js +0 -415
  49. package/dist/components/DashboardsEditor/index.js +0 -15
  50. package/dist/components/DashboardsGlobalStylesPicker/DashboardsGlobalStylesPicker.js +0 -90
  51. package/dist/components/DashboardsGlobalStylesPicker/index.js +0 -15
  52. package/dist/components/DashboardsGrid/DashboardsGrid.js +0 -139
  53. package/dist/components/DashboardsGrid/index.js +0 -15
  54. package/dist/components/DashboardsMainFreehand/DashboardsMainFreehand.js +0 -466
  55. package/dist/components/DashboardsMainFreehand/index.js +0 -15
  56. package/dist/components/DashboardsMainMessaging/DashboardsMainMessaging.js +0 -628
  57. package/dist/components/DashboardsMainMessaging/index.js +0 -15
  58. package/dist/components/DashboardsMainTable/DashboardsMainTable.js +0 -626
  59. package/dist/components/DashboardsMainTable/index.js +0 -15
  60. package/dist/components/DashboardsPreview/DashboardsPreview.js +0 -113
  61. package/dist/components/DashboardsPreview/index.js +0 -15
  62. package/dist/components/DashboardsRatio/DashboardsRatio.js +0 -288
  63. package/dist/components/DashboardsRatio/DashboardsRatioOld.js +0 -211
  64. package/dist/components/DashboardsRatio/index.js +0 -15
  65. package/dist/components/DashboardsStatusBar/DashboardsStatusBar.css +0 -1
  66. package/dist/components/DashboardsStatusBar/DashboardsStatusBar.js +0 -137
  67. package/dist/components/DashboardsStatusBar/index.js +0 -15
  68. package/dist/components/DashboardsUndoRedo/DashboardsUndoRedo.js +0 -144
  69. package/dist/components/DashboardsUndoRedo/index.js +0 -15
  70. package/dist/components/DashboardsViewer/DashboardsViewer.js +0 -74
  71. package/dist/components/DashboardsViewer/index.js +0 -15
  72. package/dist/components/DashboardsWidthHeight/DashboardsWidthHeight.js +0 -98
  73. package/dist/components/DashboardsWidthHeight/index.js +0 -15
  74. package/dist/components/WidgetParameters/WidgetParameters.js +0 -383
  75. package/dist/components/WidgetParameters/index.js +0 -15
  76. package/dist/components/index.js +0 -287
  77. package/dist/constants/defaultFreehandCell.js +0 -23
  78. package/dist/constants/defaultFreehandDashboard.js +0 -23
  79. package/dist/constants/defaultMessagingDashboard.js +0 -53
  80. package/dist/constants/defaultStyle.js +0 -11
  81. package/dist/constants/defaultTableCell.js +0 -27
  82. package/dist/constants/defaultTableDashboard.js +0 -25
  83. package/dist/constants/index.js +0 -55
  84. package/dist/functions/addTranslations.js +0 -28
  85. package/dist/functions/calculateDashboardVariables.js +0 -146
  86. package/dist/functions/convertColorObject.js +0 -10
  87. package/dist/functions/convertColorString.js +0 -26
  88. package/dist/functions/convertPercentToInt.js +0 -10
  89. package/dist/functions/convertSecondsToElapsedTime.js +0 -37
  90. package/dist/functions/generateFreehandCell.js +0 -24
  91. package/dist/functions/generateFreehandDashboard.js +0 -19
  92. package/dist/functions/generateMessagingDashboard.js +0 -14
  93. package/dist/functions/generateSelected.js +0 -18
  94. package/dist/functions/generateTableCell.js +0 -18
  95. package/dist/functions/generateTableDashboard.js +0 -37
  96. package/dist/functions/index.js +0 -119
  97. package/dist/functions/mergeSelected.js +0 -22
  98. package/dist/functions/sortCells.js +0 -26
  99. package/dist/images/BackgroundTransparency.png +0 -0
  100. package/dist/index.js +0 -44
  101. package/dist/translations/en.json +0 -11
  102. package/dist/translations/es.json +0 -3
@@ -1,438 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _react = _interopRequireWildcard(require("react"));
9
-
10
- var _versacallCoreLibraryReact = require("versacall-core-library-react");
11
-
12
- var _Settings = _interopRequireDefault(require("@material-ui/icons/Settings"));
13
-
14
- var _TextField = _interopRequireDefault(require("@material-ui/core/TextField"));
15
-
16
- var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
17
-
18
- var _Dialog = _interopRequireDefault(require("@material-ui/core/Dialog"));
19
-
20
- var _Grid = _interopRequireDefault(require("@material-ui/core/Grid"));
21
-
22
- var _reactIntl = require("react-intl");
23
-
24
- 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 = {
39
- widget: {
40
- width: '100%',
41
- height: '60vh',
42
- overflowY: 'auto' // minHeight: '60vh',
43
- // maxHeight: '80vh',
44
-
45
- },
46
- styleBox: {
47
- position: 'relative',
48
- borderStyle: 'solid',
49
- borderWidth: 1,
50
- borderColor: 'rgba(0, 0, 0, 0.23',
51
- borderRadius: 4,
52
- padding: 16
53
- },
54
- label: {
55
- fontSize: '1rem',
56
- padding: 0,
57
- paddingLeft: 6,
58
- paddingRight: 4,
59
- lineHeight: 1,
60
- zIndex: 1,
61
- position: 'absolute',
62
- top: 0,
63
- left: 0,
64
- transformOrigin: 'top left',
65
- transform: 'translate(8px, -6px) scale(0.75)',
66
- backgroundColor: 'white',
67
- color: 'rgba(0, 0, 0, 0.54)',
68
- borderColor: 'rgba(0, 0, 0, 0.54)'
69
- }
70
- };
71
-
72
- class DashboardsCellContent extends _react.Component {
73
- constructor(props) {
74
- super(props);
75
- this.state = {
76
- open: false
77
- };
78
- }
79
-
80
- updateType(type) {
81
- var value = {
82
- content: {
83
- type: type
84
- }
85
- };
86
-
87
- switch (type) {
88
- case 'url':
89
- value.content.url = '';
90
- break;
91
-
92
- case 'image':
93
- value.content.id = '';
94
- break;
95
-
96
- case 'widget':
97
- value.content.id = '';
98
- value.content.properties = '';
99
- break;
100
-
101
- default:
102
- value.content.text = '';
103
- }
104
-
105
- this.props.updateValue(value);
106
- }
107
-
108
- updateWidget(widgetId) {
109
- this.props.updateValue({
110
- content: {
111
- type: 'widget',
112
- id: widgetId,
113
- properties: ''
114
- }
115
- });
116
- }
117
-
118
- updateProperties(value) {
119
- var newContent = JSON.parse(JSON.stringify(value));
120
-
121
- if (Object.keys(newContent.content.properties).every(key => newContent.content.properties[key] === '')) {
122
- newContent.content.properties = '';
123
- } else {
124
- newContent.content.properties = JSON.stringify(newContent.content.properties);
125
- }
126
-
127
- this.props.updateValue(newContent);
128
- }
129
-
130
- 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
-
143
- if (value.type === 'widget' && value.id && open) {
144
- currentWidget = widgets.find(widget => widget.id === value.id);
145
-
146
- if (currentWidget) {
147
- var valueProperties = value.properties ? JSON.parse(value.properties) : {};
148
- currentWidget.parameters.forEach(parameter => {
149
- if (valueProperties[parameter.name]) {
150
- var valueProperty = JSON.parse(JSON.stringify(valueProperties[parameter.name]));
151
-
152
- if (typeof valueProperty === 'object') {
153
- currentWidgetProperties[parameter.name] = parameter.type === 'tag' ? valueProperty : '';
154
- } else {
155
- currentWidgetProperties[parameter.name] = parameter.type === 'tag' ? {
156
- isAdvanced: false,
157
- moduleTagFilters: [],
158
- moduleLocationFilters: [],
159
- monitoringPointTagFilters: [],
160
- monitoringPointTypeFilters: [],
161
- basicFilter: '',
162
- advancedFilter: ''
163
- } : valueProperty;
164
- }
165
- } else if (parameter.type === 'tag') {
166
- currentWidgetProperties[parameter.name] = {
167
- isAdvanced: false,
168
- moduleTagFilters: [],
169
- moduleLocationFilters: [],
170
- monitoringPointTagFilters: [],
171
- monitoringPointTypeFilters: [],
172
- basicFilter: '',
173
- advancedFilter: ''
174
- };
175
- } else {
176
- currentWidgetProperties[parameter.name] = '';
177
- }
178
- });
179
- }
180
- }
181
-
182
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Grid.default, {
183
- xs: 4,
184
- item: true
185
- }, /*#__PURE__*/_react.default.createElement(_TextField.default, {
186
- variant: "outlined",
187
- value: value.type,
188
- SelectProps: {
189
- native: true
190
- },
191
- label: intl.formatMessage({
192
- id: '__type'
193
- }),
194
- onChange: event => this.updateType(event.target.value),
195
- fullWidth: true,
196
- select: true
197
- }, /*#__PURE__*/_react.default.createElement("option", {
198
- value: "text"
199
- }, intl.formatMessage({
200
- id: '__text'
201
- })), /*#__PURE__*/_react.default.createElement("option", {
202
- value: "url"
203
- }, intl.formatMessage({
204
- id: '__url'
205
- })), /*#__PURE__*/_react.default.createElement("option", {
206
- value: "image"
207
- }, intl.formatMessage({
208
- id: '__image'
209
- })), /*#__PURE__*/_react.default.createElement("option", {
210
- value: "widget"
211
- }, intl.formatMessage({
212
- id: '__widget'
213
- })))), value.type === 'text' && /*#__PURE__*/_react.default.createElement(_Grid.default, {
214
- xs: 8,
215
- item: true
216
- }, /*#__PURE__*/_react.default.createElement(_versacallCoreLibraryReact.CoreTextField, {
217
- id: "name",
218
- value: value.text,
219
- options: variables,
220
- label: intl.formatMessage({
221
- id: '__text'
222
- }),
223
- InputLabelProps: {
224
- shrink: true
225
- },
226
- updateValue: eventValue => this.props.updateValue({
227
- content: _objectSpread(_objectSpread({}, value), {}, {
228
- text: eventValue
229
- })
230
- }),
231
- selectOption: eventOption => this.props.updateValue({
232
- content: _objectSpread(_objectSpread({}, value), {}, {
233
- text: "~".concat(eventOption.name)
234
- })
235
- }),
236
- fullWidth: true,
237
- multiline: true
238
- })), value.type === 'url' && /*#__PURE__*/_react.default.createElement(_Grid.default, {
239
- xs: 8,
240
- item: true
241
- }, /*#__PURE__*/_react.default.createElement(_TextField.default, {
242
- id: "url",
243
- variant: "outlined",
244
- value: value.url,
245
- label: intl.formatMessage({
246
- id: '__url'
247
- }),
248
- InputLabelProps: {
249
- shrink: true
250
- },
251
- onChange: event => this.props.updateValue({
252
- content: _objectSpread(_objectSpread({}, value), {}, {
253
- url: event.target.value
254
- })
255
- }),
256
- fullWidth: true
257
- })), value.type === 'image' && /*#__PURE__*/_react.default.createElement(_Grid.default, {
258
- xs: 8,
259
- item: true
260
- }, /*#__PURE__*/_react.default.createElement(_TextField.default, {
261
- variant: "outlined",
262
- SelectProps: {
263
- native: true
264
- },
265
- value: value.id ? value.id : 'default',
266
- label: intl.formatMessage({
267
- id: '__image'
268
- }),
269
- InputLabelProps: {
270
- shrink: true
271
- },
272
- onChange: event => this.props.updateValue({
273
- content: _objectSpread(_objectSpread({}, value), {}, {
274
- id: event.target.value
275
- })
276
- }),
277
- fullWidth: true,
278
- select: true
279
- }, /*#__PURE__*/_react.default.createElement("option", {
280
- value: "default",
281
- disabled: true
282
- }, intl.formatMessage({
283
- id: '__select'
284
- })), images.map(image => /*#__PURE__*/_react.default.createElement("option", {
285
- key: image.id,
286
- value: image.id
287
- }, image.fileName)))), value.type === 'widget' && /*#__PURE__*/_react.default.createElement(_Grid.default, {
288
- xs: value.id ? 5 : 8,
289
- item: true
290
- }, /*#__PURE__*/_react.default.createElement(_TextField.default, {
291
- variant: "outlined",
292
- SelectProps: {
293
- native: true
294
- },
295
- value: value.id ? value.id : 'default',
296
- label: intl.formatMessage({
297
- id: '__widget'
298
- }),
299
- InputLabelProps: {
300
- shrink: true
301
- },
302
- onChange: event => this.updateWidget(event.target.value),
303
- fullWidth: true,
304
- select: true
305
- }, /*#__PURE__*/_react.default.createElement("option", {
306
- value: "default",
307
- disabled: true
308
- }, intl.formatMessage({
309
- id: '__select'
310
- })), widgets.map(widget => /*#__PURE__*/_react.default.createElement("option", {
311
- key: widget.id,
312
- value: widget.id
313
- }, widget.name)))), value.type === 'widget' && value.id && /*#__PURE__*/_react.default.createElement(_Grid.default, {
314
- xs: 3,
315
- item: true
316
- }, /*#__PURE__*/_react.default.createElement(_Button.default, {
317
- variant: "outlined",
318
- style: {
319
- height: '100%'
320
- },
321
- onClick: () => this.setState({
322
- open: true
323
- }),
324
- fullWidth: true
325
- }, /*#__PURE__*/_react.default.createElement(_Settings.default, null))), value.type === 'widget' && value.id && open && !!currentWidget && /*#__PURE__*/_react.default.createElement(_Dialog.default, {
326
- maxWidth: "md",
327
- onClose: () => this.setState({
328
- open: false
329
- }),
330
- fullWidth: true,
331
- open: true
332
- }, /*#__PURE__*/_react.default.createElement(_versacallCoreLibraryReact.CoreToolbar, {
333
- title: intl.formatMessage({
334
- id: '__configure'
335
- }),
336
- handleClose: () => this.setState({
337
- open: false
338
- })
339
- }), /*#__PURE__*/_react.default.createElement("div", {
340
- style: style.widget,
341
- className: _versacallCoreLibraryReact.ScrollbarStyles.scroll
342
- }, currentWidget.plugInType === 'component' ? /*#__PURE__*/_react.default.createElement(_versacallCoreLibraryReact.CoreWidget, {
343
- sandbox: "allow-scripts allow-same-origin allow-popups",
344
- controller: {
345
- properties: value.properties,
346
- variables: variables
347
- },
348
- url: "".concat(core.baseUrl).concat(widgets.find(widget => widget.id === value.id).configureUrl),
349
- onChange: event => this.props.updateValue({
350
- content: _objectSpread(_objectSpread({}, value), {}, {
351
- properties: event.properties
352
- })
353
- }),
354
- withAuthentication: true,
355
- withOrganization: true
356
- }) : /*#__PURE__*/_react.default.createElement("div", {
357
- style: {
358
- padding: 16
359
- }
360
- }, /*#__PURE__*/_react.default.createElement(_Grid.default, {
361
- spacing: 2,
362
- container: true
363
- }, currentWidget.parameters.map((parameter, index) => /*#__PURE__*/_react.default.createElement(_Grid.default, {
364
- xs: 12,
365
- key: String(index),
366
- item: true
367
- }, parameter.type === 'text' && /*#__PURE__*/_react.default.createElement(_versacallCoreLibraryReact.CoreTextField, {
368
- id: "name",
369
- options: variables,
370
- type: parameter.type,
371
- label: parameter.name,
372
- placeholder: parameter.description,
373
- value: currentWidgetProperties[parameter.name],
374
- updateValue: eventValue => this.updateProperties({
375
- content: _objectSpread(_objectSpread({}, value), {}, {
376
- properties: _objectSpread(_objectSpread({}, currentWidgetProperties), {}, {
377
- [parameter.name]: eventValue
378
- })
379
- })
380
- }),
381
- selectOption: eventOption => this.updateProperties({
382
- content: _objectSpread(_objectSpread({}, value), {}, {
383
- properties: _objectSpread(_objectSpread({}, currentWidgetProperties), {}, {
384
- [parameter.name]: "~".concat(eventOption.name)
385
- })
386
- })
387
- }),
388
- fullWidth: true
389
- }), parameter.type === 'tag' && /*#__PURE__*/_react.default.createElement("div", {
390
- style: style.styleBox
391
- }, /*#__PURE__*/_react.default.createElement("span", {
392
- style: style.label
393
- }, parameter.name), /*#__PURE__*/_react.default.createElement(_Grid.default, {
394
- spacing: 2,
395
- container: true
396
- }, /*#__PURE__*/_react.default.createElement(_Grid.default, {
397
- xs: 12,
398
- item: true
399
- }, /*#__PURE__*/_react.default.createElement(_versacallCoreLibraryReact.CoreTagFilter, {
400
- tags: tags,
401
- hideAdvanced: parameter.hideAdvanced,
402
- hideModuleTagFilters: parameter.hideModuleTagFilters,
403
- hideModuleLocationFilters: parameter.hideModuleLocationFilters,
404
- hideMonitoringPointTagFilters: parameter.hideMonitoringPointTagFilters,
405
- hideMonitoringPointTypeFilters: parameter.hideMonitoringPointTypeFilters,
406
- updateFilter: event => this.updateProperties({
407
- content: _objectSpread(_objectSpread({}, value), {}, {
408
- properties: _objectSpread(_objectSpread({}, currentWidgetProperties), {}, {
409
- [parameter.name]: _objectSpread(_objectSpread({}, currentWidgetProperties[parameter.name]), event)
410
- })
411
- })
412
- }),
413
- filter: currentWidgetProperties[parameter.name]
414
- })))))))))));
415
- }
416
-
417
- }
418
-
419
- DashboardsCellContent.propTypes = {
420
- tags: _propTypes.default.shape(),
421
- core: _propTypes.default.shape().isRequired,
422
- intl: _propTypes.default.shape().isRequired,
423
- value: _propTypes.default.shape().isRequired,
424
- updateValue: _propTypes.default.func.isRequired,
425
- images: _propTypes.default.arrayOf(_propTypes.default.shape()),
426
- widgets: _propTypes.default.arrayOf(_propTypes.default.shape()),
427
- variables: _propTypes.default.arrayOf(_propTypes.default.shape())
428
- };
429
- DashboardsCellContent.defaultProps = {
430
- tags: null,
431
- images: [],
432
- widgets: [],
433
- variables: []
434
- };
435
-
436
- var _default = (0, _versacallCoreLibraryReact.withCore)((0, _reactIntl.injectIntl)(DashboardsCellContent));
437
-
438
- exports.default = _default;
@@ -1,15 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "default", {
7
- enumerable: true,
8
- get: function get() {
9
- return _DashboardsCellContent.default;
10
- }
11
- });
12
-
13
- var _DashboardsCellContent = _interopRequireDefault(require("./DashboardsCellContent"));
14
-
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -1,190 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _react = _interopRequireWildcard(require("react"));
9
-
10
- var _versacallCoreLibraryReact = require("versacall-core-library-react");
11
-
12
- var _FindReplace = _interopRequireDefault(require("@material-ui/icons/FindReplace"));
13
-
14
- var _IconButton = _interopRequireDefault(require("@material-ui/core/IconButton"));
15
-
16
- var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
17
-
18
- var _Dialog = _interopRequireDefault(require("@material-ui/core/Dialog"));
19
-
20
- var _Grid = _interopRequireDefault(require("@material-ui/core/Grid"));
21
-
22
- var _reactIntl = require("react-intl");
23
-
24
- 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 = {
33
- root: {
34
- padding: 16
35
- },
36
- button: {
37
- textAlign: 'right'
38
- }
39
- };
40
-
41
- function replaceText(find, replace, text) {
42
- var newText = String(text);
43
- newText = newText.replace(new RegExp(find), replace);
44
- return newText;
45
- }
46
-
47
- class DashboardsCellFindAndReplace extends _react.Component {
48
- constructor(props) {
49
- super(props);
50
- this.state = {
51
- open: false,
52
- find: '',
53
- replace: ''
54
- };
55
- }
56
-
57
- updateValue() {
58
- var _this = this;
59
-
60
- if (this.props.updateValue) {
61
- var cells = JSON.parse(JSON.stringify(this.props.value));
62
- cells = cells.map(cell => {
63
- var newCell = JSON.parse(JSON.stringify(cell));
64
-
65
- if (newCell.content.type === 'text') {
66
- newCell.content.text = replaceText(this.state.find, this.state.replace, newCell.content.text);
67
- } else if (newCell.content.type === 'widget') {
68
- var newProperties = JSON.parse(newCell.content.properties);
69
- Object.keys(newProperties).forEach(key => {
70
- newProperties[key] = replaceText(this.state.find, this.state.replace, newProperties[key]);
71
- });
72
- newCell.content.properties = JSON.stringify(newProperties);
73
- }
74
-
75
- for (var i = 0; i < newCell.styleConditions.length; i++) {
76
- newCell.styleConditions[i].condition = replaceText(this.state.find, this.state.replace, newCell.styleConditions[i].condition);
77
- }
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);
84
- } 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
- })();
92
- }
93
- }
94
-
95
- return newCell;
96
- });
97
- this.props.updateValue(cells);
98
- }
99
- }
100
-
101
- 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;
109
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
110
- onClick: () => this.setState({
111
- open: true
112
- })
113
- }, /*#__PURE__*/_react.default.createElement(_FindReplace.default, null)), open && /*#__PURE__*/_react.default.createElement(_Dialog.default, {
114
- onClose: () => this.setState({
115
- open: false
116
- }),
117
- fullWidth: true,
118
- open: true
119
- }, /*#__PURE__*/_react.default.createElement(_versacallCoreLibraryReact.CoreToolbar, {
120
- handleClose: () => this.setState({
121
- open: false
122
- }),
123
- title: intl.formatMessage({
124
- id: '__find_and_replace'
125
- })
126
- }), /*#__PURE__*/_react.default.createElement("div", {
127
- style: style.root
128
- }, /*#__PURE__*/_react.default.createElement(_Grid.default, {
129
- spacing: 2,
130
- container: true
131
- }, /*#__PURE__*/_react.default.createElement(_Grid.default, {
132
- sm: 12,
133
- item: true
134
- }, /*#__PURE__*/_react.default.createElement(_versacallCoreLibraryReact.CoreTextField, {
135
- id: "name",
136
- value: find,
137
- options: variables,
138
- label: intl.formatMessage({
139
- id: '__find'
140
- }),
141
- updateValue: event => this.setState({
142
- find: event
143
- }),
144
- selectOption: event => this.setState({
145
- find: "~".concat(event.name)
146
- }),
147
- fullWidth: true
148
- })), /*#__PURE__*/_react.default.createElement(_Grid.default, {
149
- sm: 12,
150
- item: true
151
- }, /*#__PURE__*/_react.default.createElement(_versacallCoreLibraryReact.CoreTextField, {
152
- id: "name",
153
- value: replace,
154
- options: variables,
155
- label: intl.formatMessage({
156
- id: '__replace'
157
- }),
158
- updateValue: event => this.setState({
159
- replace: event
160
- }),
161
- selectOption: event => this.setState({
162
- replace: "~".concat(event.name)
163
- }),
164
- fullWidth: true
165
- })), /*#__PURE__*/_react.default.createElement(_Grid.default, {
166
- sm: 12,
167
- style: style.button,
168
- item: true
169
- }, /*#__PURE__*/_react.default.createElement(_Button.default, {
170
- variant: "contained",
171
- color: "primary",
172
- onClick: () => this.updateValue(),
173
- disabled: find === ''
174
- }, intl.formatMessage({
175
- id: '__replace'
176
- })))))));
177
- }
178
-
179
- }
180
-
181
- DashboardsCellFindAndReplace.propTypes = {
182
- intl: _propTypes.default.shape().isRequired,
183
- updateValue: _propTypes.default.func.isRequired,
184
- value: _propTypes.default.arrayOf(_propTypes.default.shape()).isRequired,
185
- variables: _propTypes.default.arrayOf(_propTypes.default.shape()).isRequired
186
- };
187
-
188
- var _default = (0, _reactIntl.injectIntl)(DashboardsCellFindAndReplace);
189
-
190
- exports.default = _default;
@@ -1,15 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "default", {
7
- enumerable: true,
8
- get: function get() {
9
- return _DashboardsCellFindAndReplace.default;
10
- }
11
- });
12
-
13
- var _DashboardsCellFindAndReplace = _interopRequireDefault(require("./DashboardsCellFindAndReplace"));
14
-
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }