Comparing version 1.1.4 to 1.1.5
@@ -1,1 +0,1 @@ | ||
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=3)}([function(e,t){e.exports=require("rax")},function(e,t){e.exports=require("universal-env")},function(e,t,r){},function(e,t,r){e.exports=r(4)},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r(1),i=r(2);function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var c=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r},s=r.n(i).a;function l(e){var t=s.__cache||(s.__cache={}),r=function e(){var t=[],r=arguments[0],n=Object.prototype.toString.call(r).slice(8,-1).toLowerCase();if("string"===n)(r=r.trim())&&t.push(r);else if("array"===n)r.forEach((function(r){(r=e(r).trim())&&t.push(r)}));else if("object"===n)for(var o in r)(o=o.trim())&&r.hasOwnProperty(o)&&r[o]&&t.push(o);return t.join(" ").trim()}(e),n=r.split(/\s+/),o=t[r];return o||(o={},1===n.length?o=s[n[0].trim()]:n.forEach((function(e){o=Object.assign(o,s[e.trim()])})),t[r]=o),o}var u=Object(n.forwardRef)((function(e,t){var r,i,s=e.className,u=e.style,f=e.numberOfLines,p=e.children,b=e.onPress,y=e.onClick,O=c(e,["className","style","numberOfLines","children","onPress","onClick"]),j=y||b,d="string"==typeof f?parseInt(f,10):f,m=(i=typeof(r=p),null==r||"object"!==i&&"function"!==i?p:p.toString());if(o.isWeex)return Object(n.createElement)("text",a({},O,{ref:t,className:s,style:Object.assign({},l(s),Object.assign({lines:d},u)),onClick:j}),m);var v=["rax-text",s];return d&&(v.push("rax-text--overflow-hidden"),1===d?v.push("rax-text--singleline"):v.push("rax-text--multiline")),Object(n.createElement)("span",a({},O,{ref:t,className:v.join(" "),style:Object.assign({},l(v.join(" ")),Object.assign(Object.assign({},u),{webkitLineClamp:d>1?d:void 0})),onClick:j}),m)}));u.displayName="Text",t.default=u}]); | ||
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=3)}([function(e,t){e.exports=require("rax")},function(e,t){e.exports=require("universal-env")},function(e,t,r){},function(e,t,r){e.exports=r(4)},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r(1),i=r(2);function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var c=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r},s=r.n(i).a;function l(e){var t=s.__cache||(s.__cache={}),r=function e(){var t=[],r=arguments[0],n=Object.prototype.toString.call(r).slice(8,-1).toLowerCase();if("string"===n)(r=r.trim())&&t.push(r);else if("array"===n)r.forEach((function(r){(r=e(r).trim())&&t.push(r)}));else if("object"===n)for(var o in r)(o=o.trim())&&r.hasOwnProperty(o)&&r[o]&&t.push(o);return t.join(" ").trim()}(e),n=r.split(/\s+/),o=t[r];return o||(o={},1===n.length?o=s[n[0].trim()]:n.forEach((function(e){o=Object.assign(o,s[e.trim()])})),t[r]=o),o}var u=Object(n.forwardRef)((function(e,t){var r,i,s=e.className,u=e.style,f=e.numberOfLines,p=e.children,b=e.onPress,y=e.onClick,O=c(e,["className","style","numberOfLines","children","onPress","onClick"]),j=y||b,d="string"==typeof f?parseInt(f,10):f,m=(i=typeof(r=p),null==r||"object"!==i&&"function"!==i||Array.isArray(p)?p:p.toString());if(o.isWeex)return Object(n.createElement)("text",a({},O,{ref:t,className:s,style:Object.assign({},l(s),Object.assign({lines:d},u)),onClick:j}),m);var v=["rax-text",s];return d&&(v.push("rax-text--overflow-hidden"),1===d?v.push("rax-text--singleline"):v.push("rax-text--multiline")),Object(n.createElement)("span",a({},O,{ref:t,className:v.join(" "),style:Object.assign({},l(v.join(" ")),Object.assign(Object.assign({},u),{webkitLineClamp:d>1?d:void 0})),onClick:j}),m)}));u.displayName="Text",t.default=u}]); |
@@ -1,5 +0,5 @@ | ||
import { ForwardRefExoticComponent } from 'rax'; | ||
import { TextProps } from './types'; | ||
import './index.css'; | ||
import { ForwardRefExoticComponent } from "rax"; | ||
import { TextProps } from "./types"; | ||
import "./index.css"; | ||
declare const Text: ForwardRefExoticComponent<TextProps>; | ||
export default Text; |
@@ -82,7 +82,7 @@ "use strict"; | ||
var prefixCls = 'rax-text'; | ||
var prefixCls = "rax-text"; | ||
var isObject = function (value) { | ||
var type = typeof value; | ||
return value != null && (type === 'object' || type === 'function'); | ||
return value != null && (type === "object" || type === "function"); | ||
}; | ||
@@ -100,4 +100,4 @@ | ||
var handleClick = onClick || onPress; | ||
var lines = typeof numberOfLines === 'string' ? parseInt(numberOfLines, 10) : numberOfLines; | ||
var child = isObject(children) ? children.toString() : children; | ||
var lines = typeof numberOfLines === "string" ? parseInt(numberOfLines, 10) : numberOfLines; | ||
var child = isObject(children) && !Array.isArray(children) ? children.toString() : children; | ||
@@ -109,3 +109,2 @@ if (_universalEnv.isWeex) { | ||
style: Object.assign({}, _getStyle(className), Object.assign({ | ||
textOverflow: lines > 1 ? 'ellipsis' : 'clip', | ||
lines: lines | ||
@@ -130,4 +129,4 @@ }, style)), | ||
ref: ref, | ||
className: classNames.join(' '), | ||
style: Object.assign({}, _getStyle(classNames.join(' ')), Object.assign(Object.assign({}, style), { | ||
className: classNames.join(" "), | ||
style: Object.assign({}, _getStyle(classNames.join(" ")), Object.assign(Object.assign({}, style), { | ||
webkitLineClamp: lines > 1 ? lines : undefined | ||
@@ -139,4 +138,4 @@ })), | ||
}); | ||
Text.displayName = 'Text'; | ||
Text.displayName = "Text"; | ||
var _default = Text; | ||
exports.default = _default; |
@@ -100,3 +100,3 @@ "use strict"; | ||
var lines = typeof numberOfLines === 'string' ? parseInt(numberOfLines, 10) : numberOfLines; | ||
var child = isObject(children) ? children.toString() : children; | ||
var child = isObject(children) && !Array.isArray(children) ? children.toString() : children; | ||
@@ -103,0 +103,0 @@ if (_universalEnv.isWeex) { |
{ | ||
"name": "rax-text", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "Text component for Rax.", | ||
@@ -5,0 +5,0 @@ "license": "BSD-3-Clause", |
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
26966
577