@shopgate/engage 6.20.0-beta.2 → 6.20.0-beta.5

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 (257) hide show
  1. package/a11y/components/LiveMessage/__tests__/index.spec.js +1 -1
  2. package/a11y/components/LiveMessage/index.js +1 -1
  3. package/a11y/components/LiveMessenger/__tests__/index.spec.js +1 -1
  4. package/a11y/components/LiveMessenger/helpers.js +1 -1
  5. package/a11y/components/LiveMessenger/index.js +2 -2
  6. package/a11y/components/Navigation/__tests__/index.spec.js +1 -1
  7. package/a11y/components/Navigation/index.js +1 -1
  8. package/a11y/components/Section/__tests__/index.spec.js +1 -1
  9. package/a11y/components/Section/index.js +2 -2
  10. package/a11y/index.spec.js +1 -1
  11. package/account/constants/index.js +1 -0
  12. package/account/constants/routes.js +1 -0
  13. package/account/index.js +1 -0
  14. package/app-rating/actions/showModal.js +2 -2
  15. package/cart/index.spec.js +1 -1
  16. package/category/components/CategoryList/index.js +1 -1
  17. package/category/index.spec.js +1 -1
  18. package/checkout/index.spec.js +1 -1
  19. package/components/ChipLayout/index.js +11 -11
  20. package/components/ChipLayout/spec.js +1 -1
  21. package/components/Footer/Footer.js +9 -9
  22. package/components/Footer/__tests__/Footer.spec.js +4 -4
  23. package/components/Form/Builder/Builder.js +10 -10
  24. package/components/Form/Builder/Builder.spec.js +4 -4
  25. package/components/Form/Builder/ElementCheckbox.js +1 -1
  26. package/components/Form/Builder/ElementRadio.js +1 -1
  27. package/components/Form/Builder/ElementSelect.js +1 -1
  28. package/components/Form/Builder/ElementText.js +1 -1
  29. package/components/Form/Builder/classes/ActionListener.js +3 -3
  30. package/components/Form/Builder/helpers/buildCountryList.js +1 -1
  31. package/components/Form/Builder/helpers/buildFormDefaults.js +1 -1
  32. package/components/Form/Builder/helpers/buildFormElements.js +2 -2
  33. package/components/Form/Builder/helpers/buildFormElements.spec.js +2 -2
  34. package/components/Form/Builder/helpers/buildProvinceList.js +1 -1
  35. package/components/Form/Form.js +8 -8
  36. package/components/IntersectionVisibility/index.js +5 -5
  37. package/components/Logo/index.js +1 -1
  38. package/components/Logo/spec.js +1 -1
  39. package/components/MessageBar/index.js +1 -1
  40. package/components/MessageBar/spec.js +1 -1
  41. package/components/NavigationHandler/index.js +5 -5
  42. package/components/NavigationHandler/spec.js +1 -1
  43. package/components/Picker/components/Button/index.js +1 -1
  44. package/components/Picker/components/List/index.js +1 -1
  45. package/components/Picker/components/Modal/index.js +5 -5
  46. package/components/Picker/index.js +9 -9
  47. package/components/Picker/spec.js +1 -1
  48. package/components/PickerUtilize/components/Button/index.js +1 -1
  49. package/components/PickerUtilize/index.js +6 -6
  50. package/components/PickerUtilize/spec.js +1 -1
  51. package/components/QuantityInput/QuantityInput.js +4 -4
  52. package/components/RangeSlider/components/Handle/index.js +1 -1
  53. package/components/RangeSlider/index.js +11 -11
  54. package/components/RangeSlider/spec.js +4 -4
  55. package/components/ScrollHeader/index.js +2 -2
  56. package/components/SheetDrawer/index.js +1 -1
  57. package/components/SheetList/components/Item/index.js +5 -5
  58. package/components/SheetList/components/Item/spec.js +2 -2
  59. package/components/SheetList/index.js +4 -4
  60. package/components/SheetList/spec.js +1 -1
  61. package/components/SnackBarContainer/index.js +1 -1
  62. package/components/TimeBoundary/index.js +5 -5
  63. package/components/TimeBoundary/spec.js +3 -3
  64. package/components/VideoPlayer/index.js +6 -6
  65. package/components/View/__mocks__/index.js +1 -1
  66. package/components/View/__tests__/index.spec.js +1 -1
  67. package/components/View/__tests__/provider.spec.js +1 -1
  68. package/components/View/components/Above/__tests__/index.spec.js +1 -1
  69. package/components/View/components/Above/index.js +1 -1
  70. package/components/View/components/Below/__tests__/index.spec.js +1 -1
  71. package/components/View/components/Below/index.js +1 -1
  72. package/components/View/components/Content/__tests__/index.spec.js +1 -1
  73. package/components/View/components/Content/index.js +9 -9
  74. package/components/View/context.js +1 -1
  75. package/components/View/index.js +2 -2
  76. package/components/View/provider.js +6 -4
  77. package/components/index.spec.js +1 -1
  78. package/core/actions/__tests__/getGeolocation.spec.js +2 -2
  79. package/core/actions/__tests__/grantPermissions.spec.js +1 -1
  80. package/core/actions/getGeolocation.js +1 -1
  81. package/core/actions/grantPermissions.js +3 -3
  82. package/core/classes/GeolocationRequest.js +3 -3
  83. package/core/config/ThemeConfigResolver.js +1 -1
  84. package/core/constants/shopSettings.js +2 -0
  85. package/core/contexts/AppContext.js +1 -1
  86. package/core/helpers/getFullImageSource.js +2 -2
  87. package/core/helpers/updateLegacyNavigationBar.js +1 -1
  88. package/core/hocs/__mocks__/withWidgetSettings.js +1 -1
  89. package/core/hocs/__tests__/withApp.spec.js +1 -1
  90. package/core/hocs/__tests__/withCurrentProduct.spec.js +1 -1
  91. package/core/hocs/__tests__/withForwardedRef.spec.js +1 -1
  92. package/core/hocs/__tests__/withNavigation.spec.js +1 -1
  93. package/core/hocs/__tests__/withRoute.spec.js +1 -1
  94. package/core/hocs/__tests__/withTheme.spec.js +2 -2
  95. package/core/hocs/__tests__/withWidgetSettings.spec.js +1 -1
  96. package/core/hocs/__tests__/withWidgetStyles.spec.js +1 -1
  97. package/core/hocs/withApp.js +1 -1
  98. package/core/hocs/withCurrentProduct.js +1 -1
  99. package/core/hocs/withForwardedRef.js +1 -1
  100. package/core/hocs/withNavigation.js +1 -1
  101. package/core/hocs/withRoute.js +1 -1
  102. package/core/hocs/withTheme.js +2 -2
  103. package/core/hocs/withWidgetSettings.js +1 -1
  104. package/core/hocs/withWidgetStyles.js +1 -1
  105. package/core/hooks/__tests__/useNavigation.spec.js +1 -1
  106. package/core/hooks/html/useLoadImage.js +1 -1
  107. package/core/hooks/useTheme.js +2 -2
  108. package/core/index.spec.js +1 -1
  109. package/core/providers/AppProvider.js +9 -7
  110. package/core/providers/__tests__/AppProvider.spec.js +2 -2
  111. package/core/selectors/index.js +1 -0
  112. package/core/selectors/shopSettings.js +14 -0
  113. package/favorites/components/FavoriteProvider/connector.js +5 -0
  114. package/favorites/components/FavoriteProvider/index.js +4 -0
  115. package/favorites/components/Item/Item.js +10 -0
  116. package/favorites/components/Item/ItemCharacteristics.js +4 -0
  117. package/favorites/components/Item/index.js +1 -0
  118. package/favorites/components/List/List.js +16 -0
  119. package/favorites/components/List/index.js +1 -0
  120. package/favorites/components/ListChooser/ListChooser.js +10 -0
  121. package/favorites/components/ListChooser/ListChooserItem.js +7 -0
  122. package/favorites/components/ListChooser/index.js +1 -0
  123. package/favorites/components/Lists/Lists.js +16 -0
  124. package/favorites/components/Lists/ListsModal.js +4 -0
  125. package/favorites/components/Lists/index.js +1 -0
  126. package/favorites/components/RemoveButton/RemoveButton.js +4 -0
  127. package/favorites/components/RemoveButton/index.js +1 -0
  128. package/favorites/constants/Portals.js +2 -0
  129. package/favorites/index.js +3 -4
  130. package/favorites/index.spec.js +1 -1
  131. package/filter/components/FilterItem/index.js +1 -1
  132. package/filter/components/FilterItem/spec.js +1 -1
  133. package/filter/components/PriceSlider/components/Label/index.js +2 -2
  134. package/filter/components/PriceSlider/components/Label/spec.js +1 -1
  135. package/filter/components/PriceSlider/index.js +6 -6
  136. package/filter/components/PriceSlider/spec.js +1 -1
  137. package/filter/helpers/__tests__/buildUpdatedFilters.spec.js +1 -1
  138. package/filter/helpers/buildInitialFilters.js +1 -1
  139. package/filter/helpers/buildUpdatedFilters.js +2 -2
  140. package/filter/index.spec.js +1 -1
  141. package/index.spec.js +1 -1
  142. package/market/index.spec.js +1 -1
  143. package/orders/index.spec.js +1 -1
  144. package/package.json +7 -7
  145. package/page/index.spec.js +1 -1
  146. package/product/components/Characteristics/Characteristic/components/Sheet/index.js +4 -4
  147. package/product/components/Characteristics/Characteristic/components/SheetItem/index.js +3 -3
  148. package/product/components/Characteristics/Characteristic/components/VariantAvailability/index.js +3 -3
  149. package/product/components/Characteristics/Characteristic/index.js +5 -5
  150. package/product/components/Characteristics/Swatch/index.js +5 -5
  151. package/product/components/Characteristics/index.js +3 -3
  152. package/product/components/Description/__tests__/Description.spec.js +1 -1
  153. package/product/components/Description/index.js +2 -2
  154. package/product/components/EffectivityDates/index.js +1 -1
  155. package/product/components/Header/PriceStriked/index.js +1 -1
  156. package/product/components/Header/Shipping/components/Label/index.js +2 -2
  157. package/product/components/Header/Shipping/index.js +1 -1
  158. package/product/components/Header/Shipping/spec.js +1 -1
  159. package/product/components/Header/Tiers/components/Tier/index.js +2 -2
  160. package/product/components/Header/Tiers/components/Tier/spec.js +1 -1
  161. package/product/components/Header/Tiers/index.js +1 -1
  162. package/product/components/Header/Tiers/spec.js +1 -1
  163. package/product/components/MapPriceHint/index.js +1 -1
  164. package/product/components/Media/FeaturedMedia.js +1 -1
  165. package/product/components/Media/MediaImage.js +2 -2
  166. package/product/components/Media/MediaPlaceholder.js +1 -1
  167. package/product/components/Media/helpers.js +2 -2
  168. package/product/components/MediaSlider/components/MediaImage/index.js +1 -1
  169. package/product/components/MediaSlider/components/MediaVideo/index.js +1 -1
  170. package/product/components/MediaSlider/index.js +1 -1
  171. package/product/components/Options/components/Content/index.js +6 -6
  172. package/product/components/Options/components/Content/spec.js +1 -1
  173. package/product/components/Options/components/Option/index.js +1 -1
  174. package/product/components/Options/components/TextOption/components/OptionInfo/index.js +2 -2
  175. package/product/components/Options/components/TextOption/components/OptionInfo/spec.js +1 -1
  176. package/product/components/Options/components/TextOption/index.js +6 -6
  177. package/product/components/Options/index.js +1 -1
  178. package/product/components/OrderQuantityHint/index.js +1 -1
  179. package/product/components/PriceDifference/index.js +1 -1
  180. package/product/components/ProductBadges/index.js +2 -2
  181. package/product/components/ProductCard/index.js +2 -2
  182. package/product/components/ProductCharacteristics/context.js +1 -1
  183. package/product/components/ProductCharacteristics/index.js +9 -9
  184. package/product/components/ProductDiscountBadge/index.js +1 -1
  185. package/product/components/ProductDiscountBadge/spec.js +1 -1
  186. package/product/components/ProductGridPrice/index.js +1 -1
  187. package/product/components/ProductGridPrice/index.spec.js +1 -1
  188. package/product/components/ProductImage/index.js +7 -7
  189. package/product/components/ProductImage/spec.js +1 -1
  190. package/product/components/ProductList/components/Item/index.js +1 -1
  191. package/product/components/ProductList/components/Iterator/index.js +1 -1
  192. package/product/components/ProductList/components/Layout/index.js +1 -1
  193. package/product/components/ProductList/index.js +1 -1
  194. package/product/components/ProductProperties/Content.js +2 -2
  195. package/product/components/ProductProperties/Group.js +1 -1
  196. package/product/components/ProductProperties/GroupedProperties.js +1 -1
  197. package/product/components/ProductProperties/Lists.js +1 -1
  198. package/product/components/ProductProperties/ProductProperties.js +1 -1
  199. package/product/components/ProductProperties/Row.js +1 -1
  200. package/product/components/ProductProperties/Rows.js +1 -1
  201. package/product/components/ProductProperties/Wrapper.js +1 -1
  202. package/product/components/ProductProperties/__tests__/Content.spec.js +1 -1
  203. package/product/components/ProductProperties/__tests__/Group.spec.js +1 -1
  204. package/product/components/ProductProperties/__tests__/GroupedProperties.spec.js +1 -1
  205. package/product/components/ProductProperties/__tests__/Lists.spec.js +1 -1
  206. package/product/components/ProductProperties/__tests__/ProductProperties.spec.js +1 -1
  207. package/product/components/ProductProperties/__tests__/Row.spec.js +1 -1
  208. package/product/components/ProductProperties/__tests__/Rows.spec.js +1 -1
  209. package/product/components/ProductProvider/index.js +1 -1
  210. package/product/components/ProductSlider/index.js +1 -1
  211. package/product/components/ProductSlider/spec.js +1 -1
  212. package/product/components/QuantityPicker/index.js +2 -2
  213. package/product/components/Rating/index.js +2 -2
  214. package/product/components/Rating/spec.js +1 -1
  215. package/product/components/RelationsSlider/RelationsSheet.js +2 -2
  216. package/product/components/RelationsSlider/RelationsSlider.js +1 -1
  217. package/product/components/RelationsSlider/RelationsSliderContent.js +1 -1
  218. package/product/components/Swatch/Swatch.js +1 -1
  219. package/product/components/Swatch/SwatchContent.js +1 -1
  220. package/product/components/Swatch/VariantSwatch.js +1 -1
  221. package/product/components/Swatches/Swatches.js +1 -1
  222. package/product/components/UnitQuantityPicker/ProductUnitQuantityPicker.js +1 -1
  223. package/product/components/UnitQuantityPicker/UnitQuantityPicker.js +1 -1
  224. package/product/components/UnitQuantityPicker/UnitQuantityPickerWithSection.js +1 -1
  225. package/product/components/__mocks__/context.js +1 -1
  226. package/product/components/context.js +1 -1
  227. package/product/helpers/index.js +1 -1
  228. package/product/hocs/withMapPricing.js +4 -4
  229. package/product/hocs/withPriceCalculation.js +2 -2
  230. package/product/hooks/useLoadProductImage.js +1 -1
  231. package/product/index.spec.js +1 -1
  232. package/reviews/components/Reviews/components/AllReviewsLink/index.js +1 -1
  233. package/reviews/components/Reviews/components/Header/components/AverageRating/index.js +2 -2
  234. package/reviews/components/Reviews/components/Header/components/NoReviews/index.js +1 -1
  235. package/reviews/components/Reviews/components/Header/components/ReviewsExcerpt/index.js +1 -1
  236. package/reviews/components/Reviews/components/Header/components/WriteReviewLink/index.js +1 -1
  237. package/reviews/components/Reviews/components/Header/components/WriteReviewLink/spec.js +1 -1
  238. package/reviews/components/Reviews/components/Header/index.js +1 -1
  239. package/reviews/components/Reviews/components/Header/spec.js +1 -1
  240. package/reviews/components/Reviews/components/List/components/Info/components/Author/index.js +1 -1
  241. package/reviews/components/Reviews/components/List/components/Info/components/ReviewDate/index.js +1 -1
  242. package/reviews/components/Reviews/components/List/components/Info/index.js +2 -2
  243. package/reviews/components/Reviews/components/List/components/Rating/index.js +1 -1
  244. package/reviews/components/Reviews/components/List/components/Review/index.js +1 -1
  245. package/reviews/components/Reviews/components/List/components/Text/index.js +1 -1
  246. package/reviews/components/Reviews/components/List/components/Title/index.js +1 -1
  247. package/reviews/components/Reviews/components/List/index.js +3 -3
  248. package/reviews/components/Reviews/components/List/spec.js +1 -1
  249. package/reviews/components/Reviews/components/RatingCount/index.js +1 -1
  250. package/reviews/components/Reviews/components/RatingCount/spec.js +1 -1
  251. package/reviews/components/Reviews/index.js +1 -1
  252. package/reviews/components/Reviews/spec.js +2 -2
  253. package/reviews/index.spec.js +1 -1
  254. package/scanner/index.spec.js +1 -1
  255. package/search/index.spec.js +1 -1
  256. package/user/index.spec.js +1 -1
  257. package/core/helpers/getImageFormat.js +0 -4
@@ -3,4 +3,4 @@ import _camelCase from"lodash/camelCase";import React,{memo}from'react';import P
3
3
  * @param {Object} props Component props.
4
4
  * @param {Object} props.element The data of the element to be rendered
5
5
  * @returns {JSX}
6
- */var ElementSelect=function ElementSelect(props){var element=props.element,errorText=props.errorText,name=props.name,value=props.value,visible=props.visible;if(!visible){return null;}return React.createElement("div",{className:"".concat(_camelCase(name)," engage__form-select")},React.createElement(Select,{name:name,label:element.label,placeholder:element.placeholder,value:value,options:element.options,onChange:element.handleChange,errorText:errorText,isControlled:true,translateErrorText:false}));};ElementSelect.defaultProps={value:'',visible:true};export default memo(ElementSelect);
6
+ */var ElementSelect=function ElementSelect(props){var element=props.element,errorText=props.errorText,name=props.name,value=props.value,visible=props.visible;if(!visible){return null;}return/*#__PURE__*/React.createElement("div",{className:"".concat(_camelCase(name)," engage__form-select")},/*#__PURE__*/React.createElement(Select,{name:name,label:element.label,placeholder:element.placeholder,value:value,options:element.options,onChange:element.handleChange,errorText:errorText,isControlled:true,translateErrorText:false}));};ElementSelect.defaultProps={value:'',visible:true};export default/*#__PURE__*/memo(ElementSelect);
@@ -4,4 +4,4 @@ var mapping=(_mapping={},_defineProperty(_mapping,ELEMENT_TYPE_TEXT,'text'),_def
4
4
  * @param {Object} props Component props.
5
5
  * @param {Object} props.element The data of the element to be rendered
6
6
  * @returns {JSX}
7
- */var ElementText=function ElementText(props){var element=props.element,errorText=props.errorText,name=props.name,value=props.value,visible=props.visible;if(!visible){return null;}var type=mapping[element.type];return React.createElement("div",{className:"".concat(_camelCase(name)," engage__form-text")},React.createElement(TextField,{type:type,name:name,label:element.label,value:value,onChange:element.handleChange,errorText:errorText,isControlled:true,translateErrorText:false}));};ElementText.defaultProps={value:'',visible:true};export default memo(ElementText);
7
+ */var ElementText=function ElementText(props){var element=props.element,errorText=props.errorText,name=props.name,value=props.value,visible=props.visible;if(!visible){return null;}var type=mapping[element.type];return/*#__PURE__*/React.createElement("div",{className:"".concat(_camelCase(name)," engage__form-text")},/*#__PURE__*/React.createElement(TextField,{type:type,name:name,label:element.label,value:value,onChange:element.handleChange,errorText:errorText,isControlled:true,translateErrorText:false}));};ElementText.defaultProps={value:'',visible:true};export default/*#__PURE__*/memo(ElementText);
@@ -1,6 +1,6 @@
1
- function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import{logger}from'@shopgate/pwa-core/helpers';import{ELEMENT_TYPE_NUMBER,ELEMENT_TYPE_COUNTRY,ELEMENT_TYPE_PROVINCE,ELEMENT_TYPE_CHECKBOX}from"../Builder.constants";import{ACTION_TYPE_UPDATE_PROVINCE_ELEMENT,ACTION_TYPE_SET_VISIBILITY,ACTION_TYPE_SET_VALUE,ACTION_TYPE_TRANSFORM,ACTION_SET_VALUE_FIXED,ACTION_SET_VALUE_COPY_FROM,ACTION_SET_VALUE_LENGTH_OF,ACTION_RULE_TYPE_NOT_IN,ACTION_RULE_TYPE_ONE_OF,ACTION_RULE_TYPE_BOOLEAN,ACTION_RULE_TYPE_REGEX,ACTION_RULE_DATA_TYPES,ACTION_RULES_CONCAT_METHOD_ALL,ACTION_RULES_CONCAT_METHOD_ANY,ACTION_RULES_CONCAT_METHOD_NONE}from"./ActionListener.constants";/**
1
+ function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++){arr2[i]=arr[i];}return arr2;}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj;}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;},_typeof(obj);}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import{logger}from'@shopgate/pwa-core/helpers';import{ELEMENT_TYPE_NUMBER,ELEMENT_TYPE_COUNTRY,ELEMENT_TYPE_PROVINCE,ELEMENT_TYPE_CHECKBOX}from"../Builder.constants";import{ACTION_TYPE_UPDATE_PROVINCE_ELEMENT,ACTION_TYPE_SET_VISIBILITY,ACTION_TYPE_SET_VALUE,ACTION_TYPE_TRANSFORM,ACTION_SET_VALUE_FIXED,ACTION_SET_VALUE_COPY_FROM,ACTION_SET_VALUE_LENGTH_OF,ACTION_RULE_TYPE_NOT_IN,ACTION_RULE_TYPE_ONE_OF,ACTION_RULE_TYPE_BOOLEAN,ACTION_RULE_TYPE_REGEX,ACTION_RULE_DATA_TYPES,ACTION_RULES_CONCAT_METHOD_ALL,ACTION_RULES_CONCAT_METHOD_ANY,ACTION_RULES_CONCAT_METHOD_NONE}from"./ActionListener.constants";/**
2
2
  * ActionListener and handler for the FormBuilder component
3
- */var ActionListener=/**
3
+ */var ActionListener=/*#__PURE__*/_createClass(/**
4
4
  * Constructor
5
5
  * @param {function(string)} getProvincesList Takes a country code and returns a list of provinces
6
6
  * @param {Object} defaults Form defaults
@@ -37,4 +37,4 @@ newState=notifyListener(prevState,newState);});}return newState;});this.defaults
37
37
  * Takes the elements to be rendered by the FormBuilder and attaches available action listeners
38
38
  * to the component.
39
39
  * @param {FormElement[]} elementList List of all elements
40
- */;export default ActionListener;
40
+ */);export default ActionListener;
@@ -7,4 +7,4 @@ function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj
7
7
  if(countryElement.countries!==null&&countryElement.countries!==undefined&&!Array.isArray(countryElement.countries)){logger.error("Error: Invalid property type 'countries' in element "+"'".concat(countryElement.id,"'. Must be 'array', 'null' or 'undefined'"));return{};}// Build country display list for the country element (whitelist)
8
8
  // For 'null', 'undefined' and '[]' it shows all countries
9
9
  var countryKeys;if(countryElement.countries.length>0){countryKeys=countryElement.countries;}else{countryKeys=Object.keys(iso3166);}var countryList=countryKeys.reduce(function(reducer,countryCode){if(!iso3166[countryCode]){logger.error("Error: unknown country code [".concat(countryCode,"]"));return reducer;}return _extends({},reducer,_defineProperty({},countryCode,iso3166[countryCode].name));},{});// Add a "no selection" element
10
- if(countryElement.required){return countryList;}return _extends({},optional,{},countryList);});
10
+ if(countryElement.required){return countryList;}return _extends({},optional,countryList);});
@@ -1,4 +1,4 @@
1
- function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}import{ELEMENT_TYPE_CHECKBOX,ELEMENT_TYPE_SELECT}from"../Builder.constants";/**
1
+ function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++){arr2[i]=arr[i];}return arr2;}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}import{ELEMENT_TYPE_CHECKBOX,ELEMENT_TYPE_SELECT}from"../Builder.constants";/**
2
2
  * Prepare state of formData for form builder
3
3
  * @param {Object} formElements form elements
4
4
  * @param {Object} defaults form defaults
@@ -1,4 +1,4 @@
1
- function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import{logger}from'@shopgate/pwa-core/helpers';import{ELEMENT_TYPE_COUNTRY,ELEMENT_TYPE_PROVINCE}from"../Builder.constants";/** Noop function */var noop=function noop(){};/**
1
+ var _excluded=["custom"];function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import{logger}from'@shopgate/pwa-core/helpers';import{ELEMENT_TYPE_COUNTRY,ELEMENT_TYPE_PROVINCE}from"../Builder.constants";/** Noop function */var noop=function noop(){};/**
2
2
  * @typedef {Object} FormElement
3
3
  * @property {string} id
4
4
  * @property {boolean} custom
@@ -26,6 +26,6 @@ function _objectWithoutProperties(source,excluded){if(source==null)return{};var
26
26
  */var addFormElement=function addFormElement(id,field){var custom=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;// The "custom" field is just a placeholder for more fields
27
27
  if(typeof field.type!=='string'){return;}// Make sure country and province elements are only added once
28
28
  if(field.type===ELEMENT_TYPE_COUNTRY){if(hasCountryElement){logger.error("Error: Can not add multiple elements of type '".concat(field.type,"'"));return;}hasCountryElement=true;}if(field.type===ELEMENT_TYPE_PROVINCE){if(hasProvinceElement){logger.error("Error: Can not add multiple elements of type '".concat(field.type,"'"));return;}hasProvinceElement=true;}elementList.push(_extends({id:id},field,{custom:custom,handleChange:function handleChange(value){return elementChangeHandler(id,value);}}));};// Extract custom fields, do not mix with normal fields
29
- var _formConfig$fields=formConfig.fields,custom=_formConfig$fields.custom,restFields=_objectWithoutProperties(_formConfig$fields,["custom"]);// Add all non-custom attributes and mark them as such
29
+ var _formConfig$fields=formConfig.fields,custom=_formConfig$fields.custom,restFields=_objectWithoutProperties(_formConfig$fields,_excluded);// Add all non-custom attributes and mark them as such
30
30
  Object.keys(restFields).forEach(function(id){addFormElement(id,formConfig.fields[id]);});// Add custom fields to the element list
31
31
  if(custom){Object.keys(custom).forEach(function(id){addFormElement(id,formConfig.fields.custom[id],true);});}return elementList;});
@@ -1,3 +1,3 @@
1
- function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}import{ELEMENT_TYPE_COUNTRY}from"../Builder.constants";import buildFormElements from"./buildFormElements";jest.mock('@shopgate/pwa-core/helpers',function(){return{logger:{error:function error(){}}};});var formElementConfig={sortOrder:1,label:'Label',type:'text',"default":'default',placeholder:'locales',required:true,visible:true};var formElement={id:'field',sortOrder:1,label:'Label',type:'text',"default":'default',placeholder:'locales',required:true,visible:true,custom:false};describe('Builder/helpers/buildFormElements',function(){it('should not build custom field',function(){var config={fields:{custom:formElementConfig}};expect(buildFormElements(config)).toEqual([]);});it('should not build empty config',function(){var config={fields:{}};expect(buildFormElements(config)).toEqual([]);});it('should build text element',function(){var config={fields:{field:formElementConfig}};var _buildFormElements$=buildFormElements(config)[0],ignore=_buildFormElements$.handleChange,restElement=_objectWithoutProperties(_buildFormElements$,["handleChange"]);expect(restElement).toEqual(formElement);});it('should build 1 country element',function(){var config={fields:{country:_extends({},formElementConfig,{type:ELEMENT_TYPE_COUNTRY}),// eslint-disable-next-line camelcase
2
- country_2:_extends({},formElementConfig,{type:ELEMENT_TYPE_COUNTRY})}};var expected=_extends({},formElement,{id:'country',type:ELEMENT_TYPE_COUNTRY});var _buildFormElements$2=buildFormElements(config)[0],ignore=_buildFormElements$2.handleChange,restElement=_objectWithoutProperties(_buildFormElements$2,["handleChange"]);expect(restElement).toEqual(expected);});it('should build custom text element',function(){var config={fields:{custom:{field:formElementConfig}}};var expected=_extends({},formElement,{custom:true});var _buildFormElements$3=buildFormElements(config)[0],ignore=_buildFormElements$3.handleChange,restElement=_objectWithoutProperties(_buildFormElements$3,["handleChange"]);expect(restElement).toEqual(expected);});it('should build correct change handler for text field',function(){var config={fields:{field:formElementConfig}};var mockHandler=jest.fn();var handleChange=buildFormElements(config,mockHandler)[0].handleChange;// Invoke handler with field value
1
+ var _excluded=["handleChange"],_excluded2=["handleChange"],_excluded3=["handleChange"];function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}import{ELEMENT_TYPE_COUNTRY}from"../Builder.constants";import buildFormElements from"./buildFormElements";jest.mock('@shopgate/pwa-core/helpers',function(){return{logger:{error:function error(){}}};});var formElementConfig={sortOrder:1,label:'Label',type:'text',"default":'default',placeholder:'locales',required:true,visible:true};var formElement={id:'field',sortOrder:1,label:'Label',type:'text',"default":'default',placeholder:'locales',required:true,visible:true,custom:false};describe('Builder/helpers/buildFormElements',function(){it('should not build custom field',function(){var config={fields:{custom:formElementConfig}};expect(buildFormElements(config)).toEqual([]);});it('should not build empty config',function(){var config={fields:{}};expect(buildFormElements(config)).toEqual([]);});it('should build text element',function(){var config={fields:{field:formElementConfig}};var _buildFormElements$=buildFormElements(config)[0],ignore=_buildFormElements$.handleChange,restElement=_objectWithoutProperties(_buildFormElements$,_excluded);expect(restElement).toEqual(formElement);});it('should build 1 country element',function(){var config={fields:{country:_extends({},formElementConfig,{type:ELEMENT_TYPE_COUNTRY}),// eslint-disable-next-line camelcase
2
+ country_2:_extends({},formElementConfig,{type:ELEMENT_TYPE_COUNTRY})}};var expected=_extends({},formElement,{id:'country',type:ELEMENT_TYPE_COUNTRY});var _buildFormElements$2=buildFormElements(config)[0],ignore=_buildFormElements$2.handleChange,restElement=_objectWithoutProperties(_buildFormElements$2,_excluded2);expect(restElement).toEqual(expected);});it('should build custom text element',function(){var config={fields:{custom:{field:formElementConfig}}};var expected=_extends({},formElement,{custom:true});var _buildFormElements$3=buildFormElements(config)[0],ignore=_buildFormElements$3.handleChange,restElement=_objectWithoutProperties(_buildFormElements$3,_excluded3);expect(restElement).toEqual(expected);});it('should build correct change handler for text field',function(){var config={fields:{field:formElementConfig}};var mockHandler=jest.fn();var handleChange=buildFormElements(config,mockHandler)[0].handleChange;// Invoke handler with field value
3
3
  handleChange('bar');expect(mockHandler).toBeCalledWith('field','bar');});});
@@ -4,4 +4,4 @@ function _extends(){_extends=Object.assign||function(target){for(var i=1;i<argum
4
4
  * @param {string} countryCode Country code of the country to fetch provinces from
5
5
  * @param {?Object} optional object to prepend optional choice
6
6
  * @return {Object}
7
- */export default(function(countryCode){var optional=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;if(!iso3166){return{};}/** @property {iso3166} divisions */var provinceList=iso3166[countryCode]?iso3166[countryCode].divisions:{};if(!optional){return provinceList;}return _extends({},optional,{},provinceList);});
7
+ */export default(function(countryCode){var optional=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;if(!iso3166){return{};}/** @property {iso3166} divisions */var provinceList=iso3166[countryCode]?iso3166[countryCode].divisions:{};if(!optional){return provinceList;}return _extends({},optional,provinceList);});
@@ -1,13 +1,13 @@
1
- function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}return _assertThisInitialized(self);}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import React,{PureComponent}from'react';import PropTypes from'prop-types';import classNames from'classnames';/**
1
+ function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj;}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;},_typeof(obj);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import React,{PureComponent}from'react';import PropTypes from'prop-types';import classNames from'classnames';/**
2
2
  * Form component that handles keyboard submit, next buttons, ...
3
- */var Form=/*#__PURE__*/function(_PureComponent){_inherits(Form,_PureComponent);function Form(props){var _this;_classCallCheck(this,Form);_this=_possibleConstructorReturn(this,_getPrototypeOf(Form).call(this,props));_defineProperty(_assertThisInitialized(_this),"handleSubmit",function(event){event.preventDefault();var inputFocused=[].concat(_this.formElement.current.querySelectorAll('input')).some(function(input){return document.activeElement===input;});if(inputFocused){document.activeElement.blur();}_this.props.onSubmit();});_defineProperty(_assertThisInitialized(_this),"handleKeyPress",function(event){// Enter key and on iOS also the "Done" button.
4
- if(event.which===13){_this.handleSubmit(event);}});_this.formElement=React.createRef();return _this;}/**
3
+ */var Form=/*#__PURE__*/function(_PureComponent){_inherits(Form,_PureComponent);var _super=_createSuper(Form);/**
4
+ * Initializes the form component.
5
+ * @param {Object} props The components props.
6
+ */function Form(props){var _this;_classCallCheck(this,Form);_this=_super.call(this,props);_defineProperty(_assertThisInitialized(_this),"handleSubmit",function(event){event.preventDefault();var inputFocused=[].concat(_this.formElement.current.querySelectorAll('input')).some(function(input){return document.activeElement===input;});if(inputFocused){document.activeElement.blur();}_this.props.onSubmit();});_defineProperty(_assertThisInitialized(_this),"handleKeyPress",function(event){// Enter key and on iOS also the "Done" button.
7
+ if(event.which===13){_this.handleSubmit(event);}});_this.formElement=/*#__PURE__*/React.createRef();return _this;}/**
5
8
  * Handles the form submit.
6
9
  * @param {Object} event The event that caused the submit.
7
- */_createClass(Form,[{key:"render",/**
10
+ */_createClass(Form,[{key:"render",value:/**
8
11
  * Renders the component.
9
12
  * @returns {JSX}
10
- */value:function render(){/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */return React.createElement("form",{action:"#",className:classNames(this.props.className,'form','engage__form'),onSubmit:this.handleSubmit,onKeyPress:this.handleKeyPress,ref:this.formElement},this.props.children);/* eslint-enable jsx-a11y/no-noninteractive-element-interactions */}}]);return Form;}(PureComponent);_defineProperty(Form,"defaultProps",{className:null,onSubmit:function onSubmit(){}/**
11
- * Initializes the form component.
12
- * @param {Object} props The components props.
13
- */});export default Form;
13
+ */function render(){/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */return/*#__PURE__*/React.createElement("form",{action:"#",className:classNames(this.props.className,'form','engage__form'),onSubmit:this.handleSubmit,onKeyPress:this.handleKeyPress,ref:this.formElement},this.props.children);/* eslint-enable jsx-a11y/no-noninteractive-element-interactions */}}]);return Form;}(PureComponent);_defineProperty(Form,"defaultProps",{className:null,onSubmit:function onSubmit(){}});export default Form;
@@ -1,4 +1,4 @@
1
- function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}return _assertThisInitialized(self);}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import{Component}from'react';import PropTypes from'prop-types';import'intersection-observer';/**
1
+ function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj;}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;},_typeof(obj);}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++){arr2[i]=arr[i];}return arr2;}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import{Component}from'react';import PropTypes from'prop-types';import'intersection-observer';/**
2
2
  * The IntersectionVisibility component.
3
3
  * @example
4
4
  * <IntersectionVisibility>
@@ -6,12 +6,12 @@ function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="s
6
6
  <Video autoPlay={visible && ratio > 0.8} ref={setRef} />}
7
7
  )}
8
8
  * </IntersectionVisibility>
9
- */var IntersectionVisibility=/*#__PURE__*/function(_Component){_inherits(IntersectionVisibility,_Component);function IntersectionVisibility(){var _getPrototypeOf2;var _this;_classCallCheck(this,IntersectionVisibility);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_possibleConstructorReturn(this,(_getPrototypeOf2=_getPrototypeOf(IntersectionVisibility)).call.apply(_getPrototypeOf2,[this].concat(args)));_defineProperty(_assertThisInitialized(_this),"state",{visible:true,ratio:1,entries:null});_defineProperty(_assertThisInitialized(_this),"setRef",function(ref){if(!ref){return;}_this.node=ref;if(_this.io){_this.io.observe(_this.node);}});_defineProperty(_assertThisInitialized(_this),"handleIntersectionEvent",function(entries){var _entries=_slicedToArray(entries,1),intersectionRatio=_entries[0].intersectionRatio;_this.setState({visible:intersectionRatio>0,ratio:intersectionRatio,entries:entries});});return _this;}_createClass(IntersectionVisibility,[{key:"componentDidMount",/**
9
+ */var IntersectionVisibility=/*#__PURE__*/function(_Component){_inherits(IntersectionVisibility,_Component);var _super=_createSuper(IntersectionVisibility);function IntersectionVisibility(){var _this;_classCallCheck(this,IntersectionVisibility);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_defineProperty(_assertThisInitialized(_this),"state",{visible:true,ratio:1,entries:null});_defineProperty(_assertThisInitialized(_this),"setRef",function(ref){if(!ref){return;}_this.node=ref;if(_this.io){_this.io.observe(_this.node);}});_defineProperty(_assertThisInitialized(_this),"handleIntersectionEvent",function(entries){var _entries=_slicedToArray(entries,1),intersectionRatio=_entries[0].intersectionRatio;_this.setState({visible:intersectionRatio>0,ratio:intersectionRatio,entries:entries});});return _this;}_createClass(IntersectionVisibility,[{key:"componentDidMount",value:/**
10
10
  * Start the observer when the component is mounted
11
- */value:function componentDidMount(){this.io=new IntersectionObserver(this.handleIntersectionEvent,{threshold:this.props.thresholds});if(this.node){this.io.observe(this.node);}}/**
11
+ */function componentDidMount(){this.io=new IntersectionObserver(this.handleIntersectionEvent,{threshold:this.props.thresholds});if(this.node){this.io.observe(this.node);}}/**
12
12
  * @inheritDoc
13
13
  */},{key:"componentWillUnmount",value:function componentWillUnmount(){if(this.io){this.io.disconnect();}}/**
14
14
  * @param {Object} ref ref
15
- */},{key:"render",/**
15
+ */},{key:"render",value:/**
16
16
  * @returns {JSX.Element}
17
- */value:function render(){return this.props.children(_extends({},this.state,{setRef:this.setRef}));}}]);return IntersectionVisibility;}(Component);_defineProperty(IntersectionVisibility,"buildThresholdList",function(steps){return Array(steps).fill(0).map(function(v,i){return(i+1)/steps;});});_defineProperty(IntersectionVisibility,"defaultProps",{thresholds:IntersectionVisibility.buildThresholdList(10)});export default IntersectionVisibility;
17
+ */function render(){return this.props.children(_extends({},this.state,{setRef:this.setRef}));}}]);return IntersectionVisibility;}(Component);_defineProperty(IntersectionVisibility,"buildThresholdList",function(steps){return Array(steps).fill(0).map(function(v,i){return(i+1)/steps;});});_defineProperty(IntersectionVisibility,"defaultProps",{thresholds:IntersectionVisibility.buildThresholdList(10)});export default IntersectionVisibility;
@@ -1,4 +1,4 @@
1
1
  import React from'react';import appConfig from'@shopgate/pwa-common/helpers/config';import styles from"./style";/**
2
2
  * The Logo component.
3
3
  * @return {JSX}
4
- */var Logo=function Logo(){return React.createElement("div",{className:"".concat(styles.container," engage__logo")},React.createElement("img",{className:styles.image,src:appConfig.logo,alt:appConfig.shopName}));};export default Logo;
4
+ */var Logo=function Logo(){return/*#__PURE__*/React.createElement("div",{className:"".concat(styles.container," engage__logo")},/*#__PURE__*/React.createElement("img",{className:styles.image,src:appConfig.logo,alt:appConfig.shopName}));};export default Logo;
@@ -1 +1 @@
1
- import React from'react';import{shallow}from'enzyme';import Logo from"./index";describe('<Logo />',function(){it('should render an image',function(){var wrapper=shallow(React.createElement(Logo,null));expect(wrapper).toMatchSnapshot();expect(wrapper.find('img').exists()).toBe(true);});});
1
+ import React from'react';import{shallow}from'enzyme';import Logo from"./index";describe('<Logo />',function(){it('should render an image',function(){var wrapper=shallow(/*#__PURE__*/React.createElement(Logo,null));expect(wrapper).toMatchSnapshot();expect(wrapper.find('img').exists()).toBe(true);});});
@@ -4,4 +4,4 @@ import React,{memo}from'react';import classnames from'classnames';import PropTyp
4
4
  * @param {Array} props.messages The message content.
5
5
  * @param {Object} props.classNames Styling.
6
6
  * @return {JSX}
7
- */var MessageBar=memo(function(_ref){var messages=_ref.messages,classNames=_ref.classNames;return React.createElement("div",{className:classnames(styles.container,classNames.container,'engage__message-bar'),role:messages.length>0?'alert':null},messages.map(function(item){var _item$type=item.type,type=_item$type===void 0?'info':_item$type,message=item.message,_item$messageParams=item.messageParams,messageParams=_item$messageParams===void 0?null:_item$messageParams,translated=item.translated;var messageOutput=!translated?i18n.text(message,messageParams):message;return React.createElement("div",{key:"".concat(type,"-").concat(message),className:classnames(classNames.message,styles[type])},React.createElement("span",{className:styles.srOnly},"".concat(i18n.text("cart.message_type_".concat(type)),": ").concat(messageOutput)),React.createElement("span",{"aria-hidden":true},messageOutput));}));});MessageBar.defaultProps={classNames:{container:null,message:null}};export default MessageBar;
7
+ */var MessageBar=/*#__PURE__*/memo(function(_ref){var messages=_ref.messages,classNames=_ref.classNames;return/*#__PURE__*/React.createElement("div",{className:classnames(styles.container,classNames.container,'engage__message-bar'),role:messages.length>0?'alert':null},messages.map(function(item){var _item$type=item.type,type=_item$type===void 0?'info':_item$type,message=item.message,_item$messageParams=item.messageParams,messageParams=_item$messageParams===void 0?null:_item$messageParams,translated=item.translated;var messageOutput=!translated?i18n.text(message,messageParams):message;return/*#__PURE__*/React.createElement("div",{key:"".concat(type,"-").concat(message),className:classnames(classNames.message,styles[type])},/*#__PURE__*/React.createElement("span",{className:styles.srOnly},"".concat(i18n.text("cart.message_type_".concat(type)),": ").concat(messageOutput)),/*#__PURE__*/React.createElement("span",{"aria-hidden":true},messageOutput));}));});MessageBar.defaultProps={classNames:{container:null,message:null}};export default MessageBar;
@@ -1 +1 @@
1
- import React from'react';import{mount}from'enzyme';import MessageBar from"./index";var MESSAGE1='This is some information';var MESSAGE2='This is an error that happened here.';var MESSAGE3='This is just a warning. Nothing to freak out about.';var MESSAGE4='Normal pre-translated message.';var MESSAGE5='Normal pre-translated message.';var MESSAGE6='some.translation.string';var MESSAGE7='Message with messageParams';describe('<MessageBar />',function(){describe('General rendering',function(){it('should be empty if no messages have been set',function(){var wrapper=mount(React.createElement(MessageBar,{messages:[]}));expect(wrapper).toMatchSnapshot();});it('should render a message as info if type is missing',function(){var wrapper=mount(React.createElement(MessageBar,{messages:[{message:'something'}]}));expect(wrapper).toMatchSnapshot();});});describe('Multiple messages rendering',function(){it('should render messages without frontend translation',function(){var wrapper=mount(React.createElement(MessageBar,{messages:[{type:'info',message:MESSAGE1},{type:'error',message:MESSAGE2},{type:'warning',message:MESSAGE3},{message:MESSAGE4,translated:null},{message:MESSAGE5,translated:true}]}));expect(wrapper).toMatchSnapshot();});it('should translate and render all given messages',function(){var wrapper=mount(React.createElement(MessageBar,{messages:[{message:MESSAGE6,translated:false},{message:MESSAGE7,messageParams:{myCustomParam1:'-> TEST-VALUE #1 <-',myCustomParam2:'-> TEST-VALUE #2 <-'},translated:false}]}));expect(wrapper).toMatchSnapshot();});});it('should render with custom classNames',function(){var wrapper=mount(React.createElement(MessageBar,{messages:[{message:MESSAGE1}],classNames:{container:'cls-container',message:'cls-message'}}));expect(wrapper).toMatchSnapshot();});});
1
+ import React from'react';import{mount}from'enzyme';import MessageBar from"./index";var MESSAGE1='This is some information';var MESSAGE2='This is an error that happened here.';var MESSAGE3='This is just a warning. Nothing to freak out about.';var MESSAGE4='Normal pre-translated message.';var MESSAGE5='Normal pre-translated message.';var MESSAGE6='some.translation.string';var MESSAGE7='Message with messageParams';describe('<MessageBar />',function(){describe('General rendering',function(){it('should be empty if no messages have been set',function(){var wrapper=mount(/*#__PURE__*/React.createElement(MessageBar,{messages:[]}));expect(wrapper).toMatchSnapshot();});it('should render a message as info if type is missing',function(){var wrapper=mount(/*#__PURE__*/React.createElement(MessageBar,{messages:[{message:'something'}]}));expect(wrapper).toMatchSnapshot();});});describe('Multiple messages rendering',function(){it('should render messages without frontend translation',function(){var wrapper=mount(/*#__PURE__*/React.createElement(MessageBar,{messages:[{type:'info',message:MESSAGE1},{type:'error',message:MESSAGE2},{type:'warning',message:MESSAGE3},{message:MESSAGE4,translated:null},{message:MESSAGE5,translated:true}]}));expect(wrapper).toMatchSnapshot();});it('should translate and render all given messages',function(){var wrapper=mount(/*#__PURE__*/React.createElement(MessageBar,{messages:[{message:MESSAGE6,translated:false},{message:MESSAGE7,messageParams:{myCustomParam1:'-> TEST-VALUE #1 <-',myCustomParam2:'-> TEST-VALUE #2 <-'},translated:false}]}));expect(wrapper).toMatchSnapshot();});});it('should render with custom classNames',function(){var wrapper=mount(/*#__PURE__*/React.createElement(MessageBar,{messages:[{message:MESSAGE1}],classNames:{container:'cls-container',message:'cls-message'}}));expect(wrapper).toMatchSnapshot();});});
@@ -1,9 +1,9 @@
1
- function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import React from'react';import PropTypes from'prop-types';import{UIEvents}from'@shopgate/pwa-core';import{NAVIGATION_PUSH,NAVIGATION_POP,NAVIGATION_REPLACE,NAVIGATION_RESET}from"../../core/router/helpers";import connect from"./connector";/**
1
+ function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj;}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;},_typeof(obj);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import React from'react';import PropTypes from'prop-types';import{UIEvents}from'@shopgate/pwa-core';import{NAVIGATION_PUSH,NAVIGATION_POP,NAVIGATION_REPLACE,NAVIGATION_RESET}from"../../core/router/helpers";import connect from"./connector";/**
2
2
  * Handles
3
- */var NavigationHandler=/*#__PURE__*/function(_React$PureComponent){_inherits(NavigationHandler,_React$PureComponent);function NavigationHandler(props){var _this;_classCallCheck(this,NavigationHandler);_this=_possibleConstructorReturn(this,_getPrototypeOf(NavigationHandler).call(this,props));UIEvents.addListener(NAVIGATION_PUSH,props.push);UIEvents.addListener(NAVIGATION_POP,props.pop);UIEvents.addListener(NAVIGATION_REPLACE,props.replace);UIEvents.addListener(NAVIGATION_RESET,props.reset);return _this;}/**
3
+ */var NavigationHandler=/*#__PURE__*/function(_React$PureComponent){_inherits(NavigationHandler,_React$PureComponent);var _super=_createSuper(NavigationHandler);/**
4
+ * @param {Object} props The component props.
5
+ */function NavigationHandler(props){var _this;_classCallCheck(this,NavigationHandler);_this=_super.call(this,props);UIEvents.addListener(NAVIGATION_PUSH,props.push);UIEvents.addListener(NAVIGATION_POP,props.pop);UIEvents.addListener(NAVIGATION_REPLACE,props.replace);UIEvents.addListener(NAVIGATION_RESET,props.reset);return _this;}/**
4
6
  * Removes the event listeners.
5
7
  */_createClass(NavigationHandler,[{key:"componentWillUnmount",value:function componentWillUnmount(){UIEvents.removeListener(NAVIGATION_PUSH,this.props.push);UIEvents.removeListener(NAVIGATION_POP,this.props.pop);UIEvents.removeListener(NAVIGATION_REPLACE,this.props.replace);UIEvents.removeListener(NAVIGATION_RESET,this.props.reset);}/**
6
8
  * @returns {null}
7
- */},{key:"render",value:function render(){return this.props.children;}}]);return NavigationHandler;}(React.PureComponent);_defineProperty(NavigationHandler,"defaultProps",{pop:function pop(){},push:function push(){},replace:function replace(){},reset:function reset(){}/**
8
- * @param {Object} props The component props.
9
- */});export default connect(NavigationHandler);
9
+ */},{key:"render",value:function render(){return this.props.children;}}]);return NavigationHandler;}(React.PureComponent);_defineProperty(NavigationHandler,"defaultProps",{pop:function pop(){},push:function push(){},replace:function replace(){},reset:function reset(){}});export default connect(NavigationHandler);
@@ -1 +1 @@
1
- import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import React from'react';import{Provider}from'react-redux';import{mount}from'enzyme';import{UIEvents}from'@shopgate/pwa-core';import{createMockStore}from'@shopgate/pwa-common/store';import NavigationHandler from"./index";import{NAVIGATION_PUSH,NAVIGATION_POP,NAVIGATION_REPLACE,NAVIGATION_RESET,push,pop,replace,reset}from"../../core/router/helpers";jest.mock('@shopgate/pwa-core',function(){var map={};return{UIEvents:{addListener:jest.fn(function(event,cb){map[event]=cb;}),removeListener:jest.fn(),emit:jest.fn(function(event,params){map[event](params);})}};});describe('<NavigationHandler />',function(){var store=createMockStore();var wrapper=mount(React.createElement(Provider,{store:store},React.createElement(NavigationHandler,null,React.createElement("div",null,"Some content"))));it('should render as expected',function(){expect(wrapper).toMatchSnapshot();});it('should trigger the push() callbacks on navigation.push event',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(){return _regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:_context.next=2;return push({pathname:'/test'});case 2:expect(UIEvents.emit).toBeCalledWith(NAVIGATION_PUSH,{pathname:'/test'});UIEvents.emit.mockClear();case 4:case"end":return _context.stop();}}},_callee);})));it('should trigger the pop() callbacks on navigation.pop event',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(){return _regeneratorRuntime.wrap(function _callee2$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:_context2.next=2;return pop();case 2:expect(UIEvents.emit).toBeCalledWith(NAVIGATION_POP);UIEvents.emit.mockClear();case 4:case"end":return _context2.stop();}}},_callee2);})));it('should trigger the replace() callbacks on navigation.replace event',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(){return _regeneratorRuntime.wrap(function _callee3$(_context3){while(1){switch(_context3.prev=_context3.next){case 0:_context3.next=2;return replace({pathname:'/test'});case 2:expect(UIEvents.emit).toBeCalledWith(NAVIGATION_REPLACE,{pathname:'/test'});UIEvents.emit.mockClear();case 4:case"end":return _context3.stop();}}},_callee3);})));it('should trigger the reset() callbacks on navigation.reset event',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(){return _regeneratorRuntime.wrap(function _callee4$(_context4){while(1){switch(_context4.prev=_context4.next){case 0:_context4.next=2;return reset();case 2:expect(UIEvents.emit).toBeCalledWith(NAVIGATION_RESET);UIEvents.emit.mockClear();case 4:case"end":return _context4.stop();}}},_callee4);})));it('should register the navigation event listener',function(){var props=wrapper.find('NavigationHandler').props();expect(UIEvents.addListener.mock.calls.length).toBe(4);expect(UIEvents.addListener.mock.calls[0][0]).toEqual(NAVIGATION_PUSH,props.push);expect(UIEvents.addListener.mock.calls[1][0]).toEqual(NAVIGATION_POP,props.pop);expect(UIEvents.addListener.mock.calls[2][0]).toEqual(NAVIGATION_REPLACE,props.replace);expect(UIEvents.addListener.mock.calls[3][0]).toEqual(NAVIGATION_RESET,props.reset);UIEvents.addListener.mockClear();});it('should unregister the navigation event listener when the component unmounts',function(){var props=wrapper.find('NavigationHandler').props();wrapper.unmount();expect(UIEvents.removeListener.mock.calls.length).toBe(4);expect(UIEvents.removeListener.mock.calls[0][0]).toEqual(NAVIGATION_PUSH,props.push);expect(UIEvents.removeListener.mock.calls[1][0]).toEqual(NAVIGATION_POP,props.pop);expect(UIEvents.removeListener.mock.calls[2][0]).toEqual(NAVIGATION_REPLACE,props.replace);expect(UIEvents.removeListener.mock.calls[3][0]).toEqual(NAVIGATION_RESET,props.reset);UIEvents.removeListener.mockClear();});});
1
+ import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import React from'react';import{Provider}from'react-redux';import{mount}from'enzyme';import{UIEvents}from'@shopgate/pwa-core';import{createMockStore}from'@shopgate/pwa-common/store';import NavigationHandler from"./index";import{NAVIGATION_PUSH,NAVIGATION_POP,NAVIGATION_REPLACE,NAVIGATION_RESET,push,pop,replace,reset}from"../../core/router/helpers";jest.mock('@shopgate/pwa-core',function(){var map={};return{UIEvents:{addListener:jest.fn(function(event,cb){map[event]=cb;}),removeListener:jest.fn(),emit:jest.fn(function(event,params){map[event](params);})}};});describe('<NavigationHandler />',function(){var store=createMockStore();var wrapper=mount(/*#__PURE__*/React.createElement(Provider,{store:store},/*#__PURE__*/React.createElement(NavigationHandler,null,/*#__PURE__*/React.createElement("div",null,"Some content"))));it('should render as expected',function(){expect(wrapper).toMatchSnapshot();});it('should trigger the push() callbacks on navigation.push event',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(){return _regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:_context.next=2;return push({pathname:'/test'});case 2:expect(UIEvents.emit).toBeCalledWith(NAVIGATION_PUSH,{pathname:'/test'});UIEvents.emit.mockClear();case 4:case"end":return _context.stop();}}},_callee);})));it('should trigger the pop() callbacks on navigation.pop event',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(){return _regeneratorRuntime.wrap(function _callee2$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:_context2.next=2;return pop();case 2:expect(UIEvents.emit).toBeCalledWith(NAVIGATION_POP);UIEvents.emit.mockClear();case 4:case"end":return _context2.stop();}}},_callee2);})));it('should trigger the replace() callbacks on navigation.replace event',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(){return _regeneratorRuntime.wrap(function _callee3$(_context3){while(1){switch(_context3.prev=_context3.next){case 0:_context3.next=2;return replace({pathname:'/test'});case 2:expect(UIEvents.emit).toBeCalledWith(NAVIGATION_REPLACE,{pathname:'/test'});UIEvents.emit.mockClear();case 4:case"end":return _context3.stop();}}},_callee3);})));it('should trigger the reset() callbacks on navigation.reset event',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(){return _regeneratorRuntime.wrap(function _callee4$(_context4){while(1){switch(_context4.prev=_context4.next){case 0:_context4.next=2;return reset();case 2:expect(UIEvents.emit).toBeCalledWith(NAVIGATION_RESET);UIEvents.emit.mockClear();case 4:case"end":return _context4.stop();}}},_callee4);})));it('should register the navigation event listener',function(){var props=wrapper.find('NavigationHandler').props();expect(UIEvents.addListener.mock.calls.length).toBe(4);expect(UIEvents.addListener.mock.calls[0][0]).toEqual(NAVIGATION_PUSH,props.push);expect(UIEvents.addListener.mock.calls[1][0]).toEqual(NAVIGATION_POP,props.pop);expect(UIEvents.addListener.mock.calls[2][0]).toEqual(NAVIGATION_REPLACE,props.replace);expect(UIEvents.addListener.mock.calls[3][0]).toEqual(NAVIGATION_RESET,props.reset);UIEvents.addListener.mockClear();});it('should unregister the navigation event listener when the component unmounts',function(){var props=wrapper.find('NavigationHandler').props();wrapper.unmount();expect(UIEvents.removeListener.mock.calls.length).toBe(4);expect(UIEvents.removeListener.mock.calls[0][0]).toEqual(NAVIGATION_PUSH,props.push);expect(UIEvents.removeListener.mock.calls[1][0]).toEqual(NAVIGATION_POP,props.pop);expect(UIEvents.removeListener.mock.calls[2][0]).toEqual(NAVIGATION_REPLACE,props.replace);expect(UIEvents.removeListener.mock.calls[3][0]).toEqual(NAVIGATION_RESET,props.reset);UIEvents.removeListener.mockClear();});});
@@ -2,4 +2,4 @@ import React from'react';import PropTypes from'prop-types';import styles from"./
2
2
  * The default button for the Picker component.
3
3
  * @param {Object} props The component props.
4
4
  * @returns {JSX} The button component.
5
- */var Button=function Button(_ref){var value=_ref.value,label=_ref.label,openList=_ref.openList;return React.createElement("button",{className:"".concat(styles.button," engage__picker__button"),onClick:openList,type:"button"},React.createElement("span",{className:styles.label},label),value!==null&&React.createElement("span",{className:styles.value},value));};Button.defaultProps={value:null};export default Button;
5
+ */var Button=function Button(_ref){var value=_ref.value,label=_ref.label,openList=_ref.openList;return/*#__PURE__*/React.createElement("button",{className:"".concat(styles.button," engage__picker__button"),onClick:openList,type:"button"},/*#__PURE__*/React.createElement("span",{className:styles.label},label),value!==null&&/*#__PURE__*/React.createElement("span",{className:styles.value},value));};Button.defaultProps={value:null};export default Button;
@@ -2,4 +2,4 @@ function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj
2
2
  * The default button for the Picker component.
3
3
  * @param {Object} props The component props.
4
4
  * @returns {JSX} The button component.
5
- */var List=function List(props){var items=props.items,onClose=props.onClose,onSelect=props.onSelect,selectedIndex=props.selectedIndex,query=props.query;var filteredItems=items;if(query&&query.length){filteredItems=items.filter(function(_ref){var _ref$label=_ref.label,label=_ref$label===void 0?'':_ref$label;var searchLabel=label.replaceAll(' ','').toLowerCase();var searchValue=query.replaceAll(' ','').toLowerCase();return searchLabel.includes(searchValue);});}return React.createElement("ul",{className:"engage__picker_list"},filteredItems.map(function(item,currentIndex){return React.createElement("li",{key:item.value,className:classNames(_defineProperty({},styles.active,currentIndex===selectedIndex))},React.createElement("button",{className:styles.button,disabled:item.disabled,onClick:function onClick(){onSelect(item.value);onClose();},type:"button"},item.label));}));};List.defaultProps={onClose:function onClose(){},selectedIndex:null,query:''};export default List;
5
+ */var List=function List(props){var items=props.items,onClose=props.onClose,onSelect=props.onSelect,selectedIndex=props.selectedIndex,query=props.query;var filteredItems=items;if(query&&query.length){filteredItems=items.filter(function(_ref){var _ref$label=_ref.label,label=_ref$label===void 0?'':_ref$label;var searchLabel=label.replaceAll(' ','').toLowerCase();var searchValue=query.replaceAll(' ','').toLowerCase();return searchLabel.includes(searchValue);});}return/*#__PURE__*/React.createElement("ul",{className:"engage__picker_list"},filteredItems.map(function(item,currentIndex){return/*#__PURE__*/React.createElement("li",{key:item.value,className:classNames(_defineProperty({},styles.active,currentIndex===selectedIndex))},/*#__PURE__*/React.createElement("button",{className:styles.button,disabled:item.disabled,onClick:function onClick(){onSelect(item.value);onClose();},type:"button"},item.label));}));};List.defaultProps={onClose:function onClose(){},selectedIndex:null,query:''};export default List;
@@ -1,14 +1,14 @@
1
- function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}return _assertThisInitialized(self);}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import React,{Component}from'react';import PropTypes from'prop-types';import classNames from'classnames';import styles from"./style";/**
1
+ function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj;}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;},_typeof(obj);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import React,{Component}from'react';import PropTypes from'prop-types';import classNames from'classnames';import styles from"./style";/**
2
2
  * The picker modal.
3
- */var Modal=/*#__PURE__*/function(_Component){_inherits(Modal,_Component);/**
3
+ */var Modal=/*#__PURE__*/function(_Component){_inherits(Modal,_Component);var _super=_createSuper(Modal);/**
4
4
  * The constructor.
5
5
  * @param {Object} props The props.
6
- */function Modal(props){var _this;_classCallCheck(this,Modal);_this=_possibleConstructorReturn(this,_getPrototypeOf(Modal).call(this,props));_defineProperty(_assertThisInitialized(_this),"closeModal",function(){_this.setState({active:false});clearTimeout(_this.timeout);_this.timeout=setTimeout(_this.props.onClose,styles.duration);});_this.timeout=null;_this.state={active:true};return _this;}/**
6
+ */function Modal(props){var _this;_classCallCheck(this,Modal);_this=_super.call(this,props);_defineProperty(_assertThisInitialized(_this),"closeModal",function(){_this.setState({active:false});clearTimeout(_this.timeout);_this.timeout=setTimeout(_this.props.onClose,styles.duration);});_this.timeout=null;_this.state={active:true};return _this;}/**
7
7
  * Update state when isOpen changes.
8
8
  * @param {Object} nextProps The next component props.
9
9
  */_createClass(Modal,[{key:"UNSAFE_componentWillReceiveProps",value:function UNSAFE_componentWillReceiveProps(nextProps){if(this.props.isOpen!==nextProps.isOpen){this.setState({active:nextProps.isOpen});}}/**
10
10
  * Closes the modal after the closing animations have finished.
11
- */},{key:"render",/**
11
+ */},{key:"render",value:/**
12
12
  * Render all the things!
13
13
  * @returns {JSX} The picker modal with the picker list inside.
14
- */value:function render(){var backgroundClassName=classNames(styles.background.base,_defineProperty({},styles.background.inactive,!this.state.active));var containerClassName=classNames(styles.container.base,_defineProperty({},styles.container.inactive,!this.state.active));if(!this.props.isOpen){return null;}return React.createElement("div",{className:"".concat(styles.wrapper," engage__picker_modal")},React.createElement("div",{"aria-hidden":true,className:backgroundClassName,onClick:this.closeModal}),React.createElement("div",{className:containerClassName},React.cloneElement(this.props.children,{onClose:this.closeModal})));}}]);return Modal;}(Component);export default Modal;
14
+ */function render(){var backgroundClassName=classNames(styles.background.base,_defineProperty({},styles.background.inactive,!this.state.active));var containerClassName=classNames(styles.container.base,_defineProperty({},styles.container.inactive,!this.state.active));if(!this.props.isOpen){return null;}return/*#__PURE__*/React.createElement("div",{className:"".concat(styles.wrapper," engage__picker_modal")},/*#__PURE__*/React.createElement("div",{"aria-hidden":true,className:backgroundClassName,onClick:this.closeModal}),/*#__PURE__*/React.createElement("div",{className:containerClassName},/*#__PURE__*/React.cloneElement(this.props.children,{onClose:this.closeModal})));}}]);return Modal;}(Component);export default Modal;
@@ -1,28 +1,28 @@
1
- function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}return _assertThisInitialized(self);}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}import React,{Component}from'react';import PropTypes from'prop-types';import Portal from'react-portal';import{withForwardedRef}from"../../core";import PickerModal from"./components/Modal";import PickerButton from"./components/Button";import PickerList from"./components/List";/**
1
+ function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj;}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;},_typeof(obj);}import React,{Component}from'react';import PropTypes from'prop-types';import Portal from'react-portal';import{withForwardedRef}from"../../core";import PickerModal from"./components/Modal";import PickerButton from"./components/Button";import PickerList from"./components/List";/**
2
2
  * Converts an item of any type (e.g. string or number)
3
3
  * to an object representation containing value and label properties.
4
4
  * @param {*} item - An item of any type.
5
5
  * @returns {Object} An object representation of the item.
6
- */var normalizeItem=function normalizeItem(item){if(item!==null&&typeof item!=='undefined'){var itemDefaults={value:item.value||item,label:item.label||item.value||item,disabled:item.disabled||false};if(_typeof(item)==='object'){return _extends({},itemDefaults,{},item);}return itemDefaults;}return null;};/**
6
+ */var normalizeItem=function normalizeItem(item){if(item!==null&&typeof item!=='undefined'){var itemDefaults={value:item.value||item,label:item.label||item.value||item,disabled:item.disabled||false};if(_typeof(item)==='object'){return _extends({},itemDefaults,item);}return itemDefaults;}return null;};/**
7
7
  * Finds an item index in a list of items by value.
8
8
  * @param {Array} items - The list of items.
9
9
  * @param {*} value - The value to look for.
10
10
  * @returns {number} The found item index or undefined.
11
11
  */var findItemIndexByValue=function findItemIndexByValue(items,value){return items.map(normalizeItem).findIndex(function(item){return item.value===value;});};/**
12
12
  * The picker component (acts like a selectbox).
13
- */var Picker=/*#__PURE__*/function(_Component){_inherits(Picker,_Component);/**
13
+ */var Picker=/*#__PURE__*/function(_Component){_inherits(Picker,_Component);var _super=_createSuper(Picker);/**
14
14
  * The constructor.
15
15
  * @param {Object} props - The component props.
16
- */function Picker(props){var _this;_classCallCheck(this,Picker);_this=_possibleConstructorReturn(this,_getPrototypeOf(Picker).call(this,props));_defineProperty(_assertThisInitialized(_this),"triggerChangeCallback",function(nextValue){var nextSelectedIndex=findItemIndexByValue(_this.props.items,nextValue);if(nextSelectedIndex>-1&&_this.state.selectedIndex!==nextSelectedIndex){_this.props.onChange(nextValue);}_this.props.onSelect(nextValue);});_defineProperty(_assertThisInitialized(_this),"triggerCloseCallback",function(nextOpenState){if(_this.state.isOpen&&!nextOpenState){_this.props.onClose();}});_defineProperty(_assertThisInitialized(_this),"handleItemSelect",function(value){_this.triggerChangeCallback(value);_this.setState({selectedIndex:findItemIndexByValue(_this.props.items,value)});});_defineProperty(_assertThisInitialized(_this),"toggleOpenState",function(open){_this.setState(function(_ref){var isOpen=_ref.isOpen;var nextIsOpen=typeof open==='boolean'?open:!isOpen;_this.triggerCloseCallback(nextIsOpen);return{isOpen:nextIsOpen};});});_this.state={selectedIndex:findItemIndexByValue(props.items,props.value),isOpen:props.isOpen};return _this;}/**
16
+ */function Picker(props){var _this;_classCallCheck(this,Picker);_this=_super.call(this,props);_defineProperty(_assertThisInitialized(_this),"triggerChangeCallback",function(nextValue){var nextSelectedIndex=findItemIndexByValue(_this.props.items,nextValue);if(nextSelectedIndex>-1&&_this.state.selectedIndex!==nextSelectedIndex){_this.props.onChange(nextValue);}_this.props.onSelect(nextValue);});_defineProperty(_assertThisInitialized(_this),"triggerCloseCallback",function(nextOpenState){if(_this.state.isOpen&&!nextOpenState){_this.props.onClose();}});_defineProperty(_assertThisInitialized(_this),"handleItemSelect",function(value){_this.triggerChangeCallback(value);_this.setState({selectedIndex:findItemIndexByValue(_this.props.items,value)});});_defineProperty(_assertThisInitialized(_this),"toggleOpenState",function(open){_this.setState(function(_ref){var isOpen=_ref.isOpen;var nextIsOpen=typeof open==='boolean'?open:!isOpen;_this.triggerCloseCallback(nextIsOpen);return{isOpen:nextIsOpen};});});_this.state={selectedIndex:findItemIndexByValue(props.items,props.value),isOpen:props.isOpen};return _this;}/**
17
17
  * Updates the selected item when the value prop changes.
18
18
  * @param {Object} nextProps - The next props.
19
19
  */_createClass(Picker,[{key:"UNSAFE_componentWillReceiveProps",value:function UNSAFE_componentWillReceiveProps(nextProps){// Only update if a value is present and also changed.
20
20
  if(!this.selectedItem||nextProps.value!==this.selectedItem.value){this.setState({selectedIndex:findItemIndexByValue(nextProps.items,nextProps.value)});}if(this.props.isOpen!==nextProps.isOpen&&nextProps.isOpen!==this.state.isOpen){this.setState({isOpen:nextProps.isOpen});}}/**
21
21
  * Getter for the selected item.
22
- */},{key:"render",/**
23
- * Renders the component.
24
- * @returns {JSX}
25
- */value:function render(){var _this2=this;var hasSelection=!!this.selectedItem;var buttonValue=hasSelection?this.selectedItem.label:'';var buttonLabel=hasSelection?this.props.label:this.props.placeholder;var buttonProps=_extends({},this.props.buttonProps,{label:buttonLabel,value:buttonValue,disabled:this.props.disabled,openList:this.props.disabled?function(){}:function(){_this2.toggleOpenState(true);}});var modalProps={isOpen:this.state.isOpen,duration:this.props.duration,onClose:function onClose(){return _this2.toggleOpenState(false);}};var listProps={items:this.props.items.map(normalizeItem),selectedIndex:this.state.selectedIndex,onSelect:this.handleItemSelect};return React.createElement("div",{role:"button",className:"".concat(this.props.className," engage__picker"),ref:this.props.forwardedRef,tabIndex:0,"aria-haspopup":true},React.createElement(this.props.buttonComponent,buttonProps),React.createElement(Portal,{onClose:function onClose(){return _this2.toggleOpenState(false);},isOpened:true},React.createElement(this.props.modalComponent,modalProps,React.createElement(this.props.listComponent,listProps))));}},{key:"selectedItem",get:function get(){return normalizeItem(this.props.items[this.state.selectedIndex]);}/**
22
+ */},{key:"selectedItem",get:function get(){return normalizeItem(this.props.items[this.state.selectedIndex]);}/**
26
23
  * Triggers the onChange callback if the selected value has changed.
27
24
  * @param {Object} nextValue - The value the user picked.
28
- */}]);return Picker;}(Component);_defineProperty(Picker,"defaultProps",{buttonComponent:PickerButton,buttonProps:{},duration:300,disabled:false,forwardedRef:null,label:'',listComponent:PickerList,modalComponent:PickerModal,className:'',isOpen:false,items:[],onChange:function onChange(){},onClose:function onClose(){},onSelect:function onSelect(){},placeholder:'Pick ...',value:null});export default withForwardedRef(Picker);
25
+ */},{key:"render",value:/**
26
+ * Renders the component.
27
+ * @returns {JSX}
28
+ */function render(){var _this2=this;var hasSelection=!!this.selectedItem;var buttonValue=hasSelection?this.selectedItem.label:'';var buttonLabel=hasSelection?this.props.label:this.props.placeholder;var buttonProps=_extends({},this.props.buttonProps,{label:buttonLabel,value:buttonValue,disabled:this.props.disabled,openList:this.props.disabled?function(){}:function(){_this2.toggleOpenState(true);}});var modalProps={isOpen:this.state.isOpen,duration:this.props.duration,onClose:function onClose(){return _this2.toggleOpenState(false);}};var listProps={items:this.props.items.map(normalizeItem),selectedIndex:this.state.selectedIndex,onSelect:this.handleItemSelect};return/*#__PURE__*/React.createElement("div",{role:"button",className:"".concat(this.props.className," engage__picker"),ref:this.props.forwardedRef,tabIndex:0,"aria-haspopup":true},/*#__PURE__*/React.createElement(this.props.buttonComponent,buttonProps),/*#__PURE__*/React.createElement(Portal,{onClose:function onClose(){return _this2.toggleOpenState(false);},isOpened:true},/*#__PURE__*/React.createElement(this.props.modalComponent,modalProps,/*#__PURE__*/React.createElement(this.props.listComponent,listProps))));}}]);return Picker;}(Component);_defineProperty(Picker,"defaultProps",{buttonComponent:PickerButton,buttonProps:{},duration:300,disabled:false,forwardedRef:null,label:'',listComponent:PickerList,modalComponent:PickerModal,className:'',isOpen:false,items:[],onChange:function onChange(){},onClose:function onClose(){},onSelect:function onSelect(){},placeholder:'Pick ...',value:null});export default withForwardedRef(Picker);
@@ -1,4 +1,4 @@
1
1
  import React from'react';import{mount}from'enzyme';import Picker from"./index";import PickerList from"./components/List";jest.mock('react-portal',function(){return function(_ref){var isOpened=_ref.isOpened,children=_ref.children;return isOpened?children:null;};});describe('<Picker />',function(){var renderedElement;var renderedInstance;var mockItems=['String only',{value:'Value only'},{value:'value',label:'Value and label'}];var mockOnChange=jest.fn();var mockOnSelect=jest.fn();/**
2
2
  * The view component
3
3
  * @param {Object} props The component props.
4
- */var renderComponent=function renderComponent(props){renderedElement=mount(React.createElement(Picker,props));renderedInstance=renderedElement.find('Picker').instance();};beforeEach(function(){renderComponent({items:mockItems,onChange:mockOnChange,onSelect:mockOnSelect});renderedElement.update();});describe('Given the component was mounted to the DOM',function(){it('should match snapshot',function(){expect(renderedElement).toMatchSnapshot();});it('should have no selected value',function(){expect(renderedInstance.selectedItem).toBe(null);});describe('Given picker component gets opened',function(){beforeEach(function(){renderedInstance.toggleOpenState(true);renderedElement.update();});it('should have isOpen state',function(){expect(renderedInstance.state.isOpen).toBe(true);});it('should render the picker list',function(){expect(renderedElement.find(PickerList).length).toBe(1);});it('should render the picker items',function(){expect(renderedElement.find('li button').length).toBe(mockItems.length);});describe('Given a item gets selected',function(){jest.useFakeTimers();beforeEach(function(){jest.clearAllMocks();renderedElement.find('li button').first().simulate('click');jest.runAllTimers();});afterEach(function(){jest.clearAllTimers();});it('should trigger onChange when the value changed',function(){expect(mockOnChange).toHaveBeenCalledTimes(1);});it('should trigger onSelect when the value changed',function(){expect(mockOnSelect).toHaveBeenCalledTimes(1);});it('should not trigger onChange when the value did not change, but trigger onSelect',function(){renderedInstance.setState({selectedIndex:0});renderedInstance.toggleOpenState(true);renderedElement.find('li button').first().simulate('click');jest.runAllTimers();expect(mockOnChange).toHaveBeenCalledTimes(1);expect(mockOnSelect).toHaveBeenCalledTimes(2);});});});});});
4
+ */var renderComponent=function renderComponent(props){renderedElement=mount(/*#__PURE__*/React.createElement(Picker,props));renderedInstance=renderedElement.find('Picker').instance();};beforeEach(function(){renderComponent({items:mockItems,onChange:mockOnChange,onSelect:mockOnSelect});renderedElement.update();});describe('Given the component was mounted to the DOM',function(){it('should match snapshot',function(){expect(renderedElement).toMatchSnapshot();});it('should have no selected value',function(){expect(renderedInstance.selectedItem).toBe(null);});describe('Given picker component gets opened',function(){beforeEach(function(){renderedInstance.toggleOpenState(true);renderedElement.update();});it('should have isOpen state',function(){expect(renderedInstance.state.isOpen).toBe(true);});it('should render the picker list',function(){expect(renderedElement.find(PickerList).length).toBe(1);});it('should render the picker items',function(){expect(renderedElement.find('li button').length).toBe(mockItems.length);});describe('Given a item gets selected',function(){jest.useFakeTimers();beforeEach(function(){jest.clearAllMocks();renderedElement.find('li button').first().simulate('click');jest.runAllTimers();});afterEach(function(){jest.clearAllTimers();});it('should trigger onChange when the value changed',function(){expect(mockOnChange).toHaveBeenCalledTimes(1);});it('should trigger onSelect when the value changed',function(){expect(mockOnSelect).toHaveBeenCalledTimes(1);});it('should not trigger onChange when the value did not change, but trigger onSelect',function(){renderedInstance.setState({selectedIndex:0});renderedInstance.toggleOpenState(true);renderedElement.find('li button').first().simulate('click');jest.runAllTimers();expect(mockOnChange).toHaveBeenCalledTimes(1);expect(mockOnSelect).toHaveBeenCalledTimes(2);});});});});});
@@ -2,4 +2,4 @@ import React from'react';import PropTypes from'prop-types';import styles from"./
2
2
  * The Picker Button component.
3
3
  * @param {Object} props The component props.
4
4
  * @return {JSX}
5
- */var Button=function Button(_ref){var disabled=_ref.disabled,label=_ref.label,openList=_ref.openList,value=_ref.value;return React.createElement("button",{className:"".concat(disabled?styles.buttonDisabled:styles.button),onClick:openList,type:"button"},React.createElement("span",{className:styles.label},label),value&&React.createElement("span",{className:styles.value},value));};Button.defaultProps={disabled:false,openList:function openList(){}};export default Button;
5
+ */var Button=function Button(_ref){var disabled=_ref.disabled,label=_ref.label,openList=_ref.openList,value=_ref.value;return/*#__PURE__*/React.createElement("button",{className:"".concat(disabled?styles.buttonDisabled:styles.button),onClick:openList,type:"button"},/*#__PURE__*/React.createElement("span",{className:styles.label},label),value&&/*#__PURE__*/React.createElement("span",{className:styles.value},value));};Button.defaultProps={disabled:false,openList:function openList(){}};export default Button;
@@ -1,15 +1,15 @@
1
- function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}return _assertThisInitialized(self);}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import React,{Component}from'react';import PropTypes from'prop-types';import{SheetList,Picker as BasePicker,Sheet}from'@shopgate/engage/components';import{ViewContext}from'@shopgate/engage/components/View';import Button from"./components/Button";import styles from"./style";/**
1
+ function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj;}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;},_typeof(obj);}var _excluded=["hasButton","sheetProps"];function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import React,{Component}from'react';import PropTypes from'prop-types';import{SheetList,Picker as BasePicker,Sheet}from'@shopgate/engage/components';import{ViewContext}from'@shopgate/engage/components/View';import Button from"./components/Button";import styles from"./style";/**
2
2
  * The template version of the Picker component.
3
3
  * @param {Object} props The same component props as in the base Picker component.
4
- */var PickerUtilize=/*#__PURE__*/function(_Component){_inherits(PickerUtilize,_Component);/**
4
+ */var PickerUtilize=/*#__PURE__*/function(_Component){_inherits(PickerUtilize,_Component);var _super=_createSuper(PickerUtilize);/**
5
5
  * Constructor
6
6
  * @param {Object} props Props of the component
7
- */function PickerUtilize(props){var _this;_classCallCheck(this,PickerUtilize);_this=_possibleConstructorReturn(this,_getPrototypeOf(PickerUtilize).call(this,props));_defineProperty(_assertThisInitialized(_this),"onDidOpen",function(){_this.props.setViewAriaHidden(true);if(_this.firstSelectableItemRef.current){_this.firstSelectableItemRef.current.focus();}});_defineProperty(_assertThisInitialized(_this),"onClose",function(){_this.props.setViewAriaHidden(false);if(_this.pickerRef.current){_this.pickerRef.current.focus();}});_this.modalComponent=function(sheetProps){return React.createElement(Sheet,_extends({},_extends({},_this.props.sheetProps,{},sheetProps),{title:_this.props.label,onDidOpen:_this.onDidOpen}));};_this.pickerRef=React.createRef();_this.firstSelectableItemRef=React.createRef();_this.listComponent=function(prps){return React.createElement(SheetList,null,prps.items.map(function(item,index){return React.createElement(SheetList.Item,{key:item.value,title:item.label,onClick:function onClick(){setTimeout(function(){prps.onSelect(item.value);prps.onClose();},_this.props.clickDelay);},isDisabled:item.disabled,isSelected:index===prps.selectedIndex,rightComponent:item.rightComponent,testId:item.label,ref:index===prps.selectedIndex?_this.firstSelectableItemRef:null});}));};return _this;}/**
7
+ */function PickerUtilize(props){var _this;_classCallCheck(this,PickerUtilize);_this=_super.call(this,props);_defineProperty(_assertThisInitialized(_this),"onDidOpen",function(){_this.props.setViewAriaHidden(true);if(_this.firstSelectableItemRef.current){_this.firstSelectableItemRef.current.focus();}});_defineProperty(_assertThisInitialized(_this),"onClose",function(){_this.props.setViewAriaHidden(false);if(_this.pickerRef.current){_this.pickerRef.current.focus();}});_this.modalComponent=function(sheetProps){return/*#__PURE__*/React.createElement(Sheet,_extends({},_extends({},_this.props.sheetProps,sheetProps),{title:_this.props.label,onDidOpen:_this.onDidOpen}));};_this.pickerRef=/*#__PURE__*/React.createRef();_this.firstSelectableItemRef=/*#__PURE__*/React.createRef();_this.listComponent=function(prps){return/*#__PURE__*/React.createElement(SheetList,null,prps.items.map(function(item,index){return/*#__PURE__*/React.createElement(SheetList.Item,{key:item.value,title:item.label,onClick:function onClick(){setTimeout(function(){prps.onSelect(item.value);prps.onClose();},_this.props.clickDelay);},isDisabled:item.disabled,isSelected:index===prps.selectedIndex,rightComponent:item.rightComponent,testId:item.label,ref:index===prps.selectedIndex?_this.firstSelectableItemRef:null});}));};return _this;}/**
8
8
  * Focuses the picker button for screen readers.
9
- */_createClass(PickerUtilize,[{key:"render",/**
9
+ */_createClass(PickerUtilize,[{key:"render",value:/**
10
10
  * Render
11
11
  * @returns {JSX}
12
- */value:function render(){var _this$props=this.props,hasButton=_this$props.hasButton,ignore=_this$props.sheetProps,restProps=_objectWithoutProperties(_this$props,["hasButton","sheetProps"]);return React.createElement(BasePicker,_extends({},restProps,{className:"".concat(hasButton?styles:''," engage__picker-utilize"),modalComponent:this.modalComponent,buttonProps:this.props.buttonProps,buttonComponent:this.props.buttonComponent||Button,listComponent:this.listComponent,onClose:this.onClose,ref:this.pickerRef}));}}]);return PickerUtilize;}(Component);_defineProperty(PickerUtilize,"defaultProps",{buttonComponent:null,buttonProps:{},/**
12
+ */function render(){var _this$props=this.props,hasButton=_this$props.hasButton,ignore=_this$props.sheetProps,restProps=_objectWithoutProperties(_this$props,_excluded);return/*#__PURE__*/React.createElement(BasePicker,_extends({},restProps,{className:"".concat(hasButton?styles:''," engage__picker-utilize"),modalComponent:this.modalComponent,buttonProps:this.props.buttonProps,buttonComponent:this.props.buttonComponent||Button,listComponent:this.listComponent,onClose:this.onClose,ref:this.pickerRef}));}}]);return PickerUtilize;}(Component);_defineProperty(PickerUtilize,"defaultProps",{buttonComponent:null,buttonProps:{},/**
13
13
  * Time in ms that delays picker interaction in order
14
14
  * to let animations complete first.
15
- */clickDelay:150,hasButton:true,sheetProps:{}});export default(function(props){return React.createElement(ViewContext.Consumer,null,function(_ref){var setAriaHidden=_ref.setAriaHidden;return React.createElement(PickerUtilize,_extends({},props,{setViewAriaHidden:setAriaHidden}));});});
15
+ */clickDelay:150,hasButton:true,sheetProps:{}});export default(function(props){return/*#__PURE__*/React.createElement(ViewContext.Consumer,null,function(_ref){var setAriaHidden=_ref.setAriaHidden;return/*#__PURE__*/React.createElement(PickerUtilize,_extends({},props,{setViewAriaHidden:setAriaHidden}));});});
@@ -1 +1 @@
1
- import React from'react';import{mount}from'enzyme';import Picker from"./index";jest.mock('@shopgate/engage/components/View');describe('<Picker />',function(){it('should render the picker',function(){var label='Picker label';var wrapper=mount(React.createElement(Picker,{label:label}));expect(wrapper).toMatchSnapshot();});});
1
+ import React from'react';import{mount}from'enzyme';import Picker from"./index";jest.mock('@shopgate/engage/components/View');describe('<Picker />',function(){it('should render the picker',function(){var label='Picker label';var wrapper=mount(/*#__PURE__*/React.createElement(Picker,{label:label}));expect(wrapper).toMatchSnapshot();});});
@@ -1,8 +1,8 @@
1
- function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}import React,{useRef,useState,useCallback,useLayoutEffect,useEffect,forwardRef}from'react';import PropTypes from'prop-types';import{isIOs}from'@shopgate/pwa-core';import{parseFloatString,formatFloat}from"./helper";/**
1
+ var _excluded=["className","onChange","onFocus","onBlur","value","maxDecimals","unit","minValue","maxValue"];function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++){arr2[i]=arr[i];}return arr2;}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}import React,{useRef,useState,useCallback,useLayoutEffect,useEffect,forwardRef}from'react';import PropTypes from'prop-types';import MobileDetect from'mobile-detect';import{parseFloatString,formatFloat}from"./helper";var md=new MobileDetect(navigator.userAgent);/**
2
2
  * A Quantity Input with unit support.
3
3
  * @returns {JSX}
4
- */var QuantityInput=forwardRef(function(_ref,outerInputRef){var className=_ref.className,onChange=_ref.onChange,customOnFocus=_ref.onFocus,customOnBlur=_ref.onBlur,value=_ref.value,maxDecimals=_ref.maxDecimals,unit=_ref.unit,minValue=_ref.minValue,maxValue=_ref.maxValue,inputProps=_objectWithoutProperties(_ref,["className","onChange","onFocus","onBlur","value","maxDecimals","unit","minValue","maxValue"]);var inputRef=outerInputRef||useRef();var _useState=useState(formatFloat(value,maxDecimals)),_useState2=_slicedToArray(_useState,2),inputValue=_useState2[0],setInputValue=_useState2[1];var _useState3=useState(false),_useState4=_slicedToArray(_useState3,2),isFocused=_useState4[0],setIsFocused=_useState4[1];var onFocus=useCallback(function(event){customOnFocus(event);setIsFocused(true);},[customOnFocus]);var onBlur=useCallback(function(event){var newValue=parseFloatString(inputValue,maxDecimals);setIsFocused(false);// If invalid switch to old value.
4
+ */var QuantityInput=/*#__PURE__*/forwardRef(function(_ref,outerInputRef){var className=_ref.className,onChange=_ref.onChange,customOnFocus=_ref.onFocus,customOnBlur=_ref.onBlur,value=_ref.value,maxDecimals=_ref.maxDecimals,unit=_ref.unit,minValue=_ref.minValue,maxValue=_ref.maxValue,inputProps=_objectWithoutProperties(_ref,_excluded);var inputRef=outerInputRef||useRef();var _useState=useState(formatFloat(value,maxDecimals)),_useState2=_slicedToArray(_useState,2),inputValue=_useState2[0],setInputValue=_useState2[1];var _useState3=useState(false),_useState4=_slicedToArray(_useState3,2),isFocused=_useState4[0],setIsFocused=_useState4[1];var onFocus=useCallback(function(event){customOnFocus(event);setIsFocused(true);},[customOnFocus]);var onBlur=useCallback(function(event){var newValue=parseFloatString(inputValue,maxDecimals);setIsFocused(false);// If invalid switch to old value.
5
5
  if(Number.isNaN(parseFloat(inputValue))){setInputValue(formatFloat(value,maxDecimals));return;}onChange(newValue);customOnBlur(event,newValue);},[customOnBlur,inputValue,maxDecimals,onChange,value]);var handleChange=useCallback(function(event){var newValue=event.target.value;if(newValue!==''){if(minValue&&newValue<minValue){newValue="".concat(minValue);}if(maxValue&&newValue>maxValue){newValue="".concat(maxValue);}}setInputValue(newValue);},[maxValue,minValue]);// Select the current input value after focus.
6
- useLayoutEffect(function(){if(isFocused&&isIOs){inputRef.current.select();}},[inputRef,isFocused]);// Sync actual float value with displayed content.
6
+ useLayoutEffect(function(){if(isFocused&&md.os()!=='iOS'){inputRef.current.select();}},[inputRef,isFocused]);// Sync actual float value with displayed content.
7
7
  useEffect(function(){setInputValue(formatFloat(value,maxDecimals));},[maxDecimals,value]);// Stop the context menu from opening.
8
- useLayoutEffect(function(){inputRef.current.addEventListener('contextmenu',function(event){event.preventDefault();event.stopPropagation();return false;});},[inputRef]);var displayedValue=!isFocused&&unit?"".concat(inputValue," ").concat(unit):inputValue;return React.createElement("input",_extends({ref:inputRef},inputProps,{inputMode:"decimal"/* Pattern signals some browsers to use specialized keyboard (if inputmode not supported */,pattern:"[0-9.,]*",onFocus:onFocus,onBlur:onBlur,className:className,value:displayedValue,onChange:handleChange}));});QuantityInput.defaultProps={className:'',maxDecimals:2,unit:null,minValue:null,maxValue:null,onFocus:function onFocus(){},onChange:function onChange(){},onBlur:function onBlur(){}};export default QuantityInput;
8
+ useLayoutEffect(function(){inputRef.current.addEventListener('contextmenu',function(event){event.preventDefault();event.stopPropagation();return false;});},[inputRef]);var displayedValue=!isFocused&&unit?"".concat(inputValue," ").concat(unit):inputValue;return/*#__PURE__*/React.createElement("input",_extends({ref:inputRef},inputProps,{inputMode:"decimal"/* Pattern signals some browsers to use specialized keyboard (if inputmode not supported */,pattern:"[0-9.,]*",onFocus:onFocus,onBlur:onBlur,className:className,value:displayedValue,onChange:handleChange}));});QuantityInput.defaultProps={className:'',maxDecimals:2,unit:null,minValue:null,maxValue:null,onFocus:function onFocus(){},onChange:function onChange(){},onBlur:function onBlur(){}};export default QuantityInput;
@@ -6,4 +6,4 @@ import React from'react';import PropTypes from'prop-types';import cxs from'class
6
6
  * @param {Function} props.onTouchStart The touch start event callback.
7
7
  * @param {Object} props.classNames (Optional) An additional style classes for the handle.
8
8
  * @returns {JSX}
9
- */var RangeSliderHandle=function RangeSliderHandle(props){var active=props.active,index=props.index,_onTouchStart=props.onTouchStart,classNames=props.classNames;var style={zIndex:Number(active)||0};return React.createElement("div",{className:cxs(classNames.handleOuter,styles,'engage__range-slider__handle'),style:style,onTouchStart:function onTouchStart(event){return _onTouchStart(event,index);}},React.createElement("div",{className:classNames.handleInner}));};RangeSliderHandle.defaultProps={active:false,classNames:{handleOuter:null,handleInner:null}};export default RangeSliderHandle;
9
+ */var RangeSliderHandle=function RangeSliderHandle(props){var active=props.active,index=props.index,_onTouchStart=props.onTouchStart,classNames=props.classNames;var style={zIndex:Number(active)||0};return/*#__PURE__*/React.createElement("div",{className:cxs(classNames.handleOuter,styles,'engage__range-slider__handle'),style:style,onTouchStart:function onTouchStart(event){return _onTouchStart(event,index);}},/*#__PURE__*/React.createElement("div",{className:classNames.handleInner}));};RangeSliderHandle.defaultProps={active:false,classNames:{handleOuter:null,handleInner:null}};export default RangeSliderHandle;