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,34 +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 _default = (0, _styles.makeStyles)(function (theme) {
9
- return {
10
- paper: {
11
- border: "1px solid #D6D9E0",
12
- boxShadow: "0px 3px 10px #667CBC1A"
13
- },
14
- fullHeight: {
15
- height: "100%"
16
- },
17
- relative: {
18
- position: "relative"
19
- },
20
- fixed: {
21
- position: "fixed"
22
- },
23
- static: {
24
- position: "static"
25
- },
26
- sticky: {
27
- position: "sticky"
28
- },
29
- absolute: {
30
- position: "absolute"
31
- }
32
- };
33
- });
34
- exports.default = _default;
@@ -1,212 +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 = _interopRequireDefault(require("react"));
9
- var _propTypes = _interopRequireDefault(require("prop-types"));
10
- var _reactSelect = _interopRequireWildcard(require("react-select"));
11
- var _material = require("@mui/material");
12
- var _KeyboardArrowDown = _interopRequireDefault(require("@mui/icons-material/KeyboardArrowDown"));
13
- var _style = require("./style");
14
- var _excluded = ["getStyles", "Icon", "isDisabled", "isFocused", "isSelected", "children", "innerProps", "isCheckBox"],
15
- _excluded2 = ["options", "value", "label", "defaultValue", "isMulti", "isDisabled", "placeholder", "className", "isRequired", "simulateNativeSelect", "onChange", "theme", "error", "helperText", "isBlueTheme", "isLoading", "isCheckBox"];
16
- 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); }
17
- 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; }
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
20
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
21
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
22
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
24
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
25
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
26
- 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."); }
27
- 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); }
28
- 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; }
29
- 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; } }
30
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
31
- 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; }
32
- 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; }
33
- var DropdownIndicator = function DropdownIndicator(props) {
34
- return /*#__PURE__*/_react.default.createElement(_reactSelect.components.DropdownIndicator, props, /*#__PURE__*/_react.default.createElement(_KeyboardArrowDown.default, null));
35
- };
36
- var InputOption = function InputOption(_ref) {
37
- var getStyles = _ref.getStyles,
38
- Icon = _ref.Icon,
39
- isDisabled = _ref.isDisabled,
40
- isFocused = _ref.isFocused,
41
- isSelected = _ref.isSelected,
42
- children = _ref.children,
43
- innerProps = _ref.innerProps,
44
- isCheckBox = _ref.isCheckBox,
45
- rest = _objectWithoutProperties(_ref, _excluded);
46
- var _React$useState = _react.default.useState(false),
47
- _React$useState2 = _slicedToArray(_React$useState, 2),
48
- isActive = _React$useState2[0],
49
- setIsActive = _React$useState2[1];
50
- var onMouseDown = function onMouseDown() {
51
- return setIsActive(true);
52
- };
53
- var onMouseUp = function onMouseUp() {
54
- return setIsActive(false);
55
- };
56
- var onMouseLeave = function onMouseLeave() {
57
- return setIsActive(false);
58
- };
59
-
60
- // styles
61
- var bg = "transparent";
62
- if (isFocused) bg = "#eee";
63
- if (isActive) bg = "#B2D4FF";
64
- var style = {
65
- alignItems: "center",
66
- backgroundColor: bg,
67
- color: "inherit",
68
- display: "flex "
69
- };
70
-
71
- // prop assignment
72
- var props = _objectSpread(_objectSpread({}, innerProps), {}, {
73
- onMouseDown: onMouseDown,
74
- onMouseUp: onMouseUp,
75
- onMouseLeave: onMouseLeave,
76
- style: style
77
- });
78
- return /*#__PURE__*/_react.default.createElement(_reactSelect.components.Option, _extends({}, rest, {
79
- isDisabled: isDisabled,
80
- isFocused: isFocused,
81
- isSelected: isSelected,
82
- getStyles: getStyles,
83
- innerProps: props
84
- }), /*#__PURE__*/_react.default.createElement("input", {
85
- type: "checkbox",
86
- checked: isSelected
87
- }), children);
88
- };
89
- var ReactSelect = function ReactSelect(_ref2) {
90
- var options = _ref2.options,
91
- value = _ref2.value,
92
- label = _ref2.label,
93
- defaultValue = _ref2.defaultValue,
94
- isMulti = _ref2.isMulti,
95
- isDisabled = _ref2.isDisabled,
96
- placeholder = _ref2.placeholder,
97
- className = _ref2.className,
98
- isRequired = _ref2.isRequired,
99
- simulateNativeSelect = _ref2.simulateNativeSelect,
100
- onChange = _ref2.onChange,
101
- theme = _ref2.theme,
102
- error = _ref2.error,
103
- helperText = _ref2.helperText,
104
- isBlueTheme = _ref2.isBlueTheme,
105
- isLoading = _ref2.isLoading,
106
- isCheckBox = _ref2.isCheckBox,
107
- rest = _objectWithoutProperties(_ref2, _excluded2);
108
- var classes = (0, _style.useStyles)({
109
- colorTheme: isBlueTheme
110
- });
111
- var handleSelectChange = function handleSelectChange(value) {
112
- if (simulateNativeSelect) {
113
- onChange(value.value);
114
- } else {
115
- onChange(value);
116
- }
117
- };
118
- var handleChange = function handleChange(options) {
119
- if (Array.isArray(options)) {
120
- setSelectedOptions(options.map(function (opt) {
121
- return opt.value;
122
- }));
123
- }
124
- };
125
- var _React$useState3 = _react.default.useState([]),
126
- _React$useState4 = _slicedToArray(_React$useState3, 2),
127
- selectedOptions = _React$useState4[0],
128
- setSelectedOptions = _React$useState4[1];
129
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
130
- style: {
131
- width: "100%"
132
- }
133
- }, label && /*#__PURE__*/_react.default.createElement("div", null, label, isRequired && /*#__PURE__*/_react.default.createElement(_material.Typography, {
134
- component: "span",
135
- color: "error"
136
- }, "*")), isMulti ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactSelect.default, _extends({
137
- isMulti: true,
138
- options: options,
139
- defaultValue: defaultValue && defaultValue.length > 0 ? defaultValue : "",
140
- styles: (0, _style.getCustomStyles)({
141
- colorTheme: isBlueTheme,
142
- error: error
143
- }),
144
- isDisabled: isDisabled,
145
- placeholder: placeholder,
146
- components: isCheckBox ? {
147
- DropdownIndicator: DropdownIndicator,
148
- Option: InputOption
149
- } : {
150
- DropdownIndicator: DropdownIndicator
151
- },
152
- isLoading: isLoading
153
- /////isCheckBox
154
- ,
155
- closeMenuOnSelect: !isCheckBox ? true : false,
156
- hideSelectedOptions: !isCheckBox ? true : false,
157
- onChange: function onChange(options) {
158
- return isCheckBox && handleChange(options);
159
- }
160
- }, rest))) : /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_reactSelect.default, _extends({
161
- options: options,
162
- styles: (0, _style.getCustomStyles)({
163
- colorTheme: isBlueTheme,
164
- error: error
165
- }),
166
- onChange: handleSelectChange,
167
- defaultValue: options.filter(function (option) {
168
- return option.value === defaultValue;
169
- }),
170
- value: options.filter(function (option) {
171
- return option.value === value;
172
- }),
173
- isMulti: isMulti,
174
- isDisabled: isDisabled,
175
- placeholder: placeholder,
176
- components: {
177
- DropdownIndicator: DropdownIndicator
178
- },
179
- isLoading: isLoading
180
- }, rest))), helperText && /*#__PURE__*/_react.default.createElement(_material.Typography, {
181
- style: {
182
- color: "#be1515"
183
- }
184
- }, helperText)));
185
- };
186
- ReactSelect.propTypes = {
187
- value: _propTypes.default.string,
188
- className: _propTypes.default.string,
189
- label: _propTypes.default.string,
190
- defaultValue: _propTypes.default.instanceOf(Object),
191
- isMulti: _propTypes.default.bool,
192
- isDisabled: _propTypes.default.bool,
193
- options: _propTypes.default.instanceOf(Array),
194
- placeholder: _propTypes.default.string,
195
- isRequired: _propTypes.default.bool,
196
- simulateNativeSelect: _propTypes.default.bool,
197
- onChange: _propTypes.default.func
198
- };
199
- ReactSelect.defaultProps = {
200
- value: {},
201
- label: "",
202
- className: "",
203
- defaultValue: {},
204
- isMulti: false,
205
- isDisabled: false,
206
- options: [],
207
- placeholder: "",
208
- isRequired: false,
209
- simulateNativeSelect: true
210
- };
211
- var _default = ReactSelect;
212
- exports.default = _default;
@@ -1,163 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useStyles = exports.getCustomStyles = void 0;
7
- var _styles = require("@mui/styles");
8
- var _responsiveTheme = _interopRequireDefault(require("../../themes/responsiveTheme"));
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
- 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); }
11
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
12
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
13
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
14
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
15
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
16
- var useStyles = (0, _styles.makeStyles)(function () {
17
- return {
18
- inputLabel: function inputLabel(_ref) {
19
- var colorTheme = _ref.colorTheme;
20
- return {
21
- color: colorTheme ? _responsiveTheme.default.palette.text.main : _responsiveTheme.default.palette.text.main,
22
- fontSize: _responsiveTheme.default.typography.fontSize,
23
- fontWeight: 500,
24
- fontFamily: _responsiveTheme.default.typography.fontFamily,
25
- display: "flex",
26
- marginBottom: "12px"
27
- };
28
- },
29
- star: {
30
- lineHeight: "unset",
31
- marginLeft: "4px"
32
- },
33
- helperText: {
34
- color: "#f44336",
35
- fontSize: "8.5px"
36
- },
37
- blueTheme: {
38
- // width: "100%",
39
- height: "200px",
40
- backgroundColor: "#3D3981",
41
- borderRadius: "7px",
42
- padding: "16px",
43
- width: "50%"
44
- }
45
- };
46
- });
47
- exports.useStyles = useStyles;
48
- var getCustomStyles = function getCustomStyles(_ref2) {
49
- var colorTheme = _ref2.colorTheme,
50
- error = _ref2.error;
51
- return {
52
- option: function option(provided) {
53
- return _objectSpread(_objectSpread({}, provided), {}, {
54
- color: colorTheme ? "#f4f7fc" : _responsiveTheme.default.palette.text.main,
55
- fontSize: "10px",
56
- fontFamily: _responsiveTheme.default.typography.fontFamily,
57
- backgroundColor: colorTheme ? "#6e6ba1" : _responsiveTheme.default.palette.white.main,
58
- opacity: "100%",
59
- "&:hover": {
60
- backgroundColor: _responsiveTheme.default.palette.secondary_grey.main,
61
- color: _responsiveTheme.default.palette.primary.main
62
- }
63
- });
64
- },
65
- control: function control(provided) {
66
- return _objectSpread(_objectSpread({}, provided), {}, {
67
- backgroundColor: colorTheme ? "#6e6ba1" : _responsiveTheme.default.palette.primary.white,
68
- boxShadow: "none",
69
- fontSize: "10px",
70
- fontFamily: _responsiveTheme.default.typography.fontFamily,
71
- // marginTop: theme.spacing(1.25),
72
- height: "2.4rem !important",
73
- border: error ? "1px solid #be1515" : colorTheme ? "none" : "1px solid #CFD7DF",
74
- "&:hover": {
75
- border: error ? "1px solid #be1515" : colorTheme ? "none" : "1px solid #CFD7DF"
76
- }
77
- // minHeight: "31.83px !important",
78
- //border: "1px solid #adbac9",
79
- });
80
- },
81
-
82
- placeholder: function placeholder(provided) {
83
- return _objectSpread(_objectSpread({}, provided), {}, {
84
- color: colorTheme ? _responsiveTheme.default.palette.white.main : _responsiveTheme.default.palette.grey_dark.main,
85
- fontFamily: _responsiveTheme.default.typography.fontFamily,
86
- fontWeight: 400,
87
- fontSize: _responsiveTheme.default.typography.fontSize,
88
- padding: "0rem 0rem 0.1rem 0rem"
89
- });
90
- },
91
- indicatorSeparator: function indicatorSeparator(provided) {
92
- return _objectSpread(_objectSpread({}, provided), {}, {
93
- background: "none"
94
- });
95
- },
96
- input: function input(provided) {
97
- return _objectSpread(_objectSpread({}, provided), {}, {
98
- color: colorTheme ? "#F4F7FC" : _responsiveTheme.default.palette.text.main,
99
- padding: "0rem 0rem 0.1rem 0rem"
100
- });
101
- },
102
- menu: function menu(provided) {
103
- return _objectSpread(_objectSpread({}, provided), {}, {
104
- padding: 0,
105
- backgroundColor: colorTheme ? "#6e6ba1" : _responsiveTheme.default.palette.white.main,
106
- zIndex: 9999
107
- });
108
- },
109
- menuPortal: function menuPortal(provided) {
110
- return _objectSpread(_objectSpread({}, provided), {}, {
111
- zIndex: 9999
112
- });
113
- },
114
- dropdownIndicator: function dropdownIndicator(provided) {
115
- return _objectSpread(_objectSpread({}, provided), {}, {
116
- color: colorTheme ? "#f4f7fc" : _responsiveTheme.default.palette.text.main,
117
- opacity: 1,
118
- padding: "0rem 0rem 0.1rem 0rem"
119
- });
120
- },
121
- singleValue: function singleValue(provided) {
122
- return _objectSpread(_objectSpread({}, provided), {}, {
123
- color: colorTheme ? "#F4F7FC" : _responsiveTheme.default.palette.text.main,
124
- // fontWeight: 500,
125
- fontSize: _responsiveTheme.default.typography.fontSize,
126
- padding: "0rem 0rem 0.1rem 0rem"
127
- });
128
- },
129
- valueContainer: function valueContainer(provided) {
130
- return _objectSpread(_objectSpread({}, provided), {}, {
131
- // padding: 0,
132
- color: colorTheme ? "#F4F7FC" : _responsiveTheme.default.palette.primary.tenjinLightBlack
133
- });
134
- },
135
- clearIndicator: function clearIndicator(provided) {
136
- return _objectSpread(_objectSpread({}, provided), {}, {
137
- color: colorTheme ? "#f4f7fc" : "#adb0bb"
138
- });
139
- },
140
- multiValue: function multiValue(provided) {
141
- return _objectSpread(_objectSpread({}, provided), {}, {
142
- backgroundColor: _responsiveTheme.default.palette.primary.tenjinMLight,
143
- border: "1px solid #DAE0FF",
144
- marginTop: "-0.15rem"
145
- });
146
- },
147
- multiValueLabel: function multiValueLabel(provided) {
148
- return _objectSpread(_objectSpread({}, provided), {}, {
149
- color: _responsiveTheme.default.palette.text.main,
150
- fontWeight: 400,
151
- fontSize: _responsiveTheme.default.typography.fontSize,
152
- fontFamily: _responsiveTheme.default.typography.fontFamily
153
- });
154
- },
155
- multiValueRemove: function multiValueRemove(provided) {
156
- return _objectSpread(_objectSpread({}, provided), {}, {
157
- color: _responsiveTheme.default.palette.primary.tenjinFBlue,
158
- cursor: "pointer"
159
- });
160
- }
161
- };
162
- };
163
- exports.getCustomStyles = getCustomStyles;
@@ -1,83 +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 _rte = require("@mantine/rte");
10
- var _excluded = ["controls", "readOnly"];
11
- 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); }
12
- 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; }
13
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
14
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
15
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
16
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
17
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
18
- 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; }
19
- 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; }
20
- var RichTextEditorTest = function RichTextEditorTest(_ref) {
21
- var _ref$controls = _ref.controls,
22
- controls = _ref$controls === void 0 ? {} : _ref$controls,
23
- _ref$readOnly = _ref.readOnly,
24
- readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
25
- props = _objectWithoutProperties(_ref, _excluded);
26
- // By default everything is enabled
27
- var defaultControls = {
28
- bold: true,
29
- italic: true,
30
- underline: true,
31
- link: true,
32
- image: true,
33
- unorderedList: true,
34
- orderedList: true,
35
- h1: true,
36
- h2: true,
37
- h3: true,
38
- alignLeft: true,
39
- alignCenter: true,
40
- alignRight: true
41
- };
42
- var editorControls = (0, _react.useMemo)(function () {
43
- if (readOnly) {
44
- return [];
45
- }
46
- var finalControls = _objectSpread(_objectSpread({}, defaultControls), controls);
47
- return [["bold", "italic", "underline"].filter(function (c) {
48
- return finalControls[c];
49
- }), ["link", "image"].filter(function (c) {
50
- return finalControls[c];
51
- }), ["unorderedList", "orderedList"].filter(function (c) {
52
- return finalControls[c];
53
- }), ["h1", "h2", "h3"].filter(function (c) {
54
- return finalControls[c];
55
- }), ["alignLeft", "alignCenter", "alignRight"].filter(function (c) {
56
- return finalControls[c];
57
- })].filter(function (group) {
58
- return group.length > 0;
59
- });
60
- }, [controls, readOnly]);
61
- var mentions = (0, _react.useMemo)(function () {
62
- return {
63
- allowedChars: /^[A-Za-z\sÅÄÖåäö]*$/,
64
- mentionDenotationChars: ["@"],
65
- source: function source(searchTerm, renderList, mentionChar) {
66
- var list = mentionChar === "@" ? props.data : "";
67
- var includesSearchTerm = list.filter(function (item) {
68
- return item.value.toLowerCase().includes(searchTerm && searchTerm.toLowerCase());
69
- });
70
- renderList(includesSearchTerm);
71
- }
72
- };
73
- }, [props.data]);
74
- return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_rte.RichTextEditor, {
75
- controls: editorControls,
76
- value: props.value,
77
- onChange: props.onChange,
78
- mentions: props.mentions && mentions,
79
- readOnly: readOnly
80
- }));
81
- };
82
- var _default = RichTextEditorTest;
83
- exports.default = _default;