Comparing version 0.1.4 to 0.1.5
@@ -27,3 +27,3 @@ 'use strict'; | ||
_extends({ | ||
type: props.type || 'button', | ||
type: props.type, | ||
className: _getClasses(props), | ||
@@ -53,2 +53,6 @@ onClick: _onClick.bind(null, props) | ||
Button.defaultProps = { | ||
type: 'button' | ||
}; | ||
function _getClasses(props) { | ||
@@ -55,0 +59,0 @@ var classes = ['btn']; |
@@ -52,2 +52,14 @@ 'use strict'; | ||
var _utils = require('./utils'); | ||
Object.keys(_utils).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _utils[key]; | ||
} | ||
}); | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
@@ -1,2 +0,2 @@ | ||
"use strict"; | ||
'use strict'; | ||
@@ -10,2 +10,4 @@ Object.defineProperty(exports, "__esModule", { | ||
exports.getRemainingProps = getRemainingProps; | ||
exports.getText = getText; | ||
exports.setText = setText; | ||
function getRemainingProps(Component, props) { | ||
@@ -21,2 +23,34 @@ var rest = _extends({}, props); | ||
return rest; | ||
} | ||
function getText(data, culture) { | ||
var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; | ||
if (!data || !culture || typeof culture !== 'string' || culture.length < 2) { | ||
return defaultValue; | ||
} | ||
var language = culture.substring(0, 2).toLowerCase(); | ||
try { | ||
data = JSON.parse(data); | ||
return data[language] || defaultValue; | ||
} catch (e) { | ||
return defaultValue; | ||
} | ||
} | ||
function setText(data, text, culture) { | ||
var language = culture.substring(0, 2).toLowerCase(); | ||
var i18n = {}; | ||
try { | ||
i18n = JSON.parse(data); | ||
} catch (e) {// eslint-disable-line no-empty | ||
} | ||
i18n[language] = text; | ||
return JSON.stringify(i18n); | ||
} |
{ | ||
"name": "cyprex-ui", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "Cyprex basic UI components", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
369081
4279
0