taro-ui 3.2.0 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +85 -0
- package/dist/index.esm.js +23 -17
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +23 -17
- package/dist/index.js.map +1 -1
- package/lib/components/countdown/index.js +17 -15
- package/lib/components/countdown/index.js.map +1 -1
- package/lib/components/noticebar/index.js +6 -2
- package/lib/components/noticebar/index.js.map +1 -1
- package/lib/tsconfig.build.tsbuildinfo +1 -43215
- package/package.json +1 -9
- package/rn/components/countdown/index.tsx +16 -19
- package/types/countdown.d.ts +5 -0
package/README.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Taro UI
|
|
2
|
+
|
|
3
|
+
[![NPM][npm-version-image]][npm-version-url] [![NPM Downloads][npm-downloads-image]][npm-downloads-url] [![david-dm][david-dm-image]][david-dm-url] [![License][license-image]][license-url]
|
|
4
|
+
|
|
5
|
+
一款基于 `Taro` 框架开发的多端 UI 组件库
|
|
6
|
+
|
|
7
|
+
## 特性
|
|
8
|
+
|
|
9
|
+
- 基于 `Taro` 开发 UI 组件
|
|
10
|
+
- 一套组件可以在 `微信小程序`,`支付宝小程序`,`百度小程序`,`H5`,`ReactNative` 多端适配运行
|
|
11
|
+
- 提供友好的 API,可灵活的使用组件
|
|
12
|
+
|
|
13
|
+
## 关于 Taro
|
|
14
|
+
|
|
15
|
+
Taro 是由 [凹凸实验室](https://aotu.io) 倾力打造的多端开发解决方案。现如今市面上端的形态多种多样,Web、ReactNative、微信小程序等各种端大行其道,当业务要求同时在不同的端都要求有所表现的时候,针对不同的端去编写多套代码的成本显然非常高,这时候只编写一套代码就能够适配到多端的能力就显得极为需要。
|
|
16
|
+
|
|
17
|
+
使用 Taro,我们可以只书写一套代码,再通过 Taro 的编译工具,将源代码分别编译出可以在不同端(微信小程序、H5、RN等)运行的代码。
|
|
18
|
+
|
|
19
|
+
## 体验
|
|
20
|
+
|
|
21
|
+
请使用微信扫一扫以下体验码
|
|
22
|
+
|
|
23
|
+

|
|
24
|
+
|
|
25
|
+
## 相关链接
|
|
26
|
+
|
|
27
|
+
- [Taro UI 使用文档](https://taro-ui.taro.zone)
|
|
28
|
+
- [Taro UI 官方示例](https://github.com/NervJS/taro-ui-demo)
|
|
29
|
+
- [Taro](https://taro.jd.com/)
|
|
30
|
+
- [Taro 物料市场](https://taro-ext.jd.com)
|
|
31
|
+
- [Taro 论坛 Taro-UI 板块](https://taro-club.jd.com/category/11/taro-ui)
|
|
32
|
+
|
|
33
|
+
## 安装
|
|
34
|
+
|
|
35
|
+
### 2.x
|
|
36
|
+
当 Taro 版本 < 3 时,使用 2.x 版本
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
$ npm install taro-ui@2.3.4
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 3.x
|
|
43
|
+
当 Taro 版本 ≥ 3 时,使用 3.x 版本
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
$ npm install taro-ui@latest
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## 使用
|
|
50
|
+
|
|
51
|
+
在代码中 `import` 需要的组件并按照文档说明使用
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
import { AtButton } from 'taro-ui'
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## 开发交流
|
|
58
|
+
|
|
59
|
+
[官方微信交流群](https://github.com/NervJS/taro-ui/issues/16)
|
|
60
|
+
|
|
61
|
+
## 开发计划
|
|
62
|
+
|
|
63
|
+
[开发计划](./PLANS.md)
|
|
64
|
+
|
|
65
|
+
## 路线图
|
|
66
|
+
|
|
67
|
+
![Roadmap][roadmap-image]
|
|
68
|
+
|
|
69
|
+
## 贡献
|
|
70
|
+
|
|
71
|
+
如果你在使用 `Taro UI` 时遇到问题,或者有好的建议,欢迎给我们提 `Issue` 或 `Pull Request`。在开始之前,请阅读 [贡献指南](https://github.com/NervJS/taro-ui/blob/master/.github/CONTRIBUTING.md)
|
|
72
|
+
|
|
73
|
+
## License
|
|
74
|
+
|
|
75
|
+
MIT
|
|
76
|
+
|
|
77
|
+
[npm-version-image]: https://img.shields.io/npm/v/taro-ui.svg?style=flat-square
|
|
78
|
+
[npm-version-url]: https://www.npmjs.com/package/taro-ui
|
|
79
|
+
[npm-downloads-image]: https://img.shields.io/npm/dm/taro-ui?style=flat-square
|
|
80
|
+
[npm-downloads-url]: https://www.npmjs.com/package/taro-ui
|
|
81
|
+
[david-dm-image]: https://david-dm.org/NervJS/taro-ui.svg?style=flat-square
|
|
82
|
+
[david-dm-url]: https://david-dm.org/NervJS/taro-ui
|
|
83
|
+
[license-image]: https://img.shields.io/github/license/NervJS/taro-ui?style=flat-square
|
|
84
|
+
[license-url]: https://github.com/NervJS/taro-ui/blob/master/LICENSE
|
|
85
|
+
[roadmap-image]: ./docs/assets/taro-ui-roadmap.svg
|
package/dist/index.esm.js
CHANGED
|
@@ -3755,7 +3755,7 @@ var AtNoticebar = /** @class */ (function (_super) {
|
|
|
3755
3755
|
animationData: {
|
|
3756
3756
|
actions: [{}]
|
|
3757
3757
|
},
|
|
3758
|
-
dura:
|
|
3758
|
+
dura: 0,
|
|
3759
3759
|
isWEAPP: Taro.getEnv() === Taro.ENV_TYPE.WEAPP,
|
|
3760
3760
|
isALIPAY: Taro.getEnv() === Taro.ENV_TYPE.ALIPAY,
|
|
3761
3761
|
isWEB: Taro.getEnv() === Taro.ENV_TYPE.WEB
|
|
@@ -3853,8 +3853,12 @@ var AtNoticebar = /** @class */ (function (_super) {
|
|
|
3853
3853
|
var innerClassName = ['at-noticebar__content-inner'];
|
|
3854
3854
|
if (marquee) {
|
|
3855
3855
|
close = false;
|
|
3856
|
-
style['animation-duration'] = "".concat(dura, "s");
|
|
3857
3856
|
innerClassName.push(animElemId);
|
|
3857
|
+
style['animation-delay'] = '3s';
|
|
3858
|
+
if (dura > 0) {
|
|
3859
|
+
style['animation-duration'] = "".concat(dura, "s");
|
|
3860
|
+
style['animation-delay'] = '1s';
|
|
3861
|
+
}
|
|
3858
3862
|
}
|
|
3859
3863
|
var classObject = {
|
|
3860
3864
|
'at-noticebar--marquee': marquee,
|
|
@@ -5570,6 +5574,12 @@ AtCountdownItem.propTypes = {
|
|
|
5570
5574
|
};
|
|
5571
5575
|
|
|
5572
5576
|
var toSeconds = function (day, hours, minutes, seconds) { return day * 60 * 60 * 24 + hours * 60 * 60 + minutes * 60 + seconds; };
|
|
5577
|
+
var defaultFormat = {
|
|
5578
|
+
day: '天',
|
|
5579
|
+
hours: '时',
|
|
5580
|
+
minutes: '分',
|
|
5581
|
+
seconds: '秒'
|
|
5582
|
+
};
|
|
5573
5583
|
var AtCountdown = /** @class */ (function (_super) {
|
|
5574
5584
|
__extends(AtCountdown, _super);
|
|
5575
5585
|
function AtCountdown(props) {
|
|
@@ -5599,8 +5609,12 @@ var AtCountdown = /** @class */ (function (_super) {
|
|
|
5599
5609
|
var _a = __read([0, 0, 0, 0], 4), day = _a[0], hours = _a[1], minutes = _a[2], seconds = _a[3];
|
|
5600
5610
|
if (this.seconds > 0) {
|
|
5601
5611
|
day = this.props.isShowDay ? Math.floor(this.seconds / (60 * 60 * 24)) : 0;
|
|
5602
|
-
hours =
|
|
5603
|
-
|
|
5612
|
+
hours = this.props.isShowHour
|
|
5613
|
+
? Math.floor(this.seconds / (60 * 60)) - day * 24
|
|
5614
|
+
: 0;
|
|
5615
|
+
minutes = this.props.isShowMinute
|
|
5616
|
+
? Math.floor(this.seconds / 60) - day * 24 * 60 - hours * 60
|
|
5617
|
+
: 0;
|
|
5604
5618
|
seconds =
|
|
5605
5619
|
Math.floor(this.seconds) -
|
|
5606
5620
|
day * 24 * 60 * 60 -
|
|
@@ -5654,12 +5668,7 @@ var AtCountdown = /** @class */ (function (_super) {
|
|
|
5654
5668
|
this.setTimer();
|
|
5655
5669
|
};
|
|
5656
5670
|
AtCountdown.prototype.render = function () {
|
|
5657
|
-
var _a = this.props, className = _a.className, customStyle = _a.customStyle, _b = _a.format, format = _b === void 0 ?
|
|
5658
|
-
day: '天',
|
|
5659
|
-
hours: '时',
|
|
5660
|
-
minutes: '分',
|
|
5661
|
-
seconds: '秒'
|
|
5662
|
-
} : _b, isShowDay = _a.isShowDay, isCard = _a.isCard, isShowHour = _a.isShowHour;
|
|
5671
|
+
var _a = this.props, className = _a.className, customStyle = _a.customStyle, _b = _a.format, format = _b === void 0 ? defaultFormat : _b, isCard = _a.isCard, isShowDay = _a.isShowDay, isShowHour = _a.isShowHour, isShowMinute = _a.isShowMinute;
|
|
5663
5672
|
var _c = this.state, _day = _c._day, _hours = _c._hours, _minutes = _c._minutes, _seconds = _c._seconds;
|
|
5664
5673
|
return (React.createElement(View, { className: classnames({
|
|
5665
5674
|
'at-countdown': true,
|
|
@@ -5667,7 +5676,7 @@ var AtCountdown = /** @class */ (function (_super) {
|
|
|
5667
5676
|
}, className), style: customStyle },
|
|
5668
5677
|
isShowDay && (React.createElement(AtCountdownItem, { num: _day, separator: (format === null || format === void 0 ? void 0 : format.day) || '天' })),
|
|
5669
5678
|
isShowHour && (React.createElement(AtCountdownItem, { num: _hours, separator: (format === null || format === void 0 ? void 0 : format.hours) || '' })),
|
|
5670
|
-
React.createElement(AtCountdownItem, { num: _minutes, separator: (format === null || format === void 0 ? void 0 : format.minutes) || '' }),
|
|
5679
|
+
isShowMinute && (React.createElement(AtCountdownItem, { num: _minutes, separator: (format === null || format === void 0 ? void 0 : format.minutes) || '' })),
|
|
5671
5680
|
React.createElement(AtCountdownItem, { num: _seconds, separator: (format === null || format === void 0 ? void 0 : format.seconds) || '' })));
|
|
5672
5681
|
};
|
|
5673
5682
|
return AtCountdown;
|
|
@@ -5678,12 +5687,8 @@ AtCountdown.defaultProps = {
|
|
|
5678
5687
|
isCard: false,
|
|
5679
5688
|
isShowDay: false,
|
|
5680
5689
|
isShowHour: true,
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
hours: '时',
|
|
5684
|
-
minutes: '分',
|
|
5685
|
-
seconds: '秒'
|
|
5686
|
-
},
|
|
5690
|
+
isShowMinute: true,
|
|
5691
|
+
format: defaultFormat,
|
|
5687
5692
|
day: 0,
|
|
5688
5693
|
hours: 0,
|
|
5689
5694
|
minutes: 0,
|
|
@@ -5695,6 +5700,7 @@ AtCountdown.propTypes = {
|
|
|
5695
5700
|
isCard: propTypes.bool,
|
|
5696
5701
|
isShowDay: propTypes.bool,
|
|
5697
5702
|
isShowHour: propTypes.bool,
|
|
5703
|
+
isShowMinute: propTypes.bool,
|
|
5698
5704
|
format: propTypes.object,
|
|
5699
5705
|
day: propTypes.number,
|
|
5700
5706
|
hours: propTypes.number,
|