Skip to content

Commit 2b99e5d

Browse files
committed
bump version 1.5.4
1 parent 11cb4ff commit 2b99e5d

File tree

4 files changed

+99
-92
lines changed

4 files changed

+99
-92
lines changed

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@
2323
2424
## Changelogs
2525

26-
- **[1.5.3]**
26+
- **[1.5.4]**
27+
+ Added easily accessible pagination point manipulation: use `dotColor` / `activeDotColor` and `dotStyle` / `activeDotStyle` (thanks [@denizs](https://github.com/denizs))
28+
+ Added scrollEnabled prop to documentation (thanks [@ibandominguez](https://github.com/ibandominguez))
29+
30+
- [1.5.3]
2731
+ Add loadMinimalLoader prop to customize `<ActivityIndicator />` (thanks [@Exilz](https://github.com/Exilz))
2832
+ Disable autoplay timer when prop changes to false (thanks [@dizlexik](https://github.com/dizlexik))
2933
+ Special thanks to [@hypatiah](https://github.com/dizlexik) for fixed some grammatical errors in README
@@ -194,7 +198,11 @@ AppRegistry.registerComponent('myproject', () => swiper);
194198
| paginationStyle | {...} | `style` | Custom styles will merge with the default styles. |
195199
| renderPagination | - | `function` | Complete control how to render pagination with three params (`index`, `total`, `context`) ref to `this.state.index` / `this.state.total` / `this`, For example: show numbers instead of dots. |
196200
| dot | `<View style={{backgroundColor:'rgba(0,0,0,.2)', width: 8, height: 8,borderRadius: 4, marginLeft: 3, marginRight: 3, marginTop: 3, marginBottom: 3,}} />` | `element` | Allow custom the dot element. |
197-
| activeDot | `<View style={{backgroundColor: '#007aff', width: 8, height: 8, borderRadius: 4, marginLeft: 3, marginRight: 3, marginTop: 3, marginBottom: 3,}} />` | `element` | Allow custom the active-dot element. |
201+
| activeDot | - | `element` | Allow custom the active-dot element. |
202+
| dotStyle | - | `object` | Allow custom the active-dot element. |
203+
| dotColor | - | `string` | Allow custom the active-dot element. |
204+
| activeDotColor | - | `string` | Allow custom the active-dot element. |
205+
| activeDotStyle | - | `object` | Allow custom the active-dot element. |
198206

199207
#### Autoplay
200208

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"react-native",
66
"ios"
77
],
8-
"version": "1.5.3",
8+
"version": "1.5.4",
99
"description": "Swiper component for React Native.",
1010
"main": "index.js",
1111
"scripts": {
@@ -52,11 +52,11 @@
5252
},
5353
"homepage": "https://github.com/leecade/react-native-swiper#readme",
5454
"devDependencies": {
55-
"babel-eslint": "^7.1.0",
55+
"babel-eslint": "^7.1.1",
5656
"rimraf": "^2.5.4",
5757
"snazzy": "^5.0.0",
5858
"standard": "^8.5.0",
59-
"updtr": "^0.2.1"
59+
"updtr": "^0.2.3"
6060
},
6161
"dependencies": {}
6262
}

src/index.js

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export default class extends Component {
122122
dotStyle: PropTypes.object,
123123
activeDotStyle: PropTypes.object,
124124
dotColor: PropTypes.string,
125-
activeDotColor: PropTypes.string,
125+
activeDotColor: PropTypes.string
126126
}
127127

128128
/**
@@ -147,7 +147,7 @@ export default class extends Component {
147147
autoplay: false,
148148
autoplayTimeout: 2.5,
149149
autoplayDirection: true,
150-
index: 0,
150+
index: 0
151151
}
152152

153153
/**
@@ -450,44 +450,44 @@ export default class extends Component {
450450
* Render pagination
451451
* @return {object} react-dom
452452
*/
453-
renderPagination = () => {
453+
renderPagination = () => {
454454
// By default, dots only show when `total` >= 2
455-
if (this.state.total <= 1) return null
456-
457-
let dots = []
458-
const ActiveDot = this.props.activeDot || <View style={[{
459-
backgroundColor: this.props.activeDotColor || '#007aff',
460-
width: 8,
461-
height: 8,
462-
borderRadius: 4,
463-
marginLeft: 3,
464-
marginRight: 3,
465-
marginTop: 3,
466-
marginBottom: 3
467-
}, this.props.activeDotStyle]} />
468-
const Dot = this.props.dot || <View style={[{
469-
backgroundColor: this.props.dotColor || 'rgba(0,0,0,.2)',
470-
width: 8,
471-
height: 8,
472-
borderRadius: 4,
473-
marginLeft: 3,
474-
marginRight: 3,
475-
marginTop: 3,
476-
marginBottom: 3
477-
}, this.props.dotStyle ]} />
478-
for (let i = 0; i < this.state.total; i++) {
479-
dots.push(i === this.state.index
480-
? React.cloneElement(ActiveDot, {key: i})
481-
: React.cloneElement(Dot, {key: i})
482-
)
483-
}
455+
if (this.state.total <= 1) return null
456+
457+
let dots = []
458+
const ActiveDot = this.props.activeDot || <View style={[{
459+
backgroundColor: this.props.activeDotColor || '#007aff',
460+
width: 8,
461+
height: 8,
462+
borderRadius: 4,
463+
marginLeft: 3,
464+
marginRight: 3,
465+
marginTop: 3,
466+
marginBottom: 3
467+
}, this.props.activeDotStyle]} />
468+
const Dot = this.props.dot || <View style={[{
469+
backgroundColor: this.props.dotColor || 'rgba(0,0,0,.2)',
470+
width: 8,
471+
height: 8,
472+
borderRadius: 4,
473+
marginLeft: 3,
474+
marginRight: 3,
475+
marginTop: 3,
476+
marginBottom: 3
477+
}, this.props.dotStyle ]} />
478+
for (let i = 0; i < this.state.total; i++) {
479+
dots.push(i === this.state.index
480+
? React.cloneElement(ActiveDot, {key: i})
481+
: React.cloneElement(Dot, {key: i})
482+
)
483+
}
484484

485-
return (
486-
<View pointerEvents='none' style={[styles['pagination_' + this.state.dir], this.props.paginationStyle]}>
487-
{dots}
488-
</View>
489-
)
490-
}
485+
return (
486+
<View pointerEvents='none' style={[styles['pagination_' + this.state.dir], this.props.paginationStyle]}>
487+
{dots}
488+
</View>
489+
)
490+
}
491491

492492
renderTitle = () => {
493493
const child = this.props.children[this.state.index]
@@ -614,7 +614,7 @@ export default class extends Component {
614614
<View style={pageStyleLoading} key={`loading-${i}`}>
615615
{props.loadMinimalLoader ? props.loadMinimalLoader : <ActivityIndicator />}
616616
</View>
617-
);
617+
)
618618
}
619619
} else {
620620
return <View style={pageStyle} key={i}>{children[page]}</View>

yarn.lock

Lines changed: 47 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ ajv-keywords@^1.0.0:
1919
resolved "http://registry.npm.taobao.org/ajv-keywords/download/ajv-keywords-1.1.1.tgz#02550bc605a3e576041565628af972e06c549d50"
2020

2121
ajv@^4.7.0:
22-
version "4.8.2"
23-
resolved "http://registry.npm.taobao.org/ajv/download/ajv-4.8.2.tgz#65486936ca36fea39a1504332a78bebd5d447bdc"
22+
version "4.9.0"
23+
resolved "http://registry.npm.taobao.org/ajv/download/ajv-4.9.0.tgz#5a358085747b134eb567d6d15e015f1d7802f45c"
2424
dependencies:
2525
co "^4.6.0"
2626
json-stable-stringify "^1.0.1"
@@ -69,13 +69,14 @@ babel-code-frame@^6.16.0:
6969
esutils "^2.0.2"
7070
js-tokens "^2.0.0"
7171

72-
babel-eslint@^7.1.0:
73-
version "7.1.0"
74-
resolved "http://registry.npm.taobao.org/babel-eslint/download/babel-eslint-7.1.0.tgz#d506a5174ba224e25a2d17e128e2ba8987139ddc"
72+
babel-eslint@^7.1.1:
73+
version "7.1.1"
74+
resolved "http://registry.npm.taobao.org/babel-eslint/download/babel-eslint-7.1.1.tgz#8a6a884f085aa7060af69cfc77341c2f99370fb2"
7575
dependencies:
76+
babel-code-frame "^6.16.0"
7677
babel-traverse "^6.15.0"
7778
babel-types "^6.15.0"
78-
babylon "^6.11.2"
79+
babylon "^6.13.0"
7980
lodash.pickby "^4.6.0"
8081

8182
babel-messages@^6.8.0:
@@ -92,31 +93,31 @@ babel-runtime@^6.0.0, babel-runtime@^6.9.0, babel-runtime@^6.9.1:
9293
regenerator-runtime "^0.9.5"
9394

9495
babel-traverse@^6.15.0:
95-
version "6.18.0"
96-
resolved "http://registry.npm.taobao.org/babel-traverse/download/babel-traverse-6.18.0.tgz#5aeaa980baed2a07c8c47329cd90c3b90c80f05e"
96+
version "6.19.0"
97+
resolved "http://registry.npm.taobao.org/babel-traverse/download/babel-traverse-6.19.0.tgz#68363fb821e26247d52a519a84b2ceab8df4f55a"
9798
dependencies:
9899
babel-code-frame "^6.16.0"
99100
babel-messages "^6.8.0"
100101
babel-runtime "^6.9.0"
101-
babel-types "^6.18.0"
102+
babel-types "^6.19.0"
102103
babylon "^6.11.0"
103104
debug "^2.2.0"
104105
globals "^9.0.0"
105106
invariant "^2.2.0"
106107
lodash "^4.2.0"
107108

108-
babel-types@^6.15.0, babel-types@^6.18.0:
109-
version "6.18.0"
110-
resolved "http://registry.npm.taobao.org/babel-types/download/babel-types-6.18.0.tgz#1f7d5a73474c59eb9151b2417bbff4e4fce7c3f8"
109+
babel-types@^6.15.0, babel-types@^6.19.0:
110+
version "6.19.0"
111+
resolved "http://registry.npm.taobao.org/babel-types/download/babel-types-6.19.0.tgz#8db2972dbed01f1192a8b602ba1e1e4c516240b9"
111112
dependencies:
112113
babel-runtime "^6.9.1"
113114
esutils "^2.0.2"
114115
lodash "^4.2.0"
115116
to-fast-properties "^1.0.1"
116117

117-
babylon@^6.11.0, babylon@^6.11.2:
118-
version "6.13.1"
119-
resolved "http://registry.npm.taobao.org/babylon/download/babylon-6.13.1.tgz#adca350e088f0467647157652bafead6ddb8dfdb"
118+
babylon@^6.11.0, babylon@^6.13.0:
119+
version "6.14.1"
120+
resolved "http://registry.npm.taobao.org/babylon/download/babylon-6.14.1.tgz#956275fab72753ad9b3435d7afe58f8bf0a29815"
120121

121122
balanced-match@^0.4.1:
122123
version "0.4.2"
@@ -176,10 +177,8 @@ co@^4.6.0:
176177
resolved "http://registry.npm.taobao.org/co/download/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"
177178

178179
code-point-at@^1.0.0:
179-
version "1.0.1"
180-
resolved "http://registry.npm.taobao.org/code-point-at/download/code-point-at-1.0.1.tgz#1104cd34f9b5b45d3eba88f1babc1924e1ce35fb"
181-
dependencies:
182-
number-is-nan "^1.0.0"
180+
version "1.1.0"
181+
resolved "http://registry.npm.taobao.org/code-point-at/download/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
183182

184183
colors@^1.1.2:
185184
version "1.1.2"
@@ -222,10 +221,10 @@ debug-log@^1.0.0:
222221
resolved "http://registry.npm.taobao.org/debug-log/download/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f"
223222

224223
debug@^2.1.1, debug@^2.2.0:
225-
version "2.2.0"
226-
resolved "http://registry.npm.taobao.org/debug/download/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da"
224+
version "2.3.3"
225+
resolved "http://registry.npm.taobao.org/debug/download/debug-2.3.3.tgz#40c453e67e6e13c901ddec317af8986cda9eff8c"
227226
dependencies:
228-
ms "0.7.1"
227+
ms "0.7.2"
229228

230229
deep-is@~0.1.3:
231230
version "0.1.3"
@@ -335,8 +334,8 @@ [email protected]:
335334
resolved "http://registry.npm.taobao.org/eslint-config-standard/download/eslint-config-standard-6.2.1.tgz#d3a68aafc7191639e7ee441e7348739026354292"
336335

337336
eslint-plugin-promise@~3.3.0:
338-
version "3.3.0"
339-
resolved "http://registry.npm.taobao.org/eslint-plugin-promise/download/eslint-plugin-promise-3.3.0.tgz#20a1ef58b4243ffdaef82ee9360a02353a7cca89"
337+
version "3.3.2"
338+
resolved "http://registry.npm.taobao.org/eslint-plugin-promise/download/eslint-plugin-promise-3.3.2.tgz#c1169ae6487a87cdeae44f659f4cf05131b8dc66"
340339

341340
eslint-plugin-react@~6.4.1:
342341
version "6.4.1"
@@ -489,8 +488,8 @@ glob@^7.0.3, glob@^7.0.5:
489488
path-is-absolute "^1.0.0"
490489

491490
globals@^9.0.0, globals@^9.2.0:
492-
version "9.12.0"
493-
resolved "http://registry.npm.taobao.org/globals/download/globals-9.12.0.tgz#992ce90828c3a55fa8f16fada177adb64664cf9d"
491+
version "9.14.0"
492+
resolved "http://registry.npm.taobao.org/globals/download/globals-9.14.0.tgz#8859936af0038741263053b39d0e76ca241e4034"
494493

495494
globby@^5.0.0:
496495
version "5.0.0"
@@ -504,8 +503,8 @@ globby@^5.0.0:
504503
pinkie-promise "^2.0.0"
505504

506505
graceful-fs@^4.1.2:
507-
version "4.1.9"
508-
resolved "http://registry.npm.taobao.org/graceful-fs/download/graceful-fs-4.1.9.tgz#baacba37d19d11f9d146d3578bc99958c3787e29"
506+
version "4.1.10"
507+
resolved "http://registry.npm.taobao.org/graceful-fs/download/graceful-fs-4.1.10.tgz#f2d720c22092f743228775c75e3612632501f131"
509508

510509
"graceful-readlink@>= 1.0.0":
511510
version "1.0.1"
@@ -562,8 +561,8 @@ inquirer@^0.12.0:
562561
through "^2.3.6"
563562

564563
invariant@^2.2.0:
565-
version "2.2.1"
566-
resolved "http://registry.npm.taobao.org/invariant/download/invariant-2.2.1.tgz#b097010547668c7e337028ebe816ebe36c8a8d54"
564+
version "2.2.2"
565+
resolved "http://registry.npm.taobao.org/invariant/download/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360"
567566
dependencies:
568567
loose-envify "^1.0.0"
569568

@@ -621,8 +620,8 @@ js-tokens@^2.0.0:
621620
resolved "http://registry.npm.taobao.org/js-tokens/download/js-tokens-2.0.0.tgz#79903f5563ee778cc1162e6dcf1a0027c97f9cb5"
622621

623622
js-yaml@^3.5.1:
624-
version "3.6.1"
625-
resolved "http://registry.npm.taobao.org/js-yaml/download/js-yaml-3.6.1.tgz#6e5fe67d8b205ce4d22fad05b7781e8dadcc4b30"
623+
version "3.7.0"
624+
resolved "http://registry.npm.taobao.org/js-yaml/download/js-yaml-3.7.0.tgz#5c967ddd837a9bfdca5f2de84253abe8a1c03b80"
626625
dependencies:
627626
argparse "^1.0.7"
628627
esprima "^2.6.0"
@@ -642,8 +641,8 @@ jsonpointer@^4.0.0:
642641
resolved "http://registry.npm.taobao.org/jsonpointer/download/jsonpointer-4.0.0.tgz#6661e161d2fc445f19f98430231343722e1fcbd5"
643642

644643
jsx-ast-utils@^1.3.1:
645-
version "1.3.3"
646-
resolved "http://registry.npm.taobao.org/jsx-ast-utils/download/jsx-ast-utils-1.3.3.tgz#ccfdbe0320ba03f7a1fc4e67ceaf7e2cc0169721"
644+
version "1.3.4"
645+
resolved "http://registry.npm.taobao.org/jsx-ast-utils/download/jsx-ast-utils-1.3.4.tgz#0257ed1cc4b1e65b39d7d9940f9fb4f20f7ba0a9"
647646
dependencies:
648647
acorn-jsx "^3.0.1"
649648
object-assign "^4.1.0"
@@ -660,8 +659,8 @@ lodash.pickby@^4.6.0:
660659
resolved "http://registry.npm.taobao.org/lodash.pickby/download/lodash.pickby-4.6.0.tgz#7dea21d8c18d7703a27c704c15d3b84a67e33aff"
661660

662661
lodash@^4.0.0, lodash@^4.2.0, lodash@^4.3.0:
663-
version "4.16.6"
664-
resolved "http://registry.npm.taobao.org/lodash/download/lodash-4.16.6.tgz#d22c9ac660288f3843e16ba7d2b5d06cca27d777"
662+
version "4.17.2"
663+
resolved "http://registry.npm.taobao.org/lodash/download/lodash-4.17.2.tgz#34a3055babe04ce42467b607d700072c7ff6bf42"
665664

666665
loose-envify@^1.0.0:
667666
version "1.3.0"
@@ -689,9 +688,9 @@ mkdirp@^0.5.0, mkdirp@^0.5.1:
689688
dependencies:
690689
minimist "0.0.8"
691690

692-
693-
version "0.7.1"
694-
resolved "http://registry.npm.taobao.org/ms/download/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098"
691+
692+
version "0.7.2"
693+
resolved "http://registry.npm.taobao.org/ms/download/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765"
695694

696695
697696
version "0.0.5"
@@ -785,8 +784,8 @@ progress@^1.1.8:
785784
resolved "http://registry.npm.taobao.org/progress/download/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be"
786785

787786
readable-stream@^2.0.6:
788-
version "2.1.5"
789-
resolved "http://registry.npm.taobao.org/readable-stream/download/readable-stream-2.1.5.tgz#66fa8b720e1438b364681f2ad1a63c618448c9d0"
787+
version "2.2.2"
788+
resolved "http://registry.npm.taobao.org/readable-stream/download/readable-stream-2.2.2.tgz#a9e6fec3c7dda85f8bb1b3ba7028604556fc825e"
790789
dependencies:
791790
buffer-shims "^1.0.0"
792791
core-util-is "~1.0.0"
@@ -816,12 +815,12 @@ readline2@^1.0.1:
816815
mute-stream "0.0.5"
817816

818817
regenerator-runtime@^0.9.5:
819-
version "0.9.5"
820-
resolved "http://registry.npm.taobao.org/regenerator-runtime/download/regenerator-runtime-0.9.5.tgz#403d6d40a4bdff9c330dd9392dcbb2d9a8bba1fc"
818+
version "0.9.6"
819+
resolved "http://registry.npm.taobao.org/regenerator-runtime/download/regenerator-runtime-0.9.6.tgz#d33eb95d0d2001a4be39659707c51b0cb71ce029"
821820

822821
require-uncached@^1.0.2:
823-
version "1.0.2"
824-
resolved "http://registry.npm.taobao.org/require-uncached/download/require-uncached-1.0.2.tgz#67dad3b733089e77030124678a459589faf6a7ec"
822+
version "1.0.3"
823+
resolved "http://registry.npm.taobao.org/require-uncached/download/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3"
825824
dependencies:
826825
caller-path "^0.1.0"
827826
resolve-from "^1.0.0"
@@ -996,9 +995,9 @@ uniq@^1.0.1:
996995
version "1.0.1"
997996
resolved "http://registry.npm.taobao.org/uniq/download/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff"
998997

999-
updtr@^0.2.1:
1000-
version "0.2.1"
1001-
resolved "http://registry.npm.taobao.org/updtr/download/updtr-0.2.1.tgz#721558b43f3fcbdd9068ce785136e80f31941237"
998+
updtr@^0.2.3:
999+
version "0.2.3"
1000+
resolved "http://registry.npm.taobao.org/updtr/download/updtr-0.2.3.tgz#660bbc046ea6e26e3ca580b84a5d176c633e039e"
10021001
dependencies:
10031002
async "^1.4.2"
10041003
cli-spinner "^0.2.5"

0 commit comments

Comments
 (0)