{"bugs":{"url":"https://github.com/raxjs/rax-scrollview/issues"},"dist":{"shasum":"d5c365a4a8bb99a94625803e5cc271a8867bb9f9","tarball":"https://registry.npmjs.org/rax-scrollview/-/rax-scrollview-1.1.0-4.tgz","fileCount":16,"integrity":"sha512-IWrC8n5ONoz4bLdk29XLxmAL/D2EEt3ZvVLbb3ruKvdswlf3cTOlJbX2pSAyEsaowmqIK4tfMQmcDLSxO2OzRQ==","signatures":[{"sig":"MEYCIQDmLZAkgFV+JsmeJyv9X8KmA150FeJqvxWYJcHDOlZFOQIhAOcsmKqmsK+Bu4uyaK00G6OchdVz+44OZAcv6YFOJdiv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":28819,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdd02LCRA9TVsSAnZWagAA9EcP/RaQnJOThm+q0yUSkgsx\nRpdJK0RKhPIm/27lhITL+2NWAhLCa50qZsh4M/A1LbtxRSt/qXLPSp7KdBm0\nR86evARNrqBzy6T0jrzFgQoHBf0VLdMMMekmBYZobzm7/Tt5Cj1LvmsTPSWR\nzUwWOlLP870TXF4cUM/NUnhwAtvibthyPBUtrOUJu5WkTviw2KkLpti5R1rp\n/dLK1iBgpyHtWtlo68tiQlrF8MHNNT9SMrxc4KCdXA8jCduaEtpgV5t8DH75\nwOeTNtAQ2phgEHb8VVldh5G71qfZIhTP/PNmR46tddf4f+vd/JHpavBS6twR\nNMZ1W1afBZ+/W3ogCwEMe6loGdekVLk2NLzwuVXJQFvQ9cxoZMydTsuwqImg\nmn29K6fzLQAXZPXn1TSU42eHKIV7Hzp2+RjiT4Svh27H2hgZSjWojW8P8uuN\n/XKYZi7g6QZ9huJPml6a9NpAA9KFeUsTuBaOO74u6Co1ixh18+uTpR3dP1Ps\nzNqYYmejupXFTqeTSrlP9+uSU7CiVrpdG61sbKvwF9Xwmt18/e72onUJ3kw/\ngJJft+JxiMbZBzUFp+fl4fU0N620S7ja/u0hJ1h7Fi3mw1A0DJKjqOqGMxHr\nHaLNLkq+9Vh1euhIFaofeGz0y+C88AGNYXFuD1Y50YJyW2B7K81LuJBDSRTY\nWQ78\r\n=FiSs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","name":"rax-scrollview","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"[![npm](https://img.shields.io/npm/v/rax-scrollview.svg)](https://www.npmjs.com/package/rax-scrollview)\n**描述：**\nScrollView 是一个包装了滚动操作的组件。一般情况下需要一个确定的高度来保证 ScrollView 的正常展现。\n## 安装\n\n```bash\n$ npm install rax-scrollview --save\n```\n## 属性\n\n注：\n1、**支持**列表中的 <img alt=\"browser\" src=\"https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg\" width=\"25px\" height=\"25px\" />代表h5 <img alt=\"weex\" src=\"https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg\" width=\"25px\" height=\"25px\" />代表weex  <img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" />代表小程序\n\n|**属性**| **类型** | **默认值** | **必填** | **描述**           | **支持** |\n| ----------- | ---------- | ---------- | ------------ | ------------------ | ------------ |\n| scrollEventThrottle     | `number` | 100      |     false         | 这个属性控制在滚动过程中，scroll事件被调用的频率，用于滚动的节流 | <img alt=\"browser\" src=\"https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"weex\" src=\"https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg\" width=\"25px\" height=\"25px\" />|\n| horizontal     | `boolean` | -          |      false        | 设置为横向滚动 | <img alt=\"browser\" src=\"https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"weex\" src=\"https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg\" width=\"25px\" height=\"25px\" /><img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" />|\n| showsHorizontalScrollIndicator     | `boolean` | true          |     false         | 是否允许出现水平滚动条 | <img alt=\"browser\" src=\"https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"weex\" src=\"https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg\" width=\"25px\" height=\"25px\" />|\n| showsVerticalScrollIndicator     | `boolean` | true          |     false        | 是否允许出现垂直滚动条 | <img alt=\"browser\" src=\"https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"weex\" src=\"https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg\" width=\"25px\" height=\"25px\" />|\n| onEndReachedThreshold     | `number` | 500         |     false         | 设置加载更多的偏移 | <img alt=\"browser\" src=\"https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"weex\" src=\"https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg\" width=\"25px\" height=\"25px\" /><img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" />|\n| onEndReached     | `function` | -          |     false         | 滚动区域还剩`onEndReachedThreshold`的长度时触发 | <img alt=\"browser\" src=\"https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"weex\" src=\"https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg\" width=\"25px\" height=\"25px\" /><img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" />|\n| onScroll     | `function` | -          |     false         | 滚动时触发的事件，返回当前滚动的水平垂直距离 | <img alt=\"browser\" src=\"https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"weex\" src=\"https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg\" width=\"25px\" height=\"25px\" /><img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" />|\n## 方法\n### scrollTo({x:number,y:number})\n#### 参数\n参数为object，包含以下属性\n| **属性** | **类型** | **默认值** | **必填** | **描述**            | \n| -------- | -------- | ---------- | ------------ | ------------------- |\n| x  | `number` | -          | 否           | \b横向的偏移量            | \n| y | `number` | -       | 否           | 纵向的偏移量 | \n## 示例\n```jsx\nimport {createElement, Component, render,createRef} from 'rax';\nimport View from 'rax-view';\n\nimport DU from \"driver-universal\"\nimport Text from 'rax-text';\nimport ScrollView from 'rax-scrollview';\n\nclass Thumb extends Component {\n  shouldComponentUpdate(nextProps, nextState) {\n    return false;\n  }\n\n  render() {\n    return (\n      <View style={styles.button}>\n        <View style={styles.box} />\n      </View>\n    );\n  }\n}\n\nlet THUMBS = [];\nfor (let i = 0; i < 20; i++) THUMBS.push(i);\nlet createThumbRow = (val, i) => <Thumb key={i} />;\n\nclass App extends Component {\n  state = {\n    horizontalScrollViewEventLog: false,\n    scrollViewEventLog: false,\n  };\n  constructor(props) {\n    super(props);\n    this.horizontalScrollView = createRef();\n  }\n\n  render() {\n    return (\n      <View style={styles.root}>\n      <View style={styles.container}>\n        <ScrollView\n          ref={this.horizontalScrollView}\n          style={{\n            height: 100,\n          }}\n          horizontal={true}\n          onEndReached={() => this.setState({horizontalScrollViewEventLog:true})}\n        >\n          {THUMBS.map(createThumbRow)}\n        </ScrollView>\n\n        <View\n          style={styles.button}\n          onClick={() => {this.horizontalScrollView.current.scrollTo({x: 0})}}>\n          <Text>Scroll to start</Text>\n        </View>\n\n        <View style={styles.eventLogBox}>\n          <Text>{this.state.horizontalScrollViewEventLog ? 'onEndReached' : ''}</Text>\n        </View>\n\n      </View>\n\n      <View style={{...styles.container, ...{height: 500}}}>\n        <ScrollView\n          ref={(scrollView) => {\n            this.scrollView = scrollView;\n          }}\n          onEndReached={() => this.setState({scrollViewEventLog:true})}\n        >\n          <View>\n            <View style={styles.sticky}>\n              <Text>Cannot sticky</Text>\n            </View>\n          </View>\n\n          <View style={styles.sticky}>\n            <Text>Sticky view must in ScrollView root</Text>\n          </View>\n\n          {THUMBS.map(createThumbRow)}\n\n        </ScrollView>\n\n        <View\n          style={styles.button}\n          onClick={() => {this.scrollView.scrollTo({y: 0})}}>\n          <Text>Scroll to top</Text>\n        </View>\n\n        <View style={styles.eventLogBox}>\n          <Text>{this.state.scrollViewEventLog ? 'onEndReached' : ''}</Text>\n        </View>\n\n      </View>\n\n      </View>\n    );\n  }\n}\n\nlet styles = {\n  root: {\n    width: 750,\n    paddingTop: 20\n  },\n  sticky: {\n    position: 'sticky',\n    width: 750,\n    backgroundColor: '#cccccc'\n  },\n  container: {\n    padding: 20,\n    borderStyle: 'solid',\n    borderColor: '#dddddd',\n    borderWidth: 1,\n    marginLeft: 20,\n    marginRight: 20,\n    marginBottom: 10,\n  },\n  button: {\n    margin: 7,\n    padding: 5,\n    alignItems: 'center',\n    backgroundColor: '#eaeaea',\n    borderRadius: 3,\n  },\n  box: {\n    width: 64,\n    height: 64,\n  },\n  eventLogBox: {\n    padding: 10,\n    margin: 10,\n    height: 80,\n    borderWidth: 1,\n    borderColor: '#f0f0f0',\n    backgroundColor: '#f9f9f9',\n  },\n};\n\nrender(<App />, document.body, { driver: DU });\n\n```\n\n","engines":{"npm":">=3.0.0"},"gitHead":"19150d9071aa3bd63e827a590e5c85a078041937","license":"BSD-3-Clause","scripts":{"lint":"eslint --ext .js --ext .jsx --ext .ts --ext .tsx ./src --fix","test":"rax-scripts test","build":"npm run clean && rax-scripts build","clean":"rm -rf ./lib && rm -rf ./package-lock.json && rm -rf ./demo/miniapp/lib","start":"rax-scripts start","prepublishOnly":"npm run build"},"_npmUser":{"name":"recover758126","email":"761647716@qq.com"},"homepage":"https://github.com/raxjs/rax-scrollview","keywords":["Rax","rax-component","react-component"],"repository":{"url":"git+https://github.com/raxjs/rax-scrollview.git","type":"git"},"_npmVersion":"6.9.0","description":"ScrollView component for Rax.","directories":{},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","git add"]},"maintainers":[{"name":"amdgigabyte","email":"amdgigabyte@gmail.com"},{"name":"liangzhi.llz","email":"liangzhi.llz@alibaba-inc.com"},{"name":"recover758126","email":"761647716@qq.com"},{"name":"wintercn","email":"csf178@gmail.com"},{"name":"yacheng","email":"narutosun2@163.com"},{"name":"yuanyan","email":"yuanyan.cao@gmail.com"},{"name":"zeroling","email":"wssgcg1213@qq.com"}],"_nodeVersion":"10.16.0","dependencies":{"rax-view":"^1.1.0-0","classnames":"^2.2.6","universal-env":"^1.0.0","rax-refreshcontrol":"^1.0.0"},"miniappConfig":{"main":"lib/miniapp/index","propsMap":{"onEndReachedThreshold":"endReachedThreshold"}},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"rax":"^1.0.0","husky":"^3.0.5","eslint":"^5.16.0","csstype":"^2.6.4","rax-text":"^1.0.1","typescript":"^3.5.3","@types/jest":"^24.0.12","driver-weex":"^1.0.0","lint-staged":"^9.2.5","rax-scripts":"^2.0.0","@rax-types/rax":"^1.0.5","@types/ali-app":"^1.0.0","driver-universal":"^1.0.0","@types/classnames":"^2.2.9","eslint-config-rax":"^0.0.0","rax-test-renderer":"^1.0.0","rax-plugin-component":"^0.1.9","@typescript-eslint/parser":"^1.7.0","@typescript-eslint/eslint-plugin":"^1.7.0"},"peerDependencies":{"rax":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/rax-scrollview_1.1.0-4_1568099722366_0.042917726231190834","host":"s3://npm-registry-packages"},"_id":"rax-scrollview@1.1.0-4","version":"1.1.0-4"}