@blaze-cms/plugin-data-ui 0.146.0-translations.8 → 0.147.0-rc-eagle.4

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 (211) hide show
  1. package/lib/components/EntityDataListing/EntityDataListing.js +21 -19
  2. package/lib/components/EntityDataListing/EntityDataListing.js.map +1 -1
  3. package/lib/components/EntityDataListing/index.js +2 -3
  4. package/lib/components/EntityDataListing/index.js.map +1 -1
  5. package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +18 -19
  6. package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +1 -1
  7. package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js +2 -3
  8. package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +1 -1
  9. package/lib/components/EntityManager/Entity/Entity.js +284 -457
  10. package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
  11. package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js +62 -66
  12. package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
  13. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +32 -56
  14. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
  15. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js +2 -3
  16. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +1 -1
  17. package/lib/components/EntityManager/Entity/EntityHeader/index.js +2 -3
  18. package/lib/components/EntityManager/Entity/EntityHeader/index.js.map +1 -1
  19. package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +20 -26
  20. package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +1 -1
  21. package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +20 -17
  22. package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -1
  23. package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +34 -32
  24. package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
  25. package/lib/components/EntityManager/Entity/SideBarRelations/index.js +95 -158
  26. package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
  27. package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +23 -30
  28. package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -1
  29. package/lib/components/EntityManager/Entity/actions-handlers/create/index.js +2 -3
  30. package/lib/components/EntityManager/Entity/actions-handlers/create/index.js.map +1 -1
  31. package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js +42 -56
  32. package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
  33. package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js +29 -45
  34. package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
  35. package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js +2 -3
  36. package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js.map +1 -1
  37. package/lib/components/EntityManager/Entity/actions-handlers/index.js +7 -8
  38. package/lib/components/EntityManager/Entity/actions-handlers/index.js.map +1 -1
  39. package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js +2 -3
  40. package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js.map +1 -1
  41. package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js +36 -57
  42. package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
  43. package/lib/components/EntityManager/Entity/actions-handlers/update/index.js +2 -3
  44. package/lib/components/EntityManager/Entity/actions-handlers/update/index.js.map +1 -1
  45. package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js +47 -66
  46. package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
  47. package/lib/components/EntityManager/Entity/index.js +2 -3
  48. package/lib/components/EntityManager/Entity/index.js.map +1 -1
  49. package/lib/components/EntityManager/EntityManager.js +91 -166
  50. package/lib/components/EntityManager/EntityManager.js.map +1 -1
  51. package/lib/components/EntityManager/index.js +2 -3
  52. package/lib/components/EntityManager/index.js.map +1 -1
  53. package/lib/components/EntityManager/utils/RecordEditContext/index.js +3 -4
  54. package/lib/components/EntityManager/utils/RecordEditContext/index.js.map +1 -1
  55. package/lib/components/EntityManager/utils/data-mappers.js +34 -46
  56. package/lib/components/EntityManager/utils/data-mappers.js.map +1 -1
  57. package/lib/components/EntityManager/utils/entity.js +35 -80
  58. package/lib/components/EntityManager/utils/entity.js.map +1 -1
  59. package/lib/components/EntityManager/utils/entityAvailableActions.js +51 -110
  60. package/lib/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
  61. package/lib/components/EntityManager/utils/is-form-empty.js +6 -10
  62. package/lib/components/EntityManager/utils/is-form-empty.js.map +1 -1
  63. package/lib/components/EntityManager/utils/query.js +17 -10
  64. package/lib/components/EntityManager/utils/query.js.map +1 -1
  65. package/lib/components/InfoBoxes/InfoBoxTooltip.js +19 -16
  66. package/lib/components/InfoBoxes/InfoBoxTooltip.js.map +1 -1
  67. package/lib/components/InfoBoxes/InfoBoxes.js +19 -19
  68. package/lib/components/InfoBoxes/InfoBoxes.js.map +1 -1
  69. package/lib/components/InfoBoxes/container/InfoBoxContainer.js +26 -38
  70. package/lib/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
  71. package/lib/components/InfoBoxes/helpers/build-dynamic-query.js +21 -16
  72. package/lib/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -1
  73. package/lib/components/InfoBoxes/hooks/useData.js +33 -30
  74. package/lib/components/InfoBoxes/hooks/useData.js.map +1 -1
  75. package/lib/components/InfoBoxes/hooks/useInfoBox.js +10 -10
  76. package/lib/components/InfoBoxes/hooks/useInfoBox.js.map +1 -1
  77. package/lib/components/InfoBoxes/index.js +2 -3
  78. package/lib/components/InfoBoxes/index.js.map +1 -1
  79. package/lib/components/InfoBoxes/presentational/InfoBox.js +27 -34
  80. package/lib/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
  81. package/lib/components/InfoBoxes/presentational/InfoBoxLabel.js +11 -12
  82. package/lib/components/InfoBoxes/presentational/InfoBoxLabel.js.map +1 -1
  83. package/lib/components/InfoBoxes/presentational/InfoBoxValue.js +12 -12
  84. package/lib/components/InfoBoxes/presentational/InfoBoxValue.js.map +1 -1
  85. package/lib/components/ListingTable/ListingTable.js +155 -296
  86. package/lib/components/ListingTable/ListingTable.js.map +1 -1
  87. package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js +53 -58
  88. package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
  89. package/lib/components/ListingTable/ListingTableContent/index.js +2 -3
  90. package/lib/components/ListingTable/ListingTableContent/index.js.map +1 -1
  91. package/lib/components/ListingTable/SearchFilter/SearchContainer.js +436 -262
  92. package/lib/components/ListingTable/SearchFilter/SearchContainer.js.map +1 -1
  93. package/lib/components/ListingTable/SearchFilter/SearchFilter.js +30 -37
  94. package/lib/components/ListingTable/SearchFilter/SearchFilter.js.map +1 -1
  95. package/lib/components/ListingTable/SearchFilter/helpers.js +82 -71
  96. package/lib/components/ListingTable/SearchFilter/helpers.js.map +1 -1
  97. package/lib/components/ListingTable/SearchFilter/querys.js +5 -5
  98. package/lib/components/ListingTable/SearchFilter/querys.js.map +1 -1
  99. package/lib/components/ListingTable/TableActions/TableActions.js +27 -31
  100. package/lib/components/ListingTable/TableActions/TableActions.js.map +1 -1
  101. package/lib/components/ListingTable/TableActions/index.js +2 -3
  102. package/lib/components/ListingTable/TableActions/index.js.map +1 -1
  103. package/lib/components/ListingTable/index.js +2 -3
  104. package/lib/components/ListingTable/index.js.map +1 -1
  105. package/lib/components/ListingTable/mappers/populate-rows.js +103 -122
  106. package/lib/components/ListingTable/mappers/populate-rows.js.map +1 -1
  107. package/lib/components/ListingTable/service/index.js +66 -83
  108. package/lib/components/ListingTable/service/index.js.map +1 -1
  109. package/lib/components/Tabs/index.js +26 -42
  110. package/lib/components/Tabs/index.js.map +1 -1
  111. package/lib/components/hooks/useCallbackDebounce.js +5 -9
  112. package/lib/components/hooks/useCallbackDebounce.js.map +1 -1
  113. package/lib/constants.js +30 -31
  114. package/lib/constants.js.map +1 -1
  115. package/lib/icons/ContentIcon.js +17 -20
  116. package/lib/icons/ContentIcon.js.map +1 -1
  117. package/lib/icons/SettingsIcon.js +12 -15
  118. package/lib/icons/SettingsIcon.js.map +1 -1
  119. package/lib/icons/TaxonomyIcon.js +15 -18
  120. package/lib/icons/TaxonomyIcon.js.map +1 -1
  121. package/lib/icons/UsersIcon.js +11 -14
  122. package/lib/icons/UsersIcon.js.map +1 -1
  123. package/lib/icons/index.js +8 -9
  124. package/lib/icons/index.js.map +1 -1
  125. package/lib/index.js +88 -121
  126. package/lib/index.js.map +1 -1
  127. package/lib/utils/add-content-menu-items.js +67 -93
  128. package/lib/utils/add-content-menu-items.js.map +1 -1
  129. package/lib/utils/build-create-entity-mutation.js +12 -9
  130. package/lib/utils/build-create-entity-mutation.js.map +1 -1
  131. package/lib/utils/build-delete-entity-mutation.js +11 -8
  132. package/lib/utils/build-delete-entity-mutation.js.map +1 -1
  133. package/lib/utils/build-listing-query.js +17 -14
  134. package/lib/utils/build-listing-query.js.map +1 -1
  135. package/lib/utils/build-update-data-query.js +15 -9
  136. package/lib/utils/build-update-data-query.js.map +1 -1
  137. package/lib/utils/build-update-publish-unpublish-mutation.js +15 -8
  138. package/lib/utils/build-update-publish-unpublish-mutation.js.map +1 -1
  139. package/lib/utils/get-default-query-params.js +7 -6
  140. package/lib/utils/get-default-query-params.js.map +1 -1
  141. package/lib/utils/hoc/withContext.js +4 -6
  142. package/lib/utils/hoc/withContext.js.map +1 -1
  143. package/lib/utils/hooks/useToggle.js +4 -12
  144. package/lib/utils/hooks/useToggle.js.map +1 -1
  145. package/lib/utils/index.js +2 -3
  146. package/lib/utils/index.js.map +1 -1
  147. package/lib-es/components/EntityManager/Entity/Entity.js +8 -20
  148. package/lib-es/components/EntityManager/Entity/Entity.js.map +1 -1
  149. package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
  150. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
  151. package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -1
  152. package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
  153. package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js +6 -3
  154. package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
  155. package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -1
  156. package/lib-es/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
  157. package/lib-es/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
  158. package/lib-es/components/EntityManager/EntityManager.js.map +1 -1
  159. package/lib-es/components/EntityManager/utils/entity.js.map +1 -1
  160. package/lib-es/components/EntityManager/utils/query.js.map +1 -1
  161. package/lib-es/components/InfoBoxes/InfoBoxTooltip.js.map +1 -1
  162. package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
  163. package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -1
  164. package/lib-es/components/InfoBoxes/hooks/useData.js.map +1 -1
  165. package/lib-es/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
  166. package/lib-es/components/InfoBoxes/presentational/InfoBoxLabel.js.map +1 -1
  167. package/lib-es/components/ListingTable/ListingTable.js +2 -2
  168. package/lib-es/components/ListingTable/ListingTable.js.map +1 -1
  169. package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js +20 -17
  170. package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
  171. package/lib-es/components/ListingTable/SearchFilter/SearchContainer.js +323 -51
  172. package/lib-es/components/ListingTable/SearchFilter/SearchContainer.js.map +1 -1
  173. package/lib-es/components/ListingTable/SearchFilter/SearchFilter.js +7 -3
  174. package/lib-es/components/ListingTable/SearchFilter/SearchFilter.js.map +1 -1
  175. package/lib-es/components/ListingTable/SearchFilter/helpers.js +39 -8
  176. package/lib-es/components/ListingTable/SearchFilter/helpers.js.map +1 -1
  177. package/lib-es/components/ListingTable/SearchFilter/querys.js.map +1 -1
  178. package/lib-es/components/ListingTable/mappers/populate-rows.js.map +1 -1
  179. package/lib-es/components/ListingTable/service/index.js.map +1 -1
  180. package/lib-es/components/Tabs/index.js +6 -7
  181. package/lib-es/components/Tabs/index.js.map +1 -1
  182. package/lib-es/index.js +12 -3
  183. package/lib-es/index.js.map +1 -1
  184. package/lib-es/utils/add-content-menu-items.js.map +1 -1
  185. package/lib-es/utils/build-create-entity-mutation.js.map +1 -1
  186. package/lib-es/utils/build-delete-entity-mutation.js.map +1 -1
  187. package/lib-es/utils/build-listing-query.js.map +1 -1
  188. package/lib-es/utils/build-update-data-query.js.map +1 -1
  189. package/lib-es/utils/build-update-publish-unpublish-mutation.js.map +1 -1
  190. package/lib-es/utils/hoc/withContext.js +1 -1
  191. package/lib-es/utils/hoc/withContext.js.map +1 -1
  192. package/package.json +27 -22
  193. package/src/components/EntityManager/Entity/Entity.js +59 -77
  194. package/src/components/EntityManager/Entity/EntityHeader/EntityHeader.js +1 -2
  195. package/src/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +9 -7
  196. package/src/components/EntityManager/Entity/SideBarRelations/index.js +64 -59
  197. package/src/components/EntityManager/EntityManager.js +52 -45
  198. package/src/components/InfoBoxes/container/InfoBoxContainer.js +3 -6
  199. package/src/components/InfoBoxes/hooks/useData.js +6 -1
  200. package/src/components/ListingTable/ListingTable.js +13 -21
  201. package/src/components/ListingTable/ListingTableContent/ListingTableContent.js +38 -44
  202. package/src/components/ListingTable/SearchFilter/SearchContainer.js +411 -134
  203. package/src/components/ListingTable/SearchFilter/SearchFilter.js +5 -2
  204. package/src/components/ListingTable/SearchFilter/helpers.js +56 -8
  205. package/src/components/ListingTable/service/index.js +2 -3
  206. package/src/components/Tabs/index.js +17 -21
  207. package/src/index.js +11 -7
  208. package/src/utils/hoc/withContext.js +5 -4
  209. package/CHANGELOG.md +0 -1947
  210. package/babel.config.js +0 -3
  211. package/jest.config.js +0 -5
@@ -1,23 +1,30 @@
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
7
  exports.getAction = void 0;
9
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
10
- require("core-js/modules/es.array.concat.js");
11
8
  var _client = require("@apollo/client");
12
9
  var _lodash = _interopRequireDefault(require("lodash.upperfirst"));
13
- var _templateObject;
14
- var generateQuery = function generateQuery(action, props) {
15
- return "\n query getEntityData(\n $where: JSON\n $limit: Int\n $offset: Int\n $sort: [".concat((0, _lodash["default"])(action), "SortItem]){\n ").concat(action, " (where: $where, limit: $limit, offset: $offset, sort: $sort){\n ").concat(props, "\n }\n }\n ");
16
- };
10
+ const generateQuery = (action, props) => `
11
+ query getEntityData(
12
+ $where: JSON
13
+ $limit: Int
14
+ $offset: Int
15
+ $sort: [${(0, _lodash.default)(action)}SortItem]){
16
+ ${action} (where: $where, limit: $limit, offset: $offset, sort: $sort){
17
+ ${props}
18
+ }
19
+ }
20
+ `;
17
21
 
18
22
  // TODO: extend function to handle properties and make them dynamic with a config schema for each entity.
19
- var getAction = exports.getAction = function getAction(action, props) {
20
- var query = generateQuery(action, props);
21
- return (0, _client.gql)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n ", "\n "])), query);
23
+ const getAction = (action, props) => {
24
+ const query = generateQuery(action, props);
25
+ return (0, _client.gql)`
26
+ ${query}
27
+ `;
22
28
  };
29
+ exports.getAction = getAction;
23
30
  //# sourceMappingURL=query.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"query.js","names":["_client","require","_lodash","_interopRequireDefault","_templateObject","generateQuery","action","props","concat","upperFirst","getAction","exports","query","gql","_taggedTemplateLiteral2"],"sources":["../../../../src/components/EntityManager/utils/query.js"],"sourcesContent":["import { gql } from '@apollo/client';\nimport upperFirst from 'lodash.upperfirst';\n\nconst generateQuery = (action, props) => `\n query getEntityData(\n $where: JSON\n $limit: Int\n $offset: Int\n $sort: [${upperFirst(action)}SortItem]){\n ${action} (where: $where, limit: $limit, offset: $offset, sort: $sort){\n ${props}\n }\n }\n `;\n\n// TODO: extend function to handle properties and make them dynamic with a config schema for each entity.\nconst getAction = (action, props) => {\n const query = generateQuery(action, props);\n return gql`\n ${query}\n `;\n};\n\nexport { getAction };\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA2C,IAAAG,eAAA;AAE3C,IAAMC,aAAa,GAAG,SAAhBA,aAAaA,CAAIC,MAAM,EAAEC,KAAK;EAAA,qGAAAC,MAAA,CAKtB,IAAAC,kBAAU,EAACH,MAAM,CAAC,uBAAAE,MAAA,CAC1BF,MAAM,4EAAAE,MAAA,CACJD,KAAK;AAAA,CAGV;;AAEH;AACA,IAAMG,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,SAAZA,SAASA,CAAIJ,MAAM,EAAEC,KAAK,EAAK;EACnC,IAAMK,KAAK,GAAGP,aAAa,CAACC,MAAM,EAAEC,KAAK,CAAC;EAC1C,WAAOM,WAAG,EAAAT,eAAA,KAAAA,eAAA,OAAAU,uBAAA,mCACNF,KAAK;AAEX,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"query.js","names":["_client","require","_lodash","_interopRequireDefault","generateQuery","action","props","upperFirst","getAction","query","gql","exports"],"sources":["../../../../src/components/EntityManager/utils/query.js"],"sourcesContent":["import { gql } from '@apollo/client';\nimport upperFirst from 'lodash.upperfirst';\n\nconst generateQuery = (action, props) => `\n query getEntityData(\n $where: JSON\n $limit: Int\n $offset: Int\n $sort: [${upperFirst(action)}SortItem]){\n ${action} (where: $where, limit: $limit, offset: $offset, sort: $sort){\n ${props}\n }\n }\n `;\n\n// TODO: extend function to handle properties and make them dynamic with a config schema for each entity.\nconst getAction = (action, props) => {\n const query = generateQuery(action, props);\n return gql`\n ${query}\n `;\n};\n\nexport { getAction };\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,MAAMG,aAAa,GAAGA,CAACC,MAAM,EAAEC,KAAK,KAAK;AACzC;AACA;AACA;AACA;AACA,cAAc,IAAAC,eAAU,EAACF,MAAM,CAAC;AAChC,MAAMA,MAAM;AACZ,QAAQC,KAAK;AACb;AACA;AACA,GAAG;;AAEH;AACA,MAAME,SAAS,GAAGA,CAACH,MAAM,EAAEC,KAAK,KAAK;EACnC,MAAMG,KAAK,GAAGL,aAAa,CAACC,MAAM,EAAEC,KAAK,CAAC;EAC1C,OAAO,IAAAI,WAAG;AACZ,MAAMD,KAAK;AACX,GAAG;AACH,CAAC;AAACE,OAAA,CAAAH,SAAA,GAAAA,SAAA","ignoreList":[]}
@@ -1,40 +1,43 @@
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 _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
10
  var _react = _interopRequireDefault(require("react"));
12
11
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
12
  var _tooltip = _interopRequireDefault(require("@blaze-react/tooltip"));
14
- var _excluded = ["info"];
15
- var InfoBoxTooltip = function InfoBoxTooltip(_ref) {
16
- var info = _ref.info,
17
- tooltipProps = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
18
- var tooltipContent = info.tooltipContent,
19
- tooltipIcon = info.tooltipIcon;
13
+ const _excluded = ["info"];
14
+ const InfoBoxTooltip = _ref => {
15
+ let {
16
+ info
17
+ } = _ref,
18
+ tooltipProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
19
+ const {
20
+ tooltipContent,
21
+ tooltipIcon
22
+ } = info;
20
23
  if (!tooltipContent) return null;
21
- var renderTooltipIcon = function renderTooltipIcon(icon) {
24
+ const renderTooltipIcon = icon => {
22
25
  if (!icon) return null;
23
- return /*#__PURE__*/_react["default"].createElement("i", {
24
- className: "".concat(icon, " info-box--icon")
26
+ return /*#__PURE__*/_react.default.createElement("i", {
27
+ className: `${icon} info-box--icon`
25
28
  });
26
29
  };
27
- return /*#__PURE__*/_react["default"].createElement(_tooltip["default"], (0, _extends2["default"])({
30
+ return /*#__PURE__*/_react.default.createElement(_tooltip.default, (0, _extends2.default)({
28
31
  tooltipContent: tooltipContent,
29
32
  trigger: "click",
30
33
  className: "info-box--tooltip"
31
34
  }, tooltipProps), renderTooltipIcon(tooltipIcon));
32
35
  };
33
36
  InfoBoxTooltip.propTypes = {
34
- info: _propTypes["default"].shape({
35
- tooltipContent: _propTypes["default"].node,
36
- tooltipIcon: _propTypes["default"].string
37
+ info: _propTypes.default.shape({
38
+ tooltipContent: _propTypes.default.node,
39
+ tooltipIcon: _propTypes.default.string
37
40
  }).isRequired
38
41
  };
39
- var _default = exports["default"] = InfoBoxTooltip;
42
+ var _default = exports.default = InfoBoxTooltip;
40
43
  //# sourceMappingURL=InfoBoxTooltip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InfoBoxTooltip.js","names":["_react","_interopRequireDefault","require","_propTypes","_tooltip","_excluded","InfoBoxTooltip","_ref","info","tooltipProps","_objectWithoutProperties2","tooltipContent","tooltipIcon","renderTooltipIcon","icon","createElement","className","concat","_extends2","trigger","propTypes","PropTypes","shape","node","string","isRequired","_default","exports"],"sources":["../../../src/components/InfoBoxes/InfoBoxTooltip.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Tooltip from '@blaze-react/tooltip';\n\nconst InfoBoxTooltip = ({ info, ...tooltipProps }) => {\n const { tooltipContent, tooltipIcon } = info;\n if (!tooltipContent) return null;\n\n const renderTooltipIcon = icon => {\n if (!icon) return null;\n return <i className={`${icon} info-box--icon`} />;\n };\n\n return (\n <Tooltip\n tooltipContent={tooltipContent}\n trigger=\"click\"\n className=\"info-box--tooltip\"\n {...tooltipProps}>\n {renderTooltipIcon(tooltipIcon)}\n </Tooltip>\n );\n};\n\nInfoBoxTooltip.propTypes = {\n info: PropTypes.shape({\n tooltipContent: PropTypes.node,\n tooltipIcon: PropTypes.string\n }).isRequired\n};\n\nexport default InfoBoxTooltip;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAH,sBAAA,CAAAC,OAAA;AAA2C,IAAAG,SAAA;AAE3C,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,CAAAC,IAAA,EAAkC;EAAA,IAA5BC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IAAKC,YAAY,OAAAC,yBAAA,aAAAH,IAAA,EAAAF,SAAA;EAC7C,IAAQM,cAAc,GAAkBH,IAAI,CAApCG,cAAc;IAAEC,WAAW,GAAKJ,IAAI,CAApBI,WAAW;EACnC,IAAI,CAACD,cAAc,EAAE,OAAO,IAAI;EAEhC,IAAME,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAGC,IAAI,EAAI;IAChC,IAAI,CAACA,IAAI,EAAE,OAAO,IAAI;IACtB,oBAAOd,MAAA,YAAAe,aAAA;MAAGC,SAAS,KAAAC,MAAA,CAAKH,IAAI;IAAkB,CAAE,CAAC;EACnD,CAAC;EAED,oBACEd,MAAA,YAAAe,aAAA,CAACX,QAAA,WAAO,MAAAc,SAAA;IACNP,cAAc,EAAEA,cAAe;IAC/BQ,OAAO,EAAC,OAAO;IACfH,SAAS,EAAC;EAAmB,GACzBP,YAAY,GACfI,iBAAiB,CAACD,WAAW,CACvB,CAAC;AAEd,CAAC;AAEDN,cAAc,CAACc,SAAS,GAAG;EACzBZ,IAAI,EAAEa,qBAAS,CAACC,KAAK,CAAC;IACpBX,cAAc,EAAEU,qBAAS,CAACE,IAAI;IAC9BX,WAAW,EAAES,qBAAS,CAACG;EACzB,CAAC,CAAC,CAACC;AACL,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEarB,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"InfoBoxTooltip.js","names":["_react","_interopRequireDefault","require","_propTypes","_tooltip","_excluded","InfoBoxTooltip","_ref","info","tooltipProps","_objectWithoutProperties2","default","tooltipContent","tooltipIcon","renderTooltipIcon","icon","createElement","className","_extends2","trigger","propTypes","PropTypes","shape","node","string","isRequired","_default","exports"],"sources":["../../../src/components/InfoBoxes/InfoBoxTooltip.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Tooltip from '@blaze-react/tooltip';\n\nconst InfoBoxTooltip = ({ info, ...tooltipProps }) => {\n const { tooltipContent, tooltipIcon } = info;\n if (!tooltipContent) return null;\n\n const renderTooltipIcon = icon => {\n if (!icon) return null;\n return <i className={`${icon} info-box--icon`} />;\n };\n\n return (\n <Tooltip\n tooltipContent={tooltipContent}\n trigger=\"click\"\n className=\"info-box--tooltip\"\n {...tooltipProps}>\n {renderTooltipIcon(tooltipIcon)}\n </Tooltip>\n );\n};\n\nInfoBoxTooltip.propTypes = {\n info: PropTypes.shape({\n tooltipContent: PropTypes.node,\n tooltipIcon: PropTypes.string\n }).isRequired\n};\n\nexport default InfoBoxTooltip;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAH,sBAAA,CAAAC,OAAA;AAA2C,MAAAG,SAAA;AAE3C,MAAMC,cAAc,GAAGC,IAAA,IAA+B;EAAA,IAA9B;MAAEC;IAAsB,CAAC,GAAAD,IAAA;IAAdE,YAAY,OAAAC,yBAAA,CAAAC,OAAA,EAAAJ,IAAA,EAAAF,SAAA;EAC7C,MAAM;IAAEO,cAAc;IAAEC;EAAY,CAAC,GAAGL,IAAI;EAC5C,IAAI,CAACI,cAAc,EAAE,OAAO,IAAI;EAEhC,MAAME,iBAAiB,GAAGC,IAAI,IAAI;IAChC,IAAI,CAACA,IAAI,EAAE,OAAO,IAAI;IACtB,oBAAOf,MAAA,CAAAW,OAAA,CAAAK,aAAA;MAAGC,SAAS,EAAE,GAAGF,IAAI;IAAkB,CAAE,CAAC;EACnD,CAAC;EAED,oBACEf,MAAA,CAAAW,OAAA,CAAAK,aAAA,CAACZ,QAAA,CAAAO,OAAO,MAAAO,SAAA,CAAAP,OAAA;IACNC,cAAc,EAAEA,cAAe;IAC/BO,OAAO,EAAC,OAAO;IACfF,SAAS,EAAC;EAAmB,GACzBR,YAAY,GACfK,iBAAiB,CAACD,WAAW,CACvB,CAAC;AAEd,CAAC;AAEDP,cAAc,CAACc,SAAS,GAAG;EACzBZ,IAAI,EAAEa,kBAAS,CAACC,KAAK,CAAC;IACpBV,cAAc,EAAES,kBAAS,CAACE,IAAI;IAC9BV,WAAW,EAAEQ,kBAAS,CAACG;EACzB,CAAC,CAAC,CAACC;AACL,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAhB,OAAA,GAEaL,cAAc","ignoreList":[]}
@@ -1,35 +1,35 @@
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;
9
- require("core-js/modules/es.array.map.js");
7
+ exports.default = void 0;
10
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
9
  var _react = _interopRequireDefault(require("react"));
12
10
  var _InfoBoxContainer = _interopRequireDefault(require("./container/InfoBoxContainer"));
13
- var InfoBoxes = function InfoBoxes(_ref) {
14
- var id = _ref.id,
15
- schema = _ref.schema;
16
- var _schema$displayProper = schema.displayProperties.adminInfoBoxes,
17
- adminInfoBoxes = _schema$displayProper === void 0 ? [] : _schema$displayProper;
11
+ const InfoBoxes = ({
12
+ id,
13
+ schema
14
+ }) => {
15
+ const {
16
+ displayProperties: {
17
+ adminInfoBoxes = []
18
+ }
19
+ } = schema;
18
20
  if (adminInfoBoxes.length <= 0) {
19
21
  return null;
20
22
  }
21
- return adminInfoBoxes.map(function (infoBox) {
22
- return /*#__PURE__*/_react["default"].createElement(_InfoBoxContainer["default"], {
23
- id: id,
24
- schema: schema,
25
- key: infoBox.key,
26
- infoBox: infoBox
27
- });
28
- });
23
+ return adminInfoBoxes.map(infoBox => /*#__PURE__*/_react.default.createElement(_InfoBoxContainer.default, {
24
+ id: id,
25
+ schema: schema,
26
+ key: infoBox.key,
27
+ infoBox: infoBox
28
+ }));
29
29
  };
30
- var _default = exports["default"] = InfoBoxes;
30
+ var _default = exports.default = InfoBoxes;
31
31
  InfoBoxes.propTypes = {
32
- id: _propTypes["default"].string.isRequired,
33
- schema: _propTypes["default"].object.isRequired
32
+ id: _propTypes.default.string.isRequired,
33
+ schema: _propTypes.default.object.isRequired
34
34
  };
35
35
  //# sourceMappingURL=InfoBoxes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InfoBoxes.js","names":["_propTypes","_interopRequireDefault","require","_react","_InfoBoxContainer","InfoBoxes","_ref","id","schema","_schema$displayProper","displayProperties","adminInfoBoxes","length","map","infoBox","createElement","key","_default","exports","propTypes","PropTypes","string","isRequired","object"],"sources":["../../../src/components/InfoBoxes/InfoBoxes.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\nimport InfoBoxContainer from './container/InfoBoxContainer';\n\nconst InfoBoxes = ({ id, schema }) => {\n const {\n displayProperties: { adminInfoBoxes = [] }\n } = schema;\n\n if (adminInfoBoxes.length <= 0) {\n return null;\n }\n\n return adminInfoBoxes.map(infoBox => (\n <InfoBoxContainer id={id} schema={schema} key={infoBox.key} infoBox={infoBox} />\n ));\n};\n\nexport default InfoBoxes;\n\nInfoBoxes.propTypes = {\n id: PropTypes.string.isRequired,\n schema: PropTypes.object.isRequired\n};\n"],"mappings":";;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,iBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAMG,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAAuB;EAAA,IAAjBC,EAAE,GAAAD,IAAA,CAAFC,EAAE;IAAEC,MAAM,GAAAF,IAAA,CAANE,MAAM;EAC7B,IAAAC,qBAAA,GAEID,MAAM,CADRE,iBAAiB,CAAIC,cAAc;IAAdA,cAAc,GAAAF,qBAAA,cAAG,EAAE,GAAAA,qBAAA;EAG1C,IAAIE,cAAc,CAACC,MAAM,IAAI,CAAC,EAAE;IAC9B,OAAO,IAAI;EACb;EAEA,OAAOD,cAAc,CAACE,GAAG,CAAC,UAAAC,OAAO;IAAA,oBAC/BX,MAAA,YAAAY,aAAA,CAACX,iBAAA,WAAgB;MAACG,EAAE,EAAEA,EAAG;MAACC,MAAM,EAAEA,MAAO;MAACQ,GAAG,EAAEF,OAAO,CAACE,GAAI;MAACF,OAAO,EAAEA;IAAQ,CAAE,CAAC;EAAA,CACjF,CAAC;AACJ,CAAC;AAAC,IAAAG,QAAA,GAAAC,OAAA,cAEab,SAAS;AAExBA,SAAS,CAACc,SAAS,GAAG;EACpBZ,EAAE,EAAEa,qBAAS,CAACC,MAAM,CAACC,UAAU;EAC/Bd,MAAM,EAAEY,qBAAS,CAACG,MAAM,CAACD;AAC3B,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"InfoBoxes.js","names":["_propTypes","_interopRequireDefault","require","_react","_InfoBoxContainer","InfoBoxes","id","schema","displayProperties","adminInfoBoxes","length","map","infoBox","default","createElement","key","_default","exports","propTypes","PropTypes","string","isRequired","object"],"sources":["../../../src/components/InfoBoxes/InfoBoxes.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\nimport InfoBoxContainer from './container/InfoBoxContainer';\n\nconst InfoBoxes = ({ id, schema }) => {\n const {\n displayProperties: { adminInfoBoxes = [] }\n } = schema;\n\n if (adminInfoBoxes.length <= 0) {\n return null;\n }\n\n return adminInfoBoxes.map(infoBox => (\n <InfoBoxContainer id={id} schema={schema} key={infoBox.key} infoBox={infoBox} />\n ));\n};\n\nexport default InfoBoxes;\n\nInfoBoxes.propTypes = {\n id: PropTypes.string.isRequired,\n schema: PropTypes.object.isRequired\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,iBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,MAAMG,SAAS,GAAGA,CAAC;EAAEC,EAAE;EAAEC;AAAO,CAAC,KAAK;EACpC,MAAM;IACJC,iBAAiB,EAAE;MAAEC,cAAc,GAAG;IAAG;EAC3C,CAAC,GAAGF,MAAM;EAEV,IAAIE,cAAc,CAACC,MAAM,IAAI,CAAC,EAAE;IAC9B,OAAO,IAAI;EACb;EAEA,OAAOD,cAAc,CAACE,GAAG,CAACC,OAAO,iBAC/BT,MAAA,CAAAU,OAAA,CAAAC,aAAA,CAACV,iBAAA,CAAAS,OAAgB;IAACP,EAAE,EAAEA,EAAG;IAACC,MAAM,EAAEA,MAAO;IAACQ,GAAG,EAAEH,OAAO,CAACG,GAAI;IAACH,OAAO,EAAEA;EAAQ,CAAE,CAChF,CAAC;AACJ,CAAC;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAAJ,OAAA,GAEaR,SAAS;AAExBA,SAAS,CAACa,SAAS,GAAG;EACpBZ,EAAE,EAAEa,kBAAS,CAACC,MAAM,CAACC,UAAU;EAC/Bd,MAAM,EAAEY,kBAAS,CAACG,MAAM,CAACD;AAC3B,CAAC","ignoreList":[]}
@@ -1,58 +1,46 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.array.iterator.js");
4
- require("core-js/modules/es.object.define-property.js");
5
- require("core-js/modules/es.object.get-own-property-descriptor.js");
6
- require("core-js/modules/es.string.iterator.js");
7
- require("core-js/modules/es.weak-map.js");
8
- require("core-js/modules/web.dom-collections.iterator.js");
9
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
10
- var _typeof = require("@babel/runtime/helpers/typeof");
11
4
  Object.defineProperty(exports, "__esModule", {
12
5
  value: true
13
6
  });
14
- exports["default"] = void 0;
15
- require("core-js/modules/es.array.flat-map.js");
16
- require("core-js/modules/es.array.unscopables.flat-map.js");
17
- require("core-js/modules/es.object.keys.js");
18
- require("core-js/modules/es.object.to-string.js");
19
- require("core-js/modules/es.object.values.js");
7
+ exports.default = void 0;
20
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
21
9
  var _react = _interopRequireWildcard(require("react"));
22
- var _useData2 = _interopRequireDefault(require("../hooks/useData"));
10
+ var _useData = _interopRequireDefault(require("../hooks/useData"));
23
11
  var _InfoBox = _interopRequireDefault(require("../presentational/InfoBox"));
24
12
  var _RecordEditContext = require("../../EntityManager/utils/RecordEditContext");
25
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
26
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
27
- var InfoBoxContainer = function InfoBoxContainer(_ref) {
28
- var id = _ref.id,
29
- schema = _ref.schema,
30
- infoBox = _ref.infoBox;
31
- var _useContext = (0, _react.useContext)(_RecordEditContext.RecordEditContext),
32
- externalUpdateTime = _useContext.externalUpdateTime;
33
- var _useData = (0, _useData2["default"])({
34
- id: id,
35
- schema: schema,
36
- infoBox: infoBox
37
- }),
38
- data = _useData.data,
39
- refetch = _useData.refetch;
40
- (0, _react.useEffect)(function () {
13
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
14
+ const InfoBoxContainer = ({
15
+ id,
16
+ schema,
17
+ infoBox
18
+ }) => {
19
+ const {
20
+ externalUpdateTime
21
+ } = (0, _react.useContext)(_RecordEditContext.RecordEditContext);
22
+ const {
23
+ data,
24
+ refetch
25
+ } = (0, _useData.default)({
26
+ id,
27
+ schema,
28
+ infoBox
29
+ });
30
+ (0, _react.useEffect)(() => {
41
31
  refetch();
42
32
  }, [externalUpdateTime, refetch]);
43
33
  if (!data || !Object.keys(data) || Object.keys(data).length === 0) return null;
44
- var items = Object.values(data).flatMap(function (item) {
45
- return Object.values(item);
46
- });
47
- return /*#__PURE__*/_react["default"].createElement(_InfoBox["default"], {
34
+ const items = Object.values(data).flatMap(item => Object.values(item));
35
+ return /*#__PURE__*/_react.default.createElement(_InfoBox.default, {
48
36
  items: items,
49
37
  infoBoxKey: infoBox.key
50
38
  });
51
39
  };
52
- var _default = exports["default"] = InfoBoxContainer;
40
+ var _default = exports.default = InfoBoxContainer;
53
41
  InfoBoxContainer.propTypes = {
54
- id: _propTypes["default"].string.isRequired,
55
- infoBox: _propTypes["default"].object.isRequired,
56
- schema: _propTypes["default"].object.isRequired
42
+ id: _propTypes.default.string.isRequired,
43
+ infoBox: _propTypes.default.object.isRequired,
44
+ schema: _propTypes.default.object.isRequired
57
45
  };
58
46
  //# sourceMappingURL=InfoBoxContainer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InfoBoxContainer.js","names":["_propTypes","_interopRequireDefault","require","_react","_interopRequireWildcard","_useData2","_InfoBox","_RecordEditContext","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","InfoBoxContainer","_ref","id","schema","infoBox","_useContext","useContext","RecordEditContext","externalUpdateTime","_useData","useData","data","refetch","useEffect","keys","length","items","values","flatMap","item","createElement","infoBoxKey","key","_default","exports","propTypes","PropTypes","string","isRequired","object"],"sources":["../../../../src/components/InfoBoxes/container/InfoBoxContainer.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useContext, useEffect } from 'react';\nimport useData from '../hooks/useData';\nimport InfoBox from '../presentational/InfoBox';\nimport { RecordEditContext } from '../../EntityManager/utils/RecordEditContext';\n\nconst InfoBoxContainer = ({ id, schema, infoBox }) => {\n const { externalUpdateTime } = useContext(RecordEditContext);\n\n const { data, refetch } = useData({ id, schema, infoBox });\n\n useEffect(\n () => {\n refetch();\n },\n [externalUpdateTime, refetch]\n );\n\n if (!data || !Object.keys(data) || Object.keys(data).length === 0) return null;\n\n const items = Object.values(data).flatMap(item => Object.values(item));\n\n return <InfoBox items={items} infoBoxKey={infoBox.key} />;\n};\n\nexport default InfoBoxContainer;\n\nInfoBoxContainer.propTypes = {\n id: PropTypes.string.isRequired,\n infoBox: PropTypes.object.isRequired,\n schema: PropTypes.object.isRequired\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,QAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,kBAAA,GAAAL,OAAA;AAAgF,SAAAM,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAAAK,OAAA,CAAAL,CAAA,0BAAAA,CAAA,sBAAAA,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAc,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IAAAR,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAI,CAAA,IAAAV,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,cAAAR,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAgB,GAAA,CAAAnB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAEhF,IAAMY,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAAgC;EAAA,IAA1BC,EAAE,GAAAD,IAAA,CAAFC,EAAE;IAAEC,MAAM,GAAAF,IAAA,CAANE,MAAM;IAAEC,OAAO,GAAAH,IAAA,CAAPG,OAAO;EAC7C,IAAAC,WAAA,GAA+B,IAAAC,iBAAU,EAACC,oCAAiB,CAAC;IAApDC,kBAAkB,GAAAH,WAAA,CAAlBG,kBAAkB;EAE1B,IAAAC,QAAA,GAA0B,IAAAC,oBAAO,EAAC;MAAER,EAAE,EAAFA,EAAE;MAAEC,MAAM,EAANA,MAAM;MAAEC,OAAO,EAAPA;IAAQ,CAAC,CAAC;IAAlDO,IAAI,GAAAF,QAAA,CAAJE,IAAI;IAAEC,OAAO,GAAAH,QAAA,CAAPG,OAAO;EAErB,IAAAC,gBAAS,EACP,YAAM;IACJD,OAAO,CAAC,CAAC;EACX,CAAC,EACD,CAACJ,kBAAkB,EAAEI,OAAO,CAC9B,CAAC;EAED,IAAI,CAACD,IAAI,IAAI,CAACpB,MAAM,CAACuB,IAAI,CAACH,IAAI,CAAC,IAAIpB,MAAM,CAACuB,IAAI,CAACH,IAAI,CAAC,CAACI,MAAM,KAAK,CAAC,EAAE,OAAO,IAAI;EAE9E,IAAMC,KAAK,GAAGzB,MAAM,CAAC0B,MAAM,CAACN,IAAI,CAAC,CAACO,OAAO,CAAC,UAAAC,IAAI;IAAA,OAAI5B,MAAM,CAAC0B,MAAM,CAACE,IAAI,CAAC;EAAA,EAAC;EAEtE,oBAAO7C,MAAA,YAAA8C,aAAA,CAAC3C,QAAA,WAAO;IAACuC,KAAK,EAAEA,KAAM;IAACK,UAAU,EAAEjB,OAAO,CAACkB;EAAI,CAAE,CAAC;AAC3D,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEaxB,gBAAgB;AAE/BA,gBAAgB,CAACyB,SAAS,GAAG;EAC3BvB,EAAE,EAAEwB,qBAAS,CAACC,MAAM,CAACC,UAAU;EAC/BxB,OAAO,EAAEsB,qBAAS,CAACG,MAAM,CAACD,UAAU;EACpCzB,MAAM,EAAEuB,qBAAS,CAACG,MAAM,CAACD;AAC3B,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"InfoBoxContainer.js","names":["_propTypes","_interopRequireDefault","require","_react","_interopRequireWildcard","_useData","_InfoBox","_RecordEditContext","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","InfoBoxContainer","id","schema","infoBox","externalUpdateTime","useContext","RecordEditContext","data","refetch","useData","useEffect","keys","length","items","values","flatMap","item","createElement","infoBoxKey","key","_default","exports","propTypes","PropTypes","string","isRequired","object"],"sources":["../../../../src/components/InfoBoxes/container/InfoBoxContainer.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useContext, useEffect } from 'react';\nimport useData from '../hooks/useData';\nimport InfoBox from '../presentational/InfoBox';\nimport { RecordEditContext } from '../../EntityManager/utils/RecordEditContext';\n\nconst InfoBoxContainer = ({ id, schema, infoBox }) => {\n const { externalUpdateTime } = useContext(RecordEditContext);\n\n const { data, refetch } = useData({ id, schema, infoBox });\n\n useEffect(() => {\n refetch();\n }, [externalUpdateTime, refetch]);\n\n if (!data || !Object.keys(data) || Object.keys(data).length === 0) return null;\n\n const items = Object.values(data).flatMap(item => Object.values(item));\n\n return <InfoBox items={items} infoBoxKey={infoBox.key} />;\n};\n\nexport default InfoBoxContainer;\n\nInfoBoxContainer.propTypes = {\n id: PropTypes.string.isRequired,\n infoBox: PropTypes.object.isRequired,\n schema: PropTypes.object.isRequired\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,QAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,kBAAA,GAAAL,OAAA;AAAgF,SAAAE,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,CAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAEhF,MAAMkB,gBAAgB,GAAGA,CAAC;EAAEC,EAAE;EAAEC,MAAM;EAAEC;AAAQ,CAAC,KAAK;EACpD,MAAM;IAAEC;EAAmB,CAAC,GAAG,IAAAC,iBAAU,EAACC,oCAAiB,CAAC;EAE5D,MAAM;IAAEC,IAAI;IAAEC;EAAQ,CAAC,GAAG,IAAAC,gBAAO,EAAC;IAAER,EAAE;IAAEC,MAAM;IAAEC;EAAQ,CAAC,CAAC;EAE1D,IAAAO,gBAAS,EAAC,MAAM;IACdF,OAAO,CAAC,CAAC;EACX,CAAC,EAAE,CAACJ,kBAAkB,EAAEI,OAAO,CAAC,CAAC;EAEjC,IAAI,CAACD,IAAI,IAAI,CAACV,MAAM,CAACc,IAAI,CAACJ,IAAI,CAAC,IAAIV,MAAM,CAACc,IAAI,CAACJ,IAAI,CAAC,CAACK,MAAM,KAAK,CAAC,EAAE,OAAO,IAAI;EAE9E,MAAMC,KAAK,GAAGhB,MAAM,CAACiB,MAAM,CAACP,IAAI,CAAC,CAACQ,OAAO,CAACC,IAAI,IAAInB,MAAM,CAACiB,MAAM,CAACE,IAAI,CAAC,CAAC;EAEtE,oBAAOxC,MAAA,CAAAe,OAAA,CAAA0B,aAAA,CAACtC,QAAA,CAAAY,OAAO;IAACsB,KAAK,EAAEA,KAAM;IAACK,UAAU,EAAEf,OAAO,CAACgB;EAAI,CAAE,CAAC;AAC3D,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA9B,OAAA,GAEaS,gBAAgB;AAE/BA,gBAAgB,CAACsB,SAAS,GAAG;EAC3BrB,EAAE,EAAEsB,kBAAS,CAACC,MAAM,CAACC,UAAU;EAC/BtB,OAAO,EAAEoB,kBAAS,CAACG,MAAM,CAACD,UAAU;EACpCvB,MAAM,EAAEqB,kBAAS,CAACG,MAAM,CAACD;AAC3B,CAAC","ignoreList":[]}
@@ -1,29 +1,34 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.object.define-property.js");
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
- exports["default"] = buildDynamicQuery;
9
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
10
- require("core-js/modules/es.array.map.js");
6
+ exports.default = buildDynamicQuery;
11
7
  var _client = require("@apollo/client");
12
8
  var _coreErrors = require("@blaze-cms/core-errors");
13
- var _templateObject;
14
- function buildDynamicQuery(_ref) {
15
- var id = _ref.id,
16
- schema = _ref.schema,
17
- properties = _ref.properties;
9
+ function buildDynamicQuery({
10
+ id,
11
+ schema,
12
+ properties
13
+ }) {
18
14
  if (!id) return null;
19
15
  if (!schema || !schema.actions || !schema.actions.get || !schema.properties) {
20
16
  throw new _coreErrors.BlazeError('DataEntity query requires get action, properties and fields from entity schema');
21
17
  }
22
- var fields = properties.map(function (infoProperty) {
23
- return "".concat(infoProperty, " {\n label\n value\n showLabel\n url\n tooltipIcon\n tooltipContent\n }");
24
- });
25
- return (0, _client.gql)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["query getInfoBoxData($id: String!){\n ", "( id: $id ) {\n id\n ", "\n __typename\n }\n }"])), schema.actions.get, fields.map(function (field) {
26
- return field;
27
- }));
18
+ const fields = properties.map(infoProperty => `${infoProperty} {
19
+ label
20
+ value
21
+ showLabel
22
+ url
23
+ tooltipIcon
24
+ tooltipContent
25
+ }`);
26
+ return (0, _client.gql)`query getInfoBoxData($id: String!){
27
+ ${schema.actions.get}( id: $id ) {
28
+ id
29
+ ${fields.map(field => field)}
30
+ __typename
31
+ }
32
+ }`;
28
33
  }
29
34
  //# sourceMappingURL=build-dynamic-query.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-dynamic-query.js","names":["_client","require","_coreErrors","_templateObject","buildDynamicQuery","_ref","id","schema","properties","actions","get","BlazeError","fields","map","infoProperty","concat","gql","_taggedTemplateLiteral2","field"],"sources":["../../../../src/components/InfoBoxes/helpers/build-dynamic-query.js"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\n\nexport default function buildDynamicQuery({ id, schema, properties }) {\n if (!id) return null;\n\n if (!schema || !schema.actions || !schema.actions.get || !schema.properties) {\n throw new BlazeError(\n 'DataEntity query requires get action, properties and fields from entity schema'\n );\n }\n\n const fields = properties.map(\n infoProperty =>\n `${infoProperty} {\n label\n value\n showLabel\n url\n tooltipIcon\n tooltipContent\n }`\n );\n\n return gql`query getInfoBoxData($id: String!){\n ${schema.actions.get}( id: $id ) {\n id\n ${fields.map(field => field)}\n __typename\n }\n }`;\n}\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAAoD,IAAAE,eAAA;AAErC,SAASC,iBAAiBA,CAAAC,IAAA,EAA6B;EAAA,IAA1BC,EAAE,GAAAD,IAAA,CAAFC,EAAE;IAAEC,MAAM,GAAAF,IAAA,CAANE,MAAM;IAAEC,UAAU,GAAAH,IAAA,CAAVG,UAAU;EAChE,IAAI,CAACF,EAAE,EAAE,OAAO,IAAI;EAEpB,IAAI,CAACC,MAAM,IAAI,CAACA,MAAM,CAACE,OAAO,IAAI,CAACF,MAAM,CAACE,OAAO,CAACC,GAAG,IAAI,CAACH,MAAM,CAACC,UAAU,EAAE;IAC3E,MAAM,IAAIG,sBAAU,CAClB,gFACF,CAAC;EACH;EAEA,IAAMC,MAAM,GAAGJ,UAAU,CAACK,GAAG,CAC3B,UAAAC,YAAY;IAAA,UAAAC,MAAA,CACPD,YAAY;EAAA,CAQnB,CAAC;EAED,WAAOE,WAAG,EAAAb,eAAA,KAAAA,eAAA,OAAAc,uBAAA,kIACNV,MAAM,CAACE,OAAO,CAACC,GAAG,EAEhBE,MAAM,CAACC,GAAG,CAAC,UAAAK,KAAK;IAAA,OAAIA,KAAK;EAAA,EAAC;AAIlC","ignoreList":[]}
1
+ {"version":3,"file":"build-dynamic-query.js","names":["_client","require","_coreErrors","buildDynamicQuery","id","schema","properties","actions","get","BlazeError","fields","map","infoProperty","gql","field"],"sources":["../../../../src/components/InfoBoxes/helpers/build-dynamic-query.js"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\n\nexport default function buildDynamicQuery({ id, schema, properties }) {\n if (!id) return null;\n\n if (!schema || !schema.actions || !schema.actions.get || !schema.properties) {\n throw new BlazeError(\n 'DataEntity query requires get action, properties and fields from entity schema'\n );\n }\n\n const fields = properties.map(\n infoProperty =>\n `${infoProperty} {\n label\n value\n showLabel\n url\n tooltipIcon\n tooltipContent\n }`\n );\n\n return gql`query getInfoBoxData($id: String!){\n ${schema.actions.get}( id: $id ) {\n id\n ${fields.map(field => field)}\n __typename\n }\n }`;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAEe,SAASE,iBAAiBA,CAAC;EAAEC,EAAE;EAAEC,MAAM;EAAEC;AAAW,CAAC,EAAE;EACpE,IAAI,CAACF,EAAE,EAAE,OAAO,IAAI;EAEpB,IAAI,CAACC,MAAM,IAAI,CAACA,MAAM,CAACE,OAAO,IAAI,CAACF,MAAM,CAACE,OAAO,CAACC,GAAG,IAAI,CAACH,MAAM,CAACC,UAAU,EAAE;IAC3E,MAAM,IAAIG,sBAAU,CAClB,gFACF,CAAC;EACH;EAEA,MAAMC,MAAM,GAAGJ,UAAU,CAACK,GAAG,CAC3BC,YAAY,IACV,GAAGA,YAAY;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,MACE,CAAC;EAED,OAAO,IAAAC,WAAG;AACZ,MAAMR,MAAM,CAACE,OAAO,CAACC,GAAG;AACxB;AACA,QAAQE,MAAM,CAACC,GAAG,CAACG,KAAK,IAAIA,KAAK,CAAC;AAClC;AACA;AACA,IAAI;AACJ","ignoreList":[]}
@@ -1,43 +1,46 @@
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;
9
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
7
+ exports.default = void 0;
10
8
  var _client = require("@apollo/client");
11
9
  var _useInfoBox = _interopRequireDefault(require("./useInfoBox"));
12
- var _templateObject;
13
- function useData(_ref) {
14
- var id = _ref.id,
15
- schema = _ref.schema,
16
- infoBox = _ref.infoBox;
17
- var _useInfoBoxData = (0, _useInfoBox["default"])({
18
- id: id,
19
- schema: schema,
20
- infoBox: infoBox
21
- }),
22
- query = _useInfoBoxData.query;
23
- var infoBoxQuery = query || (0, _client.gql)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n query {\n __typename\n }\n "])));
24
- var _useQuery = (0, _client.useQuery)(infoBoxQuery, {
25
- variables: {
26
- id: id
27
- },
28
- skip: !query
29
- }),
30
- _useQuery$data = _useQuery.data,
31
- data = _useQuery$data === void 0 ? {} : _useQuery$data,
32
- loading = _useQuery.loading,
33
- error = _useQuery.error,
34
- refetch = _useQuery.refetch;
10
+ function useData({
11
+ id,
12
+ schema,
13
+ infoBox
14
+ }) {
15
+ const {
16
+ query
17
+ } = (0, _useInfoBox.default)({
18
+ id,
19
+ schema,
20
+ infoBox
21
+ });
22
+ const infoBoxQuery = query || (0, _client.gql)`
23
+ query {
24
+ __typename
25
+ }
26
+ `;
27
+ const {
28
+ data = {},
29
+ loading,
30
+ error,
31
+ refetch
32
+ } = (0, _client.useQuery)(infoBoxQuery, {
33
+ variables: {
34
+ id
35
+ },
36
+ skip: !query
37
+ });
35
38
  return {
36
39
  data: data.__typename !== 'Query' ? data : null,
37
- loading: loading,
38
- error: error,
39
- refetch: refetch
40
+ loading,
41
+ error,
42
+ refetch
40
43
  };
41
44
  }
42
- var _default = exports["default"] = useData;
45
+ var _default = exports.default = useData;
43
46
  //# sourceMappingURL=useData.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useData.js","names":["_client","require","_useInfoBox","_interopRequireDefault","_templateObject","useData","_ref","id","schema","infoBox","_useInfoBoxData","useInfoBoxData","query","infoBoxQuery","gql","_taggedTemplateLiteral2","_useQuery","useQuery","variables","skip","_useQuery$data","data","loading","error","refetch","__typename","_default","exports"],"sources":["../../../../src/components/InfoBoxes/hooks/useData.js"],"sourcesContent":["import { useQuery, gql } from '@apollo/client';\nimport useInfoBoxData from './useInfoBox';\n\nfunction useData({ id, schema, infoBox }) {\n const { query } = useInfoBoxData({ id, schema, infoBox });\n\n const infoBoxQuery =\n query ||\n gql`\n query {\n __typename\n }\n `;\n\n const { data = {}, loading, error, refetch } = useQuery(infoBoxQuery, {\n variables: { id },\n skip: !query\n });\n\n return { data: data.__typename !== 'Query' ? data : null, loading, error, refetch };\n}\n\nexport default useData;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA0C,IAAAG,eAAA;AAE1C,SAASC,OAAOA,CAAAC,IAAA,EAA0B;EAAA,IAAvBC,EAAE,GAAAD,IAAA,CAAFC,EAAE;IAAEC,MAAM,GAAAF,IAAA,CAANE,MAAM;IAAEC,OAAO,GAAAH,IAAA,CAAPG,OAAO;EACpC,IAAAC,eAAA,GAAkB,IAAAC,sBAAc,EAAC;MAAEJ,EAAE,EAAFA,EAAE;MAAEC,MAAM,EAANA,MAAM;MAAEC,OAAO,EAAPA;IAAQ,CAAC,CAAC;IAAjDG,KAAK,GAAAF,eAAA,CAALE,KAAK;EAEb,IAAMC,YAAY,GAChBD,KAAK,QACLE,WAAG,EAAAV,eAAA,KAAAA,eAAA,OAAAW,uBAAA,sEAIF;EAEH,IAAAC,SAAA,GAA+C,IAAAC,gBAAQ,EAACJ,YAAY,EAAE;MACpEK,SAAS,EAAE;QAAEX,EAAE,EAAFA;MAAG,CAAC;MACjBY,IAAI,EAAE,CAACP;IACT,CAAC,CAAC;IAAAQ,cAAA,GAAAJ,SAAA,CAHMK,IAAI;IAAJA,IAAI,GAAAD,cAAA,cAAG,CAAC,CAAC,GAAAA,cAAA;IAAEE,OAAO,GAAAN,SAAA,CAAPM,OAAO;IAAEC,KAAK,GAAAP,SAAA,CAALO,KAAK;IAAEC,OAAO,GAAAR,SAAA,CAAPQ,OAAO;EAK1C,OAAO;IAAEH,IAAI,EAAEA,IAAI,CAACI,UAAU,KAAK,OAAO,GAAGJ,IAAI,GAAG,IAAI;IAAEC,OAAO,EAAPA,OAAO;IAAEC,KAAK,EAALA,KAAK;IAAEC,OAAO,EAAPA;EAAQ,CAAC;AACrF;AAAC,IAAAE,QAAA,GAAAC,OAAA,cAEctB,OAAO","ignoreList":[]}
1
+ {"version":3,"file":"useData.js","names":["_client","require","_useInfoBox","_interopRequireDefault","useData","id","schema","infoBox","query","useInfoBoxData","infoBoxQuery","gql","data","loading","error","refetch","useQuery","variables","skip","__typename","_default","exports","default"],"sources":["../../../../src/components/InfoBoxes/hooks/useData.js"],"sourcesContent":["import { useQuery, gql } from '@apollo/client';\nimport useInfoBoxData from './useInfoBox';\n\nfunction useData({ id, schema, infoBox }) {\n const { query } = useInfoBoxData({ id, schema, infoBox });\n\n const infoBoxQuery =\n query ||\n gql`\n query {\n __typename\n }\n `;\n\n const {\n data = {},\n loading,\n error,\n refetch\n } = useQuery(infoBoxQuery, {\n variables: { id },\n skip: !query\n });\n\n return { data: data.__typename !== 'Query' ? data : null, loading, error, refetch };\n}\n\nexport default useData;\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,SAASG,OAAOA,CAAC;EAAEC,EAAE;EAAEC,MAAM;EAAEC;AAAQ,CAAC,EAAE;EACxC,MAAM;IAAEC;EAAM,CAAC,GAAG,IAAAC,mBAAc,EAAC;IAAEJ,EAAE;IAAEC,MAAM;IAAEC;EAAQ,CAAC,CAAC;EAEzD,MAAMG,YAAY,GAChBF,KAAK,IACL,IAAAG,WAAG;AACP;AACA;AACA;AACA,KAAK;EAEH,MAAM;IACJC,IAAI,GAAG,CAAC,CAAC;IACTC,OAAO;IACPC,KAAK;IACLC;EACF,CAAC,GAAG,IAAAC,gBAAQ,EAACN,YAAY,EAAE;IACzBO,SAAS,EAAE;MAAEZ;IAAG,CAAC;IACjBa,IAAI,EAAE,CAACV;EACT,CAAC,CAAC;EAEF,OAAO;IAAEI,IAAI,EAAEA,IAAI,CAACO,UAAU,KAAK,OAAO,GAAGP,IAAI,GAAG,IAAI;IAAEC,OAAO;IAAEC,KAAK;IAAEC;EAAQ,CAAC;AACrF;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEclB,OAAO","ignoreList":[]}
@@ -1,24 +1,24 @@
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 _buildDynamicQuery = _interopRequireDefault(require("../helpers/build-dynamic-query"));
10
- function useInfoBox(_ref) {
11
- var id = _ref.id,
12
- schema = _ref.schema,
13
- infoBox = _ref.infoBox;
14
- var query = (0, _buildDynamicQuery["default"])({
15
- id: id,
16
- schema: schema,
9
+ function useInfoBox({
10
+ id,
11
+ schema,
12
+ infoBox
13
+ }) {
14
+ const query = (0, _buildDynamicQuery.default)({
15
+ id,
16
+ schema,
17
17
  properties: [infoBox.property]
18
18
  });
19
19
  return {
20
20
  query: query || null
21
21
  };
22
22
  }
23
- var _default = exports["default"] = useInfoBox;
23
+ var _default = exports.default = useInfoBox;
24
24
  //# sourceMappingURL=useInfoBox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useInfoBox.js","names":["_buildDynamicQuery","_interopRequireDefault","require","useInfoBox","_ref","id","schema","infoBox","query","buildDynamicQuery","properties","property","_default","exports"],"sources":["../../../../src/components/InfoBoxes/hooks/useInfoBox.js"],"sourcesContent":["import buildDynamicQuery from '../helpers/build-dynamic-query';\n\nfunction useInfoBox({ id, schema, infoBox }) {\n const query = buildDynamicQuery({\n id,\n schema,\n properties: [infoBox.property]\n });\n\n return { query: query || null };\n}\n\nexport default useInfoBox;\n"],"mappings":";;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,SAASC,UAAUA,CAAAC,IAAA,EAA0B;EAAA,IAAvBC,EAAE,GAAAD,IAAA,CAAFC,EAAE;IAAEC,MAAM,GAAAF,IAAA,CAANE,MAAM;IAAEC,OAAO,GAAAH,IAAA,CAAPG,OAAO;EACvC,IAAMC,KAAK,GAAG,IAAAC,6BAAiB,EAAC;IAC9BJ,EAAE,EAAFA,EAAE;IACFC,MAAM,EAANA,MAAM;IACNI,UAAU,EAAE,CAACH,OAAO,CAACI,QAAQ;EAC/B,CAAC,CAAC;EAEF,OAAO;IAAEH,KAAK,EAAEA,KAAK,IAAI;EAAK,CAAC;AACjC;AAAC,IAAAI,QAAA,GAAAC,OAAA,cAEcV,UAAU","ignoreList":[]}
1
+ {"version":3,"file":"useInfoBox.js","names":["_buildDynamicQuery","_interopRequireDefault","require","useInfoBox","id","schema","infoBox","query","buildDynamicQuery","properties","property","_default","exports","default"],"sources":["../../../../src/components/InfoBoxes/hooks/useInfoBox.js"],"sourcesContent":["import buildDynamicQuery from '../helpers/build-dynamic-query';\n\nfunction useInfoBox({ id, schema, infoBox }) {\n const query = buildDynamicQuery({\n id,\n schema,\n properties: [infoBox.property]\n });\n\n return { query: query || null };\n}\n\nexport default useInfoBox;\n"],"mappings":";;;;;;;AAAA,IAAAA,kBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,SAASC,UAAUA,CAAC;EAAEC,EAAE;EAAEC,MAAM;EAAEC;AAAQ,CAAC,EAAE;EAC3C,MAAMC,KAAK,GAAG,IAAAC,0BAAiB,EAAC;IAC9BJ,EAAE;IACFC,MAAM;IACNI,UAAU,EAAE,CAACH,OAAO,CAACI,QAAQ;EAC/B,CAAC,CAAC;EAEF,OAAO;IAAEH,KAAK,EAAEA,KAAK,IAAI;EAAK,CAAC;AACjC;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcV,UAAU","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 _InfoBoxes = _interopRequireDefault(require("./InfoBoxes"));
10
- var _default = exports["default"] = _InfoBoxes["default"];
9
+ var _default = exports.default = _InfoBoxes.default;
11
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_InfoBoxes","_interopRequireDefault","require","_default","exports","InfoBoxes"],"sources":["../../../src/components/InfoBoxes/index.js"],"sourcesContent":["import InfoBoxes from './InfoBoxes';\n\nexport default InfoBoxes;\n"],"mappings":";;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAoC,IAAAC,QAAA,GAAAC,OAAA,cAErBC,qBAAS","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_InfoBoxes","_interopRequireDefault","require","_default","exports","default","InfoBoxes"],"sources":["../../../src/components/InfoBoxes/index.js"],"sourcesContent":["import InfoBoxes from './InfoBoxes';\n\nexport default InfoBoxes;\n"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAoC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAErBC,kBAAS","ignoreList":[]}