Skip to content

Commit f4187ec

Browse files
authored
Merge pull request #15 from itenl/dev-1.1.0
Dev 1.1.0
2 parents 8f37321 + 81f5692 commit f4187ec

File tree

6 files changed

+345
-38
lines changed

6 files changed

+345
-38
lines changed

.gitignore

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
9+
# Diagnostic reports (https://nodejs.org/api/report.html)
10+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11+
12+
# Runtime data
13+
pids
14+
*.pid
15+
*.seed
16+
*.pid.lock
17+
18+
# Directory for instrumented libs generated by jscoverage/JSCover
19+
lib-cov
20+
21+
# Coverage directory used by tools like istanbul
22+
coverage
23+
*.lcov
24+
25+
# nyc test coverage
26+
.nyc_output
27+
28+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29+
.grunt
30+
31+
# Bower dependency directory (https://bower.io/)
32+
bower_components
33+
34+
# node-waf configuration
35+
.lock-wscript
36+
37+
# Compiled binary addons (https://nodejs.org/api/addons.html)
38+
build/Release
39+
40+
# Dependency directories
41+
node_modules/
42+
jspm_packages/
43+
44+
# TypeScript v1 declaration files
45+
typings/
46+
47+
# TypeScript cache
48+
*.tsbuildinfo
49+
50+
# Optional npm cache directory
51+
.npm
52+
53+
# Optional eslint cache
54+
.eslintcache
55+
56+
# Microbundle cache
57+
.rpt2_cache/
58+
.rts2_cache_cjs/
59+
.rts2_cache_es/
60+
.rts2_cache_umd/
61+
62+
# Optional REPL history
63+
.node_repl_history
64+
65+
# Output of 'npm pack'
66+
*.tgz
67+
68+
# Yarn Integrity file
69+
.yarn-integrity
70+
71+
# dotenv environment variables file
72+
.env
73+
.env.test
74+
75+
# parcel-bundler cache (https://parceljs.org/)
76+
.cache
77+
78+
# Next.js build output
79+
.next
80+
81+
# Nuxt.js build / generate output
82+
.nuxt
83+
dist
84+
85+
# Gatsby files
86+
.cache/
87+
# Comment in the public line in if your project uses Gatsby and *not* Next.js
88+
# https://nextjs.org/blog/next-9-1#public-directory-support
89+
# public
90+
91+
# vuepress build output
92+
.vuepress/dist
93+
94+
# Serverless directories
95+
.serverless/
96+
97+
# FuseBox cache
98+
.fusebox/
99+
100+
# DynamoDB Local files
101+
.dynamodb/
102+
103+
# TernJS port file
104+
.tern-port
105+
106+
.expo/**

README-zh_CN.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ Prop | Type | Default | Description
147147
**`mappingProps`** | Object | {} | 关联映射数据到 Stack / Sticky
148148
**`badges`** | Array | [] | 针对每个Tab的徽章 < [阅读 Badge Property](#BadgeProperty) >
149149
**`tabsStyle`** | Object | {} | 整个Tabs样式
150-
**`tabWrapStyle`** | Object | {} | 单个Tab外包装样式
150+
**`tabWrapStyle`** | Object / Function | {} | 单个Tab外包装样式 (函数参数提供了item, index, 需要返回样式对象,eg. **`return index == 1 && { zIndex : 10}`**)
151151
**`tabInnerStyle`** | Object | {} | 单个Tab内包装样式
152152
**`tabActiveOpacity`** | Number | 0.6 | Tab按钮点击后透明度
153153
**`tabStyle`** | Object | {} | 单个Tab样式
@@ -160,6 +160,7 @@ Prop | Type | Default | Description
160160
**`onBeforeRefresh`** | Function | null | 下拉刷新前置函数, 执行 **`next`** 将执行Screen中 **`onRefresh`** 函数,执行 **`toggled`** 将切换系统loading,可传 true / false 进行指定 (回调含有 **`next`** , **`toggled`** 两个形参)
161161
**`onBeforeEndReached`** | Function | null | 上滑加载更多前置函数, 执行next将执行Screen中 **`onEndReached`** 函数 (回调含有 **`next`** 形参)
162162
**`onTabviewChanged`** | Function | null | Tab切换完成回调 (回调含有 **`index`**, **`tabLabel`** 两个形参)
163+
**`screenScrollThrottle`** | Number | 60 | **`Screen`** 横向滑动时节流参数,单位 (毫秒)
163164
**`header`** | Function / JSX Element / Class Component | null | 顶部组件 (若是函数需要返回 Element)
164165
**`oneTabHidden`** | Boolean | false | 仅一个Tab时将隐藏自身
165166
**`enableCachePage`** | Boolean | true | 是否持久化页面切换后不销毁
@@ -171,6 +172,7 @@ Prop | Type | Default | Description
171172
**`fixedTabs`** | Boolean | false | 在 **`enableCachePage`** 为true的情况下滑动切换Screen设置最小高度保障Header与Tabs不会弹跳
172173
**`fixedHeader`** | Boolean | false | 与Tabs一同渲染,固定顶部Header,不跟随滚动
173174
**`useScroll`** | Boolean | false | Tabs是否支持横向滚动(存在多个类目Tab的情况需要启用,建议 **`tabStyle`** 传入固定宽度)
175+
**`useScrollStyle`** | Object | {} | 为滚动的 **`Tabs`** 设置 **`contentContainerStyle`**,常见为左右两侧添加边距 **`paddingLeft`** **`paddingHorizontal`**
174176
**`fillScreen`** | Boolean | true | 填充整个 Screen
175177
**`title`** | Function / JSX Element / Class Component | null | 动画标题
176178
**`titleArgs`** | Object | **`{ style: {}, interpolateOpacity: {}, interpolateHeight: {} }`** | 标题配置 < [阅读 interpolate](https://reactnative.dev/docs/animations#interpolation) >

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ Prop | Type | Default | Description
147147
**`mappingProps`** | Object | {} | Associate mapping data to Stack / Sticky
148148
**`badges`** | Array | [] | Badges for each Tab < [Read Badge Property](#BadgeProperty) >
149149
**`tabsStyle`** | Object | {} | The entire Tabs style
150-
**`tabWrapStyle`** | Object | {} | Single Tab wrap style
150+
**`tabWrapStyle`** | Object / Function | {} | Single Tab wrap style (The function parameters provide item, index, and need to return the style object, eg. **`return index == 1 && {zIndex: 10}`**)
151151
**`tabInnerStyle`** | Object | {} | Single Tab inner style
152152
**`tabActiveOpacity`** | Number | 0.6 | Transparency after Tab button click
153153
**`tabStyle`** | Object | {} | Single Tab style
@@ -160,6 +160,7 @@ Prop | Type | Default | Description
160160
**`onBeforeRefresh`** | Function | null | Pull down to refresh the pre-functions, execute **`next`** to execute **`onRefresh`** function in Screen, execute **`toggled`** to switch system loading, you can pass true / false to specify (callback contains **`next`**, **`toggled`** two formal parameters)
161161
**`onBeforeEndReached`** | Function | null | Slide up to load more pre-functions, execute next will execute the **`onEndReached`** function in the Screen (callback contains **`next`** formal parameters)
162162
**`onTabviewChanged`** | Function | null | Tab switch completion callback (callback contains **`index`**, **`tabLabel`** two formal parameters)
163+
**`screenScrollThrottle`** | Number | 60 | **`Screen`** Throttle parameters during lateral sliding, Unit (ms)
163164
**`header`** | Function / JSX Element / Class Component | null | Top component (if the function needs to return Element)
164165
**`oneTabHidden`** | Boolean | false | Hide itself when there is only one Tab
165166
**`enableCachePage`** | Boolean | true | Whether the persistent page will not be destroyed after switching
@@ -171,6 +172,7 @@ Prop | Type | Default | Description
171172
**`fixedTabs`** | Boolean | false | When **`enableCachePage`** is true, slide to switch Screen to set the minimum height to ensure that the Header and Tabs will not bounce
172173
**`fixedHeader`** | Boolean | false | Render together with Tabs, fix the top Header, do not follow the scroll
173174
**`useScroll`** | Boolean | false | Does Tabs support horizontal scrolling (it needs to be enabled when there are multiple category Tabs, it is recommended that **`tabStyle`** pass in a fixed width)
175+
**`useScrollStyle`** | Object | {} | Set **`contentContainerStyle`** for scrolling **`Tabs`**, usually add margins to the left and right sides **`paddingLeft`** **`paddingHorizontal`**
174176
**`fillScreen`** | Boolean | true | Fill the entire Screen
175177
**`title`** | Function / JSX Element / Class Component | null | Animation title
176178
**`titleArgs`** | Object | **`{ style: {}, interpolateOpacity: {}, interpolateHeight: {} }`** | Title parameter configuration < [Read interpolate](https://reactnative.dev/docs/animations#interpolation) >
@@ -229,7 +231,7 @@ Name | Type | Description
229231
**`scrollTo(index: number.required)`** | Function | Swipe up and down to the specified position (passing in 0 is the default positioning to tabs / passing in a negative number is set to the top)
230232
**`toTabView(index: number.required / label: string.required)`** | Function | Jump to the specified Screen
231233
**`layoutHeight.container`** | Number | Total height of the Container
232-
**`layoutHeight.header`** | Number | otal height of the Header
234+
**`layoutHeight.header`** | Number | Total height of the Header
233235
**`layoutHeight.tabs`** | Number | Total height of the Tabs
234236
**`layoutHeight.screen`** | Number | Total height of the Screen
235237

package-lock.json

Lines changed: 173 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"test": "echo \"Error: no test specified\" && exit 1"
88
},
99
"dependencies": {
10-
"react-native-snap-carousel": "^3.9.1"
10+
"lodash.throttle": "^4.1.1",
11+
"react-native-snap-carousel": "^4.0.0-beta.6"
1112
},
1213
"keywords": [
1314
"react",

0 commit comments

Comments
 (0)