@shopgate/pwa-ui-shared 7.20.0-beta.2 → 7.20.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Form/TextField/index.js +1 -1
- package/Price/index.js +2 -1
- package/Price/style.js +1 -1
- package/TaxDisclaimer/index.js +2 -1
- package/package.json +5 -5
package/Form/TextField/index.js
CHANGED
|
@@ -11,4 +11,4 @@ var _excluded=["className","placeholder","label","errorText","leftElement","righ
|
|
|
11
11
|
*/_defineProperty(_this2,"handleFocusChange",function(isFocused){_this2.setState({isFocused:isFocused});_this2.props.onFocusChange(isFocused);});_this2.state={isFocused:false};return _this2;}_inherits(TextField,_Component);return _createClass(TextField,[{key:"render",value:/**
|
|
12
12
|
* Renders the text field.
|
|
13
13
|
* @return {JSX}
|
|
14
|
-
*/function render(){var _this$props=this.props,className=_this$props.className,placeholder=_this$props.placeholder,label=_this$props.label,errorText=_this$props.errorText,leftElement=_this$props.leftElement,rightElement=_this$props.rightElement,hasUnderline=_this$props.hasUnderline,props=_objectWithoutProperties(_this$props,_excluded);return React.createElement(FormElement,{className:"".concat(className," ui-shared__form__text-field"),htmlFor:props.name,placeholder:placeholder,label:label,errorText:errorText,hasUnderline:hasUnderline,hasValue:!!props.value,isFocused:this.state.isFocused},React.createElement(Grid,null,leftElement&&React.createElement(Grid.Item,{grow:0,className:style.element},leftElement),React.createElement(Grid.Item,{grow:1,className:style.container},React.createElement(Input,_extends({},props,{onFocusChange:this.handleFocusChange,className:style[props.multiLine?'multiLine':'input'],validateOnBlur:true}))),rightElement&&React.createElement(Grid.Item,{grow:0,className:style.element},rightElement)));}}]);}(Component);_defineProperty(TextField,"defaultProps",{attributes:null,className:'',errorText:'',hasUnderline:true,label:'',leftElement:null,onChange:noop,onFocusChange:noop,placeholder:'',multiLine:false,rightElement:null,value:'',type:'text',
|
|
14
|
+
*/function render(){var _this$props=this.props,className=_this$props.className,placeholder=_this$props.placeholder,label=_this$props.label,errorText=_this$props.errorText,leftElement=_this$props.leftElement,rightElement=_this$props.rightElement,hasUnderline=_this$props.hasUnderline,props=_objectWithoutProperties(_this$props,_excluded);return React.createElement(FormElement,{className:"".concat(className," ui-shared__form__text-field"),htmlFor:props.name,placeholder:placeholder,label:label,errorText:errorText,hasUnderline:hasUnderline,hasValue:!!props.value,isFocused:this.state.isFocused},React.createElement(Grid,null,leftElement&&React.createElement(Grid.Item,{grow:0,className:style.element},leftElement),React.createElement(Grid.Item,{grow:1,className:style.container},React.createElement(Input,_extends({},props,{onFocusChange:this.handleFocusChange,className:style[props.multiLine?'multiLine':'input'],validateOnBlur:true}))),rightElement&&React.createElement(Grid.Item,{grow:0,className:style.element},rightElement)));}}]);}(Component);_defineProperty(TextField,"defaultProps",{attributes:null,className:'',errorText:'',hasUnderline:true,label:'',leftElement:null,onChange:noop,onFocusChange:noop,placeholder:'',multiLine:false,rightElement:null,value:'',type:'text',maxLength:''});export default TextField;
|
package/Price/index.js
CHANGED
|
@@ -8,7 +8,8 @@ function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj
|
|
|
8
8
|
* @param {boolean} props.discounted Tells if the pice is discounted
|
|
9
9
|
* @param {Object} context The component context.
|
|
10
10
|
* @return {JSX}
|
|
11
|
-
*/var Price=function Price(props,context){
|
|
11
|
+
*/var Price=function Price(props,context){// Added with PWA 6 - CCP-2372
|
|
12
|
+
var _useWidgetSettings=useWidgetSettings('@shopgate/engage/components/TaxDisclaimer'),show=_useWidgetSettings.show,hint=_useWidgetSettings.hint;// use widget setting if set to true/false, otherwise use market logic
|
|
12
13
|
var showDisclaimer=typeof show==='boolean'?show:showTaxDisclaimer;var containerClasses=classNames(styles.container,props.className,_defineProperty({},styles.discounted,props.discounted),'price',props.discounted?'ui-shared__price-discounted':'ui-shared__price');var _context$i18n=context.i18n(),__=_context$i18n.__,_p=_context$i18n._p;var ariaPrice;if(props.unitPriceMin){ariaPrice=__('price.from',{price:_p(props.unitPriceMin,props.currency,props.fractions)});}else{ariaPrice=_p(props.unitPrice,props.currency,props.fractions);}ariaPrice=ariaPrice.replace('-',"\u2212");/* eslint-disable jsx-a11y/aria-role */ /**
|
|
13
14
|
* A unitPriceMin > 0 means, that the product has child products with different prices.
|
|
14
15
|
* The unitPriceMin contains the lowest of these prices and will be
|
package/Price/style.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var container=css({display:'flex',position:'relative',whiteSpace:'nowrap'}).toString();var disclaimer=css({color:'initial',fontSize:14,
|
|
1
|
+
import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var container=css({display:'flex',position:'relative',whiteSpace:'nowrap'}).toString();var disclaimer=css({color:'initial',fontSize:14,position:'absolute',right:-10,top:0}).toString();var discounted=css({color:"var(--color-primary, ".concat(themeConfig.colors.primary,")")}).toString();export default{container:container,disclaimer:disclaimer,discounted:discounted};
|
package/TaxDisclaimer/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from'react';import SurroundPortals from'@shopgate/pwa-common/components/SurroundPortals';import{PRODUCT_TAX_DISCLAIMER}from'@shopgate/pwa-common-commerce/product/constants/Portals';import I18n from'@shopgate/pwa-common/components/I18n';import showTaxDisclaimer from'@shopgate/pwa-common-commerce/market/helpers/showTaxDisclaimer';import{useWidgetSettings}from'@shopgate/engage/core/hooks/useWidgetSettings';import styles from"./style";/**
|
|
2
2
|
* TaxDisclaimer component.
|
|
3
3
|
* @returns {Function}
|
|
4
|
-
*/var TaxDisclaimer=function TaxDisclaimer(){
|
|
4
|
+
*/var TaxDisclaimer=function TaxDisclaimer(){// Added with PWA 6 - CCP-2372
|
|
5
|
+
var _useWidgetSettings=useWidgetSettings('@shopgate/engage/components/TaxDisclaimer'),show=_useWidgetSettings.show,text=_useWidgetSettings.text;// use widget setting if set to true/false, otherwise use market logic
|
|
5
6
|
var showDisclaimer=typeof show==='boolean'?show:showTaxDisclaimer;return React.createElement(SurroundPortals,{portalName:PRODUCT_TAX_DISCLAIMER,portalProps:{showTaxDisclaimer:showDisclaimer}},showDisclaimer&&React.createElement("div",{"data-test-id":"taxDisclaimer","aria-hidden":true,className:"ui-shared__tax-disclaimer"},React.createElement(I18n.Text,{className:styles,string:text||'product.tax_disclaimer'})));};export default TaxDisclaimer;
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopgate/pwa-ui-shared",
|
|
3
|
-
"version": "7.20.0-beta.
|
|
3
|
+
"version": "7.20.0-beta.4",
|
|
4
4
|
"description": "Shopgate's shared UI components.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@shopgate/pwa-ui-ios": "7.20.0-beta.
|
|
9
|
-
"@shopgate/pwa-ui-material": "7.20.0-beta.
|
|
8
|
+
"@shopgate/pwa-ui-ios": "7.20.0-beta.4",
|
|
9
|
+
"@shopgate/pwa-ui-material": "7.20.0-beta.4",
|
|
10
10
|
"react-day-picker": "^7.4.8"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@shopgate/pwa-common": "7.20.0-beta.
|
|
14
|
-
"@shopgate/pwa-common-commerce": "7.20.0-beta.
|
|
13
|
+
"@shopgate/pwa-common": "7.20.0-beta.4",
|
|
14
|
+
"@shopgate/pwa-common-commerce": "7.20.0-beta.4",
|
|
15
15
|
"classnames": "2.3.3",
|
|
16
16
|
"react": "~16.12.0"
|
|
17
17
|
},
|