{"bugs":{"url":"https://github.com/raxjs/rax-scrollview/issues"},"dist":{"shasum":"efd3027e974f08514dd42751ddf539bf04dae790","tarball":"https://registry.npmjs.org/rax-scrollview/-/rax-scrollview-1.1.0-7.tgz","fileCount":16,"integrity":"sha512-8oUhSmVelXgdofteEX7j89Tdrmtd4qMJZ9maxpzXCLysxTez9X2Z0Jo9fRsItPVHRw3Dx3TUGIqzXoR77wqraQ==","signatures":[{"sig":"MEQCIFZ68TXpNQ98iZojFvdV2QWBcZgmhH86mHj4mC4Vr4QwAiAS23ML6sbMDY/e8vC5qVqrgavQGAJB9HKUpm15fI6hSg==","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\nwsFcBAEBCAAQBQJde2WwCRA9TVsSAnZWagAAIbkP+QDpreEriNzuT2nfN0Fz\ntoTR5QJZ6xZKpPiGnFTx7ubG4zPKOI7llv/P67zs8Dhp10poeYGW8RBq7uTf\nJpQ6W9QsfAU9ZlDoeoQxj8b24IzX4YuaofLfkF8EfrtNwlQENOyHmVXWsvYT\nBowITCz/RtALyeZ1cvQ2/cq7ywz0/wHb4wCHYuBcKeGOqubpsnKPqdNt9g2Z\nipqW8SWD0jGsDGly5M9HSNfAExDrQpYX8JGkuSkfyVTxYu8G5PF+aAJJLFum\nOaHsNc37ZBhdweet6xSyIYk43OTzKX72ADqqjJJs0O+Dztx51mM/RJT0JG5T\n7XZATNoE83e05qu0uOJuvooCyr7QrWsu5MKY/scIbkT/1DlVbJvtLnN4lRTt\ntVBNAfza+5L08roF+qiVtcKcFHzOytW+75g3UgLgsaW9zpxS4oqkGAYBEm3E\n/nrQiz/GAlcuyHOUgKck9WNtjgyD4jnhRqe23K2d3zbkbyQKEtlbDQVcqgst\n6WazsJa/+1RAUo9L5pZjO8UkvH5KFD2My1qY7RMwKHvrX0Et4aq8c94X6I+f\nelW6hMyIKBGCUfykLHRNvDRHhn039kZmtjzMd8YuKNcCMjqoSxM558UTndqp\n3Ivbz2lqlANOK4jZSOAv0ueKX85o0bbA79iXTgP9QSsLEQoCSKNSwdL6liMA\nC93H\r\n=HBU+\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":"5a0ad93da6181cce941861d6847e476489af29cb","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.11.3","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-7_1568368048303_0.26776429360955456","host":"s3://npm-registry-packages"},"_id":"rax-scrollview@1.1.0-7","version":"1.1.0-7"}