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,81 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
- var _TextField = _interopRequireDefault(require("@material-ui/core/TextField"));
11
-
12
- var _Grid = _interopRequireDefault(require("@material-ui/core/Grid"));
13
-
14
- var _reactIntl = require("react-intl");
15
-
16
- var _propTypes = _interopRequireDefault(require("prop-types"));
17
-
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
-
20
- function DashboardsCellStyleObjectFit(props) {
21
- var intl = props.intl,
22
- value = props.value;
23
- return /*#__PURE__*/_react.default.createElement(_Grid.default, {
24
- xs: 6,
25
- item: true
26
- }, /*#__PURE__*/_react.default.createElement(_TextField.default, {
27
- variant: "outlined",
28
- SelectProps: {
29
- native: true,
30
- displayEmpty: true
31
- },
32
- label: intl.formatMessage({
33
- id: '__image_fit'
34
- }),
35
- InputLabelProps: {
36
- shrink: true
37
- },
38
- value: value.objectFit ? value.objectFit : 'delete',
39
- onChange: event => props.updateValue({
40
- style: {
41
- objectFit: event.target.value === '' ? null : event.target.value
42
- }
43
- }),
44
- fullWidth: true,
45
- select: true
46
- }, /*#__PURE__*/_react.default.createElement("option", {
47
- value: "delete",
48
- style: {
49
- fontStyle: 'italic'
50
- }
51
- }, intl.formatMessage({
52
- id: '__not_set'
53
- })), /*#__PURE__*/_react.default.createElement("option", {
54
- value: "none",
55
- default: true
56
- }, intl.formatMessage({
57
- id: '__none'
58
- })), /*#__PURE__*/_react.default.createElement("option", {
59
- value: "fill"
60
- }, intl.formatMessage({
61
- id: '__fill'
62
- })), /*#__PURE__*/_react.default.createElement("option", {
63
- value: "contain"
64
- }, intl.formatMessage({
65
- id: '__contain'
66
- })), /*#__PURE__*/_react.default.createElement("option", {
67
- value: "cover"
68
- }, intl.formatMessage({
69
- id: '__cover'
70
- }))));
71
- }
72
-
73
- DashboardsCellStyleObjectFit.propTypes = {
74
- intl: _propTypes.default.shape().isRequired,
75
- value: _propTypes.default.shape().isRequired,
76
- updateValue: _propTypes.default.func.isRequired
77
- };
78
-
79
- var _default = (0, _reactIntl.injectIntl)(DashboardsCellStyleObjectFit);
80
-
81
- 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 _DashboardsCellStyleObjectFit.default;
10
- }
11
- });
12
-
13
- var _DashboardsCellStyleObjectFit = _interopRequireDefault(require("./DashboardsCellStyleObjectFit"));
14
-
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -1,105 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
- var _InputAdornment = _interopRequireDefault(require("@material-ui/core/InputAdornment"));
11
-
12
- var _TextField = _interopRequireDefault(require("@material-ui/core/TextField"));
13
-
14
- var _Grid = _interopRequireDefault(require("@material-ui/core/Grid"));
15
-
16
- var _reactIntl = require("react-intl");
17
-
18
- var _propTypes = _interopRequireDefault(require("prop-types"));
19
-
20
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
-
22
- /* eslint-disable react/jsx-no-duplicate-props */
23
- function DashboardsCellStylePadding(props) {
24
- var intl = props.intl,
25
- value = props.value;
26
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Grid.default, {
27
- xs: 6,
28
- item: true
29
- }, /*#__PURE__*/_react.default.createElement(_TextField.default, {
30
- type: "number",
31
- variant: "outlined",
32
- style: {
33
- width: '100%'
34
- },
35
- inputProps: {
36
- max: 100,
37
- min: 0,
38
- step: 1
39
- },
40
- label: intl.formatMessage({
41
- id: '__padding_horizontal'
42
- }),
43
- placeholder: intl.formatMessage({
44
- id: '__not_set'
45
- }),
46
- InputLabelProps: {
47
- shrink: true
48
- },
49
- value: value.paddingHorizontal ? value.paddingHorizontal : '',
50
- InputProps: {
51
- endAdornment: /*#__PURE__*/_react.default.createElement(_InputAdornment.default, {
52
- position: "end"
53
- }, "%")
54
- },
55
- onChange: event => props.updateValue({
56
- style: {
57
- paddingHorizontal: event.target.value
58
- }
59
- })
60
- })), /*#__PURE__*/_react.default.createElement(_Grid.default, {
61
- xs: 6,
62
- item: true
63
- }, /*#__PURE__*/_react.default.createElement(_TextField.default, {
64
- type: "number",
65
- variant: "outlined",
66
- style: {
67
- width: '100%'
68
- },
69
- inputProps: {
70
- max: 100,
71
- min: 0,
72
- step: 1
73
- },
74
- label: intl.formatMessage({
75
- id: '__padding_vertical'
76
- }),
77
- placeholder: intl.formatMessage({
78
- id: '__not_set'
79
- }),
80
- InputLabelProps: {
81
- shrink: true
82
- },
83
- value: value.paddingVertical ? value.paddingVertical : '',
84
- InputProps: {
85
- endAdornment: /*#__PURE__*/_react.default.createElement(_InputAdornment.default, {
86
- position: "end"
87
- }, "%")
88
- },
89
- onChange: event => props.updateValue({
90
- style: {
91
- paddingVertical: event.target.value
92
- }
93
- })
94
- })));
95
- }
96
-
97
- DashboardsCellStylePadding.propTypes = {
98
- intl: _propTypes.default.shape().isRequired,
99
- value: _propTypes.default.shape().isRequired,
100
- updateValue: _propTypes.default.func.isRequired
101
- };
102
-
103
- var _default = (0, _reactIntl.injectIntl)(DashboardsCellStylePadding);
104
-
105
- 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 _DashboardsCellStylePadding.default;
10
- }
11
- });
12
-
13
- var _DashboardsCellStylePadding = _interopRequireDefault(require("./DashboardsCellStylePadding"));
14
-
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -1,154 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
- var _FormatUnderlined = _interopRequireDefault(require("@material-ui/icons/FormatUnderlined"));
11
-
12
- var _FormatItalic = _interopRequireDefault(require("@material-ui/icons/FormatItalic"));
13
-
14
- var _FormatBold = _interopRequireDefault(require("@material-ui/icons/FormatBold"));
15
-
16
- var _reactIntl = require("react-intl");
17
-
18
- var _IconButton = _interopRequireDefault(require("@material-ui/core/IconButton"));
19
-
20
- var _Clear = _interopRequireDefault(require("@material-ui/icons/Clear"));
21
-
22
- var _Tooltip = _interopRequireDefault(require("@material-ui/core/Tooltip"));
23
-
24
- var _Grid = _interopRequireDefault(require("@material-ui/core/Grid"));
25
-
26
- var _propTypes = _interopRequireDefault(require("prop-types"));
27
-
28
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
-
30
- 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; }
31
-
32
- 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; }
33
-
34
- 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; }
35
-
36
- var style = {
37
- styleBox: {
38
- position: 'relative',
39
- borderStyle: 'solid',
40
- borderWidth: 1,
41
- borderColor: 'rgba(0, 0, 0, 0.23',
42
- borderRadius: 4,
43
- padding: 8
44
- },
45
- label: {
46
- fontSize: '1rem',
47
- padding: 0,
48
- paddingLeft: 6,
49
- paddingRight: 4,
50
- lineHeight: 1,
51
- zIndex: 1,
52
- position: 'absolute',
53
- top: 0,
54
- left: 0,
55
- transformOrigin: 'top left',
56
- transform: 'translate(8px, -6px) scale(0.75)',
57
- backgroundColor: 'white'
58
- }
59
- };
60
-
61
- function DashboardsCellStyleWeightStyleDecoration(props) {
62
- var value = props.value,
63
- intl = props.intl;
64
- return /*#__PURE__*/_react.default.createElement(_Grid.default, {
65
- xs: 6,
66
- item: true
67
- }, /*#__PURE__*/_react.default.createElement("div", {
68
- style: _objectSpread(_objectSpread({}, style.styleBox), {}, {
69
- color: value.fontWeight || value.fontStyle || value.textDecoration ? '#005A96' : 'rgba(0, 0, 0, 0.54)',
70
- borderColor: value.fontWeight || value.fontStyle || value.textDecoration ? '#005A96' : 'rgba(0, 0, 0, 0.23)'
71
- })
72
- }, /*#__PURE__*/_react.default.createElement("span", {
73
- style: style.label
74
- }, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, {
75
- id: "__font_style"
76
- })), /*#__PURE__*/_react.default.createElement("div", {
77
- style: {
78
- display: 'inline-block',
79
- textAlign: 'center',
80
- width: 'calc(100% - 48px)'
81
- }
82
- }, /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
83
- title: intl.formatMessage({
84
- id: '__bold'
85
- })
86
- }, /*#__PURE__*/_react.default.createElement("div", {
87
- style: {
88
- display: 'inline'
89
- }
90
- }, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
91
- color: value.fontWeight === 'bold' ? 'primary' : 'default',
92
- onClick: () => props.updateValue({
93
- style: {
94
- fontWeight: value.fontWeight === 'bold' ? 'normal' : 'bold'
95
- }
96
- })
97
- }, /*#__PURE__*/_react.default.createElement(_FormatBold.default, null)))), /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
98
- title: intl.formatMessage({
99
- id: '__italic'
100
- })
101
- }, /*#__PURE__*/_react.default.createElement("div", {
102
- style: {
103
- display: 'inline'
104
- }
105
- }, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
106
- color: value.fontStyle === 'italic' ? 'primary' : 'default',
107
- onClick: () => props.updateValue({
108
- style: {
109
- fontStyle: value.fontStyle === 'italic' ? 'normal' : 'italic'
110
- }
111
- })
112
- }, /*#__PURE__*/_react.default.createElement(_FormatItalic.default, null)))), /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
113
- title: intl.formatMessage({
114
- id: '__underline'
115
- })
116
- }, /*#__PURE__*/_react.default.createElement("div", {
117
- style: {
118
- display: 'inline'
119
- }
120
- }, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
121
- color: value.textDecoration === 'underline' ? 'primary' : 'default',
122
- onClick: () => props.updateValue({
123
- style: {
124
- textDecoration: value.textDecoration === 'underline' ? 'none' : 'underline'
125
- }
126
- })
127
- }, /*#__PURE__*/_react.default.createElement(_FormatUnderlined.default, null))))), (value.fontWeight || value.fontStyle || value.textDecoration) && /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
128
- title: intl.formatMessage({
129
- id: '__clear'
130
- })
131
- }, /*#__PURE__*/_react.default.createElement("div", {
132
- style: {
133
- display: 'inline'
134
- }
135
- }, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
136
- onClick: () => props.updateValue({
137
- style: {
138
- fontWeight: 'delete',
139
- fontStyle: 'delete',
140
- textDecoration: 'delete'
141
- }
142
- })
143
- }, /*#__PURE__*/_react.default.createElement(_Clear.default, null))))));
144
- }
145
-
146
- DashboardsCellStyleWeightStyleDecoration.propTypes = {
147
- intl: _propTypes.default.shape().isRequired,
148
- value: _propTypes.default.shape().isRequired,
149
- updateValue: _propTypes.default.func.isRequired
150
- };
151
-
152
- var _default = (0, _reactIntl.injectIntl)(DashboardsCellStyleWeightStyleDecoration);
153
-
154
- 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 _DashboardsCellStyleWeightStyleDecoration.default;
10
- }
11
- });
12
-
13
- var _DashboardsCellStyleWeightStyleDecoration = _interopRequireDefault(require("./DashboardsCellStyleWeightStyleDecoration"));
14
-
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -1,112 +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 _FormatPaint = _interopRequireDefault(require("@material-ui/icons/FormatPaint"));
11
-
12
- var _FileCopy = _interopRequireDefault(require("@material-ui/icons/FileCopy"));
13
-
14
- var _IconButton = _interopRequireDefault(require("@material-ui/core/IconButton"));
15
-
16
- var _propTypes = _interopRequireDefault(require("prop-types"));
17
-
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
-
20
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
21
-
22
- 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; }
23
-
24
- 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; }
25
-
26
- 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; }
27
-
28
- 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; }
29
-
30
- class DashboardsCopyAndPaste extends _react.Component {
31
- constructor(props) {
32
- super(props);
33
- this.state = {
34
- copy: [],
35
- copySelected: {
36
- row: 0,
37
- column: 0,
38
- cells: []
39
- }
40
- };
41
- }
42
-
43
- updateValue() {
44
- if (this.props.updateValue) {
45
- var newCells = JSON.parse(JSON.stringify(this.props.value));
46
- newCells = newCells.map((oldCell, index) => {
47
- var newCell = _objectSpread({}, this.state.copy[this.state.copy.length > 1 ? index : 0]);
48
-
49
- if (Object.keys(oldCell).includes('row') || Object.keys(oldCell).includes('column')) {
50
- newCell.row = oldCell.row;
51
- newCell.column = oldCell.column;
52
- }
53
-
54
- if (Object.keys(oldCell).includes('x') || Object.keys(oldCell).includes('y') || Object.keys(oldCell).includes('z')) {
55
- newCell.x = oldCell.x;
56
- newCell.y = oldCell.y;
57
- newCell.z = oldCell.z;
58
- }
59
-
60
- if (Object.keys(oldCell).includes('rowSpan') || Object.keys(oldCell).includes('columnSpan')) {
61
- newCell.rowSpan = oldCell.rowSpan;
62
- newCell.columnSpan = oldCell.columnSpan;
63
- }
64
-
65
- return newCell;
66
- });
67
- this.props.updateValue(newCells);
68
- }
69
- }
70
-
71
- render() {
72
- var _this$props = this.props,
73
- value = _this$props.value,
74
- selected = _this$props.selected;
75
- var copySelected = this.state.copySelected;
76
- var canCopy = false;
77
-
78
- if (selected.row > 0 || selected.column > 0 || selected.cells.length === 1) {
79
- canCopy = true;
80
- }
81
-
82
- var canPaste = false;
83
-
84
- if (copySelected.cells.length > 0 && selected.cells.length > 0) {
85
- if (copySelected.row > 0 && selected.row > 0 || copySelected.column > 0 && selected.column > 0) {
86
- canPaste = true;
87
- } else if (copySelected.row === 0 && copySelected.column === 0) {
88
- canPaste = true;
89
- }
90
- }
91
-
92
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
93
- disabled: !canCopy,
94
- onClick: () => this.setState({
95
- copy: value,
96
- copySelected: selected
97
- })
98
- }, /*#__PURE__*/_react.default.createElement(_FileCopy.default, null)), /*#__PURE__*/_react.default.createElement(_IconButton.default, {
99
- disabled: !canPaste,
100
- onClick: () => this.updateValue()
101
- }, /*#__PURE__*/_react.default.createElement(_FormatPaint.default, null)));
102
- }
103
-
104
- }
105
-
106
- DashboardsCopyAndPaste.propTypes = {
107
- selected: _propTypes.default.shape().isRequired,
108
- updateValue: _propTypes.default.func.isRequired,
109
- value: _propTypes.default.arrayOf(_propTypes.default.shape()).isRequired
110
- };
111
- var _default = DashboardsCopyAndPaste;
112
- 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 _DashboardsCopyAndPaste.default;
10
- }
11
- });
12
-
13
- var _DashboardsCopyAndPaste = _interopRequireDefault(require("./DashboardsCopyAndPaste"));
14
-
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }