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.
- package/common/hooks/apiHooks.js +91 -199
- package/common/hooks/newApiHook.js +127 -258
- package/common/utils/security/index.js +2 -2
- package/common/utils/security/securityConfig.js +1 -2
- package/components/Canvas.js +172 -101
- package/components/DragBox/index.js +21 -31
- package/components/InputWithChip/index.js +178 -83
- package/components/RightContext/index.js +17 -41
- package/components/WorkFlow.js +19 -29
- package/components/WorkFlowBuilder.js +32 -56
- package/components/alert/Style.js +11 -14
- package/components/alert/index.js +8 -14
- package/components/attachment/index.js +26 -31
- package/components/authenticationProvider/AuthError.js +3 -4
- package/components/authenticationProvider/AuthLoader.js +3 -4
- package/components/authenticationProvider/index.js +58 -130
- package/components/avatar/index.js +24 -23
- package/components/avatar/styles.js +76 -77
- package/components/breadCrumbs/index.js +64 -89
- package/components/breadCrumbs/style.js +1 -4
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/index.js +7 -6
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/style.js +5 -8
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewHeader/index.js +7 -6
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewContent/Index.js +8 -7
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/Index.js +8 -7
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/style.js +16 -19
- package/components/browsingTestCaseLayout/index.js +30 -46
- package/components/button/index.js +47 -58
- package/components/chatBotModal/index.js +40 -61
- package/components/checkBox/index.js +8 -10
- package/components/combobox/index.js +66 -100
- package/components/divider/index.js +9 -18
- package/components/editableField/index.js +19 -46
- package/components/error/index.js +6 -12
- package/components/errorBoundary/index.js +74 -98
- package/components/fileUploader/index.js +46 -58
- package/components/fileUploader/style.js +46 -49
- package/components/filter/ValueSelector.js +149 -245
- package/components/filter/index.js +45 -71
- package/components/iconButton/index.js +3 -4
- package/components/input/index.js +60 -74
- package/components/layout/index.js +36 -49
- package/components/layout/main/index.js +13 -14
- package/components/layout/main/style.js +11 -14
- package/components/layout/pageContent/index.js +8 -7
- package/components/layout/sidebar/FlatMenu.js +51 -47
- package/components/layout/sidebar/GroupedIconMenu.js +169 -194
- package/components/layout/sidebar/GroupedMenu.js +45 -50
- package/components/layout/sidebar/ProjectMenu.js +165 -185
- package/components/layout/sidebar/index.js +27 -26
- package/components/layout/sidebar/style.js +138 -143
- package/components/layout/topBar/ProjectTopbar.js +91 -208
- package/components/layout/topBar/UserAvatar.js +53 -69
- package/components/layout/topBar/index.js +23 -41
- package/components/loader/index.js +9 -12
- package/components/menu/index.js +23 -42
- package/components/modal/Modal.js +5 -6
- package/components/modal/index.js +16 -20
- package/components/modal/style.js +53 -56
- package/components/optionMenu/index.js +32 -47
- package/components/pagination/index.js +23 -43
- package/components/pagination/style.js +25 -28
- package/components/paginationUpdated/index.js +22 -29
- package/components/paper/index.js +20 -22
- package/components/paper/style.js +24 -27
- package/components/reactSelect/index.js +64 -97
- package/components/reactSelect/style.js +131 -151
- package/components/richTextEditor/index.js +24 -48
- package/components/select/GroupedSelect.js +96 -99
- package/components/select/SimpleSelect.js +61 -103
- package/components/select/index.js +56 -69
- package/components/simpleSelect/index.js +18 -22
- package/components/sort/index.js +23 -36
- package/components/switch/index.js +14 -15
- package/components/switch/style.js +29 -32
- package/components/switch/switch.js +30 -47
- package/components/table/ReactTable.js +59 -83
- package/components/table/SimpleTable.js +67 -91
- package/components/table/index.js +300 -206
- package/components/text/index.js +22 -30
- package/components/timeStamp/index.js +4 -9
- package/components/timeStamp/style.js +12 -15
- package/components/topBar/index.js +86 -102
- package/components/tree/index.js +30 -58
- package/components/tree/style.js +20 -23
- package/components/valuePicker/ValueSelector.js +78 -160
- package/components/valuePicker/index.js +30 -50
- package/components/wrapperLayout/layout/index.js +8 -7
- package/components/wrapperLayout/main/index.js +8 -7
- package/components/wrapperLayout/main/pageContainer/index.js +6 -5
- package/components/wrapperLayout/main/sideBar/index.js +171 -175
- package/components/wrapperLayout/main/sideBar/style.js +177 -183
- package/components/wrapperLayout/topBar/UserAvatar.js +6 -5
- package/components/wrapperLayout/topBar/avatar.js +15 -18
- package/components/wrapperLayout/topBar/index.js +115 -107
- package/components/wrapperLayout/topBar/menuIcon.js +6 -5
- package/components/wrapperLayout/topBar/style.js +63 -64
- package/http/index.js +92 -188
- package/index.js +53 -55
- package/package.json +3 -3
- package/templates/listPage/index.js +168 -196
- package/themes/default.js +5 -7
- package/themes/defaultSmall.js +2 -3
- package/themes/responsiveTheme.js +6 -8
|
@@ -9,31 +9,18 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
9
9
|
var _material = require("@mui/material");
|
|
10
10
|
var _styles = require("@mui/material/styles");
|
|
11
11
|
var _KeyboardArrowDown = _interopRequireDefault(require("@mui/icons-material/KeyboardArrowDown"));
|
|
12
|
-
function _interopRequireDefault(
|
|
13
|
-
function
|
|
14
|
-
function
|
|
15
|
-
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); }
|
|
16
|
-
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; }
|
|
17
|
-
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; }
|
|
18
|
-
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; }
|
|
19
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
20
|
-
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); }
|
|
21
|
-
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); }
|
|
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; }
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
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); }
|
|
14
|
+
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); }
|
|
28
15
|
// Styled components to match the Tailwind design
|
|
29
|
-
|
|
30
|
-
shouldForwardProp:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
16
|
+
const StyledTextField = (0, _styles.styled)(_material.TextField, {
|
|
17
|
+
shouldForwardProp: prop => prop !== "error" && prop !== "loading"
|
|
18
|
+
})(_ref => {
|
|
19
|
+
let {
|
|
20
|
+
theme,
|
|
21
|
+
error,
|
|
22
|
+
loading
|
|
23
|
+
} = _ref;
|
|
37
24
|
return {
|
|
38
25
|
"& .MuiOutlinedInput-root": {
|
|
39
26
|
backgroundColor: loading ? "#f9fafb" : "#ffffff",
|
|
@@ -51,7 +38,7 @@ var StyledTextField = (0, _styles.styled)(_material.TextField, {
|
|
|
51
38
|
borderWidth: "1px"
|
|
52
39
|
},
|
|
53
40
|
"&.Mui-focused": {
|
|
54
|
-
boxShadow: error ?
|
|
41
|
+
boxShadow: error ? `0 0 0 1px ${theme.palette.error.main}` : `0 0 0 1px ${theme.palette.primary.main}`
|
|
55
42
|
}
|
|
56
43
|
},
|
|
57
44
|
"& .MuiOutlinedInput-input": {
|
|
@@ -70,8 +57,10 @@ var StyledTextField = (0, _styles.styled)(_material.TextField, {
|
|
|
70
57
|
}
|
|
71
58
|
};
|
|
72
59
|
});
|
|
73
|
-
|
|
74
|
-
|
|
60
|
+
const StyledPaper = (0, _styles.styled)(_material.Paper)(_ref2 => {
|
|
61
|
+
let {
|
|
62
|
+
theme
|
|
63
|
+
} = _ref2;
|
|
75
64
|
return {
|
|
76
65
|
marginTop: "4px",
|
|
77
66
|
maxHeight: "240px",
|
|
@@ -105,12 +94,12 @@ var StyledPaper = (0, _styles.styled)(_material.Paper)(function (_ref2) {
|
|
|
105
94
|
}
|
|
106
95
|
};
|
|
107
96
|
});
|
|
108
|
-
|
|
109
|
-
shouldForwardProp:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
97
|
+
const Label = (0, _styles.styled)(_material.Typography, {
|
|
98
|
+
shouldForwardProp: prop => prop !== "isRequired"
|
|
99
|
+
})(_ref3 => {
|
|
100
|
+
let {
|
|
101
|
+
isRequired
|
|
102
|
+
} = _ref3;
|
|
114
103
|
return {
|
|
115
104
|
display: "block",
|
|
116
105
|
fontSize: "0.875rem",
|
|
@@ -125,12 +114,12 @@ var Label = (0, _styles.styled)(_material.Typography, {
|
|
|
125
114
|
} : {}
|
|
126
115
|
};
|
|
127
116
|
});
|
|
128
|
-
|
|
129
|
-
shouldForwardProp:
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
117
|
+
const HelperText = (0, _styles.styled)(_material.Typography, {
|
|
118
|
+
shouldForwardProp: prop => prop !== "error"
|
|
119
|
+
})(_ref4 => {
|
|
120
|
+
let {
|
|
121
|
+
error
|
|
122
|
+
} = _ref4;
|
|
134
123
|
return {
|
|
135
124
|
marginTop: "8px",
|
|
136
125
|
fontSize: "0.875rem",
|
|
@@ -138,48 +127,35 @@ var HelperText = (0, _styles.styled)(_material.Typography, {
|
|
|
138
127
|
color: error ? "#dc2626" : "#4b5563"
|
|
139
128
|
};
|
|
140
129
|
});
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
options =
|
|
144
|
-
selected
|
|
145
|
-
defaultValue
|
|
146
|
-
label
|
|
147
|
-
id
|
|
148
|
-
isRequired
|
|
149
|
-
onChange
|
|
150
|
-
error
|
|
151
|
-
helperText
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
160
|
-
internalSelected = _useState2[0],
|
|
161
|
-
setInternalSelected = _useState2[1];
|
|
162
|
-
var _useState3 = (0, _react.useState)(false),
|
|
163
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
164
|
-
hasSetDefault = _useState4[0],
|
|
165
|
-
setHasSetDefault = _useState4[1];
|
|
166
|
-
var _useState5 = (0, _react.useState)(false),
|
|
167
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
168
|
-
open = _useState6[0],
|
|
169
|
-
setOpen = _useState6[1];
|
|
130
|
+
const Combobox = _ref5 => {
|
|
131
|
+
let {
|
|
132
|
+
options = [],
|
|
133
|
+
selected,
|
|
134
|
+
defaultValue,
|
|
135
|
+
label,
|
|
136
|
+
id,
|
|
137
|
+
isRequired,
|
|
138
|
+
onChange,
|
|
139
|
+
error,
|
|
140
|
+
helperText,
|
|
141
|
+
loading = false,
|
|
142
|
+
by = "id",
|
|
143
|
+
labelKey = "label"
|
|
144
|
+
} = _ref5;
|
|
145
|
+
const [internalSelected, setInternalSelected] = (0, _react.useState)(null);
|
|
146
|
+
const [hasSetDefault, setHasSetDefault] = (0, _react.useState)(false);
|
|
147
|
+
const [open, setOpen] = (0, _react.useState)(false);
|
|
170
148
|
|
|
171
149
|
// Handle defaultValue - accepts both object and primitive (ID)
|
|
172
|
-
(0, _react.useEffect)(
|
|
150
|
+
(0, _react.useEffect)(() => {
|
|
173
151
|
if (defaultValue && options.length > 0 && !hasSetDefault) {
|
|
174
|
-
|
|
175
|
-
if (
|
|
152
|
+
let defaultOption;
|
|
153
|
+
if (typeof defaultValue === "object" && defaultValue !== null) {
|
|
176
154
|
// defaultValue is already a full object
|
|
177
155
|
defaultOption = defaultValue;
|
|
178
156
|
} else {
|
|
179
157
|
// defaultValue is a primitive (ID), find the matching option
|
|
180
|
-
defaultOption = options.find(
|
|
181
|
-
return opt[by] === defaultValue;
|
|
182
|
-
});
|
|
158
|
+
defaultOption = options.find(opt => opt[by] === defaultValue);
|
|
183
159
|
}
|
|
184
160
|
if (defaultOption) {
|
|
185
161
|
setInternalSelected(defaultOption);
|
|
@@ -189,8 +165,8 @@ var Combobox = function Combobox(_ref5) {
|
|
|
189
165
|
}, [defaultValue, options, by, hasSetDefault]);
|
|
190
166
|
|
|
191
167
|
// Use selected prop if provided, otherwise use internal state
|
|
192
|
-
|
|
193
|
-
|
|
168
|
+
const currentValue = selected || internalSelected;
|
|
169
|
+
const handleChange = (event, value) => {
|
|
194
170
|
setInternalSelected(value);
|
|
195
171
|
if (onChange) {
|
|
196
172
|
// Pass the full object to onChange (industry standard)
|
|
@@ -209,21 +185,13 @@ var Combobox = function Combobox(_ref5) {
|
|
|
209
185
|
value: currentValue,
|
|
210
186
|
onChange: handleChange,
|
|
211
187
|
options: options,
|
|
212
|
-
getOptionLabel:
|
|
213
|
-
|
|
214
|
-
},
|
|
215
|
-
isOptionEqualToValue: function isOptionEqualToValue(option, value) {
|
|
216
|
-
return (option === null || option === void 0 ? void 0 : option[by]) === (value === null || value === void 0 ? void 0 : value[by]);
|
|
217
|
-
},
|
|
188
|
+
getOptionLabel: option => option?.[labelKey] || "",
|
|
189
|
+
isOptionEqualToValue: (option, value) => option?.[by] === value?.[by],
|
|
218
190
|
loading: loading,
|
|
219
191
|
disabled: loading,
|
|
220
192
|
open: open && !loading,
|
|
221
|
-
onOpen:
|
|
222
|
-
|
|
223
|
-
},
|
|
224
|
-
onClose: function onClose() {
|
|
225
|
-
return setOpen(false);
|
|
226
|
-
},
|
|
193
|
+
onOpen: () => setOpen(true),
|
|
194
|
+
onClose: () => setOpen(false),
|
|
227
195
|
disableClearable: false,
|
|
228
196
|
PaperComponent: StyledPaper,
|
|
229
197
|
popupIcon: loading ? /*#__PURE__*/_react.default.createElement(_material.CircularProgress, {
|
|
@@ -237,16 +205,15 @@ var Combobox = function Combobox(_ref5) {
|
|
|
237
205
|
}
|
|
238
206
|
}),
|
|
239
207
|
noOptionsText: "No results found",
|
|
240
|
-
renderInput:
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
}
|
|
208
|
+
renderInput: params => /*#__PURE__*/_react.default.createElement(StyledTextField, _extends({}, params, {
|
|
209
|
+
error: error,
|
|
210
|
+
loading: loading,
|
|
211
|
+
placeholder: loading ? "Loading..." : "",
|
|
212
|
+
InputProps: {
|
|
213
|
+
...params.InputProps,
|
|
214
|
+
endAdornment: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, params.InputProps.endAdornment)
|
|
215
|
+
}
|
|
216
|
+
}))
|
|
250
217
|
}), helperText && /*#__PURE__*/_react.default.createElement(HelperText, {
|
|
251
218
|
error: error
|
|
252
219
|
}, helperText));
|
|
@@ -407,5 +374,4 @@ Combobox.defaultProps = {
|
|
|
407
374
|
by: "id",
|
|
408
375
|
labelKey: "label"
|
|
409
376
|
};
|
|
410
|
-
var _default = Combobox;
|
|
411
|
-
exports.default = _default;
|
|
377
|
+
var _default = exports.default = Combobox;
|
|
@@ -10,24 +10,15 @@ var _material = require("@mui/material");
|
|
|
10
10
|
var _Chip = _interopRequireDefault(require("@mui/material/Chip"));
|
|
11
11
|
var _text = _interopRequireDefault(require("../text"));
|
|
12
12
|
var _responsiveTheme = _interopRequireDefault(require("../../themes/responsiveTheme"));
|
|
13
|
-
function _interopRequireDefault(
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var Root = (0, _styles.styled)("div")(function () {
|
|
23
|
-
return _objectSpread(_objectSpread({
|
|
24
|
-
width: "100%"
|
|
25
|
-
}, _responsiveTheme.default.typography.body2), {}, {
|
|
26
|
-
"& > :not(style) + :not(style)": {
|
|
27
|
-
marginTop: _responsiveTheme.default.spacing(2)
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
});
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
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); }
|
|
15
|
+
const Root = (0, _styles.styled)("div")(() => ({
|
|
16
|
+
width: "100%",
|
|
17
|
+
..._responsiveTheme.default.typography.body2,
|
|
18
|
+
"& > :not(style) + :not(style)": {
|
|
19
|
+
marginTop: _responsiveTheme.default.spacing(2)
|
|
20
|
+
}
|
|
21
|
+
}));
|
|
31
22
|
function Divider(props) {
|
|
32
23
|
return /*#__PURE__*/React.createElement(Root, null, props.type && props.type === "Chip" ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_material.Divider, {
|
|
33
24
|
textAlign: props.textAlign && props.textAlign
|
|
@@ -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
|
});
|
|
@@ -9,31 +8,15 @@ var _material = require("@mui/material");
|
|
|
9
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
9
|
var _Edit = _interopRequireDefault(require("@mui/icons-material/Edit"));
|
|
11
10
|
var _text = _interopRequireDefault(require("../text"));
|
|
12
|
-
function _interopRequireDefault(
|
|
13
|
-
function
|
|
14
|
-
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; }
|
|
15
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
16
|
-
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."); }
|
|
17
|
-
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); }
|
|
18
|
-
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; }
|
|
19
|
-
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; } }
|
|
20
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
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); }
|
|
21
13
|
// import Select from "../select";
|
|
22
14
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var _useState3 = (0, _react.useState)(false),
|
|
29
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
30
|
-
isNameFocused = _useState4[0],
|
|
31
|
-
setIsNameFocused = _useState4[1];
|
|
32
|
-
var _useState5 = (0, _react.useState)(false),
|
|
33
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
34
|
-
show = _useState6[0],
|
|
35
|
-
isShow = _useState6[1];
|
|
36
|
-
var handleKeyDown = function handleKeyDown(event) {
|
|
15
|
+
const EditableField = props => {
|
|
16
|
+
const [name, setName] = (0, _react.useState)(props.editableData || "N/A");
|
|
17
|
+
const [isNameFocused, setIsNameFocused] = (0, _react.useState)(false);
|
|
18
|
+
const [show, isShow] = (0, _react.useState)(false);
|
|
19
|
+
const handleKeyDown = event => {
|
|
37
20
|
// if (name?.length > 0 || typeof name === "number") {
|
|
38
21
|
// if (event.key === "Enter") {
|
|
39
22
|
// setIsNameFocused(false);
|
|
@@ -44,35 +27,32 @@ var EditableField = function EditableField(props) {
|
|
|
44
27
|
// setName(props.editableData ?? <Text>Please, enter some data</Text>);
|
|
45
28
|
// }
|
|
46
29
|
if (event.key === "Enter") {
|
|
47
|
-
if (
|
|
30
|
+
if (name?.length > 0) {
|
|
48
31
|
setIsNameFocused(false);
|
|
49
32
|
isShow(false);
|
|
50
33
|
} else {
|
|
51
|
-
var _props$editableData;
|
|
52
34
|
window.alert("Sorry, data should be there");
|
|
53
|
-
setName(
|
|
35
|
+
setName(props.editableData ?? /*#__PURE__*/_react.default.createElement(_text.default, null, "Please, enter some data"));
|
|
54
36
|
}
|
|
55
37
|
}
|
|
56
38
|
};
|
|
57
|
-
|
|
58
|
-
if (
|
|
39
|
+
const onBLurHandeler = () => {
|
|
40
|
+
if (name?.length > 0 || typeof name === "number") {
|
|
59
41
|
setIsNameFocused(false);
|
|
60
42
|
isShow(false);
|
|
61
43
|
} else {
|
|
62
|
-
var _props$editableData2;
|
|
63
44
|
window.alert("Sorry, data should be there");
|
|
64
|
-
setName(
|
|
45
|
+
setName(props.editableData ?? /*#__PURE__*/_react.default.createElement(_text.default, null, "Please, enter some data"));
|
|
65
46
|
setIsNameFocused(true);
|
|
66
47
|
isShow(true);
|
|
67
48
|
}
|
|
68
49
|
};
|
|
69
50
|
|
|
70
51
|
//Select Type
|
|
71
|
-
|
|
52
|
+
const onSelectBLurHandeler = () => {
|
|
72
53
|
if (props.value === null) {
|
|
73
|
-
var _props$value;
|
|
74
54
|
window.alert("Sorry, data should be selected");
|
|
75
|
-
setName(
|
|
55
|
+
setName(props.value ?? /*#__PURE__*/_react.default.createElement(_text.default, null, "Please, select some data"));
|
|
76
56
|
setIsNameFocused(true);
|
|
77
57
|
isShow(true);
|
|
78
58
|
} else {
|
|
@@ -93,15 +73,9 @@ var EditableField = function EditableField(props) {
|
|
|
93
73
|
cursor: "pointer"
|
|
94
74
|
} : {}
|
|
95
75
|
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
96
|
-
onClick:
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
onMouseEnter: function onMouseEnter() {
|
|
100
|
-
return isShow(true);
|
|
101
|
-
},
|
|
102
|
-
onMouseLeave: function onMouseLeave() {
|
|
103
|
-
return isShow(false);
|
|
104
|
-
},
|
|
76
|
+
onClick: () => setIsNameFocused(true),
|
|
77
|
+
onMouseEnter: () => isShow(true),
|
|
78
|
+
onMouseLeave: () => isShow(false),
|
|
105
79
|
style: {
|
|
106
80
|
display: "flex",
|
|
107
81
|
alignItems: "center",
|
|
@@ -113,7 +87,7 @@ var EditableField = function EditableField(props) {
|
|
|
113
87
|
variant: "standard",
|
|
114
88
|
autoFocus: true,
|
|
115
89
|
value: name,
|
|
116
|
-
onChange:
|
|
90
|
+
onChange: e => {
|
|
117
91
|
setName(e.target.value);
|
|
118
92
|
props.onChange(e.target.value);
|
|
119
93
|
},
|
|
@@ -131,5 +105,4 @@ var EditableField = function EditableField(props) {
|
|
|
131
105
|
}
|
|
132
106
|
})));
|
|
133
107
|
};
|
|
134
|
-
var _default = EditableField;
|
|
135
|
-
exports.default = _default;
|
|
108
|
+
var _default = exports.default = EditableField;
|
|
@@ -7,17 +7,16 @@ exports.default = void 0;
|
|
|
7
7
|
var _material = require("@mui/material");
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _text = _interopRequireDefault(require("../text"));
|
|
10
|
-
function _interopRequireDefault(
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
/* eslint-disable jsx-a11y/anchor-is-valid */
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
const Error = () => {
|
|
14
|
+
const handleGoBack = () => {
|
|
15
15
|
window.history.back();
|
|
16
16
|
// window.setTimeout(() => {
|
|
17
17
|
// window.location.reload();
|
|
18
18
|
// }, 10);
|
|
19
19
|
};
|
|
20
|
-
|
|
21
20
|
return /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
22
21
|
container: true
|
|
23
22
|
}, /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
@@ -39,18 +38,13 @@ var Error = function Error() {
|
|
|
39
38
|
cursor: "pointer",
|
|
40
39
|
color: "blue"
|
|
41
40
|
},
|
|
42
|
-
onClick:
|
|
43
|
-
return window.location.reload();
|
|
44
|
-
}
|
|
41
|
+
onClick: () => window.location.reload()
|
|
45
42
|
}, "Reloading", " "), "the page OR", /*#__PURE__*/_react.default.createElement("a", {
|
|
46
43
|
style: {
|
|
47
44
|
cursor: "pointer",
|
|
48
45
|
color: "blue"
|
|
49
46
|
},
|
|
50
|
-
onClick:
|
|
51
|
-
return handleGoBack();
|
|
52
|
-
}
|
|
47
|
+
onClick: () => handleGoBack()
|
|
53
48
|
}, " ", "Go Back")))));
|
|
54
49
|
};
|
|
55
|
-
var _default = Error;
|
|
56
|
-
exports.default = _default;
|
|
50
|
+
var _default = exports.default = Error;
|