tenjin-ui-kit 0.3.72-dev-1 → 0.3.73

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 (104) hide show
  1. package/common/hooks/apiHooks.js +91 -199
  2. package/common/hooks/newApiHook.js +127 -258
  3. package/common/utils/security/index.js +2 -2
  4. package/common/utils/security/securityConfig.js +1 -2
  5. package/components/Canvas.js +172 -101
  6. package/components/DragBox/index.js +21 -31
  7. package/components/InputWithChip/index.js +178 -83
  8. package/components/RightContext/index.js +17 -41
  9. package/components/WorkFlow.js +19 -29
  10. package/components/WorkFlowBuilder.js +32 -56
  11. package/components/alert/Style.js +11 -14
  12. package/components/alert/index.js +8 -14
  13. package/components/attachment/index.js +26 -31
  14. package/components/authenticationProvider/AuthError.js +3 -4
  15. package/components/authenticationProvider/AuthLoader.js +3 -4
  16. package/components/authenticationProvider/index.js +58 -130
  17. package/components/avatar/index.js +24 -23
  18. package/components/avatar/styles.js +76 -77
  19. package/components/breadCrumbs/index.js +64 -89
  20. package/components/breadCrumbs/style.js +1 -4
  21. package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/index.js +7 -6
  22. package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/style.js +5 -8
  23. package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewHeader/index.js +7 -6
  24. package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewContent/Index.js +8 -7
  25. package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/Index.js +8 -7
  26. package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/style.js +16 -19
  27. package/components/browsingTestCaseLayout/index.js +30 -46
  28. package/components/button/index.js +47 -58
  29. package/components/chatBotModal/index.js +40 -61
  30. package/components/checkBox/index.js +8 -10
  31. package/components/combobox/index.js +66 -100
  32. package/components/divider/index.js +9 -18
  33. package/components/editableField/index.js +19 -46
  34. package/components/error/index.js +6 -12
  35. package/components/errorBoundary/index.js +74 -98
  36. package/components/fileUploader/index.js +46 -58
  37. package/components/fileUploader/style.js +46 -49
  38. package/components/filter/ValueSelector.js +149 -245
  39. package/components/filter/index.js +45 -71
  40. package/components/iconButton/index.js +3 -4
  41. package/components/input/index.js +60 -74
  42. package/components/layout/index.js +36 -49
  43. package/components/layout/main/index.js +13 -14
  44. package/components/layout/main/style.js +11 -14
  45. package/components/layout/pageContent/index.js +8 -7
  46. package/components/layout/sidebar/FlatMenu.js +51 -47
  47. package/components/layout/sidebar/GroupedIconMenu.js +169 -194
  48. package/components/layout/sidebar/GroupedMenu.js +45 -50
  49. package/components/layout/sidebar/ProjectMenu.js +165 -185
  50. package/components/layout/sidebar/index.js +27 -26
  51. package/components/layout/sidebar/style.js +138 -143
  52. package/components/layout/topBar/ProjectTopbar.js +91 -208
  53. package/components/layout/topBar/UserAvatar.js +53 -69
  54. package/components/layout/topBar/index.js +23 -41
  55. package/components/loader/index.js +9 -12
  56. package/components/menu/index.js +23 -42
  57. package/components/modal/Modal.js +5 -6
  58. package/components/modal/index.js +16 -20
  59. package/components/modal/style.js +53 -56
  60. package/components/optionMenu/index.js +32 -47
  61. package/components/pagination/index.js +23 -43
  62. package/components/pagination/style.js +25 -28
  63. package/components/paginationUpdated/index.js +22 -29
  64. package/components/paper/index.js +20 -22
  65. package/components/paper/style.js +24 -27
  66. package/components/reactSelect/index.js +64 -97
  67. package/components/reactSelect/style.js +131 -151
  68. package/components/richTextEditor/index.js +24 -48
  69. package/components/select/GroupedSelect.js +96 -99
  70. package/components/select/SimpleSelect.js +61 -103
  71. package/components/select/index.js +56 -69
  72. package/components/simpleSelect/index.js +18 -22
  73. package/components/sort/index.js +23 -36
  74. package/components/switch/index.js +14 -15
  75. package/components/switch/style.js +29 -32
  76. package/components/switch/switch.js +30 -47
  77. package/components/table/ReactTable.js +59 -83
  78. package/components/table/SimpleTable.js +67 -91
  79. package/components/table/index.js +300 -206
  80. package/components/text/index.js +22 -30
  81. package/components/timeStamp/index.js +4 -9
  82. package/components/timeStamp/style.js +12 -15
  83. package/components/topBar/index.js +86 -102
  84. package/components/tree/index.js +30 -58
  85. package/components/tree/style.js +20 -23
  86. package/components/valuePicker/ValueSelector.js +78 -160
  87. package/components/valuePicker/index.js +30 -50
  88. package/components/wrapperLayout/layout/index.js +8 -7
  89. package/components/wrapperLayout/main/index.js +8 -7
  90. package/components/wrapperLayout/main/pageContainer/index.js +6 -5
  91. package/components/wrapperLayout/main/sideBar/index.js +171 -175
  92. package/components/wrapperLayout/main/sideBar/style.js +177 -183
  93. package/components/wrapperLayout/topBar/UserAvatar.js +6 -5
  94. package/components/wrapperLayout/topBar/avatar.js +15 -18
  95. package/components/wrapperLayout/topBar/index.js +115 -107
  96. package/components/wrapperLayout/topBar/menuIcon.js +6 -5
  97. package/components/wrapperLayout/topBar/style.js +63 -64
  98. package/http/index.js +92 -188
  99. package/index.js +53 -55
  100. package/package.json +3 -3
  101. package/templates/listPage/index.js +168 -196
  102. package/themes/default.js +5 -7
  103. package/themes/defaultSmall.js +2 -3
  104. package/themes/responsiveTheme.js +6 -8
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
@@ -12,75 +11,155 @@ var _WorkFlow = _interopRequireDefault(require("./WorkFlow"));
12
11
  require("../../App.css");
13
12
  var _material = require("@mui/material");
14
13
  var _text = _interopRequireDefault(require("./text"));
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
18
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
19
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
20
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
21
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
22
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
23
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
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
- 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; }
26
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
27
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
28
- var Canvas = function Canvas() {
14
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
+ 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); }
16
+ // import { Grid } from '@mui/material';
17
+ // import React, { useState } from 'react';
18
+
19
+ // const Canvas = () => {
20
+ // const [inputBoxes, setInputBoxes] = useState([]);
21
+ // let [type, setType] = useState(null);
22
+
23
+ // const addInputBox = () => {
24
+ // setInputBoxes([...inputBoxes, { label: 'Text', value: '' }]);
25
+ // setType('input');
26
+ // };
27
+
28
+ // const handleInputChange = (index, event) => {
29
+ // const values = [...inputBoxes];
30
+ // values[index] = event.target.value;
31
+ // setInputBoxes(values);
32
+ // };
33
+
34
+ // const addIfElseInputBox = () => {
35
+ // setInputBoxes([
36
+ // ...inputBoxes,
37
+ // { label: 'If', value: '' },
38
+ // { label: 'Else', value: '' },
39
+ // ]);
40
+ // setType('if_else');
41
+ // };
42
+
43
+ // // const handleIfElseInputChange = (index, event) => {
44
+ // // const values = [...inputBoxes];
45
+ // // values[index] = event.target.value;
46
+ // // setInputBoxes(values);
47
+ // // };
48
+
49
+ // return (
50
+ // <div
51
+ // style={{
52
+ // border: '1px solid black',
53
+ // padding: '10px',
54
+ // display: 'inline-block',
55
+ // }}
56
+ // >
57
+ // <div
58
+ // style={{
59
+ // display: 'flex',
60
+ // justifyContent: 'center',
61
+ // alignItems: 'center',
62
+ // }}
63
+ // >
64
+ // <div
65
+ // style={{ fontSize: '30px', cursor: 'pointer' }}
66
+ // onClick={addInputBox}
67
+ // title="Add Text Box"
68
+ // >
69
+ // +
70
+ // </div>
71
+ // </div>
72
+ // <div
73
+ // style={{
74
+ // display: 'flex',
75
+ // justifyContent: 'center',
76
+ // alignItems: 'center',
77
+ // }}
78
+ // >
79
+ // <div
80
+ // style={{ fontSize: '30px', cursor: 'pointer' }}
81
+ // onClick={addIfElseInputBox}
82
+ // title="Add If Else Box"
83
+ // >
84
+ // +
85
+ // </div>
86
+ // </div>
87
+
88
+ // {inputBoxes.map((box, index) => (
89
+ // <Grid item container>
90
+ // <Grid item xs>
91
+ // <div
92
+ // style={{
93
+ // border: '1px solid black',
94
+ // padding: '10px',
95
+ // display: 'inline-block',
96
+ // }}
97
+ // >
98
+ // <div key={index} style={{ marginTop: '1rem' }}>
99
+ // <label htmlFor={`${type}-${index}`}>{box.label}</label>
100
+ // <br />
101
+ // <input
102
+ // id={`${type}-${index}`}
103
+ // type="text"
104
+ // value={box.value}
105
+ // onChange={(e) => {
106
+ // const updatedBoxes = [...inputBoxes];
107
+ // updatedBoxes[index].value = e.target.value;
108
+ // setInputBoxes(updatedBoxes);
109
+ // }}
110
+ // />
111
+ // </div>
112
+ // </div>
113
+ // </Grid>
114
+ // </Grid>
115
+ // ))}
116
+ // </div>
117
+ // );
118
+ // };
119
+
120
+ // export default Canvas;
121
+
122
+ ///New
123
+
124
+ const Canvas = () => {
29
125
  return /*#__PURE__*/_react.default.createElement(_reactDnd.DndProvider, {
30
126
  backend: _reactDndHtml5Backend.HTML5Backend
31
127
  }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(DragDrop, null)));
32
128
  };
33
- var _default = Canvas;
34
- exports.default = _default;
35
- var WorkFlowList = [{
129
+ var _default = exports.default = Canvas;
130
+ const WorkFlowList = [{
36
131
  id: 1,
37
132
  name: "If Else Box"
38
133
  }, {
39
134
  id: 2,
40
135
  name: "Simple Text Box"
41
136
  }];
42
- var DragDrop = function DragDrop() {
43
- var _useState = (0, _react.useState)([]),
44
- _useState2 = _slicedToArray(_useState, 2),
45
- board = _useState2[0],
46
- setBoard = _useState2[1];
47
- var _useDrop = (0, _reactDnd.useDrop)(function () {
48
- return {
49
- accept: "block",
50
- drop: function drop(item) {
51
- return addBlockToBoard(item.id, true);
52
- },
53
- collect: function collect(monitor) {
54
- return {
55
- isOver: !!monitor.isOver()
56
- };
57
- }
58
- };
59
- }),
60
- _useDrop2 = _slicedToArray(_useDrop, 2),
61
- isOver = _useDrop2[0].isOver,
62
- drop = _useDrop2[1];
63
- var addBlockToBoard = function addBlockToBoard(id, isDropped) {
64
- var workFlowList = WorkFlowList.filter(function (workflow) {
65
- return id === workflow.id;
66
- });
67
- var workflow = {
137
+ const DragDrop = () => {
138
+ const [board, setBoard] = (0, _react.useState)([]);
139
+ const [{
140
+ isOver
141
+ }, drop] = (0, _reactDnd.useDrop)(() => ({
142
+ accept: "block",
143
+ drop: item => addBlockToBoard(item.id, true),
144
+ collect: monitor => ({
145
+ isOver: !!monitor.isOver()
146
+ })
147
+ }));
148
+ const addBlockToBoard = (id, isDropped) => {
149
+ const workFlowList = WorkFlowList.filter(workflow => id === workflow.id);
150
+ const workflow = {
68
151
  name: workFlowList[0].name,
69
152
  id: workFlowList[0].id
70
153
  };
71
154
  if (isDropped) {
72
- setBoard(function (board) {
73
- return [].concat(_toConsumableArray(board), [workflow]);
74
- });
155
+ setBoard(board => [...board, workflow]);
75
156
  } else {
76
- setBoard(function (board) {
77
- return [].concat(_toConsumableArray(board), [workflow.name]);
78
- });
157
+ setBoard(board => [...board, workflow.name]);
79
158
  }
80
159
  };
81
160
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
82
161
  className: "WorkFlow"
83
- }, WorkFlowList === null || WorkFlowList === void 0 ? void 0 : WorkFlowList.map(function (workflow) {
162
+ }, WorkFlowList?.map(workflow => {
84
163
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_WorkFlow.default, {
85
164
  name: workflow.name,
86
165
  id: workflow.id
@@ -88,7 +167,7 @@ var DragDrop = function DragDrop() {
88
167
  })), /*#__PURE__*/_react.default.createElement("div", {
89
168
  className: "Board",
90
169
  ref: drop
91
- }, board === null || board === void 0 ? void 0 : board.map(function (workflow, index) {
170
+ }, board?.map((workflow, index) => {
92
171
  return /*#__PURE__*/_react.default.createElement("div", {
93
172
  key: index
94
173
  }, workflow.name === "If Else Box" ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
@@ -148,35 +227,29 @@ var DragDrop = function DragDrop() {
148
227
  }));
149
228
  };
150
229
  exports.DragDrop = DragDrop;
151
- var AddNewBox = function AddNewBox() {
152
- var _useState3 = (0, _react.useState)([]),
153
- _useState4 = _slicedToArray(_useState3, 2),
154
- inputBoxes = _useState4[0],
155
- setInputBoxes = _useState4[1];
156
- var _useState5 = (0, _react.useState)(null),
157
- _useState6 = _slicedToArray(_useState5, 2),
158
- type = _useState6[0],
159
- setType = _useState6[1];
160
- var addInputBox = function addInputBox() {
161
- setInputBoxes([].concat(_toConsumableArray(inputBoxes), [{
230
+ const AddNewBox = () => {
231
+ const [inputBoxes, setInputBoxes] = (0, _react.useState)([]);
232
+ let [type, setType] = (0, _react.useState)(null);
233
+ const addInputBox = () => {
234
+ setInputBoxes([...inputBoxes, {
162
235
  label: "Text",
163
236
  value: ""
164
- }]));
237
+ }]);
165
238
  setType("input");
166
239
  };
167
- var handleInputChange = function handleInputChange(index, event) {
168
- var values = _toConsumableArray(inputBoxes);
240
+ const handleInputChange = (index, event) => {
241
+ const values = [...inputBoxes];
169
242
  values[index] = event.target.value;
170
243
  setInputBoxes(values);
171
244
  };
172
- var addIfElseInputBox = function addIfElseInputBox() {
173
- setInputBoxes([].concat(_toConsumableArray(inputBoxes), [{
245
+ const addIfElseInputBox = () => {
246
+ setInputBoxes([...inputBoxes, {
174
247
  label: "If",
175
248
  value: ""
176
249
  }, {
177
250
  label: "Else",
178
251
  value: ""
179
- }]));
252
+ }]);
180
253
  setType("if_else");
181
254
  };
182
255
 
@@ -218,37 +291,35 @@ var AddNewBox = function AddNewBox() {
218
291
  },
219
292
  onClick: addIfElseInputBox,
220
293
  title: "Add If Else Box"
221
- }, /*#__PURE__*/_react.default.createElement(_text.default, null, "+"))), inputBoxes.map(function (box, index) {
222
- return /*#__PURE__*/_react.default.createElement(_material.Grid, {
223
- item: true,
224
- container: true
225
- }, /*#__PURE__*/_react.default.createElement(_material.Grid, {
226
- item: true,
227
- xs: true
228
- }, /*#__PURE__*/_react.default.createElement("div", {
229
- style: {
230
- border: "1px solid black",
231
- padding: "10px",
232
- display: "inline-block",
233
- margin: "0.5rem"
234
- }
235
- }, /*#__PURE__*/_react.default.createElement("div", {
236
- key: index,
237
- style: {
238
- marginTop: "1rem"
239
- }
240
- }, /*#__PURE__*/_react.default.createElement("label", {
241
- htmlFor: "".concat(type, "-").concat(index)
242
- }, /*#__PURE__*/_react.default.createElement(_text.default, null, box.label)), /*#__PURE__*/_react.default.createElement("br", null), /*#__PURE__*/_react.default.createElement("input", {
243
- id: "".concat(type, "-").concat(index),
244
- type: "text",
245
- value: box.value,
246
- onChange: function onChange(e) {
247
- var updatedBoxes = _toConsumableArray(inputBoxes);
248
- updatedBoxes[index].value = e.target.value;
249
- setInputBoxes(updatedBoxes);
250
- }
251
- })))));
252
- }));
294
+ }, /*#__PURE__*/_react.default.createElement(_text.default, null, "+"))), inputBoxes.map((box, index) => /*#__PURE__*/_react.default.createElement(_material.Grid, {
295
+ item: true,
296
+ container: true
297
+ }, /*#__PURE__*/_react.default.createElement(_material.Grid, {
298
+ item: true,
299
+ xs: true
300
+ }, /*#__PURE__*/_react.default.createElement("div", {
301
+ style: {
302
+ border: "1px solid black",
303
+ padding: "10px",
304
+ display: "inline-block",
305
+ margin: "0.5rem"
306
+ }
307
+ }, /*#__PURE__*/_react.default.createElement("div", {
308
+ key: index,
309
+ style: {
310
+ marginTop: "1rem"
311
+ }
312
+ }, /*#__PURE__*/_react.default.createElement("label", {
313
+ htmlFor: `${type}-${index}`
314
+ }, /*#__PURE__*/_react.default.createElement(_text.default, null, box.label)), /*#__PURE__*/_react.default.createElement("br", null), /*#__PURE__*/_react.default.createElement("input", {
315
+ id: `${type}-${index}`,
316
+ type: "text",
317
+ value: box.value,
318
+ onChange: e => {
319
+ const updatedBoxes = [...inputBoxes];
320
+ updatedBoxes[index].value = e.target.value;
321
+ setInputBoxes(updatedBoxes);
322
+ }
323
+ })))))));
253
324
  };
254
325
  exports.AddNewBox = AddNewBox;
@@ -7,39 +7,29 @@ exports.DragBox = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _reactDnd = require("react-dnd");
9
9
  var _text = _interopRequireDefault(require("../text"));
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
12
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
13
- 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); }
14
- 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; }
15
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
16
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
17
- var DragBox = function DragBox(_ref) {
18
- var name = _ref.name;
19
- var _useDrag = (0, _reactDnd.useDrag)(function () {
20
- return {
21
- type: "box",
22
- item: {
23
- name: name
24
- },
25
- collect: function collect(monitor) {
26
- return {
27
- isDragging: monitor.isDragging(),
28
- handlerId: monitor.getHandlerId()
29
- };
30
- }
31
- };
32
- }),
33
- _useDrag2 = _slicedToArray(_useDrag, 2),
34
- isDragging = _useDrag2[0].isDragging,
35
- drag = _useDrag2[1];
36
- var opacity = isDragging ? 0.4 : 1;
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ const DragBox = exports.DragBox = function DragBox(_ref) {
12
+ let {
13
+ name
14
+ } = _ref;
15
+ const [{
16
+ isDragging
17
+ }, drag] = (0, _reactDnd.useDrag)(() => ({
18
+ type: "box",
19
+ item: {
20
+ name
21
+ },
22
+ collect: monitor => ({
23
+ isDragging: monitor.isDragging(),
24
+ handlerId: monitor.getHandlerId()
25
+ })
26
+ }));
27
+ const opacity = isDragging ? 0.4 : 1;
37
28
  return /*#__PURE__*/_react.default.createElement("div", {
38
29
  ref: drag,
39
30
  style: {
40
- opacity: opacity
31
+ opacity
41
32
  },
42
- "data-testid": "box"
33
+ "data-testid": `box`
43
34
  }, /*#__PURE__*/_react.default.createElement(_text.default, null, name));
44
- };
45
- exports.DragBox = DragBox;
35
+ };