@blaze-cms/react-page-builder 0.143.1 → 0.144.0-alpha.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 (56) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/lib/components/DataSummary/DataSummaryFactory.js +17 -8
  3. package/lib/components/DataSummary/DataSummaryFactory.js.map +1 -1
  4. package/lib/components/DataSummary/DataSummaryRender.js +29 -5
  5. package/lib/components/DataSummary/DataSummaryRender.js.map +1 -1
  6. package/lib/components/DataSummary/helpers/build-loop-props-content.js +2 -0
  7. package/lib/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
  8. package/lib/components/DateTime/DateTime.js +1 -1
  9. package/lib/components/DateTime/DateTime.js.map +1 -1
  10. package/lib/components/SearchContent/SearchContent.js +17 -6
  11. package/lib/components/SearchContent/SearchContent.js.map +1 -1
  12. package/lib/components/SearchContent/SearchContentItems.js +1 -1
  13. package/lib/components/SearchContent/SearchContentItems.js.map +1 -1
  14. package/lib/components/SearchFilter/SearchFilter/SearchFilter.js +1 -1
  15. package/lib/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
  16. package/lib/hooks/helpers/getVariant.js.map +1 -1
  17. package/lib/variants/SlideSummary/SlideSummary.js +27 -0
  18. package/lib/variants/SlideSummary/SlideSummary.js.map +1 -0
  19. package/lib/variants/SlideSummary/index.js +43 -0
  20. package/lib/variants/SlideSummary/index.js.map +1 -0
  21. package/lib/variants/index.js +3 -1
  22. package/lib/variants/index.js.map +1 -1
  23. package/lib-es/components/DataSummary/DataSummaryFactory.js +29 -21
  24. package/lib-es/components/DataSummary/DataSummaryFactory.js.map +1 -1
  25. package/lib-es/components/DataSummary/DataSummaryRender.js +27 -6
  26. package/lib-es/components/DataSummary/DataSummaryRender.js.map +1 -1
  27. package/lib-es/components/DataSummary/helpers/build-loop-props-content.js +2 -1
  28. package/lib-es/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
  29. package/lib-es/components/DateTime/DateTime.js +1 -1
  30. package/lib-es/components/DateTime/DateTime.js.map +1 -1
  31. package/lib-es/components/SearchContent/SearchContent.js +16 -6
  32. package/lib-es/components/SearchContent/SearchContent.js.map +1 -1
  33. package/lib-es/components/SearchContent/SearchContentItems.js +1 -1
  34. package/lib-es/components/SearchContent/SearchContentItems.js.map +1 -1
  35. package/lib-es/components/SearchFilter/SearchFilter/SearchFilter.js +1 -1
  36. package/lib-es/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
  37. package/lib-es/hooks/helpers/getVariant.js.map +1 -1
  38. package/lib-es/variants/SlideSummary/SlideSummary.js +21 -0
  39. package/lib-es/variants/SlideSummary/SlideSummary.js.map +1 -0
  40. package/lib-es/variants/SlideSummary/index.js +12 -0
  41. package/lib-es/variants/SlideSummary/index.js.map +1 -0
  42. package/lib-es/variants/index.js +3 -1
  43. package/lib-es/variants/index.js.map +1 -1
  44. package/package.json +5 -5
  45. package/src/components/DataSummary/DataSummaryFactory.js +17 -5
  46. package/src/components/DataSummary/DataSummaryRender.js +32 -4
  47. package/src/components/DataSummary/helpers/build-loop-props-content.js +8 -3
  48. package/src/components/DateTime/DateTime.js +1 -1
  49. package/src/components/SearchContent/SearchContent.js +16 -6
  50. package/src/components/SearchContent/SearchContentItems.js +1 -1
  51. package/src/components/SearchFilter/SearchFilter/SearchFilter.js +0 -2
  52. package/src/hooks/helpers/getVariant.js +1 -0
  53. package/src/variants/SlideSummary/SlideSummary.js +15 -0
  54. package/src/variants/SlideSummary/index.js +12 -0
  55. package/src/variants/index.js +3 -1
  56. package/tests/unit/src/components/SearchFilter/SearchFilter/__snapshots__/SearchFilter.test.js.snap +1 -8
@@ -1 +1 @@
1
- {"version":3,"file":"getVariant.js","names":["_utils","require","getVariant","settings","variant","_ref","variantHandler","get","VariantComponent","getSettings","variantSettings"],"sources":["../../../src/hooks/helpers/getVariant.js"],"sourcesContent":["import { variantHandler } from '../../utils';\n\nexport default function getVariant(settings) {\n const { variant } = settings;\n if (!variant) return [null, {}];\n\n const { VariantComponent, getSettings } = variantHandler.get(variant) || {};\n const variantSettings =\n !!getSettings && typeof getSettings === 'function' ? getSettings(settings) : settings;\n\n return [VariantComponent, variantSettings];\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEe,SAASC,UAAUA,CAACC,QAAQ,EAAE;EAC3C,IAAQC,OAAO,GAAKD,QAAQ,CAApBC,OAAO;EACf,IAAI,CAACA,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;EAE/B,IAAAC,IAAA,GAA0CC,qBAAc,CAACC,GAAG,CAACH,OAAO,CAAC,IAAI,CAAC,CAAC;IAAnEI,gBAAgB,GAAAH,IAAA,CAAhBG,gBAAgB;IAAEC,WAAW,GAAAJ,IAAA,CAAXI,WAAW;EACrC,IAAMC,eAAe,GACnB,CAAC,CAACD,WAAW,IAAI,OAAOA,WAAW,KAAK,UAAU,GAAGA,WAAW,CAACN,QAAQ,CAAC,GAAGA,QAAQ;EAEvF,OAAO,CAACK,gBAAgB,EAAEE,eAAe,CAAC;AAC5C"}
1
+ {"version":3,"file":"getVariant.js","names":["_utils","require","getVariant","settings","variant","_ref","variantHandler","get","VariantComponent","getSettings","variantSettings"],"sources":["../../../src/hooks/helpers/getVariant.js"],"sourcesContent":["import { variantHandler } from '../../utils';\n\nexport default function getVariant(settings) {\n const { variant } = settings;\n if (!variant) return [null, {}];\n\n const { VariantComponent, getSettings } = variantHandler.get(variant) || {};\n\n const variantSettings =\n !!getSettings && typeof getSettings === 'function' ? getSettings(settings) : settings;\n\n return [VariantComponent, variantSettings];\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEe,SAASC,UAAUA,CAACC,QAAQ,EAAE;EAC3C,IAAQC,OAAO,GAAKD,QAAQ,CAApBC,OAAO;EACf,IAAI,CAACA,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;EAE/B,IAAAC,IAAA,GAA0CC,qBAAc,CAACC,GAAG,CAACH,OAAO,CAAC,IAAI,CAAC,CAAC;IAAnEI,gBAAgB,GAAAH,IAAA,CAAhBG,gBAAgB;IAAEC,WAAW,GAAAJ,IAAA,CAAXI,WAAW;EAErC,IAAMC,eAAe,GACnB,CAAC,CAACD,WAAW,IAAI,OAAOA,WAAW,KAAK,UAAU,GAAGA,WAAW,CAACN,QAAQ,CAAC,GAAGA,QAAQ;EAEvF,OAAO,CAACK,gBAAgB,EAAEE,eAAe,CAAC;AAC5C"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.object.define-property.js");
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
+ var _react = _interopRequireDefault(require("react"));
12
+ var _propTypes = _interopRequireDefault(require("prop-types"));
13
+ var _CarouselWrapper = _interopRequireDefault(require("../../components/CarouselWrapper"));
14
+ var _excluded = ["children"];
15
+ var SlideSummary = function SlideSummary(_ref) {
16
+ var children = _ref.children,
17
+ otherProps = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
18
+ return /*#__PURE__*/_react["default"].createElement(_CarouselWrapper["default"], (0, _extends2["default"])({}, otherProps, {
19
+ enableAutoScroll: true,
20
+ autoScrollTimer: 3000
21
+ }), children);
22
+ };
23
+ SlideSummary.propTypes = {
24
+ children: _propTypes["default"].string.isRequired
25
+ };
26
+ var _default = exports["default"] = SlideSummary;
27
+ //# sourceMappingURL=SlideSummary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SlideSummary.js","names":["_react","_interopRequireDefault","require","_propTypes","_CarouselWrapper","_excluded","SlideSummary","_ref","children","otherProps","_objectWithoutProperties2","createElement","_extends2","enableAutoScroll","autoScrollTimer","propTypes","PropTypes","string","isRequired","_default","exports"],"sources":["../../../src/variants/SlideSummary/SlideSummary.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport CarouselWrapper from '../../components/CarouselWrapper';\n\nconst SlideSummary = ({ children, ...otherProps }) => (\n <CarouselWrapper {...otherProps} enableAutoScroll autoScrollTimer={3000}>\n {children}\n </CarouselWrapper>\n);\n\nSlideSummary.propTypes = {\n children: PropTypes.string.isRequired\n};\n\nexport default SlideSummary;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,gBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAA+D,IAAAG,SAAA;AAE/D,IAAMC,YAAY,GAAG,SAAfA,YAAYA,CAAAC,IAAA;EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAKC,UAAU,OAAAC,yBAAA,aAAAH,IAAA,EAAAF,SAAA;EAAA,oBAC7CL,MAAA,YAAAW,aAAA,CAACP,gBAAA,WAAe,MAAAQ,SAAA,iBAAKH,UAAU;IAAEI,gBAAgB;IAACC,eAAe,EAAE;EAAK,IACrEN,QACc,CAAC;AAAA,CACnB;AAEDF,YAAY,CAACS,SAAS,GAAG;EACvBP,QAAQ,EAAEQ,qBAAS,CAACC,MAAM,CAACC;AAC7B,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEad,YAAY"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.object.keys.js");
4
+ require("core-js/modules/es.symbol.js");
5
+ require("core-js/modules/es.array.filter.js");
6
+ require("core-js/modules/es.object.get-own-property-descriptor.js");
7
+ require("core-js/modules/es.array.for-each.js");
8
+ require("core-js/modules/web.dom-collections.for-each.js");
9
+ require("core-js/modules/es.object.get-own-property-descriptors.js");
10
+ require("core-js/modules/es.object.define-properties.js");
11
+ require("core-js/modules/es.object.define-property.js");
12
+ require("core-js/modules/es.array.iterator.js");
13
+ require("core-js/modules/es.string.iterator.js");
14
+ require("core-js/modules/es.weak-map.js");
15
+ require("core-js/modules/web.dom-collections.iterator.js");
16
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
17
+ var _typeof = require("@babel/runtime/helpers/typeof");
18
+ Object.defineProperty(exports, "__esModule", {
19
+ value: true
20
+ });
21
+ exports["default"] = void 0;
22
+ require("core-js/modules/es.object.to-string.js");
23
+ require("core-js/modules/es.promise.js");
24
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
25
+ var _dynamic = _interopRequireDefault(require("next/dynamic"));
26
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
27
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
28
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
29
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
30
+ var SlideSummary = {
31
+ getSettings: function getSettings(componentSettings) {
32
+ return _objectSpread(_objectSpread({}, componentSettings), {}, {
33
+ modifier: 'slide-summary'
34
+ });
35
+ },
36
+ VariantComponent: (0, _dynamic["default"])(function () {
37
+ return Promise.resolve().then(function () {
38
+ return _interopRequireWildcard(require( /* webpackChunkName: "blazePbVariantSlideSummary" */'./SlideSummary'));
39
+ });
40
+ })
41
+ };
42
+ var _default = exports["default"] = SlideSummary;
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_dynamic","_interopRequireDefault","require","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","SlideSummary","getSettings","componentSettings","modifier","VariantComponent","dynamic","Promise","resolve","then","_default","exports"],"sources":["../../../src/variants/SlideSummary/index.js"],"sourcesContent":["import dynamic from 'next/dynamic';\n\nconst SlideSummary = {\n getSettings: componentSettings => ({\n ...componentSettings,\n modifier: 'slide-summary'\n }),\n VariantComponent: dynamic(() =>\n import(/* webpackChunkName: \"blazePbVariantSlideSummary\" */ './SlideSummary')\n )\n};\nexport default SlideSummary;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAmC,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAA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EAAAE,CAAA,EAAAwB,UAAA,OAAAvB,CAAA,CAAAwB,IAAA,CAAAC,KAAA,CAAAzB,CAAA,EAAAqB,CAAA,YAAArB,CAAA;AAAA,SAAA0B,cAAA7B,CAAA,aAAAE,CAAA,MAAAA,CAAA,GAAA4B,SAAA,CAAAC,MAAA,EAAA7B,CAAA,UAAAC,CAAA,WAAA2B,SAAA,CAAA5B,CAAA,IAAA4B,SAAA,CAAA5B,CAAA,QAAAA,CAAA,OAAAmB,OAAA,CAAAT,MAAA,CAAAT,CAAA,OAAA6B,OAAA,WAAA9B,CAAA,QAAA+B,gBAAA,aAAAjC,CAAA,EAAAE,CAAA,EAAAC,CAAA,CAAAD,CAAA,SAAAU,MAAA,CAAAsB,yBAAA,GAAAtB,MAAA,CAAAuB,gBAAA,CAAAnC,CAAA,EAAAY,MAAA,CAAAsB,yBAAA,CAAA/B,CAAA,KAAAkB,OAAA,CAAAT,MAAA,CAAAT,CAAA,GAAA6B,OAAA,WAAA9B,CAAA,IAAAU,MAAA,CAAAC,cAAA,CAAAb,CAAA,EAAAE,CAAA,EAAAU,MAAA,CAAAE,wBAAA,CAAAX,CAAA,EAAAD,CAAA,iBAAAF,CAAA;AAEnC,IAAMoC,YAAY,GAAG;EACnBC,WAAW,EAAE,SAAAA,YAAAC,iBAAiB;IAAA,OAAAT,aAAA,CAAAA,aAAA,KACzBS,iBAAiB;MACpBC,QAAQ,EAAE;IAAe;EAAA,CACzB;EACFC,gBAAgB,EAAE,IAAAC,mBAAO,EAAC;IAAA,OAAAC,OAAA,CAAAC,OAAA,GAAAC,IAAA;MAAA,OAAAxC,uBAAA,CAAAN,OAAA,EACjB,oDAAqD,gBAAgB;IAAA;EAAA,CAC9E;AACF,CAAC;AAAC,IAAA+C,QAAA,GAAAC,OAAA,cACaV,YAAY"}
@@ -12,12 +12,14 @@ var _LongformGallery = _interopRequireDefault(require("./LongformGallery"));
12
12
  var _LongformRow = _interopRequireDefault(require("./LongformRow"));
13
13
  var _ParallaxImageTextRight = _interopRequireDefault(require("./ParallaxImageTextRight"));
14
14
  var _ThumbnailCarousel = _interopRequireDefault(require("./ThumbnailCarousel"));
15
+ var _SlideSummary = _interopRequireDefault(require("./SlideSummary"));
15
16
  var _default = exports["default"] = {
16
17
  heroImage: _HeroImage["default"],
17
18
  infographic: _Infographic["default"],
18
19
  longformGallery: _LongformGallery["default"],
19
20
  longformRow: _LongformRow["default"],
20
21
  parallaxImageTextRight: _ParallaxImageTextRight["default"],
21
- thumbnailCarousel: _ThumbnailCarousel["default"]
22
+ thumbnailCarousel: _ThumbnailCarousel["default"],
23
+ slideSummary: _SlideSummary["default"]
22
24
  };
23
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_HeroImage","_interopRequireDefault","require","_Infographic","_LongformGallery","_LongformRow","_ParallaxImageTextRight","_ThumbnailCarousel","_default","exports","heroImage","infographic","longformGallery","longformRow","parallaxImageTextRight","thumbnailCarousel"],"sources":["../../src/variants/index.js"],"sourcesContent":["import heroImage from './HeroImage';\nimport infographic from './Infographic';\nimport longformGallery from './LongformGallery';\nimport longformRow from './LongformRow';\nimport parallaxImageTextRight from './ParallaxImageTextRight';\nimport thumbnailCarousel from './ThumbnailCarousel';\n\nexport default {\n heroImage,\n infographic,\n longformGallery,\n longformRow,\n parallaxImageTextRight,\n thumbnailCarousel\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,gBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,YAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,uBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,kBAAA,GAAAN,sBAAA,CAAAC,OAAA;AAAoD,IAAAM,QAAA,GAAAC,OAAA,cAErC;EACbC,SAAS,EAATA,qBAAS;EACTC,WAAW,EAAXA,uBAAW;EACXC,eAAe,EAAfA,2BAAe;EACfC,WAAW,EAAXA,uBAAW;EACXC,sBAAsB,EAAtBA,kCAAsB;EACtBC,iBAAiB,EAAjBA;AACF,CAAC"}
1
+ {"version":3,"file":"index.js","names":["_HeroImage","_interopRequireDefault","require","_Infographic","_LongformGallery","_LongformRow","_ParallaxImageTextRight","_ThumbnailCarousel","_SlideSummary","_default","exports","heroImage","infographic","longformGallery","longformRow","parallaxImageTextRight","thumbnailCarousel","slideSummary"],"sources":["../../src/variants/index.js"],"sourcesContent":["import heroImage from './HeroImage';\nimport infographic from './Infographic';\nimport longformGallery from './LongformGallery';\nimport longformRow from './LongformRow';\nimport parallaxImageTextRight from './ParallaxImageTextRight';\nimport thumbnailCarousel from './ThumbnailCarousel';\nimport slideSummary from './SlideSummary';\n\nexport default {\n heroImage,\n infographic,\n longformGallery,\n longformRow,\n parallaxImageTextRight,\n thumbnailCarousel,\n slideSummary\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,gBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,YAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,uBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,kBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,aAAA,GAAAP,sBAAA,CAAAC,OAAA;AAA0C,IAAAO,QAAA,GAAAC,OAAA,cAE3B;EACbC,SAAS,EAATA,qBAAS;EACTC,WAAW,EAAXA,uBAAW;EACXC,eAAe,EAAfA,2BAAe;EACfC,WAAW,EAAXA,uBAAW;EACXC,sBAAsB,EAAtBA,kCAAsB;EACtBC,iBAAiB,EAAjBA,6BAAiB;EACjBC,YAAY,EAAZA;AACF,CAAC"}
@@ -1,5 +1,3 @@
1
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
- const _excluded = ["entity", "dataRecordId", "propsToDisplay", "type", "useSelectedEntity", "elementTitle", "modifier", "headingStyle", "loopProperties", "loopLimit"];
3
1
  import React, { useContext } from 'react';
4
2
  import { useQuery } from '@apollo/client';
5
3
  import PropTypes from 'prop-types';
@@ -8,21 +6,22 @@ import { getSingleEntitySchema } from '../../application/query';
8
6
  import { buildPropsQuery, checkPropsToUse } from '../../helpers';
9
7
  import { getDataSummaryQuery, getLinkProps } from './helpers';
10
8
  import DataSummaryRender from './DataSummaryRender';
11
- const DataSummaryFactory = _ref => {
12
- let {
13
- entity,
14
- dataRecordId,
15
- propsToDisplay,
16
- type,
17
- useSelectedEntity,
18
- elementTitle,
19
- modifier,
20
- headingStyle,
21
- loopProperties,
22
- loopLimit
23
- } = _ref,
24
- dataSummaryProps = _objectWithoutProperties(_ref, _excluded);
25
- const entityForQuery = useSelectedEntity ? entity : dataSummaryProps.parent.itemEntity;
9
+ const DataSummaryFactory = ({
10
+ entity,
11
+ dataRecordId,
12
+ propsToDisplay,
13
+ type,
14
+ useSelectedEntity,
15
+ elementTitle,
16
+ modifier,
17
+ headingStyle,
18
+ loopProperties,
19
+ loopLimit,
20
+ variant,
21
+ VariantComponent,
22
+ parent
23
+ }) => {
24
+ const entityForQuery = useSelectedEntity ? entity : parent.itemEntity;
26
25
  const {
27
26
  data,
28
27
  error,
@@ -43,7 +42,8 @@ const DataSummaryFactory = _ref => {
43
42
  const linkProps = getLinkProps(propsToDisplay);
44
43
  const propsQueryString = buildPropsQuery(data, propsToDisplayValues, null, linkProps);
45
44
  const dataSummaryQuery = getDataSummaryQuery(data, isPreview, propsQueryString);
46
- const recordId = dataRecordId[0] || dataSummaryProps.parent.itemId;
45
+ const recordId = dataRecordId[0] || parent.itemId;
46
+ const isSlider = variant === 'slideSummary';
47
47
  return /*#__PURE__*/React.createElement(DataSummaryRender, {
48
48
  recordId: recordId,
49
49
  propsToDisplay: propsToDisplay,
@@ -53,10 +53,14 @@ const DataSummaryFactory = _ref => {
53
53
  type: type,
54
54
  elementTitle: elementTitle,
55
55
  modifier: modifier,
56
- htmlTag: headingStyle
56
+ htmlTag: headingStyle,
57
+ variant: variant,
58
+ VariantComponent: VariantComponent,
59
+ isSlider: isSlider
57
60
  });
58
61
  };
59
62
  DataSummaryFactory.propTypes = {
63
+ parent: PropTypes.object.isRequired,
60
64
  type: PropTypes.string,
61
65
  dataRecordId: PropTypes.array,
62
66
  propsToDisplay: PropTypes.array,
@@ -66,7 +70,9 @@ DataSummaryFactory.propTypes = {
66
70
  modifier: PropTypes.string,
67
71
  headingStyle: PropTypes.string,
68
72
  loopProperties: PropTypes.array,
69
- loopLimit: PropTypes.number
73
+ loopLimit: PropTypes.number,
74
+ variant: PropTypes.string,
75
+ VariantComponent: PropTypes.func
70
76
  };
71
77
  DataSummaryFactory.defaultProps = {
72
78
  type: 'text',
@@ -78,7 +84,9 @@ DataSummaryFactory.defaultProps = {
78
84
  modifier: '',
79
85
  headingStyle: 'h2',
80
86
  loopProperties: [],
81
- loopLimit: 0
87
+ loopLimit: 0,
88
+ variant: null,
89
+ VariantComponent: null
82
90
  };
83
91
  export default DataSummaryFactory;
84
92
  //# sourceMappingURL=DataSummaryFactory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DataSummaryFactory.js","names":["React","useContext","useQuery","PropTypes","MainContext","getSingleEntitySchema","buildPropsQuery","checkPropsToUse","getDataSummaryQuery","getLinkProps","DataSummaryRender","DataSummaryFactory","_ref","entity","dataRecordId","propsToDisplay","type","useSelectedEntity","elementTitle","modifier","headingStyle","loopProperties","loopLimit","dataSummaryProps","_objectWithoutProperties","_excluded","entityForQuery","parent","itemEntity","data","error","loading","variables","id","isPreview","message","length","propsToDisplayValues","linkProps","propsQueryString","dataSummaryQuery","recordId","itemId","createElement","query","htmlTag","propTypes","string","array","bool","number","defaultProps"],"sources":["../../../src/components/DataSummary/DataSummaryFactory.js"],"sourcesContent":["import React, { useContext } from 'react';\nimport { useQuery } from '@apollo/client';\nimport PropTypes from 'prop-types';\nimport { MainContext } from '@blaze-cms/nextjs-components';\nimport { getSingleEntitySchema } from '../../application/query';\nimport { buildPropsQuery, checkPropsToUse } from '../../helpers';\nimport { getDataSummaryQuery, getLinkProps } from './helpers';\nimport DataSummaryRender from './DataSummaryRender';\n\nconst DataSummaryFactory = ({\n entity,\n dataRecordId,\n propsToDisplay,\n type,\n useSelectedEntity,\n elementTitle,\n modifier,\n headingStyle,\n loopProperties,\n loopLimit,\n ...dataSummaryProps\n}) => {\n const entityForQuery = useSelectedEntity ? entity : dataSummaryProps.parent.itemEntity;\n const { data, error, loading } = useQuery(getSingleEntitySchema, {\n variables: { id: entityForQuery }\n });\n const { isPreview } = useContext(MainContext);\n if (loading) return '';\n if (error) return error.message;\n if (!data) return null;\n if (!propsToDisplay || !propsToDisplay.length) return null;\n const propsToDisplayValues = checkPropsToUse(propsToDisplay);\n const linkProps = getLinkProps(propsToDisplay);\n const propsQueryString = buildPropsQuery(data, propsToDisplayValues, null, linkProps);\n const dataSummaryQuery = getDataSummaryQuery(data, isPreview, propsQueryString);\n const recordId = dataRecordId[0] || dataSummaryProps.parent.itemId;\n\n return (\n <DataSummaryRender\n recordId={recordId}\n propsToDisplay={propsToDisplay}\n loopProperties={loopProperties}\n loopLimit={loopLimit}\n query={dataSummaryQuery}\n type={type}\n elementTitle={elementTitle}\n modifier={modifier}\n htmlTag={headingStyle}\n />\n );\n};\n\nDataSummaryFactory.propTypes = {\n type: PropTypes.string,\n dataRecordId: PropTypes.array,\n propsToDisplay: PropTypes.array,\n entity: PropTypes.string,\n useSelectedEntity: PropTypes.bool,\n elementTitle: PropTypes.string,\n modifier: PropTypes.string,\n headingStyle: PropTypes.string,\n loopProperties: PropTypes.array,\n loopLimit: PropTypes.number\n};\n\nDataSummaryFactory.defaultProps = {\n type: 'text',\n dataRecordId: [],\n propsToDisplay: [],\n useSelectedEntity: true,\n entity: '',\n elementTitle: '',\n modifier: '',\n headingStyle: 'h2',\n loopProper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BAAiB,EAAE,IAAI;EACvBJ,MAAM,EAAE,EAAE;EACVK,YAAY,EAAE,EAAE;EAChBC,QAAQ,EAAE,EAAE;EACZC,YAAY,EAAE,IAAI;EAClBC,cAAc,EAAE,EAAE;EAClBC,SAAS,EAAE;AACb,CAAC;AAED,eAAeX,kBAAkB"}
1
+ {"version":3,"file":"DataSummaryFactory.js","names":["React","useContext","useQuery","PropTypes","MainContext","getSingleEntitySchema","buildPropsQuery","checkPropsToUse","getDataSummaryQuery","getLinkProps","DataSummaryRender","DataSummaryFactory","entity","dataRecordId","propsToDisplay","type","useSelectedEntity","elementTitle","modifier","headingStyle","loopProperties","loopLimit","variant","VariantComponent","parent","entityForQuery","itemEntity","data","error","loading","variables","id","isPreview","message","length","propsToDisplayValues","linkProps","propsQueryString","dataSummaryQuery","recordId","itemId","isSlider","createElement","query","htmlTag","propTypes","object","isRequired","string","array","bool","number","func","defaultProps"],"sources":["../../../src/components/DataSummary/DataSummaryFactory.js"],"sourcesContent":["import React, { useContext } from 'react';\nimport { useQuery } from '@apollo/client';\nimport PropTypes from 'prop-types';\nimport { MainContext } from '@blaze-cms/nextjs-components';\nimport { getSingleEntitySchema } from '../../application/query';\nimport { buildPropsQuery, checkPropsToUse } from '../../helpers';\nimport { getDataSummaryQuery, getLinkProps } from './helpers';\nimport DataSummaryRender from './DataSummaryRender';\n\nconst DataSummaryFactory = ({\n entity,\n dataRecordId,\n propsToDisplay,\n type,\n useSelectedEntity,\n elementTitle,\n modifier,\n headingStyle,\n loopProperties,\n loopLimit,\n variant,\n VariantComponent,\n parent\n}) => {\n const entityForQuery = useSelectedEntity ? entity : parent.itemEntity;\n const { data, error, loading } = useQuery(getSingleEntitySchema, {\n variables: { id: entityForQuery }\n });\n\n const { isPreview } = useContext(MainContext);\n if (loading) return '';\n if (error) return error.message;\n if (!data) return null;\n if (!propsToDisplay || !propsToDisplay.length) return null;\n const propsToDisplayValues = checkPropsToUse(propsToDisplay);\n const linkProps = getLinkProps(propsToDisplay);\n const propsQueryString = buildPropsQuery(data, propsToDisplayValues, null, linkProps);\n const dataSummaryQuery = getDataSummaryQuery(data, isPreview, propsQueryString);\n const recordId = dataRecordId[0] || parent.itemId;\n const isSlider = variant === 'slideSummary';\n\n return (\n <DataSummaryRender\n recordId={recordId}\n propsToDisplay={propsToDisplay}\n loopProperties={loopProperties}\n loopLimit={loopLimit}\n query={dataSummaryQuery}\n type={type}\n elementTitle={elementTitle}\n modifier={modifier}\n htmlTag={headingStyle}\n variant={variant}\n VariantComponent={VariantComponent}\n isSlider={isSlider}\n />\n );\n};\n\nDataSummaryFactory.propTypes = {\n parent: PropTypes.object.isRequired,\n type: PropTypes.string,\n dataRecordId: PropTypes.array,\n propsToDisplay: PropTypes.array,\n entity: PropTypes.string,\n useSelectedEntity: PropTypes.bool,\n elementTitle: PropTypes.string,\n modifier: PropTypes.string,\n headingStyle: PropTypes.string,\n loopProperties: PropTypes.array,\n loopLimit: PropTypes.number,\n variant: PropTypes.string,\n VariantComponent: PropTypes.func\n};\n\nDataSummaryFactory.defaultProps = {\n type: 'text',\n dataRecordId: [],\n propsToDisplay: [],\n useSelectedEntity: true,\n entity: '',\n elementTitle: '',\n modifier: '',\n headingStyle: 'h2',\n loopProperties: [],\n loopLimit: 0,\n variant: null,\n VariantComponent: null\n};\n\nexport default DataSummaryFactory;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,WAAW,QAAQ,8BAA8B;AAC1D,SAASC,qBAAqB,QAAQ,yBAAyB;AAC/D,SAASC,eAAe,EAAEC,eAAe,QAAQ,eAAe;AAChE,SAASC,mBAAmB,EAAEC,YAAY,QAAQ,WAAW;AAC7D,OAAOC,iBAAiB,MAAM,qBAAqB;AAEnD,MAAMC,kBAAkB,GAAGA,CAAC;EAC1BC,MAAM;EACNC,YAAY;EACZC,cAAc;EACdC,I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}
@@ -1,11 +1,12 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
- const _excluded = ["type", "htmlTag", "recordId", "query", "propsToDisplay", "elementTitle", "loopProperties", "loopLimit"];
2
+ const _excluded = ["type", "htmlTag", "recordId", "query", "propsToDisplay", "elementTitle", "loopProperties", "loopLimit", "VariantComponent", "isSlider"];
3
3
  import React from 'react';
4
4
  import { useQuery } from '@apollo/client';
5
5
  import PropTypes from 'prop-types';
6
6
  import { summaryComponents } from './DataSummaryTypes';
7
7
  import { getClassModifiers } from '../../utils';
8
8
  import { buildPropsToDisplayWithContent, stripSummaryPropsContent, buildLoopPropsContent } from './helpers';
9
+ import { parsePropsToDisplay } from '../../helpers';
9
10
  const DataSummaryRender = _ref => {
10
11
  let {
11
12
  type,
@@ -15,9 +16,12 @@ const DataSummaryRender = _ref => {
15
16
  propsToDisplay,
16
17
  elementTitle,
17
18
  loopProperties,
18
- loopLimit
19
+ loopLimit,
20
+ VariantComponent,
21
+ isSlider
19
22
  } = _ref,
20
23
  otherProps = _objectWithoutProperties(_ref, _excluded);
24
+ const SummaryComponent = summaryComponents[type];
21
25
  const {
22
26
  data,
23
27
  error,
@@ -35,10 +39,20 @@ const DataSummaryRender = _ref => {
35
39
  } = data;
36
40
  const shouldLoop = loopProperties && loopProperties.length;
37
41
  const modifier = getClassModifiers('list', otherProps);
38
- const summaryPropsWithContent = shouldLoop ? buildLoopPropsContent(loopProperties, propsToDisplay, loopLimit, entityData) : buildPropsToDisplayWithContent(entityData, propsToDisplay);
42
+ const summaryPropsWithContent = shouldLoop ? buildLoopPropsContent(loopProperties, propsToDisplay, loopLimit, entityData, isSlider) : buildPropsToDisplayWithContent(entityData, propsToDisplay);
39
43
  const summaryPropsWithCleanContent = stripSummaryPropsContent(propsToDisplay, summaryPropsWithContent);
40
- const SummaryComponent = summaryComponents[type];
44
+ const parsedPropsToDisplay = parsePropsToDisplay(entityData, propsToDisplay);
41
45
  if (!summaryPropsWithCleanContent.length) return null;
46
+ if (VariantComponent) return /*#__PURE__*/React.createElement(VariantComponent, {
47
+ propsToDisplay: propsToDisplay,
48
+ summaryPropsWithContent: summaryPropsWithCleanContent,
49
+ parsedPropsToDisplay: parsedPropsToDisplay
50
+ }, summaryPropsWithContent.map(summaryProps => /*#__PURE__*/React.createElement(SummaryComponent, {
51
+ modifier: modifier,
52
+ elementTitle: elementTitle,
53
+ summaryPropsWithContent: summaryProps,
54
+ htmlTag: htmlTag
55
+ })));
42
56
  return /*#__PURE__*/React.createElement(SummaryComponent, {
43
57
  modifier: modifier,
44
58
  elementTitle: elementTitle,
@@ -47,16 +61,22 @@ const DataSummaryRender = _ref => {
47
61
  });
48
62
  };
49
63
  DataSummaryRender.propTypes = {
64
+ entities: PropTypes.array.isRequired,
65
+ mainSchemas: PropTypes.object.isRequired,
66
+ isSlider: PropTypes.bool.isRequired,
50
67
  type: PropTypes.string,
68
+ name: PropTypes.string,
51
69
  query: PropTypes.object,
52
70
  recordId: PropTypes.string,
53
71
  propsToDisplay: PropTypes.array,
54
72
  elementTitle: PropTypes.string,
55
73
  htmlTag: PropTypes.string,
56
74
  loopProperties: PropTypes.array,
57
- loopLimit: PropTypes.number
75
+ loopLimit: PropTypes.number,
76
+ VariantComponent: PropTypes.func
58
77
  };
59
78
  DataSummaryRender.defaultProps = {
79
+ name: '',
60
80
  type: 'text',
61
81
  query: {},
62
82
  recordId: '',
@@ -64,7 +84,8 @@ DataSummaryRender.defaultProps = {
64
84
  elementTitle: '',
65
85
  htmlTag: 'h2',
66
86
  loopProperties: [],
67
- loopLimit: 0
87
+ loopLimit: 0,
88
+ VariantComponent: null
68
89
  };
69
90
  export default DataSummaryRender;
70
91
  //# sourceMappingURL=DataSummaryRender.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DataSummaryRender.js","names":["React","useQuery","PropTypes","summaryComponents","getClassModifiers","buildPropsToDisplayWithContent","stripSummaryPropsContent","buildLoopPropsContent","DataSummaryRender","_ref","type","htmlTag","recordId","query","propsToDisplay","elementTitle","loopProperties","loopLimit","otherProps","_objectWithoutProperties","_excluded","data","error","loading","variables","id","message","entityData","shouldLoop","length","modifier","summaryPropsWithContent","summaryPropsWithCleanContent","SummaryComponent","createElement","propTypes","string","object","array","number","defaultProps"],"sources":["../../../src/components/DataSummary/DataSummaryRender.js"],"sourcesContent":["import React from 'react';\nimport { useQuery } from '@apollo/client';\nimport PropTypes from 'prop-types';\nimport { summaryComponents } from './DataSummaryTypes';\nimport { getClassModifiers } from '../../utils';\nimport {\n buildPropsToDisplayWithContent,\n stripSummaryPropsContent,\n buildLoopPropsContent\n} from './helpers';\n\nconst DataSummaryRender = ({\n type,\n htmlTag,\n recordId,\n query,\n propsToDisplay,\n elementTitle,\n loopProperties,\n loopLimit,\n ...otherProps\n}) => {\n const { data, error, loading } = useQuery(query, {\n variables: { id: recordId }\n });\n\n if (loading) return '';\n if (error) return error.message;\n if (!data || !data.entityData) return null;\n\n const { entityData } = data;\n const shouldLoop = loopProperties && loopProperties.length;\n const modifier = getClassModifiers('list', otherProps);\n const summaryPropsWithContent = shouldLoop\n ? buildLoopPropsContent(loopProperties, propsToDisplay, loopLimit, entityData)\n : buildPropsToDisplayWithContent(entityData, propsToDisplay);\n\n const summaryPropsWithCleanContent = stripSummaryPropsContent(\n propsToDisplay,\n summaryPropsWithContent\n );\n const SummaryComponent = summaryComponents[type];\n if (!summaryPropsWithCleanContent.length) return null;\n\n return (\n <SummaryComponent\n modifier={modifier}\n elementTitle={elementTitle}\n summaryPropsWithContent={summaryPropsWithCleanContent}\n htmlTag={htmlTag}\n />\n );\n};\n\nDataSummaryRender.propTypes = {\n type: PropTypes.string,\n query: PropTypes.object,\n recordId: PropTypes.string,\n propsToDisplay: PropTypes.array,\n elementTitle: PropTypes.string,\n htmlTag: PropTypes.string,\n loopProperties: PropTypes.array,\n loopLimit: PropTypes.number\n};\n\nDataSummaryRender.defaultProps = {\n type: 'text',\n query: {},\n recordId: '',\n propsToDisplay: [],\n element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AAwB,CAC3DQ,cAAc,EACdiB,uBACF,CAAC;EACD,MAAME,gBAAgB,GAAG9B,iBAAiB,CAACO,IAAI,CAAC;EAChD,IAAI,CAACsB,4BAA4B,CAACH,MAAM,EAAE,OAAO,IAAI;EAErD,oBACE7B,KAAA,CAAAkC,aAAA,CAACD,gBAAgB;IACfH,QAAQ,EAAEA,QAAS;IACnBf,YAAY,EAAEA,YAAa;IAC3BgB,uBAAuB,EAAEC,4BAA6B;IACtDrB,OAAO,EAAEA;EAAQ,CAClB,CAAC;AAEN,CAAC;AAEDH,iBAAiB,CAAC2B,SAAS,GAAG;EAC5BzB,IAAI,EAAER,SAAS,CAACkC,MAAM;EACtBvB,KAAK,EAAEX,SAAS,CAACmC,MAAM;EACvBzB,QAAQ,EAAEV,SAAS,CAACkC,MAAM;EAC1BtB,cAAc,EAAEZ,SAAS,CAACoC,KAAK;EAC/BvB,YAAY,EAAEb,SAAS,CAACkC,MAAM;EAC9BzB,OAAO,EAAET,SAAS,CAACkC,MAAM;EACzBpB,cAAc,EAAEd,SAAS,CAACoC,KAAK;EAC/BrB,SAAS,EAAEf,SAAS,CAACqC;AACvB,CAAC;AAED/B,iBAAiB,CAACgC,YAAY,GAAG;EAC/B9B,IAAI,EAAE,MAAM;EACZG,KAAK,EAAE,CAAC,CAAC;EACTD,QAAQ,EAAE,EAAE;EACZE,cAAc,EAAE,EAAE;EAClBC,YAAY,EAAE,EAAE;EAChBJ,OAAO,EAAE,IAAI;EACbK,cAAc,EAAE,EAAE;EAClBC,SAAS,EAAE;AACb,CAAC;AAED,eAAeT,iBAAiB"}
1
+ {"version":3,"file":"DataSummaryRender.js","names":["React","useQuery","PropTypes","summaryComponents","getClassModifiers","buildPropsToDisplayWithContent","stripSummaryPropsContent","buildLoopPropsContent","parsePropsToDisplay","DataSummaryRender","_ref","type","htmlTag","recordId","query","propsToDisplay","elementTitle","loopProperties","loopLimit","VariantComponent","isSlider","otherProps","_objectWithoutProperties","_excluded","SummaryComponent","data","error","loading","variables","id","message","entityData","shouldLoop","length","modifier","summaryPropsWithContent","summaryPropsWithCleanContent","parsedPropsToDisplay","createElement","map","summaryProps","propTypes","entities","array","isRequired","mainSchemas","object","bool","string","name","number","func","defaultProps"],"sources":["../../../src/components/DataSummary/DataSummaryRender.js"],"sourcesContent":["import React from 'react';\nimport { useQuery } from '@apollo/client';\nimport PropTypes from 'prop-types';\nimport { summaryComponents } from './DataSummaryTypes';\nimport { getClassModifiers } from '../../utils';\nimport {\n buildPropsToDisplayWithContent,\n stripSummaryPropsContent,\n buildLoopPropsContent\n} from './helpers';\nimport { parsePropsToDisplay } from '../../helpers';\n\nconst DataSummaryRender = ({\n type,\n htmlTag,\n recordId,\n query,\n propsToDisplay,\n elementTitle,\n loopProperties,\n loopLimit,\n VariantComponent,\n isSlider,\n ...otherProps\n}) => {\n const SummaryComponent = summaryComponents[type];\n const { data, error, loading } = useQuery(query, {\n variables: { id: recordId }\n });\n\n if (loading) return '';\n if (error) return error.message;\n if (!data || !data.entityData) return null;\n\n const { entityData } = data;\n const shouldLoop = loopProperties && loopProperties.length;\n const modifier = getClassModifiers('list', otherProps);\n const summaryPropsWithContent = shouldLoop\n ? buildLoopPropsContent(loopProperties, propsToDisplay, loopLimit, entityData, isSlider)\n : buildPropsToDisplayWithContent(entityData, propsToDisplay);\n\n const summaryPropsWithCleanContent = stripSummaryPropsContent(\n propsToDisplay,\n summaryPropsWithContent\n );\n const parsedPropsToDisplay = parsePropsToDisplay(entityData, propsToDisplay);\n if (!summaryPropsWithCleanContent.length) return null;\n\n if (VariantComponent)\n return (\n <VariantComponent\n propsToDisplay={propsToDisplay}\n summaryPropsWithContent={summaryPropsWithCleanContent}\n parsedPropsToDisplay={parsedPropsToDisplay}>\n {summaryPropsWithContent.map(summaryProps => (\n <SummaryComponent\n modifier={modifier}\n elementTitle={elementTitle}\n summaryPropsWithContent={summaryProps}\n htmlTag={htmlTag}\n />\n ))}\n </VariantComponent>\n );\n\n return (\n <SummaryComponent\n modifier={modifier}\n elementTitle={elementTitle}\n summaryPropsWithContent={summaryPropsWithCleanContent}\n htmlTag={htmlTag}\n />\n );\n};\n\nDataSummaryRender.propTypes = {\n entities: PropTypes.array.isRequired,\n mainSchemas: PropTypes.object.isRequired,\n isSlider: PropTypes.bool.isRequired,\n type: PropTypes.string,\n name: PropTypes.string,\n query: PropTypes.object,\n recordId: PropTypes.string,\n propsToDisplay: PropTypes.array,\n elementTitle: PropTypes.string,\n htmlTag: PropTypes.string,\n loopProperties: PropTypes.array,\n loopLimit: PropTypes.number,\n VariantComponent: PropTypes.func\n};\n\nDataSummaryRender.defaultProps = {\n name: '',\n type: 'text',\n query: {},\n recordId: '',\n propsToDisplay: [],\n elementTitle: '',\n htmlTag: 'h2',\n loopProperties: [],\n loopLimit: 0,\n VariantComponent: null\n};\n\nexport default DataSummaryRender;\n"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,iBAAiB,QAAQ,oBAAoB;AACtD,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SACEC,8BAA8B,EAC9BC,wBAAwB,EACxBC,qBAAqB,QAChB,WAAW;AAClB,SAASC,mBAAmB,QAAQ,eAAe;AAEnD,MAAMC,iBAAiB,GAAGC,IAAA,IAYpB;EAAA,IAZqB;MACzBC,IAAI;MACJC,OAAO;MACPC,QAAQ;MACRC,KAAK;MACLC,cAAc;MACdC,YAAY;MACZC,cAAc;MACdC,SAAS;MACTC,gBAAgB;MAChBC;IAEF,CAAC,GAAAV,IAAA;IADIW,UAAU,GAAAC,wBAAA,CAAAZ,IAAA,EAAAa,SAAA;EAEb,MAAMC,gBAAgB,GAAGrB,iBAAiB,CAACQ,IAAI,CAAC;EAChD,MAAM;IAAEc,IAAI;IAAEC,KAAK;IAAEC;EAAQ,CAAC,GAAG1B,QAAQ,CAACa,KAAK,EAAE;IAC/Cc,SAAS,EAAE;MA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,EAAEA,YAAa;IAC3BmB,uBAAuB,EAAEC,4BAA6B;IACtDxB,OAAO,EAAEA;EAAQ,CAClB,CAAC;AAEN,CAAC;AAEDH,iBAAiB,CAACgC,SAAS,GAAG;EAC5BC,QAAQ,EAAExC,SAAS,CAACyC,KAAK,CAACC,UAAU;EACpCC,WAAW,EAAE3C,SAAS,CAAC4C,MAAM,CAACF,UAAU;EACxCxB,QAAQ,EAAElB,SAAS,CAAC6C,IAAI,CAACH,UAAU;EACnCjC,IAAI,EAAET,SAAS,CAAC8C,MAAM;EACtBC,IAAI,EAAE/C,SAAS,CAAC8C,MAAM;EACtBlC,KAAK,EAAEZ,SAAS,CAAC4C,MAAM;EACvBjC,QAAQ,EAAEX,SAAS,CAAC8C,MAAM;EAC1BjC,cAAc,EAAEb,SAAS,CAACyC,KAAK;EAC/B3B,YAAY,EAAEd,SAAS,CAAC8C,MAAM;EAC9BpC,OAAO,EAAEV,SAAS,CAAC8C,MAAM;EACzB/B,cAAc,EAAEf,SAAS,CAACyC,KAAK;EAC/BzB,SAAS,EAAEhB,SAAS,CAACgD,MAAM;EAC3B/B,gBAAgB,EAAEjB,SAAS,CAACiD;AAC9B,CAAC;AAED1C,iBAAiB,CAAC2C,YAAY,GAAG;EAC/BH,IAAI,EAAE,EAAE;EACRtC,IAAI,EAAE,MAAM;EACZG,KAAK,EAAE,CAAC,CAAC;EACTD,QAAQ,EAAE,EAAE;EACZE,cAAc,EAAE,EAAE;EAClBC,YAAY,EAAE,EAAE;EAChBJ,OAAO,EAAE,IAAI;EACbK,cAAc,EAAE,EAAE;EAClBC,SAAS,EAAE,CAAC;EACZC,gBAAgB,EAAE;AACpB,CAAC;AAED,eAAeV,iBAAiB"}
@@ -31,7 +31,7 @@ const separateValues = (propsToDisplay, loopProps, data) => {
31
31
  });
32
32
  return [regularValues, loopValues];
33
33
  };
34
- const buildLoopPropsContent = (loopProps = [], propsToDisplay = [], limit = 0, data = {}) => {
34
+ const buildLoopPropsContent = (loopProps = [], propsToDisplay = [], limit = 0, data = {}, isSlider = false) => {
35
35
  const loopPropsWithContent = [];
36
36
  const [regularValues, loopValues] = separateValues(propsToDisplay, loopProps, data);
37
37
  const loopLimit = getLoopPropsLimit(loopValues, limit);
@@ -54,6 +54,7 @@ const buildLoopPropsContent = (loopProps = [], propsToDisplay = [], limit = 0, d
54
54
  })).filter(Boolean);
55
55
  loopPropsWithContent.push(propsArray);
56
56
  }
57
+ if (isSlider) return loopPropsWithContent;
57
58
  return flatten(loopPropsWithContent);
58
59
  };
59
60
  export default buildLoopPropsContent;
@@ -1 +1 @@
1
- {"version":3,"file":"build-loop-props-content.js","names":["upperFirst","flatten","getLinkToPublishedContent","getLoopPropsLimit","getPropValue","processDataSummaryValue","getLoopValue","value","keyField","separateValues","propsToDisplay","loopProps","data","regularValues","loopValues","forEach","options","propertiesToDisplay","prop","isArrayValue","Array","isArray","isLoopableProp","includes","buildLoopPropsContent","limit","loopPropsWithContent","loopLimit","i","propsArray","map","label","modifier","key","loopValue","loopValueItem","propValue","processedValue","linkToPublishedContent","filter","Boolean","push"],"sources":["../../../../src/components/DataSummary/helpers/build-loop-props-content.js"],"sourcesContent":["import upperFirst from 'lodash.upperfirst';\nimport flatten from 'lodash.flatten';\nimport getLinkToPublishedContent from './get-link-to-published-content';\nimport getLoopPropsLimit from './get-loop-props-limit';\nimport getPropValue from './get-prop-value';\nimport { processDataSummaryValue } from '../../../helpers';\n\nconst getLoopValue = value => {\n const { keyField } = value;\n return value[keyField];\n};\n\nconst separateValues = (propsToDisplay, loopProps, data) => {\n const regularValues = {};\n const loopValues = {};\n\n propsToDisplay.forEach(options => {\n const { propertiesToDisplay } = options;\n propertiesToDisplay.forEach(prop => {\n const value = getPropValue(prop, data, options);\n const isArrayValue = Array.isArray(value);\n if (!value) return;\n const isLoopableProp = loopProps.includes(prop) && isArrayValue;\n\n if (isLoopableProp) {\n loopValues[prop] = value;\n } else {\n regularValues[prop] = value;\n }\n });\n });\n return [regularValues, loopValues];\n};\n\nconst buildLoopPropsContent = (loopProps = [], propsToDisplay = [], limit = 0, data = {}) => {\n const loopPropsWithContent = [];\n const [regularValues, loopValues] = separateValues(propsToDisplay, loopProps, data);\n\n const loopLimit = getLoopPropsLimit(loopValues, limit);\n\n for (let i = 0; i < loopLimit; i += 1) {\n const propsArray = flatten(\n propsToDisplay.map(options => {\n const { propertiesToDisplay, label, modifier = '' } = options;\n\n return propertiesToDisplay.map(key => {\n const loopValue = loopValues[key];\n const loopValueItem = loopValue && loopValue[i];\n const propValue = loopValueItem ? getLoopValue(loopValueItem) : regularValues[key];\n if (!propValue) return null;\n\n const processedValue = processDataSummaryValue(propValue, options);\n const linkToPublishedContent = getLinkToPublishedContent(key, data, loopValueItem);\n return [upperFirst(label), processedValue, linkToPublishedContent, modifier];\n });\n })\n ).filter(Boolean);\n loopPropsWithContent.push(propsArray);\n }\n\n return flatten(loopPropsWithContent);\n};\n\nexport default buildLoopPropsContent;\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,mBAAmB;AAC1C,OAAOC,OAAO,MAAM,gBAAgB;AACpC,OAAOC,yBAAyB,MAAM,iCAAiC;AACvE,OAAOC,iBAAiB,MAAM,wBAAwB;AACtD,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,SAASC,uBAAuB,QAAQ,kBAAkB;AAE1D,MAAMC,YAAY,GAAGC,KAAK,IAAI;EAC5B,MAAM;IAAEC;EAAS,CAAC,GAAGD,KAAK;EAC1B,OAAOA,KAAK,CAACC,QAAQ,CAAC;AACxB,CAAC;AAED,MAAMC,cAAc,GAAGA,CAACC,cAAc,EAAEC,SAAS,EAAEC,IAAI,KAAK;EAC1D,MAAMC,aAAa,GAAG,CAAC,CAAC;EACxB,MAAMC,UAAU,GAAG,CAAC,CAAC;EAErBJ,cAAc,CAACK,OAAO,CAACC,OAAO,IAAI;IAChC,MAAM;MAAEC;IAAoB,CAAC,GAAGD,OAAO;IACvCC,mBAAmB,CAACF,OAAO,CAACG,IAAI,IAAI;MAClC,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ACN,CAAC,CAAC;QAC/C,MAAMQ,SAAS,GAAGD,aAAa,GAAG7B,YAAY,CAAC6B,aAAa,CAAC,GAAGtB,aAAa,CAACoB,GAAG,CAAC;QAClF,IAAI,CAACG,SAAS,EAAE,OAAO,IAAI;QAE3B,MAAMC,cAAc,GAAGhC,uBAAuB,CAAC+B,SAAS,EAAEpB,OAAO,CAAC;QAClE,MAAMsB,sBAAsB,GAAGpC,yBAAyB,CAAC+B,GAAG,EAAErB,IAAI,EAAEuB,aAAa,CAAC;QAClF,OAAO,CAACnC,UAAU,CAAC+B,KAAK,CAAC,EAAEM,cAAc,EAAEC,sBAAsB,EAAEN,QAAQ,CAAC;MAC9E,CAAC,CAAC;IACJ,CAAC,CACH,CAAC,CAACO,MAAM,CAACC,OAAO,CAAC;IACjBd,oBAAoB,CAACe,IAAI,CAACZ,UAAU,CAAC;EACvC;EAEA,OAAO5B,OAAO,CAACyB,oBAAoB,CAAC;AACtC,CAAC;AAED,eAAeF,qBAAqB"}
1
+ {"version":3,"file":"build-loop-props-content.js","names":["upperFirst","flatten","getLinkToPublishedContent","getLoopPropsLimit","getPropValue","processDataSummaryValue","getLoopValue","value","keyField","separateValues","propsToDisplay","loopProps","data","regularValues","loopValues","forEach","options","propertiesToDisplay","prop","isArrayValue","Array","isArray","isLoopableProp","includes","buildLoopPropsContent","limit","isSlider","loopPropsWithContent","loopLimit","i","propsArray","map","label","modifier","key","loopValue","loopValueItem","propValue","processedValue","linkToPublishedContent","filter","Boolean","push"],"sources":["../../../../src/components/DataSummary/helpers/build-loop-props-content.js"],"sourcesContent":["import upperFirst from 'lodash.upperfirst';\nimport flatten from 'lodash.flatten';\nimport getLinkToPublishedContent from './get-link-to-published-content';\nimport getLoopPropsLimit from './get-loop-props-limit';\nimport getPropValue from './get-prop-value';\nimport { processDataSummaryValue } from '../../../helpers';\n\nconst getLoopValue = value => {\n const { keyField } = value;\n return value[keyField];\n};\n\nconst separateValues = (propsToDisplay, loopProps, data) => {\n const regularValues = {};\n const loopValues = {};\n\n propsToDisplay.forEach(options => {\n const { propertiesToDisplay } = options;\n propertiesToDisplay.forEach(prop => {\n const value = getPropValue(prop, data, options);\n const isArrayValue = Array.isArray(value);\n if (!value) return;\n const isLoopableProp = loopProps.includes(prop) && isArrayValue;\n\n if (isLoopableProp) {\n loopValues[prop] = value;\n } else {\n regularValues[prop] = value;\n }\n });\n });\n return [regularValues, loopValues];\n};\n\nconst buildLoopPropsContent = (\n loopProps = [],\n propsToDisplay = [],\n limit = 0,\n data = {},\n isSlider = false\n) => {\n const loopPropsWithContent = [];\n const [regularValues, loopValues] = separateValues(propsToDisplay, loopProps, data);\n const loopLimit = getLoopPropsLimit(loopValues, limit);\n\n for (let i = 0; i < loopLimit; i += 1) {\n const propsArray = flatten(\n propsToDisplay.map(options => {\n const { propertiesToDisplay, label, modifier = '' } = options;\n\n return propertiesToDisplay.map(key => {\n const loopValue = loopValues[key];\n const loopValueItem = loopValue && loopValue[i];\n const propValue = loopValueItem ? getLoopValue(loopValueItem) : regularValues[key];\n if (!propValue) return null;\n\n const processedValue = processDataSummaryValue(propValue, options);\n const linkToPublishedContent = getLinkToPublishedContent(key, data, loopValueItem);\n return [upperFirst(label), processedValue, linkToPublishedContent, modifier];\n });\n })\n ).filter(Boolean);\n loopPropsWithContent.push(propsArray);\n }\n if (isSlider) return loopPropsWithContent;\n return flatten(loopPropsWithContent);\n};\n\nexport default buildLoopPropsContent;\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,mBAAmB;AAC1C,OAAOC,OAAO,MAAM,gBAAgB;AACpC,OAAOC,yBAAyB,MAAM,iCAAiC;AACvE,OAAOC,iBAAiB,MAAM,wBAAwB;AACtD,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,SAASC,uBAAuB,QAAQ,kBAAkB;AAE1D,MAAMC,YAAY,GAAGC,KAAK,IAAI;EAC5B,MAAM;IAAEC;EAAS,CAAC,GAAGD,KAAK;EAC1B,OAAOA,KAAK,CAACC,QAAQ,CAA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AAE;IACrC,MAAMC,UAAU,GAAG7B,OAAO,CACxBS,cAAc,CAACqB,GAAG,CAACf,OAAO,IAAI;MAC5B,MAAM;QAAEC,mBAAmB;QAAEe,KAAK;QAAEC,QAAQ,GAAG;MAAG,CAAC,GAAGjB,OAAO;MAE7D,OAAOC,mBAAmB,CAACc,GAAG,CAACG,GAAG,IAAI;QACpC,MAAMC,SAAS,GAAGrB,UAAU,CAACoB,GAAG,CAAC;QACjC,MAAME,aAAa,GAAGD,SAAS,IAAIA,SAAS,CAACN,CAAC,CAAC;QAC/C,MAAMQ,SAAS,GAAGD,aAAa,GAAG9B,YAAY,CAAC8B,aAAa,CAAC,GAAGvB,aAAa,CAACqB,GAAG,CAAC;QAClF,IAAI,CAACG,SAAS,EAAE,OAAO,IAAI;QAE3B,MAAMC,cAAc,GAAGjC,uBAAuB,CAACgC,SAAS,EAAErB,OAAO,CAAC;QAClE,MAAMuB,sBAAsB,GAAGrC,yBAAyB,CAACgC,GAAG,EAAEtB,IAAI,EAAEwB,aAAa,CAAC;QAClF,OAAO,CAACpC,UAAU,CAACgC,KAAK,CAAC,EAAEM,cAAc,EAAEC,sBAAsB,EAAEN,QAAQ,CAAC;MAC9E,CAAC,CAAC;IACJ,CAAC,CACH,CAAC,CAACO,MAAM,CAACC,OAAO,CAAC;IACjBd,oBAAoB,CAACe,IAAI,CAACZ,UAAU,CAAC;EACvC;EACA,IAAIJ,QAAQ,EAAE,OAAOC,oBAAoB;EACzC,OAAO1B,OAAO,CAAC0B,oBAAoB,CAAC;AACtC,CAAC;AAED,eAAeH,qBAAqB"}
@@ -9,7 +9,7 @@ const DateTime = ({
9
9
  customFormat,
10
10
  modifier
11
11
  }) => {
12
- const dateFormat = customFormat ? customFormat.toUpperCase() : format;
12
+ const dateFormat = customFormat || format;
13
13
  if (!dateFormat) return null;
14
14
  const formatedDate = dayjs().format(dateFormat);
15
15
  return /*#__PURE__*/React.createElement(Wrapper, {
@@ -1 +1 @@
1
- {"version":3,"file":"DateTime.js","names":["React","PropTypes","dayjs","LocalizedFormat","Wrapper","extend","DateTime","format","customFormat","modifier","dateFormat","toUpperCase","formatedDate","createElement","className","modifiers","propTypes","string","isRequired","defaultProps"],"sources":["../../../src/components/DateTime/DateTime.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport dayjs from 'dayjs';\nimport LocalizedFormat from 'dayjs/plugin/localizedFormat';\nimport Wrapper from '../Wrapper';\n\ndayjs.extend(LocalizedFormat);\n\nconst DateTime = ({ format, customFormat, modifier }) => {\n const dateFormat = customFormat ? customFormat.toUpperCase() : format;\n\n if (!dateFormat) return null;\n\n const formatedDate = dayjs().format(dateFormat);\n\n return (\n <Wrapper className=\"date\" modifiers={modifier}>\n {formatedDate}\n </Wrapper>\n );\n};\n\nDateTime.propTypes = {\n format: PropTypes.string.isRequired,\n customFormat: PropTypes.string,\n modifier: PropTypes.string\n};\n\nDateTime.defaultProps = {\n modifier: null,\n customFormat: ''\n};\n\nexport default DateTime;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,eAAe,MAAM,8BAA8B;AAC1D,OAAOC,OAAO,MAAM,YAAY;AAEhCF,KAAK,CAACG,MAAM,CAACF,eAAe,CAAC;AAE7B,MAAMG,QAAQ,GAAGA,CAAC;EAAEC,MAAM;EAAEC,YAAY;EAAEC;AAAS,CAAC,KAAK;EACvD,MAAMC,UAAU,GAAGF,YAAY,GAAGA,YAAY,CAACG,WAAW,CAAC,CAAC,GAAGJ,MAAM;EAErE,IAAI,CAACG,UAAU,EAAE,OAAO,IAAI;EAE5B,MAAME,YAAY,GAAGV,KAAK,CAAC,CAAC,CAACK,MAAM,CAACG,UAAU,CAAC;EAE/C,oBACEV,KAAA,CAAAa,aAAA,CAACT,OAAO;IAACU,SAAS,EAAC,MAAM;IAACC,SAAS,EAAEN;EAAS,GAC3CG,YACM,CAAC;AAEd,CAAC;AAEDN,QAAQ,CAACU,SAAS,GAAG;EACnBT,MAAM,EAAEN,SAAS,CAACgB,MAAM,CAACC,UAAU;EACnCV,YAAY,EAAEP,SAAS,CAACgB,MAAM;EAC9BR,QAAQ,EAAER,SAAS,CAACgB;AACtB,CAAC;AAEDX,QAAQ,CAACa,YAAY,GAAG;EACtBV,QAAQ,EAAE,IAAI;EACdD,YAAY,EAAE;AAChB,CAAC;AAED,eAAeF,QAAQ"}
1
+ {"version":3,"file":"DateTime.js","names":["React","PropTypes","dayjs","LocalizedFormat","Wrapper","extend","DateTime","format","customFormat","modifier","dateFormat","formatedDate","createElement","className","modifiers","propTypes","string","isRequired","defaultProps"],"sources":["../../../src/components/DateTime/DateTime.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport dayjs from 'dayjs';\nimport LocalizedFormat from 'dayjs/plugin/localizedFormat';\nimport Wrapper from '../Wrapper';\n\ndayjs.extend(LocalizedFormat);\n\nconst DateTime = ({ format, customFormat, modifier }) => {\n const dateFormat = customFormat || format;\n\n if (!dateFormat) return null;\n\n const formatedDate = dayjs().format(dateFormat);\n\n return (\n <Wrapper className=\"date\" modifiers={modifier}>\n {formatedDate}\n </Wrapper>\n );\n};\n\nDateTime.propTypes = {\n format: PropTypes.string.isRequired,\n customFormat: PropTypes.string,\n modifier: PropTypes.string\n};\n\nDateTime.defaultProps = {\n modifier: null,\n customFormat: ''\n};\n\nexport default DateTime;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,eAAe,MAAM,8BAA8B;AAC1D,OAAOC,OAAO,MAAM,YAAY;AAEhCF,KAAK,CAACG,MAAM,CAACF,eAAe,CAAC;AAE7B,MAAMG,QAAQ,GAAGA,CAAC;EAAEC,MAAM;EAAEC,YAAY;EAAEC;AAAS,CAAC,KAAK;EACvD,MAAMC,UAAU,GAAGF,YAAY,IAAID,MAAM;EAEzC,IAAI,CAACG,UAAU,EAAE,OAAO,IAAI;EAE5B,MAAMC,YAAY,GAAGT,KAAK,CAAC,CAAC,CAACK,MAAM,CAACG,UAAU,CAAC;EAE/C,oBACEV,KAAA,CAAAY,aAAA,CAACR,OAAO;IAACS,SAAS,EAAC,MAAM;IAACC,SAAS,EAAEL;EAAS,GAC3CE,YACM,CAAC;AAEd,CAAC;AAEDL,QAAQ,CAACS,SAAS,GAAG;EACnBR,MAAM,EAAEN,SAAS,CAACe,MAAM,CAACC,UAAU;EACnCT,YAAY,EAAEP,SAAS,CAACe,MAAM;EAC9BP,QAAQ,EAAER,SAAS,CAACe;AACtB,CAAC;AAEDV,QAAQ,CAACY,YAAY,GAAG;EACtBT,QAAQ,EAAE,IAAI;EACdD,YAAY,EAAE;AAChB,CAAC;AAED,eAAeF,QAAQ"}
@@ -11,7 +11,9 @@ const SearchContent = ({
11
11
  isMobile,
12
12
  placeholder,
13
13
  modifier,
14
- collapsedSearch
14
+ collapsedSearch,
15
+ searchUrl,
16
+ navigateToSingleSearchResult
15
17
  }) => {
16
18
  const searchContentRef = useRef(null);
17
19
  const [collapsed, setCollapsed] = useState(collapsedSearch);
@@ -58,9 +60,13 @@ const SearchContent = ({
58
60
  e.preventDefault();
59
61
  router.push(url);
60
62
  };
61
- const handleKeyPress = e => {
63
+ const handleKeyDown = e => {
62
64
  if (e.key === 'Enter' && e.target.value !== '') {
63
- router.push(`/search?search_term=${e.target.value}`);
65
+ if (navigateToSingleSearchResult && results && results.length === 1 && results[0].url) {
66
+ router.push(results[0].url);
67
+ } else {
68
+ router.push(`${searchUrl || '/search'}?search_term=${e.target.value}`);
69
+ }
64
70
  }
65
71
  };
66
72
  const handleIconClick = () => {
@@ -95,7 +101,7 @@ const SearchContent = ({
95
101
  placeholder: placeholder,
96
102
  value: searchTerm,
97
103
  onChange: e => setSearchTerm(e.target.value),
98
- onKeyPress: handleKeyPress,
104
+ onKeyDown: handleKeyDown,
99
105
  onFocus: () => setShowResults(true),
100
106
  "data-testid": "search-content-input"
101
107
  }))), showResults && /*#__PURE__*/React.createElement(SearchContentResults, {
@@ -111,7 +117,9 @@ SearchContent.propTypes = {
111
117
  isMobile: PropTypes.bool,
112
118
  entities: PropTypes.array.isRequired,
113
119
  modifier: PropTypes.string,
114
- collapsedSearch: PropTypes.bool
120
+ collapsedSearch: PropTypes.bool,
121
+ searchUrl: PropTypes.string,
122
+ navigateToSingleSearchResult: PropTypes.bool
115
123
  };
116
124
  SearchContent.defaultProps = {
117
125
  searchInputWrapperMobile: '',
@@ -119,7 +127,9 @@ SearchContent.defaultProps = {
119
127
  placeholder: '',
120
128
  isMobile: false,
121
129
  modifier: '',
122
- collapsedSearch: false
130
+ collapsedSearch: false,
131
+ searchUrl: '',
132
+ navigateToSingleSearchResult: false
123
133
  };
124
134
  export default SearchContent;
125
135
  //# sourceMappingURL=SearchContent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SearchContent.js","names":["React","useState","useEffect","useRef","PropTypes","useRouter","useDebounceSearch","SearchContentResults","SearchContentToggleIcon","SearchContent","entities","searchInputWrapperMobile","searchInputWrapperDesktop","isMobile","placeholder","modifier","collapsedSearch","searchContentRef","collapsed","setCollapsed","showResults","setShowResults","router","results","searchTerm","setSearchTerm","debouncedSearchTerm","initialSearchTerm","resultKeys","handleRouteChange","events","on","off","handleClickOutside","event","current","contains","target","document","addEventListener","removeEventListener","responsiveClasses","handleNavigation","e","url","preventDefault","push","handleKeyPress","key","value","handleIconClick","isCloseIcon","className","filter","Boolean","join","searchModifier","createElement","ref","onClick","useCloseIcon","type","name","onChange","onKeyPress","onFocus","handleClick","propTypes","string","bool","array","isRequired","defaultProps"],"sources":["../../../src/components/SearchContent/SearchContent.js"],"sourcesContent":["import React, { useState, useEffect, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport { useRouter } from 'next/router';\nimport { useDebounceSearch } from '@blaze-cms/plugin-search-ui';\nimport SearchContentResults from './SearchContentResults';\nimport SearchContentToggleIcon from './SearchContentToggleIcon';\n\nconst SearchContent = ({\n entities,\n searchInputWrapperMobile,\n searchInputWrapperDesktop,\n isMobile,\n placeholder,\n modifier,\n collapsedSearch\n}) => {\n const searchContentRef = useRef(null);\n const [collapsed, setCollapsed] = useState(collapsedSearch);\n const [showResults, setShowResults] = useState(false);\n const router = useRouter();\n\n const { results, searchTerm, setSearchTerm, debouncedSearchTerm } = useDebounceSearch({\n entities,\n initialSearchTerm: '',\n resultKeys: 'id, name, image { url }, url'\n });\n\n useEffect(\n () => {\n const handleRouteChange = () => {\n setSearchTerm('');\n setShowResults(false);\n if (collapsedSearch) setCollapsed(true);\n };\n router.events.on('routeChangeStart', handleRouteChange);\n\n return () => {\n router.events.off('routeChangeStart', handleRouteChange);\n };\n },\n [collapsedSearch, router.events, setSearchTerm]\n );\n\n useEffect(\n () => {\n const handleClickOutside = event => {\n if (searchContentRef.current && !searchContentRef.current.contains(event.target)) {\n setShowResults(false);\n if (collapsedSearch) {\n setCollapsed(true);\n setSearchTerm('');\n }\n }\n };\n\n document.addEventListener('click', handleClickOutside);\n\n return () => {\n document.removeEventListener('click', handleClickOutside);\n };\n },\n [collapsedSearch, setSearchTerm]\n );\n\n const responsiveClasses = isMobile ? searchInputWrapperMobile : searchInputWrapperDesktop;\n\n const handleNavigation = (e, url) => {\n e.preventDefault();\n router.push(url);\n };\n\n const handleKeyPress = e => {\n if (e.key === 'Enter' && e.target.value !== '') {\n router.push(`/search?search_term=${e.target.value}`);\n }\n };\n\n const handleIconClick = () => {\n const isCloseIcon = collapsedSearch ? !collapsed : debouncedSearchTerm;\n\n if (collapsedSearch) setCollapsed(!collapsed);\n\n if (isCloseIcon) {\n setSearchTerm('');\n setShowResults(false);\n } else {\n setShowResults(true);\n }\n };\n\n const className = ['search-content', modifier, responsiveClasses].filter(Boolean).join(' ');\n const searchModifier = collapsed ? 'search-content--collapse' : 'search-content--expanded';\n\n return (\n <div className={className} ref={searchContentRef}>\n <div className={`${searchModifier}__wrapper`}>\n <label className={`${searchModifier}__label`}>\n <span className={`${searchModifier}__icon_wrapper`}>\n <SearchContentToggleIcon\n searchTerm={debouncedSearchTerm}\n onClick={handleIconClick}\n useCloseIcon={collapsedSearch ? !collapsed : debouncedSearchTerm}\n />\n </span>\n {!collapsed && (\n <input\n className={`${searchModifier}__input`}\n type=\"text\"\n name=\"search\"\n placeholder={placeholder}\n value={searchTerm}\n onChange={e => setSearchTerm(e.target.value)}\n onKeyPress={handleKeyPress}\n onFocus={() => setShowResults(true)}\n data-testid=\"search-content-input\"\n />\n )}\n </label>\n </div>\n {showResults && (\n <SearchContentResults\n results={results}\n debouncedSearchTerm={debouncedSearchTerm}\n handleClick={handleNavigation}\n />\n )}\n </div>\n );\n};\n\nSearchContent.propTypes = {\n searchInputWrapperMobile: PropTypes.string,\n searchInputWrapperDesktop: PropTypes.string,\n placeholder: PropTypes.string,\n isMobile: PropTypes.bool,\n entities: PropTypes.array.isRequired,\n modifier: PropTypes.string,\n collapsedSearch: PropTypes.bool\n};\n\nSearchContent.defaultProps = {\n searchInputWrapperMobile: '',\n searchInputWrapperDesktop: '',\n placeholder: '',\n isMobile: false,\n modifier: '',\n collapsedSearch: false\n};\n\nexport default SearchContent;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAC1D,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,iBAAiB,QAAQ,6BAA6B;AAC/D,OAAOC,oBAAoB,MAAM,wBAAwB;AACzD,OAAOC,uBAAuB,MAAM,2BAA2B;AAE/D,MAAMC,aAAa,GAAGA,CAAC;EACrBC,QAAQ;EACRC,wBAAwB;EACxBC,yBAAyB;EACzBC,QAAQ;EACRC,WAAW;EACXC,QAAQ;EACRC;AACF,CAAC,KAAK;EACJ,MAAMC,gBAAgB,GAAGd,MAAM,CAAC,IAAI,CAAC;EACrC,MAAM,C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EX,SAAS,CAACgE,MAAM;EAC1BpD,eAAe,EAAEZ,SAAS,CAACiE;AAC7B,CAAC;AAED5D,aAAa,CAAC+D,YAAY,GAAG;EAC3B7D,wBAAwB,EAAE,EAAE;EAC5BC,yBAAyB,EAAE,EAAE;EAC7BE,WAAW,EAAE,EAAE;EACfD,QAAQ,EAAE,KAAK;EACfE,QAAQ,EAAE,EAAE;EACZC,eAAe,EAAE;AACnB,CAAC;AAED,eAAeP,aAAa"}
1
+ {"version":3,"file":"SearchContent.js","names":["React","useState","useEffect","useRef","PropTypes","useRouter","useDebounceSearch","SearchContentResults","SearchContentToggleIcon","SearchContent","entities","searchInputWrapperMobile","searchInputWrapperDesktop","isMobile","placeholder","modifier","collapsedSearch","searchUrl","navigateToSingleSearchResult","searchContentRef","collapsed","setCollapsed","showResults","setShowResults","router","results","searchTerm","setSearchTerm","debouncedSearchTerm","initialSearchTerm","resultKeys","handleRouteChange","events","on","off","handleClickOutside","event","current","contains","target","document","addEventListener","removeEventListener","responsiveClasses","handleNavigation","e","url","preventDefault","push","handleKeyDown","key","value","length","handleIconClick","isCloseIcon","className","filter","Boolean","join","searchModifier","createElement","ref","onClick","useCloseIcon","type","name","onChange","onKeyDown","onFocus","handleClick","propTypes","string","bool","array","isRequired","defaultProps"],"sources":["../../../src/components/SearchContent/SearchContent.js"],"sourcesContent":["import React, { useState, useEffect, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport { useRouter } from 'next/router';\nimport { useDebounceSearch } from '@blaze-cms/plugin-search-ui';\nimport SearchContentResults from './SearchContentResults';\nimport SearchContentToggleIcon from './SearchContentToggleIcon';\n\nconst SearchContent = ({\n entities,\n searchInputWrapperMobile,\n searchInputWrapperDesktop,\n isMobile,\n placeholder,\n modifier,\n collapsedSearch,\n searchUrl,\n navigateToSingleSearchResult\n}) => {\n const searchContentRef = useRef(null);\n const [collapsed, setCollapsed] = useState(collapsedSearch);\n const [showResults, setShowResults] = useState(false);\n const router = useRouter();\n\n const { results, searchTerm, setSearchTerm, debouncedSearchTerm } = useDebounceSearch({\n entities,\n initialSearchTerm: '',\n resultKeys: 'id, name, image { url }, url'\n });\n\n useEffect(\n () => {\n const handleRouteChange = () => {\n setSearchTerm('');\n setShowResults(false);\n if (collapsedSearch) setCollapsed(true);\n };\n router.events.on('routeChangeStart', handleRouteChange);\n\n return () => {\n router.events.off('routeChangeStart', handleRouteChange);\n };\n },\n [collapsedSearch, router.events, setSearchTerm]\n );\n\n useEffect(\n () => {\n const handleClickOutside = event => {\n if (searchContentRef.current && !searchContentRef.current.contains(event.target)) {\n setShowResults(false);\n if (collapsedSearch) {\n setCollapsed(true);\n setSearchTerm('');\n }\n }\n };\n\n document.addEventListener('click', handleClickOutside);\n\n return () => {\n document.removeEventListener('click', handleClickOutside);\n };\n },\n [collapsedSearch, setSearchTerm]\n );\n\n const responsiveClasses = isMobile ? searchInputWrapperMobile : searchInputWrapperDesktop;\n\n const handleNavigation = (e, url) => {\n e.preventDefault();\n router.push(url);\n };\n\n const handleKeyDown = e => {\n if (e.key === 'Enter' && e.target.value !== '') {\n if (navigateToSingleSearchResult && results && results.length === 1 && results[0].url) {\n router.push(results[0].url);\n } else {\n router.push(`${searchUrl || '/search'}?search_term=${e.target.value}`);\n }\n }\n };\n\n const handleIconClick = () => {\n const isCloseIcon = collapsedSearch ? !collapsed : debouncedSearchTerm;\n\n if (collapsedSearch) setCollapsed(!collapsed);\n\n if (isCloseIcon) {\n setSearchTerm('');\n setShowResults(false);\n } else {\n setShowResults(true);\n }\n };\n\n const className = ['search-content', modifier, responsiveClasses].filter(Boolean).join(' ');\n const searchModifier = collapsed ? 'search-content--collapse' : 'search-content--expanded';\n\n return (\n <div className={className} ref={searchContentRef}>\n <div className={`${searchModifier}__wrapper`}>\n <label className={`${searchModifier}__label`}>\n <span className={`${searchModifier}__icon_wrapper`}>\n <SearchContentToggleIcon\n searchTerm={debouncedSearchTerm}\n onClick={handleIconClick}\n useCloseIcon={collapsedSearch ? !collapsed : debouncedSearchTerm}\n />\n </span>\n {!collapsed && (\n <input\n className={`${searchModifier}__input`}\n type=\"text\"\n name=\"search\"\n placeholder={placeholder}\n value={searchTerm}\n onChange={e => setSearchTerm(e.target.value)}\n onKeyDown={handleKeyDown}\n onFocus={() => setShowResults(true)}\n data-testid=\"search-content-input\"\n />\n )}\n </label>\n </div>\n {showResults && (\n <SearchContentResults\n results={results}\n debouncedSearchTerm={debouncedSearchTerm}\n handleClick={handleNavigation}\n />\n )}\n </div>\n );\n};\n\nSearchContent.propTypes = {\n searchInputWrapperMobile: PropTypes.string,\n searchInputWrapperDesktop: PropTypes.string,\n placeholder: PropTypes.string,\n isMobile: PropTypes.bool,\n entities: PropTypes.array.isRequired,\n modifier: PropTypes.string,\n collapsedSearch: PropTypes.bool,\n searchUrl: PropTypes.string,\n navigateToSingleSearchResult: PropTypes.bool\n};\n\nSearchContent.defaultProps = {\n searchInputWrapperMobile: '',\n searchInputWrapperDesktop: '',\n placeholder: '',\n isMobile: false,\n modifier: '',\n collapsedSearch: false,\n searchUrl: '',\n navigateToSingleSearchResult: false\n};\n\nexport default SearchContent;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAC1D,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,iBAAiB,QAAQ,6BAA6B;AAC/D,OAAOC,oBAAoB,MAAM,wBAAwB;AACzD,OAAOC,uBAAuB,MAAM,2BAA2B;AAE/D,MAAMC,aAAa,GAAGA,CAAC;EACrBC,QAAQ;EACRC,wBAAwB;EACxBC,yBAAyB;EACzBC,QAAQ;EACRC,WAAW;EACXC,QAAQ;EACRC,eAAe;EACfC,SAAS;EACTC;AACF,CAAC,KAAK;EACJ,MAAMC,gBAAgB,GAAGhB,MAAM,CAAC,IAAI,CAAC;EACrC,MAAM,CAACiB,SAAS,EAAEC,YAAY,CAAC,GAAGpB,QAAQ,CAACe,eAA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AC1C3D,yBAAyB,EAAER,SAAS,CAACmE,MAAM;EAC3CzD,WAAW,EAAEV,SAAS,CAACmE,MAAM;EAC7B1D,QAAQ,EAAET,SAAS,CAACoE,IAAI;EACxB9D,QAAQ,EAAEN,SAAS,CAACqE,KAAK,CAACC,UAAU;EACpC3D,QAAQ,EAAEX,SAAS,CAACmE,MAAM;EAC1BvD,eAAe,EAAEZ,SAAS,CAACoE,IAAI;EAC/BvD,SAAS,EAAEb,SAAS,CAACmE,MAAM;EAC3BrD,4BAA4B,EAAEd,SAAS,CAACoE;AAC1C,CAAC;AAED/D,aAAa,CAACkE,YAAY,GAAG;EAC3BhE,wBAAwB,EAAE,EAAE;EAC5BC,yBAAyB,EAAE,EAAE;EAC7BE,WAAW,EAAE,EAAE;EACfD,QAAQ,EAAE,KAAK;EACfE,QAAQ,EAAE,EAAE;EACZC,eAAe,EAAE,KAAK;EACtBC,SAAS,EAAE,EAAE;EACbC,4BAA4B,EAAE;AAChC,CAAC;AAED,eAAeT,aAAa"}
@@ -5,7 +5,7 @@ const SearchContentItems = ({
5
5
  results = [],
6
6
  onClick
7
7
  }) => results.map(item => {
8
- if (!item.url) return null;
8
+ if (!item || !item.url) return null;
9
9
  const {
10
10
  id,
11
11
  name,
@@ -1 +1 @@
1
- {"version":3,"file":"SearchContentItems.js","names":["React","BlazeLink","LazyImage","SearchContentItems","results","onClick","map","item","url","id","name","image","createElement","href","key","className","src","alt","sizeKey"],"sources":["../../../src/components/SearchContent/SearchContentItems.js"],"sourcesContent":["import React from 'react';\nimport BlazeLink from '../BlazeLink';\nimport LazyImage from '../LazyImage';\n\nconst SearchContentItems = ({ results = [], onClick }) =>\n results.map(item => {\n if (!item.url) return null;\n\n const { id, name, image, url } = item;\n\n return (\n <BlazeLink href={url} onClick={onClick} key={id}>\n <div className=\"search-content--results__wrapper\">\n {image?.url ? (\n <LazyImage\n src={image.url}\n alt={name}\n className=\"search-content--results__image\"\n sizeKey=\"search-result\"\n />\n ) : null}\n <span className=\"search-content--results__title\">{name}</span>\n </div>\n </BlazeLink>\n );\n });\n\nexport default SearchContentItems;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,cAAc;AACpC,OAAOC,SAAS,MAAM,cAAc;AAEpC,MAAMC,kBAAkB,GAAGA,CAAC;EAAEC,OAAO,GAAG,EAAE;EAAEC;AAAQ,CAAC,KACnDD,OAAO,CAACE,GAAG,CAACC,IAAI,IAAI;EAClB,IAAI,CAACA,IAAI,CAACC,GAAG,EAAE,OAAO,IAAI;EAE1B,MAAM;IAAEC,EAAE;IAAEC,IAAI;IAAEC,KAAK;IAAEH;EAAI,CAAC,GAAGD,IAAI;EAErC,oBACEP,KAAA,CAAAY,aAAA,CAACX,SAAS;IAACY,IAAI,EAAEL,GAAI;IAACH,OAAO,EAAEA,OAAQ;IAACS,GAAG,EAAEL;EAAG,gBAC9CT,KAAA,CAAAY,aAAA;IAAKG,SAAS,EAAC;EAAkC,GAC9C,CAAAJ,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEH,GAAG,iBACTR,KAAA,CAAAY,aAAA,CAACV,SAAS;IACRc,GAAG,EAAEL,KAAK,CAACH,GAAI;IACfS,GAAG,EAAEP,IAAK;IACVK,SAAS,EAAC,gCAAgC;IAC1CG,OAAO,EAAC;EAAe,CACxB,CAAC,GACA,IAAI,eACRlB,KAAA,CAAAY,aAAA;IAAMG,SAAS,EAAC;EAAgC,GAAEL,IAAW,CAC1D,CACI,CAAC;AAEhB,CAAC,CAAC;AAEJ,eAAeP,kBAAkB"}
1
+ {"version":3,"file":"SearchContentItems.js","names":["React","BlazeLink","LazyImage","SearchContentItems","results","onClick","map","item","url","id","name","image","createElement","href","key","className","src","alt","sizeKey"],"sources":["../../../src/components/SearchContent/SearchContentItems.js"],"sourcesContent":["import React from 'react';\nimport BlazeLink from '../BlazeLink';\nimport LazyImage from '../LazyImage';\n\nconst SearchContentItems = ({ results = [], onClick }) =>\n results.map(item => {\n if (!item || !item.url) return null;\n\n const { id, name, image, url } = item;\n\n return (\n <BlazeLink href={url} onClick={onClick} key={id}>\n <div className=\"search-content--results__wrapper\">\n {image?.url ? (\n <LazyImage\n src={image.url}\n alt={name}\n className=\"search-content--results__image\"\n sizeKey=\"search-result\"\n />\n ) : null}\n <span className=\"search-content--results__title\">{name}</span>\n </div>\n </BlazeLink>\n );\n });\n\nexport default SearchContentItems;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,cAAc;AACpC,OAAOC,SAAS,MAAM,cAAc;AAEpC,MAAMC,kBAAkB,GAAGA,CAAC;EAAEC,OAAO,GAAG,EAAE;EAAEC;AAAQ,CAAC,KACnDD,OAAO,CAACE,GAAG,CAACC,IAAI,IAAI;EAClB,IAAI,CAACA,IAAI,IAAI,CAACA,IAAI,CAACC,GAAG,EAAE,OAAO,IAAI;EAEnC,MAAM;IAAEC,EAAE;IAAEC,IAAI;IAAEC,KAAK;IAAEH;EAAI,CAAC,GAAGD,IAAI;EAErC,oBACEP,KAAA,CAAAY,aAAA,CAACX,SAAS;IAACY,IAAI,EAAEL,GAAI;IAACH,OAAO,EAAEA,OAAQ;IAACS,GAAG,EAAEL;EAAG,gBAC9CT,KAAA,CAAAY,aAAA;IAAKG,SAAS,EAAC;EAAkC,GAC9C,CAAAJ,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEH,GAAG,iBACTR,KAAA,CAAAY,aAAA,CAACV,SAAS;IACRc,GAAG,EAAEL,KAAK,CAACH,GAAI;IACfS,GAAG,EAAEP,IAAK;IACVK,SAAS,EAAC,gCAAgC;IAC1CG,OAAO,EAAC;EAAe,CACxB,CAAC,GACA,IAAI,eACRlB,KAAA,CAAAY,aAAA;IAAMG,SAAS,EAAC;EAAgC,GAAEL,IAAW,CAC1D,CACI,CAAC;AAEhB,CAAC,CAAC;AAEJ,eAAeP,kBAAkB"}
@@ -151,7 +151,7 @@ const SearchFilter = ({
151
151
  }), /*#__PURE__*/React.createElement("button", {
152
152
  className: "button button--full-width",
153
153
  type: "submit"
154
- }, SEARCH)))), /*#__PURE__*/React.createElement("br", null), !displaySearchFilter && /*#__PURE__*/React.createElement("button", {
154
+ }, SEARCH)))), !displaySearchFilter && /*#__PURE__*/React.createElement("button", {
155
155
  className: "button button--full-width",
156
156
  type: "submit"
157
157
  }, SEARCH))), displaySearchFilter && /*#__PURE__*/React.createElement(MobileFormToolbar, {