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
|
@@ -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
|
});
|
|
@@ -10,20 +11,21 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
10
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
12
|
var _Menu = _interopRequireDefault(require("@mui/material/Menu"));
|
|
12
13
|
var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
function
|
|
16
|
-
function
|
|
17
|
-
function
|
|
14
|
+
var _excluded = ["loading"];
|
|
15
|
+
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); }
|
|
16
|
+
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; }
|
|
17
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
|
+
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); }
|
|
19
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
18
20
|
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."); }
|
|
19
|
-
function _unsupportedIterableToArray(
|
|
20
|
-
function _arrayLikeToArray(
|
|
21
|
-
function _iterableToArrayLimit(
|
|
22
|
-
function _arrayWithHoles(
|
|
23
|
-
function _objectWithoutProperties(
|
|
24
|
-
function _objectWithoutPropertiesLoose(
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
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); }
|
|
22
|
+
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; }
|
|
23
|
+
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; } }
|
|
24
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
25
|
+
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; }
|
|
26
|
+
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; }
|
|
27
|
+
var Button = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
28
|
+
var loading = props.loading,
|
|
27
29
|
loadingText = props.loadingText,
|
|
28
30
|
children = props.children,
|
|
29
31
|
size = props.size,
|
|
@@ -31,29 +33,29 @@ const Button = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
31
33
|
color = props.color,
|
|
32
34
|
fixedWidth = props.fixedWidth,
|
|
33
35
|
type = props.type;
|
|
34
|
-
|
|
36
|
+
var _ = props.loading,
|
|
35
37
|
propsSansLoading = _objectWithoutProperties(props, _excluded);
|
|
36
|
-
|
|
38
|
+
var handleClick = function handleClick(e) {
|
|
37
39
|
if (loading) {
|
|
38
40
|
e.preventDefault();
|
|
39
41
|
} else {
|
|
40
42
|
onClick && onClick(e);
|
|
41
43
|
}
|
|
42
44
|
};
|
|
43
|
-
|
|
45
|
+
var menuItems = props.menuItems,
|
|
44
46
|
setSelectedMenu = props.setSelectedMenu;
|
|
45
|
-
|
|
47
|
+
var _React$useState = _react.default.useState(null),
|
|
46
48
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
47
49
|
anchorEl = _React$useState2[0],
|
|
48
50
|
setAnchorEl = _React$useState2[1];
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
var open = Boolean(anchorEl);
|
|
52
|
+
var handleMenuClick = function handleMenuClick(event) {
|
|
51
53
|
setAnchorEl(event.currentTarget);
|
|
52
54
|
};
|
|
53
|
-
|
|
55
|
+
var handleClose = function handleClose(e) {
|
|
54
56
|
setAnchorEl(null);
|
|
55
57
|
};
|
|
56
|
-
|
|
58
|
+
var handleMenuItemClick = function handleMenuItemClick(value) {
|
|
57
59
|
setSelectedMenu(value);
|
|
58
60
|
handleClose();
|
|
59
61
|
};
|
|
@@ -75,20 +77,24 @@ const Button = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
75
77
|
id: "basic-menu",
|
|
76
78
|
anchorEl: anchorEl,
|
|
77
79
|
open: open,
|
|
78
|
-
onClose:
|
|
80
|
+
onClose: function onClose(e) {
|
|
81
|
+
return handleClose(e);
|
|
82
|
+
},
|
|
79
83
|
MenuListProps: {
|
|
80
84
|
"aria-labelledby": "basic-button"
|
|
81
85
|
},
|
|
82
86
|
sx: {
|
|
83
87
|
mt: "0.7rem"
|
|
84
88
|
}
|
|
85
|
-
}, menuItems && (menuItems === null || menuItems === void 0 ? void 0 : menuItems.map((item, key)
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
}, menuItems && (menuItems === null || menuItems === void 0 ? void 0 : menuItems.map(function (item, key) {
|
|
90
|
+
return /*#__PURE__*/_react.default.createElement(_MenuItem.default, {
|
|
91
|
+
onClick: function onClick(e) {
|
|
92
|
+
handleClose(e);
|
|
93
|
+
handleMenuItemClick(item);
|
|
94
|
+
},
|
|
95
|
+
key: item.item
|
|
96
|
+
}, item.item);
|
|
97
|
+
})))) : /*#__PURE__*/_react.default.createElement(_material.Button, _extends({
|
|
92
98
|
ref: ref,
|
|
93
99
|
onClick: handleClick
|
|
94
100
|
}, props, {
|
|
@@ -100,16 +106,16 @@ const Button = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
100
106
|
size: size,
|
|
101
107
|
loadingText: loadingText
|
|
102
108
|
}), loadingText && {
|
|
103
|
-
loadingText
|
|
109
|
+
loadingText: loadingText
|
|
104
110
|
}) : children));
|
|
105
111
|
});
|
|
106
|
-
|
|
107
|
-
|
|
112
|
+
var ButtonLoader = function ButtonLoader(_ref) {
|
|
113
|
+
var buttonColor = _ref.buttonColor,
|
|
108
114
|
size = _ref.size,
|
|
109
115
|
loadingText = _ref.loadingText;
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
116
|
+
var theme = (0, _styles.useTheme)();
|
|
117
|
+
var resolvedButtonColor = theme.palette[buttonColor] ? theme.palette[buttonColor].main : theme.palette.primary.main;
|
|
118
|
+
var textColor = theme.palette.getContrastText(resolvedButtonColor);
|
|
113
119
|
return /*#__PURE__*/_react.default.createElement(_material.CircularProgress, {
|
|
114
120
|
size: size === "small" ? 20 : size === "large" ? 24 : 22,
|
|
115
121
|
sx: {
|
|
@@ -130,4 +136,5 @@ Button.propTypes = {
|
|
|
130
136
|
onClick: _propTypes.default.func,
|
|
131
137
|
color: _propTypes.default.string
|
|
132
138
|
};
|
|
133
|
-
var _default =
|
|
139
|
+
var _default = Button;
|
|
140
|
+
exports.default = _default;
|
|
@@ -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
|
});
|
|
@@ -12,33 +13,34 @@ var _fa = require("react-icons/fa");
|
|
|
12
13
|
var _fi = require("react-icons/fi");
|
|
13
14
|
var _input = _interopRequireDefault(require("../input"));
|
|
14
15
|
var _text = _interopRequireDefault(require("../text"));
|
|
15
|
-
function _interopRequireDefault(
|
|
16
|
-
function
|
|
17
|
-
function
|
|
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
18
20
|
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."); }
|
|
19
|
-
function _unsupportedIterableToArray(
|
|
20
|
-
function _arrayLikeToArray(
|
|
21
|
-
function _iterableToArrayLimit(
|
|
22
|
-
function _arrayWithHoles(
|
|
23
|
-
|
|
21
|
+
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); }
|
|
22
|
+
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; }
|
|
23
|
+
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; } }
|
|
24
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
25
|
+
var ChatBotModal = function ChatBotModal(_ref) {
|
|
24
26
|
var _theme$breakpoints;
|
|
25
|
-
|
|
27
|
+
var open = _ref.open,
|
|
26
28
|
onClose = _ref.onClose,
|
|
27
29
|
messages = _ref.messages,
|
|
28
30
|
inputValue = _ref.inputValue,
|
|
29
31
|
setInputValue = _ref.setInputValue,
|
|
30
32
|
handleSend = _ref.handleSend,
|
|
31
33
|
loading = _ref.loading;
|
|
32
|
-
|
|
34
|
+
var _useState = (0, _react.useState)(false),
|
|
33
35
|
_useState2 = _slicedToArray(_useState, 2),
|
|
34
36
|
isFullscreen = _useState2[0],
|
|
35
37
|
setIsFullscreen = _useState2[1];
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
(0, _react.useEffect)(()
|
|
38
|
+
var messagesEndRef = (0, _react.useRef)(null);
|
|
39
|
+
var theme = (0, _material.useTheme)();
|
|
40
|
+
var isNotExpanded = (0, _material.useMediaQuery)(theme === null || theme === void 0 ? void 0 : (_theme$breakpoints = theme.breakpoints) === null || _theme$breakpoints === void 0 ? void 0 : _theme$breakpoints.down("sm"));
|
|
41
|
+
(0, _react.useEffect)(function () {
|
|
40
42
|
var _messagesEndRef$curre;
|
|
41
|
-
messagesEndRef === null || messagesEndRef === void 0
|
|
43
|
+
messagesEndRef === null || messagesEndRef === void 0 ? void 0 : (_messagesEndRef$curre = messagesEndRef.current) === null || _messagesEndRef$curre === void 0 ? void 0 : _messagesEndRef$curre.scrollIntoView({
|
|
42
44
|
behavior: "smooth"
|
|
43
45
|
});
|
|
44
46
|
}, [messages]);
|
|
@@ -102,7 +104,11 @@ const ChatBotModal = _ref => {
|
|
|
102
104
|
variant: "h6",
|
|
103
105
|
semibold: true
|
|
104
106
|
}, "Chat with Tenjin"), /*#__PURE__*/_react.default.createElement(_material.Box, null, /*#__PURE__*/_react.default.createElement(_material.IconButton, {
|
|
105
|
-
onClick: ()
|
|
107
|
+
onClick: function onClick() {
|
|
108
|
+
return setIsFullscreen(function (prev) {
|
|
109
|
+
return !prev;
|
|
110
|
+
});
|
|
111
|
+
},
|
|
106
112
|
size: "small"
|
|
107
113
|
}, isFullscreen ? /*#__PURE__*/_react.default.createElement(_fi.FiMinimize, null) : /*#__PURE__*/_react.default.createElement(_fa.FaExpand, null)), /*#__PURE__*/_react.default.createElement(_material.IconButton, {
|
|
108
114
|
onClick: onClose,
|
|
@@ -120,22 +126,24 @@ const ChatBotModal = _ref => {
|
|
|
120
126
|
position: "relative",
|
|
121
127
|
zIndex: 1
|
|
122
128
|
}
|
|
123
|
-
}, messages === null || messages === void 0 ? void 0 : messages.map((msg, idx)
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
129
|
+
}, messages === null || messages === void 0 ? void 0 : messages.map(function (msg, idx) {
|
|
130
|
+
return /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
131
|
+
key: idx,
|
|
132
|
+
sx: {
|
|
133
|
+
alignSelf: msg.sender === "user" ? "flex-end" : "flex-start",
|
|
134
|
+
backgroundColor: "#f5f5f5",
|
|
135
|
+
color: "#000",
|
|
136
|
+
px: 2,
|
|
137
|
+
py: 1,
|
|
138
|
+
borderRadius: 2,
|
|
139
|
+
boxShadow: 1,
|
|
140
|
+
maxWidth: "80%",
|
|
141
|
+
fontSize: "0.9rem",
|
|
142
|
+
wordBreak: "break-word",
|
|
143
|
+
whiteSpace: "pre-wrap"
|
|
144
|
+
}
|
|
145
|
+
}, msg.text);
|
|
146
|
+
}), loading && /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
139
147
|
sx: {
|
|
140
148
|
alignSelf: "flex-start",
|
|
141
149
|
backgroundColor: "#f5f5f5",
|
|
@@ -167,11 +175,11 @@ const ChatBotModal = _ref => {
|
|
|
167
175
|
fullWidth: true,
|
|
168
176
|
placeholder: "Type your message...",
|
|
169
177
|
value: inputValue,
|
|
170
|
-
onChange: e
|
|
178
|
+
onChange: function onChange(e) {
|
|
171
179
|
var _e$target;
|
|
172
|
-
return setInputValue(e === null || e === void 0
|
|
180
|
+
return setInputValue(e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
|
|
173
181
|
},
|
|
174
|
-
onKeyDown: e
|
|
182
|
+
onKeyDown: function onKeyDown(e) {
|
|
175
183
|
if ((e === null || e === void 0 ? void 0 : e.key) === "Enter") handleSend();
|
|
176
184
|
},
|
|
177
185
|
sx: {
|
|
@@ -188,4 +196,5 @@ const ChatBotModal = _ref => {
|
|
|
188
196
|
disabled: !(inputValue !== null && inputValue !== void 0 && inputValue.trim())
|
|
189
197
|
}, /*#__PURE__*/_react.default.createElement(_Send.default, null))))));
|
|
190
198
|
};
|
|
191
|
-
var _default =
|
|
199
|
+
var _default = ChatBotModal;
|
|
200
|
+
exports.default = _default;
|
|
@@ -7,13 +7,13 @@ 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
|
-
|
|
11
|
-
function _interopRequireDefault(
|
|
12
|
-
function _extends() {
|
|
13
|
-
function _objectWithoutProperties(
|
|
14
|
-
function _objectWithoutPropertiesLoose(
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
var _excluded = ["label"];
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
14
|
+
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; }
|
|
15
|
+
var CheckBox = function CheckBox(props) {
|
|
16
|
+
var label = props.label,
|
|
17
17
|
rest = _objectWithoutProperties(props, _excluded);
|
|
18
18
|
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_material.FormControlLabel, _extends({
|
|
19
19
|
control: /*#__PURE__*/_react.default.createElement(_material.Checkbox, rest),
|
|
@@ -26,4 +26,5 @@ CheckBox.defaultProps = {
|
|
|
26
26
|
defaultChecked: true,
|
|
27
27
|
labelPlacement: "right"
|
|
28
28
|
};
|
|
29
|
-
var _default =
|
|
29
|
+
var _default = CheckBox;
|
|
30
|
+
exports.default = _default;
|
|
@@ -9,25 +9,29 @@ 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
|
|
16
|
-
function
|
|
17
|
-
function
|
|
18
|
-
function
|
|
19
|
-
function
|
|
20
|
-
function
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
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); }
|
|
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 _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(); }
|
|
21
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."); }
|
|
22
|
-
function _unsupportedIterableToArray(
|
|
23
|
-
function _arrayLikeToArray(
|
|
24
|
-
function _iterableToArrayLimit(
|
|
25
|
-
function _arrayWithHoles(
|
|
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; }
|
|
26
28
|
// Styled components to match the Tailwind design
|
|
27
|
-
|
|
28
|
-
shouldForwardProp:
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
var StyledTextField = (0, _styles.styled)(_material.TextField, {
|
|
30
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
31
|
+
return prop !== "error" && prop !== "loading";
|
|
32
|
+
}
|
|
33
|
+
})(function (_ref) {
|
|
34
|
+
var theme = _ref.theme,
|
|
31
35
|
error = _ref.error,
|
|
32
36
|
loading = _ref.loading;
|
|
33
37
|
return {
|
|
@@ -66,8 +70,8 @@ const StyledTextField = (0, _styles.styled)(_material.TextField, {
|
|
|
66
70
|
}
|
|
67
71
|
};
|
|
68
72
|
});
|
|
69
|
-
|
|
70
|
-
|
|
73
|
+
var StyledPaper = (0, _styles.styled)(_material.Paper)(function (_ref2) {
|
|
74
|
+
var theme = _ref2.theme;
|
|
71
75
|
return {
|
|
72
76
|
marginTop: "4px",
|
|
73
77
|
maxHeight: "240px",
|
|
@@ -101,10 +105,12 @@ const StyledPaper = (0, _styles.styled)(_material.Paper)(_ref2 => {
|
|
|
101
105
|
}
|
|
102
106
|
};
|
|
103
107
|
});
|
|
104
|
-
|
|
105
|
-
shouldForwardProp:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
+
var Label = (0, _styles.styled)(_material.Typography, {
|
|
109
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
110
|
+
return prop !== "isRequired";
|
|
111
|
+
}
|
|
112
|
+
})(function (_ref3) {
|
|
113
|
+
var isRequired = _ref3.isRequired;
|
|
108
114
|
return {
|
|
109
115
|
display: "block",
|
|
110
116
|
fontSize: "0.875rem",
|
|
@@ -119,10 +125,12 @@ const Label = (0, _styles.styled)(_material.Typography, {
|
|
|
119
125
|
} : {}
|
|
120
126
|
};
|
|
121
127
|
});
|
|
122
|
-
|
|
123
|
-
shouldForwardProp:
|
|
124
|
-
|
|
125
|
-
|
|
128
|
+
var HelperText = (0, _styles.styled)(_material.Typography, {
|
|
129
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
130
|
+
return prop !== "error";
|
|
131
|
+
}
|
|
132
|
+
})(function (_ref4) {
|
|
133
|
+
var error = _ref4.error;
|
|
126
134
|
return {
|
|
127
135
|
marginTop: "8px",
|
|
128
136
|
fontSize: "0.875rem",
|
|
@@ -130,8 +138,8 @@ const HelperText = (0, _styles.styled)(_material.Typography, {
|
|
|
130
138
|
color: error ? "#dc2626" : "#4b5563"
|
|
131
139
|
};
|
|
132
140
|
});
|
|
133
|
-
|
|
134
|
-
|
|
141
|
+
var Combobox = function Combobox(_ref5) {
|
|
142
|
+
var _ref5$options = _ref5.options,
|
|
135
143
|
options = _ref5$options === void 0 ? [] : _ref5$options,
|
|
136
144
|
selected = _ref5.selected,
|
|
137
145
|
defaultValue = _ref5.defaultValue,
|
|
@@ -147,29 +155,31 @@ const Combobox = _ref5 => {
|
|
|
147
155
|
by = _ref5$by === void 0 ? "id" : _ref5$by,
|
|
148
156
|
_ref5$labelKey = _ref5.labelKey,
|
|
149
157
|
labelKey = _ref5$labelKey === void 0 ? "label" : _ref5$labelKey;
|
|
150
|
-
|
|
158
|
+
var _useState = (0, _react.useState)(null),
|
|
151
159
|
_useState2 = _slicedToArray(_useState, 2),
|
|
152
160
|
internalSelected = _useState2[0],
|
|
153
161
|
setInternalSelected = _useState2[1];
|
|
154
|
-
|
|
162
|
+
var _useState3 = (0, _react.useState)(false),
|
|
155
163
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
156
164
|
hasSetDefault = _useState4[0],
|
|
157
165
|
setHasSetDefault = _useState4[1];
|
|
158
|
-
|
|
166
|
+
var _useState5 = (0, _react.useState)(false),
|
|
159
167
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
160
168
|
open = _useState6[0],
|
|
161
169
|
setOpen = _useState6[1];
|
|
162
170
|
|
|
163
171
|
// Handle defaultValue - accepts both object and primitive (ID)
|
|
164
|
-
(0, _react.useEffect)(()
|
|
172
|
+
(0, _react.useEffect)(function () {
|
|
165
173
|
if (defaultValue && options.length > 0 && !hasSetDefault) {
|
|
166
|
-
|
|
167
|
-
if (
|
|
174
|
+
var defaultOption;
|
|
175
|
+
if (_typeof(defaultValue) === "object" && defaultValue !== null) {
|
|
168
176
|
// defaultValue is already a full object
|
|
169
177
|
defaultOption = defaultValue;
|
|
170
178
|
} else {
|
|
171
179
|
// defaultValue is a primitive (ID), find the matching option
|
|
172
|
-
defaultOption = options.find(
|
|
180
|
+
defaultOption = options.find(function (opt) {
|
|
181
|
+
return opt[by] === defaultValue;
|
|
182
|
+
});
|
|
173
183
|
}
|
|
174
184
|
if (defaultOption) {
|
|
175
185
|
setInternalSelected(defaultOption);
|
|
@@ -179,8 +189,8 @@ const Combobox = _ref5 => {
|
|
|
179
189
|
}, [defaultValue, options, by, hasSetDefault]);
|
|
180
190
|
|
|
181
191
|
// Use selected prop if provided, otherwise use internal state
|
|
182
|
-
|
|
183
|
-
|
|
192
|
+
var currentValue = selected || internalSelected;
|
|
193
|
+
var handleChange = function handleChange(event, value) {
|
|
184
194
|
setInternalSelected(value);
|
|
185
195
|
if (onChange) {
|
|
186
196
|
// Pass the full object to onChange (industry standard)
|
|
@@ -199,13 +209,21 @@ const Combobox = _ref5 => {
|
|
|
199
209
|
value: currentValue,
|
|
200
210
|
onChange: handleChange,
|
|
201
211
|
options: options,
|
|
202
|
-
getOptionLabel:
|
|
203
|
-
|
|
212
|
+
getOptionLabel: function getOptionLabel(option) {
|
|
213
|
+
return (option === null || option === void 0 ? void 0 : option[labelKey]) || "";
|
|
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
|
+
},
|
|
204
218
|
loading: loading,
|
|
205
219
|
disabled: loading,
|
|
206
220
|
open: open && !loading,
|
|
207
|
-
onOpen: ()
|
|
208
|
-
|
|
221
|
+
onOpen: function onOpen() {
|
|
222
|
+
return setOpen(true);
|
|
223
|
+
},
|
|
224
|
+
onClose: function onClose() {
|
|
225
|
+
return setOpen(false);
|
|
226
|
+
},
|
|
209
227
|
disableClearable: false,
|
|
210
228
|
PaperComponent: StyledPaper,
|
|
211
229
|
popupIcon: loading ? /*#__PURE__*/_react.default.createElement(_material.CircularProgress, {
|
|
@@ -219,14 +237,16 @@ const Combobox = _ref5 => {
|
|
|
219
237
|
}
|
|
220
238
|
}),
|
|
221
239
|
noOptionsText: "No results found",
|
|
222
|
-
renderInput:
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
240
|
+
renderInput: function renderInput(params) {
|
|
241
|
+
return /*#__PURE__*/_react.default.createElement(StyledTextField, _extends({}, params, {
|
|
242
|
+
error: error,
|
|
243
|
+
loading: loading,
|
|
244
|
+
placeholder: loading ? "Loading..." : "",
|
|
245
|
+
InputProps: _objectSpread(_objectSpread({}, params.InputProps), {}, {
|
|
246
|
+
endAdornment: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, params.InputProps.endAdornment)
|
|
247
|
+
})
|
|
248
|
+
}));
|
|
249
|
+
}
|
|
230
250
|
}), helperText && /*#__PURE__*/_react.default.createElement(HelperText, {
|
|
231
251
|
error: error
|
|
232
252
|
}, helperText));
|
|
@@ -387,4 +407,5 @@ Combobox.defaultProps = {
|
|
|
387
407
|
by: "id",
|
|
388
408
|
labelKey: "label"
|
|
389
409
|
};
|
|
390
|
-
var _default =
|
|
410
|
+
var _default = Combobox;
|
|
411
|
+
exports.default = _default;
|