Socket
Socket
Sign inDemoInstall

nuke-cell

Package Overview
Dependencies
Maintainers
2
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuke-cell - npm Package Compare versions

Comparing version 2.0.1 to 2.1.1-3

68

lib/index.js

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

/** @jsx createElement */
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _rax = require('rax');
var _nukeEnv = require('nuke-env');
var _nukeEnv2 = _interopRequireDefault(_nukeEnv);
var _nukeView = require('nuke-view');
var _nukeView2 = _interopRequireDefault(_nukeView);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof 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 isWeex = _nukeEnv2.default.isWeex;
var Cell = function (_Component) {
_inherits(Cell, _Component);
function Cell() {
_classCallCheck(this, Cell);
return _possibleConstructorReturn(this, (Cell.__proto__ || Object.getPrototypeOf(Cell)).apply(this, arguments));
}
_createClass(Cell, [{
key: 'render',
value: function render() {
var _props = this.props,
_props$append = _props.append,
append = _props$append === undefined ? 'tree' : _props$append,
others = _objectWithoutProperties(_props, ['append']);
if (isWeex && this.context.isInARecyclerView) {
return (0, _rax.createElement)('cell', _extends({ append: append }, others));
} else {
return (0, _rax.createElement)(_nukeView2.default, others);
}
}
}]);
return Cell;
}(_rax.Component);
Cell.contextTypes = {
isInARecyclerView: _rax.PropTypes.bool
};
exports.default = Cell;
module.exports = exports['default'];
'use strict';Object.defineProperty(exports,'__esModule',{value:!0});var _class,_temp,_extends=Object.assign||function(target){for(var source,i=1;i<arguments.length;i++)for(var key in source=arguments[i],source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);return target},_createClass=function(){function defineProperties(target,props){for(var descriptor,i=0;i<props.length;i++)descriptor=props[i],descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,'value'in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_rax=require('rax'),_nukeEnv=require('nuke-env'),_nukeEnv2=_interopRequireDefault(_nukeEnv),_nukeView=require('nuke-view'),_nukeView2=_interopRequireDefault(_nukeView);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _objectWithoutProperties(obj,keys){var target={};for(var i in obj)0<=keys.indexOf(i)||Object.prototype.hasOwnProperty.call(obj,i)&&(target[i]=obj[i]);return target}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError('Cannot call a class as a function')}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return call&&('object'==typeof call||'function'==typeof call)?call:self}function _inherits(subClass,superClass){if('function'!=typeof superClass&&null!==superClass)throw new TypeError('Super expression must either be null or a function, not '+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var isWeex=_nukeEnv2.default.isWeex,Cell=(_temp=_class=function(_Component){function Cell(){return _classCallCheck(this,Cell),_possibleConstructorReturn(this,(Cell.__proto__||Object.getPrototypeOf(Cell)).apply(this,arguments))}return _inherits(Cell,_Component),_createClass(Cell,[{key:'render',value:function render(){var _props=this.props,_props$append=_props.append,append=void 0===_props$append?'tree':_props$append,others=_objectWithoutProperties(_props,['append']);return isWeex&&this.context.isInARecyclerView?(0,_rax.createElement)('cell',_extends({append:append},others)):(0,_rax.createElement)(_nukeView2.default,others)}}]),Cell}(_rax.Component),_class.contextTypes={isInARecyclerView:_rax.PropTypes.bool},_temp);exports.default=Cell,module.exports=exports['default'];

20

package.json
{
"name": "nuke-cell",
"version": "2.0.1",
"version": "2.1.1-3",
"description": "列表项",

@@ -39,9 +39,2 @@ "main": "lib/index",

},
"scripts": {
"dev": "nuke-bin server",
"build": "nuke-bin build",
"prepublish": "nuke-bin build",
"test": "nuke-bin test",
"lint": "eslint '@(src|docs)/**/*.@(js|jsx|md)' || true"
},
"repository": {

@@ -62,8 +55,8 @@ "type": "git",

"dependencies": {
"nuke-env": "^2.x.x",
"nuke-view": "^2.x.x"
"nuke-env": "^2.1.1-3",
"nuke-view": "^2.1.1-3"
},
"devDependencies": {
"nuke-list-view": "^2.x.x",
"nuke-text": "^2.x.x"
"nuke-list-view": "^2.1.1-3",
"nuke-text": "^2.1.1-3"
},

@@ -73,3 +66,4 @@ "publishConfig": {

},
"license": "Apache"
"license": "Apache",
"gitHead": "1f7b1551e5d262305859ef4a185eb6d4743fa0aa"
}
/** @jsx createElement */
'use strict';
import { createElement, Component, PropTypes } from 'rax';
import Env from 'nuke-env';
import View from 'nuke-view';
const { isWeex } = Env;

@@ -11,3 +13,3 @@

static contextTypes = {
isInARecyclerView: PropTypes.bool
isInARecyclerView: PropTypes.bool,
};

@@ -19,7 +21,6 @@

return <cell append={append} {...others} />;
} else {
return <View {...others} />;
}
return <View {...others} />;
}
}
export default Cell;
/** @jsx createElement */
import {createElement, Component,render } from 'rax';
import { createElement, Component, render } from 'rax';
import View from 'nuke-view';

@@ -8,46 +8,43 @@ import Text from 'nuke-text';

const styles = {
listContainer: {
flex: 1,
},
cellItem: {
width: '750rem',
height: '200rem',
paddingTop: '20rem',
flexDirection: 'row',
borderBottomWidth: '1rem',
borderBottomStyle: 'solid',
borderBottomColor: '#cccccc',
justifyContent: 'center',
alignItems: 'center',
},
text: {
color: '#666666',
},
};
class Demo extends Component {
constructor() {
super();
this.state = {
data: ["列表1","列表2","列表3","列表4","列表5","列表6","列表7"]
};
}
render(){
return (
<ListView _autoWrapCell={false} showScrollbar={false} style={styles.listContainer}>
{
this.state.data.map((item,index)=>{
return (
<Cell key={`cell_${index}`}>
<View style={[styles.cellItem]}>
<Text style={styles.text}>{item}</Text>
</View>
</Cell>
)
})
}
</ListView>
)
}
constructor() {
super();
this.state = {
data: ['列表1', '列表2', '列表3', '列表4', '列表5', '列表6', '列表7'],
};
}
render() {
return (
<ListView _autoWrapCell={false} showScrollbar={false} style={styles.listContainer}>
{this.state.data.map((item, index) => (
<Cell key={`cell_${index}`}>
<View style={[styles.cellItem]}>
<Text style={styles.text}>{item}</Text>
</View>
</Cell>
))}
</ListView>
);
}
}
const styles = {
listContainer : {
flex : 1
},
cellItem : {
width: '750rem',
height: '200rem',
paddingTop:'20rem',
flexDirection:'row',
borderBottomWidth:'1rem',
borderBottomStyle:'solid',
borderBottomColor:'#cccccc',
justifyContent:'center',
alignItems:'center'
},
text:{
color:'#666666'
}
}
render(<Demo />);
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