tenjin-ui-kit 0.3.67 → 0.3.69
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/.dockerignore +6 -0
- package/.storybook/main.js +16 -0
- package/.storybook/preview.js +11 -0
- package/Dockerfile +17 -0
- package/Jenkinsfile +66 -0
- package/build/asset-manifest.json +16 -0
- package/build/favicon.ico +0 -0
- package/build/index.html +1 -0
- package/build/logo192.png +0 -0
- package/build/logo512.png +0 -0
- package/build/manifest.json +25 -0
- package/build/robots.txt +3 -0
- package/build/static/css/main.e7366529.css +2 -0
- package/build/static/css/main.e7366529.css.map +1 -0
- package/build/static/js/453.900c81c3.chunk.js +2 -0
- package/build/static/js/453.900c81c3.chunk.js.map +1 -0
- package/build/static/js/main.8abb72fa.js +3 -0
- package/build/static/js/main.8abb72fa.js.LICENSE.txt +61 -0
- package/build/static/js/main.8abb72fa.js.map +1 -0
- package/build/static/media/logo.6ce24c58023cc2f8fd88fe9d219db6c6.svg +1 -0
- package/build/tenjinLogo.png +0 -0
- package/dist/README.md +13 -0
- package/dist/common/hooks/apiHooks.js +155 -0
- package/dist/common/hooks/newApiHook.js +188 -0
- package/{common → dist/common}/utils/security/index.js +2 -2
- package/{common → dist/common}/utils/security/securityConfig.js +1 -2
- package/dist/components/Canvas.js +330 -0
- package/dist/components/DragBox/index.js +40 -0
- package/dist/components/InputWithChip/index.js +294 -0
- package/{components → dist/components}/RightContext/index.js +19 -28
- package/dist/components/WorkFlow.js +42 -0
- package/dist/components/WorkFlowBuilder.js +115 -0
- package/dist/components/alert/Style.js +20 -0
- package/dist/components/alert/index.js +67 -0
- package/{components → dist/components}/attachment/index.js +21 -28
- package/{components → dist/components}/authenticationProvider/AuthError.js +3 -4
- package/{components → dist/components}/authenticationProvider/AuthLoader.js +3 -4
- package/dist/components/authenticationProvider/index.js +110 -0
- package/{components → dist/components}/avatar/index.js +13 -14
- package/dist/components/avatar/styles.js +91 -0
- package/dist/components/breadCrumbs/index.js +169 -0
- package/{components → dist/components}/breadCrumbs/style.js +1 -4
- package/{components → dist/components}/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/index.js +5 -6
- package/{components → dist/components}/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/style.js +5 -8
- package/{components → dist/components}/browsingTestCaseLayout/DetailsViewLayout/DetailsViewHeader/index.js +4 -5
- package/{components → dist/components}/browsingTestCaseLayout/TreeViewLayout/TreeViewContent/Index.js +4 -5
- package/{components → dist/components}/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/Index.js +5 -6
- package/dist/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/style.js +23 -0
- package/{components → dist/components}/browsingTestCaseLayout/index.js +25 -30
- package/dist/components/button/index.js +133 -0
- package/{components → dist/components}/chatBotModal/index.js +36 -45
- package/dist/components/checkBox/index.js +29 -0
- package/{components → dist/components}/combobox/index.js +51 -72
- package/dist/components/divider/index.js +37 -0
- package/{components → dist/components}/editableField/index.js +19 -28
- package/{components → dist/components}/error/index.js +6 -12
- package/dist/components/errorBoundary/index.js +140 -0
- package/dist/components/fileUploader/index.js +151 -0
- package/dist/components/fileUploader/style.js +57 -0
- package/dist/components/filter/ValueSelector.js +333 -0
- package/{components → dist/components}/filter/index.js +31 -36
- package/{components → dist/components}/iconButton/index.js +3 -4
- package/dist/components/input/index.js +167 -0
- package/dist/components/layout/index.js +94 -0
- package/dist/components/layout/main/index.js +24 -0
- package/dist/components/layout/main/style.js +19 -0
- package/{components → dist/components}/layout/pageContent/index.js +6 -7
- package/dist/components/layout/sidebar/FlatMenu.js +64 -0
- package/dist/components/layout/sidebar/GroupedIconMenu.js +233 -0
- package/dist/components/layout/sidebar/GroupedMenu.js +57 -0
- package/dist/components/layout/sidebar/ProjectMenu.js +223 -0
- package/dist/components/layout/sidebar/index.js +88 -0
- package/dist/components/layout/sidebar/style.js +149 -0
- package/{components → dist/components}/layout/topBar/ProjectTopbar.js +81 -98
- package/dist/components/layout/topBar/UserAvatar.js +138 -0
- package/dist/components/layout/topBar/index.js +121 -0
- package/{components → dist/components}/loader/index.js +9 -12
- package/dist/components/menu/index.js +71 -0
- package/{components → dist/components}/modal/Modal.js +5 -6
- package/dist/components/modal/index.js +88 -0
- package/dist/components/modal/style.js +65 -0
- package/dist/components/optionMenu/index.js +105 -0
- package/dist/components/pagination/index.js +114 -0
- package/dist/components/pagination/style.js +33 -0
- package/dist/components/paginationUpdated/index.js +73 -0
- package/dist/components/paper/index.js +43 -0
- package/dist/components/paper/style.js +31 -0
- package/dist/components/reactSelect/index.js +195 -0
- package/dist/components/reactSelect/style.js +130 -0
- package/dist/components/richTextEditor/index.js +64 -0
- package/dist/components/select/GroupedSelect.js +167 -0
- package/dist/components/select/SimpleSelect.js +184 -0
- package/{components → dist/components}/select/index.js +38 -54
- package/dist/components/simpleSelect/index.js +53 -0
- package/{components → dist/components}/sort/index.js +19 -22
- package/{components → dist/components}/switch/index.js +10 -11
- package/dist/components/switch/style.js +39 -0
- package/{components → dist/components}/switch/switch.js +17 -23
- package/dist/components/table/ReactTable.js +101 -0
- package/dist/components/table/SimpleTable.js +117 -0
- package/dist/components/table/index.js +381 -0
- package/dist/components/text/index.js +65 -0
- package/{components → dist/components}/timeStamp/index.js +4 -6
- package/dist/components/timeStamp/style.js +20 -0
- package/dist/components/topBar/index.js +169 -0
- package/{components → dist/components}/tree/index.js +29 -47
- package/dist/components/tree/style.js +29 -0
- package/dist/components/valuePicker/ValueSelector.js +205 -0
- package/{components → dist/components}/valuePicker/index.js +19 -26
- package/{components → dist/components}/wrapperLayout/layout/index.js +4 -5
- package/{components → dist/components}/wrapperLayout/main/index.js +4 -5
- package/{components → dist/components}/wrapperLayout/main/pageContainer/index.js +4 -5
- package/dist/components/wrapperLayout/main/sideBar/index.js +272 -0
- package/dist/components/wrapperLayout/main/sideBar/style.js +190 -0
- package/{components → dist/components}/wrapperLayout/topBar/UserAvatar.js +4 -5
- package/dist/components/wrapperLayout/topBar/avatar.js +55 -0
- package/dist/components/wrapperLayout/topBar/index.js +196 -0
- package/{components → dist/components}/wrapperLayout/topBar/menuIcon.js +4 -5
- package/dist/components/wrapperLayout/topBar/style.js +74 -0
- package/dist/http/index.js +133 -0
- package/{index.js → dist/index.js} +53 -55
- package/dist/package.json +127 -0
- package/{templates → dist/templates}/listPage/index.js +36 -57
- package/{themes → dist/themes}/default.js +5 -7
- package/{themes → dist/themes}/defaultSmall.js +2 -3
- package/{themes → dist/themes}/responsiveTheme.js +6 -8
- package/package.json +4 -1
- package/public/favicon.ico +0 -0
- package/public/index.html +43 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +25 -0
- package/public/robots.txt +3 -0
- package/public/tenjinLogo.png +0 -0
- package/common/hooks/apiHooks.js +0 -223
- package/common/hooks/newApiHook.js +0 -270
- package/components/Canvas.js +0 -254
- package/components/DragBox/index.js +0 -45
- package/components/InputWithChip/index.js +0 -187
- package/components/WorkFlow.js +0 -47
- package/components/WorkFlowBuilder.js +0 -130
- package/components/alert/Style.js +0 -23
- package/components/alert/index.js +0 -69
- package/components/authenticationProvider/index.js +0 -166
- package/components/avatar/styles.js +0 -94
- package/components/breadCrumbs/index.js +0 -180
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/style.js +0 -26
- package/components/button/index.js +0 -135
- package/components/checkBox/index.js +0 -30
- package/components/divider/index.js +0 -41
- package/components/errorBoundary/index.js +0 -160
- package/components/fileUploader/index.js +0 -156
- package/components/fileUploader/style.js +0 -60
- package/components/filter/ValueSelector.js +0 -350
- package/components/input/index.js +0 -174
- package/components/layout/index.js +0 -98
- package/components/layout/main/index.js +0 -27
- package/components/layout/main/style.js +0 -22
- package/components/layout/sidebar/FlatMenu.js +0 -64
- package/components/layout/sidebar/GroupedIconMenu.js +0 -246
- package/components/layout/sidebar/GroupedMenu.js +0 -67
- package/components/layout/sidebar/ProjectMenu.js +0 -230
- package/components/layout/sidebar/index.js +0 -91
- package/components/layout/sidebar/style.js +0 -154
- package/components/layout/topBar/UserAvatar.js +0 -145
- package/components/layout/topBar/index.js +0 -132
- package/components/menu/index.js +0 -80
- package/components/modal/index.js +0 -91
- package/components/modal/style.js +0 -68
- package/components/optionMenu/index.js +0 -112
- package/components/pagination/index.js +0 -129
- package/components/pagination/style.js +0 -36
- package/components/paginationUpdated/index.js +0 -75
- package/components/paper/index.js +0 -44
- package/components/paper/style.js +0 -34
- package/components/reactSelect/index.js +0 -212
- package/components/reactSelect/style.js +0 -163
- package/components/richTextEditor/index.js +0 -83
- package/components/select/GroupedSelect.js +0 -183
- package/components/select/SimpleSelect.js +0 -212
- package/components/simpleSelect/index.js +0 -56
- package/components/switch/style.js +0 -42
- package/components/table/ReactTable.js +0 -118
- package/components/table/SimpleTable.js +0 -136
- package/components/table/index.js +0 -256
- package/components/text/index.js +0 -67
- package/components/timeStamp/style.js +0 -23
- package/components/topBar/index.js +0 -176
- package/components/tree/style.js +0 -32
- package/components/valuePicker/ValueSelector.js +0 -273
- package/components/wrapperLayout/main/sideBar/index.js +0 -262
- package/components/wrapperLayout/main/sideBar/style.js +0 -196
- package/components/wrapperLayout/topBar/avatar.js +0 -57
- package/components/wrapperLayout/topBar/index.js +0 -182
- package/components/wrapperLayout/topBar/style.js +0 -77
- package/http/index.js +0 -226
- /package/{assets → dist/assets}/images/MicrosoftTeams-image (1).png +0 -0
- /package/{assets → dist/assets}/images/tenjin-4.0-logo.png +0 -0
- /package/{components → dist/components}/RightContext/index.css +0 -0
- /package/{components → dist/components}/browsingTestCaseLayout/style.css +0 -0
- /package/{components → dist/components}/errorBoundary/Error.jpg +0 -0
- /package/{components → dist/components}/iconButton/style.js +0 -0
- /package/{components → dist/components}/richTextEditor/style.js +0 -0
- /package/{components → dist/components}/wrapperLayout/layout/style.js +0 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.ButtonLoader = void 0;
|
|
7
|
+
var _material = require("@mui/material");
|
|
8
|
+
var _styles = require("@mui/material/styles");
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _Menu = _interopRequireDefault(require("@mui/material/Menu"));
|
|
12
|
+
var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
|
|
13
|
+
const _excluded = ["loading"];
|
|
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
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
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); }
|
|
17
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
18
|
+
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(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
20
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
21
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
22
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
23
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
24
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
25
|
+
const Button = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
26
|
+
const loading = props.loading,
|
|
27
|
+
loadingText = props.loadingText,
|
|
28
|
+
children = props.children,
|
|
29
|
+
size = props.size,
|
|
30
|
+
onClick = props.onClick,
|
|
31
|
+
color = props.color,
|
|
32
|
+
fixedWidth = props.fixedWidth,
|
|
33
|
+
type = props.type;
|
|
34
|
+
const _ = props.loading,
|
|
35
|
+
propsSansLoading = _objectWithoutProperties(props, _excluded);
|
|
36
|
+
const handleClick = e => {
|
|
37
|
+
if (loading) {
|
|
38
|
+
e.preventDefault();
|
|
39
|
+
} else {
|
|
40
|
+
onClick && onClick(e);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const menuItems = props.menuItems,
|
|
44
|
+
setSelectedMenu = props.setSelectedMenu;
|
|
45
|
+
const _React$useState = _react.default.useState(null),
|
|
46
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
47
|
+
anchorEl = _React$useState2[0],
|
|
48
|
+
setAnchorEl = _React$useState2[1];
|
|
49
|
+
const open = Boolean(anchorEl);
|
|
50
|
+
const handleMenuClick = event => {
|
|
51
|
+
setAnchorEl(event.currentTarget);
|
|
52
|
+
};
|
|
53
|
+
const handleClose = e => {
|
|
54
|
+
setAnchorEl(null);
|
|
55
|
+
};
|
|
56
|
+
const handleMenuItemClick = value => {
|
|
57
|
+
setSelectedMenu(value);
|
|
58
|
+
handleClose();
|
|
59
|
+
};
|
|
60
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, type === "menu" ? /*#__PURE__*/_react.default.createElement("div", {
|
|
61
|
+
style: {
|
|
62
|
+
display: "flex",
|
|
63
|
+
justifyContent: "flex-end",
|
|
64
|
+
gap: 20,
|
|
65
|
+
alignItems: "center"
|
|
66
|
+
}
|
|
67
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Button, _extends({
|
|
68
|
+
ref: ref,
|
|
69
|
+
size: "small",
|
|
70
|
+
"aria-controls": open ? "basic-menu" : undefined,
|
|
71
|
+
"aria-haspopup": "true",
|
|
72
|
+
"aria-expanded": open ? "true" : undefined,
|
|
73
|
+
onClick: handleMenuClick
|
|
74
|
+
}, propsSansLoading), children), /*#__PURE__*/_react.default.createElement(_Menu.default, {
|
|
75
|
+
id: "basic-menu",
|
|
76
|
+
anchorEl: anchorEl,
|
|
77
|
+
open: open,
|
|
78
|
+
onClose: e => handleClose(e),
|
|
79
|
+
MenuListProps: {
|
|
80
|
+
"aria-labelledby": "basic-button"
|
|
81
|
+
},
|
|
82
|
+
sx: {
|
|
83
|
+
mt: "0.7rem"
|
|
84
|
+
}
|
|
85
|
+
}, menuItems && (menuItems === null || menuItems === void 0 ? void 0 : menuItems.map((item, key) => /*#__PURE__*/_react.default.createElement(_MenuItem.default, {
|
|
86
|
+
onClick: e => {
|
|
87
|
+
handleClose(e);
|
|
88
|
+
handleMenuItemClick(item);
|
|
89
|
+
},
|
|
90
|
+
key: item.item
|
|
91
|
+
}, item.item))))) : /*#__PURE__*/_react.default.createElement(_material.Button, _extends({
|
|
92
|
+
ref: ref,
|
|
93
|
+
onClick: handleClick
|
|
94
|
+
}, props, {
|
|
95
|
+
sx: fixedWidth && {
|
|
96
|
+
minWidth: 148
|
|
97
|
+
}
|
|
98
|
+
}), loading ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(ButtonLoader, {
|
|
99
|
+
buttonColor: color,
|
|
100
|
+
size: size,
|
|
101
|
+
loadingText: loadingText
|
|
102
|
+
}), loadingText && {
|
|
103
|
+
loadingText
|
|
104
|
+
}) : children));
|
|
105
|
+
});
|
|
106
|
+
const ButtonLoader = _ref => {
|
|
107
|
+
let buttonColor = _ref.buttonColor,
|
|
108
|
+
size = _ref.size,
|
|
109
|
+
loadingText = _ref.loadingText;
|
|
110
|
+
const theme = (0, _styles.useTheme)();
|
|
111
|
+
const resolvedButtonColor = theme.palette[buttonColor] ? theme.palette[buttonColor].main : theme.palette.primary.main;
|
|
112
|
+
const textColor = theme.palette.getContrastText(resolvedButtonColor);
|
|
113
|
+
return /*#__PURE__*/_react.default.createElement(_material.CircularProgress, {
|
|
114
|
+
size: size === "small" ? 20 : size === "large" ? 24 : 22,
|
|
115
|
+
sx: {
|
|
116
|
+
marginRight: loadingText ? "0.5rem" : "initial",
|
|
117
|
+
color: textColor
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
exports.ButtonLoader = ButtonLoader;
|
|
122
|
+
Button.defaultProps = {
|
|
123
|
+
color: "primary"
|
|
124
|
+
};
|
|
125
|
+
Button.propTypes = {
|
|
126
|
+
loading: _propTypes.default.bool,
|
|
127
|
+
loadingText: _propTypes.default.string,
|
|
128
|
+
children: _propTypes.default.any,
|
|
129
|
+
size: _propTypes.default.string,
|
|
130
|
+
onClick: _propTypes.default.func,
|
|
131
|
+
color: _propTypes.default.string
|
|
132
|
+
};
|
|
133
|
+
var _default = exports.default = Button;
|
|
@@ -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
|
});
|
|
@@ -13,34 +12,33 @@ var _fa = require("react-icons/fa");
|
|
|
13
12
|
var _fi = require("react-icons/fi");
|
|
14
13
|
var _input = _interopRequireDefault(require("../input"));
|
|
15
14
|
var _text = _interopRequireDefault(require("../text"));
|
|
16
|
-
function _interopRequireDefault(
|
|
17
|
-
function
|
|
18
|
-
function
|
|
19
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
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); }
|
|
17
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
20
18
|
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."); }
|
|
21
|
-
function _unsupportedIterableToArray(
|
|
22
|
-
function _arrayLikeToArray(
|
|
23
|
-
function _iterableToArrayLimit(
|
|
24
|
-
function _arrayWithHoles(
|
|
25
|
-
|
|
19
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
20
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
21
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
22
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
23
|
+
const ChatBotModal = _ref => {
|
|
26
24
|
var _theme$breakpoints;
|
|
27
|
-
|
|
25
|
+
let open = _ref.open,
|
|
28
26
|
onClose = _ref.onClose,
|
|
29
27
|
messages = _ref.messages,
|
|
30
28
|
inputValue = _ref.inputValue,
|
|
31
29
|
setInputValue = _ref.setInputValue,
|
|
32
30
|
handleSend = _ref.handleSend,
|
|
33
31
|
loading = _ref.loading;
|
|
34
|
-
|
|
32
|
+
const _useState = (0, _react.useState)(false),
|
|
35
33
|
_useState2 = _slicedToArray(_useState, 2),
|
|
36
34
|
isFullscreen = _useState2[0],
|
|
37
35
|
setIsFullscreen = _useState2[1];
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
(0, _react.useEffect)(
|
|
36
|
+
const messagesEndRef = (0, _react.useRef)(null);
|
|
37
|
+
const theme = (0, _material.useTheme)();
|
|
38
|
+
const isNotExpanded = (0, _material.useMediaQuery)(theme === null || theme === void 0 || (_theme$breakpoints = theme.breakpoints) === null || _theme$breakpoints === void 0 ? void 0 : _theme$breakpoints.down("sm"));
|
|
39
|
+
(0, _react.useEffect)(() => {
|
|
42
40
|
var _messagesEndRef$curre;
|
|
43
|
-
messagesEndRef === null || messagesEndRef === void 0
|
|
41
|
+
messagesEndRef === null || messagesEndRef === void 0 || (_messagesEndRef$curre = messagesEndRef.current) === null || _messagesEndRef$curre === void 0 || _messagesEndRef$curre.scrollIntoView({
|
|
44
42
|
behavior: "smooth"
|
|
45
43
|
});
|
|
46
44
|
}, [messages]);
|
|
@@ -104,11 +102,7 @@ var ChatBotModal = function ChatBotModal(_ref) {
|
|
|
104
102
|
variant: "h6",
|
|
105
103
|
semibold: true
|
|
106
104
|
}, "Chat with Tenjin"), /*#__PURE__*/_react.default.createElement(_material.Box, null, /*#__PURE__*/_react.default.createElement(_material.IconButton, {
|
|
107
|
-
onClick:
|
|
108
|
-
return setIsFullscreen(function (prev) {
|
|
109
|
-
return !prev;
|
|
110
|
-
});
|
|
111
|
-
},
|
|
105
|
+
onClick: () => setIsFullscreen(prev => !prev),
|
|
112
106
|
size: "small"
|
|
113
107
|
}, isFullscreen ? /*#__PURE__*/_react.default.createElement(_fi.FiMinimize, null) : /*#__PURE__*/_react.default.createElement(_fa.FaExpand, null)), /*#__PURE__*/_react.default.createElement(_material.IconButton, {
|
|
114
108
|
onClick: onClose,
|
|
@@ -126,24 +120,22 @@ var ChatBotModal = function ChatBotModal(_ref) {
|
|
|
126
120
|
position: "relative",
|
|
127
121
|
zIndex: 1
|
|
128
122
|
}
|
|
129
|
-
}, messages === null || messages === void 0 ? void 0 : messages.map(
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}, msg.text);
|
|
146
|
-
}), loading && /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
123
|
+
}, messages === null || messages === void 0 ? void 0 : messages.map((msg, idx) => /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
124
|
+
key: idx,
|
|
125
|
+
sx: {
|
|
126
|
+
alignSelf: msg.sender === "user" ? "flex-end" : "flex-start",
|
|
127
|
+
backgroundColor: "#f5f5f5",
|
|
128
|
+
color: "#000",
|
|
129
|
+
px: 2,
|
|
130
|
+
py: 1,
|
|
131
|
+
borderRadius: 2,
|
|
132
|
+
boxShadow: 1,
|
|
133
|
+
maxWidth: "80%",
|
|
134
|
+
fontSize: "0.9rem",
|
|
135
|
+
wordBreak: "break-word",
|
|
136
|
+
whiteSpace: "pre-wrap"
|
|
137
|
+
}
|
|
138
|
+
}, msg.text)), loading && /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
147
139
|
sx: {
|
|
148
140
|
alignSelf: "flex-start",
|
|
149
141
|
backgroundColor: "#f5f5f5",
|
|
@@ -175,11 +167,11 @@ var ChatBotModal = function ChatBotModal(_ref) {
|
|
|
175
167
|
fullWidth: true,
|
|
176
168
|
placeholder: "Type your message...",
|
|
177
169
|
value: inputValue,
|
|
178
|
-
onChange:
|
|
170
|
+
onChange: e => {
|
|
179
171
|
var _e$target;
|
|
180
|
-
return setInputValue(e === null || e === void 0
|
|
172
|
+
return setInputValue(e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
|
|
181
173
|
},
|
|
182
|
-
onKeyDown:
|
|
174
|
+
onKeyDown: e => {
|
|
183
175
|
if ((e === null || e === void 0 ? void 0 : e.key) === "Enter") handleSend();
|
|
184
176
|
},
|
|
185
177
|
sx: {
|
|
@@ -196,5 +188,4 @@ var ChatBotModal = function ChatBotModal(_ref) {
|
|
|
196
188
|
disabled: !(inputValue !== null && inputValue !== void 0 && inputValue.trim())
|
|
197
189
|
}, /*#__PURE__*/_react.default.createElement(_Send.default, null))))));
|
|
198
190
|
};
|
|
199
|
-
var _default = ChatBotModal;
|
|
200
|
-
exports.default = _default;
|
|
191
|
+
var _default = exports.default = ChatBotModal;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _material = require("@mui/material");
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _text = _interopRequireDefault(require("../text"));
|
|
10
|
+
const _excluded = ["label"];
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
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); }
|
|
13
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
14
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
15
|
+
const CheckBox = props => {
|
|
16
|
+
const label = props.label,
|
|
17
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_material.FormControlLabel, _extends({
|
|
19
|
+
control: /*#__PURE__*/_react.default.createElement(_material.Checkbox, rest),
|
|
20
|
+
label: /*#__PURE__*/_react.default.createElement(_text.default, null, label)
|
|
21
|
+
}, rest)));
|
|
22
|
+
};
|
|
23
|
+
CheckBox.defaultProps = {
|
|
24
|
+
size: "medium",
|
|
25
|
+
color: "primary",
|
|
26
|
+
defaultChecked: true,
|
|
27
|
+
labelPlacement: "right"
|
|
28
|
+
};
|
|
29
|
+
var _default = exports.default = CheckBox;
|
|
@@ -9,29 +9,25 @@ 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
|
|
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(); }
|
|
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); }
|
|
15
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
19
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
20
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
23
21
|
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(
|
|
25
|
-
function _arrayLikeToArray(
|
|
26
|
-
function _iterableToArrayLimit(
|
|
27
|
-
function _arrayWithHoles(
|
|
22
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
23
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
24
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
25
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
28
26
|
// Styled components to match the Tailwind design
|
|
29
|
-
|
|
30
|
-
shouldForwardProp:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
})(function (_ref) {
|
|
34
|
-
var theme = _ref.theme,
|
|
27
|
+
const StyledTextField = (0, _styles.styled)(_material.TextField, {
|
|
28
|
+
shouldForwardProp: prop => prop !== "error" && prop !== "loading"
|
|
29
|
+
})(_ref => {
|
|
30
|
+
let theme = _ref.theme,
|
|
35
31
|
error = _ref.error,
|
|
36
32
|
loading = _ref.loading;
|
|
37
33
|
return {
|
|
@@ -70,8 +66,8 @@ var StyledTextField = (0, _styles.styled)(_material.TextField, {
|
|
|
70
66
|
}
|
|
71
67
|
};
|
|
72
68
|
});
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
const StyledPaper = (0, _styles.styled)(_material.Paper)(_ref2 => {
|
|
70
|
+
let theme = _ref2.theme;
|
|
75
71
|
return {
|
|
76
72
|
marginTop: "4px",
|
|
77
73
|
maxHeight: "240px",
|
|
@@ -105,12 +101,10 @@ var StyledPaper = (0, _styles.styled)(_material.Paper)(function (_ref2) {
|
|
|
105
101
|
}
|
|
106
102
|
};
|
|
107
103
|
});
|
|
108
|
-
|
|
109
|
-
shouldForwardProp:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
})(function (_ref3) {
|
|
113
|
-
var isRequired = _ref3.isRequired;
|
|
104
|
+
const Label = (0, _styles.styled)(_material.Typography, {
|
|
105
|
+
shouldForwardProp: prop => prop !== "isRequired"
|
|
106
|
+
})(_ref3 => {
|
|
107
|
+
let isRequired = _ref3.isRequired;
|
|
114
108
|
return {
|
|
115
109
|
display: "block",
|
|
116
110
|
fontSize: "0.875rem",
|
|
@@ -125,12 +119,10 @@ var Label = (0, _styles.styled)(_material.Typography, {
|
|
|
125
119
|
} : {}
|
|
126
120
|
};
|
|
127
121
|
});
|
|
128
|
-
|
|
129
|
-
shouldForwardProp:
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
})(function (_ref4) {
|
|
133
|
-
var error = _ref4.error;
|
|
122
|
+
const HelperText = (0, _styles.styled)(_material.Typography, {
|
|
123
|
+
shouldForwardProp: prop => prop !== "error"
|
|
124
|
+
})(_ref4 => {
|
|
125
|
+
let error = _ref4.error;
|
|
134
126
|
return {
|
|
135
127
|
marginTop: "8px",
|
|
136
128
|
fontSize: "0.875rem",
|
|
@@ -138,8 +130,8 @@ var HelperText = (0, _styles.styled)(_material.Typography, {
|
|
|
138
130
|
color: error ? "#dc2626" : "#4b5563"
|
|
139
131
|
};
|
|
140
132
|
});
|
|
141
|
-
|
|
142
|
-
|
|
133
|
+
const Combobox = _ref5 => {
|
|
134
|
+
let _ref5$options = _ref5.options,
|
|
143
135
|
options = _ref5$options === void 0 ? [] : _ref5$options,
|
|
144
136
|
selected = _ref5.selected,
|
|
145
137
|
defaultValue = _ref5.defaultValue,
|
|
@@ -155,31 +147,29 @@ var Combobox = function Combobox(_ref5) {
|
|
|
155
147
|
by = _ref5$by === void 0 ? "id" : _ref5$by,
|
|
156
148
|
_ref5$labelKey = _ref5.labelKey,
|
|
157
149
|
labelKey = _ref5$labelKey === void 0 ? "label" : _ref5$labelKey;
|
|
158
|
-
|
|
150
|
+
const _useState = (0, _react.useState)(null),
|
|
159
151
|
_useState2 = _slicedToArray(_useState, 2),
|
|
160
152
|
internalSelected = _useState2[0],
|
|
161
153
|
setInternalSelected = _useState2[1];
|
|
162
|
-
|
|
154
|
+
const _useState3 = (0, _react.useState)(false),
|
|
163
155
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
164
156
|
hasSetDefault = _useState4[0],
|
|
165
157
|
setHasSetDefault = _useState4[1];
|
|
166
|
-
|
|
158
|
+
const _useState5 = (0, _react.useState)(false),
|
|
167
159
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
168
160
|
open = _useState6[0],
|
|
169
161
|
setOpen = _useState6[1];
|
|
170
162
|
|
|
171
163
|
// Handle defaultValue - accepts both object and primitive (ID)
|
|
172
|
-
(0, _react.useEffect)(
|
|
164
|
+
(0, _react.useEffect)(() => {
|
|
173
165
|
if (defaultValue && options.length > 0 && !hasSetDefault) {
|
|
174
|
-
|
|
175
|
-
if (
|
|
166
|
+
let defaultOption;
|
|
167
|
+
if (typeof defaultValue === "object" && defaultValue !== null) {
|
|
176
168
|
// defaultValue is already a full object
|
|
177
169
|
defaultOption = defaultValue;
|
|
178
170
|
} else {
|
|
179
171
|
// defaultValue is a primitive (ID), find the matching option
|
|
180
|
-
defaultOption = options.find(
|
|
181
|
-
return opt[by] === defaultValue;
|
|
182
|
-
});
|
|
172
|
+
defaultOption = options.find(opt => opt[by] === defaultValue);
|
|
183
173
|
}
|
|
184
174
|
if (defaultOption) {
|
|
185
175
|
setInternalSelected(defaultOption);
|
|
@@ -189,8 +179,8 @@ var Combobox = function Combobox(_ref5) {
|
|
|
189
179
|
}, [defaultValue, options, by, hasSetDefault]);
|
|
190
180
|
|
|
191
181
|
// Use selected prop if provided, otherwise use internal state
|
|
192
|
-
|
|
193
|
-
|
|
182
|
+
const currentValue = selected || internalSelected;
|
|
183
|
+
const handleChange = (event, value) => {
|
|
194
184
|
setInternalSelected(value);
|
|
195
185
|
if (onChange) {
|
|
196
186
|
// Pass the full object to onChange (industry standard)
|
|
@@ -209,21 +199,13 @@ var Combobox = function Combobox(_ref5) {
|
|
|
209
199
|
value: currentValue,
|
|
210
200
|
onChange: handleChange,
|
|
211
201
|
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
|
-
},
|
|
202
|
+
getOptionLabel: option => (option === null || option === void 0 ? void 0 : option[labelKey]) || "",
|
|
203
|
+
isOptionEqualToValue: (option, value) => (option === null || option === void 0 ? void 0 : option[by]) === (value === null || value === void 0 ? void 0 : value[by]),
|
|
218
204
|
loading: loading,
|
|
219
205
|
disabled: loading,
|
|
220
206
|
open: open && !loading,
|
|
221
|
-
onOpen:
|
|
222
|
-
|
|
223
|
-
},
|
|
224
|
-
onClose: function onClose() {
|
|
225
|
-
return setOpen(false);
|
|
226
|
-
},
|
|
207
|
+
onOpen: () => setOpen(true),
|
|
208
|
+
onClose: () => setOpen(false),
|
|
227
209
|
disableClearable: false,
|
|
228
210
|
PaperComponent: StyledPaper,
|
|
229
211
|
popupIcon: loading ? /*#__PURE__*/_react.default.createElement(_material.CircularProgress, {
|
|
@@ -237,16 +219,14 @@ var Combobox = function Combobox(_ref5) {
|
|
|
237
219
|
}
|
|
238
220
|
}),
|
|
239
221
|
noOptionsText: "No results found",
|
|
240
|
-
renderInput:
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
}));
|
|
249
|
-
}
|
|
222
|
+
renderInput: params => /*#__PURE__*/_react.default.createElement(StyledTextField, _extends({}, params, {
|
|
223
|
+
error: error,
|
|
224
|
+
loading: loading,
|
|
225
|
+
placeholder: loading ? "Loading..." : "",
|
|
226
|
+
InputProps: _objectSpread(_objectSpread({}, params.InputProps), {}, {
|
|
227
|
+
endAdornment: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, params.InputProps.endAdornment)
|
|
228
|
+
})
|
|
229
|
+
}))
|
|
250
230
|
}), helperText && /*#__PURE__*/_react.default.createElement(HelperText, {
|
|
251
231
|
error: error
|
|
252
232
|
}, helperText));
|
|
@@ -407,5 +387,4 @@ Combobox.defaultProps = {
|
|
|
407
387
|
by: "id",
|
|
408
388
|
labelKey: "label"
|
|
409
389
|
};
|
|
410
|
-
var _default = Combobox;
|
|
411
|
-
exports.default = _default;
|
|
390
|
+
var _default = exports.default = Combobox;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = Divider;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _styles = require("@mui/material/styles");
|
|
9
|
+
var _material = require("@mui/material");
|
|
10
|
+
var _Chip = _interopRequireDefault(require("@mui/material/Chip"));
|
|
11
|
+
var _text = _interopRequireDefault(require("../text"));
|
|
12
|
+
var _responsiveTheme = _interopRequireDefault(require("../../themes/responsiveTheme"));
|
|
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
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
19
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
20
|
+
const Root = (0, _styles.styled)("div")(() => _objectSpread(_objectSpread({
|
|
21
|
+
width: "100%"
|
|
22
|
+
}, _responsiveTheme.default.typography.body2), {}, {
|
|
23
|
+
"& > :not(style) + :not(style)": {
|
|
24
|
+
marginTop: _responsiveTheme.default.spacing(2)
|
|
25
|
+
}
|
|
26
|
+
}));
|
|
27
|
+
function Divider(props) {
|
|
28
|
+
return /*#__PURE__*/React.createElement(Root, null, props.type && props.type === "Chip" ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_material.Divider, {
|
|
29
|
+
textAlign: props.textAlign && props.textAlign
|
|
30
|
+
}, /*#__PURE__*/React.createElement(_Chip.default, {
|
|
31
|
+
label: props.title && props.title
|
|
32
|
+
})), /*#__PURE__*/React.createElement(_text.default, null, props.children)) : props.title && props.title ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_material.Divider, {
|
|
33
|
+
textAlign: props.textAlign && props.textAlign
|
|
34
|
+
}, /*#__PURE__*/React.createElement(_text.default, null, props.title && props.title)), props.children) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_material.Divider, {
|
|
35
|
+
textAlign: props.textAlign && props.textAlign
|
|
36
|
+
}), props.children));
|
|
37
|
+
}
|