tenjin-ui-kit 0.3.73 → 0.3.74
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.
- package/README.md +13 -13
- package/common/hooks/apiHooks.js +199 -91
- package/common/hooks/newApiHook.js +258 -127
- package/common/utils/security/index.js +2 -2
- package/common/utils/security/securityConfig.js +2 -1
- package/components/Canvas.js +101 -172
- package/components/DragBox/index.js +31 -21
- package/components/InputWithChip/index.js +83 -178
- package/components/RightContext/index.css +20 -20
- package/components/RightContext/index.js +41 -17
- package/components/WorkFlow.js +29 -19
- package/components/WorkFlowBuilder.js +56 -32
- package/components/alert/Style.js +14 -11
- package/components/alert/index.js +14 -8
- package/components/attachment/index.js +31 -26
- package/components/authenticationProvider/AuthError.js +4 -3
- package/components/authenticationProvider/AuthLoader.js +4 -3
- package/components/authenticationProvider/index.js +130 -58
- package/components/avatar/index.js +23 -24
- package/components/avatar/styles.js +77 -76
- package/components/breadCrumbs/index.js +89 -64
- package/components/breadCrumbs/style.js +4 -1
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/index.js +6 -7
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/style.js +8 -5
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewHeader/index.js +6 -7
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewContent/Index.js +7 -8
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/Index.js +7 -8
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/style.js +19 -16
- package/components/browsingTestCaseLayout/index.js +46 -30
- package/components/browsingTestCaseLayout/style.css +82 -82
- package/components/button/index.js +58 -47
- package/components/chatBotModal/index.js +61 -40
- package/components/checkBox/index.js +10 -8
- package/components/combobox/index.js +216 -182
- package/components/divider/index.js +18 -9
- package/components/editableField/index.js +46 -19
- package/components/error/index.js +12 -6
- package/components/errorBoundary/index.js +98 -74
- package/components/fileUploader/index.js +58 -46
- package/components/fileUploader/style.js +49 -46
- package/components/filter/ValueSelector.js +243 -148
- package/components/filter/index.js +66 -43
- package/components/iconButton/index.js +4 -3
- package/components/input/index.js +74 -60
- package/components/layout/index.js +49 -36
- package/components/layout/main/index.js +14 -13
- package/components/layout/main/style.js +14 -11
- package/components/layout/pageContent/index.js +7 -8
- package/components/layout/sidebar/FlatMenu.js +47 -51
- package/components/layout/sidebar/GroupedIconMenu.js +194 -169
- package/components/layout/sidebar/GroupedMenu.js +50 -45
- package/components/layout/sidebar/ProjectMenu.js +185 -165
- package/components/layout/sidebar/index.js +26 -27
- package/components/layout/sidebar/style.js +143 -138
- package/components/layout/topBar/ProjectTopbar.js +119 -86
- package/components/layout/topBar/UserAvatar.js +65 -51
- package/components/layout/topBar/index.js +41 -23
- package/components/loader/index.js +12 -9
- package/components/menu/index.js +42 -23
- package/components/modal/Modal.js +6 -5
- package/components/modal/index.js +20 -16
- package/components/modal/style.js +56 -53
- package/components/optionMenu/index.js +72 -57
- package/components/pagination/index.js +43 -23
- package/components/pagination/style.js +28 -25
- package/components/paginationUpdated/index.js +26 -19
- package/components/paper/index.js +22 -20
- package/components/paper/style.js +27 -24
- package/components/reactSelect/index.js +97 -64
- package/components/reactSelect/style.js +151 -131
- package/components/richTextEditor/index.js +48 -24
- package/components/select/GroupedSelect.js +100 -56
- package/components/select/SimpleSelect.js +99 -59
- package/components/select/index.js +69 -56
- package/components/simpleSelect/index.js +22 -18
- package/components/sort/index.js +36 -23
- package/components/switch/index.js +15 -14
- package/components/switch/style.js +32 -29
- package/components/switch/switch.js +47 -30
- package/components/table/ReactTable.js +83 -59
- package/components/table/SimpleTable.js +91 -67
- package/components/table/index.js +206 -300
- package/components/text/index.js +30 -22
- package/components/timeStamp/index.js +6 -4
- package/components/timeStamp/style.js +15 -12
- package/components/topBar/index.js +102 -86
- package/components/tree/index.js +58 -30
- package/components/tree/style.js +23 -20
- package/components/valuePicker/ValueSelector.js +160 -78
- package/components/valuePicker/index.js +50 -30
- package/components/wrapperLayout/layout/index.js +7 -8
- package/components/wrapperLayout/main/index.js +7 -8
- package/components/wrapperLayout/main/pageContainer/index.js +5 -6
- package/components/wrapperLayout/main/sideBar/index.js +175 -171
- package/components/wrapperLayout/main/sideBar/style.js +183 -177
- package/components/wrapperLayout/topBar/UserAvatar.js +5 -6
- package/components/wrapperLayout/topBar/avatar.js +18 -15
- package/components/wrapperLayout/topBar/index.js +107 -115
- package/components/wrapperLayout/topBar/menuIcon.js +5 -6
- package/components/wrapperLayout/topBar/style.js +64 -63
- package/http/index.js +188 -92
- package/index.js +55 -53
- package/package.json +124 -125
- package/templates/listPage/index.js +196 -168
- package/themes/default.js +7 -5
- package/themes/defaultSmall.js +3 -2
- package/themes/responsiveTheme.js +8 -6
package/components/Canvas.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
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); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -11,155 +12,75 @@ var _WorkFlow = _interopRequireDefault(require("./WorkFlow"));
|
|
|
11
12
|
require("../../App.css");
|
|
12
13
|
var _material = require("@mui/material");
|
|
13
14
|
var _text = _interopRequireDefault(require("./text"));
|
|
14
|
-
function _interopRequireDefault(
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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 = () => {
|
|
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() {
|
|
125
29
|
return /*#__PURE__*/_react.default.createElement(_reactDnd.DndProvider, {
|
|
126
30
|
backend: _reactDndHtml5Backend.HTML5Backend
|
|
127
31
|
}, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(DragDrop, null)));
|
|
128
32
|
};
|
|
129
|
-
var _default =
|
|
130
|
-
|
|
33
|
+
var _default = Canvas;
|
|
34
|
+
exports.default = _default;
|
|
35
|
+
var WorkFlowList = [{
|
|
131
36
|
id: 1,
|
|
132
37
|
name: "If Else Box"
|
|
133
38
|
}, {
|
|
134
39
|
id: 2,
|
|
135
40
|
name: "Simple Text Box"
|
|
136
41
|
}];
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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 = {
|
|
151
68
|
name: workFlowList[0].name,
|
|
152
69
|
id: workFlowList[0].id
|
|
153
70
|
};
|
|
154
71
|
if (isDropped) {
|
|
155
|
-
setBoard(
|
|
72
|
+
setBoard(function (board) {
|
|
73
|
+
return [].concat(_toConsumableArray(board), [workflow]);
|
|
74
|
+
});
|
|
156
75
|
} else {
|
|
157
|
-
setBoard(
|
|
76
|
+
setBoard(function (board) {
|
|
77
|
+
return [].concat(_toConsumableArray(board), [workflow.name]);
|
|
78
|
+
});
|
|
158
79
|
}
|
|
159
80
|
};
|
|
160
81
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
161
82
|
className: "WorkFlow"
|
|
162
|
-
}, WorkFlowList
|
|
83
|
+
}, WorkFlowList === null || WorkFlowList === void 0 ? void 0 : WorkFlowList.map(function (workflow) {
|
|
163
84
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_WorkFlow.default, {
|
|
164
85
|
name: workflow.name,
|
|
165
86
|
id: workflow.id
|
|
@@ -167,7 +88,7 @@ const DragDrop = () => {
|
|
|
167
88
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
168
89
|
className: "Board",
|
|
169
90
|
ref: drop
|
|
170
|
-
}, board
|
|
91
|
+
}, board === null || board === void 0 ? void 0 : board.map(function (workflow, index) {
|
|
171
92
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
172
93
|
key: index
|
|
173
94
|
}, workflow.name === "If Else Box" ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -227,29 +148,35 @@ const DragDrop = () => {
|
|
|
227
148
|
}));
|
|
228
149
|
};
|
|
229
150
|
exports.DragDrop = DragDrop;
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
setInputBoxes
|
|
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), [{
|
|
235
162
|
label: "Text",
|
|
236
163
|
value: ""
|
|
237
|
-
}]);
|
|
164
|
+
}]));
|
|
238
165
|
setType("input");
|
|
239
166
|
};
|
|
240
|
-
|
|
241
|
-
|
|
167
|
+
var handleInputChange = function handleInputChange(index, event) {
|
|
168
|
+
var values = _toConsumableArray(inputBoxes);
|
|
242
169
|
values[index] = event.target.value;
|
|
243
170
|
setInputBoxes(values);
|
|
244
171
|
};
|
|
245
|
-
|
|
246
|
-
setInputBoxes([
|
|
172
|
+
var addIfElseInputBox = function addIfElseInputBox() {
|
|
173
|
+
setInputBoxes([].concat(_toConsumableArray(inputBoxes), [{
|
|
247
174
|
label: "If",
|
|
248
175
|
value: ""
|
|
249
176
|
}, {
|
|
250
177
|
label: "Else",
|
|
251
178
|
value: ""
|
|
252
|
-
}]);
|
|
179
|
+
}]));
|
|
253
180
|
setType("if_else");
|
|
254
181
|
};
|
|
255
182
|
|
|
@@ -291,35 +218,37 @@ const AddNewBox = () => {
|
|
|
291
218
|
},
|
|
292
219
|
onClick: addIfElseInputBox,
|
|
293
220
|
title: "Add If Else Box"
|
|
294
|
-
}, /*#__PURE__*/_react.default.createElement(_text.default, null, "+"))), inputBoxes.map((box, index)
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
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
|
+
}));
|
|
324
253
|
};
|
|
325
254
|
exports.AddNewBox = AddNewBox;
|
|
@@ -7,29 +7,39 @@ 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(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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;
|
|
28
37
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
29
38
|
ref: drag,
|
|
30
39
|
style: {
|
|
31
|
-
opacity
|
|
40
|
+
opacity: opacity
|
|
32
41
|
},
|
|
33
|
-
"data-testid":
|
|
42
|
+
"data-testid": "box"
|
|
34
43
|
}, /*#__PURE__*/_react.default.createElement(_text.default, null, name));
|
|
35
|
-
};
|
|
44
|
+
};
|
|
45
|
+
exports.DragBox = DragBox;
|