versacall-dashboards-library-react 2.0.46 → 2.0.47

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.
@@ -40,6 +40,9 @@ require("react-nestable-fork/dist/Nestable/Nestable.css");
40
40
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
41
41
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
42
42
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
43
+ 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; }
44
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
45
+ 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); }
43
46
  // Constants
44
47
  const OPERATOR_OPTIONS = [{
45
48
  value: '===',
@@ -215,379 +218,379 @@ const determineIfAdvanced = condition => {
215
218
  class DashboardsCellGlobalConditions extends _react.Component {
216
219
  constructor(props) {
217
220
  super(props);
218
- this.state = {
219
- open: false,
220
- tabIndex: 0,
221
- conditionIndex: null,
222
- menuIndex: null,
223
- menuAnchorEl: null,
224
- advanced: false
225
- };
226
- }
227
- stylePreviewCustomCell = _ref2 => {
228
- let {
229
- row
230
- } = _ref2;
231
- const newCell = {
232
- ...row
233
- };
234
- newCell.custom = {
235
- viewWidth: 120,
236
- viewHeight: 120,
237
- style: {}
238
- };
239
- if (this.props.styles.length > 0 && row.styleIds && row.styleIds.length > 0) {
240
- for (let i = 0; i < newCell.styleIds.length; i++) {
241
- const findStyle = this.props.styles.find(searchStyle => searchStyle.id === newCell.styleIds[i]);
242
- if (findStyle) {
243
- newCell.custom.style = {
244
- ...newCell.custom.style,
245
- ...findStyle.options
246
- };
221
+ _defineProperty(this, "stylePreviewCustomCell", _ref2 => {
222
+ let {
223
+ row
224
+ } = _ref2;
225
+ const newCell = {
226
+ ...row
227
+ };
228
+ newCell.custom = {
229
+ viewWidth: 120,
230
+ viewHeight: 120,
231
+ style: {}
232
+ };
233
+ if (this.props.styles.length > 0 && row.styleIds && row.styleIds.length > 0) {
234
+ for (let i = 0; i < newCell.styleIds.length; i++) {
235
+ const findStyle = this.props.styles.find(searchStyle => searchStyle.id === newCell.styleIds[i]);
236
+ if (findStyle) {
237
+ newCell.custom.style = {
238
+ ...newCell.custom.style,
239
+ ...findStyle.options
240
+ };
241
+ }
247
242
  }
248
243
  }
249
- }
250
- newCell.custom.style = {
251
- ...newCell.custom.style,
252
- ...newCell.style
253
- };
254
- return /*#__PURE__*/_react.default.createElement("div", {
255
- style: {
256
- width: 120
257
- }
258
- }, /*#__PURE__*/_react.default.createElement(_DashboardsPreview.default, {
259
- width: "120px",
260
- height: "100px",
261
- padding: "10px"
262
- }, /*#__PURE__*/_react.default.createElement(_DashboardsCell.default, {
263
- cell: {
264
- content: {
265
- type: 'text',
266
- text: 'Hello'
267
- },
268
- custom: newCell.custom
269
- }
270
- })));
271
- };
272
- contentTypeCustomCell = _ref3 => {
273
- let {
274
- row
275
- } = _ref3;
276
- return /*#__PURE__*/_react.default.createElement("span", null, this.props.intl.formatMessage({
277
- id: `__${row.content.type}`
278
- }));
279
- };
280
- actionsCustomCell = _ref4 => {
281
- let {
282
- row
283
- } = _ref4;
284
- const {
285
- tabIndex
286
- } = this.state;
287
- const conditions = tabIndex === 0 ? this.props.value.styleConditions : this.props.value.contentConditions;
288
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, row.index !== 0 && /*#__PURE__*/_react.default.createElement(_IconButton.default, {
289
- onClick: e => {
290
- e.stopPropagation();
291
- this.moveCondition(row.index, -1);
292
- },
293
- "aria-label": this.props.intl.formatMessage({
294
- id: '__move_up'
295
- })
296
- }, /*#__PURE__*/_react.default.createElement(_ArrowUpward.default, null)), row.index !== String(conditions.length - 1) && /*#__PURE__*/_react.default.createElement(_IconButton.default, {
297
- onClick: e => {
298
- e.stopPropagation();
299
- this.moveCondition(row.index, 1);
300
- },
301
- "aria-label": this.props.intl.formatMessage({
302
- id: '__move_down'
303
- })
304
- }, /*#__PURE__*/_react.default.createElement(_ArrowDownward.default, null)), /*#__PURE__*/_react.default.createElement(_IconButton.default, {
305
- onClick: e => {
306
- e.stopPropagation();
307
- this.copyCondition(row);
308
- },
309
- "aria-label": this.props.intl.formatMessage({
310
- id: '__copy'
311
- })
312
- }, /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
313
- title: this.props.intl.formatMessage({
314
- id: '__copy'
315
- })
316
- }, /*#__PURE__*/_react.default.createElement(_FileCopy.default, null))), /*#__PURE__*/_react.default.createElement(_IconButton.default, {
317
- onClick: e => {
318
- e.stopPropagation();
319
- this.deleteCondition(row.index);
320
- },
321
- "aria-label": this.props.intl.formatMessage({
322
- id: '__delete'
323
- })
324
- }, /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
325
- title: this.props.intl.formatMessage({
326
- id: '__delete'
327
- })
328
- }, /*#__PURE__*/_react.default.createElement(_Delete.default, null))));
329
- };
330
- updateCondition = change => {
331
- const {
332
- conditionIndex,
333
- tabIndex
334
- } = this.state;
335
- const updatedValue = {
336
- ...this.props.value
337
- };
338
- const conditions = tabIndex === 1 ? updatedValue.contentConditions : updatedValue.styleConditions;
339
- if (this.state.advanced) {
340
- conditions[conditionIndex].condition = change.value;
341
- } else {
342
- const split = conditions[conditionIndex].condition.split(/[ ,]+/);
343
- const segment1 = split[0];
344
- const segment2 = split.length > 1 ? split[1] : '===';
345
- const segment3 = split.length > 2 ? split[2] : '0';
346
- switch (change.stringIndex) {
347
- case 0:
348
- conditions[conditionIndex].condition = `${change.value} ${segment2} ${segment3}`;
349
- break;
350
- case 1:
351
- conditions[conditionIndex].condition = `${segment1} ${change.value} ${segment3}`;
352
- break;
353
- case 2:
354
- conditions[conditionIndex].condition = `${segment1} ${segment2} ${change.value}`;
355
- break;
356
- default:
357
- conditions[conditionIndex].condition = `${segment1} ${segment2} ${segment3}`;
358
- break;
359
- }
360
- }
361
- this.props.updateValue({
362
- styleConditions: updatedValue.styleConditions,
363
- contentConditions: updatedValue.contentConditions
244
+ newCell.custom.style = {
245
+ ...newCell.custom.style,
246
+ ...newCell.style
247
+ };
248
+ return /*#__PURE__*/_react.default.createElement("div", {
249
+ style: {
250
+ width: 120
251
+ }
252
+ }, /*#__PURE__*/_react.default.createElement(_DashboardsPreview.default, {
253
+ width: "120px",
254
+ height: "100px",
255
+ padding: "10px"
256
+ }, /*#__PURE__*/_react.default.createElement(_DashboardsCell.default, {
257
+ cell: {
258
+ content: {
259
+ type: 'text',
260
+ text: 'Hello'
261
+ },
262
+ custom: newCell.custom
263
+ }
264
+ })));
265
+ });
266
+ _defineProperty(this, "contentTypeCustomCell", _ref3 => {
267
+ let {
268
+ row
269
+ } = _ref3;
270
+ return /*#__PURE__*/_react.default.createElement("span", null, this.props.intl.formatMessage({
271
+ id: `__${row.content.type}`
272
+ }));
364
273
  });
365
- };
366
- updateStyleIds = value => {
367
- const styleConditions = [...this.props.value.styleConditions];
368
- styleConditions[this.state.conditionIndex].styleIds = value.styleIds;
369
- this.props.updateValue({
370
- styleConditions
274
+ _defineProperty(this, "actionsCustomCell", _ref4 => {
275
+ let {
276
+ row
277
+ } = _ref4;
278
+ const {
279
+ tabIndex
280
+ } = this.state;
281
+ const conditions = tabIndex === 0 ? this.props.value.styleConditions : this.props.value.contentConditions;
282
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, row.index !== 0 && /*#__PURE__*/_react.default.createElement(_IconButton.default, {
283
+ onClick: e => {
284
+ e.stopPropagation();
285
+ this.moveCondition(row.index, -1);
286
+ },
287
+ "aria-label": this.props.intl.formatMessage({
288
+ id: '__move_up'
289
+ })
290
+ }, /*#__PURE__*/_react.default.createElement(_ArrowUpward.default, null)), row.index !== String(conditions.length - 1) && /*#__PURE__*/_react.default.createElement(_IconButton.default, {
291
+ onClick: e => {
292
+ e.stopPropagation();
293
+ this.moveCondition(row.index, 1);
294
+ },
295
+ "aria-label": this.props.intl.formatMessage({
296
+ id: '__move_down'
297
+ })
298
+ }, /*#__PURE__*/_react.default.createElement(_ArrowDownward.default, null)), /*#__PURE__*/_react.default.createElement(_IconButton.default, {
299
+ onClick: e => {
300
+ e.stopPropagation();
301
+ this.copyCondition(row);
302
+ },
303
+ "aria-label": this.props.intl.formatMessage({
304
+ id: '__copy'
305
+ })
306
+ }, /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
307
+ title: this.props.intl.formatMessage({
308
+ id: '__copy'
309
+ })
310
+ }, /*#__PURE__*/_react.default.createElement(_FileCopy.default, null))), /*#__PURE__*/_react.default.createElement(_IconButton.default, {
311
+ onClick: e => {
312
+ e.stopPropagation();
313
+ this.deleteCondition(row.index);
314
+ },
315
+ "aria-label": this.props.intl.formatMessage({
316
+ id: '__delete'
317
+ })
318
+ }, /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
319
+ title: this.props.intl.formatMessage({
320
+ id: '__delete'
321
+ })
322
+ }, /*#__PURE__*/_react.default.createElement(_Delete.default, null))));
371
323
  });
372
- };
373
- updateStyle = value => {
374
- const styleConditions = [...this.props.value.styleConditions];
375
- if (Object.keys(value.style).length > 0) {
376
- styleConditions[this.state.conditionIndex].style = {
377
- ...styleConditions[this.state.conditionIndex].style,
378
- ...value.style
324
+ _defineProperty(this, "updateCondition", change => {
325
+ const {
326
+ conditionIndex,
327
+ tabIndex
328
+ } = this.state;
329
+ const updatedValue = {
330
+ ...this.props.value
379
331
  };
380
- Object.keys(styleConditions[this.state.conditionIndex].style).forEach(key => {
381
- if (styleConditions[this.state.conditionIndex].style[key] === 'delete') {
382
- delete styleConditions[this.state.conditionIndex].style[key];
332
+ const conditions = tabIndex === 1 ? updatedValue.contentConditions : updatedValue.styleConditions;
333
+ if (this.state.advanced) {
334
+ conditions[conditionIndex].condition = change.value;
335
+ } else {
336
+ const split = conditions[conditionIndex].condition.split(/[ ,]+/);
337
+ const segment1 = split[0];
338
+ const segment2 = split.length > 1 ? split[1] : '===';
339
+ const segment3 = split.length > 2 ? split[2] : '0';
340
+ switch (change.stringIndex) {
341
+ case 0:
342
+ conditions[conditionIndex].condition = `${change.value} ${segment2} ${segment3}`;
343
+ break;
344
+ case 1:
345
+ conditions[conditionIndex].condition = `${segment1} ${change.value} ${segment3}`;
346
+ break;
347
+ case 2:
348
+ conditions[conditionIndex].condition = `${segment1} ${segment2} ${change.value}`;
349
+ break;
350
+ default:
351
+ conditions[conditionIndex].condition = `${segment1} ${segment2} ${segment3}`;
352
+ break;
383
353
  }
354
+ }
355
+ this.props.updateValue({
356
+ styleConditions: updatedValue.styleConditions,
357
+ contentConditions: updatedValue.contentConditions
384
358
  });
385
- } else {
386
- styleConditions[this.state.conditionIndex].style = {};
387
- }
388
- this.props.updateValue({
389
- styleConditions
390
359
  });
391
- };
392
- updateContent = value => {
393
- const contentConditions = [...this.props.value.contentConditions];
394
- contentConditions[this.state.conditionIndex].content = value.content;
395
- this.props.updateValue({
396
- contentConditions
397
- });
398
- };
399
- addCondition = () => {
400
- const conditions = {
401
- ...this.props.value
402
- };
403
- let index = null;
404
- if (this.state.tabIndex === 0) {
405
- conditions.styleConditions.push({
406
- condition: '1 > 0',
407
- style: {},
408
- styleIds: []
360
+ _defineProperty(this, "updateStyleIds", value => {
361
+ const styleConditions = [...this.props.value.styleConditions];
362
+ styleConditions[this.state.conditionIndex].styleIds = value.styleIds;
363
+ this.props.updateValue({
364
+ styleConditions
409
365
  });
410
- index = conditions.styleConditions.length - 1;
411
- } else {
412
- conditions.contentConditions.push({
413
- condition: '1 > 0',
414
- content: {
415
- type: 'text',
416
- text: ''
417
- }
366
+ });
367
+ _defineProperty(this, "updateStyle", value => {
368
+ const styleConditions = [...this.props.value.styleConditions];
369
+ if (Object.keys(value.style).length > 0) {
370
+ styleConditions[this.state.conditionIndex].style = {
371
+ ...styleConditions[this.state.conditionIndex].style,
372
+ ...value.style
373
+ };
374
+ Object.keys(styleConditions[this.state.conditionIndex].style).forEach(key => {
375
+ if (styleConditions[this.state.conditionIndex].style[key] === 'delete') {
376
+ delete styleConditions[this.state.conditionIndex].style[key];
377
+ }
378
+ });
379
+ } else {
380
+ styleConditions[this.state.conditionIndex].style = {};
381
+ }
382
+ this.props.updateValue({
383
+ styleConditions
418
384
  });
419
- index = conditions.contentConditions.length - 1;
420
- }
421
- this.props.updateValue({
422
- styleConditions: conditions.styleConditions,
423
- contentConditions: conditions.contentConditions
424
385
  });
425
- this.setState({
426
- conditionIndex: index,
427
- advanced: false
386
+ _defineProperty(this, "updateContent", value => {
387
+ const contentConditions = [...this.props.value.contentConditions];
388
+ contentConditions[this.state.conditionIndex].content = value.content;
389
+ this.props.updateValue({
390
+ contentConditions
391
+ });
428
392
  });
429
- };
430
- copyCondition = condition => {
431
- const newValue = {
432
- ...this.props.value
433
- };
434
- const newCondition = {
435
- ...condition
436
- };
437
- delete newCondition.index;
438
- const conditions = newValue[this.state.tabIndex === 0 ? 'styleConditions' : 'contentConditions'];
439
- conditions.push(newCondition);
440
- const advanced = determineIfAdvanced(newCondition.condition);
441
- this.props.updateValue({
442
- styleConditions: newValue.styleConditions,
443
- contentConditions: newValue.contentConditions
393
+ _defineProperty(this, "addCondition", () => {
394
+ const conditions = {
395
+ ...this.props.value
396
+ };
397
+ let index = null;
398
+ if (this.state.tabIndex === 0) {
399
+ conditions.styleConditions.push({
400
+ condition: '1 > 0',
401
+ style: {},
402
+ styleIds: []
403
+ });
404
+ index = conditions.styleConditions.length - 1;
405
+ } else {
406
+ conditions.contentConditions.push({
407
+ condition: '1 > 0',
408
+ content: {
409
+ type: 'text',
410
+ text: ''
411
+ }
412
+ });
413
+ index = conditions.contentConditions.length - 1;
414
+ }
415
+ this.props.updateValue({
416
+ styleConditions: conditions.styleConditions,
417
+ contentConditions: conditions.contentConditions
418
+ });
419
+ this.setState({
420
+ conditionIndex: index,
421
+ advanced: false
422
+ });
444
423
  });
445
- this.setState(prevState => ({
446
- conditionIndex: conditions.length - 1,
447
- advanced
448
- }));
449
- };
450
- duplicateCondition = index => {
451
- const {
452
- value
453
- } = this.props;
454
- const {
455
- tabIndex
456
- } = this.state;
457
- const condition = value[tabIndex === 0 ? 'styleConditions' : 'contentConditions'][index];
458
- this.copyCondition(condition);
459
- };
460
- deleteCondition = index => {
461
- const conditions = {
462
- ...this.props.value
463
- };
464
- conditions[this.state.tabIndex === 0 ? 'styleConditions' : 'contentConditions'].splice(Number(index), 1);
465
- this.props.updateValue({
466
- styleConditions: conditions.styleConditions,
467
- contentConditions: conditions.contentConditions
424
+ _defineProperty(this, "copyCondition", condition => {
425
+ const newValue = {
426
+ ...this.props.value
427
+ };
428
+ const newCondition = {
429
+ ...condition
430
+ };
431
+ delete newCondition.index;
432
+ const conditions = newValue[this.state.tabIndex === 0 ? 'styleConditions' : 'contentConditions'];
433
+ conditions.push(newCondition);
434
+ const advanced = determineIfAdvanced(newCondition.condition);
435
+ this.props.updateValue({
436
+ styleConditions: newValue.styleConditions,
437
+ contentConditions: newValue.contentConditions
438
+ });
439
+ this.setState(prevState => ({
440
+ conditionIndex: conditions.length - 1,
441
+ advanced
442
+ }));
468
443
  });
469
- this.setState({
470
- conditionIndex: null,
471
- advanced: false
444
+ _defineProperty(this, "duplicateCondition", index => {
445
+ const {
446
+ value
447
+ } = this.props;
448
+ const {
449
+ tabIndex
450
+ } = this.state;
451
+ const condition = value[tabIndex === 0 ? 'styleConditions' : 'contentConditions'][index];
452
+ this.copyCondition(condition);
472
453
  });
473
- };
474
- moveCondition = (index, direction) => {
475
- const conditions = {
476
- ...this.props.value
477
- };
478
- const conditionArray = conditions[this.state.tabIndex === 0 ? 'styleConditions' : 'contentConditions'];
479
- const [removed] = conditionArray.splice(Number(index), 1);
480
- conditionArray.splice(Number(index) + direction, 0, removed);
481
- this.props.updateValue({
482
- styleConditions: conditions.styleConditions,
483
- contentConditions: conditions.contentConditions
454
+ _defineProperty(this, "deleteCondition", index => {
455
+ const conditions = {
456
+ ...this.props.value
457
+ };
458
+ conditions[this.state.tabIndex === 0 ? 'styleConditions' : 'contentConditions'].splice(Number(index), 1);
459
+ this.props.updateValue({
460
+ styleConditions: conditions.styleConditions,
461
+ contentConditions: conditions.contentConditions
462
+ });
463
+ this.setState({
464
+ conditionIndex: null,
465
+ advanced: false
466
+ });
484
467
  });
485
- this.setState({
486
- conditionIndex: null,
487
- advanced: false
468
+ _defineProperty(this, "moveCondition", (index, direction) => {
469
+ const conditions = {
470
+ ...this.props.value
471
+ };
472
+ const conditionArray = conditions[this.state.tabIndex === 0 ? 'styleConditions' : 'contentConditions'];
473
+ const [removed] = conditionArray.splice(Number(index), 1);
474
+ conditionArray.splice(Number(index) + direction, 0, removed);
475
+ this.props.updateValue({
476
+ styleConditions: conditions.styleConditions,
477
+ contentConditions: conditions.contentConditions
478
+ });
479
+ this.setState({
480
+ conditionIndex: null,
481
+ advanced: false
482
+ });
488
483
  });
489
- };
490
- onDragEnd = result => {
491
- const {
492
- value
493
- } = this.props;
494
- const {
495
- tabIndex
496
- } = this.state;
497
- if (!result.destination) {
498
- return;
499
- }
500
- const items = reorder(tabIndex === 0 ? value.styleConditions : value.contentConditions, result.source.index, result.destination.index);
501
- const newConditions = {
502
- ...value
503
- };
504
- if (tabIndex === 0) {
505
- newConditions.styleConditions = items;
506
- } else {
507
- newConditions.contentConditions = items;
508
- }
509
- this.props.updateValue({
510
- styleConditions: newConditions.styleConditions,
511
- contentConditions: newConditions.contentConditions
484
+ _defineProperty(this, "onDragEnd", result => {
485
+ const {
486
+ value
487
+ } = this.props;
488
+ const {
489
+ tabIndex
490
+ } = this.state;
491
+ if (!result.destination) {
492
+ return;
493
+ }
494
+ const items = reorder(tabIndex === 0 ? value.styleConditions : value.contentConditions, result.source.index, result.destination.index);
495
+ const newConditions = {
496
+ ...value
497
+ };
498
+ if (tabIndex === 0) {
499
+ newConditions.styleConditions = items;
500
+ } else {
501
+ newConditions.contentConditions = items;
502
+ }
503
+ this.props.updateValue({
504
+ styleConditions: newConditions.styleConditions,
505
+ contentConditions: newConditions.contentConditions
506
+ });
507
+ this.setState({
508
+ conditionIndex: result.destination.index
509
+ });
512
510
  });
513
- this.setState({
514
- conditionIndex: result.destination.index
511
+ _defineProperty(this, "selectCondition", index => {
512
+ const {
513
+ value
514
+ } = this.props;
515
+ const {
516
+ tabIndex
517
+ } = this.state;
518
+ const conditions = tabIndex === 1 ? value.contentConditions : value.styleConditions;
519
+ const condition = conditions[index];
520
+ const advanced = determineIfAdvanced(condition.condition);
521
+ this.setState({
522
+ conditionIndex: index,
523
+ advanced
524
+ });
515
525
  });
516
- };
517
- selectCondition = index => {
518
- const {
519
- value
520
- } = this.props;
521
- const {
522
- tabIndex
523
- } = this.state;
524
- const conditions = tabIndex === 1 ? value.contentConditions : value.styleConditions;
525
- const condition = conditions[index];
526
- const advanced = determineIfAdvanced(condition.condition);
527
- this.setState({
528
- conditionIndex: index,
529
- advanced
526
+ _defineProperty(this, "renderConditionCard", obj => {
527
+ const {
528
+ item,
529
+ handler
530
+ } = obj;
531
+ const {
532
+ classes,
533
+ intl
534
+ } = this.props;
535
+ const {
536
+ tabIndex,
537
+ conditionIndex
538
+ } = this.state;
539
+ const divStyle = {
540
+ border: '1px solid black',
541
+ padding: 10,
542
+ margin: 2,
543
+ display: 'flex',
544
+ alignItems: 'center',
545
+ backgroundColor: item.index === conditionIndex ? '#55b7dc' : '#ffffff'
546
+ };
547
+ return /*#__PURE__*/_react.default.createElement("div", {
548
+ role: "treeitem",
549
+ "aria-selected": item.index === conditionIndex,
550
+ style: divStyle,
551
+ className: classes.selectable,
552
+ onClick: () => this.selectCondition(item.index)
553
+ }, /*#__PURE__*/_react.default.createElement("span", {
554
+ style: {
555
+ marginRight: 20,
556
+ fontWeight: 'bold'
557
+ }
558
+ }, item.index === 0 ? 'IF' : 'ELSE IF'), /*#__PURE__*/_react.default.createElement("span", {
559
+ style: {
560
+ flexGrow: 1
561
+ }
562
+ }, determineIfAdvanced(item.condition) ? item.condition : formatCondition(item.condition)), tabIndex === 0 && this.stylePreviewCustomCell({
563
+ row: item
564
+ }), tabIndex === 1 && item.content && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
565
+ style: {
566
+ marginRight: 10
567
+ }
568
+ }, intl.formatMessage({
569
+ id: `__${item.content.type}`
570
+ })), contentPreviewCustomCell({
571
+ row: item
572
+ })), handler, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
573
+ onClick: e => {
574
+ e.stopPropagation();
575
+ this.setState({
576
+ menuIndex: item.index,
577
+ menuAnchorEl: e.currentTarget
578
+ });
579
+ },
580
+ "aria-label": intl.formatMessage({
581
+ id: '__more_options'
582
+ })
583
+ }, /*#__PURE__*/_react.default.createElement(_MoreVert.default, null)));
530
584
  });
531
- };
532
- renderConditionCard = obj => {
533
- const {
534
- item,
535
- handler
536
- } = obj;
537
- const {
538
- classes,
539
- intl
540
- } = this.props;
541
- const {
542
- tabIndex,
543
- conditionIndex
544
- } = this.state;
545
- const divStyle = {
546
- border: '1px solid black',
547
- padding: 10,
548
- margin: 2,
549
- display: 'flex',
550
- alignItems: 'center',
551
- backgroundColor: item.index === conditionIndex ? '#55b7dc' : '#ffffff'
585
+ this.state = {
586
+ open: false,
587
+ tabIndex: 0,
588
+ conditionIndex: null,
589
+ menuIndex: null,
590
+ menuAnchorEl: null,
591
+ advanced: false
552
592
  };
553
- return /*#__PURE__*/_react.default.createElement("div", {
554
- role: "treeitem",
555
- "aria-selected": item.index === conditionIndex,
556
- style: divStyle,
557
- className: classes.selectable,
558
- onClick: () => this.selectCondition(item.index)
559
- }, /*#__PURE__*/_react.default.createElement("span", {
560
- style: {
561
- marginRight: 20,
562
- fontWeight: 'bold'
563
- }
564
- }, item.index === 0 ? 'IF' : 'ELSE IF'), /*#__PURE__*/_react.default.createElement("span", {
565
- style: {
566
- flexGrow: 1
567
- }
568
- }, determineIfAdvanced(item.condition) ? item.condition : formatCondition(item.condition)), tabIndex === 0 && this.stylePreviewCustomCell({
569
- row: item
570
- }), tabIndex === 1 && item.content && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
571
- style: {
572
- marginRight: 10
573
- }
574
- }, intl.formatMessage({
575
- id: `__${item.content.type}`
576
- })), contentPreviewCustomCell({
577
- row: item
578
- })), handler, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
579
- onClick: e => {
580
- e.stopPropagation();
581
- this.setState({
582
- menuIndex: item.index,
583
- menuAnchorEl: e.currentTarget
584
- });
585
- },
586
- "aria-label": intl.formatMessage({
587
- id: '__more_options'
588
- })
589
- }, /*#__PURE__*/_react.default.createElement(_MoreVert.default, null)));
590
- };
593
+ }
591
594
  render() {
592
595
  const {
593
596
  classes,
package/package.json CHANGED
@@ -2,10 +2,10 @@
2
2
  "versacall": {
3
3
  "title": "Versacall Dashboards Library React",
4
4
  "applicationType": "react-library",
5
- "build": 46
5
+ "build": 47
6
6
  },
7
7
  "name": "versacall-dashboards-library-react",
8
- "version": "2.0.46",
8
+ "version": "2.0.47",
9
9
  "description": "Versacall Dashboards Library",
10
10
  "main": "dist/index.js",
11
11
  "module": "dist/index.js",