Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rax-countdown

Package Overview
Dependencies
Maintainers
1
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rax-countdown - npm Package Compare versions

Comparing version 0.3.7 to 0.3.8

150

dist/countdown.factory.js

@@ -134,2 +134,4 @@ module.exports = function(require, exports, module) {

var _class, _temp;
var _rax = __webpack_require__(0);

@@ -157,3 +159,3 @@

var View = function (_Component) {
var View = (_temp = _class = function (_Component) {
_inherits(View, _Component);

@@ -182,3 +184,3 @@

return View;
}(_rax.Component);
}(_rax.Component), _class.propTypes = {}, _temp);

@@ -294,7 +296,6 @@ var styles = {

nativeProps.style = _extends({
display: 'flex',
nativeProps.style = _extends(_extends({}, !this.context.isInAParentText && { display: 'flex' }, {
width: width,
height: height
}, style);
}), style);
nativeProps.src = uri;

@@ -334,3 +335,3 @@

return Image;
}(_rax.Component), _class.resizeMode = {
}(_rax.Component), _class.propTypes = {}, _class.resizeMode = {
contain: 'contain',

@@ -341,2 +342,4 @@ cover: 'cover',

repeat: 'repeat'
}, _class.contextTypes = {
isInAParentText: _rax.PropTypes.bool
}, _temp);

@@ -362,3 +365,3 @@

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

@@ -369,2 +372,8 @@ Object.defineProperty(exports, "__esModule", {

var _typeof = typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol" ? function (obj) {
return typeof obj === "undefined" ? "undefined" : _typeof2(obj);
} : function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof2(obj);
};
var _extends = Object.assign || function (target) {

@@ -390,3 +399,3 @@ for (var i = 1; i < arguments.length; i++) {

var _class, _temp;
var _class, _temp2;

@@ -406,3 +415,3 @@ var _rax = __webpack_require__(0);

throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}return call && ((typeof call === "undefined" ? "undefined" : _typeof(call)) === "object" || typeof call === "function") ? call : self;
}return call && ((typeof call === "undefined" ? "undefined" : _typeof2(call)) === "object" || typeof call === "function") ? call : self;
}

@@ -412,26 +421,22 @@

if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : _typeof(superClass)));
throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : _typeof2(superClass)));
}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
var Text = (_temp = _class = function (_Component) {
var Text = (_temp2 = _class = function (_Component) {
_inherits(Text, _Component);
function Text() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, Text);
return _possibleConstructorReturn(this, (Text.__proto__ || Object.getPrototypeOf(Text)).apply(this, arguments));
}
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_createClass(Text, [{
key: 'getChildContext',
value: function getChildContext() {
return {
isInAParentText: true
};
}
}, {
key: 'render',
value: function render() {
var props = this.props;
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Text.__proto__ || Object.getPrototypeOf(Text)).call.apply(_ref, [this].concat(args))), _this), _this.renderText = function () {
var props = _this.props;
var nativeProps = _extends({}, props, {

@@ -450,2 +455,6 @@ style: props.style || {}

if (_this.context.isInAParentText) {
return (0, _rax.createElement)('span', nativeProps, textString);
}
if (props.onPress) {

@@ -464,3 +473,3 @@ nativeProps.onClick = props.onPress;

} else {
var styleProps = _extends({}, styles.initial, nativeProps.style);
var styleProps = _extends({}, styles.text, nativeProps.style);
var numberOfLines = props.numberOfLines;

@@ -481,14 +490,95 @@ if (numberOfLines) {

}
}, _this.renderRichText = function () {
var props = _this.props;
var children = props.children;
var nativeProps = _extends({}, props, {
style: props.style || {}
});
var styleProps = _extends({}, styles.richtext, nativeProps.style);
if (_universalEnv.isWeex) {
children = transformChildren(children, _this);
}
return (0, _rax.createElement)('p', _extends({}, nativeProps, { style: styleProps }), children);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Text, [{
key: 'getChildContext',
value: function getChildContext() {
return {
isInAParentText: true
};
}
}, {
key: 'render',
value: function render() {
var props = this.props;
var children = props.children;
if (!Array.isArray(children)) {
children = [children];
}
var nested = false;
for (var i = 0; i < children.length; i++) {
var child = children[i];
if (child && (typeof child === 'undefined' ? 'undefined' : _typeof(child)) === 'object') {
nested = true;
break;
}
}
return nested ? this.renderRichText() : this.renderText();
}
}]);
return Text;
}(_rax.Component), _class.contextTypes = {
}(_rax.Component), _class.propTypes = {}, _class.contextTypes = {
isInAParentText: _rax.PropTypes.bool
}, _class.childContextTypes = {
isInAParentText: _rax.PropTypes.bool
}, _temp);
}, _temp2);
function transformChild(child, instance) {
var Com = child.type,
props = child.props;
var children = props.children;
if (typeof type === 'function') {
var childInstance = new Com();
childInstance.props = props;
if (children) {
childInstance.props.children = transformChildren(children, instance);
}
childInstance.context = instance.getChildContext();
return childInstance.render();
} else {
return child;
}
}
function transformChildren(children, instance) {
var elements = [];
if (!Array.isArray(children)) {
children = [children];
}
for (var i = 0; i < children.length; i++) {
var child = children[i];
if (typeof child === 'string') {
elements.push(child);
} else if ((typeof child === 'undefined' ? 'undefined' : _typeof(child)) === 'object') {
elements.push(transformChild(child, instance));
}
}
return elements;
}
var styles = {
initial: {
text: {
border: '0 solid black',

@@ -502,2 +592,6 @@ position: 'relative',

fontSize: 32
},
richtext: {
marginTop: 0,
marginBottom: 0
}

@@ -504,0 +598,0 @@ };

@@ -156,2 +156,4 @@

var _class, _temp;
var _rax = __webpack_require__(0);

@@ -179,3 +181,3 @@

var View = function (_Component) {
var View = (_temp = _class = function (_Component) {
_inherits(View, _Component);

@@ -204,3 +206,3 @@

return View;
}(_rax.Component);
}(_rax.Component), _class.propTypes = {}, _temp);

@@ -316,7 +318,6 @@ var styles = {

nativeProps.style = _extends({
display: 'flex',
nativeProps.style = _extends(_extends({}, !this.context.isInAParentText && { display: 'flex' }, {
width: width,
height: height
}, style);
}), style);
nativeProps.src = uri;

@@ -356,3 +357,3 @@

return Image;
}(_rax.Component), _class.resizeMode = {
}(_rax.Component), _class.propTypes = {}, _class.resizeMode = {
contain: 'contain',

@@ -363,2 +364,4 @@ cover: 'cover',

repeat: 'repeat'
}, _class.contextTypes = {
isInAParentText: _rax.PropTypes.bool
}, _temp);

@@ -384,3 +387,3 @@

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

@@ -391,2 +394,8 @@ Object.defineProperty(exports, "__esModule", {

var _typeof = typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol" ? function (obj) {
return typeof obj === "undefined" ? "undefined" : _typeof2(obj);
} : function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof2(obj);
};
var _extends = Object.assign || function (target) {

@@ -412,3 +421,3 @@ for (var i = 1; i < arguments.length; i++) {

var _class, _temp;
var _class, _temp2;

@@ -428,3 +437,3 @@ var _rax = __webpack_require__(0);

throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}return call && ((typeof call === "undefined" ? "undefined" : _typeof(call)) === "object" || typeof call === "function") ? call : self;
}return call && ((typeof call === "undefined" ? "undefined" : _typeof2(call)) === "object" || typeof call === "function") ? call : self;
}

@@ -434,26 +443,22 @@

if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : _typeof(superClass)));
throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : _typeof2(superClass)));
}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
var Text = (_temp = _class = function (_Component) {
var Text = (_temp2 = _class = function (_Component) {
_inherits(Text, _Component);
function Text() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, Text);
return _possibleConstructorReturn(this, (Text.__proto__ || Object.getPrototypeOf(Text)).apply(this, arguments));
}
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_createClass(Text, [{
key: 'getChildContext',
value: function getChildContext() {
return {
isInAParentText: true
};
}
}, {
key: 'render',
value: function render() {
var props = this.props;
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Text.__proto__ || Object.getPrototypeOf(Text)).call.apply(_ref, [this].concat(args))), _this), _this.renderText = function () {
var props = _this.props;
var nativeProps = _extends({}, props, {

@@ -472,2 +477,6 @@ style: props.style || {}

if (_this.context.isInAParentText) {
return (0, _rax.createElement)('span', nativeProps, textString);
}
if (props.onPress) {

@@ -486,3 +495,3 @@ nativeProps.onClick = props.onPress;

} else {
var styleProps = _extends({}, styles.initial, nativeProps.style);
var styleProps = _extends({}, styles.text, nativeProps.style);
var numberOfLines = props.numberOfLines;

@@ -503,14 +512,95 @@ if (numberOfLines) {

}
}, _this.renderRichText = function () {
var props = _this.props;
var children = props.children;
var nativeProps = _extends({}, props, {
style: props.style || {}
});
var styleProps = _extends({}, styles.richtext, nativeProps.style);
if (_universalEnv.isWeex) {
children = transformChildren(children, _this);
}
return (0, _rax.createElement)('p', _extends({}, nativeProps, { style: styleProps }), children);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Text, [{
key: 'getChildContext',
value: function getChildContext() {
return {
isInAParentText: true
};
}
}, {
key: 'render',
value: function render() {
var props = this.props;
var children = props.children;
if (!Array.isArray(children)) {
children = [children];
}
var nested = false;
for (var i = 0; i < children.length; i++) {
var child = children[i];
if (child && (typeof child === 'undefined' ? 'undefined' : _typeof(child)) === 'object') {
nested = true;
break;
}
}
return nested ? this.renderRichText() : this.renderText();
}
}]);
return Text;
}(_rax.Component), _class.contextTypes = {
}(_rax.Component), _class.propTypes = {}, _class.contextTypes = {
isInAParentText: _rax.PropTypes.bool
}, _class.childContextTypes = {
isInAParentText: _rax.PropTypes.bool
}, _temp);
}, _temp2);
function transformChild(child, instance) {
var Com = child.type,
props = child.props;
var children = props.children;
if (typeof type === 'function') {
var childInstance = new Com();
childInstance.props = props;
if (children) {
childInstance.props.children = transformChildren(children, instance);
}
childInstance.context = instance.getChildContext();
return childInstance.render();
} else {
return child;
}
}
function transformChildren(children, instance) {
var elements = [];
if (!Array.isArray(children)) {
children = [children];
}
for (var i = 0; i < children.length; i++) {
var child = children[i];
if (typeof child === 'string') {
elements.push(child);
} else if ((typeof child === 'undefined' ? 'undefined' : _typeof(child)) === 'object') {
elements.push(transformChild(child, instance));
}
}
return elements;
}
var styles = {
initial: {
text: {
border: '0 solid black',

@@ -524,2 +614,6 @@ position: 'relative',

fontSize: 32
},
richtext: {
marginTop: 0,
marginBottom: 0
}

@@ -526,0 +620,0 @@ };

2

dist/countdown.min.js

@@ -1,1 +0,1 @@

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define)define("rax-countdown",function(t,n,o){o.exports=e()});else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:this,t.RaxCountdown=e()}}(function(){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=5)}([function(e,t){e.exports=function(){var e;if(!e)try{e=require("rax")}catch(e){}return e}()},function(e,t,n){"use strict";var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return void 0===e?"undefined":o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":o(e)};t.isWeb="object"===("undefined"==typeof navigator?"undefined":r(navigator))&&("Mozilla"===navigator.appCodeName||"Gecko"===navigator.product),t.isNode="undefined"!=typeof process&&!(!process.versions||!process.versions.node),t.isWeex="function"==typeof callNative,t.isReactNative="undefined"!=typeof __fbBatchedBridgeConfig},function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":l(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":l(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),c=n(0),s=n(1),f=function(e){function t(){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),a(t,[{key:"render",value:function(){var e=this.props;if(s.isWeex)return(0,c.createElement)("div",e);var t=u({},p.initial,e.style);return(0,c.createElement)("div",u({},e,{style:t}))}}]),t}(c.Component),p={initial:{border:"0 solid black",position:"relative",boxSizing:"border-box",display:"flex",flexDirection:"column",alignContent:"flex-start",flexShrink:0}};t.default=f,e.exports=t.default},function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":l(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":l(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var u,a,c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),f=n(0),p=n(1),y=n(2),d=function(e){return e&&e.__esModule?e:{default:e}}(y),m=(a=u=function(e){function t(){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),s(t,[{key:"render",value:function(){var e=c({},this.props),t=e.source;if(t&&t.uri){var n=e.style,o=t.width,r=t.height,i=t.uri;null==o&&null==r&&null==n.height&&null==n.width&&(o=0,r=0),e.style=c({display:"flex",width:o,height:r},n),e.src=i,delete e.source;var l=void 0;l=p.isWeex?"image":"img";var u=e.resizeMode||e.style.resizeMode;return u&&(p.isWeex?(e.resize=u,e.style.resizeMode=u):e.style.objectFit=u),this.props.children?(e.children=null,(0,f.createElement)(d.default,{style:e.style},(0,f.createElement)(l,e),(0,f.createElement)(d.default,{style:b.absoluteImage},this.props.children))):(0,f.createElement)(l,e)}return null}}]),t}(f.Component),u.resizeMode={contain:"contain",cover:"cover",stretch:"stretch",center:"center",repeat:"repeat"},a),b={absoluteImage:{left:0,top:0,position:"absolute"}};t.default=m,e.exports=t.default},function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":l(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":l(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var u,a,c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),f=n(0),p=n(1),y=(a=u=function(e){function t(){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),s(t,[{key:"getChildContext",value:function(){return{isInAParentText:!0}}},{key:"render",value:function(){var e=this.props,t=c({},e,{style:e.style||{}}),n="";if(null!=e.children&&(n=Array.isArray(e.children)?e.children.join(""):e.children.toString()),e.onPress&&(t.onClick=e.onPress),p.isWeex)return e.numberOfLines&&(t.style.lines=e.numberOfLines),t.value=n,(0,f.createElement)("text",t);var o=c({},d.initial,t.style),r=e.numberOfLines;return r&&(1===parseInt(r)?o.whiteSpace="nowrap":(o.display="-webkit-box",o.webkitBoxOrient="vertical",o.webkitLineClamp=String(r)),o.overflow="hidden"),(0,f.createElement)("span",c({},t,{style:o}),n)}}]),t}(f.Component),u.contextTypes={isInAParentText:f.PropTypes.bool},u.childContextTypes={isInAParentText:f.PropTypes.bool},a),d={initial:{border:"0 solid black",position:"relative",boxSizing:"border-box",display:"block",flexDirection:"column",alignContent:"flex-start",flexShrink:0,fontSize:32}};t.default=y,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function u(e){return e&&"[object Function]"==={}.toString.call(e)}function a(e,t,n,o,r,i){var l=e<0?0:e,u=l<10?0:l.toString().slice(0,1),a=l<10?l:l.toString().slice(1);return(0,p.createElement)(b.default,{style:[t,x.item]},n?(0,p.createElement)(v.default,{source:n,style:o}):null,(0,p.createElement)(d.default,{style:r},""+u),(0,p.createElement)(d.default,{style:i},""+a))}Object.defineProperty(t,"__esModule",{value:!0});var c,s,f=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),p=n(0),y=n(4),d=o(y),m=n(2),b=o(m),h=n(3),v=o(h),g=(s=c=function(e){function t(){var e,n,o,l;r(this,t);for(var a=arguments.length,c=Array(a),s=0;s<a;s++)c[s]=arguments[s];return n=o=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(c))),o.state={timeRemaining:0},o.timeoutId=0,o.tick=function(){var e=o.props,t=e.onComplete,n=e.onTick,r=e.interval,i=o.state.timeRemaining,l=1e3>i;o.timeoutId&&clearTimeout(o.timeoutId),l&&u(t)?t():o.timeoutId=!l&&setTimeout(function(){return o.setState({timeRemaining:i-r},function(){return u(n)&&n(i)})},r)},l=n,i(o,l)}return l(t,e),f(t,[{key:"componentWillMount",value:function(){var e=this.props.timeRemaining;this.setState({timeRemaining:e})}},{key:"componentDidMount",value:function(){this.tick()}},{key:"componentDidUpdate",value:function(){this.tick()}},{key:"componentWillReceiveProps",value:function(e){e.timeRemaining!==this.props.timeRemaining&&(this.timeoutId&&clearTimeout(this.timeoutId),this.setState({timeRemaining:e.timeRemaining}))}},{key:"componentWillUnmount",value:function(){this.timeoutId&&clearTimeout(this.timeoutId)}},{key:"shouldComponentUpdate",value:function(e,t){return this.props.timeRemaining!==e.timeRemaining||this.state.timeRemaining!==t.timeRemaining}},{key:"render",value:function(){var e=this.state.timeRemaining,t=this.props,n=t.formatFunc,o=t.timeStyle,r=t.timeBackgroundStyle,i=t.timeWrapStyle,l=t.timeBackground,u=t.secondStyle,c=t.textStyle,s=t.tpl;if(n)return n(e);var f=Math.floor(e/1e3),y=parseInt(f/3600/24),m=parseInt(f/3600)%24,h=parseInt(f/60)%60,v=parseInt(f%60),g=[x.background,r],w=new RegExp("{d}").test(s),O=new RegExp("{h}").test(s),S=new RegExp("{m}").test(s),_=new RegExp("{s}").test(s),j=s.indexOf("d"),P=s.indexOf("h"),k=s.indexOf("m"),T=s.indexOf("s");return(0,p.createElement)(b.default,{style:x.main},w?a(y,i,l,g,o,o):null,w?(0,p.createElement)(d.default,{style:c},s.slice(j+2,j+3)):null,O?a(m,i,l,g,o,o):null,O?(0,p.createElement)(d.default,{style:c},s.slice(P+2,P+3)):null,S?a(h,i,l,g,o,o):null,S?(0,p.createElement)(d.default,{style:c},s.slice(k+2,k+3)):null,_?a(v,i,l,g,o,u):null,_?(0,p.createElement)(d.default,{style:c},s.slice(T+2,T+3)):null)}}]),t}(p.Component),c.propTypes={formatFunc:p.PropTypes.func,onTick:p.PropTypes.func,onComplete:p.PropTypes.func,tpl:p.PropTypes.string,timeRemaining:p.PropTypes.number,secondStyle:p.PropTypes.object,timeStyle:p.PropTypes.object,textStyle:p.PropTypes.object,timeWrapStyle:p.PropTypes.object,timeBackground:p.PropTypes.string,timeBackgroundStyle:p.PropTypes.object,interval:p.PropTypes.number},c.defaultProps={tpl:"{d}天{h}时{m}分{s}秒",timeRemaining:0,interval:1e3},s),x={main:{flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},item:{flexDirection:"row"},background:{position:"absolute"}};t.default=g,e.exports=t.default}])});
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define)define("rax-countdown",function(t,n,o){o.exports=e()});else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:this,t.RaxCountdown=e()}}(function(){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=5)}([function(e,t){e.exports=function(){var e;if(!e)try{e=require("rax")}catch(e){}return e}()},function(e,t,n){"use strict";var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return void 0===e?"undefined":o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":o(e)};t.isWeb="object"===("undefined"==typeof navigator?"undefined":r(navigator))&&("Mozilla"===navigator.appCodeName||"Gecko"===navigator.product),t.isNode="undefined"!=typeof process&&!(!process.versions||!process.versions.node),t.isWeex="function"==typeof callNative,t.isReactNative="undefined"!=typeof __fbBatchedBridgeConfig},function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":u(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":u(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var l,a,c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),f=n(0),p=n(1),y=(a=l=function(e){function t(){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),s(t,[{key:"render",value:function(){var e=this.props;if(p.isWeex)return(0,f.createElement)("div",e);var t=c({},d.initial,e.style);return(0,f.createElement)("div",c({},e,{style:t}))}}]),t}(f.Component),l.propTypes={},a),d={initial:{border:"0 solid black",position:"relative",boxSizing:"border-box",display:"flex",flexDirection:"column",alignContent:"flex-start",flexShrink:0}};t.default=y,e.exports=t.default},function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":u(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":u(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var l,a,c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),f=n(0),p=n(1),y=n(2),d=function(e){return e&&e.__esModule?e:{default:e}}(y),m=(a=l=function(e){function t(){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),s(t,[{key:"render",value:function(){var e=c({},this.props),t=e.source;if(t&&t.uri){var n=e.style,o=t.width,r=t.height,i=t.uri;null==o&&null==r&&null==n.height&&null==n.width&&(o=0,r=0),e.style=c(c({},!this.context.isInAParentText&&{display:"flex"},{width:o,height:r}),n),e.src=i,delete e.source;var u=void 0;u=p.isWeex?"image":"img";var l=e.resizeMode||e.style.resizeMode;return l&&(p.isWeex?(e.resize=l,e.style.resizeMode=l):e.style.objectFit=l),this.props.children?(e.children=null,(0,f.createElement)(d.default,{style:e.style},(0,f.createElement)(u,e),(0,f.createElement)(d.default,{style:b.absoluteImage},this.props.children))):(0,f.createElement)(u,e)}return null}}]),t}(f.Component),l.propTypes={},l.resizeMode={contain:"contain",cover:"cover",stretch:"stretch",center:"center",repeat:"repeat"},l.contextTypes={isInAParentText:f.PropTypes.bool},a),b={absoluteImage:{left:0,top:0,position:"absolute"}};t.default=m,e.exports=t.default},function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":a(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":a(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function u(e,t){var n=e.type,o=e.props,r=o.children;if("function"==typeof type){var i=new n;return i.props=o,r&&(i.props.children=l(r,t)),i.context=t.getChildContext(),i.render()}return e}function l(e,t){var n=[];Array.isArray(e)||(e=[e]);for(var o=0;o<e.length;o++){var r=e[o];"string"==typeof r?n.push(r):"object"===(void 0===r?"undefined":f(r))&&n.push(u(r,t))}return n}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var c,s,f="function"==typeof Symbol&&"symbol"===a(Symbol.iterator)?function(e){return void 0===e?"undefined":a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":a(e)},p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},y=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),d=n(0),m=n(1),b=(s=c=function(e){function t(){var e,n,i,u;o(this,t);for(var a=arguments.length,c=Array(a),s=0;s<a;s++)c[s]=arguments[s];return n=i=r(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(c))),i.renderText=function(){var e=i.props,t=p({},e,{style:e.style||{}}),n="";if(null!=e.children&&(n=Array.isArray(e.children)?e.children.join(""):e.children.toString()),i.context.isInAParentText)return(0,d.createElement)("span",t,n);if(e.onPress&&(t.onClick=e.onPress),m.isWeex)return e.numberOfLines&&(t.style.lines=e.numberOfLines),t.value=n,(0,d.createElement)("text",t);var o=p({},h.text,t.style),r=e.numberOfLines;return r&&(1===parseInt(r)?o.whiteSpace="nowrap":(o.display="-webkit-box",o.webkitBoxOrient="vertical",o.webkitLineClamp=String(r)),o.overflow="hidden"),(0,d.createElement)("span",p({},t,{style:o}),n)},i.renderRichText=function(){var e=i.props,t=e.children,n=p({},e,{style:e.style||{}}),o=p({},h.richtext,n.style);return m.isWeex&&(t=l(t,i)),(0,d.createElement)("p",p({},n,{style:o}),t)},u=n,r(i,u)}return i(t,e),y(t,[{key:"getChildContext",value:function(){return{isInAParentText:!0}}},{key:"render",value:function(){var e=this.props,t=e.children;Array.isArray(t)||(t=[t]);for(var n=!1,o=0;o<t.length;o++){var r=t[o];if(r&&"object"===(void 0===r?"undefined":f(r))){n=!0;break}}return n?this.renderRichText():this.renderText()}}]),t}(d.Component),c.propTypes={},c.contextTypes={isInAParentText:d.PropTypes.bool},c.childContextTypes={isInAParentText:d.PropTypes.bool},s),h={text:{border:"0 solid black",position:"relative",boxSizing:"border-box",display:"block",flexDirection:"column",alignContent:"flex-start",flexShrink:0,fontSize:32},richtext:{marginTop:0,marginBottom:0}};t.default=b,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e){return e&&"[object Function]"==={}.toString.call(e)}function a(e,t,n,o,r,i){var u=e<0?0:e,l=u<10?0:u.toString().slice(0,1),a=u<10?u:u.toString().slice(1);return(0,p.createElement)(b.default,{style:[t,x.item]},n?(0,p.createElement)(v.default,{source:n,style:o}):null,(0,p.createElement)(d.default,{style:r},""+l),(0,p.createElement)(d.default,{style:i},""+a))}Object.defineProperty(t,"__esModule",{value:!0});var c,s,f=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),p=n(0),y=n(4),d=o(y),m=n(2),b=o(m),h=n(3),v=o(h),g=(s=c=function(e){function t(){var e,n,o,u;r(this,t);for(var a=arguments.length,c=Array(a),s=0;s<a;s++)c[s]=arguments[s];return n=o=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(c))),o.state={timeRemaining:0},o.timeoutId=0,o.tick=function(){var e=o.props,t=e.onComplete,n=e.onTick,r=e.interval,i=o.state.timeRemaining,u=1e3>i;o.timeoutId&&clearTimeout(o.timeoutId),u&&l(t)?t():o.timeoutId=!u&&setTimeout(function(){return o.setState({timeRemaining:i-r},function(){return l(n)&&n(i)})},r)},u=n,i(o,u)}return u(t,e),f(t,[{key:"componentWillMount",value:function(){var e=this.props.timeRemaining;this.setState({timeRemaining:e})}},{key:"componentDidMount",value:function(){this.tick()}},{key:"componentDidUpdate",value:function(){this.tick()}},{key:"componentWillReceiveProps",value:function(e){e.timeRemaining!==this.props.timeRemaining&&(this.timeoutId&&clearTimeout(this.timeoutId),this.setState({timeRemaining:e.timeRemaining}))}},{key:"componentWillUnmount",value:function(){this.timeoutId&&clearTimeout(this.timeoutId)}},{key:"shouldComponentUpdate",value:function(e,t){return this.props.timeRemaining!==e.timeRemaining||this.state.timeRemaining!==t.timeRemaining}},{key:"render",value:function(){var e=this.state.timeRemaining,t=this.props,n=t.formatFunc,o=t.timeStyle,r=t.timeBackgroundStyle,i=t.timeWrapStyle,u=t.timeBackground,l=t.secondStyle,c=t.textStyle,s=t.tpl;if(n)return n(e);var f=Math.floor(e/1e3),y=parseInt(f/3600/24),m=parseInt(f/3600)%24,h=parseInt(f/60)%60,v=parseInt(f%60),g=[x.background,r],w=new RegExp("{d}").test(s),S=new RegExp("{h}").test(s),O=new RegExp("{m}").test(s),P=new RegExp("{s}").test(s),j=s.indexOf("d"),_=s.indexOf("h"),T=s.indexOf("m"),k=s.indexOf("s");return(0,p.createElement)(b.default,{style:x.main},w?a(y,i,u,g,o,o):null,w?(0,p.createElement)(d.default,{style:c},s.slice(j+2,j+3)):null,S?a(m,i,u,g,o,o):null,S?(0,p.createElement)(d.default,{style:c},s.slice(_+2,_+3)):null,O?a(h,i,u,g,o,o):null,O?(0,p.createElement)(d.default,{style:c},s.slice(T+2,T+3)):null,P?a(v,i,u,g,o,l):null,P?(0,p.createElement)(d.default,{style:c},s.slice(k+2,k+3)):null)}}]),t}(p.Component),c.propTypes={formatFunc:p.PropTypes.func,onTick:p.PropTypes.func,onComplete:p.PropTypes.func,tpl:p.PropTypes.string,timeRemaining:p.PropTypes.number,secondStyle:p.PropTypes.object,timeStyle:p.PropTypes.object,textStyle:p.PropTypes.object,timeWrapStyle:p.PropTypes.object,timeBackground:p.PropTypes.string,timeBackgroundStyle:p.PropTypes.object,interval:p.PropTypes.number},c.defaultProps={tpl:"{d}天{h}时{m}分{s}秒",timeRemaining:0,interval:1e3},s),x={main:{flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},item:{flexDirection:"row"},background:{position:"absolute"}};t.default=g,e.exports=t.default}])});
{
"name": "rax-countdown",
"version": "0.3.7",
"version": "0.3.8",
"description": "Countdown component for Rax.",

@@ -24,5 +24,5 @@ "license": "BSD-3-Clause",

"dependencies": {
"rax-view": "^0.3.7",
"rax-text": "^0.3.7",
"rax-image": "^0.3.7"
"rax-view": "^0.3.8",
"rax-text": "^0.3.8",
"rax-image": "^0.3.8"
},

@@ -33,4 +33,4 @@ "peerDependencies": {

"devDependencies": {
"rax-test-renderer": "^0.3.7"
"rax-test-renderer": "^0.3.8"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc