@blaze-cms/react-page-builder 0.131.0 → 0.132.0-admin-updates.0

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 (229) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/lib/components/Button.js +2 -1
  3. package/lib/components/Button.js.map +1 -1
  4. package/lib/components/Card/CardsRender.js +13 -6
  5. package/lib/components/Card/CardsRender.js.map +1 -1
  6. package/lib/components/Card/helpers/get-updated-items-to-display.js +55 -0
  7. package/lib/components/Card/helpers/get-updated-items-to-display.js.map +1 -0
  8. package/lib/components/Card/helpers/index.js +7 -0
  9. package/lib/components/Card/helpers/index.js.map +1 -1
  10. package/lib/components/CarouselWrapper/SmoothScrollCarousel.js +2 -2
  11. package/lib/components/CarouselWrapper/SmoothScrollCarousel.js.map +1 -1
  12. package/lib/components/Code/Code.js +7 -3
  13. package/lib/components/Code/Code.js.map +1 -1
  14. package/lib/components/DataSummary/helpers/build-loop-props-content.js +6 -3
  15. package/lib/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
  16. package/lib/components/DataSummary/helpers/build-props-to-display-with-content.js +3 -2
  17. package/lib/components/DataSummary/helpers/build-props-to-display-with-content.js.map +1 -1
  18. package/lib/components/DataSummary/helpers/get-link-to-published-content.js +2 -0
  19. package/lib/components/DataSummary/helpers/get-link-to-published-content.js.map +1 -1
  20. package/lib/components/List/ListFactory.js +16 -11
  21. package/lib/components/List/ListFactory.js.map +1 -1
  22. package/lib/components/List/helpers/get-list-query.js +43 -0
  23. package/lib/components/List/helpers/get-list-query.js.map +1 -0
  24. package/lib/components/List/helpers/get-list-specific-search-filter.js +21 -0
  25. package/lib/components/List/helpers/get-list-specific-search-filter.js.map +1 -0
  26. package/lib/components/List/helpers/index.js +14 -0
  27. package/lib/components/List/helpers/index.js.map +1 -1
  28. package/lib/components/List/helpers/strip-query-key.js +14 -0
  29. package/lib/components/List/helpers/strip-query-key.js.map +1 -0
  30. package/lib/components/SearchContent/SearchContent.js +8 -8
  31. package/lib/components/SearchContent/SearchContent.js.map +1 -1
  32. package/lib/components/SearchFilter/SearchFilter/SearchFilter.js +17 -13
  33. package/lib/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
  34. package/lib/components/SearchFilter/SearchFilterContainer.js +64 -83
  35. package/lib/components/SearchFilter/SearchFilterContainer.js.map +1 -1
  36. package/lib/components/SearchFilter/helpers/build-filters-query.js +3 -1
  37. package/lib/components/SearchFilter/helpers/build-filters-query.js.map +1 -1
  38. package/lib/components/SearchFilter/helpers/build-new-url.js +17 -0
  39. package/lib/components/SearchFilter/helpers/build-new-url.js.map +1 -0
  40. package/lib/components/SearchFilter/helpers/build-url-query.js +49 -0
  41. package/lib/components/SearchFilter/helpers/build-url-query.js.map +1 -0
  42. package/lib/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js +32 -0
  43. package/lib/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js.map +1 -0
  44. package/lib/components/SearchFilter/helpers/get-filter-values.js +31 -0
  45. package/lib/components/SearchFilter/helpers/get-filter-values.js.map +1 -0
  46. package/lib/components/SearchFilter/helpers/index.js +18 -11
  47. package/lib/components/SearchFilter/helpers/index.js.map +1 -1
  48. package/lib/components/SearchFilter/index.js.map +1 -1
  49. package/lib/components/SearchFilter/searchFilterReducer.js +43 -0
  50. package/lib/components/SearchFilter/searchFilterReducer.js.map +1 -0
  51. package/lib/components/SearchFilterSort/SearchFilterSort.js +31 -11
  52. package/lib/components/SearchFilterSort/SearchFilterSort.js.map +1 -1
  53. package/lib/components/SearchFilterSort/helpers/handle-sort-update.js +19 -5
  54. package/lib/components/SearchFilterSort/helpers/handle-sort-update.js.map +1 -1
  55. package/lib/components/SearchFilterSort/helpers/update-sort.js +9 -5
  56. package/lib/components/SearchFilterSort/helpers/update-sort.js.map +1 -1
  57. package/lib/helpers/build-inherited-filters.js +2 -0
  58. package/lib/helpers/build-inherited-filters.js.map +1 -1
  59. package/lib/helpers/build-props-query.js +5 -2
  60. package/lib/helpers/build-props-query.js.map +1 -1
  61. package/lib/helpers/build-query-key.js +16 -0
  62. package/lib/helpers/build-query-key.js.map +1 -0
  63. package/lib/helpers/build-set-filters.js +5 -1
  64. package/lib/helpers/build-set-filters.js.map +1 -1
  65. package/lib/helpers/get-entities-with-banner.js +8 -2
  66. package/lib/helpers/get-entities-with-banner.js.map +1 -1
  67. package/lib/helpers/get-query-filters.js +6 -8
  68. package/lib/helpers/get-query-filters.js.map +1 -1
  69. package/lib/helpers/get-query-props.js +13 -2
  70. package/lib/helpers/get-query-props.js.map +1 -1
  71. package/lib/helpers/get-wrapped-value-with-link.js +2 -3
  72. package/lib/helpers/get-wrapped-value-with-link.js.map +1 -1
  73. package/lib/helpers/index.js +14 -0
  74. package/lib/helpers/index.js.map +1 -1
  75. package/lib/helpers/parse-props-to-display.js +13 -8
  76. package/lib/helpers/parse-props-to-display.js.map +1 -1
  77. package/lib/helpers/process-data-summary-value.js +56 -0
  78. package/lib/helpers/process-data-summary-value.js.map +1 -0
  79. package/lib-es/components/Button.js +2 -1
  80. package/lib-es/components/Button.js.map +1 -1
  81. package/lib-es/components/Card/CardsRender.js +14 -7
  82. package/lib-es/components/Card/CardsRender.js.map +1 -1
  83. package/lib-es/components/Card/helpers/get-updated-items-to-display.js +32 -0
  84. package/lib-es/components/Card/helpers/get-updated-items-to-display.js.map +1 -0
  85. package/lib-es/components/Card/helpers/index.js +1 -0
  86. package/lib-es/components/Card/helpers/index.js.map +1 -1
  87. package/lib-es/components/CarouselWrapper/SmoothScrollCarousel.js +2 -2
  88. package/lib-es/components/CarouselWrapper/SmoothScrollCarousel.js.map +1 -1
  89. package/lib-es/components/Code/Code.js +8 -4
  90. package/lib-es/components/Code/Code.js.map +1 -1
  91. package/lib-es/components/DataSummary/helpers/build-loop-props-content.js +6 -3
  92. package/lib-es/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
  93. package/lib-es/components/DataSummary/helpers/build-props-to-display-with-content.js +4 -3
  94. package/lib-es/components/DataSummary/helpers/build-props-to-display-with-content.js.map +1 -1
  95. package/lib-es/components/DataSummary/helpers/get-link-to-published-content.js +2 -1
  96. package/lib-es/components/DataSummary/helpers/get-link-to-published-content.js.map +1 -1
  97. package/lib-es/components/List/ListFactory.js +16 -12
  98. package/lib-es/components/List/ListFactory.js.map +1 -1
  99. package/lib-es/components/List/helpers/get-list-query.js +24 -0
  100. package/lib-es/components/List/helpers/get-list-query.js.map +1 -0
  101. package/lib-es/components/List/helpers/get-list-specific-search-filter.js +12 -0
  102. package/lib-es/components/List/helpers/get-list-specific-search-filter.js.map +1 -0
  103. package/lib-es/components/List/helpers/index.js +2 -0
  104. package/lib-es/components/List/helpers/index.js.map +1 -1
  105. package/lib-es/components/List/helpers/strip-query-key.js +6 -0
  106. package/lib-es/components/List/helpers/strip-query-key.js.map +1 -0
  107. package/lib-es/components/SearchContent/SearchContent.js +8 -8
  108. package/lib-es/components/SearchContent/SearchContent.js.map +1 -1
  109. package/lib-es/components/SearchFilter/SearchFilter/SearchFilter.js +18 -13
  110. package/lib-es/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
  111. package/lib-es/components/SearchFilter/SearchFilterContainer.js +48 -70
  112. package/lib-es/components/SearchFilter/SearchFilterContainer.js.map +1 -1
  113. package/lib-es/components/SearchFilter/helpers/build-filters-query.js +2 -0
  114. package/lib-es/components/SearchFilter/helpers/build-filters-query.js.map +1 -1
  115. package/lib-es/components/SearchFilter/helpers/build-new-url.js +8 -0
  116. package/lib-es/components/SearchFilter/helpers/build-new-url.js.map +1 -0
  117. package/lib-es/components/SearchFilter/helpers/build-url-query.js +31 -0
  118. package/lib-es/components/SearchFilter/helpers/build-url-query.js.map +1 -0
  119. package/lib-es/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js +18 -0
  120. package/lib-es/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js.map +1 -0
  121. package/lib-es/components/SearchFilter/helpers/get-filter-values.js +19 -0
  122. package/lib-es/components/SearchFilter/helpers/get-filter-values.js.map +1 -0
  123. package/lib-es/components/SearchFilter/helpers/index.js +5 -4
  124. package/lib-es/components/SearchFilter/helpers/index.js.map +1 -1
  125. package/lib-es/components/SearchFilter/index.js +2 -2
  126. package/lib-es/components/SearchFilter/index.js.map +1 -1
  127. package/lib-es/components/SearchFilter/searchFilterReducer.js +26 -0
  128. package/lib-es/components/SearchFilter/searchFilterReducer.js.map +1 -0
  129. package/lib-es/components/SearchFilterSort/SearchFilterSort.js +26 -10
  130. package/lib-es/components/SearchFilterSort/SearchFilterSort.js.map +1 -1
  131. package/lib-es/components/SearchFilterSort/helpers/handle-sort-update.js +21 -4
  132. package/lib-es/components/SearchFilterSort/helpers/handle-sort-update.js.map +1 -1
  133. package/lib-es/components/SearchFilterSort/helpers/update-sort.js +8 -4
  134. package/lib-es/components/SearchFilterSort/helpers/update-sort.js.map +1 -1
  135. package/lib-es/helpers/build-inherited-filters.js +2 -0
  136. package/lib-es/helpers/build-inherited-filters.js.map +1 -1
  137. package/lib-es/helpers/build-props-query.js +4 -2
  138. package/lib-es/helpers/build-props-query.js.map +1 -1
  139. package/lib-es/helpers/build-query-key.js +7 -0
  140. package/lib-es/helpers/build-query-key.js.map +1 -0
  141. package/lib-es/helpers/build-set-filters.js +5 -1
  142. package/lib-es/helpers/build-set-filters.js.map +1 -1
  143. package/lib-es/helpers/get-entities-with-banner.js +9 -2
  144. package/lib-es/helpers/get-entities-with-banner.js.map +1 -1
  145. package/lib-es/helpers/get-query-filters.js +6 -8
  146. package/lib-es/helpers/get-query-filters.js.map +1 -1
  147. package/lib-es/helpers/get-query-props.js +10 -2
  148. package/lib-es/helpers/get-query-props.js.map +1 -1
  149. package/lib-es/helpers/get-wrapped-value-with-link.js +2 -2
  150. package/lib-es/helpers/get-wrapped-value-with-link.js.map +1 -1
  151. package/lib-es/helpers/index.js +2 -0
  152. package/lib-es/helpers/index.js.map +1 -1
  153. package/lib-es/helpers/parse-props-to-display.js +12 -9
  154. package/lib-es/helpers/parse-props-to-display.js.map +1 -1
  155. package/lib-es/helpers/process-data-summary-value.js +36 -0
  156. package/lib-es/helpers/process-data-summary-value.js.map +1 -0
  157. package/package.json +10 -10
  158. package/src/components/Button.js +2 -1
  159. package/src/components/Card/CardsRender.js +27 -7
  160. package/src/components/Card/helpers/get-updated-items-to-display.js +32 -0
  161. package/src/components/Card/helpers/index.js +1 -0
  162. package/src/components/CarouselWrapper/SmoothScrollCarousel.js +2 -2
  163. package/src/components/Code/Code.js +7 -3
  164. package/src/components/DataSummary/helpers/build-loop-props-content.js +7 -3
  165. package/src/components/DataSummary/helpers/build-props-to-display-with-content.js +6 -3
  166. package/src/components/DataSummary/helpers/get-link-to-published-content.js +4 -1
  167. package/src/components/List/ListFactory.js +25 -15
  168. package/src/components/List/helpers/get-list-query.js +28 -0
  169. package/src/components/List/helpers/get-list-specific-search-filter.js +10 -0
  170. package/src/components/List/helpers/index.js +2 -0
  171. package/src/components/List/helpers/strip-query-key.js +6 -0
  172. package/src/components/SearchContent/SearchContent.js +8 -8
  173. package/src/components/SearchFilter/SearchFilter/SearchFilter.js +21 -18
  174. package/src/components/SearchFilter/SearchFilterContainer.js +59 -67
  175. package/src/components/SearchFilter/helpers/build-filters-query.js +9 -1
  176. package/src/components/SearchFilter/helpers/build-new-url.js +8 -0
  177. package/src/components/SearchFilter/helpers/build-url-query.js +33 -0
  178. package/src/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js +17 -0
  179. package/src/components/SearchFilter/helpers/get-filter-values.js +21 -0
  180. package/src/components/SearchFilter/helpers/index.js +9 -7
  181. package/src/components/SearchFilter/index.js +2 -2
  182. package/src/components/SearchFilter/searchFilterReducer.js +15 -0
  183. package/src/components/SearchFilterSort/SearchFilterSort.js +18 -8
  184. package/src/components/SearchFilterSort/helpers/handle-sort-update.js +14 -5
  185. package/src/components/SearchFilterSort/helpers/update-sort.js +7 -3
  186. package/src/helpers/build-inherited-filters.js +3 -1
  187. package/src/helpers/build-props-query.js +4 -2
  188. package/src/helpers/build-query-key.js +7 -0
  189. package/src/helpers/build-set-filters.js +2 -1
  190. package/src/helpers/get-entities-with-banner.js +3 -2
  191. package/src/helpers/get-query-filters.js +4 -4
  192. package/src/helpers/get-query-props.js +12 -4
  193. package/src/helpers/get-wrapped-value-with-link.js +6 -3
  194. package/src/helpers/index.js +2 -0
  195. package/src/helpers/parse-props-to-display.js +25 -21
  196. package/src/helpers/process-data-summary-value.js +22 -0
  197. package/tests/helpers/mocks.js +3 -5
  198. package/tests/unit/src/components/Card/helpers/get-updated-items-to-display.test.js +72 -0
  199. package/tests/unit/src/components/Code/Code.test.js +5 -0
  200. package/tests/unit/src/components/Code/__snapshots__/Code.test.js.snap +8 -0
  201. package/tests/unit/src/components/DataSummary/helpers/build-loop-props-content.test.js +50 -0
  202. package/tests/unit/src/components/DataSummary/helpers/get-link-to-published-content.test.js +21 -0
  203. package/tests/unit/src/components/SearchFilter/__snapshots__/SearchFilterContainer.test.js.snap +1 -7
  204. package/tests/unit/src/components/SearchFilter/helpers/build-new-query.test.js +10 -10
  205. package/tests/unit/src/components/SearchFilter/helpers/build-query.test.js +24 -7
  206. package/tests/unit/src/components/SearchFilter/helpers/get-initial-filter-values.test.js +10 -10
  207. package/tests/unit/src/components/SearchFilterSort/SearchFilterSort.test.js +4 -1
  208. package/tests/unit/src/components/SearchFilterSort/helpers/handle-sort-update.test.js +26 -19
  209. package/tests/unit/src/components/SearchFilterSort/helpers/update-sort.test.js +10 -1
  210. package/tests/unit/src/helpers/__snapshots__/get-wrapped-value-with-link.test.js.snap +18 -0
  211. package/tests/unit/src/helpers/build-props-query.test.js +25 -0
  212. package/tests/unit/src/helpers/get-wrapped-value-with-link.test.js +2 -2
  213. package/tests/unit/src/helpers/parse-props-to-display.test.js +4 -0
  214. package/tests/unit/src/helpers/prcoess-data-summary-value.test.js +52 -0
  215. package/lib/components/SearchFilter/helpers/build-new-query.js +0 -15
  216. package/lib/components/SearchFilter/helpers/build-new-query.js.map +0 -1
  217. package/lib/components/SearchFilter/helpers/build-query.js +0 -37
  218. package/lib/components/SearchFilter/helpers/build-query.js.map +0 -1
  219. package/lib/components/SearchFilter/helpers/get-initial-filter-values.js +0 -43
  220. package/lib/components/SearchFilter/helpers/get-initial-filter-values.js.map +0 -1
  221. package/lib-es/components/SearchFilter/helpers/build-new-query.js +0 -6
  222. package/lib-es/components/SearchFilter/helpers/build-new-query.js.map +0 -1
  223. package/lib-es/components/SearchFilter/helpers/build-query.js +0 -23
  224. package/lib-es/components/SearchFilter/helpers/build-query.js.map +0 -1
  225. package/lib-es/components/SearchFilter/helpers/get-initial-filter-values.js +0 -26
  226. package/lib-es/components/SearchFilter/helpers/get-initial-filter-values.js.map +0 -1
  227. package/src/components/SearchFilter/helpers/build-new-query.js +0 -6
  228. package/src/components/SearchFilter/helpers/build-query.js +0 -26
  229. package/src/components/SearchFilter/helpers/get-initial-filter-values.js +0 -30
@@ -45,7 +45,11 @@ var buildSetFilters = function buildSetFilters(_ref) {
45
45
  getCheckboxFilters(checkboxFilters, _constants.SPONSORED);
46
46
  }
47
47
  var shouldApplyFilterValues = filterBy.length && filterByProperty.length;
48
- var listFilterValues = shouldApplyFilterValues ? getFilterValues(filterBy) : {};
48
+ if (!shouldApplyFilterValues) return {
49
+ checkboxFilters: checkboxFilters,
50
+ listFilterValues: {}
51
+ };
52
+ var listFilterValues = getFilterValues(filterBy);
49
53
  return {
50
54
  checkboxFilters: checkboxFilters,
51
55
  listFilterValues: listFilterValues
@@ -1 +1 @@
1
- {"version":3,"file":"build-set-filters.js","names":["_constants","require","getCheckboxFilters","checkboxFilters","name","push","getFilterValues","filterBy","reduce","acc","filter","_filter$split","split","_filter$split2","_toArray2","fieldName","values","slice","value","join","previousValue","finalValue","concat","_toConsumableArray2","buildSetFilters","_ref","_ref$filterBy","_ref$filterByProperty","filterByProperty","filterByFeatured","filterBySponsored","FEATURED","SPONSORED","shouldApplyFilterValues","length","listFilterValues","_default","exports"],"sources":["../../src/helpers/build-set-filters.js"],"sourcesContent":["import { FEATURED, SPONSORED } from '../constants';\n\nconst getCheckboxFilters = (checkboxFilters, name) => {\n checkboxFilters.push(name);\n};\n\nconst getFilterValues = filterBy =>\n filterBy.reduce((acc, filter) => {\n const [fieldName, ...values] = filter.split('/');\n const value = values.join('/');\n const previousValue = acc[fieldName];\n const finalValue = previousValue ? [...previousValue, value] : [value];\n\n acc[fieldName] = finalValue;\n return acc;\n }, {});\n\nconst buildSetFilters = ({\n filterBy = [],\n filterByProperty = [],\n filterByFeatured,\n filterBySponsored\n}) => {\n const checkboxFilters = [];\n\n if (filterByFeatured) {\n getCheckboxFilters(checkboxFilters, FEATURED);\n }\n if (filterBySponsored) {\n getCheckboxFilters(checkboxFilters, SPONSORED);\n }\n\n const shouldApplyFilterValues = filterBy.length && filterByProperty.length;\n const listFilterValues = shouldApplyFilterValues ? getFilterValues(filterBy) : {};\n\n return { checkboxFilters, listFilterValues };\n};\n\nexport default buildSetFilters;\n"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAMC,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAIC,eAAe,EAAEC,IAAI,EAAK;EACpDD,eAAe,CAACE,IAAI,CAACD,IAAI,CAAC;AAC5B,CAAC;AAED,IAAME,eAAe,GAAG,SAAlBA,eAAeA,CAAGC,QAAQ;EAAA,OAC9BA,QAAQ,CAACC,MAAM,CAAC,UAACC,GAAG,EAAEC,MAAM,EAAK;IAC/B,IAAAC,aAAA,GAA+BD,MAAM,CAACE,KAAK,CAAC,GAAG,CAAC;MAAAC,cAAA,OAAAC,SAAA,aAAAH,aAAA;MAAzCI,SAAS,GAAAF,cAAA;MAAKG,MAAM,GAAAH,cAAA,CAAAI,KAAA;IAC3B,IAAMC,KAAK,GAAGF,MAAM,CAACG,IAAI,CAAC,GAAG,CAAC;IAC9B,IAAMC,aAAa,GAAGX,GAAG,CAACM,SAAS,CAAC;IACpC,IAAMM,UAAU,GAAGD,aAAa,MAAAE,MAAA,KAAAC,mBAAA,aAAOH,aAAa,IAAEF,KAAK,KAAI,CAACA,KAAK,CAAC;IAEtET,GAAG,CAACM,SAAS,CAAC,GAAGM,UAAU;IAC3B,OAAOZ,GAAG;EACZ,CAAC,EAAE,CAAC,CAAC,CAAC;AAAA;AAER,IAAMe,eAAe,GAAG,SAAlBA,eAAeA,CAAAC,IAAA,EAKf;EAAA,IAAAC,aAAA,GAAAD,IAAA,CAJJlB,QAAQ;IAARA,QAAQ,GAAAmB,aAAA,cAAG,EAAE,GAAAA,aAAA;IAAAC,qBAAA,GAAAF,IAAA,CACbG,gBAAgB;IAAhBA,gBAAgB,GAAAD,qBAAA,cAAG,EAAE,GAAAA,qBAAA;IACrBE,gBAAgB,GAAAJ,IAAA,CAAhBI,gBAAgB;IAChBC,iBAAiB,GAAAL,IAAA,CAAjBK,iBAAiB;EAEjB,IAAM3B,eAAe,GAAG,EAAE;EAE1B,IAAI0B,gBAAgB,EAAE;IACpB3B,kBAAkB,CAACC,eAAe,EAAE4B,mBAAQ,CAAC;EAC/C;EACA,IAAID,iBAAiB,EAAE;IACrB5B,kBAAkB,CAACC,eAAe,EAAE6B,oBAAS,CAAC;EAChD;EAEA,IAAMC,uBAAuB,GAAG1B,QAAQ,CAAC2B,MAAM,IAAIN,gBAAgB,CAACM,MAAM;EAC1E,IAAMC,gBAAgB,GAAGF,uBAAuB,GAAG3B,eAAe,CAACC,QAAQ,CAAC,GAAG,CAAC,CAAC;EAEjF,OAAO;IAAEJ,eAAe,EAAfA,eAAe;IAAEgC,gBAAgB,EAAhBA;EAAiB,CAAC;AAC9C,CAAC;AAAC,IAAAC,QAAA,GAEaZ,eAAe;AAAAa,OAAA,cAAAD,QAAA"}
1
+ {"version":3,"file":"build-set-filters.js","names":["_constants","require","getCheckboxFilters","checkboxFilters","name","push","getFilterValues","filterBy","reduce","acc","filter","_filter$split","split","_filter$split2","_toArray2","fieldName","values","slice","value","join","previousValue","finalValue","concat","_toConsumableArray2","buildSetFilters","_ref","_ref$filterBy","_ref$filterByProperty","filterByProperty","filterByFeatured","filterBySponsored","FEATURED","SPONSORED","shouldApplyFilterValues","length","listFilterValues","_default","exports"],"sources":["../../src/helpers/build-set-filters.js"],"sourcesContent":["import { FEATURED, SPONSORED } from '../constants';\n\nconst getCheckboxFilters = (checkboxFilters, name) => {\n checkboxFilters.push(name);\n};\n\nconst getFilterValues = filterBy =>\n filterBy.reduce((acc, filter) => {\n const [fieldName, ...values] = filter.split('/');\n const value = values.join('/');\n const previousValue = acc[fieldName];\n const finalValue = previousValue ? [...previousValue, value] : [value];\n\n acc[fieldName] = finalValue;\n return acc;\n }, {});\n\nconst buildSetFilters = ({\n filterBy = [],\n filterByProperty = [],\n filterByFeatured,\n filterBySponsored\n}) => {\n const checkboxFilters = [];\n\n if (filterByFeatured) {\n getCheckboxFilters(checkboxFilters, FEATURED);\n }\n if (filterBySponsored) {\n getCheckboxFilters(checkboxFilters, SPONSORED);\n }\n\n const shouldApplyFilterValues = filterBy.length && filterByProperty.length;\n if (!shouldApplyFilterValues) return { checkboxFilters, listFilterValues: {} };\n\n const listFilterValues = getFilterValues(filterBy);\n return { checkboxFilters, listFilterValues };\n};\n\nexport default buildSetFilters;\n"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAMC,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAIC,eAAe,EAAEC,IAAI,EAAK;EACpDD,eAAe,CAACE,IAAI,CAACD,IAAI,CAAC;AAC5B,CAAC;AAED,IAAME,eAAe,GAAG,SAAlBA,eAAeA,CAAGC,QAAQ;EAAA,OAC9BA,QAAQ,CAACC,MAAM,CAAC,UAACC,GAAG,EAAEC,MAAM,EAAK;IAC/B,IAAAC,aAAA,GAA+BD,MAAM,CAACE,KAAK,CAAC,GAAG,CAAC;MAAAC,cAAA,OAAAC,SAAA,aAAAH,aAAA;MAAzCI,SAAS,GAAAF,cAAA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,EAAhBA;EAAiB,CAAC;AAC9C,CAAC;AAAC,IAAAC,QAAA,GAEaZ,eAAe;AAAAa,OAAA,cAAAD,QAAA"}
@@ -26,11 +26,17 @@ function getEntitiesWithBanner(entities, options, hasNewBannerSettings) {
26
26
  return entities.map(function (currentEntity) {
27
27
  var parent = options.parent,
28
28
  transform = options.transform,
29
- limit = options.limit;
29
+ limit = options.limit,
30
+ banner = options.banner;
31
+ var _ref = banner || {},
32
+ adunit = _ref.adunit,
33
+ baseAdunit = _ref.baseAdunit;
30
34
  return _objectSpread(_objectSpread({}, currentEntity), {}, {
31
35
  parent: parent,
32
36
  limit: limit,
33
- transform: transform
37
+ transform: transform,
38
+ adunit: adunit,
39
+ baseAdunit: baseAdunit
34
40
  });
35
41
  });
36
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"get-entities-with-banner.js","names":["_injectBannersToEntities","_interopRequireDefault","require","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","getEntitiesWithBanner","entities","options","hasNewBannerSettings","hasBanner","map","currentEntity","parent","transform","limit","injectBannersToEntities"],"sources":["../../src/helpers/get-entities-with-banner.js"],"sourcesContent":["import injectBannersToEntities from './inject-banners-to-entities';\n\nexport default function getEntitiesWithBanner(entities, options, hasNewBannerSettings) {\n const { hasBanner } = options;\n if (hasNewBannerSettings) {\n return entities.map(currentEntity => {\n const { parent, transform, limit } = options;\n return { ...currentEntity, parent, limit, transform };\n });\n }\n if (!hasBanner) return entities;\n\n return injectBannersToEntities(entities, options);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,wBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAmE,SAAAC,QAAAC,MAAA,EAAAC,cAAA,QAAAC,IAAA,GAAAC,MAAA,CAAAD,IAAA,CAAAF,MAAA,OAAAG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AAK;MAChC,OAAArB,aAAA,CAAAA,aAAA,KAAYkB,aAAa;QAAEC,MAAM,EAANA,MAAM;QAAEE,KAAK,EAALA,KAAK;QAAED,SAAS,EAATA;MAAS;IACrD,CAAC,CAAC;EACJ;EACA,IAAI,CAACJ,SAAS,EAAE,OAAOH,QAAQ;EAE/B,OAAO,IAAAS,mCAAuB,EAACT,QAAQ,EAAEC,OAAO,CAAC;AACnD"}
1
+ {"version":3,"file":"get-entities-with-banner.js","names":["_injectBannersToEntities","_interopRequireDefault","require","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","getEntitiesWithBanner","entities","options","hasNewBannerSettings","hasBanner","map","currentEntity","parent","transform","limit","banner","_ref","adunit","baseAdunit","injectBannersToEntities"],"sources":["../../src/helpers/get-entities-with-banner.js"],"sourcesContent":["import injectBannersToEntities from './inject-banners-to-entities';\n\nexport default function getEntitiesWithBanner(entities, options, hasNewBannerSettings) {\n const { hasBanner } = options;\n if (hasNewBannerSettings) {\n return entities.map(currentEntity => {\n const { parent, transform, limit, banner } = options;\n const { adunit, baseAdunit } = banner || {};\n return { ...currentEntity, parent, limit, transform, adunit, baseAdunit };\n });\n }\n if (!hasBanner) return entities;\n\n return injectBannersToEntities(entities, options);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,wBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAmE,SAAAC,QAAAC,MAAA,EAAAC,cAAA,QAAAC,IAAA,GAAAC,MAAA,CAAAD,IAAA,CAAAF,MAAA,OAAAG,MAAA,CAAAC,qBAAA,QAAAC,OAAA,GAAAF,MAAA,CAAAC,qBAAA,CAAAJ,MAAA,GAAAC,cAAA,KAAAI,OAAA,GAAAA,OAAA,CAAAC,MAAA,WAAAC,GAAA,WAAAJ,MAAA,CAAAK,wB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AAVE,UAAU;MAC1B,OAAAzB,aAAA,CAAAA,aAAA,KAAYkB,aAAa;QAAEC,MAAM,EAANA,MAAM;QAAEE,KAAK,EAALA,KAAK;QAAED,SAAS,EAATA,SAAS;QAAEI,MAAM,EAANA,MAAM;QAAEC,UAAU,EAAVA;MAAU;IACzE,CAAC,CAAC;EACJ;EACA,IAAI,CAACT,SAAS,EAAE,OAAOH,QAAQ;EAE/B,OAAO,IAAAa,mCAAuB,EAACb,QAAQ,EAAEC,OAAO,CAAC;AACnD"}
@@ -12,17 +12,15 @@ require("core-js/modules/web.dom-collections.iterator.js");
12
12
  var _getSearchFilterType = _interopRequireDefault(require("./get-search-filter-type"));
13
13
  var _buildSearchValuesCheckboxSelect = _interopRequireDefault(require("./build-search-values-checkbox-select"));
14
14
  var _constants = require("../constants");
15
- var getQueryFilters = function getQueryFilters(searchFilter, query) {
16
- if (!searchFilter.settings || !searchFilter.settings.filters) {
17
- return {
18
- valuesAnd: [],
19
- valuesOr: []
20
- };
21
- }
15
+ var getQueryFilters = function getQueryFilters(searchFilter, query, listName) {
16
+ if (!searchFilter.settings || !searchFilter.settings.filters) return {
17
+ valuesAnd: [],
18
+ valuesOr: []
19
+ };
22
20
  var rangeFilters = (0, _getSearchFilterType["default"])(searchFilter, _constants.RANGE);
23
21
  var checkboxFilters = (0, _getSearchFilterType["default"])(searchFilter, _constants.CHECKBOX);
24
22
  var selectFilters = (0, _getSearchFilterType["default"])(searchFilter, _constants.SELECT);
25
- var _buildSearchValuesChe = (0, _buildSearchValuesCheckboxSelect["default"])(query, rangeFilters, checkboxFilters, selectFilters),
23
+ var _buildSearchValuesChe = (0, _buildSearchValuesCheckboxSelect["default"])(query, rangeFilters, checkboxFilters, selectFilters, listName),
26
24
  valuesAnd = _buildSearchValuesChe.values,
27
25
  valuesOr = _buildSearchValuesChe.valuesOr;
28
26
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"get-query-filters.js","names":["_getSearchFilterType","_interopRequireDefault","require","_buildSearchValuesCheckboxSelect","_constants","getQueryFilters","searchFilter","query","settings","filters","valuesAnd","valuesOr","rangeFilters","getSearchFilterType","RANGE","checkboxFilters","CHECKBOX","selectFilters","SELECT","_buildSearchValuesChe","buildSearchValuesCheckboxSelect","values","_default","exports"],"sources":["../../src/helpers/get-query-filters.js"],"sourcesContent":["import getSearchFilterType from './get-search-filter-type';\nimport buildSearchValuesCheckboxSelect from './build-search-values-checkbox-select';\nimport { RANGE, CHECKBOX, SELECT } from '../constants';\n\nconst getQueryFilters = (searchFilter, query) => {\n if (!searchFilter.settings || !searchFilter.settings.filters) {\n return { valuesAnd: [], valuesOr: [] };\n }\n\n const rangeFilters = getSearchFilterType(searchFilter, RANGE);\n const checkboxFilters = getSearchFilterType(searchFilter, CHECKBOX);\n const selectFilters = getSearchFilterType(searchFilter, SELECT);\n\n const { values: valuesAnd, valuesOr } = buildSearchValuesCheckboxSelect(\n query,\n rangeFilters,\n checkboxFilters,\n selectFilters\n );\n return { valuesAnd, valuesOr };\n};\n\nexport default getQueryFilters;\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,oBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,gCAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAEA,IAAMG,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,YAAY,EAAEC,KAAK,EAAK;EAC/C,IAAI,CAACD,YAAY,CAACE,QAAQ,IAAI,CAACF,YAAY,CAACE,QAAQ,CAACC,OAAO,EAAE;IAC5D,OAAO;MAAEC,SAAS,EAAE,EAAE;MAAEC,QAAQ,EAAE;IAAG,CAAC;EACxC;EAEA,IAAMC,YAAY,GAAG,IAAAC,+BAAmB,EAACP,YAAY,EAAEQ,gBAAK,CAAC;EAC7D,IAAMC,eAAe,GAAG,IAAAF,+BAAmB,EAACP,YAAY,EAAEU,mBAAQ,CAAC;EACnE,IAAMC,aAAa,GAAG,IAAAJ,+BAAmB,EAACP,YAAY,EAAEY,iBAAM,CAAC;EAE/D,IAAAC,qBAAA,GAAwC,IAAAC,2CAA+B,EACrEb,KAAK,EACLK,YAAY,EACZG,eAAe,EACfE,aACF,CAAC;IALeP,SAAS,GAAAS,qBAAA,CAAjBE,MAAM;IAAaV,QAAQ,GAAAQ,qBAAA,CAARR,QAAQ;EAMnC,OAAO;IAAED,SAAS,EAATA,SAAS;IAAEC,QAAQ,EAARA;EAAS,CAAC;AAChC,CAAC;AAAC,IAAAW,QAAA,GAEajB,eAAe;AAAAkB,OAAA,cAAAD,QAAA"}
1
+ {"version":3,"file":"get-query-filters.js","names":["_getSearchFilterType","_interopRequireDefault","require","_buildSearchValuesCheckboxSelect","_constants","getQueryFilters","searchFilter","query","listName","settings","filters","valuesAnd","valuesOr","rangeFilters","getSearchFilterType","RANGE","checkboxFilters","CHECKBOX","selectFilters","SELECT","_buildSearchValuesChe","buildSearchValuesCheckboxSelect","values","_default","exports"],"sources":["../../src/helpers/get-query-filters.js"],"sourcesContent":["import getSearchFilterType from './get-search-filter-type';\nimport buildSearchValuesCheckboxSelect from './build-search-values-checkbox-select';\nimport { RANGE, CHECKBOX, SELECT } from '../constants';\n\nconst getQueryFilters = (searchFilter, query, listName) => {\n if (!searchFilter.settings || !searchFilter.settings.filters)\n return { valuesAnd: [], valuesOr: [] };\n\n const rangeFilters = getSearchFilterType(searchFilter, RANGE);\n const checkboxFilters = getSearchFilterType(searchFilter, CHECKBOX);\n const selectFilters = getSearchFilterType(searchFilter, SELECT);\n\n const { values: valuesAnd, valuesOr } = buildSearchValuesCheckboxSelect(\n query,\n rangeFilters,\n checkboxFilters,\n selectFilters,\n listName\n );\n return { valuesAnd, valuesOr };\n};\n\nexport default getQueryFilters;\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,oBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,gCAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAEA,IAAMG,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,YAAY,EAAEC,KAAK,EAAEC,QAAQ,EAAK;EACzD,IAAI,CAACF,YAAY,CAACG,QAAQ,IAAI,CAACH,YAAY,CAACG,QAAQ,CAACC,OAAO,EAC1D,OAAO;IAAEC,SAAS,EAAE,EAAE;IAAEC,QAAQ,EAAE;EAAG,CAAC;EAExC,IAAMC,YAAY,GAAG,IAAAC,+BAAmB,EAACR,YAAY,EAAES,gBAAK,CAAC;EAC7D,IAAMC,eAAe,GAAG,IAAAF,+BAAmB,EAACR,YAAY,EAAEW,mBAAQ,CAAC;EACnE,IAAMC,aAAa,GAAG,IAAAJ,+BAAmB,EAACR,YAAY,EAAEa,iBAAM,CAAC;EAE/D,IAAAC,qBAAA,GAAwC,IAAAC,2CAA+B,EACrEd,KAAK,EACLM,YAAY,EACZG,eAAe,EACfE,aAAa,EACbV,QACF,CAAC;IANeG,SAAS,GAAAS,qBAAA,CAAjBE,MAAM;IAAaV,QAAQ,GAAAQ,qBAAA,CAARR,QAAQ;EAOnC,OAAO;IAAED,SAAS,EAATA,SAAS;IAAEC,QAAQ,EAARA;EAAS,CAAC;AAChC,CAAC;AAAC,IAAAW,QAAA,GAEalB,eAAe;AAAAmB,OAAA,cAAAD,QAAA"}
@@ -10,12 +10,17 @@ require("core-js/modules/es.array.reduce.js");
10
10
  require("core-js/modules/es.object.to-string.js");
11
11
  require("core-js/modules/es.array.concat.js");
12
12
  require("core-js/modules/es.array.join.js");
13
+ require("core-js/modules/es.array.find.js");
14
+ require("core-js/modules/es.object.keys.js");
13
15
  var _isFilterEntitysId = _interopRequireDefault(require("./is-filter-entitys-id"));
14
16
  var _getFilterProps2 = _interopRequireDefault(require("./get-filter-props"));
15
17
  var _constants = require("../constants");
16
- var getQueryProps = function getQueryProps(inheritedFilters, currentSchema, filterEntitySchema) {
18
+ var getQueryProps = function getQueryProps(inheritedFilters, currentSchema) {
19
+ var filterEntitySchema = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
17
20
  if (!currentSchema || !inheritedFilters.length) return _constants.ID;
18
- var currentEntityId = currentSchema.identifier;
21
+ var currentEntityId = currentSchema.identifier,
22
+ properties = currentSchema.properties;
23
+ var filterEntityId = filterEntitySchema.identifier;
19
24
  return inheritedFilters.reduce(function (acc, filter) {
20
25
  var _getFilterProps = (0, _getFilterProps2["default"])(filter, currentSchema, filterEntitySchema),
21
26
  filterName = _getFilterProps.filterName,
@@ -29,6 +34,12 @@ var getQueryProps = function getQueryProps(inheritedFilters, currentSchema, filt
29
34
  if (relationForeignKeys && relationForeignKeys.length) {
30
35
  return "".concat(acc, " ").concat(relationForeignKeys.join(' '));
31
36
  }
37
+ if (filterName === _constants.ID) {
38
+ var queryValue = Object.keys(properties).find(function (propKey) {
39
+ return properties[propKey] && properties[propKey].relation && properties[propKey].relation.entityIdentifier === filterEntityId;
40
+ });
41
+ if (queryValue) return "".concat(acc, " ").concat(queryValue, " ");
42
+ }
32
43
  var queryProp = relationEntityName ? "".concat(relationName, " { ").concat(relationProp, " }") : filterName;
33
44
  var queryPropFinalValue = isEntityItself && (0, _isFilterEntitysId["default"])(filterName, currentEntityId) ? _constants.ID : queryProp;
34
45
  return "".concat(acc, " ").concat(queryPropFinalValue, " ");
@@ -1 +1 @@
1
- {"version":3,"file":"get-query-props.js","names":["_isFilterEntitysId","_interopRequireDefault","require","_getFilterProps2","_constants","getQueryProps","inheritedFilters","currentSchema","filterEntitySchema","length","ID","currentEntityId","identifier","reduce","acc","filter","_getFilterProps","getFilterProps","filterName","relationName","relationProp","relationEntityName","isEntityItself","relationForeignKeys","shouldIgnoreFilter","concat","join","queryProp","queryPropFinalValue","isFilterEntitysId","_default","exports"],"sources":["../../src/helpers/get-query-props.js"],"sourcesContent":["import isFilterEntitysId from './is-filter-entitys-id';\nimport getFilterProps from './get-filter-props';\nimport { ID } from '../constants';\n\nconst getQueryProps = (inheritedFilters, currentSchema, filterEntitySchema) => {\n if (!currentSchema || !inheritedFilters.length) return ID;\n\n const { identifier: currentEntityId } = currentSchema;\n\n return inheritedFilters.reduce((acc, filter) => {\n const {\n filterName,\n relationName,\n relationProp,\n relationEntityName,\n isEntityItself,\n relationForeignKeys,\n shouldIgnoreFilter\n } = getFilterProps(filter, currentSchema, filterEntitySchema);\n\n if (shouldIgnoreFilter) return acc;\n if (relationForeignKeys && relationForeignKeys.length) {\n return `${acc} ${relationForeignKeys.join(' ')}`;\n }\n\n const queryProp = relationEntityName ? `${relationName} { ${relationProp} }` : filterName;\n const queryPropFinalValue =\n isEntityItself && isFilterEntitysId(filterName, currentEntityId) ? ID : queryProp;\n\n return `${acc} ${queryPropFinalValue} `;\n }, ID);\n};\n\nexport default getQueryProps;\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAEA,IAAMG,aAAa,GAAG,SAAhBA,aAAaA,CAAIC,gBAAgB,EAAEC,aAAa,EAAEC,kBAAkB,EAAK;EAC7E,IAAI,CAACD,aAAa,IAAI,CAACD,gBAAgB,CAACG,MAAM,EAAE,OAAOC,aAAE;EAEzD,IAAoBC,eAAe,GAAKJ,aAAa,CAA7CK,UAAU;EAElB,OAAON,gBAAgB,CAACO,MAAM,CAAC,UAACC,GAAG,EAAEC,MAAM,EAAK;IAC9C,IAAAC,eAAA,GAQI,IAAAC,2BAAc,EAACF,MAAM,EAAER,aAAa,EAAEC,kBAAkB,CAAC;MAP3DU,UAAU,GAAAF,eAAA,CAAVE,UAAU;MACVC,YAAY,GAAAH,eAAA,CAAZG,YAAY;MACZC,YAAY,GAAAJ,eAAA,CAAZI,YAAY;MACZC,kBAAkB,GAAAL,eAAA,CAAlBK,kBAAkB;MAClBC,cAAc,GAAAN,eAAA,CAAdM,cAAc;MACdC,mBAAmB,GAAAP,eAAA,CAAnBO,mBAAmB;MACnBC,kBAAkB,GAAAR,eAAA,CAAlBQ,kBAAkB;IAGpB,IAAIA,kBAAkB,EAAE,OAAOV,GAAG;IAClC,IAAIS,mBAAmB,IAAIA,mBAAmB,CAACd,MAAM,EAAE;MACrD,UAAAgB,MAAA,CAAUX,GAAG,OAAAW,MAAA,CAAIF,mBAAmB,CAACG,IAAI,CAAC,GAAG,CAAC;IAChD;IAEA,IAAMC,SAAS,GAAGN,kBAAkB,MAAAI,MAAA,CAAMN,YAAY,SAAAM,MAAA,CAAML,YAAY,UAAOF,UAAU;IACzF,IAAMU,mBAAmB,GACvBN,cAAc,IAAI,IAAAO,6BAAiB,EAACX,UAAU,EAAEP,eAAe,CAAC,GAAGD,aAAE,GAAGiB,SAAS;IAEnF,UAAAF,MAAA,CAAUX,GAAG,OAAAW,MAAA,CAAIG,mBAAmB;EACtC,CAAC,EAAElB,aAAE,CAAC;AACR,CAAC;AAAC,IAAAoB,QAAA,GAEazB,aAAa;AAAA0B,OAAA,cAAAD,QAAA"}
1
+ {"version":3,"file":"get-query-props.js","names":["_isFilterEntitysId","_interopRequireDefault","require","_getFilterProps2","_constants","getQueryProps","inheritedFilters","currentSchema","filterEntitySchema","arguments","length","undefined","ID","currentEntityId","identifier","properties","filterEntityId","reduce","acc","filter","_getFilterProps","getFilterProps","filterName","relationName","relationProp","relationEntityName","isEntityItself","relationForeignKeys","shouldIgnoreFilter","concat","join","queryValue","Object","keys","find","propKey","relation","entityIdentifier","queryProp","queryPropFinalValue","isFilterEntitysId","_default","exports"],"sources":["../../src/helpers/get-query-props.js"],"sourcesContent":["import isFilterEntitysId from './is-filter-entitys-id';\nimport getFilterProps from './get-filter-props';\nimport { ID } from '../constants';\n\nconst getQueryProps = (inheritedFilters, currentSchema, filterEntitySchema = {}) => {\n if (!currentSchema || !inheritedFilters.length) return ID;\n\n const { identifier: currentEntityId, properties } = currentSchema;\n const { identifier: filterEntityId } = filterEntitySchema;\n\n return inheritedFilters.reduce((acc, filter) => {\n const {\n filterName,\n relationName,\n relationProp,\n relationEntityName,\n isEntityItself,\n relationForeignKeys,\n shouldIgnoreFilter\n } = getFilterProps(filter, currentSchema, filterEntitySchema);\n if (shouldIgnoreFilter) return acc;\n if (relationForeignKeys && relationForeignKeys.length) {\n return `${acc} ${relationForeignKeys.join(' ')}`;\n }\n if (filterName === ID) {\n const queryValue = Object.keys(properties).find(\n propKey =>\n properties[propKey] &&\n properties[propKey].relation &&\n properties[propKey].relation.entityIdentifier === filterEntityId\n );\n if (queryValue) return `${acc} ${queryValue} `;\n }\n const queryProp = relationEntityName ? `${relationName} { ${relationProp} }` : filterName;\n const queryPropFinalValue =\n isEntityItself && isFilterEntitysId(filterName, currentEntityId) ? ID : queryProp;\n\n return `${acc} ${queryPropFinalValue} `;\n }, ID);\n};\n\nexport default getQueryProps;\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAEA,IAAMG,aAAa,GAAG,SAAhBA,aAAaA,CAAIC,gBAAgB,EAAEC,aAAa,EAA8B;EAAA,IAA5BC,kBAAkB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAC7E,IAAI,CAACF,aAAa,IAAI,CAACD,gBAAgB,CAACI,MAAM,EAAE,OAAOE,aAAE;EAEzD,IAAoBC,eAAe,GAAiBN,aAAa,CAAzDO,UAAU;IAAmBC,UAAU,GAAKR,aAAa,CAA5BQ,UAAU;EAC/C,IAAoBC,cAAc,GAAKR,kBAAkB,CAAjDM,UAAU;EAElB,OAAOR,gBAAgB,CAACW,MAAM,CAAC,UAACC,GAAG,EAAEC,MAAM,EAAK;IAC9C,IAAAC,eAAA,GAQI,IAAAC,2BAAc,EAACF,MAAM,EAAEZ,aAAa,EAAEC,kBAAkB,CAAC;MAP3Dc,UAAU,GAAAF,eAAA,CAAVE,U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,QAAA"}
@@ -8,7 +8,6 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports["default"] = void 0;
9
9
  require("core-js/modules/es.array.is-array.js");
10
10
  require("core-js/modules/es.array.map.js");
11
- require("core-js/modules/es.array.concat.js");
12
11
  require("core-js/modules/es.array.join.js");
13
12
  var _react = _interopRequireDefault(require("react"));
14
13
  var _BlazeLink = _interopRequireDefault(require("../components/BlazeLink"));
@@ -20,11 +19,11 @@ var getWrappedValueWithLink = function getWrappedValueWithLink(value, link) {
20
19
  url = arrValue.url;
21
20
  var keyValue = arrValue[keyField];
22
21
  var isLastItem = index === value.length - 1;
23
- var keyFieldValue = isLastItem ? keyValue : keyValue.concat(',');
22
+ var keyFieldValue = isLastItem ? keyValue : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, keyValue, ", ");
24
23
  return url ? /*#__PURE__*/_react["default"].createElement(_BlazeLink["default"], {
25
24
  key: [keyPrefix, index].join('-'),
26
25
  href: url
27
- }, "".concat(keyFieldValue, " ")) : "".concat(keyFieldValue, " ");
26
+ }, /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, keyFieldValue, " ")) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, keyFieldValue, " ");
28
27
  });
29
28
  return arrayResults.length ? arrayResults : null;
30
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"get-wrapped-value-with-link.js","names":["_react","_interopRequireDefault","require","_BlazeLink","getWrappedValueWithLink","value","link","keyPrefix","arguments","length","undefined","Array","isArray","arrayResults","map","arrValue","index","keyField","url","keyValue","isLastItem","keyFieldValue","concat","createElement","key","join","href","_default","exports"],"sources":["../../src/helpers/get-wrapped-value-with-link.js"],"sourcesContent":["import React from 'react';\nimport BlazeLink from '../components/BlazeLink';\n\nconst getWrappedValueWithLink = (value, link, keyPrefix = '') => {\n if (Array.isArray(value)) {\n const arrayResults = value.map((arrValue, index) => {\n const { keyField, url } = arrValue;\n const keyValue = arrValue[keyField];\n const isLastItem = index === value.length - 1;\n const keyFieldValue = isLastItem ? keyValue : keyValue.concat(',');\n\n return url ? (\n <BlazeLink key={[keyPrefix, index].join('-')} href={url}>{`${keyFieldValue} `}</BlazeLink>\n ) : (\n `${keyFieldValue} `\n );\n });\n\n return arrayResults.length ? arrayResults : null;\n }\n\n return link ? <BlazeLink href={link}>{value}</BlazeLink> : value;\n};\n\nexport default getWrappedValueWithLink;\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAME,uBAAuB,GAAG,SAA1BA,uBAAuBA,CAAIC,KAAK,EAAEC,IAAI,EAAqB;EAAA,IAAnBC,SAAS,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;EAC1D,IAAIG,KAAK,CAACC,OAAO,CAACP,KAAK,CAAC,EAAE;IACxB,IAAMQ,YAAY,GAAGR,KAAK,CAACS,GAAG,CAAC,UAACC,QAAQ,EAAEC,KAAK,EAAK;MAClD,IAAQC,QAAQ,GAAUF,QAAQ,CAA1BE,QAAQ;QAAEC,GAAG,GAAKH,QAAQ,CAAhBG,GAAG;MACrB,IAAMC,QAAQ,GAAGJ,QAAQ,CAACE,QAAQ,CAAC;MACnC,IAAMG,UAAU,GAAGJ,KAAK,KAAKX,KAAK,CAACI,MAAM,GAAG,CAAC;MAC7C,IAAMY,aAAa,GAAGD,UAAU,GAAGD,QAAQ,GAAGA,QAAQ,CAACG,MAAM,CAAC,GAAG,CAAC;MAElE,OAAOJ,GAAG,gBACRlB,MAAA,YAAAuB,aAAA,CAACpB,UAAA,WAAS;QAACqB,GAAG,EAAE,CAACjB,SAAS,EAAES,KAAK,CAAC,CAACS,IAAI,CAAC,GAAG,CAAE;QAACC,IAAI,EAAER;MAAI,MAAAI,MAAA,CAAKD,aAAa,MAAe,CAAC,MAAAC,MAAA,CAEvFD,aAAa,MACjB;IACH,CAAC,CAAC;IAEF,OAAOR,YAAY,CAACJ,MAAM,GAAGI,YAAY,GAAG,IAAI;EAClD;EAEA,OAAOP,IAAI,gBAAGN,MAAA,YAAAuB,aAAA,CAACpB,UAAA,WAAS;IAACuB,IAAI,EAAEpB;EAAK,GAAED,KAAiB,CAAC,GAAGA,KAAK;AAClE,CAAC;AAAC,IAAAsB,QAAA,GAEavB,uBAAuB;AAAAwB,OAAA,cAAAD,QAAA"}
1
+ {"version":3,"file":"get-wrapped-value-with-link.js","names":["_react","_interopRequireDefault","require","_BlazeLink","getWrappedValueWithLink","value","link","keyPrefix","arguments","length","undefined","Array","isArray","arrayResults","map","arrValue","index","keyField","url","keyValue","isLastItem","keyFieldValue","createElement","Fragment","key","join","href","_default","exports"],"sources":["../../src/helpers/get-wrapped-value-with-link.js"],"sourcesContent":["import React from 'react';\nimport BlazeLink from '../components/BlazeLink';\n\nconst getWrappedValueWithLink = (value, link, keyPrefix = '') => {\n if (Array.isArray(value)) {\n const arrayResults = value.map((arrValue, index) => {\n const { keyField, url } = arrValue;\n const keyValue = arrValue[keyField];\n\n const isLastItem = index === value.length - 1;\n const keyFieldValue = isLastItem ? keyValue : <>{keyValue}, </>;\n\n return url ? (\n <BlazeLink key={[keyPrefix, index].join('-')} href={url}>\n {<>{keyFieldValue} </>}\n </BlazeLink>\n ) : (\n <>{keyFieldValue} </>\n );\n });\n\n return arrayResults.length ? arrayResults : null;\n }\n\n return link ? <BlazeLink href={link}>{value}</BlazeLink> : value;\n};\n\nexport default getWrappedValueWithLink;\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAME,uBAAuB,GAAG,SAA1BA,uBAAuBA,CAAIC,KAAK,EAAEC,IAAI,EAAqB;EAAA,IAAnBC,SAAS,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAA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ildQueryFields["default"];
42
42
  }
43
43
  });
44
+ Object.defineProperty(exports, "buildQueryKey", {
45
+ enumerable: true,
46
+ get: function get() {
47
+ return _buildQueryKey["default"];
48
+ }
49
+ });
44
50
  Object.defineProperty(exports, "buildRawQuery", {
45
51
  enumerable: true,
46
52
  get: function get() {
@@ -275,6 +281,12 @@ Object.defineProperty(exports, "parseTextBlock", {
275
281
  return _parseTextBlock["default"];
276
282
  }
277
283
  });
284
+ Object.defineProperty(exports, "processDataSummaryValue", {
285
+ enumerable: true,
286
+ get: function get() {
287
+ return _processDataSummaryValue["default"];
288
+ }
289
+ });
278
290
  Object.defineProperty(exports, "removeExtraItems", {
279
291
  enumerable: true,
280
292
  get: function get() {
@@ -376,4 +388,6 @@ var _getParsedPropValues = _interopRequireDefault(require("./get-parsed-prop-val
376
388
  var _getSanitizedPropValues = _interopRequireDefault(require("./get-sanitized-prop-values"));
377
389
  var _appendImages = _interopRequireDefault(require("./append-images"));
378
390
  var _parseTextBlock = _interopRequireDefault(require("./parse-TextBlock"));
391
+ var _processDataSummaryValue = _interopRequireDefault(require("./process-data-summary-value"));
392
+ var _buildQueryKey = _interopRequireDefault(require("./build-query-key"));
379
393
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_buildInheritedFilters","_interopRequireDefault","require","_buildLinkExtraProps","_buildPropsQuery","_buildQueryFields","_buildRawQuery","_buildRawQueryBase","_buildSearchValuesCheckboxSelect","_buildSearchValuesText","_buildSetFilters","_checkPropsToUse","_getElasticsearchOperator","_getClickWrapperOptions","_getEntitiesWithBanner","_getEntityData","_getEntityRenderProps","_getGenericProps","_getGenericRenderVariables","_getImageIds","_getInheritedFilters","_getModifiers","_getNotEqualQuery","_getPaginationIndex","_getParsedSummaryValue","_getQueryFilters","_getQueryProps","_getRequiredSchemas","_getSearchFilterType","_getUnpublishedEntityName","_getWrappedValueWithLink","_getItemsToDisplayIds","_isBrowser","_isFilterEntitysId","_isObject","_isUsingRelationImage","_parsePropsToDisplay","_renderChildren","_shouldRenderWaypoint","_shouldShowProperty","_sortResponseData","_splitChildren","_getCurrentOffset","_updateChildrensParent","_getDisplayCountData","_buildImageProperties","_getUpdatedFilterBy","_checkForError","_removeUnwantedCharacters","_hasChildren","_removeExtraItems","_getParsedPropValues","_getSanitizedPropValues","_appendImages","_parseTextBlock"],"sources":["../../src/helpers/index.js"],"sourcesContent":["export { default as buildInheritedFilters } from './build-inherited-filters';\nexport { default as buildLinkExtraProps } from './build-link-extra-props';\nexport { default as buildPropsQuery } from './build-props-query';\nexport { default as buildQueryFields } from './build-query-fields';\nexport { default as buildRawQuery } from './build-raw-query';\nexport { default as buildRawQueryBase } from './build-raw-query-base';\nexport { default as buildSearchValuesCheckboxSelect } from './build-search-values-checkbox-select';\nexport { default as buildSearchValuesText } from './build-search-values-text';\nexport { default as buildSetFilters } from './build-set-filters';\nexport { default as checkPropsToUse } from './check-props-to-use';\nexport { default as getElasticsearchOperator } from './get-elasticsearch-operator';\nexport { default as getClickWrapperOptions } from './get-click-wrapper-options';\nexport { default as getEntitiesWithBanner } from './get-entities-with-banner';\nexport { default as getEntityData } from './get-entity-data';\nexport { default as getEntityRenderProps } from './get-entity-render-props';\nexport { default as getGenericProps } from './get-generic-props';\nexport { default as getGenericRenderVariables } from './get-generic-render-variables';\nexport { default as getImageIds } from './get-image-ids';\nexport { default as getInheritedFilters } from './get-inherited-filters';\nexport { default as getModifiers } from './get-modifiers';\nexport { default as getNotEqualQuery } from './get-not-equal-query';\nexport { default as getPaginationIndex } from './get-pagination-index';\nexport { default as getParsedSummaryValue } from './get-parsed-summary-value';\nexport { default as getQueryFilters } from './get-query-filters';\nexport { default as getQueryProps } from './get-query-props';\nexport { default as getRequiredSchemas } from './get-required-schemas';\nexport { default as getSearchFilterType } from './get-search-filter-type';\nexport { default as getUnpublishedEntityName } from './get-unpublished-entity-name';\nexport { default as getWrappedValueWithLink } from './get-wrapped-value-with-link';\nexport { default as getItemsToDisplayIds } from './get-items-to-display-ids';\nexport { default as isBrowser } from './is-browser';\nexport { default as isFilterEntitysId } from './is-filter-entitys-id';\nexport { default as isObject } from './is-object';\nexport { default as isUsingRelationImage } from './is-using-relation-image';\nexport { default as parsePropsToDisplay } from './parse-props-to-display';\nexport { default as renderChildren } from './render-children';\nexport { default as shouldRenderWaypoint } from './should-render-waypoint';\nexport { default as shouldShowProperty } from './should-show-property';\nexport { default as sortResponseData } from './sort-response-data';\nexport { default as splitChildren } from './split-children';\nexport { default as getCurrentOffset } from './get-current-offset';\nexport { default as updateChildrensParent } from './update-childrens-parent';\nexport { default as getDisplayCountData } from './get-display-count-data';\nexport { default as buildImageProperties } from './build-image-properties';\nexport { default as getUpdatedFilterBy } from './get-updated-filter-by';\nexport { default as checkForError } from './check-for-error';\nexport { default as removeUnwantedCharacters } from './remove-unwanted-characters';\nexport { default as hasChildren } from './has-children';\nexport { default as removeExtraItems } from './remove-extra-items';\nexport { default as getParsedPropValues } from './get-parsed-prop-values';\nexport { default as getSanitizedPropValues } from './get-sanitized-prop-values';\nexport { default as appendImages } from './append-images';\nexport { default as parseTextBlock } from './parse-TextBlock';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,sBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,oBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,gBAAA,GAAAH,sBAAA,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ritedFilters","_interopRequireDefault","require","_buildLinkExtraProps","_buildPropsQuery","_buildQueryFields","_buildRawQuery","_buildRawQueryBase","_buildSearchValuesCheckboxSelect","_buildSearchValuesText","_buildSetFilters","_checkPropsToUse","_getElasticsearchOperator","_getClickWrapperOptions","_getEntitiesWithBanner","_getEntityData","_getEntityRenderProps","_getGenericProps","_getGenericRenderVariables","_getImageIds","_getInheritedFilters","_getModifiers","_getNotEqualQuery","_getPaginationIndex","_getParsedSummaryValue","_getQueryFilters","_getQueryProps","_getRequiredSchemas","_getSearchFilterType","_getUnpublishedEntityName","_getWrappedValueWithLink","_getItemsToDisplayIds","_isBrowser","_isFilterEntitysId","_isObject","_isUsingRelationImage","_parsePropsToDisplay","_renderChildren","_shouldRenderWaypoint","_shouldShowProperty","_sortResponseData","_splitChildren","_getCurrentOffset","_updateChildrensParent","_getDisplayCountData","_buildImageProperties","_getUpdatedFilterBy","_checkForError","_removeUnwantedCharacters","_hasChildren","_removeExtraItems","_getParsedPropValues","_getSanitizedPropValues","_appendImages","_parseTextBlock","_processDataSummaryValue","_buildQueryKey"],"sources":["../../src/helpers/index.js"],"sourcesContent":["export { default as buildInheritedFilters } from './build-inherited-filters';\nexport { default as buildLinkExtraProps } from './build-link-extra-props';\nexport { default as buildPropsQuery } from './build-props-query';\nexport { default as buildQueryFields } from './build-query-fields';\nexport { default as buildRawQuery } from './build-raw-query';\nexport { default as buildRawQueryBase } from './build-raw-query-base';\nexport { default as buildSearchValuesCheckboxSelect } from './build-search-values-checkbox-select';\nexport { default as buildSearchValuesText } from './build-search-values-text';\nexport { default as buildSetFilters } from './build-set-filters';\nexport { default as checkPropsToUse } from './check-props-to-use';\nexport { default as getElasticsearchOperator } from './get-elasticsearch-operator';\nexport { default as getClickWrapperOptions } from './get-click-wrapper-options';\nexport { default as getEntitiesWithBanner } from './get-entities-with-banner';\nexport { default as getEntityData } from './get-entity-data';\nexport { default as getEntityRenderProps } from './get-entity-render-props';\nexport { default as getGenericProps } from './get-generic-props';\nexport { default as getGenericRenderVariables } from './get-generic-render-variables';\nexport { default as getImageIds } from './get-image-ids';\nexport { default as getInheritedFilters } from './get-inherited-filters';\nexport { default as getModifiers } from './get-modifiers';\nexport { default as getNotEqualQuery } from './get-not-equal-query';\nexport { default as getPaginationIndex } from './get-pagination-index';\nexport { default as getParsedSummaryValue } from './get-parsed-summary-value';\nexport { default as getQueryFilters } from './get-query-filters';\nexport { default as getQueryProps } from './get-query-props';\nexport { default as getRequiredSchemas } from './get-required-schemas';\nexport { default as getSearchFilterType } from './get-search-filter-type';\nexport { default as getUnpublishedEntityName } from './get-unpublished-entity-name';\nexport { default as getWrappedValueWithLink } from './get-wrapped-value-with-link';\nexport { default as getItemsToDisplayIds } from './get-items-to-display-ids';\nexport { default as isBrowser } from './is-browser';\nexport { default as isFilterEntitysId } from './is-filter-entitys-id';\nexport { default as isObject } from './is-object';\nexport { default as isUsingRelationImage } from './is-using-relation-image';\nexport { default as parsePropsToDisplay } from './parse-props-to-display';\nexport { default as renderChildren } from './render-children';\nexport { default as shouldRenderWaypoint } from './should-render-waypoint';\nexport { default as shouldShowProperty } from './should-show-property';\nexport { default as sortResponseData } from './sort-response-data';\nexport { default as splitChildren } from './split-children';\nexport { default as getCurrentOffset } from './get-current-offset';\nexport { default as updateChildrensParent } from './update-childrens-parent';\nexport { default as getDisplayCountData } from './get-display-count-data';\nexport { default as buildImageProperties } from './build-image-properties';\nexport { default as getUpdatedFilterBy } from './get-updated-filter-by';\nexport { default as checkForError } from './check-for-error';\nexport { default as removeUnwantedCharacters } from './remove-unwanted-characters';\nexport { default as hasChildren } from './has-children';\nexport { default as removeExtraItems } from './remove-extra-items';\nexport { default as getParsedPropValues } from './get-parsed-prop-values';\nexport { default as getSanitizedPropValues } from './get-sanitized-prop-values';\nexport { default as appendImages } from './append-images';\nexport { default as parseTextBlock } from './parse-TextBlock';\nexport { default as processDataSummaryValue } from './process-data-summary-value';\nexport { default as buildQueryKey } from './build-query-key';\n"],"mappings":";;;;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AC,OAAA;AACA,IAAA2C,qBAAA,GAAA5C,sBAAA,CAAAC,OAAA;AACA,IAAA4C,mBAAA,GAAA7C,sBAAA,CAAAC,OAAA;AACA,IAAA6C,cAAA,GAAA9C,sBAAA,CAAAC,OAAA;AACA,IAAA8C,yBAAA,GAAA/C,sBAAA,CAAAC,OAAA;AACA,IAAA+C,YAAA,GAAAhD,sBAAA,CAAAC,OAAA;AACA,IAAAgD,iBAAA,GAAAjD,sBAAA,CAAAC,OAAA;AACA,IAAAiD,oBAAA,GAAAlD,sBAAA,CAAAC,OAAA;AACA,IAAAkD,uBAAA,GAAAnD,sBAAA,CAAAC,OAAA;AACA,IAAAmD,aAAA,GAAApD,sBAAA,CAAAC,OAAA;AACA,IAAAoD,eAAA,GAAArD,sBAAA,CAAAC,OAAA;AACA,IAAAqD,wBAAA,GAAAtD,sBAAA,CAAAC,OAAA;AACA,IAAAsD,cAAA,GAAAvD,sBAAA,CAAAC,OAAA"}
@@ -16,12 +16,14 @@ require("core-js/modules/es.array.filter.js");
16
16
  require("core-js/modules/es.object.to-string.js");
17
17
  require("core-js/modules/es.array.map.js");
18
18
  require("core-js/modules/es.string.bold.js");
19
+ require("core-js/modules/es.array.is-array.js");
19
20
  var _react = _interopRequireWildcard(require("react"));
20
21
  var _lodash = _interopRequireDefault(require("lodash.at"));
21
22
  var _isObject = _interopRequireDefault(require("./is-object"));
22
23
  var _getParsedPropValues = _interopRequireDefault(require("./get-parsed-prop-values"));
23
24
  var _getSanitizedPropValues = _interopRequireDefault(require("./get-sanitized-prop-values"));
24
25
  var _constants = require("../constants");
26
+ var _processDataSummaryValue = _interopRequireDefault(require("./process-data-summary-value"));
25
27
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
26
28
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
29
  // TODO this helper should be removed if database is wiped clean and all elements change to new props struc
@@ -29,13 +31,13 @@ var parsePropsToDisplay = function parsePropsToDisplay() {
29
31
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
30
32
  var propsToDisplay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
31
33
  if (!(0, _isObject["default"])(propsToDisplay[0])) return (0, _lodash["default"])(props, propsToDisplay).filter(Boolean);
32
- return propsToDisplay.map(function (_ref, currentIndex) {
33
- var bold = _ref.bold,
34
- propertiesToDisplay = _ref.propertiesToDisplay,
35
- prefix = _ref.prefix,
36
- suffix = _ref.suffix,
37
- shouldStrip = _ref.shouldStrip,
38
- enableLink = _ref.enableLink;
34
+ return propsToDisplay.map(function (options, currentIndex) {
35
+ var bold = options.bold,
36
+ propertiesToDisplay = options.propertiesToDisplay,
37
+ prefix = options.prefix,
38
+ suffix = options.suffix,
39
+ shouldStrip = options.shouldStrip,
40
+ enableLink = options.enableLink;
39
41
  var Wrapper = bold ? _constants.BOLD_TAG : _react.Fragment;
40
42
  var parsedPropValues = (0, _getParsedPropValues["default"])({
41
43
  propertiesToDisplay: propertiesToDisplay,
@@ -46,7 +48,10 @@ var parsePropsToDisplay = function parsePropsToDisplay() {
46
48
  var sanitizedPropValues = (0, _getSanitizedPropValues["default"])(parsedPropValues);
47
49
  if (!sanitizedPropValues || !sanitizedPropValues.length) return null;
48
50
  var stringEndBlank = currentIndex + 1 === propsToDisplay.length ? '' : _constants.BLANK_SPACE_UNICODE_STRING;
49
- return /*#__PURE__*/_react["default"].createElement(Wrapper, null, prefix, " ", sanitizedPropValues, " ", suffix, stringEndBlank);
51
+ var processedValue = Array.isArray(sanitizedPropValues) ? sanitizedPropValues.map(function (value) {
52
+ return (0, _processDataSummaryValue["default"])(value, options);
53
+ }) : (0, _processDataSummaryValue["default"])(sanitizedPropValues, options);
54
+ return /*#__PURE__*/_react["default"].createElement(Wrapper, null, prefix, " ", processedValue, " ", suffix, stringEndBlank);
50
55
  });
51
56
  };
52
57
  var _default = parsePropsToDisplay;
@@ -1 +1 @@
1
- {"version":3,"file":"parse-props-to-display.js","names":["_react","_interopRequireWildcard","require","_lodash","_interopRequireDefault","_isObject","_getParsedPropValues","_getSanitizedPropValues","_constants","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","parsePropsToDisplay","props","arguments","length","undefined","propsToDisplay","isObject","at","filter","Boolean","map","_ref","currentIndex","bold","propertiesToDisplay","prefix","suffix","shouldStrip","enableLink","Wrapper","BOLD_TAG","Fragment","parsedPropValues","getParsedPropValues","sanitizedPropValues","getSanitizedPropValues","stringEndBlank","BLANK_SPACE_UNICODE_STRING","createElement","_default","exports"],"sources":["../../src/helpers/parse-props-to-display.js"],"sourcesContent":["import React, { Fragment } from 'react';\nimport at from 'lodash.at';\nimport isObject from './is-object';\nimport getParsedPropValues from './get-parsed-prop-values';\nimport getSanitizedPropValues from './get-sanitized-prop-values';\nimport { BOLD_TAG, BLANK_SPACE_UNICODE_STRING } from '../constants';\n\n// TODO this helper should be removed if database is wiped clean and all elements change to new props struc\nconst parsePropsToDisplay = (props = {}, propsToDisplay = []) => {\n if (!isObject(propsToDisplay[0])) return at(props, propsToDisplay).filter(Boolean);\n\n return propsToDisplay.map(\n ({ bold, propertiesToDisplay, prefix, suffix, shouldStrip, enableLink }, currentIndex) => {\n const Wrapper = bold ? BOLD_TAG : Fragment;\n\n const parsedPropValues = getParsedPropValues({\n propertiesToDisplay,\n props,\n enableLink,\n shouldStrip\n });\n\n const sanitizedPropValues = getSanitizedPropValues(parsedPropValues);\n if (!sanitizedPropValues || !sanitizedPropValues.length) return null;\n const stringEndBlank =\n currentIndex + 1 === propsToDisplay.length ? '' : BLANK_SPACE_UNICODE_STRING;\n\n return (\n <Wrapper>\n {prefix} {sanitizedPropValues} {suffix}\n {stringEndBlank}\n </Wrapper>\n );\n }\n );\n};\n\nexport default parsePropsToDisplay;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,oBAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,uBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AAAoE,SAAAO,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAT,wBAAAa,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,uCAAAA,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,C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MAAEC,MAAM,GAAAJ,IAAA,CAANI,MAAM;MAAEC,MAAM,GAAAL,IAAA,CAANK,MAAM;MAAEC,WAAW,GAAAN,IAAA,CAAXM,WAAW;MAAEC,UAAU,GAAAP,IAAA,CAAVO,UAAU;IACnE,IAAMC,OAAO,GAAGN,IAAI,GAAGO,mBAAQ,GAAGC,eAAQ;IAE1C,IAAMC,gBAAgB,GAAG,IAAAC,+BAAmB,EAAC;MAC3CT,mBAAmB,EAAnBA,mBAAmB;MACnBb,KAAK,EAALA,KAAK;MACLiB,UAAU,EAAVA,UAAU;MACVD,WAAW,EAAXA;IACF,CAAC,CAAC;IAEF,IAAMO,mBAAmB,GAAG,IAAAC,kCAAsB,EAACH,gBAAgB,CAAC;IACpE,IAAI,CAACE,mBAAmB,IAAI,CAACA,mBAAmB,CAACrB,MAAM,EAAE,OAAO,IAAI;IACpE,IAAMuB,cAAc,GAClBd,YAAY,GAAG,CAAC,KAAKP,cAAc,CAACF,MAAM,GAAG,EAAE,GAAGwB,qCAA0B;IAE9E,oBACE1D,MAAA,YAAA2D,aAAA,CAACT,OAAO,QACLJ,MAAM,EAAC,GAAC,EAACS,mBAAmB,EAAC,GAAC,EAACR,MAAM,EACrCU,cACM,CAAC;EAEd,CACF,CAAC;AACH,CAAC;AAAC,IAAAG,QAAA,GAEa7B,mBAAmB;AAAA8B,OAAA,cAAAD,QAAA"}
1
+ {"version":3,"file":"parse-props-to-display.js","names":["_react","_interopRequireWildcard","require","_lodash","_interopRequireDefault","_isObject","_getParsedPropValues","_getSanitizedPropValues","_constants","_processDataSummaryValue","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","parsePropsToDisplay","props","arguments","length","undefined","propsToDisplay","isObject","at","filter","Boolean","map","options","currentIndex","bold","propertiesToDisplay","prefix","suffix","shouldStrip","enableLink","Wrapper","BOLD_TAG","Fragment","parsedPropValues","getParsedPropValues","sanitizedPropValues","getSanitizedPropValues","stringEndBlank","BLANK_SPACE_UNICODE_STRING","processedValue","Array","isArray","value","processDataSummaryValue","createElement","_default","exports"],"sources":["../../src/helpers/parse-props-to-display.js"],"sourcesContent":["import React, { Fragment } from 'react';\nimport at from 'lodash.at';\nimport isObject from './is-object';\nimport getParsedPropValues from './get-parsed-prop-values';\nimport getSanitizedPropValues from './get-sanitized-prop-values';\nimport { BOLD_TAG, BLANK_SPACE_UNICODE_STRING } from '../constants';\nimport processDataSummaryValue from './process-data-summary-value';\n\n// TODO this helper should be removed if database is wiped clean and all elements change to new props struc\nconst parsePropsToDisplay = (props = {}, propsToDisplay = []) => {\n if (!isObject(propsToDisplay[0])) return at(props, propsToDisplay).filter(Boolean);\n\n return propsToDisplay.map((options, currentIndex) => {\n const { bold, propertiesToDisplay, prefix, suffix, shouldStrip, enableLink } = options;\n const Wrapper = bold ? BOLD_TAG : Fragment;\n\n const parsedPropValues = getParsedPropValues({\n propertiesToDisplay,\n props,\n enableLink,\n shouldStrip\n });\n\n const sanitizedPropValues = getSanitizedPropValues(parsedPropValues);\n if (!sanitizedPropValues || !sanitizedPropValues.length) return null;\n const stringEndBlank =\n currentIndex + 1 === propsToDisplay.length ? '' : BLANK_SPACE_UNICODE_STRING;\n\n const processedValue = Array.isArray(sanitizedPropValues)\n ? sanitizedPropValues.map(value => processDataSummaryValue(value, options))\n : processDataSummaryValue(sanitizedPropValues, options);\n\n return (\n <Wrapper>\n {prefix} {processedValue} {suffix}\n {stringEndBlank}\n </Wrapper>\n );\n });\n};\n\nexport default parsePropsToDisplay;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,oBAAA,GAAAF,s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E,IAAMC,cAAc,GAAGC,KAAK,CAACC,OAAO,CAACN,mBAAmB,CAAC,GACrDA,mBAAmB,CAACd,GAAG,CAAC,UAAAqB,KAAK;MAAA,OAAI,IAAAC,mCAAuB,EAACD,KAAK,EAAEpB,OAAO,CAAC;IAAA,EAAC,GACzE,IAAAqB,mCAAuB,EAACR,mBAAmB,EAAEb,OAAO,CAAC;IAEzD,oBACE3C,MAAA,YAAAiE,aAAA,CAACd,OAAO,QACLJ,MAAM,EAAC,GAAC,EAACa,cAAc,EAAC,GAAC,EAACZ,MAAM,EAChCU,cACM,CAAC;EAEd,CAAC,CAAC;AACJ,CAAC;AAAC,IAAAQ,QAAA,GAEalC,mBAAmB;AAAAmC,OAAA,cAAAD,QAAA"}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.symbol.to-primitive.js");
4
+ require("core-js/modules/es.date.to-primitive.js");
5
+ require("core-js/modules/es.symbol.js");
6
+ require("core-js/modules/es.symbol.description.js");
7
+ require("core-js/modules/es.object.to-string.js");
8
+ require("core-js/modules/es.number.constructor.js");
9
+ require("core-js/modules/es.object.keys.js");
10
+ require("core-js/modules/es.array.filter.js");
11
+ require("core-js/modules/es.object.get-own-property-descriptor.js");
12
+ require("core-js/modules/es.array.for-each.js");
13
+ require("core-js/modules/web.dom-collections.for-each.js");
14
+ require("core-js/modules/es.object.get-own-property-descriptors.js");
15
+ require("core-js/modules/es.object.define-properties.js");
16
+ require("core-js/modules/es.object.define-property.js");
17
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
18
+ var _typeof = require("@babel/runtime/helpers/typeof");
19
+ Object.defineProperty(exports, "__esModule", {
20
+ value: true
21
+ });
22
+ exports["default"] = void 0;
23
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
24
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
25
+ require("core-js/modules/es.array.is-array.js");
26
+ require("core-js/modules/es.array.map.js");
27
+ var _react = _interopRequireDefault(require("react"));
28
+ var _components = _interopRequireDefault(require("../components"));
29
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
30
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
31
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
32
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
33
+ var Code = _components["default"].code;
34
+ var renderCode = function renderCode(value) {
35
+ return /*#__PURE__*/_react["default"].createElement(Code, {
36
+ code: value,
37
+ disableWrapper: true
38
+ });
39
+ };
40
+ var processDataSummaryValue = function processDataSummaryValue(objPropValue, _ref) {
41
+ var isHtml = _ref.isHtml;
42
+ var pValue = objPropValue;
43
+ if (isHtml) {
44
+ pValue = Array.isArray(objPropValue) ? objPropValue.map(function (_ref2) {
45
+ var _objectSpread2;
46
+ var keyField = _ref2.keyField,
47
+ value = _ref2[keyField],
48
+ otherProps = (0, _objectWithoutProperties2["default"])(_ref2, ["keyField", keyField].map(_toPropertyKey));
49
+ return _objectSpread((_objectSpread2 = {}, (0, _defineProperty2["default"])(_objectSpread2, keyField, renderCode(value)), (0, _defineProperty2["default"])(_objectSpread2, "keyField", keyField), _objectSpread2), otherProps);
50
+ }) : renderCode(objPropValue);
51
+ }
52
+ return pValue;
53
+ };
54
+ var _default = processDataSummaryValue;
55
+ exports["default"] = _default;
56
+ //# sourceMappingURL=process-data-summary-value.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-data-summary-value.js","names":["_react","_interopRequireDefault","require","_components","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","arg","_toPrimitive","_typeof","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","Code","components","code","renderCode","value","createElement","disableWrapper","processDataSummaryValue","objPropValue","_ref","isHtml","pValue","Array","isArray","map","_ref2","_objectSpread2","keyField","otherProps","_objectWithoutProperties2","_default","exports"],"sources":["../../src/helpers/process-data-summary-value.js"],"sourcesContent":["import React from 'react';\nimport components from '../components';\n\nconst { code: Code } = components;\n\nconst renderCode = value => <Code code={value} disableWrapper />;\n\nconst processDataSummaryValue = (objPropValue, { isHtml }) => {\n let pValue = objPropValue;\n if (isHtml) {\n pValue = Array.isArray(objPropValue)\n ? objPropValue.map(({ keyField, [keyField]: value, ...otherProps }) => ({\n [keyField]: renderCode(value),\n keyField,\n ...otherProps\n }))\n : renderCode(objPropValue);\n }\n return pValue;\n};\n\nexport default processDataSummaryValue;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AAAuC,SAAAE,QAAAC,MAAA,EAAAC,cAAA,QAAAC,IAAA,GAAAC,MAAA,CAAAD,IAAA,CAAAF,MAAA,OAAAG,MAAA,CAAAC,qBAAA,QA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? router.reload(urlToUse) : router.reload();
58
+ if (hasChildren(children)) return setShowChildren(true);
59
+ return url ? router.reload(urlToUse) : router.reload();
59
60
  };
60
61
  const handleClick = () => {
61
62
  if (isLogoutButton) logout();
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","names":["React","useState","Fragment","useEffect","useCookies","useRouter","classnames","BlazeButton","handleLogout","useApolloClient","PropTypes","bool","string","useStringTemplate","ClickWrapper","BlazeLink","withTitle","getClassModifiers","LOGOUT","renderChildren","updateChildrensParent","hasChildren","getClickWrapperOptions","Button","props","type","text","url","icon","name","style","children","clickAction","childSeoVisibility","afterClickText","parent","otherProps","_objectWithoutProperties","_excluded","client","router","isLogoutButton","cookies","blaze_auth","blazeCookie","showChildren","setShowChildren","data","textToUse","afterClickTextToUse","urlToUse","asPath","checkIfButtonShouldRender","logout","reload","handleClick","buttonType","modifiers","_objectSpread","currentProps","href","title","DynamicButton","itemId","itemEntity","renderedChildren","onClose","shouldUseClickWrapper","wrapperProps","Wrapper","contentClassName","createElement","className","_extends","onClick","propTypes","object","size","oneOfType","arrayOf","node","defaultProps"],"sources":["../../src/components/Button.js"],"sourcesContent":["import React, { useState, Fragment, useEffect } from 'react';\nimport { useCookies } from 'react-cookie';\nimport { useRouter } from 'next/router';\nimport classnames from 'classnames';\nimport BlazeButton from '@blaze-react/button';\nimport { handleLogout } from '@blaze-cms/core-auth-ui';\nimport { useApolloClient } from '@apollo/client';\nimport PropTypes, { bool, string } from 'prop-types';\nimport { useStringTemplate } from '@blaze-cms/utils-handlebars';\nimport ClickWrapper from './ClickWrapper';\nimport BlazeLink from './BlazeLink';\nimport { withTitle } from '../HOC';\nimport { getClassModifiers } from '../utils';\nimport { LOGOUT } from '../constants';\nimport {\n renderChildren,\n updateChildrensParent,\n hasChildren,\n getClickWrapperOptions\n} from '../helpers';\n\nconst Button = props => {\n const {\n type,\n text,\n url,\n icon,\n name,\n style,\n children,\n clickAction,\n childSeoVisibility,\n afterClickText,\n parent,\n ...otherProps\n } = props;\n const client = useApolloClient();\n const router = useRouter();\n const isLogoutButton = clickAction === LOGOUT;\n const [cookies] = useCookies();\n const { blaze_auth: blazeCookie } = cookies;\n const [showChildren, setShowChildren] = useState(false);\n const {\n data: [textToUse, afterClickTextToUse, urlToUse]\n } = useStringTemplate(parent, [text, afterClickText, url]);\n\n useEffect(\n () => {\n setShowChildren(false);\n },\n [router.asPath]\n );\n\n const checkIfButtonShouldRender = () => {\n if (isLogoutButton) return !!blazeCookie;\n if (!text && !icon) return false;\n return !!(url || hasChildren(children));\n };\n\n const logout = () => {\n handleLogout(client);\n url ? router.reload(urlToUse) : router.reload();\n };\n\n const handleClick = () => {\n if (isLogoutButton) logout();\n if (!url && !isLogoutButton) setShowChildren(!showChildren);\n };\n\n if (!checkIfButtonShouldRender()) return null;\n\n const buttonType = !text && icon ? 'icon' : type;\n const modifiers = getClassModifiers(buttonType, { icon, style, ...otherProps });\n const currentProps = url ? { href: urlToUse, title: name } : { name };\n const DynamicButton = url && !isLogoutButton ? BlazeLink : BlazeButton;\n updateChildrensParent(children, parent.itemId, parent.itemEntity);\n\n const renderedChildren = renderChildren(children, { onClose: handleClick });\n const { shouldUseClickWrapper, wrapperProps } = getClickWrapperOptions(children, props);\n const Wrapper = shouldUseClickWrapper ? ClickWrapper : Fragment;\n\n const contentClassName = classnames('button__content', {\n 'button__content--show': showChildren\n });\n\n return (\n <Wrapper {...wrapperProps}>\n {childSeoVisibility && <div className={contentClassName}>{renderedChildren}</div>}\n {!childSeoVisibility && showChildren && renderedChildren}\n <DynamicButton className={modifiers} onClick={handleClick} {...currentProps}>\n {icon && <i className={icon} />}\n {showChildren ? afterClickTextToUse : textToUse}\n </DynamicButton>\n </Wrapper>\n );\n};\n\nButton.propTypes = {\n parent: PropTypes.object,\n clickAction: PropTypes.string,\n text: PropTypes.string,\n afterClickText: string,\n name: PropTypes.string,\n type: PropTypes.string,\n url: PropTypes.string,\n size: PropTypes.string,\n icon: PropTypes.string,\n style: PropTypes.string,\n childSeoVisibility: bool,\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node])\n};\n\nButton.defaultProps = {\n parent: {},\n clickAction: '',\n text: '',\n afterClickText: '',\n name: '',\n type: '',\n url: null,\n size: '',\n icon: '',\n style: '',\n children: [],\n childSeoVisibility: false\n};\n\nexport default withTitle(Button);\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAC5D,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,SAAS,QAAQ,aAAa;AACvC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,WAAW,MAAM,qBAAqB;AAC7C,SAASC,YAAY,QAAQ,yBAAyB;AACtD,SAASC,eAAe,QAAQ,gBAAgB;AAChD,OAAOC,SAAS,IAAIC,IAAI,EAAEC,MAAM,QAAQ,YAAY;AACpD,SAASC,iBAAiB,QAAQ,6BAA6B;AAC/D,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,SAAS,MAAM,aAAa;AACnC,SAASC,SAAS,QAAQ,QAAQ;AAClC,SAASC,iBAAiB,QAAQ,UAAU;AAC5C,SAASC,MAAM,QAAQ,cAAc;AACrC,SACEC,cAAc,EACdC,qBAAqB,EACrBC,WAAW,EACXC,sBAAsB,QACjB,YAAY;AAEnB,MAAMC,MAAM,GAAGC,KAAK,IAAI;EACtB,MAAM;MACJC,IAAI;MACJC,IAAI;MACJC,GAAG;MACHC,IAAI;MACJC,IAAI;MACJC,KAAK;MACLC,QAAQ;MACRC,WAAW;MACXC,kBAAkB;MAClBC,cAAc;MACdC;IAEF,CAAC,GAAGX,KAAK;IADJY,UAAU,GAAAC,wBAAA,CACXb,KAAK,EAAAc,SAAA;EACT,MAAMC,MAAM,GAAG9B,eAAe,CAAC,CAAC;EAChC,MAAM+B,MAAM,GAAGnC,SAAS,CAAC,CAAC;EAC1B,MAAMoC,cAAc,GAAGT,WAAW,KAAKd,MAA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,CAAC;AAEDzB,MAAM,CAACoD,SAAS,GAAG;EACjBxC,MAAM,EAAEzB,SAAS,CAACkE,MAAM;EACxB5C,WAAW,EAAEtB,SAAS,CAACE,MAAM;EAC7Bc,IAAI,EAAEhB,SAAS,CAACE,MAAM;EACtBsB,cAAc,EAAEtB,MAAM;EACtBiB,IAAI,EAAEnB,SAAS,CAACE,MAAM;EACtBa,IAAI,EAAEf,SAAS,CAACE,MAAM;EACtBe,GAAG,EAAEjB,SAAS,CAACE,MAAM;EACrBiE,IAAI,EAAEnE,SAAS,CAACE,MAAM;EACtBgB,IAAI,EAAElB,SAAS,CAACE,MAAM;EACtBkB,KAAK,EAAEpB,SAAS,CAACE,MAAM;EACvBqB,kBAAkB,EAAEtB,IAAI;EACxBoB,QAAQ,EAAErB,SAAS,CAACoE,SAAS,CAAC,CAACpE,SAAS,CAACqE,OAAO,CAACrE,SAAS,CAACsE,IAAI,CAAC,EAAEtE,SAAS,CAACsE,IAAI,CAAC;AACnF,CAAC;AAEDzD,MAAM,CAAC0D,YAAY,GAAG;EACpB9C,MAAM,EAAE,CAAC,CAAC;EACVH,WAAW,EAAE,EAAE;EACfN,IAAI,EAAE,EAAE;EACRQ,cAAc,EAAE,EAAE;EAClBL,IAAI,EAAE,EAAE;EACRJ,IAAI,EAAE,EAAE;EACRE,GAAG,EAAE,IAAI;EACTkD,IAAI,EAAE,EAAE;EACRjD,IAAI,EAAE,EAAE;EACRE,KAAK,EAAE,EAAE;EACTC,QAAQ,EAAE,EAAE;EACZE,kBAAkB,EAAE;AACtB,CAAC;AAED,eAAejB,SAAS,CAACO,MAAM,CAAC"}
1
+ {"version":3,"file":"Button.js","names":["React","useState","Fragment","useEffect","useCookies","useRouter","classnames","BlazeButton","handleLogout","useApolloClient","PropTypes","bool","string","useStringTemplate","ClickWrapper","BlazeLink","withTitle","getClassModifiers","LOGOUT","renderChildren","updateChildrensParent","hasChildren","getClickWrapperOptions","Button","props","type","text","url","icon","name","style","children","clickAction","childSeoVisibility","afterClickText","parent","otherProps","_objectWithoutProperties","_excluded","client","router","isLogoutButton","cookies","blaze_auth","blazeCookie","showChildren","setShowChildren","data","textToUse","afterClickTextToUse","urlToUse","asPath","checkIfButtonShouldRender","logout","reload","handleClick","buttonType","modifiers","_objectSpread","currentProps","href","title","DynamicButton","itemId","itemEntity","renderedChildren","onClose","shouldUseClickWrapper","wrapperProps","Wrapper","contentClassName","createElement","className","_extends","onClick","propTypes","object","size","oneOfType","arrayOf","node","defaultProps"],"sources":["../../src/components/Button.js"],"sourcesContent":["import React, { useState, Fragment, useEffect } from 'react';\nimport { useCookies } from 'react-cookie';\nimport { useRouter } from 'next/router';\nimport classnames from 'classnames';\nimport BlazeButton from '@blaze-react/button';\nimport { handleLogout } from '@blaze-cms/core-auth-ui';\nimport { useApolloClient } from '@apollo/client';\nimport PropTypes, { bool, string } from 'prop-types';\nimport { useStringTemplate } from '@blaze-cms/utils-handlebars';\nimport ClickWrapper from './ClickWrapper';\nimport BlazeLink from './BlazeLink';\nimport { withTitle } from '../HOC';\nimport { getClassModifiers } from '../utils';\nimport { LOGOUT } from '../constants';\nimport {\n renderChildren,\n updateChildrensParent,\n hasChildren,\n getClickWrapperOptions\n} from '../helpers';\n\nconst Button = props => {\n const {\n type,\n text,\n url,\n icon,\n name,\n style,\n children,\n clickAction,\n childSeoVisibility,\n afterClickText,\n parent,\n ...otherProps\n } = props;\n const client = useApolloClient();\n const router = useRouter();\n const isLogoutButton = clickAction === LOGOUT;\n const [cookies] = useCookies();\n const { blaze_auth: blazeCookie } = cookies;\n const [showChildren, setShowChildren] = useState(false);\n const {\n data: [textToUse, afterClickTextToUse, urlToUse]\n } = useStringTemplate(parent, [text, afterClickText, url]);\n\n useEffect(\n () => {\n setShowChildren(false);\n },\n [router.asPath]\n );\n\n const checkIfButtonShouldRender = () => {\n if (isLogoutButton) return !!blazeCookie;\n if (!text && !icon) return false;\n return !!(url || hasChildren(children));\n };\n\n const logout = () => {\n handleLogout(client);\n if (hasChildren(children)) return setShowChildren(true);\n return url ? router.reload(urlToUse) : router.reload();\n };\n\n const handleClick = () => {\n if (isLogoutButton) logout();\n if (!url && !isLogoutButton) setShowChildren(!showChildren);\n };\n\n if (!checkIfButtonShouldRender()) return null;\n\n const buttonType = !text && icon ? 'icon' : type;\n const modifiers = getClassModifiers(buttonType, { icon, style, ...otherProps });\n const currentProps = url ? { href: urlToUse, title: name } : { name };\n const DynamicButton = url && !isLogoutButton ? BlazeLink : BlazeButton;\n updateChildrensParent(children, parent.itemId, parent.itemEntity);\n\n const renderedChildren = renderChildren(children, { onClose: handleClick });\n const { shouldUseClickWrapper, wrapperProps } = getClickWrapperOptions(children, props);\n const Wrapper = shouldUseClickWrapper ? ClickWrapper : Fragment;\n\n const contentClassName = classnames('button__content', {\n 'button__content--show': showChildren\n });\n\n return (\n <Wrapper {...wrapperProps}>\n {childSeoVisibility && <div className={contentClassName}>{renderedChildren}</div>}\n {!childSeoVisibility && showChildren && renderedChildren}\n <DynamicButton className={modifiers} onClick={handleClick} {...currentProps}>\n {icon && <i className={icon} />}\n {showChildren ? afterClickTextToUse : textToUse}\n </DynamicButton>\n </Wrapper>\n );\n};\n\nButton.propTypes = {\n parent: PropTypes.object,\n clickAction: PropTypes.string,\n text: PropTypes.string,\n afterClickText: string,\n name: PropTypes.string,\n type: PropTypes.string,\n url: PropTypes.string,\n size: PropTypes.string,\n icon: PropTypes.string,\n style: PropTypes.string,\n childSeoVisibility: bool,\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node])\n};\n\nButton.defaultProps = {\n parent: {},\n clickAction: '',\n text: '',\n afterClickText: '',\n name: '',\n type: '',\n url: null,\n size: '',\n icon: '',\n style: '',\n children: [],\n childSeoVisibility: false\n};\n\nexport default withTitle(Button);\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAC5D,SAASC,UAAU,QAAQ,cAAc;AACzC,S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CAACE,MAAM;EACtBe,GAAG,EAAEjB,SAAS,CAACE,MAAM;EACrBiE,IAAI,EAAEnE,SAAS,CAACE,MAAM;EACtBgB,IAAI,EAAElB,SAAS,CAACE,MAAM;EACtBkB,KAAK,EAAEpB,SAAS,CAACE,MAAM;EACvBqB,kBAAkB,EAAEtB,IAAI;EACxBoB,QAAQ,EAAErB,SAAS,CAACoE,SAAS,CAAC,CAACpE,SAAS,CAACqE,OAAO,CAACrE,SAAS,CAACsE,IAAI,CAAC,EAAEtE,SAAS,CAACsE,IAAI,CAAC;AACnF,CAAC;AAEDzD,MAAM,CAAC0D,YAAY,GAAG;EACpB9C,MAAM,EAAE,CAAC,CAAC;EACVH,WAAW,EAAE,EAAE;EACfN,IAAI,EAAE,EAAE;EACRQ,cAAc,EAAE,EAAE;EAClBL,IAAI,EAAE,EAAE;EACRJ,IAAI,EAAE,EAAE;EACRE,GAAG,EAAE,IAAI;EACTkD,IAAI,EAAE,EAAE;EACRjD,IAAI,EAAE,EAAE;EACRE,KAAK,EAAE,EAAE;EACTC,QAAQ,EAAE,EAAE;EACZE,kBAAkB,EAAE;AACtB,CAAC;AAED,eAAejB,SAAS,CAACO,MAAM,CAAC"}
@@ -13,7 +13,7 @@ import { generateSingleItemQuery } from '../../application/query';
13
13
  import { SEARCH_PUBLISHED_CONTENT, AND } from '../../constants';
14
14
  import { useGetEntitySchemasAsObj, useGetImages } from '../../hooks';
15
15
  import { getUpdatedFilterBy, getEntityData, getRequiredSchemas, sortResponseData, getUnpublishedEntityName, renderChildren, splitChildren, removeExtraItems, appendImages } from '../../helpers';
16
- import { filtersSetup, filterQuerySetup, shouldSkipSingleQuery, shouldReturn, getUpdatedSortProperties } from './helpers';
16
+ import { filtersSetup, filterQuerySetup, shouldSkipSingleQuery, shouldReturn, getUpdatedSortProperties, getUpdatedItemsToDisplay } from './helpers';
17
17
  const CardsContainer = dynamic(() => import('./CardsContainer'));
18
18
  const CardsRender = _ref => {
19
19
  let {
@@ -104,6 +104,12 @@ const CardsRender = _ref => {
104
104
  error: schemaError
105
105
  } = useGetEntitySchemasAsObj(getRequiredSchemas([...filterByProperty, ...sortbyFilters], filterEntitySchema), _loading);
106
106
  const updatedFilterBy = getUpdatedFilterBy(inheritedFilters, parentEntityData, parentSchema, filterEntitySchema, parentId, variableProps);
107
+ const updatedItemsToDisplay = getUpdatedItemsToDisplay({
108
+ itemsToDisplay,
109
+ inheritedFilters,
110
+ parentSchema,
111
+ parentEntityData
112
+ });
107
113
  const {
108
114
  limit,
109
115
  variables
@@ -115,10 +121,11 @@ const CardsRender = _ref => {
115
121
  docType: docTypes,
116
122
  filterOperator,
117
123
  filterEntityRelations,
118
- itemsToDisplay,
124
+ itemsToDisplay: updatedItemsToDisplay,
119
125
  entitySameAsCurrentItemEntity,
120
126
  useRandomSort
121
127
  });
128
+ const hasNoFiltersOrItemsToDisplay = !updatedItemsToDisplay.length && !updatedFilterBy;
122
129
  const {
123
130
  data: cardData,
124
131
  error: cardsError,
@@ -126,9 +133,9 @@ const CardsRender = _ref => {
126
133
  } = useQuery(action, {
127
134
  variables,
128
135
  fetchPolicy: useRandomSort ? 'cache-and-network' : 'cache-first',
129
- skip: shouldReturn(!updatedFilterBy, _loading, _load, schemaLoading, _error, _err, schemaError)
136
+ skip: shouldReturn(hasNoFiltersOrItemsToDisplay, _loading, _load, schemaLoading, _error, _err, schemaError)
130
137
  });
131
- const imageIds = itemsToDisplay.map(({
138
+ const imageIds = updatedItemsToDisplay.map(({
132
139
  imageId
133
140
  }) => imageId).filter(Boolean);
134
141
  const {
@@ -137,7 +144,7 @@ const CardsRender = _ref => {
137
144
  } = useGetImages(imageIds, true);
138
145
  const isLoading = shouldReturn(_loading, _load, schemaLoading, cardsLoading, imagesLoading);
139
146
  const hasError = shouldReturn(_error, _err, schemaError);
140
- if (!updatedFilterBy) return null;
147
+ if (hasNoFiltersOrItemsToDisplay) return null;
141
148
  if (isLoading) return null;
142
149
  if (hasError) return null;
143
150
  if (cardsError) return cardsError.message;
@@ -147,14 +154,14 @@ const CardsRender = _ref => {
147
154
  if (!cardDataResults || !cardDataResults.length) return null;
148
155
  cardDataResults = entitySameAsCurrentItemEntity ? removeExtraItems(cardDataResults, limit, parentId) : cardDataResults;
149
156
  if (!cardDataResults.length) return null;
150
- const orderedData = useRandomSort ? cardDataResults : sortResponseData(cardDataResults, itemsToDisplay);
157
+ const orderedData = useRandomSort ? cardDataResults : sortResponseData(cardDataResults, updatedItemsToDisplay);
151
158
  const {
152
159
  regularChildren,
153
160
  gtmChildren
154
161
  } = splitChildren(children, cardDataResults, graphqlEntityMap, {
155
162
  name: variableProps.name
156
163
  });
157
- const updatedCards = appendImages(imagesData, orderedData, itemsToDisplay);
164
+ const updatedCards = appendImages(imagesData, orderedData, updatedItemsToDisplay);
158
165
  return /*#__PURE__*/React.createElement(React.Fragment, null, gtmChildren && renderChildren(gtmChildren), /*#__PURE__*/React.createElement(CardsContainer, _extends({
159
166
  cardData: updatedCards,
160
167
  entity: primaryEntityToUse,