tenjin-ui-kit 0.3.70 → 0.3.72-dev

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.
Files changed (203) hide show
  1. package/common/hooks/apiHooks.js +155 -0
  2. package/common/hooks/newApiHook.js +188 -0
  3. package/{dist/common → common}/utils/security/index.js +2 -2
  4. package/{dist/common → common}/utils/security/securityConfig.js +1 -2
  5. package/components/Canvas.js +330 -0
  6. package/components/DragBox/index.js +40 -0
  7. package/components/InputWithChip/index.js +294 -0
  8. package/{dist/components → components}/RightContext/index.js +19 -28
  9. package/components/WorkFlow.js +42 -0
  10. package/components/WorkFlowBuilder.js +115 -0
  11. package/components/alert/Style.js +20 -0
  12. package/components/alert/index.js +67 -0
  13. package/{dist/components → components}/attachment/index.js +21 -28
  14. package/{dist/components → components}/authenticationProvider/AuthError.js +3 -4
  15. package/{dist/components → components}/authenticationProvider/AuthLoader.js +3 -4
  16. package/components/authenticationProvider/index.js +110 -0
  17. package/{dist/components → components}/avatar/index.js +13 -14
  18. package/components/avatar/styles.js +91 -0
  19. package/components/breadCrumbs/index.js +169 -0
  20. package/{dist/components → components}/breadCrumbs/style.js +1 -4
  21. package/{dist/components → components}/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/index.js +5 -6
  22. package/{dist/components → components}/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/style.js +5 -8
  23. package/{dist/components → components}/browsingTestCaseLayout/DetailsViewLayout/DetailsViewHeader/index.js +4 -5
  24. package/{dist/components → components}/browsingTestCaseLayout/TreeViewLayout/TreeViewContent/Index.js +4 -5
  25. package/{dist/components → components}/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/Index.js +5 -6
  26. package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/style.js +23 -0
  27. package/{dist/components → components}/browsingTestCaseLayout/index.js +25 -30
  28. package/components/button/index.js +133 -0
  29. package/{dist/components → components}/chatBotModal/index.js +36 -45
  30. package/components/checkBox/index.js +29 -0
  31. package/{dist/components → components}/combobox/index.js +51 -72
  32. package/components/divider/index.js +37 -0
  33. package/{dist/components → components}/editableField/index.js +19 -28
  34. package/{dist/components → components}/error/index.js +6 -12
  35. package/components/errorBoundary/index.js +140 -0
  36. package/components/fileUploader/index.js +151 -0
  37. package/components/fileUploader/style.js +57 -0
  38. package/components/filter/ValueSelector.js +333 -0
  39. package/{dist/components → components}/filter/index.js +26 -33
  40. package/{dist/components → components}/iconButton/index.js +3 -4
  41. package/components/input/index.js +167 -0
  42. package/components/layout/index.js +94 -0
  43. package/components/layout/main/index.js +24 -0
  44. package/components/layout/main/style.js +19 -0
  45. package/{dist/components → components}/layout/pageContent/index.js +6 -7
  46. package/components/layout/sidebar/FlatMenu.js +64 -0
  47. package/components/layout/sidebar/GroupedIconMenu.js +233 -0
  48. package/components/layout/sidebar/GroupedMenu.js +57 -0
  49. package/components/layout/sidebar/ProjectMenu.js +223 -0
  50. package/components/layout/sidebar/index.js +88 -0
  51. package/components/layout/sidebar/style.js +149 -0
  52. package/components/layout/topBar/ProjectTopbar.js +388 -0
  53. package/components/layout/topBar/UserAvatar.js +138 -0
  54. package/components/layout/topBar/index.js +121 -0
  55. package/{dist/components → components}/loader/index.js +9 -12
  56. package/components/menu/index.js +71 -0
  57. package/{dist/components → components}/modal/Modal.js +5 -6
  58. package/components/modal/index.js +88 -0
  59. package/components/modal/style.js +65 -0
  60. package/components/optionMenu/index.js +105 -0
  61. package/components/pagination/index.js +114 -0
  62. package/components/pagination/style.js +33 -0
  63. package/components/paginationUpdated/index.js +74 -0
  64. package/components/paper/index.js +43 -0
  65. package/components/paper/style.js +31 -0
  66. package/components/reactSelect/index.js +195 -0
  67. package/components/reactSelect/style.js +130 -0
  68. package/components/richTextEditor/index.js +64 -0
  69. package/components/select/GroupedSelect.js +167 -0
  70. package/components/select/SimpleSelect.js +184 -0
  71. package/{dist/components → components}/select/index.js +38 -54
  72. package/components/simpleSelect/index.js +53 -0
  73. package/{dist/components → components}/sort/index.js +19 -22
  74. package/{dist/components → components}/switch/index.js +10 -11
  75. package/components/switch/style.js +39 -0
  76. package/{dist/components → components}/switch/switch.js +17 -23
  77. package/components/table/ReactTable.js +101 -0
  78. package/components/table/SimpleTable.js +117 -0
  79. package/components/table/index.js +381 -0
  80. package/components/text/index.js +65 -0
  81. package/{dist/components → components}/timeStamp/index.js +4 -6
  82. package/components/timeStamp/style.js +20 -0
  83. package/components/topBar/index.js +169 -0
  84. package/{dist/components → components}/tree/index.js +29 -47
  85. package/components/tree/style.js +29 -0
  86. package/components/valuePicker/ValueSelector.js +205 -0
  87. package/{dist/components → components}/valuePicker/index.js +19 -26
  88. package/{dist/components → components}/wrapperLayout/layout/index.js +4 -5
  89. package/{dist/components → components}/wrapperLayout/main/index.js +4 -5
  90. package/{dist/components → components}/wrapperLayout/main/pageContainer/index.js +4 -5
  91. package/components/wrapperLayout/main/sideBar/index.js +272 -0
  92. package/components/wrapperLayout/main/sideBar/style.js +190 -0
  93. package/{dist/components → components}/wrapperLayout/topBar/UserAvatar.js +4 -5
  94. package/components/wrapperLayout/topBar/avatar.js +55 -0
  95. package/components/wrapperLayout/topBar/index.js +196 -0
  96. package/{dist/components → components}/wrapperLayout/topBar/menuIcon.js +4 -5
  97. package/components/wrapperLayout/topBar/style.js +74 -0
  98. package/http/index.js +133 -0
  99. package/{dist/index.js → index.js} +53 -55
  100. package/package.json +5 -3
  101. package/{dist/templates → templates}/listPage/index.js +36 -57
  102. package/{dist/themes → themes}/default.js +5 -7
  103. package/{dist/themes → themes}/defaultSmall.js +2 -3
  104. package/{dist/themes → themes}/responsiveTheme.js +6 -8
  105. package/.dockerignore +0 -6
  106. package/.storybook/main.js +0 -16
  107. package/.storybook/preview.js +0 -11
  108. package/Dockerfile +0 -17
  109. package/Jenkinsfile +0 -66
  110. package/build/asset-manifest.json +0 -16
  111. package/build/favicon.ico +0 -0
  112. package/build/index.html +0 -1
  113. package/build/logo192.png +0 -0
  114. package/build/logo512.png +0 -0
  115. package/build/manifest.json +0 -25
  116. package/build/robots.txt +0 -3
  117. package/build/static/css/main.522396f6.css +0 -2
  118. package/build/static/css/main.522396f6.css.map +0 -1
  119. package/build/static/js/787.18cf14d0.chunk.js +0 -2
  120. package/build/static/js/787.18cf14d0.chunk.js.map +0 -1
  121. package/build/static/js/main.d71fecac.js +0 -3
  122. package/build/static/js/main.d71fecac.js.LICENSE.txt +0 -50
  123. package/build/static/js/main.d71fecac.js.map +0 -1
  124. package/build/static/media/logo.6ce24c58023cc2f8fd88fe9d219db6c6.svg +0 -1
  125. package/build/tenjinLogo.png +0 -0
  126. package/dist/common/hooks/apiHooks.js +0 -223
  127. package/dist/common/hooks/newApiHook.js +0 -270
  128. package/dist/components/Canvas.js +0 -254
  129. package/dist/components/DragBox/index.js +0 -45
  130. package/dist/components/InputWithChip/index.js +0 -187
  131. package/dist/components/WorkFlow.js +0 -47
  132. package/dist/components/WorkFlowBuilder.js +0 -130
  133. package/dist/components/alert/Style.js +0 -23
  134. package/dist/components/alert/index.js +0 -69
  135. package/dist/components/authenticationProvider/index.js +0 -166
  136. package/dist/components/avatar/styles.js +0 -94
  137. package/dist/components/breadCrumbs/index.js +0 -180
  138. package/dist/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/style.js +0 -26
  139. package/dist/components/button/index.js +0 -140
  140. package/dist/components/checkBox/index.js +0 -30
  141. package/dist/components/divider/index.js +0 -41
  142. package/dist/components/errorBoundary/index.js +0 -160
  143. package/dist/components/fileUploader/index.js +0 -156
  144. package/dist/components/fileUploader/style.js +0 -60
  145. package/dist/components/filter/ValueSelector.js +0 -405
  146. package/dist/components/input/index.js +0 -174
  147. package/dist/components/layout/index.js +0 -98
  148. package/dist/components/layout/main/index.js +0 -27
  149. package/dist/components/layout/main/style.js +0 -22
  150. package/dist/components/layout/sidebar/FlatMenu.js +0 -64
  151. package/dist/components/layout/sidebar/GroupedIconMenu.js +0 -246
  152. package/dist/components/layout/sidebar/GroupedMenu.js +0 -67
  153. package/dist/components/layout/sidebar/ProjectMenu.js +0 -230
  154. package/dist/components/layout/sidebar/index.js +0 -91
  155. package/dist/components/layout/sidebar/style.js +0 -154
  156. package/dist/components/layout/topBar/ProjectTopbar.js +0 -338
  157. package/dist/components/layout/topBar/UserAvatar.js +0 -145
  158. package/dist/components/layout/topBar/index.js +0 -132
  159. package/dist/components/menu/index.js +0 -80
  160. package/dist/components/modal/index.js +0 -91
  161. package/dist/components/modal/style.js +0 -68
  162. package/dist/components/optionMenu/index.js +0 -112
  163. package/dist/components/pagination/index.js +0 -129
  164. package/dist/components/pagination/style.js +0 -36
  165. package/dist/components/paginationUpdated/index.js +0 -75
  166. package/dist/components/paper/index.js +0 -44
  167. package/dist/components/paper/style.js +0 -34
  168. package/dist/components/reactSelect/index.js +0 -212
  169. package/dist/components/reactSelect/style.js +0 -163
  170. package/dist/components/richTextEditor/index.js +0 -83
  171. package/dist/components/select/GroupedSelect.js +0 -183
  172. package/dist/components/select/SimpleSelect.js +0 -212
  173. package/dist/components/simpleSelect/index.js +0 -56
  174. package/dist/components/switch/style.js +0 -42
  175. package/dist/components/table/ReactTable.js +0 -118
  176. package/dist/components/table/SimpleTable.js +0 -136
  177. package/dist/components/table/index.js +0 -256
  178. package/dist/components/text/index.js +0 -67
  179. package/dist/components/timeStamp/style.js +0 -23
  180. package/dist/components/topBar/index.js +0 -176
  181. package/dist/components/tree/style.js +0 -32
  182. package/dist/components/valuePicker/ValueSelector.js +0 -273
  183. package/dist/components/wrapperLayout/main/sideBar/index.js +0 -262
  184. package/dist/components/wrapperLayout/main/sideBar/style.js +0 -196
  185. package/dist/components/wrapperLayout/topBar/avatar.js +0 -57
  186. package/dist/components/wrapperLayout/topBar/index.js +0 -182
  187. package/dist/components/wrapperLayout/topBar/style.js +0 -77
  188. package/dist/http/index.js +0 -226
  189. package/public/favicon.ico +0 -0
  190. package/public/index.html +0 -43
  191. package/public/logo192.png +0 -0
  192. package/public/logo512.png +0 -0
  193. package/public/manifest.json +0 -25
  194. package/public/robots.txt +0 -3
  195. package/public/tenjinLogo.png +0 -0
  196. /package/{dist/assets → assets}/images/MicrosoftTeams-image (1).png +0 -0
  197. /package/{dist/assets → assets}/images/tenjin-4.0-logo.png +0 -0
  198. /package/{dist/components → components}/RightContext/index.css +0 -0
  199. /package/{dist/components → components}/browsingTestCaseLayout/style.css +0 -0
  200. /package/{dist/components → components}/errorBoundary/Error.jpg +0 -0
  201. /package/{dist/components → components}/iconButton/style.js +0 -0
  202. /package/{dist/components → components}/richTextEditor/style.js +0 -0
  203. /package/{dist/components → components}/wrapperLayout/layout/style.js +0 -0
@@ -1,183 +0,0 @@
1
- "use strict";
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
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var React = _interopRequireWildcard(require("react"));
9
- var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
10
- var _fa = require("react-icons/fa");
11
- var _reactDom = require("react-dom");
12
- var _text = _interopRequireDefault(require("../text"));
13
- var _excluded = ["options", "onChange", "value", "defaultValue", "fullWidth"];
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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 _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); }
18
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
19
- 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."); }
20
- 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); }
21
- 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; }
22
- 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; } }
23
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
24
- 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; }
25
- 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; }
26
- var GroupedSelect = function GroupedSelect(_ref) {
27
- var _options$find, _Object$entries;
28
- var options = _ref.options,
29
- onChange = _ref.onChange,
30
- propValue = _ref.value,
31
- defaultValue = _ref.defaultValue,
32
- fullWidth = _ref.fullWidth,
33
- rest = _objectWithoutProperties(_ref, _excluded);
34
- var triggerRef = React.useRef(null);
35
- var _React$useState = React.useState(""),
36
- _React$useState2 = _slicedToArray(_React$useState, 2),
37
- searchTerm = _React$useState2[0],
38
- setSearchTerm = _React$useState2[1];
39
- var _React$useState3 = React.useState(false),
40
- _React$useState4 = _slicedToArray(_React$useState3, 2),
41
- isDropdownOpen = _React$useState4[0],
42
- setIsDropdownOpen = _React$useState4[1];
43
- var _React$useState5 = React.useState(propValue || defaultValue),
44
- _React$useState6 = _slicedToArray(_React$useState5, 2),
45
- value = _React$useState6[0],
46
- setValue = _React$useState6[1];
47
- var _React$useState7 = React.useState(null),
48
- _React$useState8 = _slicedToArray(_React$useState7, 2),
49
- hoveredOption = _React$useState8[0],
50
- setHoveredOption = _React$useState8[1];
51
- var groupOptionsByPageTitle = function groupOptionsByPageTitle(options) {
52
- var grouped = {};
53
- options.forEach(function (option) {
54
- var _grouped$option$pageT;
55
- if (!grouped[option === null || option === void 0 ? void 0 : option.pageTitle]) {
56
- grouped[option === null || option === void 0 ? void 0 : option.pageTitle] = [];
57
- }
58
- (_grouped$option$pageT = grouped[option === null || option === void 0 ? void 0 : option.pageTitle]) === null || _grouped$option$pageT === void 0 ? void 0 : _grouped$option$pageT.push(option);
59
- });
60
- return grouped;
61
- };
62
- var handleSearchChange = function handleSearchChange(event) {
63
- setSearchTerm(event.target.value);
64
- };
65
- var filteredOptions = options.filter(function (option) {
66
- var _option$label, _option$pageTitle;
67
- return (option === null || option === void 0 ? void 0 : (_option$label = option.label) === null || _option$label === void 0 ? void 0 : _option$label.includes(searchTerm)) || (option === null || option === void 0 ? void 0 : (_option$pageTitle = option.pageTitle) === null || _option$pageTitle === void 0 ? void 0 : _option$pageTitle.includes(searchTerm));
68
- });
69
- var groupedOptions = groupOptionsByPageTitle(filteredOptions);
70
- var toggleDropdown = function toggleDropdown() {
71
- setIsDropdownOpen(function (prev) {
72
- return !prev;
73
- });
74
- };
75
- var handleOptionClick = function handleOptionClick(selectedValue) {
76
- setValue(selectedValue);
77
- setIsDropdownOpen(false);
78
- onChange({
79
- target: {
80
- value: selectedValue
81
- }
82
- });
83
- };
84
- var handleCloseDropdown = function handleCloseDropdown() {
85
- setIsDropdownOpen(false);
86
- };
87
- return /*#__PURE__*/React.createElement(_FormControl.default, _extends({
88
- sx: {
89
- width: fullWidth ? "100%" : 200
90
- }
91
- }, rest), /*#__PURE__*/React.createElement("div", {
92
- style: {
93
- position: "relative",
94
- width: "100%"
95
- },
96
- ref: triggerRef
97
- }, /*#__PURE__*/React.createElement("div", {
98
- onClick: toggleDropdown,
99
- style: {
100
- padding: "8px 10px",
101
- border: "1px solid #ccc",
102
- borderRadius: "4px",
103
- cursor: "pointer",
104
- display: "flex",
105
- alignItems: "center",
106
- justifyContent: "space-between"
107
- }
108
- }, /*#__PURE__*/React.createElement("div", {
109
- style: {
110
- flexGrow: 1
111
- }
112
- }, value ? options === null || options === void 0 ? void 0 : (_options$find = options.find(function (opt) {
113
- return (opt === null || opt === void 0 ? void 0 : opt.id) === value;
114
- })) === null || _options$find === void 0 ? void 0 : _options$find.label : "Select Option"), /*#__PURE__*/React.createElement("div", null, isDropdownOpen ? /*#__PURE__*/React.createElement(_fa.FaCaretUp, null) : /*#__PURE__*/React.createElement(_fa.FaCaretDown, null)))), isDropdownOpen && /*#__PURE__*/(0, _reactDom.createPortal)( /*#__PURE__*/React.createElement("div", {
115
- style: {
116
- position: "absolute",
117
- top: "".concat(triggerRef.current.getBoundingClientRect().bottom + 8, "px"),
118
- left: "".concat(triggerRef.current.getBoundingClientRect().left, "px"),
119
- width: "".concat(triggerRef.current.offsetWidth, "px"),
120
- backgroundColor: "#fff",
121
- border: "1px solid #ccc",
122
- borderRadius: "4px",
123
- boxShadow: "0px 4px 6px rgba(0, 0, 0, 0.1)",
124
- maxHeight: "200px",
125
- overflowY: "auto",
126
- zIndex: 2000
127
- }
128
- }, /*#__PURE__*/React.createElement("div", {
129
- style: {
130
- padding: "10px"
131
- }
132
- }, /*#__PURE__*/React.createElement("input", {
133
- type: "text",
134
- placeholder: "Search...",
135
- value: searchTerm,
136
- onChange: handleSearchChange,
137
- style: {
138
- paddingLeft: "2.5rem",
139
- background: 'white url("https://static.thenounproject.com/png/101791-200.png") no-repeat left',
140
- backgroundPosition: "0.875rem center",
141
- backgroundSize: "1.125rem",
142
- height: "2.188rem",
143
- margin: 0,
144
- width: "100%",
145
- border: "1px solid #949494",
146
- borderRadius: "4px"
147
- }
148
- }), (_Object$entries = Object.entries(groupedOptions)) === null || _Object$entries === void 0 ? void 0 : _Object$entries.map(function (_ref2) {
149
- var _ref3 = _slicedToArray(_ref2, 2),
150
- pageTitle = _ref3[0],
151
- options = _ref3[1];
152
- return /*#__PURE__*/React.createElement("div", {
153
- key: pageTitle
154
- }, /*#__PURE__*/React.createElement(_text.default, {
155
- style: {
156
- padding: "5px 10px"
157
- // backgroundColor: "#f5f5f5",
158
- },
159
-
160
- semibold: true
161
- }, pageTitle !== null && pageTitle !== void 0 ? pageTitle : "N/A"), options.map(function (option) {
162
- return /*#__PURE__*/React.createElement("div", {
163
- key: option === null || option === void 0 ? void 0 : option.id,
164
- onClick: function onClick() {
165
- return handleOptionClick(option.id);
166
- },
167
- onMouseEnter: function onMouseEnter() {
168
- return setHoveredOption(option.id);
169
- },
170
- onMouseLeave: function onMouseLeave() {
171
- return setHoveredOption(null);
172
- },
173
- style: {
174
- padding: "8px 24px",
175
- cursor: "pointer",
176
- backgroundColor: value === (option === null || option === void 0 ? void 0 : option.id) ? "#f0f0f7" : hoveredOption === (option === null || option === void 0 ? void 0 : option.id) ? "#f5f5f5" : "transparent"
177
- }
178
- }, option.label);
179
- }));
180
- }))), document.body));
181
- };
182
- var _default = GroupedSelect;
183
- exports.default = _default;
@@ -1,212 +0,0 @@
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 = _interopRequireWildcard(require("react"));
9
- var _text = _interopRequireDefault(require("../text"));
10
- var _excluded = ["options", "errorMessage", "error", "fullWidth", "isDisabled", "label", "isRequired", "helperText", "isSearch", "isClearOption", "loading", "isSort", "placeholder"];
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
- 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); }
13
- 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; }
14
- 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); }
15
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
16
- 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); }
17
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _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(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); }
20
- 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; }
21
- 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; } }
22
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
23
- 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; }
24
- 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; }
25
- var SimpleSelect = function SimpleSelect(_ref) {
26
- var _isSort, _isSearch, _isClearOption;
27
- var options = _ref.options,
28
- errorMessage = _ref.errorMessage,
29
- error = _ref.error,
30
- fullWidth = _ref.fullWidth,
31
- isDisabled = _ref.isDisabled,
32
- label = _ref.label,
33
- isRequired = _ref.isRequired,
34
- helperText = _ref.helperText,
35
- isSearch = _ref.isSearch,
36
- isClearOption = _ref.isClearOption,
37
- loading = _ref.loading,
38
- isSort = _ref.isSort,
39
- placeholder = _ref.placeholder,
40
- rest = _objectWithoutProperties(_ref, _excluded);
41
- isSort = (_isSort = isSort) !== null && _isSort !== void 0 ? _isSort : true; //by default true
42
- isSearch = (_isSearch = isSearch) !== null && _isSearch !== void 0 ? _isSearch : true; //by default true
43
- isClearOption = (_isClearOption = isClearOption) !== null && _isClearOption !== void 0 ? _isClearOption : true; //by default true
44
-
45
- var _useState = (0, _react.useState)(""),
46
- _useState2 = _slicedToArray(_useState, 2),
47
- searchText = _useState2[0],
48
- setSearchText = _useState2[1];
49
- var _useState3 = (0, _react.useState)(false),
50
- _useState4 = _slicedToArray(_useState3, 2),
51
- noDataAvailable = _useState4[0],
52
- setNoDataAvailable = _useState4[1];
53
- var validateChildren = function validateChildren(type, searchText) {
54
- if (_typeof(type) !== "object") {
55
- return typeof type === "string" && type.toLowerCase().indexOf(searchText.toLowerCase()) > -1;
56
- }
57
- if (_typeof(type.props) === "object" && Array.isArray(type.props.children)) {
58
- return type.props.children.some(function (data) {
59
- return validateChildren(data, searchText);
60
- });
61
- }
62
- return false;
63
- };
64
- var containsText = function containsText(text, searchText) {
65
- if (typeof text === "string" && typeof searchText === "string") {
66
- return text.toLowerCase().indexOf(searchText.toLowerCase()) > -1;
67
- }
68
- if (_typeof(text) === "object" && text.props && Array.isArray(text.props.children)) {
69
- return text.props.children.some(function (data) {
70
- return validateChildren(data, searchText);
71
- });
72
- }
73
- return false;
74
- };
75
- var displayedOptions = (0, _react.useMemo)(function () {
76
- var filteredOptions = options === null || options === void 0 ? void 0 : options.filter(function (option) {
77
- return containsText(option === null || option === void 0 ? void 0 : option.label, searchText);
78
- });
79
- if (isSearch) {
80
- setNoDataAvailable((filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.length) === 0);
81
- }
82
-
83
- // const sortedOptions = filteredOptions?.sort((a, b) =>
84
- // a?.label?.localeCompare(b.label)
85
- // );
86
- var sortedOptions = filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.slice().sort(function (a, b) {
87
- var labelA = typeof a.label === "string" ? a.label : findStringInChildren(a.label.props.children);
88
- var labelB = typeof b.label === "string" ? b.label : findStringInChildren(b.label.props.children);
89
- return labelA.localeCompare(labelB);
90
- });
91
- function findStringInChildren(children) {
92
- var _iterator = _createForOfIteratorHelper(children),
93
- _step;
94
- try {
95
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
96
- var child = _step.value;
97
- if (typeof child === "string") {
98
- return child;
99
- } else if (child.props && typeof child.props.children === "string") {
100
- return child.props.children;
101
- }
102
- }
103
- } catch (err) {
104
- _iterator.e(err);
105
- } finally {
106
- _iterator.f();
107
- }
108
- return "";
109
- }
110
- return (isSort ? sortedOptions : filteredOptions).map(function (option) {
111
- return {
112
- label: option === null || option === void 0 ? void 0 : option.label,
113
- value: option === null || option === void 0 ? void 0 : option.value
114
- };
115
- });
116
- // eslint-disable-next-line react-hooks/exhaustive-deps
117
- }, [options, searchText, isSearch]);
118
- var recommendedOptions = isSearch ? displayedOptions : options;
119
- var typingTimer;
120
- var handleKeyDown = function handleKeyDown(e) {
121
- clearTimeout(typingTimer);
122
- if (e.key !== "Escape") {
123
- if (e.key !== "ArrowDown" && e.key !== "ArrowUp") {
124
- e.stopPropagation();
125
- }
126
- typingTimer = setTimeout(function () {
127
- clearTimeout(typingTimer);
128
- }, 500);
129
- }
130
- };
131
- return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_material.FormControl, {
132
- sx: {
133
- minWidth: 120
134
- },
135
- fullWidth: fullWidth,
136
- disabled: isDisabled,
137
- error: error,
138
- style: {
139
- margin: "0rem !important"
140
- }
141
- }, label && /*#__PURE__*/_react.default.createElement(_material.FormLabel, {
142
- htmlFor: "my-input",
143
- sx: {
144
- fontSize: "0.8rem",
145
- fontWeight: 500,
146
- paddingBottom: "0.2rem"
147
- }
148
- }, /*#__PURE__*/_react.default.createElement(_text.default, null, label, isRequired ? /*#__PURE__*/_react.default.createElement("span", {
149
- style: {
150
- color: "red"
151
- }
152
- }, " * ") : "")), /*#__PURE__*/_react.default.createElement(_material.Select, _extends({}, rest, {
153
- fullWidth: true,
154
- onClose: function onClose() {
155
- return setSearchText("");
156
- },
157
- MenuProps: {
158
- PaperProps: {
159
- style: {
160
- maxHeight: "12.5rem"
161
- }
162
- }
163
- }
164
- }), isSearch && /*#__PURE__*/_react.default.createElement("input", {
165
- id: "search-box",
166
- type: "text",
167
- autoFocus: true,
168
- style: {
169
- paddingLeft: "2.5rem",
170
- background: 'white url("https://static.thenounproject.com/png/101791-200.png") no-repeat left',
171
- backgroundPosition: "0.875rem center",
172
- backgroundSize: "1.125rem",
173
- position: "sticky",
174
- top: 0,
175
- zIndex: 9999,
176
- backgroundColor: "white !important",
177
- height: "2.188rem",
178
- margin: 0,
179
- width: "100%",
180
- border: "1px solid #949494",
181
- borderRadius: "4px"
182
- },
183
- placeholder: "Type to search...",
184
- onChange: function onChange(e) {
185
- return setSearchText(e.target.value);
186
- },
187
- onKeyDown: handleKeyDown
188
- }), isClearOption && !loading && /*#__PURE__*/_react.default.createElement(_material.MenuItem, {
189
- value: ""
190
- }, /*#__PURE__*/_react.default.createElement("em", {
191
- style: {
192
- color: "#888"
193
- }
194
- }, "Clear the option")), loading ? /*#__PURE__*/_react.default.createElement(_text.default, {
195
- variant: "span",
196
- color: "secondary",
197
- sx: {
198
- fontStyle: "italic",
199
- display: "flex",
200
- padding: "0.5rem 0rem 0rem 1rem"
201
- }
202
- }, "Fetching Options...") : noDataAvailable ? /*#__PURE__*/_react.default.createElement(_material.MenuItem, {
203
- disabled: true
204
- }, "No Data Available") : recommendedOptions === null || recommendedOptions === void 0 ? void 0 : recommendedOptions.map(function (option) {
205
- return /*#__PURE__*/_react.default.createElement(_material.MenuItem, {
206
- key: option.value,
207
- value: option.value
208
- }, option.label);
209
- })), error && /*#__PURE__*/_react.default.createElement(_material.FormHelperText, null, errorMessage), helperText && /*#__PURE__*/_react.default.createElement(_material.FormHelperText, null, helperText)));
210
- };
211
- var _default = SimpleSelect;
212
- exports.default = _default;
@@ -1,56 +0,0 @@
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 _text = _interopRequireDefault(require("../text"));
9
- var _excluded = ["options", "errorMessage", "error", "fullWidth", "isDisabled", "label", "isRequired"];
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
- 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); }
12
- 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; }
13
- 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; }
14
- var SimpleSelect = function SimpleSelect(_ref) {
15
- var options = _ref.options,
16
- errorMessage = _ref.errorMessage,
17
- error = _ref.error,
18
- fullWidth = _ref.fullWidth,
19
- isDisabled = _ref.isDisabled,
20
- label = _ref.label,
21
- isRequired = _ref.isRequired,
22
- rest = _objectWithoutProperties(_ref, _excluded);
23
- console.log(errorMessage, error, "error");
24
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_material.FormControl, {
25
- sx: {
26
- m: 1,
27
- minWidth: 120
28
- },
29
- fullWidth: fullWidth,
30
- disabled: isDisabled,
31
- error: error,
32
- style: {
33
- margin: "0rem !important"
34
- }
35
- }, label && /*#__PURE__*/React.createElement(_material.FormLabel, {
36
- htmlFor: "my-input",
37
- sx: {
38
- fontSize: "0.8rem",
39
- fontWeight: 500,
40
- paddingBottom: "0.2rem"
41
- }
42
- }, /*#__PURE__*/React.createElement(_text.default, null, label, isRequired ? /*#__PURE__*/React.createElement("span", {
43
- style: {
44
- color: "red"
45
- }
46
- }, " * ") : "")), /*#__PURE__*/React.createElement(_material.Select, _extends({}, rest, {
47
- fullWidth: true
48
- }), options.map(function (option) {
49
- return /*#__PURE__*/React.createElement(_material.MenuItem, {
50
- key: option.value,
51
- value: option.value
52
- }, option.label);
53
- })), error && /*#__PURE__*/React.createElement(_material.FormHelperText, null, errorMessage)));
54
- };
55
- var _default = SimpleSelect;
56
- exports.default = _default;
@@ -1,42 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _styles = require("@mui/styles");
8
- var _default2 = _interopRequireDefault(require("../../themes/default"));
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
- var _default = (0, _styles.makeStyles)(function () {
11
- return {
12
- labelLarge: {
13
- "@media (min-width:1101px) and (max-width:1200px)": {
14
- fontSize: "1.5rem !important",
15
- fontWeight: "".concat(500, " !important")
16
- },
17
- "@media (min-width:769px) and (max-width:1100px)": {
18
- fontSize: "1.3rem !important",
19
- fontWeight: "".concat(500, " !important")
20
- },
21
- "@media (min-width:600px) and (max-width:768px)": {
22
- fontSize: "1rem",
23
- fontWeight: "".concat(500, " !important")
24
- }
25
- },
26
- labelSmall: {
27
- "@media (min-width:1101px) and (max-width:1200px)": {
28
- fontSize: "0.85rem !important",
29
- fontWeight: "".concat(500, " !important")
30
- },
31
- "@media (min-width:769px) and (max-width:1100px)": {
32
- fontSize: "0.75rem !important",
33
- fontWeight: "".concat(500, " !important")
34
- },
35
- "@media (min-width:600px) and (max-width:768px)": {
36
- fontSize: "0.75rem",
37
- fontWeight: "".concat(500, " !important")
38
- }
39
- }
40
- };
41
- });
42
- exports.default = _default;
@@ -1,118 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _propTypes = _interopRequireDefault(require("prop-types"));
9
- var _material = require("@mui/material");
10
- var _text = _interopRequireDefault(require("../text"));
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
13
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
14
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
15
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
16
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
17
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
18
- function _unsupportedIterableToArray(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); }
19
- 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; }
20
- 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; } }
21
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
22
- var ReactTable = function ReactTable(_ref) {
23
- var columns = _ref.columns,
24
- rows = _ref.rows,
25
- sortable = _ref.sortable,
26
- msg = _ref.msg;
27
- var _React$useState = _react.default.useState({
28
- column: null,
29
- direction: "desc"
30
- }),
31
- _React$useState2 = _slicedToArray(_React$useState, 2),
32
- sorting = _React$useState2[0],
33
- setSorting = _React$useState2[1];
34
- var handleSort = function handleSort(columnName) {
35
- setSorting(function (prevSorting) {
36
- return {
37
- column: columnName,
38
- direction: prevSorting.column === columnName && prevSorting.direction === "desc" ? "asc" : "desc"
39
- };
40
- });
41
- };
42
- var sortedData = _react.default.useMemo(function () {
43
- if (sorting !== null && sorting !== void 0 && sorting.column) {
44
- var sortedArray = _toConsumableArray(rows).sort(function (a, b) {
45
- var valueA = a[sorting.column];
46
- var valueB = b[sorting.column];
47
- if (typeof valueA === "string" && typeof valueB === "string") {
48
- return sorting.direction === "asc" ? valueA.localeCompare(valueB) : valueB.localeCompare(valueA);
49
- }
50
- return sorting.direction === "asc" ? valueA - valueB : valueB - valueA;
51
- });
52
- return sortedArray;
53
- }
54
- return rows;
55
- }, [rows, sorting]);
56
- var theme = (0, _material.useTheme)();
57
- return rows && (rows === null || rows === void 0 ? void 0 : rows.length) > 0 ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_material.TableContainer, null, /*#__PURE__*/_react.default.createElement(_material.Table, null, /*#__PURE__*/_react.default.createElement(_material.TableHead, null, /*#__PURE__*/_react.default.createElement(_material.TableRow, null, columns === null || columns === void 0 ? void 0 : columns.map(function (c) {
58
- return /*#__PURE__*/_react.default.createElement(_material.TableCell, {
59
- key: c.name,
60
- style: {
61
- width: c.width
62
- }
63
- }, sortable ? /*#__PURE__*/_react.default.createElement(_material.TableSortLabel, {
64
- active: sorting.column === c.name.toLowerCase(),
65
- direction: sorting.column === c.name.toLowerCase() ? sorting.direction : "asc",
66
- onClick: function onClick() {
67
- return handleSort(c.name.toLowerCase());
68
- }
69
- }, /*#__PURE__*/_react.default.createElement(_text.default, {
70
- style: {
71
- color: "#7D7D7D"
72
- }
73
- }, c.displayName)) : /*#__PURE__*/_react.default.createElement(_text.default, {
74
- style: {
75
- color: "#7D7D7D"
76
- }
77
- }, c.displayName));
78
- }))), /*#__PURE__*/_react.default.createElement(_material.TableBody, null, sortedData === null || sortedData === void 0 ? void 0 : sortedData.map(function (u) {
79
- return /*#__PURE__*/_react.default.createElement(_material.TableRow, {
80
- key: u.id
81
- }, columns === null || columns === void 0 ? void 0 : columns.map(function (c) {
82
- return /*#__PURE__*/_react.default.createElement(_material.TableCell, {
83
- size: "small",
84
- key: u[c.name],
85
- style: {
86
- width: c.width,
87
- borderBottom: "none"
88
- }
89
- }, c.render ? c.render(u) : /*#__PURE__*/_react.default.createElement(_text.default, null, u[c.name]));
90
- }));
91
- }))))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, " ", /*#__PURE__*/_react.default.createElement(_material.TableContainer, null, /*#__PURE__*/_react.default.createElement(_material.Table, null, /*#__PURE__*/_react.default.createElement(_material.TableHead, null, columns === null || columns === void 0 ? void 0 : columns.map(function (c) {
92
- return /*#__PURE__*/_react.default.createElement(_material.TableCell, {
93
- key: c.name,
94
- style: {
95
- width: c.width,
96
- color: "#7D7D7D",
97
- borderBottom: "none"
98
- }
99
- }, /*#__PURE__*/_react.default.createElement(_text.default, null, c.displayName));
100
- })), " ")), /*#__PURE__*/_react.default.createElement(_material.Grid, {
101
- item: true,
102
- xs: 11,
103
- container: true,
104
- justifyContent: "center"
105
- }, /*#__PURE__*/_react.default.createElement(_text.default, {
106
- style: {
107
- color: "grey",
108
- marginTop: "calc(100vh - 750px)"
109
- }
110
- }, msg)));
111
- };
112
- ReactTable.propTypes = {
113
- rows: _propTypes.default.array.isRequired,
114
- columns: _propTypes.default.array.isRequired,
115
- msg: _propTypes.default.string
116
- };
117
- var _default = ReactTable;
118
- exports.default = _default;