taro-ui 3.2.0 → 3.2.2
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 +2 -18
- package/rn/components/countdown/index.tsx +16 -19
- package/types/countdown.d.ts +5 -0
package/dist/index.js
CHANGED
|
@@ -3764,7 +3764,7 @@ var AtNoticebar = /** @class */ (function (_super) {
|
|
|
3764
3764
|
animationData: {
|
|
3765
3765
|
actions: [{}]
|
|
3766
3766
|
},
|
|
3767
|
-
dura:
|
|
3767
|
+
dura: 0,
|
|
3768
3768
|
isWEAPP: Taro__default["default"].getEnv() === Taro__default["default"].ENV_TYPE.WEAPP,
|
|
3769
3769
|
isALIPAY: Taro__default["default"].getEnv() === Taro__default["default"].ENV_TYPE.ALIPAY,
|
|
3770
3770
|
isWEB: Taro__default["default"].getEnv() === Taro__default["default"].ENV_TYPE.WEB
|
|
@@ -3862,8 +3862,12 @@ var AtNoticebar = /** @class */ (function (_super) {
|
|
|
3862
3862
|
var innerClassName = ['at-noticebar__content-inner'];
|
|
3863
3863
|
if (marquee) {
|
|
3864
3864
|
close = false;
|
|
3865
|
-
style['animation-duration'] = "".concat(dura, "s");
|
|
3866
3865
|
innerClassName.push(animElemId);
|
|
3866
|
+
style['animation-delay'] = '3s';
|
|
3867
|
+
if (dura > 0) {
|
|
3868
|
+
style['animation-duration'] = "".concat(dura, "s");
|
|
3869
|
+
style['animation-delay'] = '1s';
|
|
3870
|
+
}
|
|
3867
3871
|
}
|
|
3868
3872
|
var classObject = {
|
|
3869
3873
|
'at-noticebar--marquee': marquee,
|
|
@@ -5579,6 +5583,12 @@ AtCountdownItem.propTypes = {
|
|
|
5579
5583
|
};
|
|
5580
5584
|
|
|
5581
5585
|
var toSeconds = function (day, hours, minutes, seconds) { return day * 60 * 60 * 24 + hours * 60 * 60 + minutes * 60 + seconds; };
|
|
5586
|
+
var defaultFormat = {
|
|
5587
|
+
day: '天',
|
|
5588
|
+
hours: '时',
|
|
5589
|
+
minutes: '分',
|
|
5590
|
+
seconds: '秒'
|
|
5591
|
+
};
|
|
5582
5592
|
var AtCountdown = /** @class */ (function (_super) {
|
|
5583
5593
|
__extends(AtCountdown, _super);
|
|
5584
5594
|
function AtCountdown(props) {
|
|
@@ -5608,8 +5618,12 @@ var AtCountdown = /** @class */ (function (_super) {
|
|
|
5608
5618
|
var _a = __read([0, 0, 0, 0], 4), day = _a[0], hours = _a[1], minutes = _a[2], seconds = _a[3];
|
|
5609
5619
|
if (this.seconds > 0) {
|
|
5610
5620
|
day = this.props.isShowDay ? Math.floor(this.seconds / (60 * 60 * 24)) : 0;
|
|
5611
|
-
hours =
|
|
5612
|
-
|
|
5621
|
+
hours = this.props.isShowHour
|
|
5622
|
+
? Math.floor(this.seconds / (60 * 60)) - day * 24
|
|
5623
|
+
: 0;
|
|
5624
|
+
minutes = this.props.isShowMinute
|
|
5625
|
+
? Math.floor(this.seconds / 60) - day * 24 * 60 - hours * 60
|
|
5626
|
+
: 0;
|
|
5613
5627
|
seconds =
|
|
5614
5628
|
Math.floor(this.seconds) -
|
|
5615
5629
|
day * 24 * 60 * 60 -
|
|
@@ -5663,12 +5677,7 @@ var AtCountdown = /** @class */ (function (_super) {
|
|
|
5663
5677
|
this.setTimer();
|
|
5664
5678
|
};
|
|
5665
5679
|
AtCountdown.prototype.render = function () {
|
|
5666
|
-
var _a = this.props, className = _a.className, customStyle = _a.customStyle, _b = _a.format, format = _b === void 0 ?
|
|
5667
|
-
day: '天',
|
|
5668
|
-
hours: '时',
|
|
5669
|
-
minutes: '分',
|
|
5670
|
-
seconds: '秒'
|
|
5671
|
-
} : _b, isShowDay = _a.isShowDay, isCard = _a.isCard, isShowHour = _a.isShowHour;
|
|
5680
|
+
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;
|
|
5672
5681
|
var _c = this.state, _day = _c._day, _hours = _c._hours, _minutes = _c._minutes, _seconds = _c._seconds;
|
|
5673
5682
|
return (React__default["default"].createElement(components.View, { className: classnames({
|
|
5674
5683
|
'at-countdown': true,
|
|
@@ -5676,7 +5685,7 @@ var AtCountdown = /** @class */ (function (_super) {
|
|
|
5676
5685
|
}, className), style: customStyle },
|
|
5677
5686
|
isShowDay && (React__default["default"].createElement(AtCountdownItem, { num: _day, separator: (format === null || format === void 0 ? void 0 : format.day) || '天' })),
|
|
5678
5687
|
isShowHour && (React__default["default"].createElement(AtCountdownItem, { num: _hours, separator: (format === null || format === void 0 ? void 0 : format.hours) || '' })),
|
|
5679
|
-
React__default["default"].createElement(AtCountdownItem, { num: _minutes, separator: (format === null || format === void 0 ? void 0 : format.minutes) || '' }),
|
|
5688
|
+
isShowMinute && (React__default["default"].createElement(AtCountdownItem, { num: _minutes, separator: (format === null || format === void 0 ? void 0 : format.minutes) || '' })),
|
|
5680
5689
|
React__default["default"].createElement(AtCountdownItem, { num: _seconds, separator: (format === null || format === void 0 ? void 0 : format.seconds) || '' })));
|
|
5681
5690
|
};
|
|
5682
5691
|
return AtCountdown;
|
|
@@ -5687,12 +5696,8 @@ AtCountdown.defaultProps = {
|
|
|
5687
5696
|
isCard: false,
|
|
5688
5697
|
isShowDay: false,
|
|
5689
5698
|
isShowHour: true,
|
|
5690
|
-
|
|
5691
|
-
|
|
5692
|
-
hours: '时',
|
|
5693
|
-
minutes: '分',
|
|
5694
|
-
seconds: '秒'
|
|
5695
|
-
},
|
|
5699
|
+
isShowMinute: true,
|
|
5700
|
+
format: defaultFormat,
|
|
5696
5701
|
day: 0,
|
|
5697
5702
|
hours: 0,
|
|
5698
5703
|
minutes: 0,
|
|
@@ -5704,6 +5709,7 @@ AtCountdown.propTypes = {
|
|
|
5704
5709
|
isCard: propTypes.bool,
|
|
5705
5710
|
isShowDay: propTypes.bool,
|
|
5706
5711
|
isShowHour: propTypes.bool,
|
|
5712
|
+
isShowMinute: propTypes.bool,
|
|
5707
5713
|
format: propTypes.object,
|
|
5708
5714
|
day: propTypes.number,
|
|
5709
5715
|
hours: propTypes.number,
|