tenjin-ui-kit 0.3.71 → 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 +191 -90
- 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 +19 -16
- 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 +4 -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
|
@@ -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,142 +12,25 @@ var _Clear = _interopRequireDefault(require("@mui/icons-material/Clear"));
|
|
|
11
12
|
var _styles = require("@mui/material/styles");
|
|
12
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
14
|
var _text = _interopRequireDefault(require("../text"));
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
// onChange,
|
|
25
|
-
// fullWidth,
|
|
26
|
-
// label,
|
|
27
|
-
// isRequired,
|
|
28
|
-
// isDisabled,
|
|
29
|
-
// errorMessage,
|
|
30
|
-
// error,
|
|
31
|
-
// initialValue,
|
|
32
|
-
// ...rest
|
|
33
|
-
// }) => {
|
|
34
|
-
// const [chips, setChips] = useState(initialValue ? [...initialValue] : []);
|
|
35
|
-
// const theme = useTheme();
|
|
36
|
-
// const [txtValue, setTxtValue] = useState("");
|
|
37
|
-
// useEffect(() => {
|
|
38
|
-
// if (onChange) {
|
|
39
|
-
// onChange(chips);
|
|
40
|
-
// }
|
|
41
|
-
// }, [chips]);
|
|
42
|
-
// const onTextValueChange = (e) => {
|
|
43
|
-
// const value = e.target.value.trim();
|
|
44
|
-
// setTxtValue(value.replace(",", ""));
|
|
45
|
-
// };
|
|
46
|
-
// const handleAddChip = (event) => {
|
|
47
|
-
// if (
|
|
48
|
-
// (event.key === "Enter" ||
|
|
49
|
-
// event.keyCode === 32 ||
|
|
50
|
-
// event.keyCode === 188 ||
|
|
51
|
-
// event.keyCode === 9 ||
|
|
52
|
-
// event.type === "blur") &&
|
|
53
|
-
// event.target.value.replace(",", "")
|
|
54
|
-
// ) {
|
|
55
|
-
// const {
|
|
56
|
-
// target: { value },
|
|
57
|
-
// } = event;
|
|
58
|
-
// const newValue =
|
|
59
|
-
// typeof value === "string"
|
|
60
|
-
// ? value.replace(",", "").trim()
|
|
61
|
-
// : value.trim();
|
|
62
|
-
// // if (chips.includes(newValue)) return; //add if any info or anything needs to be shown
|
|
63
|
-
// setChips([...chips, newValue]);
|
|
64
|
-
// onChange([...chips, newValue]);
|
|
65
|
-
// setTxtValue("");
|
|
66
|
-
// event.target.parentNode.querySelector("input").value = "";
|
|
67
|
-
// }
|
|
68
|
-
// };
|
|
69
|
-
// const handleDeleteChip = (chipToDelete) => {
|
|
70
|
-
// setChips((chips) => chips.filter((chip) => chip !== chipToDelete));
|
|
71
|
-
// };
|
|
72
|
-
// return (
|
|
73
|
-
// <div>
|
|
74
|
-
// <FormControl variant="standard" fullWidth={fullWidth}>
|
|
75
|
-
// {label && (
|
|
76
|
-
// <Text color={theme.palette.grey[600]} required={isRequired}>
|
|
77
|
-
// {label}
|
|
78
|
-
// {isRequired ? <span style={{ color: "red" }}> * </span> : ""}
|
|
79
|
-
// </Text>
|
|
80
|
-
// )}
|
|
81
|
-
// <TextField
|
|
82
|
-
// value={txtValue}
|
|
83
|
-
// {...rest}
|
|
84
|
-
// id={id}
|
|
85
|
-
// required={isRequired}
|
|
86
|
-
// disabled={isDisabled}
|
|
87
|
-
// onKeyDown={handleAddChip}
|
|
88
|
-
// onBlur={(e) => {
|
|
89
|
-
// if (!chips?.length > 0) {
|
|
90
|
-
// setChips([]);
|
|
91
|
-
// }
|
|
92
|
-
// if (e.target.value !== "") {
|
|
93
|
-
// handleAddChip(e);
|
|
94
|
-
// }
|
|
95
|
-
// }}
|
|
96
|
-
// style={{ backgroundColor: isDisabled && "#E7E7E7" }}
|
|
97
|
-
// sx={{
|
|
98
|
-
// "& MuiOutlinedInput": { backgroundColor: isDisabled && "#E7E7E7" },
|
|
99
|
-
// "& input": {
|
|
100
|
-
// // backgroundColor: isDisabled && '#E7E7E7',
|
|
101
|
-
// color: isDisabled && "#000000",
|
|
102
|
-
// },
|
|
103
|
-
// marginTop: label ? theme.spacing(1) : 0,
|
|
104
|
-
// "& label": {
|
|
105
|
-
// fontWeight: 500,
|
|
106
|
-
// },
|
|
107
|
-
// }}
|
|
108
|
-
// onChange={onTextValueChange}
|
|
109
|
-
// helperText={errorMessage}
|
|
110
|
-
// error={error}
|
|
111
|
-
// InputProps={{
|
|
112
|
-
// startAdornment: chips.map((chip, index) => (
|
|
113
|
-
// <Chip
|
|
114
|
-
// key={`${chip}-${index}`}
|
|
115
|
-
// label={<Text>{chip}</Text>}
|
|
116
|
-
// onDelete={() => handleDeleteChip(chip)}
|
|
117
|
-
// deleteIcon={<ClearIcon fontSize="small" />}
|
|
118
|
-
// style={{ margin: "0.2rem" }}
|
|
119
|
-
// size="small"
|
|
120
|
-
// />
|
|
121
|
-
// )),
|
|
122
|
-
// }}
|
|
123
|
-
// />
|
|
124
|
-
// </FormControl>
|
|
125
|
-
// </div>
|
|
126
|
-
// );
|
|
127
|
-
// };
|
|
128
|
-
// InputWithChip.propTypes = {
|
|
129
|
-
// label: PropTypes.string,
|
|
130
|
-
// fullWidth: PropTypes.bool,
|
|
131
|
-
// size: PropTypes.string,
|
|
132
|
-
// isRequired: PropTypes.bool,
|
|
133
|
-
// isDisabled: PropTypes.bool,
|
|
134
|
-
// error: PropTypes.bool,
|
|
135
|
-
// };
|
|
136
|
-
// export default InputWithChip;
|
|
137
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
138
|
-
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); }
|
|
139
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
140
|
-
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
15
|
+
var _excluded = ["value", "id", "onChange", "fullWidth", "label", "isRequired", "isDisabled", "errorMessage", "error", "initialValue", "height"];
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
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); }
|
|
18
|
+
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; }
|
|
19
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
20
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
21
|
+
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."); }
|
|
22
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
23
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
24
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
141
25
|
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."); }
|
|
142
|
-
function _unsupportedIterableToArray(
|
|
143
|
-
function _arrayLikeToArray(
|
|
144
|
-
function _iterableToArrayLimit(
|
|
145
|
-
function _arrayWithHoles(
|
|
146
|
-
function _objectWithoutProperties(
|
|
147
|
-
function _objectWithoutPropertiesLoose(
|
|
148
|
-
|
|
149
|
-
|
|
26
|
+
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); }
|
|
27
|
+
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; }
|
|
28
|
+
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; } }
|
|
29
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
30
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
31
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
32
|
+
var InputWithChip = function InputWithChip(_ref) {
|
|
33
|
+
var value = _ref.value,
|
|
150
34
|
id = _ref.id,
|
|
151
35
|
onChange = _ref.onChange,
|
|
152
36
|
fullWidth = _ref.fullWidth,
|
|
@@ -158,53 +42,57 @@ const InputWithChip = _ref => {
|
|
|
158
42
|
initialValue = _ref.initialValue,
|
|
159
43
|
height = _ref.height,
|
|
160
44
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
161
|
-
|
|
45
|
+
var _useState = (0, _react.useState)(value ? _toConsumableArray(value) : []),
|
|
162
46
|
_useState2 = _slicedToArray(_useState, 2),
|
|
163
47
|
chips = _useState2[0],
|
|
164
48
|
setChips = _useState2[1];
|
|
165
|
-
|
|
166
|
-
|
|
49
|
+
var theme = (0, _styles.useTheme)();
|
|
50
|
+
var _useState3 = (0, _react.useState)(""),
|
|
167
51
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
168
52
|
txtValue = _useState4[0],
|
|
169
53
|
setTxtValue = _useState4[1];
|
|
170
|
-
|
|
54
|
+
var _useState5 = (0, _react.useState)(null),
|
|
171
55
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
172
56
|
duplicateWarnig = _useState6[0],
|
|
173
57
|
setDuplicateWarning = _useState6[1];
|
|
174
|
-
(0, _react.useEffect)(()
|
|
58
|
+
(0, _react.useEffect)(function () {
|
|
175
59
|
if (onChange) {
|
|
176
60
|
onChange(chips);
|
|
177
61
|
}
|
|
178
62
|
}, [chips]);
|
|
179
|
-
|
|
180
|
-
|
|
63
|
+
var onTextValueChange = function onTextValueChange(e) {
|
|
64
|
+
var value = e.target.value.trim();
|
|
181
65
|
setTxtValue(value.replace(",", ""));
|
|
182
66
|
};
|
|
183
|
-
|
|
67
|
+
var handleAddChip = function handleAddChip(event) {
|
|
184
68
|
setDuplicateWarning({
|
|
185
69
|
status: false,
|
|
186
70
|
message: ""
|
|
187
71
|
});
|
|
188
72
|
if ((event.key === "Enter" || event.keyCode === 32 || event.keyCode === 188 || event.keyCode === 9 || event.type === "blur") && event.target.value.replace(",", "")) {
|
|
189
|
-
|
|
190
|
-
|
|
73
|
+
var _value = event.target.value;
|
|
74
|
+
var newValue = typeof _value === "string" ? _value.replace(",", "").trim() : _value.trim();
|
|
191
75
|
// if (chips.includes(newValue)) return; //add if any info or anything needs to be shown
|
|
192
|
-
|
|
76
|
+
var isPresent = chips.includes(newValue);
|
|
193
77
|
if (isPresent) {
|
|
194
78
|
setDuplicateWarning({
|
|
195
79
|
status: true,
|
|
196
80
|
message: "".concat(newValue, " already exists")
|
|
197
81
|
});
|
|
198
82
|
} else {
|
|
199
|
-
setChips([
|
|
200
|
-
onChange([
|
|
83
|
+
setChips([].concat(_toConsumableArray(chips), [newValue]));
|
|
84
|
+
onChange([].concat(_toConsumableArray(chips), [newValue]));
|
|
201
85
|
setTxtValue("");
|
|
202
86
|
event.target.parentNode.querySelector("input").value = "";
|
|
203
87
|
}
|
|
204
88
|
}
|
|
205
89
|
};
|
|
206
|
-
|
|
207
|
-
setChips(
|
|
90
|
+
var handleDeleteChip = function handleDeleteChip(chipToDelete) {
|
|
91
|
+
setChips(function (chips) {
|
|
92
|
+
return chips.filter(function (chip) {
|
|
93
|
+
return chip !== chipToDelete;
|
|
94
|
+
});
|
|
95
|
+
});
|
|
208
96
|
};
|
|
209
97
|
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_material.FormControl, {
|
|
210
98
|
variant: "standard",
|
|
@@ -223,7 +111,7 @@ const InputWithChip = _ref => {
|
|
|
223
111
|
required: isRequired,
|
|
224
112
|
disabled: isDisabled,
|
|
225
113
|
onKeyDown: handleAddChip,
|
|
226
|
-
onBlur: e
|
|
114
|
+
onBlur: function onBlur(e) {
|
|
227
115
|
if (!(chips !== null && chips !== void 0 && chips.length) > 0) {
|
|
228
116
|
setChips([]);
|
|
229
117
|
}
|
|
@@ -270,18 +158,22 @@ const InputWithChip = _ref => {
|
|
|
270
158
|
// border={!!chips && "1px solid #E7E7E7"}
|
|
271
159
|
,
|
|
272
160
|
mt: theme.spacing(2)
|
|
273
|
-
}, /*#__PURE__*/_react.default.createElement(_text.default, null, chips.map((chip, index)
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
161
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, null, chips.map(function (chip, index) {
|
|
162
|
+
return /*#__PURE__*/_react.default.createElement(_Chip.default, {
|
|
163
|
+
key: "".concat(chip, "-").concat(index),
|
|
164
|
+
label: /*#__PURE__*/_react.default.createElement(_text.default, null, chip),
|
|
165
|
+
onDelete: function onDelete() {
|
|
166
|
+
return handleDeleteChip(chip);
|
|
167
|
+
},
|
|
168
|
+
deleteIcon: /*#__PURE__*/_react.default.createElement(_Clear.default, {
|
|
169
|
+
fontSize: "small"
|
|
170
|
+
}),
|
|
171
|
+
style: {
|
|
172
|
+
margin: "0.2rem"
|
|
173
|
+
},
|
|
174
|
+
size: "small"
|
|
175
|
+
});
|
|
176
|
+
}))));
|
|
285
177
|
};
|
|
286
178
|
InputWithChip.propTypes = {
|
|
287
179
|
label: _propTypes.default.string,
|
|
@@ -291,4 +183,5 @@ InputWithChip.propTypes = {
|
|
|
291
183
|
isDisabled: _propTypes.default.bool,
|
|
292
184
|
error: _propTypes.default.bool
|
|
293
185
|
};
|
|
294
|
-
var _default =
|
|
186
|
+
var _default = InputWithChip;
|
|
187
|
+
exports.default = _default;
|
|
@@ -7,43 +7,43 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
require("./index.css");
|
|
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
|
-
|
|
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 RightContext = function RightContext() {
|
|
18
|
+
var _React$useState = _react.default.useState(false),
|
|
19
19
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
20
20
|
context = _React$useState2[0],
|
|
21
21
|
setContext = _React$useState2[1];
|
|
22
|
-
|
|
22
|
+
var _React$useState3 = _react.default.useState({
|
|
23
23
|
x: 0,
|
|
24
24
|
y: 0
|
|
25
25
|
}),
|
|
26
26
|
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
27
27
|
xYPosistion = _React$useState4[0],
|
|
28
28
|
setXyPosistion = _React$useState4[1];
|
|
29
|
-
|
|
29
|
+
var showNav = function showNav(event) {
|
|
30
30
|
event.preventDefault();
|
|
31
31
|
setContext(false);
|
|
32
|
-
|
|
32
|
+
var positionChange = {
|
|
33
33
|
x: event.pageX,
|
|
34
34
|
y: event.pageY
|
|
35
35
|
};
|
|
36
36
|
setXyPosistion(positionChange);
|
|
37
37
|
setContext(true);
|
|
38
38
|
};
|
|
39
|
-
|
|
39
|
+
var hideContext = function hideContext(event) {
|
|
40
40
|
setContext(false);
|
|
41
41
|
};
|
|
42
|
-
|
|
42
|
+
var _React$useState5 = _react.default.useState(),
|
|
43
43
|
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
44
44
|
chosen = _React$useState6[0],
|
|
45
45
|
setChosen = _React$useState6[1];
|
|
46
|
-
|
|
46
|
+
var initMenu = function initMenu(chosen) {
|
|
47
47
|
setChosen(chosen);
|
|
48
48
|
};
|
|
49
49
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
@@ -62,16 +62,25 @@ const RightContext = () => {
|
|
|
62
62
|
className: "rightClick"
|
|
63
63
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
64
64
|
className: "menuElement",
|
|
65
|
-
onClick: ()
|
|
65
|
+
onClick: function onClick() {
|
|
66
|
+
return initMenu("New");
|
|
67
|
+
}
|
|
66
68
|
}, /*#__PURE__*/_react.default.createElement(_text.default, null, "Refactor")), /*#__PURE__*/_react.default.createElement("div", {
|
|
67
69
|
className: "menuElement",
|
|
68
|
-
onClick: ()
|
|
70
|
+
onClick: function onClick() {
|
|
71
|
+
return initMenu("Delete");
|
|
72
|
+
}
|
|
69
73
|
}, /*#__PURE__*/_react.default.createElement(_text.default, null, "Cut")), /*#__PURE__*/_react.default.createElement("div", {
|
|
70
74
|
className: "menuElement",
|
|
71
|
-
onClick: ()
|
|
75
|
+
onClick: function onClick() {
|
|
76
|
+
return initMenu("Copy");
|
|
77
|
+
}
|
|
72
78
|
}, /*#__PURE__*/_react.default.createElement(_text.default, null, "Copy")), /*#__PURE__*/_react.default.createElement("div", {
|
|
73
79
|
className: "menuElement",
|
|
74
|
-
onClick: ()
|
|
80
|
+
onClick: function onClick() {
|
|
81
|
+
return initMenu("Paste");
|
|
82
|
+
}
|
|
75
83
|
}, /*#__PURE__*/_react.default.createElement(_text.default, null, "Paste")))));
|
|
76
84
|
};
|
|
77
|
-
var _default =
|
|
85
|
+
var _default = RightContext;
|
|
86
|
+
exports.default = _default;
|
package/components/WorkFlow.js
CHANGED
|
@@ -7,25 +7,29 @@ exports.default = 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
|
-
|
|
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 WorkFlow = function WorkFlow(props) {
|
|
18
|
+
var name = props.name,
|
|
19
19
|
id = props.id;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
var _useDrag = (0, _reactDnd.useDrag)(function () {
|
|
21
|
+
return {
|
|
22
|
+
type: 'block',
|
|
23
|
+
item: {
|
|
24
|
+
id: props.id
|
|
25
|
+
},
|
|
26
|
+
collect: function collect(monitor) {
|
|
27
|
+
return {
|
|
28
|
+
isDragging: !!monitor.isDragging()
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}),
|
|
29
33
|
_useDrag2 = _slicedToArray(_useDrag, 2),
|
|
30
34
|
isDragging = _useDrag2[0].isDragging,
|
|
31
35
|
drag = _useDrag2[1];
|
|
@@ -39,4 +43,5 @@ const WorkFlow = props => {
|
|
|
39
43
|
variant: "h4"
|
|
40
44
|
}, "WorkFlow- ".concat(name)));
|
|
41
45
|
};
|
|
42
|
-
var _default =
|
|
46
|
+
var _default = WorkFlow;
|
|
47
|
+
exports.default = _default;
|
|
@@ -7,27 +7,29 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _reactflow = require("reactflow");
|
|
9
9
|
var _d3Hierarchy = require("d3-hierarchy");
|
|
10
|
-
function
|
|
11
|
-
function
|
|
10
|
+
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); }
|
|
11
|
+
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; }
|
|
12
|
+
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); }
|
|
13
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
14
|
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
|
-
function ownKeys(
|
|
18
|
-
function _objectSpread(
|
|
19
|
-
function _defineProperty(
|
|
20
|
-
function _toPropertyKey(
|
|
21
|
-
function _toPrimitive(
|
|
15
|
+
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); }
|
|
16
|
+
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; }
|
|
17
|
+
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; } }
|
|
18
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
19
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
20
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
22
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
23
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
22
24
|
// Custom node styles
|
|
23
|
-
|
|
25
|
+
var customNodeStyles = {
|
|
24
26
|
border: '1px solid #ddd',
|
|
25
27
|
padding: '10px',
|
|
26
28
|
borderRadius: '5px'
|
|
27
29
|
};
|
|
28
30
|
|
|
29
31
|
// Custom node types
|
|
30
|
-
|
|
32
|
+
var customNodeTypes = [{
|
|
31
33
|
default: {
|
|
32
34
|
style: customNodeStyles
|
|
33
35
|
},
|
|
@@ -44,7 +46,7 @@ const customNodeTypes = [{
|
|
|
44
46
|
}];
|
|
45
47
|
|
|
46
48
|
// Custom edge types
|
|
47
|
-
|
|
49
|
+
var customEdgeTypes = {
|
|
48
50
|
default: {
|
|
49
51
|
stroke: '#ddd'
|
|
50
52
|
},
|
|
@@ -54,7 +56,7 @@ const customEdgeTypes = {
|
|
|
54
56
|
};
|
|
55
57
|
|
|
56
58
|
// Sample data for the workflow
|
|
57
|
-
|
|
59
|
+
var data = [{
|
|
58
60
|
name: 'Workflow',
|
|
59
61
|
children: [{
|
|
60
62
|
name: 'Start',
|
|
@@ -76,27 +78,39 @@ const data = [{
|
|
|
76
78
|
}];
|
|
77
79
|
|
|
78
80
|
// Generate the hierarchy data
|
|
79
|
-
|
|
81
|
+
var hierarchyData = (0, _d3Hierarchy.hierarchy)(data);
|
|
80
82
|
function WorkFlowBuilder() {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
83
|
+
var _useState = (0, _react.useState)(hierarchyData.descendants().map(function (d) {
|
|
84
|
+
return {
|
|
85
|
+
id: d.data.name,
|
|
86
|
+
type: d.data.type || 'default',
|
|
87
|
+
data: {
|
|
88
|
+
label: d.data.name
|
|
89
|
+
},
|
|
90
|
+
position: {
|
|
91
|
+
x: d.depth * 200,
|
|
92
|
+
y: d.index * 100
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
})),
|
|
92
96
|
_useState2 = _slicedToArray(_useState, 2),
|
|
93
97
|
elements = _useState2[0],
|
|
94
98
|
setElements = _useState2[1];
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
var onElementsRemoveStart = function onElementsRemoveStart() {
|
|
100
|
+
return console.log('Elements removal started');
|
|
101
|
+
};
|
|
102
|
+
var onElementsRemoveEnd = function onElementsRemoveEnd(removedElements) {
|
|
103
|
+
return setElements(function (els) {
|
|
104
|
+
return (0, _reactflow.removeElements)(removedElements, els);
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
var onConnect = function onConnect(params) {
|
|
108
|
+
return setElements(function (els) {
|
|
109
|
+
return (0, _reactflow.addEdge)(_objectSpread(_objectSpread({}, params), {}, {
|
|
110
|
+
type: 'default'
|
|
111
|
+
}), els);
|
|
112
|
+
});
|
|
113
|
+
};
|
|
100
114
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
101
115
|
style: {
|
|
102
116
|
height: '800px'
|
|
@@ -112,4 +126,5 @@ function WorkFlowBuilder() {
|
|
|
112
126
|
attributionPosition: "bottom-left"
|
|
113
127
|
}));
|
|
114
128
|
}
|
|
115
|
-
var _default =
|
|
129
|
+
var _default = WorkFlowBuilder;
|
|
130
|
+
exports.default = _default;
|