@unbxd-ui/unbxd-react-components 0.2.107-beta.2 → 0.2.108-beta.2

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 (289) hide show
  1. package/components/Accordian/Accordian.js +13 -45
  2. package/components/Accordian/Accordian.stories.js +6 -25
  3. package/components/Accordian/index.js +0 -3
  4. package/components/Button/Button.js +9 -26
  5. package/components/Button/Button.stories.js +1 -14
  6. package/components/Button/DropdownButton.js +9 -31
  7. package/components/Button/DropdownButton.stories.js +6 -23
  8. package/components/Button/index.js +1 -8
  9. package/components/DataLoader/DataLoader.js +10 -40
  10. package/components/DataLoader/DataLoader.stories.js +5 -30
  11. package/components/DataLoader/index.js +0 -3
  12. package/components/Form/Checkbox.js +18 -43
  13. package/components/Form/DragDropFileUploader.js +12 -42
  14. package/components/Form/Dropdown.js +106 -182
  15. package/components/Form/FileUploader.js +10 -32
  16. package/components/Form/Form.js +15 -45
  17. package/components/Form/FormElementWrapper.js +2 -7
  18. package/components/Form/Input.js +27 -72
  19. package/components/Form/RadioList.js +20 -49
  20. package/components/Form/RangeSlider.js +39 -74
  21. package/components/Form/ServerPaginatedDDList.js +86 -130
  22. package/components/Form/Textarea.js +18 -43
  23. package/components/Form/Toggle.js +16 -48
  24. package/components/Form/index.js +18 -30
  25. package/components/Form/stories/Checkbox.stories.js +1 -12
  26. package/components/Form/stories/DragDropFileUploader.stories.js +0 -8
  27. package/components/Form/stories/Dropdown.stories.js +6 -24
  28. package/components/Form/stories/FileUploader.stories.js +0 -8
  29. package/components/Form/stories/FormDefault.stories.js +1 -21
  30. package/components/Form/stories/RadioList.stories.js +1 -12
  31. package/components/Form/stories/RangeSlider.stories.js +1 -15
  32. package/components/Form/stories/TextInput.stories.js +3 -19
  33. package/components/Form/stories/Textarea.stories.js +1 -12
  34. package/components/Form/stories/Toggle.stories.js +0 -7
  35. package/components/Form/stories/form.stories.js +3 -40
  36. package/components/InlineModal/InlineModal.js +14 -51
  37. package/components/InlineModal/InlineModal.stories.js +2 -14
  38. package/components/InlineModal/index.js +1 -6
  39. package/components/List/List.js +9 -24
  40. package/components/List/index.js +0 -3
  41. package/components/List/list.stories.js +0 -10
  42. package/components/Modal/Modal.js +17 -49
  43. package/components/Modal/Modal.stories.js +1 -15
  44. package/components/Modal/index.js +0 -3
  45. package/components/NotificationComponent/NotificationComponent.js +11 -34
  46. package/components/NotificationComponent/NotificationComponent.stories.js +0 -6
  47. package/components/NotificationComponent/index.js +0 -3
  48. package/components/ProgressBar/ProgressBar.js +2 -11
  49. package/components/ProgressBar/ProgressBar.stories.js +0 -6
  50. package/components/ProgressBar/index.js +0 -3
  51. package/components/Table/BaseTable.js +69 -134
  52. package/components/Table/PaginationComponent.js +11 -23
  53. package/components/Table/Table.js +68 -149
  54. package/components/Table/Table.stories.js +22 -67
  55. package/components/Table/index.js +0 -4
  56. package/components/TabsComponent/TabsComponent.js +20 -57
  57. package/components/TabsComponent/TabsComponent.stories.js +0 -16
  58. package/components/TabsComponent/index.js +0 -3
  59. package/components/Tooltip/Tooltip.js +25 -47
  60. package/components/Tooltip/Tooltip.stories.js +0 -6
  61. package/components/Tooltip/index.js +0 -3
  62. package/components/core.css +3 -1
  63. package/components/index.js +1 -17
  64. package/components/theme.css +2 -0
  65. package/package.json +3 -2
  66. package/.babelrc +0 -4
  67. package/.eslintrc.js +0 -38
  68. package/CONTRIBUTE.md +0 -105
  69. package/README.md +0 -82
  70. package/lib/components/Accordian/Accordian.js +0 -117
  71. package/lib/components/Accordian/Accordian.stories.js +0 -137
  72. package/lib/components/Accordian/index.js +0 -10
  73. package/lib/components/Button/Button.js +0 -84
  74. package/lib/components/Button/Button.stories.js +0 -89
  75. package/lib/components/Button/DropdownButton.js +0 -77
  76. package/lib/components/Button/DropdownButton.stories.js +0 -51
  77. package/lib/components/Button/index.js +0 -32
  78. package/lib/components/DataLoader/DataLoader.js +0 -88
  79. package/lib/components/DataLoader/DataLoader.stories.js +0 -77
  80. package/lib/components/DataLoader/index.js +0 -10
  81. package/lib/components/Form/Checkbox.js +0 -93
  82. package/lib/components/Form/DragDropFileUploader.js +0 -85
  83. package/lib/components/Form/Dropdown.js +0 -478
  84. package/lib/components/Form/FileUploader.js +0 -81
  85. package/lib/components/Form/Form.js +0 -106
  86. package/lib/components/Form/FormElementWrapper.js +0 -27
  87. package/lib/components/Form/Input.js +0 -140
  88. package/lib/components/Form/RadioList.js +0 -111
  89. package/lib/components/Form/RangeSlider.js +0 -142
  90. package/lib/components/Form/ServerPaginatedDDList.js +0 -267
  91. package/lib/components/Form/Textarea.js +0 -95
  92. package/lib/components/Form/Toggle.js +0 -117
  93. package/lib/components/Form/index.js +0 -73
  94. package/lib/components/Form/stories/Checkbox.stories.js +0 -54
  95. package/lib/components/Form/stories/DragDropFileUploader.stories.js +0 -27
  96. package/lib/components/Form/stories/Dropdown.stories.js +0 -114
  97. package/lib/components/Form/stories/FileUploader.stories.js +0 -31
  98. package/lib/components/Form/stories/FormDefault.stories.js +0 -117
  99. package/lib/components/Form/stories/RadioList.stories.js +0 -55
  100. package/lib/components/Form/stories/RangeSlider.stories.js +0 -82
  101. package/lib/components/Form/stories/TextInput.stories.js +0 -79
  102. package/lib/components/Form/stories/Textarea.stories.js +0 -48
  103. package/lib/components/Form/stories/Toggle.stories.js +0 -25
  104. package/lib/components/Form/stories/form.stories.js +0 -240
  105. package/lib/components/InlineModal/InlineModal.js +0 -146
  106. package/lib/components/InlineModal/InlineModal.stories.js +0 -61
  107. package/lib/components/InlineModal/index.js +0 -24
  108. package/lib/components/List/List.js +0 -76
  109. package/lib/components/List/index.js +0 -10
  110. package/lib/components/List/list.stories.js +0 -38
  111. package/lib/components/Modal/Modal.js +0 -117
  112. package/lib/components/Modal/Modal.stories.js +0 -55
  113. package/lib/components/Modal/index.js +0 -10
  114. package/lib/components/NotificationComponent/NotificationComponent.js +0 -76
  115. package/lib/components/NotificationComponent/NotificationComponent.stories.js +0 -29
  116. package/lib/components/NotificationComponent/index.js +0 -10
  117. package/lib/components/ProgressBar/ProgressBar.js +0 -49
  118. package/lib/components/ProgressBar/ProgressBar.stories.js +0 -21
  119. package/lib/components/ProgressBar/index.js +0 -10
  120. package/lib/components/Table/BaseTable.js +0 -352
  121. package/lib/components/Table/PaginationComponent.js +0 -87
  122. package/lib/components/Table/Table.js +0 -333
  123. package/lib/components/Table/Table.stories.js +0 -204
  124. package/lib/components/Table/index.js +0 -17
  125. package/lib/components/TabsComponent/TabsComponent.js +0 -134
  126. package/lib/components/TabsComponent/TabsComponent.stories.js +0 -65
  127. package/lib/components/TabsComponent/index.js +0 -10
  128. package/lib/components/Tooltip/Tooltip.js +0 -102
  129. package/lib/components/Tooltip/Tooltip.stories.js +0 -25
  130. package/lib/components/Tooltip/index.js +0 -10
  131. package/lib/components/core.css +0 -3
  132. package/lib/components/core.scss +0 -29
  133. package/lib/components/index.js +0 -159
  134. package/lib/components/theme.css +0 -3
  135. package/lib/components/theme.scss +0 -11
  136. package/lib/package-lock.json +0 -20607
  137. package/lib/package.json +0 -94
  138. package/src/Intro.stories.mdx +0 -119
  139. package/src/components/Accordian/Accordian.js +0 -89
  140. package/src/components/Accordian/Accordian.stories.js +0 -92
  141. package/src/components/Accordian/accordianCore.css +0 -1
  142. package/src/components/Accordian/accordianCore.scss +0 -8
  143. package/src/components/Accordian/accordianTheme.css +0 -1
  144. package/src/components/Accordian/accordianTheme.scss +0 -6
  145. package/src/components/Accordian/index.js +0 -3
  146. package/src/components/Button/Button.js +0 -67
  147. package/src/components/Button/Button.stories.js +0 -103
  148. package/src/components/Button/DropdownButton.js +0 -60
  149. package/src/components/Button/DropdownButton.stories.js +0 -38
  150. package/src/components/Button/button.css +0 -1
  151. package/src/components/Button/buttonTheme.css +0 -1
  152. package/src/components/Button/buttonTheme.scss +0 -45
  153. package/src/components/Button/index.js +0 -5
  154. package/src/components/DataLoader/DataLoader.js +0 -86
  155. package/src/components/DataLoader/DataLoader.stories.js +0 -72
  156. package/src/components/DataLoader/index.js +0 -3
  157. package/src/components/Form/Checkbox.js +0 -73
  158. package/src/components/Form/DragDropFileUploader.js +0 -67
  159. package/src/components/Form/Dropdown.js +0 -430
  160. package/src/components/Form/FileUploader.js +0 -64
  161. package/src/components/Form/Form.js +0 -83
  162. package/src/components/Form/FormElementWrapper.js +0 -22
  163. package/src/components/Form/Input.js +0 -121
  164. package/src/components/Form/RadioList.js +0 -86
  165. package/src/components/Form/RangeSlider.js +0 -100
  166. package/src/components/Form/ServerPaginatedDDList.js +0 -231
  167. package/src/components/Form/Textarea.js +0 -76
  168. package/src/components/Form/Toggle.js +0 -96
  169. package/src/components/Form/form.css +0 -1
  170. package/src/components/Form/formCore.css +0 -1
  171. package/src/components/Form/formCore.scss +0 -142
  172. package/src/components/Form/formTheme.css +0 -1
  173. package/src/components/Form/formTheme.scss +0 -27
  174. package/src/components/Form/index.js +0 -13
  175. package/src/components/Form/stories/Checkbox.stories.js +0 -41
  176. package/src/components/Form/stories/DragDropFileUploader.stories.js +0 -21
  177. package/src/components/Form/stories/Dropdown.stories.js +0 -124
  178. package/src/components/Form/stories/FileUploader.stories.js +0 -21
  179. package/src/components/Form/stories/FormDefault.stories.js +0 -87
  180. package/src/components/Form/stories/RadioList.stories.js +0 -48
  181. package/src/components/Form/stories/RangeSlider.stories.js +0 -84
  182. package/src/components/Form/stories/TextInput.stories.js +0 -77
  183. package/src/components/Form/stories/Textarea.stories.js +0 -43
  184. package/src/components/Form/stories/Toggle.stories.js +0 -14
  185. package/src/components/Form/stories/form.stories.js +0 -216
  186. package/src/components/InlineModal/InlineModal.js +0 -135
  187. package/src/components/InlineModal/InlineModal.stories.js +0 -54
  188. package/src/components/InlineModal/index.js +0 -4
  189. package/src/components/InlineModal/inlineModal.css +0 -1
  190. package/src/components/InlineModal/inlineModalCore.css +0 -1
  191. package/src/components/InlineModal/inlineModalCore.scss +0 -31
  192. package/src/components/InlineModal/inlineModalTheme.css +0 -1
  193. package/src/components/InlineModal/inlineModalTheme.scss +0 -16
  194. package/src/components/List/List.js +0 -72
  195. package/src/components/List/index.js +0 -3
  196. package/src/components/List/list.css +0 -1
  197. package/src/components/List/list.stories.js +0 -28
  198. package/src/components/List/listCore.css +0 -1
  199. package/src/components/List/listCore.scss +0 -6
  200. package/src/components/List/listTheme.css +0 -0
  201. package/src/components/List/listTheme.scss +0 -0
  202. package/src/components/Modal/Modal.js +0 -99
  203. package/src/components/Modal/Modal.stories.js +0 -54
  204. package/src/components/Modal/index.js +0 -3
  205. package/src/components/Modal/modal.css +0 -1
  206. package/src/components/Modal/modalCore.css +0 -1
  207. package/src/components/Modal/modalCore.scss +0 -34
  208. package/src/components/Modal/modalTheme.css +0 -0
  209. package/src/components/Modal/modalTheme.scss +0 -0
  210. package/src/components/NotificationComponent/NotificationComponent.js +0 -58
  211. package/src/components/NotificationComponent/NotificationComponent.stories.js +0 -28
  212. package/src/components/NotificationComponent/index.js +0 -3
  213. package/src/components/NotificationComponent/notificationComponent.css +0 -1
  214. package/src/components/NotificationComponent/notificationTheme.css +0 -1
  215. package/src/components/NotificationComponent/notificationTheme.scss +0 -30
  216. package/src/components/ProgressBar/ProgressBar.js +0 -45
  217. package/src/components/ProgressBar/ProgressBar.stories.js +0 -14
  218. package/src/components/ProgressBar/index.js +0 -3
  219. package/src/components/ProgressBar/progressBar.css +0 -1
  220. package/src/components/ProgressBar/progressBarCore.css +0 -1
  221. package/src/components/ProgressBar/progressBarCore.scss +0 -14
  222. package/src/components/ProgressBar/progressBarTheme.css +0 -0
  223. package/src/components/ProgressBar/progressBarTheme.scss +0 -0
  224. package/src/components/Table/BaseTable.js +0 -306
  225. package/src/components/Table/PaginationComponent.js +0 -73
  226. package/src/components/Table/Table.js +0 -295
  227. package/src/components/Table/Table.stories.js +0 -198
  228. package/src/components/Table/index.js +0 -8
  229. package/src/components/Table/table.css +0 -1
  230. package/src/components/Table/tableCore.css +0 -1
  231. package/src/components/Table/tableCore.scss +0 -94
  232. package/src/components/Table/tableTheme.css +0 -1
  233. package/src/components/Table/tableTheme.scss +0 -34
  234. package/src/components/TabsComponent/TabsComponent.js +0 -99
  235. package/src/components/TabsComponent/TabsComponent.stories.js +0 -69
  236. package/src/components/TabsComponent/index.js +0 -3
  237. package/src/components/TabsComponent/tabs.css +0 -1
  238. package/src/components/TabsComponent/tabsCore.css +0 -1
  239. package/src/components/TabsComponent/tabsCore.scss +0 -59
  240. package/src/components/TabsComponent/tabsTheme.css +0 -0
  241. package/src/components/TabsComponent/tabsTheme.scss +0 -0
  242. package/src/components/Tooltip/Tooltip.js +0 -87
  243. package/src/components/Tooltip/Tooltip.stories.js +0 -16
  244. package/src/components/Tooltip/index.js +0 -3
  245. package/src/components/Tooltip/tooltipCore.css +0 -1
  246. package/src/components/Tooltip/tooltipCore.scss +0 -22
  247. package/src/components/Tooltip/tooltipTheme.css +0 -1
  248. package/src/components/Tooltip/tooltipTheme.scss +0 -21
  249. package/src/components/core.css +0 -1
  250. package/src/components/core.scss +0 -29
  251. package/src/components/index.js +0 -38
  252. package/src/components/theme.css +0 -1
  253. package/src/components/theme.scss +0 -11
  254. package/src/core/Validators.js +0 -34
  255. package/src/core/customHooks.js +0 -20
  256. package/src/core/dataLoader.js +0 -143
  257. package/src/core/dataLoader.stories.js +0 -123
  258. package/src/core/index.js +0 -3
  259. package/src/core/utils.js +0 -95
  260. package/src/index.js +0 -68
  261. package/vscode-templates/NewStoryTemplate.stories.js +0 -8
  262. /package/{lib/Readme.md → Readme.md} +0 -0
  263. /package/{lib/components → components}/Accordian/accordianCore.css +0 -0
  264. /package/{lib/components → components}/Accordian/accordianTheme.css +0 -0
  265. /package/{lib/components → components}/Button/buttonTheme.css +0 -0
  266. /package/{lib/components → components}/Form/formCore.css +0 -0
  267. /package/{lib/components → components}/Form/formTheme.css +0 -0
  268. /package/{lib/components → components}/InlineModal/inlineModalCore.css +0 -0
  269. /package/{lib/components → components}/InlineModal/inlineModalTheme.css +0 -0
  270. /package/{lib/components → components}/List/listCore.css +0 -0
  271. /package/{lib/components → components}/List/listTheme.css +0 -0
  272. /package/{lib/components → components}/Modal/modalCore.css +0 -0
  273. /package/{lib/components → components}/Modal/modalTheme.css +0 -0
  274. /package/{lib/components → components}/NotificationComponent/notificationTheme.css +0 -0
  275. /package/{lib/components → components}/ProgressBar/progressBarCore.css +0 -0
  276. /package/{lib/components → components}/ProgressBar/progressBarTheme.css +0 -0
  277. /package/{lib/components → components}/Table/tableCore.css +0 -0
  278. /package/{lib/components → components}/Table/tableTheme.css +0 -0
  279. /package/{lib/components → components}/TabsComponent/tabsCore.css +0 -0
  280. /package/{lib/components → components}/TabsComponent/tabsTheme.css +0 -0
  281. /package/{lib/components → components}/Tooltip/tooltipCore.css +0 -0
  282. /package/{lib/components → components}/Tooltip/tooltipTheme.css +0 -0
  283. /package/{lib/core → core}/Validators.js +0 -0
  284. /package/{lib/core → core}/customHooks.js +0 -0
  285. /package/{lib/core → core}/dataLoader.js +0 -0
  286. /package/{lib/core → core}/dataLoader.stories.js +0 -0
  287. /package/{lib/core → core}/index.js +0 -0
  288. /package/{lib/core → core}/utils.js +0 -0
  289. /package/{lib/index.js → index.js} +0 -0
@@ -1,352 +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 _propTypes = _interopRequireDefault(require("prop-types"));
10
- var _utils = _interopRequireDefault(require("../../core/utils"));
11
- var _Checkbox = _interopRequireDefault(require("../Form/Checkbox"));
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
14
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
16
- 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."); }
17
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
18
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
19
- 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; }
20
- 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; }
21
- 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; }
22
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
23
- 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); }
24
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
25
- 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."); }
26
- 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); }
27
- 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; }
28
- 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; } }
29
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
30
- 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); }
31
- var DEFAULT_CHECKBOX_CONFIG = {
32
- enabled: false,
33
- showInHeader: true
34
- };
35
- var DefaultNoDataComponent = function DefaultNoDataComponent() {
36
- return /*#__PURE__*/_react["default"].createElement("div", {
37
- className: "RCB-no-data"
38
- }, "No data found");
39
- };
40
-
41
- /* eslint-disable react/prop-types */
42
-
43
- var getTDValue = function getTDValue(_ref) {
44
- var columnValue = _ref.columnValue,
45
- _ref$rowData = _ref.rowData,
46
- rowData = _ref$rowData === void 0 ? {} : _ref$rowData,
47
- _ref$columnConfig = _ref.columnConfig,
48
- columnConfig = _ref$columnConfig === void 0 ? {} : _ref$columnConfig,
49
- _ref$tdProps = _ref.tdProps,
50
- tdProps = _ref$tdProps === void 0 ? {} : _ref$tdProps;
51
- var key = columnConfig.key,
52
- valueFormatter = columnConfig.valueFormatter,
53
- ColumnComponent = columnConfig.ColumnComponent,
54
- _columnConfig$compone = columnConfig.componentProps,
55
- componentProps = _columnConfig$compone === void 0 ? {} : _columnConfig$compone;
56
- var tdValue = columnValue;
57
- if (typeof valueFormatter === "function") {
58
- tdValue = valueFormatter({
59
- value: columnValue,
60
- record: rowData
61
- });
62
- } else if (ColumnComponent) {
63
- tdValue = /*#__PURE__*/_react["default"].createElement(ColumnComponent, _extends({
64
- record: rowData
65
- }, componentProps));
66
- }
67
- return /*#__PURE__*/_react["default"].createElement("td", _extends({
68
- key: key
69
- }, tdProps), tdValue);
70
- };
71
- var ExpandableTR = function ExpandableTR(props) {
72
- var rowIndex = props.rowIndex,
73
- rowData = props.rowData,
74
- columnConfigs = props.columnConfigs,
75
- isEven = props.isEven,
76
- ExpandedRowComponent = props.ExpandedRowComponent,
77
- showCheckbox = props.showCheckbox,
78
- checkboxChangeCounter = props.checkboxChangeCounter,
79
- checkboxValue = props.checkboxValue,
80
- onSelectionChange = props.onSelectionChange;
81
- var _useState = (0, _react.useState)(checkboxValue || false),
82
- _useState2 = _slicedToArray(_useState, 2),
83
- selected = _useState2[0],
84
- setSelected = _useState2[1];
85
- var _useState3 = (0, _react.useState)(false),
86
- _useState4 = _slicedToArray(_useState3, 2),
87
- isExpanded = _useState4[0],
88
- setIsExpanded = _useState4[1];
89
- var onChange = function onChange(value) {
90
- setSelected(value);
91
- onSelectionChange(rowData, value);
92
- };
93
- (0, _react.useEffect)(function () {
94
- setSelected(checkboxValue);
95
- }, [checkboxChangeCounter, checkboxValue]);
96
- var toggleExpanded = function toggleExpanded() {
97
- setIsExpanded(!isExpanded);
98
- };
99
- var className = "RCB-tr RCB-parent-row " + (isEven ? "RCB-even-tr" : "RCB-odd-tr");
100
- return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement("tr", {
101
- className: className
102
- }, getTDValue({
103
- columnValue: "",
104
- columnConfig: {
105
- key: "expandIcon"
106
- },
107
- tdProps: {
108
- onClick: toggleExpanded,
109
- className: isExpanded ? "expand-open" : "expand-close"
110
- }
111
- }), showCheckbox && /*#__PURE__*/_react["default"].createElement("td", {
112
- key: "checkbox-colum-".concat(rowIndex)
113
- }, /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], {
114
- name: "checkbox".concat(rowIndex),
115
- type: "checkbox",
116
- className: "table-checkbox",
117
- onChange: onChange,
118
- value: selected
119
- })), columnConfigs.map(function (configObj) {
120
- var key = configObj.key;
121
- return getTDValue({
122
- columnValue: rowData[key],
123
- rowData: rowData,
124
- columnConfig: configObj,
125
- tdProps: {
126
- onClick: toggleExpanded
127
- }
128
- });
129
- })), isExpanded && /*#__PURE__*/_react["default"].createElement("tr", {
130
- className: "RCB-expanded-row"
131
- }, /*#__PURE__*/_react["default"].createElement("td", {
132
- colSpan: columnConfigs.length + 1
133
- }, /*#__PURE__*/_react["default"].createElement(ExpandedRowComponent, {
134
- parentRecord: rowData
135
- }))));
136
- };
137
- ExpandableTR.propTypes = {
138
- ExpandedRowComponent: _propTypes["default"].any.isRequired // TODO : check for a React Component
139
- };
140
-
141
- var TR = function TR(props) {
142
- var rowIndex = props.rowIndex,
143
- rowData = props.rowData,
144
- columnConfigs = props.columnConfigs,
145
- isEven = props.isEven,
146
- showCheckbox = props.showCheckbox,
147
- checkboxChangeCounter = props.checkboxChangeCounter,
148
- checkboxValue = props.checkboxValue,
149
- onSelectionChange = props.onSelectionChange;
150
- var _useState5 = (0, _react.useState)(checkboxValue || false),
151
- _useState6 = _slicedToArray(_useState5, 2),
152
- selected = _useState6[0],
153
- setSelected = _useState6[1];
154
- var className = "RCB-tr " + (isEven ? "RCB-even-tr" : "RCB-odd-tr");
155
- var onChange = function onChange(value) {
156
- setSelected(value);
157
- onSelectionChange(rowData, value);
158
- };
159
- (0, _react.useEffect)(function () {
160
- setSelected(checkboxValue);
161
- }, [checkboxChangeCounter, checkboxValue]);
162
- return /*#__PURE__*/_react["default"].createElement("tr", {
163
- className: className
164
- }, showCheckbox && /*#__PURE__*/_react["default"].createElement("td", {
165
- key: "checkbox-colum-".concat(rowIndex)
166
- }, /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], {
167
- name: "checkbox".concat(rowIndex),
168
- type: "checkbox",
169
- className: "table-checkbox",
170
- onChange: onChange,
171
- value: selected
172
- })), columnConfigs.map(function (configObj) {
173
- var key = configObj.key;
174
- return getTDValue({
175
- columnValue: rowData[key],
176
- rowData: rowData,
177
- columnConfig: configObj
178
- });
179
- }));
180
- };
181
- var BaseTable = function BaseTable(props, ref) {
182
- var className = props.className,
183
- records = props.records,
184
- columnConfigs = props.columnConfigs,
185
- idAttribute = props.idAttribute,
186
- checkboxConfig = props.checkboxConfig,
187
- isExpandableTable = props.isExpandableTable,
188
- ExpandedRowComponent = props.ExpandedRowComponent,
189
- noDataComponent = props.noDataComponent,
190
- sortByConfig = props.sortByConfig,
191
- resetPageNo = props.resetPageNo;
192
- var _DEFAULT_CHECKBOX_CON = _objectSpread(_objectSpread({}, DEFAULT_CHECKBOX_CONFIG), checkboxConfig || {}),
193
- showCheckbox = _DEFAULT_CHECKBOX_CON.enabled,
194
- showInHeader = _DEFAULT_CHECKBOX_CON.showInHeader;
195
- var sortBy = sortByConfig.sortBy,
196
- sortOrder = sortByConfig.sortOrder;
197
- var _useState7 = (0, _react.useState)(false),
198
- _useState8 = _slicedToArray(_useState7, 2),
199
- checkboxValue = _useState8[0],
200
- setCheckboxValue = _useState8[1];
201
- var _useState9 = (0, _react.useState)(0),
202
- _useState10 = _slicedToArray(_useState9, 2),
203
- checkboxChangeCounter = _useState10[0],
204
- setChangeCounter = _useState10[1];
205
- var _useState11 = (0, _react.useState)([]),
206
- _useState12 = _slicedToArray(_useState11, 2),
207
- selected = _useState12[0],
208
- setSelected = _useState12[1];
209
- var RowComponent = isExpandableTable ? ExpandableTR : TR;
210
- var onSelectionChange = function onSelectionChange(record, checked) {
211
- if (checked) {
212
- /* add to selected array */
213
- setSelected([].concat(_toConsumableArray(selected), [record]));
214
- } else {
215
- /* remove from selected array */
216
- var newSelected = selected.filter(function (obj) {
217
- return obj[idAttribute] !== record[idAttribute];
218
- });
219
- setSelected(newSelected);
220
- }
221
- };
222
- var getSelectedRows = function getSelectedRows() {
223
- return selected;
224
- };
225
- var updateCheckboxValue = function updateCheckboxValue(newValue) {
226
- setCheckboxValue(newValue);
227
- setChangeCounter(checkboxChangeCounter + 1);
228
- };
229
- var resetSelected = function resetSelected() {
230
- updateCheckboxValue(false);
231
- setSelected([]);
232
- };
233
- var toggleSelectAll = function toggleSelectAll() {
234
- var checked = !checkboxValue;
235
- updateCheckboxValue(checked);
236
- if (checked) {
237
- setSelected(records);
238
- } else {
239
- setSelected([]);
240
- }
241
- };
242
- (0, _react.useImperativeHandle)(ref, function () {
243
- return {
244
- getSelectedRows: getSelectedRows,
245
- resetSelected: resetSelected,
246
- resetPageNo: resetPageNo
247
- };
248
- });
249
- if (records.length === 0) {
250
- return noDataComponent;
251
- } else {
252
- return /*#__PURE__*/_react["default"].createElement("table", {
253
- className: "RCB-table ".concat(className)
254
- }, /*#__PURE__*/_react["default"].createElement("thead", null, /*#__PURE__*/_react["default"].createElement("tr", null, isExpandableTable && /*#__PURE__*/_react["default"].createElement("th", {
255
- key: "expandIcon",
256
- className: "RCB-th RCB-expand-column"
257
- }), showCheckbox && (showInHeader ? /*#__PURE__*/_react["default"].createElement("th", {
258
- key: "headerCheckbox"
259
- }, /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], {
260
- name: "headerCheckbox",
261
- type: "checkbox",
262
- className: "table-checkbox",
263
- value: checkboxValue,
264
- onChange: toggleSelectAll
265
- })) : /*#__PURE__*/_react["default"].createElement("th", null)), columnConfigs.map(function (columnObj) {
266
- var key = columnObj.key,
267
- label = columnObj.label,
268
- sortable = columnObj.sortable,
269
- headerClassName = columnObj.headerClassName;
270
- var className = "RCB-th";
271
- var thAttrs = {};
272
- if (sortable) {
273
- className += " RCB-th-sortable";
274
- if (sortBy === key) {
275
- className += " RCB-th-".concat(sortOrder.toLowerCase());
276
- } else {
277
- className += " RCB-th-sort";
278
- }
279
- thAttrs = {
280
- onClick: function onClick() {
281
- props.onSort(columnObj);
282
- }
283
- };
284
- }
285
- if (headerClassName) {
286
- className += " ".concat(headerClassName);
287
- }
288
- return /*#__PURE__*/_react["default"].createElement("th", _extends({
289
- className: className,
290
- key: key
291
- }, thAttrs), label);
292
- }))), /*#__PURE__*/_react["default"].createElement("tbody", null, records.map(function (rowData, index) {
293
- return /*#__PURE__*/_react["default"].createElement(RowComponent, {
294
- key: rowData[idAttribute],
295
- isEven: _utils["default"].isEven(index),
296
- rowIndex: index,
297
- rowData: rowData,
298
- columnConfigs: columnConfigs,
299
- ExpandedRowComponent: ExpandedRowComponent,
300
- showCheckbox: showCheckbox,
301
- checkboxValue: checkboxValue,
302
- checkboxChangeCounter: checkboxChangeCounter,
303
- onSelectionChange: onSelectionChange
304
- });
305
- })));
306
- }
307
- };
308
- BaseTable = /*#__PURE__*/(0, _react.forwardRef)(BaseTable);
309
-
310
- /* eslint-enable react/prop-types */
311
-
312
- BaseTable.propTypes = {
313
- /** Pass any additional classNames to Table component */
314
- className: _propTypes["default"].string,
315
- /** Array containing table row data */
316
- records: function records(props, propName) {
317
- if (props["paginationType"] == "CLIENT") {
318
- if (!props[propName]) {
319
- return new Error("Please provide the table records for paginationType 'CLIENT'!");
320
- }
321
- if (Object.prototype.toString.call(props[propName]) !== "[object Array]") {
322
- return new Error("'records' must be an array");
323
- }
324
- }
325
- },
326
- /** Array containing the table columns config */
327
- columnConfigs: _propTypes["default"].array.isRequired,
328
- /** ID attribute key to use when rendering the dropdown items */
329
- idAttribute: _propTypes["default"].string,
330
- /* Config to display checkbox in the first column of the table
331
- * {
332
- enabled: false, // turn this on to display checkbox in first column of the table
333
- showInHeader: true // turn this off to not display the checkbox in the table header
334
- }
335
- */
336
- checkboxConfig: _propTypes["default"].object,
337
- /** set to "true" if table rows are expandable */
338
- isExpandableTable: _propTypes["default"].bool,
339
- /** Component to be rendered on expanding a row */
340
- ExpandedRowComponent: _propTypes["default"].oneOfType([_propTypes["default"].instanceOf(Element), _propTypes["default"].func]),
341
- /** Component to be rendered if the table has no data */
342
- noDataComponent: _propTypes["default"].any
343
- };
344
- BaseTable.defaultProps = {
345
- className: "",
346
- records: [],
347
- idAttribute: "id",
348
- isExpandableTable: false,
349
- noDataComponent: /*#__PURE__*/_react["default"].createElement(DefaultNoDataComponent, null)
350
- };
351
- var _default = BaseTable;
352
- exports["default"] = _default;
@@ -1,87 +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 _Dropdown = _interopRequireDefault(require("../Form/Dropdown"));
10
- var _utils = _interopRequireDefault(require("../../core/utils"));
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
12
- 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); }
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
- var PaginationComponent = function PaginationComponent(props) {
19
- var pageSizeList = props.pageSizeList,
20
- pageConfig = props.pageConfig,
21
- onPageConfigChanged = props.onPageConfigChanged;
22
- var perPageCount = pageConfig.perPageCount,
23
- pageNo = pageConfig.pageNo,
24
- total = pageConfig.total;
25
- var SelectionSummary = function SelectionSummary() {
26
- var pagIndex = _utils["default"].getPagIndex(pageConfig);
27
- var start = pagIndex.start,
28
- end = pagIndex.end;
29
- var startVal = start + 1;
30
- var endVal = total < end ? total : end;
31
- var summaryString = "".concat(startVal, "-").concat(endVal);
32
- return /*#__PURE__*/_react["default"].createElement("div", {
33
- className: "RCB-select-summary"
34
- }, summaryString, /*#__PURE__*/_react["default"].createElement("span", {
35
- className: "RCB-select-arrow"
36
- }));
37
- };
38
- var onPerPageChanged = function onPerPageChanged(perPageObj) {
39
- var perPage = +perPageObj.id;
40
- onPageConfigChanged(_objectSpread(_objectSpread({}, pageConfig), {}, {
41
- pageNo: 1,
42
- perPageCount: perPage
43
- }));
44
- };
45
- var changePage = function changePage(moveUnit, event) {
46
- event.preventDefault();
47
- onPageConfigChanged(_objectSpread(_objectSpread({}, pageConfig), {}, {
48
- pageNo: pageNo + moveUnit
49
- }));
50
- };
51
- var isLeftNavDisbaled = pageNo <= 1;
52
- var isRightNavDisbaled = pageNo >= Math.ceil(total / +perPageCount);
53
- return /*#__PURE__*/_react["default"].createElement("div", {
54
- className: "RCB-paginate-wrapper"
55
- }, /*#__PURE__*/_react["default"].createElement(_Dropdown["default"], {
56
- name: "perPageCount",
57
- showLabel: false,
58
- className: "RCB-per-page-count",
59
- options: pageSizeList,
60
- onChange: onPerPageChanged,
61
- SelectionSummary: SelectionSummary
62
- }), "of ".concat(total), /*#__PURE__*/_react["default"].createElement("div", {
63
- className: "RCB-paginate-nav"
64
- }, /*#__PURE__*/_react["default"].createElement("a", {
65
- href: "javacsript:void(0)",
66
- className: "RCB-page-nav ".concat(isLeftNavDisbaled ? "disabled" : ""),
67
- onClick: function onClick(event) {
68
- return changePage(-1, event);
69
- }
70
- }, "<"), /*#__PURE__*/_react["default"].createElement("a", {
71
- href: "javacsript:void(0)",
72
- className: "RCB-page-nav ".concat(isRightNavDisbaled ? "disabled" : ""),
73
- onClick: function onClick(event) {
74
- return changePage(1, event);
75
- }
76
- }, ">")));
77
- };
78
- PaginationComponent.propTypes = {
79
- pageSizeList: _propTypes["default"].arrayOf(_propTypes["default"].shape({
80
- id: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
81
- name: _propTypes["default"].string
82
- })),
83
- pageConfig: _propTypes["default"].object,
84
- onPageConfigChanged: _propTypes["default"].func.isRequired
85
- };
86
- var _default = PaginationComponent;
87
- exports["default"] = _default;