@blaze-cms/plugin-data-ui 0.146.0-translations.6 → 0.147.0-rc-eagle.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 (273) hide show
  1. package/README.md +57 -0
  2. package/lib/components/EntityDataListing/EntityDataListing.js +21 -19
  3. package/lib/components/EntityDataListing/EntityDataListing.js.map +1 -1
  4. package/lib/components/EntityDataListing/index.js +2 -3
  5. package/lib/components/EntityDataListing/index.js.map +1 -1
  6. package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +18 -19
  7. package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +1 -1
  8. package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js +2 -3
  9. package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +1 -1
  10. package/lib/components/EntityManager/Entity/Entity.js +289 -452
  11. package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
  12. package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js +62 -66
  13. package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
  14. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +34 -50
  15. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
  16. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js +2 -3
  17. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +1 -1
  18. package/lib/components/EntityManager/Entity/EntityHeader/index.js +2 -3
  19. package/lib/components/EntityManager/Entity/EntityHeader/index.js.map +1 -1
  20. package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +20 -26
  21. package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +1 -1
  22. package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +20 -17
  23. package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -1
  24. package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +34 -32
  25. package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
  26. package/lib/components/EntityManager/Entity/SideBarRelations/index.js +104 -150
  27. package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
  28. package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +24 -24
  29. package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -1
  30. package/lib/components/EntityManager/Entity/actions-handlers/create/index.js +2 -3
  31. package/lib/components/EntityManager/Entity/actions-handlers/create/index.js.map +1 -1
  32. package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js +42 -56
  33. package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
  34. package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js +29 -45
  35. package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
  36. package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js +2 -3
  37. package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js.map +1 -1
  38. package/lib/components/EntityManager/Entity/actions-handlers/index.js +7 -8
  39. package/lib/components/EntityManager/Entity/actions-handlers/index.js.map +1 -1
  40. package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js +2 -3
  41. package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js.map +1 -1
  42. package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js +36 -57
  43. package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
  44. package/lib/components/EntityManager/Entity/actions-handlers/update/index.js +2 -3
  45. package/lib/components/EntityManager/Entity/actions-handlers/update/index.js.map +1 -1
  46. package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js +47 -66
  47. package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
  48. package/lib/components/EntityManager/Entity/index.js +2 -3
  49. package/lib/components/EntityManager/Entity/index.js.map +1 -1
  50. package/lib/components/EntityManager/EntityManager.js +91 -166
  51. package/lib/components/EntityManager/EntityManager.js.map +1 -1
  52. package/lib/components/EntityManager/index.js +2 -3
  53. package/lib/components/EntityManager/index.js.map +1 -1
  54. package/lib/components/EntityManager/utils/RecordEditContext/index.js +3 -4
  55. package/lib/components/EntityManager/utils/RecordEditContext/index.js.map +1 -1
  56. package/lib/components/EntityManager/utils/data-mappers.js +34 -46
  57. package/lib/components/EntityManager/utils/data-mappers.js.map +1 -1
  58. package/lib/components/EntityManager/utils/entity.js +35 -73
  59. package/lib/components/EntityManager/utils/entity.js.map +1 -1
  60. package/lib/components/EntityManager/utils/entityAvailableActions.js +51 -110
  61. package/lib/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
  62. package/lib/components/EntityManager/utils/is-form-empty.js +6 -10
  63. package/lib/components/EntityManager/utils/is-form-empty.js.map +1 -1
  64. package/lib/components/EntityManager/utils/query.js +17 -10
  65. package/lib/components/EntityManager/utils/query.js.map +1 -1
  66. package/lib/components/InfoBoxes/InfoBoxTooltip.js +43 -0
  67. package/lib/components/InfoBoxes/InfoBoxTooltip.js.map +1 -0
  68. package/lib/components/InfoBoxes/InfoBoxes.js +19 -19
  69. package/lib/components/InfoBoxes/InfoBoxes.js.map +1 -1
  70. package/lib/components/InfoBoxes/container/InfoBoxContainer.js +26 -38
  71. package/lib/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
  72. package/lib/components/InfoBoxes/helpers/build-dynamic-query.js +21 -16
  73. package/lib/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -1
  74. package/lib/components/InfoBoxes/hooks/useData.js +33 -30
  75. package/lib/components/InfoBoxes/hooks/useData.js.map +1 -1
  76. package/lib/components/InfoBoxes/hooks/useInfoBox.js +10 -10
  77. package/lib/components/InfoBoxes/hooks/useInfoBox.js.map +1 -1
  78. package/lib/components/InfoBoxes/index.js +2 -3
  79. package/lib/components/InfoBoxes/index.js.map +1 -1
  80. package/lib/components/InfoBoxes/presentational/InfoBox.js +28 -32
  81. package/lib/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
  82. package/lib/components/InfoBoxes/presentational/InfoBoxLabel.js +11 -12
  83. package/lib/components/InfoBoxes/presentational/InfoBoxLabel.js.map +1 -1
  84. package/lib/components/InfoBoxes/presentational/InfoBoxValue.js +12 -12
  85. package/lib/components/InfoBoxes/presentational/InfoBoxValue.js.map +1 -1
  86. package/lib/components/ListingTable/ListingTable.js +163 -303
  87. package/lib/components/ListingTable/ListingTable.js.map +1 -1
  88. package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js +61 -40
  89. package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
  90. package/lib/components/ListingTable/ListingTableContent/index.js +2 -3
  91. package/lib/components/ListingTable/ListingTableContent/index.js.map +1 -1
  92. package/lib/components/ListingTable/SearchFilter/SearchContainer.js +215 -0
  93. package/lib/components/ListingTable/SearchFilter/SearchContainer.js.map +1 -0
  94. package/lib/components/ListingTable/SearchFilter/SearchFilter.js +48 -0
  95. package/lib/components/ListingTable/SearchFilter/SearchFilter.js.map +1 -0
  96. package/lib/components/ListingTable/SearchFilter/helpers.js +105 -0
  97. package/lib/components/ListingTable/SearchFilter/helpers.js.map +1 -0
  98. package/lib/components/ListingTable/SearchFilter/querys.js +13 -0
  99. package/lib/components/ListingTable/SearchFilter/querys.js.map +1 -0
  100. package/lib/components/ListingTable/TableActions/TableActions.js +27 -31
  101. package/lib/components/ListingTable/TableActions/TableActions.js.map +1 -1
  102. package/lib/components/ListingTable/TableActions/index.js +2 -3
  103. package/lib/components/ListingTable/TableActions/index.js.map +1 -1
  104. package/lib/components/ListingTable/index.js +2 -3
  105. package/lib/components/ListingTable/index.js.map +1 -1
  106. package/lib/components/ListingTable/mappers/populate-rows.js +104 -120
  107. package/lib/components/ListingTable/mappers/populate-rows.js.map +1 -1
  108. package/lib/components/ListingTable/service/index.js +66 -83
  109. package/lib/components/ListingTable/service/index.js.map +1 -1
  110. package/lib/components/Tabs/index.js +26 -42
  111. package/lib/components/Tabs/index.js.map +1 -1
  112. package/lib/components/hooks/useCallbackDebounce.js +5 -9
  113. package/lib/components/hooks/useCallbackDebounce.js.map +1 -1
  114. package/lib/constants.js +31 -29
  115. package/lib/constants.js.map +1 -1
  116. package/lib/icons/ContentIcon.js +17 -20
  117. package/lib/icons/ContentIcon.js.map +1 -1
  118. package/lib/icons/SettingsIcon.js +12 -15
  119. package/lib/icons/SettingsIcon.js.map +1 -1
  120. package/lib/icons/TaxonomyIcon.js +15 -18
  121. package/lib/icons/TaxonomyIcon.js.map +1 -1
  122. package/lib/icons/UsersIcon.js +11 -14
  123. package/lib/icons/UsersIcon.js.map +1 -1
  124. package/lib/icons/index.js +8 -9
  125. package/lib/icons/index.js.map +1 -1
  126. package/lib/index.js +81 -121
  127. package/lib/index.js.map +1 -1
  128. package/lib/utils/add-content-menu-items.js +67 -93
  129. package/lib/utils/add-content-menu-items.js.map +1 -1
  130. package/lib/utils/build-create-entity-mutation.js +12 -9
  131. package/lib/utils/build-create-entity-mutation.js.map +1 -1
  132. package/lib/utils/build-delete-entity-mutation.js +11 -8
  133. package/lib/utils/build-delete-entity-mutation.js.map +1 -1
  134. package/lib/utils/build-listing-query.js +20 -17
  135. package/lib/utils/build-listing-query.js.map +1 -1
  136. package/lib/utils/build-update-data-query.js +15 -9
  137. package/lib/utils/build-update-data-query.js.map +1 -1
  138. package/lib/utils/build-update-publish-unpublish-mutation.js +15 -8
  139. package/lib/utils/build-update-publish-unpublish-mutation.js.map +1 -1
  140. package/lib/utils/get-default-query-params.js +7 -6
  141. package/lib/utils/get-default-query-params.js.map +1 -1
  142. package/lib/utils/hoc/withContext.js +4 -6
  143. package/lib/utils/hoc/withContext.js.map +1 -1
  144. package/lib/utils/hooks/useToggle.js +4 -12
  145. package/lib/utils/hooks/useToggle.js.map +1 -1
  146. package/lib/utils/index.js +2 -3
  147. package/lib/utils/index.js.map +1 -1
  148. package/lib-es/components/EntityDataListing/EntityDataListing.js.map +1 -1
  149. package/lib-es/components/EntityDataListing/index.js.map +1 -1
  150. package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +1 -1
  151. package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +1 -1
  152. package/lib-es/components/EntityManager/Entity/Entity.js +21 -28
  153. package/lib-es/components/EntityManager/Entity/Entity.js.map +1 -1
  154. package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
  155. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +6 -1
  156. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
  157. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +1 -1
  158. package/lib-es/components/EntityManager/Entity/EntityHeader/index.js.map +1 -1
  159. package/lib-es/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +1 -1
  160. package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +2 -0
  161. package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -1
  162. package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
  163. package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js +26 -7
  164. package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
  165. package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +8 -2
  166. package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -1
  167. package/lib-es/components/EntityManager/Entity/actions-handlers/create/index.js.map +1 -1
  168. package/lib-es/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
  169. package/lib-es/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
  170. package/lib-es/components/EntityManager/Entity/actions-handlers/delete/index.js.map +1 -1
  171. package/lib-es/components/EntityManager/Entity/actions-handlers/index.js.map +1 -1
  172. package/lib-es/components/EntityManager/Entity/actions-handlers/shared/index.js.map +1 -1
  173. package/lib-es/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
  174. package/lib-es/components/EntityManager/Entity/actions-handlers/update/index.js.map +1 -1
  175. package/lib-es/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
  176. package/lib-es/components/EntityManager/Entity/index.js.map +1 -1
  177. package/lib-es/components/EntityManager/EntityManager.js.map +1 -1
  178. package/lib-es/components/EntityManager/index.js.map +1 -1
  179. package/lib-es/components/EntityManager/utils/RecordEditContext/index.js.map +1 -1
  180. package/lib-es/components/EntityManager/utils/data-mappers.js.map +1 -1
  181. package/lib-es/components/EntityManager/utils/entity.js +6 -2
  182. package/lib-es/components/EntityManager/utils/entity.js.map +1 -1
  183. package/lib-es/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
  184. package/lib-es/components/EntityManager/utils/is-form-empty.js.map +1 -1
  185. package/lib-es/components/EntityManager/utils/query.js.map +1 -1
  186. package/lib-es/components/InfoBoxes/InfoBoxTooltip.js +36 -0
  187. package/lib-es/components/InfoBoxes/InfoBoxTooltip.js.map +1 -0
  188. package/lib-es/components/InfoBoxes/InfoBoxes.js.map +1 -1
  189. package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
  190. package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js +2 -0
  191. package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -1
  192. package/lib-es/components/InfoBoxes/hooks/useData.js.map +1 -1
  193. package/lib-es/components/InfoBoxes/hooks/useInfoBox.js.map +1 -1
  194. package/lib-es/components/InfoBoxes/index.js.map +1 -1
  195. package/lib-es/components/InfoBoxes/presentational/InfoBox.js +4 -1
  196. package/lib-es/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
  197. package/lib-es/components/InfoBoxes/presentational/InfoBoxLabel.js.map +1 -1
  198. package/lib-es/components/InfoBoxes/presentational/InfoBoxValue.js.map +1 -1
  199. package/lib-es/components/ListingTable/ListingTable.js +12 -11
  200. package/lib-es/components/ListingTable/ListingTable.js.map +1 -1
  201. package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js +34 -16
  202. package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
  203. package/lib-es/components/ListingTable/ListingTableContent/index.js.map +1 -1
  204. package/lib-es/components/ListingTable/SearchFilter/SearchContainer.js +207 -0
  205. package/lib-es/components/ListingTable/SearchFilter/SearchContainer.js.map +1 -0
  206. package/lib-es/components/ListingTable/SearchFilter/SearchFilter.js +40 -0
  207. package/lib-es/components/ListingTable/SearchFilter/SearchFilter.js.map +1 -0
  208. package/lib-es/components/ListingTable/SearchFilter/helpers.js +96 -0
  209. package/lib-es/components/ListingTable/SearchFilter/helpers.js.map +1 -0
  210. package/lib-es/components/ListingTable/SearchFilter/querys.js +8 -0
  211. package/lib-es/components/ListingTable/SearchFilter/querys.js.map +1 -0
  212. package/lib-es/components/ListingTable/TableActions/TableActions.js.map +1 -1
  213. package/lib-es/components/ListingTable/TableActions/index.js.map +1 -1
  214. package/lib-es/components/ListingTable/index.js.map +1 -1
  215. package/lib-es/components/ListingTable/mappers/populate-rows.js +3 -0
  216. package/lib-es/components/ListingTable/mappers/populate-rows.js.map +1 -1
  217. package/lib-es/components/ListingTable/service/index.js +3 -2
  218. package/lib-es/components/ListingTable/service/index.js.map +1 -1
  219. package/lib-es/components/Tabs/index.js +6 -7
  220. package/lib-es/components/Tabs/index.js.map +1 -1
  221. package/lib-es/components/hooks/useCallbackDebounce.js.map +1 -1
  222. package/lib-es/constants.js +4 -1
  223. package/lib-es/constants.js.map +1 -1
  224. package/lib-es/icons/ContentIcon.js.map +1 -1
  225. package/lib-es/icons/SettingsIcon.js.map +1 -1
  226. package/lib-es/icons/TaxonomyIcon.js.map +1 -1
  227. package/lib-es/icons/UsersIcon.js.map +1 -1
  228. package/lib-es/icons/index.js.map +1 -1
  229. package/lib-es/index.js +11 -3
  230. package/lib-es/index.js.map +1 -1
  231. package/lib-es/utils/add-content-menu-items.js.map +1 -1
  232. package/lib-es/utils/build-create-entity-mutation.js.map +1 -1
  233. package/lib-es/utils/build-delete-entity-mutation.js.map +1 -1
  234. package/lib-es/utils/build-listing-query.js +4 -4
  235. package/lib-es/utils/build-listing-query.js.map +1 -1
  236. package/lib-es/utils/build-update-data-query.js.map +1 -1
  237. package/lib-es/utils/build-update-publish-unpublish-mutation.js.map +1 -1
  238. package/lib-es/utils/get-default-query-params.js.map +1 -1
  239. package/lib-es/utils/hoc/withContext.js +1 -1
  240. package/lib-es/utils/hoc/withContext.js.map +1 -1
  241. package/lib-es/utils/hooks/useToggle.js.map +1 -1
  242. package/lib-es/utils/index.js.map +1 -1
  243. package/package.json +28 -22
  244. package/src/components/EntityManager/Entity/Entity.js +72 -80
  245. package/src/components/EntityManager/Entity/EntityHeader/EntityHeader.js +1 -2
  246. package/src/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +8 -1
  247. package/src/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +2 -0
  248. package/src/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +9 -7
  249. package/src/components/EntityManager/Entity/SideBarRelations/index.js +82 -59
  250. package/src/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +5 -3
  251. package/src/components/EntityManager/EntityManager.js +52 -45
  252. package/src/components/EntityManager/utils/entity.js +13 -2
  253. package/src/components/InfoBoxes/InfoBoxTooltip.js +32 -0
  254. package/src/components/InfoBoxes/container/InfoBoxContainer.js +3 -6
  255. package/src/components/InfoBoxes/helpers/build-dynamic-query.js +2 -0
  256. package/src/components/InfoBoxes/hooks/useData.js +6 -1
  257. package/src/components/InfoBoxes/presentational/InfoBox.js +4 -2
  258. package/src/components/ListingTable/ListingTable.js +23 -31
  259. package/src/components/ListingTable/ListingTableContent/ListingTableContent.js +43 -27
  260. package/src/components/ListingTable/SearchFilter/SearchContainer.js +228 -0
  261. package/src/components/ListingTable/SearchFilter/SearchFilter.js +38 -0
  262. package/src/components/ListingTable/SearchFilter/helpers.js +99 -0
  263. package/src/components/ListingTable/SearchFilter/querys.js +9 -0
  264. package/src/components/ListingTable/mappers/populate-rows.js +3 -0
  265. package/src/components/ListingTable/service/index.js +3 -4
  266. package/src/components/Tabs/index.js +17 -21
  267. package/src/constants.js +9 -1
  268. package/src/index.js +9 -7
  269. package/src/utils/build-listing-query.js +4 -4
  270. package/src/utils/hoc/withContext.js +5 -4
  271. package/CHANGELOG.md +0 -1939
  272. package/babel.config.js +0 -3
  273. package/jest.config.js +0 -5
@@ -0,0 +1 @@
1
+ {"version":3,"file":"querys.js","names":["_client","require","NOOP_QUERY","exports","gql"],"sources":["../../../../src/components/ListingTable/SearchFilter/querys.js"],"sourcesContent":["import { gql } from '@apollo/client';\n\nconst NOOP_QUERY = gql`\n query NoOp {\n __typename\n }\n`;\n\nexport { NOOP_QUERY };\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA,MAAMC,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG,IAAAE,WAAG;AACtB;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -1,45 +1,41 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.object.define-property.js");
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
- exports["default"] = void 0;
7
+ exports.default = void 0;
9
8
  var _react = _interopRequireDefault(require("react"));
10
9
  var _reactRouterDom = require("react-router-dom");
11
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
12
11
  var _more = _interopRequireDefault(require("@blaze-react/more"));
13
12
  var _button = _interopRequireDefault(require("@blaze-react/button"));
14
- var TableActions = function TableActions(_ref) {
15
- var editUrl = _ref.editUrl,
16
- data = _ref.data,
17
- showDeleteModal = _ref.showDeleteModal;
18
- return /*#__PURE__*/_react["default"].createElement("div", {
19
- className: "more-menu__wrapper"
20
- }, /*#__PURE__*/_react["default"].createElement(_more["default"], {
21
- isMoreMenu: true
22
- }, /*#__PURE__*/_react["default"].createElement(_more["default"].Avatar, {
23
- isMoreMenu: true
24
- }, /*#__PURE__*/_react["default"].createElement("span", {
25
- className: "material-icons"
26
- }, "more_vert")), /*#__PURE__*/_react["default"].createElement(_more["default"].Content, {
27
- isMoreMenu: true
28
- }, /*#__PURE__*/_react["default"].createElement(_reactRouterDom.Link, {
29
- to: editUrl,
30
- className: "more-menu__link",
31
- role: "button"
32
- }, "Edit"), /*#__PURE__*/_react["default"].createElement(_button["default"], {
33
- className: "more-menu__link",
34
- onClick: function onClick() {
35
- return showDeleteModal(data);
36
- }
37
- }, "Delete"))));
38
- };
13
+ const TableActions = ({
14
+ editUrl,
15
+ data,
16
+ showDeleteModal
17
+ }) => /*#__PURE__*/_react.default.createElement("div", {
18
+ className: "more-menu__wrapper"
19
+ }, /*#__PURE__*/_react.default.createElement(_more.default, {
20
+ isMoreMenu: true
21
+ }, /*#__PURE__*/_react.default.createElement(_more.default.Avatar, {
22
+ isMoreMenu: true
23
+ }, /*#__PURE__*/_react.default.createElement("span", {
24
+ className: "material-icons"
25
+ }, "more_vert")), /*#__PURE__*/_react.default.createElement(_more.default.Content, {
26
+ isMoreMenu: true
27
+ }, /*#__PURE__*/_react.default.createElement(_reactRouterDom.Link, {
28
+ to: editUrl,
29
+ className: "more-menu__link",
30
+ role: "button"
31
+ }, "Edit"), /*#__PURE__*/_react.default.createElement(_button.default, {
32
+ className: "more-menu__link",
33
+ onClick: () => showDeleteModal(data)
34
+ }, "Delete"))));
39
35
  TableActions.propTypes = {
40
- editUrl: _propTypes["default"].string.isRequired,
41
- showDeleteModal: _propTypes["default"].func.isRequired,
42
- data: _propTypes["default"].object.isRequired
36
+ editUrl: _propTypes.default.string.isRequired,
37
+ showDeleteModal: _propTypes.default.func.isRequired,
38
+ data: _propTypes.default.object.isRequired
43
39
  };
44
- var _default = exports["default"] = TableActions;
40
+ var _default = exports.default = TableActions;
45
41
  //# sourceMappingURL=TableActions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableActions.js","names":["_react","_interopRequireDefault","require","_reactRouterDom","_propTypes","_more","_button","TableActions","_ref","editUrl","data","showDeleteModal","createElement","className","isMoreMenu","Avatar","Content","Link","to","role","onClick","propTypes","PropTypes","string","isRequired","func","object","_default","exports"],"sources":["../../../../src/components/ListingTable/TableActions/TableActions.js"],"sourcesContent":["import React from 'react';\nimport { Link } from 'react-router-dom';\nimport PropTypes from 'prop-types';\nimport More from '@blaze-react/more';\nimport Button from '@blaze-react/button';\n\nconst TableActions = ({ editUrl, data, showDeleteModal }) => (\n <div className=\"more-menu__wrapper\">\n <More isMoreMenu>\n <More.Avatar isMoreMenu>\n <span className=\"material-icons\">more_vert</span>\n </More.Avatar>\n <More.Content isMoreMenu>\n <Link to={editUrl} className=\"more-menu__link\" role=\"button\">\n Edit\n </Link>\n <Button className=\"more-menu__link\" onClick={() => showDeleteModal(data)}>\n Delete\n </Button>\n </More.Content>\n </More>\n </div>\n);\n\nTableActions.propTypes = {\n editUrl: PropTypes.string.isRequired,\n showDeleteModal: PropTypes.func.isRequired,\n data: PropTypes.object.isRequired\n};\n\nexport default TableActions;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,KAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,OAAA,GAAAL,sBAAA,CAAAC,OAAA;AAEA,IAAMK,YAAY,GAAG,SAAfA,YAAYA,CAAAC,IAAA;EAAA,IAAMC,OAAO,GAAAD,IAAA,CAAPC,OAAO;IAAEC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IAAEC,eAAe,GAAAH,IAAA,CAAfG,eAAe;EAAA,oBACpDX,MAAA,YAAAY,aAAA;IAAKC,SAAS,EAAC;EAAoB,gBACjCb,MAAA,YAAAY,aAAA,CAACP,KAAA,WAAI;IAACS,UAAU;EAAA,gBACdd,MAAA,YAAAY,aAAA,CAACP,KAAA,WAAI,CAACU,MAAM;IAACD,UAAU;EAAA,gBACrBd,MAAA,YAAAY,aAAA;IAAMC,SAAS,EAAC;EAAgB,GAAC,WAAe,CACrC,CAAC,eACdb,MAAA,YAAAY,aAAA,CAACP,KAAA,WAAI,CAACW,OAAO;IAACF,UAAU;EAAA,gBACtBd,MAAA,YAAAY,aAAA,CAACT,eAAA,CAAAc,IAAI;IAACC,EAAE,EAAET,OAAQ;IAACI,SAAS,EAAC,iBAAiB;IAACM,IAAI,EAAC;EAAQ,GAAC,MAEvD,CAAC,eACPnB,MAAA,YAAAY,aAAA,CAACN,OAAA,WAAM;IAACO,SAAS,EAAC,iBAAiB;IAACO,OAAO,EAAE,SAAAA,QAAA;MAAA,OAAMT,eAAe,CAACD,IAAI,CAAC;IAAA;EAAC,GAAC,QAElE,CACI,CACV,CACH,CAAC;AAAA,CACP;AAEDH,YAAY,CAACc,SAAS,GAAG;EACvBZ,OAAO,EAAEa,qBAAS,CAACC,MAAM,CAACC,UAAU;EACpCb,eAAe,EAAEW,qBAAS,CAACG,IAAI,CAACD,UAAU;EAC1Cd,IAAI,EAAEY,qBAAS,CAACI,MAAM,CAACF;AACzB,CAAC;AAAC,IAAAG,QAAA,GAAAC,OAAA,cAEarB,YAAY"}
1
+ {"version":3,"file":"TableActions.js","names":["_react","_interopRequireDefault","require","_reactRouterDom","_propTypes","_more","_button","TableActions","editUrl","data","showDeleteModal","default","createElement","className","isMoreMenu","Avatar","Content","Link","to","role","onClick","propTypes","PropTypes","string","isRequired","func","object","_default","exports"],"sources":["../../../../src/components/ListingTable/TableActions/TableActions.js"],"sourcesContent":["import React from 'react';\nimport { Link } from 'react-router-dom';\nimport PropTypes from 'prop-types';\nimport More from '@blaze-react/more';\nimport Button from '@blaze-react/button';\n\nconst TableActions = ({ editUrl, data, showDeleteModal }) => (\n <div className=\"more-menu__wrapper\">\n <More isMoreMenu>\n <More.Avatar isMoreMenu>\n <span className=\"material-icons\">more_vert</span>\n </More.Avatar>\n <More.Content isMoreMenu>\n <Link to={editUrl} className=\"more-menu__link\" role=\"button\">\n Edit\n </Link>\n <Button className=\"more-menu__link\" onClick={() => showDeleteModal(data)}>\n Delete\n </Button>\n </More.Content>\n </More>\n </div>\n);\n\nTableActions.propTypes = {\n editUrl: PropTypes.string.isRequired,\n showDeleteModal: PropTypes.func.isRequired,\n data: PropTypes.object.isRequired\n};\n\nexport default TableActions;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,KAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,OAAA,GAAAL,sBAAA,CAAAC,OAAA;AAEA,MAAMK,YAAY,GAAGA,CAAC;EAAEC,OAAO;EAAEC,IAAI;EAAEC;AAAgB,CAAC,kBACtDV,MAAA,CAAAW,OAAA,CAAAC,aAAA;EAAKC,SAAS,EAAC;AAAoB,gBACjCb,MAAA,CAAAW,OAAA,CAAAC,aAAA,CAACP,KAAA,CAAAM,OAAI;EAACG,UAAU;AAAA,gBACdd,MAAA,CAAAW,OAAA,CAAAC,aAAA,CAACP,KAAA,CAAAM,OAAI,CAACI,MAAM;EAACD,UAAU;AAAA,gBACrBd,MAAA,CAAAW,OAAA,CAAAC,aAAA;EAAMC,SAAS,EAAC;AAAgB,GAAC,WAAe,CACrC,CAAC,eACdb,MAAA,CAAAW,OAAA,CAAAC,aAAA,CAACP,KAAA,CAAAM,OAAI,CAACK,OAAO;EAACF,UAAU;AAAA,gBACtBd,MAAA,CAAAW,OAAA,CAAAC,aAAA,CAACT,eAAA,CAAAc,IAAI;EAACC,EAAE,EAAEV,OAAQ;EAACK,SAAS,EAAC,iBAAiB;EAACM,IAAI,EAAC;AAAQ,GAAC,MAEvD,CAAC,eACPnB,MAAA,CAAAW,OAAA,CAAAC,aAAA,CAACN,OAAA,CAAAK,OAAM;EAACE,SAAS,EAAC,iBAAiB;EAACO,OAAO,EAAEA,CAAA,KAAMV,eAAe,CAACD,IAAI;AAAE,GAAC,QAElE,CACI,CACV,CACH,CACN;AAEDF,YAAY,CAACc,SAAS,GAAG;EACvBb,OAAO,EAAEc,kBAAS,CAACC,MAAM,CAACC,UAAU;EACpCd,eAAe,EAAEY,kBAAS,CAACG,IAAI,CAACD,UAAU;EAC1Cf,IAAI,EAAEa,kBAAS,CAACI,MAAM,CAACF;AACzB,CAAC;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAAjB,OAAA,GAEaJ,YAAY","ignoreList":[]}
@@ -1,11 +1,10 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.object.define-property.js");
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
- exports["default"] = void 0;
7
+ exports.default = void 0;
9
8
  var _TableActions = _interopRequireDefault(require("./TableActions"));
10
- var _default = exports["default"] = _TableActions["default"];
9
+ var _default = exports.default = _TableActions.default;
11
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_TableActions","_interopRequireDefault","require","_default","exports","TableActions"],"sources":["../../../../src/components/ListingTable/TableActions/index.js"],"sourcesContent":["import TableActions from './TableActions';\n\nexport default TableActions;\n"],"mappings":";;;;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0C,IAAAC,QAAA,GAAAC,OAAA,cAE3BC,wBAAY"}
1
+ {"version":3,"file":"index.js","names":["_TableActions","_interopRequireDefault","require","_default","exports","default","TableActions"],"sources":["../../../../src/components/ListingTable/TableActions/index.js"],"sourcesContent":["import TableActions from './TableActions';\n\nexport default TableActions;\n"],"mappings":";;;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0C,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAE3BC,qBAAY","ignoreList":[]}
@@ -1,11 +1,10 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.object.define-property.js");
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
- exports["default"] = void 0;
7
+ exports.default = void 0;
9
8
  var _ListingTable = _interopRequireDefault(require("./ListingTable"));
10
- var _default = exports["default"] = _ListingTable["default"];
9
+ var _default = exports.default = _ListingTable.default;
11
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_ListingTable","_interopRequireDefault","require","_default","exports","ListingTable"],"sources":["../../../src/components/ListingTable/index.js"],"sourcesContent":["import ListingTable from './ListingTable';\n\nexport default ListingTable;\n"],"mappings":";;;;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0C,IAAAC,QAAA,GAAAC,OAAA,cAE3BC,wBAAY"}
1
+ {"version":3,"file":"index.js","names":["_ListingTable","_interopRequireDefault","require","_default","exports","default","ListingTable"],"sources":["../../../src/components/ListingTable/index.js"],"sourcesContent":["import ListingTable from './ListingTable';\n\nexport default ListingTable;\n"],"mappings":";;;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0C,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAE3BC,qBAAY","ignoreList":[]}
@@ -1,30 +1,11 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.symbol.js");
4
- require("core-js/modules/es.array.filter.js");
5
- require("core-js/modules/es.object.get-own-property-descriptor.js");
6
- require("core-js/modules/es.object.get-own-property-descriptors.js");
7
- require("core-js/modules/es.object.define-properties.js");
8
- require("core-js/modules/es.object.define-property.js");
9
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
10
4
  Object.defineProperty(exports, "__esModule", {
11
5
  value: true
12
6
  });
13
7
  exports.populateRows = exports.getParsedRowData = exports.formatRows = void 0;
14
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
15
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
16
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
17
- require("core-js/modules/es.array.map.js");
18
- require("core-js/modules/es.array.concat.js");
19
- require("core-js/modules/es.array.slice.js");
20
- require("core-js/modules/es.array.reduce.js");
21
- require("core-js/modules/es.object.to-string.js");
22
- require("core-js/modules/es.object.keys.js");
23
- require("core-js/modules/es.array.is-array.js");
24
- require("core-js/modules/es.array.for-each.js");
25
- require("core-js/modules/web.dom-collections.for-each.js");
26
- require("core-js/modules/es.array.includes.js");
27
- require("core-js/modules/es.string.includes.js");
28
9
  var _react = _interopRequireDefault(require("react"));
29
10
  var _reactRouterDom = require("react-router-dom");
30
11
  var _pluginRenderHooksUi = require("@blaze-cms/plugin-render-hooks-ui");
@@ -32,134 +13,137 @@ var _TableActions = _interopRequireDefault(require("../TableActions"));
32
13
  var _constants = require("../../../constants");
33
14
  var _InfoBoxValue = _interopRequireDefault(require("../../InfoBoxes/presentational/InfoBoxValue"));
34
15
  var _InfoBoxLabel = _interopRequireDefault(require("../../InfoBoxes/presentational/InfoBoxLabel"));
16
+ var _InfoBoxTooltip = _interopRequireDefault(require("../../InfoBoxes/InfoBoxTooltip"));
35
17
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
36
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
37
- var formatRows = exports.formatRows = function formatRows(_ref) {
38
- var rows = _ref.rows,
39
- url = _ref.url,
40
- toggleModal = _ref.toggleModal,
41
- label = _ref.label,
42
- _ref$firstColumn = _ref.firstColumn,
43
- firstColumn = _ref$firstColumn === void 0 ? 'name' : _ref$firstColumn,
44
- isEnquiry = _ref.isEnquiry,
45
- entitySchema = _ref.entitySchema;
46
- return rows.map(function (data) {
47
- var editUrl = "".concat(url, "/update/").concat(data.id);
48
- var rowProps = _objectSpread(_objectSpread({}, data), {}, (0, _defineProperty2["default"])({}, firstColumn, /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_reactRouterDom.Link, {
18
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
19
+ const formatRows = ({
20
+ rows,
21
+ url,
22
+ toggleModal,
23
+ label,
24
+ firstColumn = 'name',
25
+ isEnquiry,
26
+ entitySchema
27
+ }) => rows.map(data => {
28
+ const editUrl = `${url}/update/${data.id}`;
29
+ const rowProps = _objectSpread(_objectSpread({}, data), {}, {
30
+ [firstColumn]: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactRouterDom.Link, {
49
31
  to: editUrl,
50
32
  role: "button"
51
- }, data[firstColumn]), /*#__PURE__*/_react["default"].createElement(_pluginRenderHooksUi.RenderHook, {
33
+ }, data[firstColumn]), /*#__PURE__*/_react.default.createElement(_pluginRenderHooksUi.RenderHook, {
52
34
  hookKey: "entity:listing:table:row:column:after",
53
35
  schema: entitySchema,
54
36
  data: data,
55
37
  value: data[firstColumn],
56
38
  column: firstColumn
57
- }))));
58
- if (!isEnquiry) rowProps.actions = /*#__PURE__*/_react["default"].createElement(_TableActions["default"], {
59
- editUrl: editUrl,
60
- data: data,
61
- showDeleteModal: toggleModal
62
- });
63
- return rowProps;
39
+ }))
64
40
  });
65
- };
66
- var getSanitizedColumnLabel = function getSanitizedColumnLabel(columnProp) {
67
- var sanitizedChar = '';
68
- for (var index = 0; index < columnProp.length; index += 1) {
69
- if (index && columnProp[index] === columnProp[index].toUpperCase()) sanitizedChar = "".concat(sanitizedChar, " ").concat(columnProp[index].toLowerCase());else sanitizedChar += columnProp[index];
41
+ if (!isEnquiry) rowProps.actions = /*#__PURE__*/_react.default.createElement(_TableActions.default, {
42
+ editUrl: editUrl,
43
+ data: data,
44
+ showDeleteModal: toggleModal
45
+ });
46
+ return rowProps;
47
+ });
48
+ exports.formatRows = formatRows;
49
+ const getSanitizedColumnLabel = columnProp => {
50
+ let sanitizedChar = '';
51
+ for (let index = 0; index < columnProp.length; index += 1) {
52
+ if (index && columnProp[index] === columnProp[index].toUpperCase()) sanitizedChar = `${sanitizedChar} ${columnProp[index].toLowerCase()}`;else sanitizedChar += columnProp[index];
70
53
  }
71
54
  return sanitizedChar;
72
55
  };
73
- var buildArrayRowContent = function buildArrayRowContent(rowData) {
74
- return /*#__PURE__*/_react["default"].createElement("div", {
75
- className: "table-row-list"
76
- }, rowData.map(function (rowGroup) {
77
- if (!rowGroup.length) return null;
78
- return /*#__PURE__*/_react["default"].createElement("div", {
79
- className: "table-row-list__group"
80
- }, rowGroup.map(function (item) {
81
- return /*#__PURE__*/_react["default"].createElement("div", {
82
- className: "table-row-list__group__item"
83
- }, /*#__PURE__*/_react["default"].createElement("span", {
84
- className: "table-row-list__group__item__label"
85
- }, /*#__PURE__*/_react["default"].createElement(_InfoBoxLabel["default"], {
86
- item: item
87
- })), /*#__PURE__*/_react["default"].createElement("span", {
88
- className: "table-row-list__group__item__value"
89
- }, /*#__PURE__*/_react["default"].createElement(_InfoBoxValue["default"], {
90
- item: item
91
- })));
92
- }));
93
- }));
94
- };
95
- var buildArrayRowData = function buildArrayRowData(rowData) {
96
- var groupSize = Math.ceil(rowData.length / 3);
97
- var group1 = rowData.slice(0, groupSize);
98
- var group2 = rowData.slice(groupSize, groupSize * 2);
99
- var group3 = rowData.slice(groupSize * 2);
100
- var dataGroups = [group1, group2, group3];
56
+ const buildArrayRowContent = rowData => /*#__PURE__*/_react.default.createElement("div", {
57
+ className: "table-row-list"
58
+ }, rowData.map(rowGroup => {
59
+ if (!rowGroup.length) return null;
60
+ return /*#__PURE__*/_react.default.createElement("div", {
61
+ className: "table-row-list__group"
62
+ }, rowGroup.map(item => /*#__PURE__*/_react.default.createElement("div", {
63
+ className: "table-row-list__group__item"
64
+ }, /*#__PURE__*/_react.default.createElement("span", {
65
+ className: "table-row-list__group__item__label"
66
+ }, /*#__PURE__*/_react.default.createElement(_InfoBoxLabel.default, {
67
+ item: item
68
+ })), /*#__PURE__*/_react.default.createElement("span", {
69
+ className: "table-row-list__group__item__value"
70
+ }, /*#__PURE__*/_react.default.createElement(_InfoBoxValue.default, {
71
+ item: item
72
+ }), /*#__PURE__*/_react.default.createElement(_InfoBoxTooltip.default, {
73
+ info: item
74
+ })))));
75
+ }));
76
+ const buildArrayRowData = rowData => {
77
+ const groupSize = Math.ceil(rowData.length / 3);
78
+ const group1 = rowData.slice(0, groupSize);
79
+ const group2 = rowData.slice(groupSize, groupSize * 2);
80
+ const group3 = rowData.slice(groupSize * 2);
81
+ const dataGroups = [group1, group2, group3];
101
82
  return buildArrayRowContent(dataGroups);
102
83
  };
103
- var getParsedRowData = exports.getParsedRowData = function getParsedRowData(rows) {
104
- return rows.map(function (rowData) {
105
- return Object.keys(rowData).reduce(function (acc, key) {
106
- var parsedData = Array.isArray(rowData[key]) ? buildArrayRowData(rowData[key]) : rowData[key];
107
- return _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2["default"])({}, key, parsedData));
108
- }, {});
84
+ const getParsedRowData = rows => rows.map(rowData => Object.keys(rowData).reduce((acc, key) => {
85
+ const parsedData = Array.isArray(rowData[key]) ? buildArrayRowData(rowData[key]) : rowData[key];
86
+ return _objectSpread(_objectSpread({}, acc), {}, {
87
+ [key]: parsedData
109
88
  });
110
- };
111
- var getColumnsAndLabels = function getColumnsAndLabels(listingProperties, allProperties, rows) {
112
- var columns = [];
113
- var labels = {};
114
- listingProperties.forEach(function (listingProperty) {
115
- var propKey = listingProperty.includes(' ') ? listingProperty.split(' ')[0] : listingProperty;
116
- var _ref2 = allProperties[propKey] || {},
117
- label = _ref2.label;
89
+ }, {}));
90
+ exports.getParsedRowData = getParsedRowData;
91
+ const getColumnsAndLabels = (listingProperties, allProperties, rows) => {
92
+ const columns = [];
93
+ const labels = {};
94
+ listingProperties.forEach(listingProperty => {
95
+ const propKey = listingProperty.includes(' ') ? listingProperty.split(' ')[0] : listingProperty;
96
+ const {
97
+ label
98
+ } = allProperties[propKey] || {};
118
99
  columns.push(propKey);
119
100
  labels[propKey] = label || getSanitizedColumnLabel(propKey);
120
101
  });
121
- var parsedRowData = getParsedRowData(rows);
102
+ const parsedRowData = getParsedRowData(rows);
122
103
  return {
123
- columns: columns,
124
- labels: labels,
125
- parsedRowData: parsedRowData
104
+ columns,
105
+ labels,
106
+ parsedRowData
126
107
  };
127
108
  };
128
- var populateRows = exports.populateRows = function populateRows(_ref3) {
129
- var toggleModal = _ref3.toggleModal,
130
- url = _ref3.url,
131
- entitySchema = _ref3.entitySchema,
132
- rows = _ref3.rows;
133
- var schemaId = entitySchema.id,
134
- listingProperties = entitySchema.listingProperties,
135
- properties = entitySchema.properties,
136
- _entitySchema$dynamic = entitySchema.dynamicProperties,
137
- dynamicProperties = _entitySchema$dynamic === void 0 ? {} : _entitySchema$dynamic,
138
- formProperties = entitySchema.formProperties;
139
- var isEnquiry = schemaId === 'enquiry';
140
- var columnOptions = !isEnquiry ? [].concat((0, _toConsumableArray2["default"])(listingProperties), [_constants.ACTIONS]) : (0, _toConsumableArray2["default"])(listingProperties);
141
- var allProperties = _objectSpread(_objectSpread({}, properties), dynamicProperties);
142
- var _getColumnsAndLabels = getColumnsAndLabels(columnOptions, allProperties, rows),
143
- columns = _getColumnsAndLabels.columns,
144
- labels = _getColumnsAndLabels.labels,
145
- parsedRowData = _getColumnsAndLabels.parsedRowData;
146
- var _columns = (0, _slicedToArray2["default"])(columns, 1),
147
- firstColumn = _columns[0];
109
+ const populateRows = ({
110
+ toggleModal,
111
+ url,
112
+ entitySchema,
113
+ rows
114
+ }) => {
115
+ const {
116
+ id: schemaId,
117
+ listingProperties,
118
+ properties,
119
+ dynamicProperties = {},
120
+ formProperties
121
+ } = entitySchema;
122
+ const isEnquiry = schemaId === 'enquiry';
123
+ const columnOptions = !isEnquiry ? [...listingProperties, _constants.ACTIONS] : [...listingProperties];
124
+ const allProperties = _objectSpread(_objectSpread({}, properties), dynamicProperties);
125
+ const {
126
+ columns,
127
+ labels,
128
+ parsedRowData
129
+ } = getColumnsAndLabels(columnOptions, allProperties, rows);
130
+ const [firstColumn] = columns;
148
131
  return {
149
132
  identification: 'id',
150
133
  sort: null,
151
- columns: columns,
152
- labels: labels,
153
- orderBy: (0, _toConsumableArray2["default"])(formProperties),
134
+ columns,
135
+ labels,
136
+ orderBy: [...formProperties],
154
137
  rows: formatRows({
155
- firstColumn: firstColumn,
138
+ firstColumn,
156
139
  rows: parsedRowData,
157
- url: url,
158
- toggleModal: toggleModal,
159
- isEnquiry: isEnquiry,
160
- entitySchema: entitySchema
140
+ url,
141
+ toggleModal,
142
+ isEnquiry,
143
+ entitySchema
161
144
  }),
162
- isEnquiry: isEnquiry
145
+ isEnquiry
163
146
  };
164
147
  };
148
+ exports.populateRows = populateRows;
165
149
  //# sourceMappingURL=populate-rows.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"populate-rows.js","names":["_react","_interopRequireDefault","require","_reactRouterDom","_pluginRenderHooksUi","_TableActions","_constants","_InfoBoxValue","_InfoBoxLabel","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","formatRows","exports","_ref","rows","url","toggleModal","label","_ref$firstColumn","firstColumn","isEnquiry","entitySchema","map","data","editUrl","concat","id","rowProps","createElement","Fragment","Link","to","role","RenderHook","hookKey","schema","value","column","actions","showDeleteModal","getSanitizedColumnLabel","columnProp","sanitizedChar","index","toUpperCase","toLowerCase","buildArrayRowContent","rowData","className","rowGroup","item","buildArrayRowData","groupSize","Math","ceil","group1","slice","group2","group3","dataGroups","getParsedRowData","reduce","acc","key","parsedData","Array","isArray","getColumnsAndLabels","listingProperties","allProperties","columns","labels","listingProperty","propKey","includes","split","_ref2","parsedRowData","populateRows","_ref3","schemaId","properties","_entitySchema$dynamic","dynamicProperties","formProperties","columnOptions","_toConsumableArray2","ACTIONS","_getColumnsAndLabels","_columns","_slicedToArray2","identification","sort","orderBy"],"sources":["../../../../src/components/ListingTable/mappers/populate-rows.js"],"sourcesContent":["import React from 'react';\nimport { Link } from 'react-router-dom';\nimport { RenderHook } from '@blaze-cms/plugin-render-hooks-ui';\nimport TableActions from '../TableActions';\nimport { ACTIONS } from '../../../constants';\nimport InfoBoxValue from '../../InfoBoxes/presentational/InfoBoxValue';\nimport InfoBoxLabel from '../../InfoBoxes/presentational/InfoBoxLabel';\n\nconst formatRows = ({\n rows,\n url,\n toggleModal,\n label,\n firstColumn = 'name',\n isEnquiry,\n entitySchema\n}) =>\n rows.map(data => {\n const editUrl = `${url}/update/${data.id}`;\n const rowProps = {\n ...data,\n [firstColumn]: (\n <>\n <Link to={editUrl} role=\"button\">\n {data[firstColumn]}\n </Link>\n <RenderHook\n hookKey=\"entity:listing:table:row:column:after\"\n schema={entitySchema}\n data={data}\n value={data[firstColumn]}\n column={firstColumn}\n />\n </>\n )\n };\n if (!isEnquiry)\n rowProps.actions = (\n <TableActions editUrl={editUrl} data={data} showDeleteModal={toggleModal} />\n );\n return rowProps;\n });\n\nconst getSanitizedColumnLabel = columnProp => {\n let sanitizedChar = '';\n\n for (let index = 0; index < columnProp.length; index += 1) {\n if (index && columnProp[index] === columnProp[index].toUpperCase())\n sanitizedChar = `${sanitizedChar} ${columnProp[index].toLowerCase()}`;\n else sanitizedChar += columnProp[index];\n }\n return sanitizedChar;\n};\n\nconst buildArrayRowContent = rowData => (\n <div className=\"table-row-list\">\n {rowData.map(rowGroup => {\n if (!rowGroup.length) return null;\n return (\n <div className=\"table-row-list__group\">\n {rowGroup.map(item => (\n <div className=\"table-row-list__group__item\">\n <span className=\"table-row-list__group__item__label\">\n <InfoBoxLabel item={item} />\n </span>\n <span className=\"table-row-list__group__item__value\">\n <InfoBoxValue item={item} />\n </span>\n </div>\n ))}\n </div>\n );\n })}\n </div>\n);\n\nconst buildArrayRowData = rowData => {\n const groupSize = Math.ceil(rowData.length / 3);\n const group1 = rowData.slice(0, groupSize);\n const group2 = rowData.slice(groupSize, groupSize * 2);\n const group3 = rowData.slice(groupSize * 2);\n const dataGroups = [group1, group2, group3];\n\n return buildArrayRowContent(dataGroups);\n};\n\nconst getParsedRowData = rows =>\n rows.map(rowData =>\n Object.keys(rowData).reduce((acc, key) => {\n const parsedData = Array.isArray(rowData[key])\n ? buildArrayRowData(rowData[key])\n : rowData[key];\n return { ...acc, [key]: parsedData };\n }, {})\n );\n\nconst getColumnsAndLabels = (listingProperties, allProperties, rows) => {\n const columns = [];\n const labels = {};\n\n listingProperties.forEach(listingProperty => {\n const propKey = listingProperty.includes(' ') ? listingProperty.split(' ')[0] : listingProperty;\n const { label } = allProperties[propKey] || {};\n columns.push(propKey);\n labels[propKey] = label || getSanitizedColumnLabel(propKey);\n });\n const parsedRowData = getParsedRowData(rows);\n\n return { columns, labels, parsedRowData };\n};\n\nconst populateRows = ({ toggleModal, url, entitySchema, rows }) => {\n const {\n id: schemaId,\n listingProperties,\n properties,\n dynamicProperties = {},\n formProperties\n } = entitySchema;\n\n const isEnquiry = schemaId === 'enquiry';\n const columnOptions = !isEnquiry ? [...listingProperties, ACTIONS] : [...listingProperties];\n\n const allProperties = { ...properties, ...dynamicProperties };\n const { columns, labels, parsedRowData } = getColumnsAndLabels(\n columnOptions,\n allProperties,\n rows\n );\n const [firstColumn] = columns;\n\n return {\n identification: 'id',\n sort: null,\n columns,\n labels,\n orderBy: [...formProperties],\n rows: formatRows({\n firstColumn,\n rows: parsedRowData,\n url,\n toggleModal,\n isEnquiry,\n entitySchema\n }),\n isEnquiry\n };\n};\n\nexport { populateRows, formatRows, getParsedRowData };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,oBAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,aAAA,GAAAP,sBAAA,CAAAC,OAAA;AAAuE,SAAAO,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAA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AAa,EACbhB,aAAa,EACbvD,IACF,CAAC;IAJOwD,OAAO,GAAAkB,oBAAA,CAAPlB,OAAO;IAAEC,MAAM,GAAAiB,oBAAA,CAANjB,MAAM;IAAEM,aAAa,GAAAW,oBAAA,CAAbX,aAAa;EAKtC,IAAAY,QAAA,OAAAC,eAAA,aAAsBpB,OAAO;IAAtBnD,WAAW,GAAAsE,QAAA;EAElB,OAAO;IACLE,cAAc,EAAE,IAAI;IACpBC,IAAI,EAAE,IAAI;IACVtB,OAAO,EAAPA,OAAO;IACPC,MAAM,EAANA,MAAM;IACNsB,OAAO,MAAAP,mBAAA,aAAMF,cAAc,CAAC;IAC5BtE,IAAI,EAAEH,UAAU,CAAC;MACfQ,WAAW,EAAXA,WAAW;MACXL,IAAI,EAAE+D,aAAa;MACnB9D,GAAG,EAAHA,GAAG;MACHC,WAAW,EAAXA,WAAW;MACXI,SAAS,EAATA,SAAS;MACTC,YAAY,EAAZA;IACF,CAAC,CAAC;IACFD,SAAS,EAATA;EACF,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"populate-rows.js","names":["_react","_interopRequireDefault","require","_reactRouterDom","_pluginRenderHooksUi","_TableActions","_constants","_InfoBoxValue","_InfoBoxLabel","_InfoBoxTooltip","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","default","getOwnPropertyDescriptors","defineProperties","defineProperty","formatRows","rows","url","toggleModal","label","firstColumn","isEnquiry","entitySchema","map","data","editUrl","id","rowProps","createElement","Fragment","Link","to","role","RenderHook","hookKey","schema","value","column","actions","showDeleteModal","exports","getSanitizedColumnLabel","columnProp","sanitizedChar","index","toUpperCase","toLowerCase","buildArrayRowContent","rowData","className","rowGroup","item","info","buildArrayRowData","groupSize","Math","ceil","group1","slice","group2","group3","dataGroups","getParsedRowData","reduce","acc","key","parsedData","Array","isArray","getColumnsAndLabels","listingProperties","allProperties","columns","labels","listingProperty","propKey","includes","split","parsedRowData","populateRows","schemaId","properties","dynamicProperties","formProperties","columnOptions","ACTIONS","identification","sort","orderBy"],"sources":["../../../../src/components/ListingTable/mappers/populate-rows.js"],"sourcesContent":["import React from 'react';\nimport { Link } from 'react-router-dom';\nimport { RenderHook } from '@blaze-cms/plugin-render-hooks-ui';\nimport TableActions from '../TableActions';\nimport { ACTIONS } from '../../../constants';\nimport InfoBoxValue from '../../InfoBoxes/presentational/InfoBoxValue';\nimport InfoBoxLabel from '../../InfoBoxes/presentational/InfoBoxLabel';\nimport InfoBoxTooltip from '../../InfoBoxes/InfoBoxTooltip';\n\nconst formatRows = ({\n rows,\n url,\n toggleModal,\n label,\n firstColumn = 'name',\n isEnquiry,\n entitySchema\n}) =>\n rows.map(data => {\n const editUrl = `${url}/update/${data.id}`;\n\n const rowProps = {\n ...data,\n [firstColumn]: (\n <>\n <Link to={editUrl} role=\"button\">\n {data[firstColumn]}\n </Link>\n <RenderHook\n hookKey=\"entity:listing:table:row:column:after\"\n schema={entitySchema}\n data={data}\n value={data[firstColumn]}\n column={firstColumn}\n />\n </>\n )\n };\n if (!isEnquiry)\n rowProps.actions = (\n <TableActions editUrl={editUrl} data={data} showDeleteModal={toggleModal} />\n );\n return rowProps;\n });\n\nconst getSanitizedColumnLabel = columnProp => {\n let sanitizedChar = '';\n\n for (let index = 0; index < columnProp.length; index += 1) {\n if (index && columnProp[index] === columnProp[index].toUpperCase())\n sanitizedChar = `${sanitizedChar} ${columnProp[index].toLowerCase()}`;\n else sanitizedChar += columnProp[index];\n }\n return sanitizedChar;\n};\n\nconst buildArrayRowContent = rowData => (\n <div className=\"table-row-list\">\n {rowData.map(rowGroup => {\n if (!rowGroup.length) return null;\n return (\n <div className=\"table-row-list__group\">\n {rowGroup.map(item => (\n <div className=\"table-row-list__group__item\">\n <span className=\"table-row-list__group__item__label\">\n <InfoBoxLabel item={item} />\n </span>\n <span className=\"table-row-list__group__item__value\">\n <InfoBoxValue item={item} />\n <InfoBoxTooltip info={item} />\n </span>\n </div>\n ))}\n </div>\n );\n })}\n </div>\n);\n\nconst buildArrayRowData = rowData => {\n const groupSize = Math.ceil(rowData.length / 3);\n const group1 = rowData.slice(0, groupSize);\n const group2 = rowData.slice(groupSize, groupSize * 2);\n const group3 = rowData.slice(groupSize * 2);\n const dataGroups = [group1, group2, group3];\n\n return buildArrayRowContent(dataGroups);\n};\n\nconst getParsedRowData = rows =>\n rows.map(rowData =>\n Object.keys(rowData).reduce((acc, key) => {\n const parsedData = Array.isArray(rowData[key])\n ? buildArrayRowData(rowData[key])\n : rowData[key];\n return { ...acc, [key]: parsedData };\n }, {})\n );\n\nconst getColumnsAndLabels = (listingProperties, allProperties, rows) => {\n const columns = [];\n const labels = {};\n\n listingProperties.forEach(listingProperty => {\n const propKey = listingProperty.includes(' ') ? listingProperty.split(' ')[0] : listingProperty;\n const { label } = allProperties[propKey] || {};\n columns.push(propKey);\n labels[propKey] = label || getSanitizedColumnLabel(propKey);\n });\n const parsedRowData = getParsedRowData(rows);\n\n return { columns, labels, parsedRowData };\n};\n\nconst populateRows = ({ toggleModal, url, entitySchema, rows }) => {\n const {\n id: schemaId,\n listingProperties,\n properties,\n dynamicProperties = {},\n formProperties\n } = entitySchema;\n\n const isEnquiry = schemaId === 'enquiry';\n const columnOptions = !isEnquiry ? [...listingProperties, ACTIONS] : [...listingProperties];\n\n const allProperties = { ...properties, ...dynamicProperties };\n const { columns, labels, parsedRowData } = getColumnsAndLabels(\n columnOptions,\n allProperties,\n rows\n );\n const [firstColumn] = columns;\n\n return {\n identification: 'id',\n sort: null,\n columns,\n labels,\n orderBy: [...formProperties],\n rows: formatRows({\n firstColumn,\n rows: parsedRowData,\n url,\n toggleModal,\n isEnquiry,\n entitySchema\n }),\n isEnquiry\n };\n};\n\nexport { populateRows, formatRows, getParsedRowData };\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,I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