@shopgate/pwa-ui-shared 7.30.0-alpha.4 → 7.30.0-alpha.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.
- package/Form/RadioGroup/index.js +2 -2
- package/TextField/index.js +2 -2
- package/package.json +5 -5
package/Form/RadioGroup/index.js
CHANGED
|
@@ -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 _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 _callSuper(_this,derived,args){function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(e){return false;}}derived=_getPrototypeOf(derived);return _possibleConstructorReturn(_this,isNativeReflectConstruct()?Reflect.construct(derived,args||[],_getPrototypeOf(_this).constructor):derived.apply(_this,args));}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
|
|
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 _callSuper(_this,derived,args){function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(e){return false;}}derived=_getPrototypeOf(derived);return _possibleConstructorReturn(_this,isNativeReflectConstruct()?Reflect.construct(derived,args||[],_getPrototypeOf(_this).constructor):derived.apply(_this,args));}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,{Component,Children,cloneElement}from'react';import PropTypes from'prop-types';import classNames from'classnames';import FormElement from'@shopgate/pwa-ui-shared/FormElement';import style from"./style";/**
|
|
2
2
|
* RadioGroup component.
|
|
3
3
|
*/var RadioGroup=/*#__PURE__*/function(_Component){function RadioGroup(props){var _this2;_classCallCheck(this,RadioGroup);_this2=_callSuper(this,RadioGroup,[props]);/**
|
|
4
4
|
* @param {string} event click from radio element
|
|
@@ -10,4 +10,4 @@ function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="s
|
|
|
10
10
|
*/function render(){var _this3=this;var _this$props=this.props,children=_this$props.children,className=_this$props.className,label=_this$props.label,errorText=_this$props.errorText,direction=_this$props.direction,name=_this$props.name,translateErrorText=_this$props.translateErrorText,disabled=_this$props.disabled,showErrorText=_this$props.showErrorText;return React.createElement(FormElement,{className:classNames(className,'radioGroup','ui-shared__form__radio-group',{disabled:disabled}),label:label,labelStatic:true,errorText:errorText,translateErrorText:translateErrorText,showErrorText:showErrorText,htmlFor:"none",hasUnderline:false,hasValue:true},React.createElement("div",{className:classNames(style.container(direction),'radioGroup')},Children.map(children,function(child){if(!child){return null;}return cloneElement(child,{key:"".concat(name,"_").concat(child.props.name),checked:_this3.state.value===child.props.name,onChange:_this3.handleChange});})));}}]);}(Component);_defineProperty(RadioGroup,"defaultProps",{onChange:function onChange(){},children:null,className:'',direction:'column',disabled:false,errorText:'',isControlled:false,label:'',translateErrorText:true,value:null,showErrorText:true/**
|
|
11
11
|
* Initializes the component.
|
|
12
12
|
* @param {Object} props The components props.
|
|
13
|
-
*/});export default
|
|
13
|
+
*/});export default RadioGroup;
|
package/TextField/index.js
CHANGED
|
@@ -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 _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 _callSuper(_this,derived,args){function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(e){return false;}}derived=_getPrototypeOf(derived);return _possibleConstructorReturn(_this,isNativeReflectConstruct()?Reflect.construct(derived,args||[],_getPrototypeOf(_this).constructor):derived.apply(_this,args));}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
|
|
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 _callSuper(_this,derived,args){function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(e){return false;}}derived=_getPrototypeOf(derived);return _possibleConstructorReturn(_this,isNativeReflectConstruct()?Reflect.construct(derived,args||[],_getPrototypeOf(_this).constructor):derived.apply(_this,args));}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,{Component}from'react';import PropTypes from'prop-types';import classNames from'classnames';import Label from"./components/Label";import Underline from"./components/Underline";import ErrorText from"./components/ErrorText";import Hint from"./components/Hint";import styles from"./style";import FormElement from"./components/FormElement/index";/**
|
|
2
2
|
* A component that provides a styled text field for user input in material design.
|
|
3
3
|
*/var TextField=/*#__PURE__*/function(_Component){/**
|
|
4
4
|
* Creates a new text field component.
|
|
@@ -33,4 +33,4 @@ if(navigator.userAgent.includes('Firefox')&&this.props.type==='date'){return tru
|
|
|
33
33
|
*/},{key:"hasErrorMessage",get:function get(){return!!(this.state.validationError||this.props.errorText);}},{key:"render",value:/**
|
|
34
34
|
* Renders the text field.
|
|
35
35
|
* @return {JSX.Element}
|
|
36
|
-
*/function render(){var styleType=this.props.multiLine?'multiLine':'input';var style=styles.container[styleType];var _this$props=this.props,multiLine=_this$props.multiLine,className=_this$props.className,disabled=_this$props.disabled,hintText=_this$props.hintText,name=_this$props.name,label=_this$props.label,setRef=_this$props.setRef,onSanitize=_this$props.onSanitize,password=_this$props.password,type=_this$props.type,value=_this$props.value,isControlled=_this$props.isControlled,inputComponent=_this$props.inputComponent,showErrorText=_this$props.showErrorText,errorText=_this$props.errorText,translateErrorText=_this$props.translateErrorText,required=_this$props.required;return React.createElement("div",{className:classNames(style,className,'textField','ui-shared__text-field',{disabled:disabled})},React.createElement(Hint,{visible:this.isHintVisible,hintText:hintText}),React.createElement(Label,{name:name,label:label,isFocused:this.isFocused,isFloating:this.isLabelFloating,hasErrorMessage:this.hasErrorMessage}),React.createElement(FormElement,{id:name,multiLine:multiLine,name:name,setRef:setRef,onFocusChange:this.handleFocusChange,onChange:this.handleChange,onSanitize:onSanitize,onValidate:this.handleValidate,password:password,type:type,value:value,isControlled:isControlled,inputComponent:inputComponent,disabled:disabled,required:required,attributes:{'aria-invalid':!!errorText,'aria-describedby':this.hasErrorMessage?"ariaError-".concat(name):null}}),React.createElement(Underline,{isFocused:this.isFocused,hasErrorMessage:this.hasErrorMessage}),showErrorText&&React.createElement(ErrorText,{validationError:this.state.validationError,errorText:errorText,translate:translateErrorText,elementName:name}));}}]);}(Component);_defineProperty(TextField,"defaultProps",{className:'',errorText:'',showErrorText:true,setRef:function setRef(){},hintText:'',isControlled:false,label:'',multiLine:false,onChange:function onChange(){},onFocusChange:function onFocusChange(){},onSanitize:function onSanitize(value){return value;},onValidate:function onValidate(){return true;},required:false,password:false,translateErrorText:true,type:'text',value:'',inputComponent:'input',disabled:false});export default
|
|
36
|
+
*/function render(){var styleType=this.props.multiLine?'multiLine':'input';var style=styles.container[styleType];var _this$props=this.props,multiLine=_this$props.multiLine,className=_this$props.className,disabled=_this$props.disabled,hintText=_this$props.hintText,name=_this$props.name,label=_this$props.label,setRef=_this$props.setRef,onSanitize=_this$props.onSanitize,password=_this$props.password,type=_this$props.type,value=_this$props.value,isControlled=_this$props.isControlled,inputComponent=_this$props.inputComponent,showErrorText=_this$props.showErrorText,errorText=_this$props.errorText,translateErrorText=_this$props.translateErrorText,required=_this$props.required;return React.createElement("div",{className:classNames(style,className,'textField','ui-shared__text-field',{disabled:disabled})},React.createElement(Hint,{visible:this.isHintVisible,hintText:hintText}),React.createElement(Label,{name:name,label:label,isFocused:this.isFocused,isFloating:this.isLabelFloating,hasErrorMessage:this.hasErrorMessage}),React.createElement(FormElement,{id:name,multiLine:multiLine,name:name,setRef:setRef,onFocusChange:this.handleFocusChange,onChange:this.handleChange,onSanitize:onSanitize,onValidate:this.handleValidate,password:password,type:type,value:value,isControlled:isControlled,inputComponent:inputComponent,disabled:disabled,required:required,attributes:{'aria-invalid':!!errorText,'aria-describedby':this.hasErrorMessage?"ariaError-".concat(name):null}}),React.createElement(Underline,{isFocused:this.isFocused,hasErrorMessage:this.hasErrorMessage}),showErrorText&&React.createElement(ErrorText,{validationError:this.state.validationError,errorText:errorText,translate:translateErrorText,elementName:name}));}}]);}(Component);_defineProperty(TextField,"defaultProps",{className:'',errorText:'',showErrorText:true,setRef:function setRef(){},hintText:'',isControlled:false,label:'',multiLine:false,onChange:function onChange(){},onFocusChange:function onFocusChange(){},onSanitize:function onSanitize(value){return value;},onValidate:function onValidate(){return true;},required:false,password:false,translateErrorText:true,type:'text',value:'',inputComponent:'input',disabled:false});export default TextField;
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopgate/pwa-ui-shared",
|
|
3
|
-
"version": "7.30.0-alpha.
|
|
3
|
+
"version": "7.30.0-alpha.5",
|
|
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.30.0-alpha.
|
|
9
|
-
"@shopgate/pwa-ui-material": "7.30.0-alpha.
|
|
8
|
+
"@shopgate/pwa-ui-ios": "7.30.0-alpha.5",
|
|
9
|
+
"@shopgate/pwa-ui-material": "7.30.0-alpha.5",
|
|
10
10
|
"react-day-picker": "^7.4.8"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@shopgate/pwa-common": "7.30.0-alpha.
|
|
14
|
-
"@shopgate/pwa-common-commerce": "7.30.0-alpha.
|
|
13
|
+
"@shopgate/pwa-common": "7.30.0-alpha.5",
|
|
14
|
+
"@shopgate/pwa-common-commerce": "7.30.0-alpha.5",
|
|
15
15
|
"classnames": "2.5.1",
|
|
16
16
|
"react": "~16.14.0"
|
|
17
17
|
},
|