tenjin-ui-kit 0.3.72-dev → 0.3.72-dev-1
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/common/hooks/apiHooks.js +182 -114
- package/common/hooks/newApiHook.js +225 -143
- package/common/utils/security/index.js +2 -2
- package/common/utils/security/securityConfig.js +2 -1
- package/components/Canvas.js +88 -164
- package/components/DragBox/index.js +26 -21
- package/components/InputWithChip/index.js +57 -164
- package/components/RightContext/index.js +28 -19
- package/components/WorkFlow.js +23 -18
- package/components/WorkFlowBuilder.js +48 -33
- package/components/alert/Style.js +14 -11
- package/components/alert/index.js +12 -10
- package/components/attachment/index.js +28 -21
- package/components/authenticationProvider/AuthError.js +4 -3
- package/components/authenticationProvider/AuthLoader.js +4 -3
- package/components/authenticationProvider/index.js +116 -60
- package/components/avatar/index.js +14 -13
- package/components/avatar/styles.js +77 -74
- package/components/breadCrumbs/index.js +53 -42
- package/components/breadCrumbs/style.js +4 -1
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/index.js +6 -5
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/style.js +8 -5
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewHeader/index.js +5 -4
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewContent/Index.js +5 -4
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/Index.js +6 -5
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/style.js +19 -16
- package/components/browsingTestCaseLayout/index.js +30 -25
- package/components/button/index.js +43 -36
- package/components/chatBotModal/index.js +45 -36
- package/components/checkBox/index.js +9 -8
- package/components/combobox/index.js +72 -51
- package/components/divider/index.js +18 -14
- package/components/editableField/index.js +28 -19
- package/components/error/index.js +12 -6
- package/components/errorBoundary/index.js +94 -74
- package/components/fileUploader/index.js +35 -30
- package/components/fileUploader/style.js +49 -46
- package/components/filter/ValueSelector.js +210 -137
- package/components/filter/index.js +39 -29
- package/components/iconButton/index.js +4 -3
- package/components/input/index.js +38 -31
- package/components/layout/index.js +31 -27
- package/components/layout/main/index.js +13 -10
- package/components/layout/main/style.js +14 -11
- package/components/layout/pageContent/index.js +7 -6
- package/components/layout/sidebar/FlatMenu.js +43 -43
- package/components/layout/sidebar/GroupedIconMenu.js +108 -95
- package/components/layout/sidebar/GroupedMenu.js +48 -38
- package/components/layout/sidebar/ProjectMenu.js +116 -109
- package/components/layout/sidebar/index.js +18 -15
- package/components/layout/sidebar/style.js +143 -138
- package/components/layout/topBar/ProjectTopbar.js +138 -104
- package/components/layout/topBar/UserAvatar.js +60 -51
- package/components/layout/topBar/index.js +33 -22
- package/components/loader/index.js +12 -9
- package/components/menu/index.js +35 -26
- package/components/modal/Modal.js +6 -5
- package/components/modal/index.js +13 -10
- package/components/modal/style.js +56 -53
- package/components/optionMenu/index.js +41 -34
- package/components/pagination/index.js +39 -24
- package/components/pagination/style.js +28 -25
- package/components/paginationUpdated/index.js +16 -14
- package/components/paper/index.js +16 -15
- package/components/paper/style.js +27 -24
- package/components/reactSelect/index.js +63 -46
- package/components/reactSelect/style.js +150 -117
- package/components/richTextEditor/index.js +44 -25
- package/components/select/GroupedSelect.js +61 -45
- package/components/select/SimpleSelect.js +82 -52
- package/components/select/index.js +54 -38
- package/components/simpleSelect/index.js +15 -12
- package/components/sort/index.js +22 -19
- package/components/switch/index.js +11 -10
- package/components/switch/style.js +32 -29
- package/components/switch/switch.js +23 -17
- package/components/table/ReactTable.js +71 -54
- package/components/table/SimpleTable.js +78 -59
- package/components/table/index.js +186 -311
- package/components/text/index.js +17 -15
- package/components/timeStamp/index.js +9 -4
- package/components/timeStamp/style.js +15 -12
- package/components/topBar/index.js +92 -85
- package/components/tree/index.js +47 -29
- package/components/tree/style.js +23 -20
- package/components/valuePicker/ValueSelector.js +138 -70
- package/components/valuePicker/index.js +26 -19
- package/components/wrapperLayout/layout/index.js +5 -4
- package/components/wrapperLayout/main/index.js +5 -4
- package/components/wrapperLayout/main/pageContainer/index.js +5 -4
- package/components/wrapperLayout/main/sideBar/index.js +110 -120
- package/components/wrapperLayout/main/sideBar/style.js +183 -177
- package/components/wrapperLayout/topBar/UserAvatar.js +5 -4
- package/components/wrapperLayout/topBar/avatar.js +12 -10
- package/components/wrapperLayout/topBar/index.js +97 -111
- package/components/wrapperLayout/topBar/menuIcon.js +5 -4
- package/components/wrapperLayout/topBar/style.js +64 -61
- package/http/index.js +184 -91
- package/index.js +55 -53
- package/package.json +2 -4
- package/templates/listPage/index.js +57 -36
- 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,154 +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
|
-
function
|
|
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(); }
|
|
17
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."); }
|
|
18
|
-
function _unsupportedIterableToArray(
|
|
19
|
-
function _arrayLikeToArray(
|
|
20
|
-
function _iterableToArrayLimit(
|
|
21
|
-
function _arrayWithHoles(
|
|
22
|
-
|
|
23
|
-
// const Canvas = () => {
|
|
24
|
-
// const [inputBoxes, setInputBoxes] = useState([]);
|
|
25
|
-
// let [type, setType] = useState(null);
|
|
26
|
-
// const addInputBox = () => {
|
|
27
|
-
// setInputBoxes([...inputBoxes, { label: 'Text', value: '' }]);
|
|
28
|
-
// setType('input');
|
|
29
|
-
// };
|
|
30
|
-
// const handleInputChange = (index, event) => {
|
|
31
|
-
// const values = [...inputBoxes];
|
|
32
|
-
// values[index] = event.target.value;
|
|
33
|
-
// setInputBoxes(values);
|
|
34
|
-
// };
|
|
35
|
-
// const addIfElseInputBox = () => {
|
|
36
|
-
// setInputBoxes([
|
|
37
|
-
// ...inputBoxes,
|
|
38
|
-
// { label: 'If', value: '' },
|
|
39
|
-
// { label: 'Else', value: '' },
|
|
40
|
-
// ]);
|
|
41
|
-
// setType('if_else');
|
|
42
|
-
// };
|
|
43
|
-
// // const handleIfElseInputChange = (index, event) => {
|
|
44
|
-
// // const values = [...inputBoxes];
|
|
45
|
-
// // values[index] = event.target.value;
|
|
46
|
-
// // setInputBoxes(values);
|
|
47
|
-
// // };
|
|
48
|
-
// return (
|
|
49
|
-
// <div
|
|
50
|
-
// style={{
|
|
51
|
-
// border: '1px solid black',
|
|
52
|
-
// padding: '10px',
|
|
53
|
-
// display: 'inline-block',
|
|
54
|
-
// }}
|
|
55
|
-
// >
|
|
56
|
-
// <div
|
|
57
|
-
// style={{
|
|
58
|
-
// display: 'flex',
|
|
59
|
-
// justifyContent: 'center',
|
|
60
|
-
// alignItems: 'center',
|
|
61
|
-
// }}
|
|
62
|
-
// >
|
|
63
|
-
// <div
|
|
64
|
-
// style={{ fontSize: '30px', cursor: 'pointer' }}
|
|
65
|
-
// onClick={addInputBox}
|
|
66
|
-
// title="Add Text Box"
|
|
67
|
-
// >
|
|
68
|
-
// +
|
|
69
|
-
// </div>
|
|
70
|
-
// </div>
|
|
71
|
-
// <div
|
|
72
|
-
// style={{
|
|
73
|
-
// display: 'flex',
|
|
74
|
-
// justifyContent: 'center',
|
|
75
|
-
// alignItems: 'center',
|
|
76
|
-
// }}
|
|
77
|
-
// >
|
|
78
|
-
// <div
|
|
79
|
-
// style={{ fontSize: '30px', cursor: 'pointer' }}
|
|
80
|
-
// onClick={addIfElseInputBox}
|
|
81
|
-
// title="Add If Else Box"
|
|
82
|
-
// >
|
|
83
|
-
// +
|
|
84
|
-
// </div>
|
|
85
|
-
// </div>
|
|
86
|
-
// {inputBoxes.map((box, index) => (
|
|
87
|
-
// <Grid item container>
|
|
88
|
-
// <Grid item xs>
|
|
89
|
-
// <div
|
|
90
|
-
// style={{
|
|
91
|
-
// border: '1px solid black',
|
|
92
|
-
// padding: '10px',
|
|
93
|
-
// display: 'inline-block',
|
|
94
|
-
// }}
|
|
95
|
-
// >
|
|
96
|
-
// <div key={index} style={{ marginTop: '1rem' }}>
|
|
97
|
-
// <label htmlFor={`${type}-${index}`}>{box.label}</label>
|
|
98
|
-
// <br />
|
|
99
|
-
// <input
|
|
100
|
-
// id={`${type}-${index}`}
|
|
101
|
-
// type="text"
|
|
102
|
-
// value={box.value}
|
|
103
|
-
// onChange={(e) => {
|
|
104
|
-
// const updatedBoxes = [...inputBoxes];
|
|
105
|
-
// updatedBoxes[index].value = e.target.value;
|
|
106
|
-
// setInputBoxes(updatedBoxes);
|
|
107
|
-
// }}
|
|
108
|
-
// />
|
|
109
|
-
// </div>
|
|
110
|
-
// </div>
|
|
111
|
-
// </Grid>
|
|
112
|
-
// </Grid>
|
|
113
|
-
// ))}
|
|
114
|
-
// </div>
|
|
115
|
-
// );
|
|
116
|
-
// };
|
|
117
|
-
// export default Canvas;
|
|
118
|
-
///New
|
|
119
|
-
const Canvas = () => {
|
|
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() {
|
|
120
29
|
return /*#__PURE__*/_react.default.createElement(_reactDnd.DndProvider, {
|
|
121
30
|
backend: _reactDndHtml5Backend.HTML5Backend
|
|
122
31
|
}, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(DragDrop, null)));
|
|
123
32
|
};
|
|
124
|
-
var _default =
|
|
125
|
-
|
|
33
|
+
var _default = Canvas;
|
|
34
|
+
exports.default = _default;
|
|
35
|
+
var WorkFlowList = [{
|
|
126
36
|
id: 1,
|
|
127
37
|
name: "If Else Box"
|
|
128
38
|
}, {
|
|
129
39
|
id: 2,
|
|
130
40
|
name: "Simple Text Box"
|
|
131
41
|
}];
|
|
132
|
-
|
|
133
|
-
|
|
42
|
+
var DragDrop = function DragDrop() {
|
|
43
|
+
var _useState = (0, _react.useState)([]),
|
|
134
44
|
_useState2 = _slicedToArray(_useState, 2),
|
|
135
45
|
board = _useState2[0],
|
|
136
46
|
setBoard = _useState2[1];
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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
|
+
}),
|
|
144
60
|
_useDrop2 = _slicedToArray(_useDrop, 2),
|
|
145
61
|
isOver = _useDrop2[0].isOver,
|
|
146
62
|
drop = _useDrop2[1];
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
63
|
+
var addBlockToBoard = function addBlockToBoard(id, isDropped) {
|
|
64
|
+
var workFlowList = WorkFlowList.filter(function (workflow) {
|
|
65
|
+
return id === workflow.id;
|
|
66
|
+
});
|
|
67
|
+
var workflow = {
|
|
150
68
|
name: workFlowList[0].name,
|
|
151
69
|
id: workFlowList[0].id
|
|
152
70
|
};
|
|
153
71
|
if (isDropped) {
|
|
154
|
-
setBoard(
|
|
72
|
+
setBoard(function (board) {
|
|
73
|
+
return [].concat(_toConsumableArray(board), [workflow]);
|
|
74
|
+
});
|
|
155
75
|
} else {
|
|
156
|
-
setBoard(
|
|
76
|
+
setBoard(function (board) {
|
|
77
|
+
return [].concat(_toConsumableArray(board), [workflow.name]);
|
|
78
|
+
});
|
|
157
79
|
}
|
|
158
80
|
};
|
|
159
81
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
160
82
|
className: "WorkFlow"
|
|
161
|
-
}, WorkFlowList === null || WorkFlowList === void 0 ? void 0 : WorkFlowList.map(workflow
|
|
83
|
+
}, WorkFlowList === null || WorkFlowList === void 0 ? void 0 : WorkFlowList.map(function (workflow) {
|
|
162
84
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_WorkFlow.default, {
|
|
163
85
|
name: workflow.name,
|
|
164
86
|
id: workflow.id
|
|
@@ -166,7 +88,7 @@ const DragDrop = () => {
|
|
|
166
88
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
167
89
|
className: "Board",
|
|
168
90
|
ref: drop
|
|
169
|
-
}, board === null || board === void 0 ? void 0 : board.map((workflow, index)
|
|
91
|
+
}, board === null || board === void 0 ? void 0 : board.map(function (workflow, index) {
|
|
170
92
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
171
93
|
key: index
|
|
172
94
|
}, workflow.name === "If Else Box" ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -226,35 +148,35 @@ const DragDrop = () => {
|
|
|
226
148
|
}));
|
|
227
149
|
};
|
|
228
150
|
exports.DragDrop = DragDrop;
|
|
229
|
-
|
|
230
|
-
|
|
151
|
+
var AddNewBox = function AddNewBox() {
|
|
152
|
+
var _useState3 = (0, _react.useState)([]),
|
|
231
153
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
232
154
|
inputBoxes = _useState4[0],
|
|
233
155
|
setInputBoxes = _useState4[1];
|
|
234
|
-
|
|
156
|
+
var _useState5 = (0, _react.useState)(null),
|
|
235
157
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
236
158
|
type = _useState6[0],
|
|
237
159
|
setType = _useState6[1];
|
|
238
|
-
|
|
239
|
-
setInputBoxes([
|
|
160
|
+
var addInputBox = function addInputBox() {
|
|
161
|
+
setInputBoxes([].concat(_toConsumableArray(inputBoxes), [{
|
|
240
162
|
label: "Text",
|
|
241
163
|
value: ""
|
|
242
|
-
}]);
|
|
164
|
+
}]));
|
|
243
165
|
setType("input");
|
|
244
166
|
};
|
|
245
|
-
|
|
246
|
-
|
|
167
|
+
var handleInputChange = function handleInputChange(index, event) {
|
|
168
|
+
var values = _toConsumableArray(inputBoxes);
|
|
247
169
|
values[index] = event.target.value;
|
|
248
170
|
setInputBoxes(values);
|
|
249
171
|
};
|
|
250
|
-
|
|
251
|
-
setInputBoxes([
|
|
172
|
+
var addIfElseInputBox = function addIfElseInputBox() {
|
|
173
|
+
setInputBoxes([].concat(_toConsumableArray(inputBoxes), [{
|
|
252
174
|
label: "If",
|
|
253
175
|
value: ""
|
|
254
176
|
}, {
|
|
255
177
|
label: "Else",
|
|
256
178
|
value: ""
|
|
257
|
-
}]);
|
|
179
|
+
}]));
|
|
258
180
|
setType("if_else");
|
|
259
181
|
};
|
|
260
182
|
|
|
@@ -296,35 +218,37 @@ const AddNewBox = () => {
|
|
|
296
218
|
},
|
|
297
219
|
onClick: addIfElseInputBox,
|
|
298
220
|
title: "Add If Else Box"
|
|
299
|
-
}, /*#__PURE__*/_react.default.createElement(_text.default, null, "+"))), inputBoxes.map((box, index)
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
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
|
+
}));
|
|
329
253
|
};
|
|
330
254
|
exports.AddNewBox = AddNewBox;
|
|
@@ -7,34 +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
|
-
function _slicedToArray(
|
|
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
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(
|
|
14
|
-
function _arrayLikeToArray(
|
|
15
|
-
function _iterableToArrayLimit(
|
|
16
|
-
function _arrayWithHoles(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
+
}),
|
|
29
33
|
_useDrag2 = _slicedToArray(_useDrag, 2),
|
|
30
34
|
isDragging = _useDrag2[0].isDragging,
|
|
31
35
|
drag = _useDrag2[1];
|
|
32
|
-
|
|
36
|
+
var opacity = isDragging ? 0.4 : 1;
|
|
33
37
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
34
38
|
ref: drag,
|
|
35
39
|
style: {
|
|
36
|
-
opacity
|
|
40
|
+
opacity: opacity
|
|
37
41
|
},
|
|
38
42
|
"data-testid": "box"
|
|
39
43
|
}, /*#__PURE__*/_react.default.createElement(_text.default, null, name));
|
|
40
|
-
};
|
|
44
|
+
};
|
|
45
|
+
exports.DragBox = DragBox;
|