taro-ui 3.2.0-beta.2 → 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 -0
- package/package.json +19 -27
- package/rn/components/countdown/index.tsx +16 -19
- package/types/countdown.d.ts +5 -0
- package/LICENSE +0 -21
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "taro-ui",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "UI KIT for Taro",
|
|
5
5
|
"module": "dist/index.esm.js",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -29,6 +29,22 @@
|
|
|
29
29
|
"url": "git@github.com:nervjs/taro-ui.git"
|
|
30
30
|
},
|
|
31
31
|
"license": "MIT",
|
|
32
|
+
"scripts": {
|
|
33
|
+
"dev": "pnpm run dev:lib",
|
|
34
|
+
"dev:lib": "tsc --project ./tsconfig.build.json --watch --incremental",
|
|
35
|
+
"dev:rollup": "rollup --config ./config/rollup.config.js --watch",
|
|
36
|
+
"build": "pnpm run build:rollup && pnpm run build:lib",
|
|
37
|
+
"build:lib": "tsc --project ./tsconfig.build.json",
|
|
38
|
+
"build:rollup": "rollup --config ./config/rollup.config.js",
|
|
39
|
+
"lint": "eslint ./src --fix",
|
|
40
|
+
"lint:style": "stylelint \"src/**/*.scss\" --syntax scss",
|
|
41
|
+
"lint:style-fix": "stylelint \"src/**/*.scss\" --syntax scss --fix",
|
|
42
|
+
"test": "cross-env NODE_ENV=test && jest --coverage",
|
|
43
|
+
"test:ci": "pnpm run build:h5 && pnpm run test",
|
|
44
|
+
"test:analyze": "rollup --config ./config/rollup.config.analyze.js",
|
|
45
|
+
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
|
|
46
|
+
"clean": "rimraf .temp dist lib coverage"
|
|
47
|
+
},
|
|
32
48
|
"dependencies": {
|
|
33
49
|
"classnames": "^2.2.6",
|
|
34
50
|
"dayjs": "^1.7.7",
|
|
@@ -38,14 +54,6 @@
|
|
|
38
54
|
},
|
|
39
55
|
"devDependencies": {
|
|
40
56
|
"@rollup/plugin-commonjs": "^11.0.2",
|
|
41
|
-
"@tarojs/plugin-platform-alipay": "3.6.6",
|
|
42
|
-
"@tarojs/plugin-platform-h5": "3.6.6",
|
|
43
|
-
"@tarojs/plugin-platform-jd": "3.6.6",
|
|
44
|
-
"@tarojs/plugin-platform-qq": "3.6.6",
|
|
45
|
-
"@tarojs/plugin-platform-swan": "3.6.6",
|
|
46
|
-
"@tarojs/plugin-platform-tt": "3.6.6",
|
|
47
|
-
"@tarojs/plugin-platform-weapp": "3.6.6",
|
|
48
|
-
"@tarojs/taro-rn": "3.6.6",
|
|
49
57
|
"@rollup/plugin-json": "^4.0.2",
|
|
50
58
|
"@rollup/plugin-node-resolve": "^7.1.1",
|
|
51
59
|
"@tarojs/components": "3.6.6",
|
|
@@ -80,21 +88,5 @@
|
|
|
80
88
|
"@tarojs/plugin-platform-weapp": "3.6.6",
|
|
81
89
|
"@tarojs/taro-rn": "3.6.6"
|
|
82
90
|
},
|
|
83
|
-
"gitHead": "c33cc7fbb734f0dbdd6e305dda1bc8300e5adbe2"
|
|
84
|
-
|
|
85
|
-
"dev": "pnpm run dev:lib",
|
|
86
|
-
"dev:lib": "tsc --project ./tsconfig.build.json --watch --incremental",
|
|
87
|
-
"dev:rollup": "rollup --config ./config/rollup.config.js --watch",
|
|
88
|
-
"build": "pnpm run build:rollup && pnpm run build:lib",
|
|
89
|
-
"build:lib": "tsc --project ./tsconfig.build.json",
|
|
90
|
-
"build:rollup": "rollup --config ./config/rollup.config.js",
|
|
91
|
-
"lint": "eslint ./src --fix",
|
|
92
|
-
"lint:style": "stylelint \"src/**/*.scss\" --syntax scss",
|
|
93
|
-
"lint:style-fix": "stylelint \"src/**/*.scss\" --syntax scss --fix",
|
|
94
|
-
"test": "cross-env NODE_ENV=test && jest --coverage",
|
|
95
|
-
"test:ci": "pnpm run build:h5 && pnpm run test",
|
|
96
|
-
"test:analyze": "rollup --config ./config/rollup.config.analyze.js",
|
|
97
|
-
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
|
|
98
|
-
"clean": "rimraf .temp dist lib coverage"
|
|
99
|
-
}
|
|
100
|
-
}
|
|
91
|
+
"gitHead": "c33cc7fbb734f0dbdd6e305dda1bc8300e5adbe2"
|
|
92
|
+
}
|
|
@@ -64,8 +64,12 @@ export default class AtCountdown extends React.Component<
|
|
|
64
64
|
|
|
65
65
|
if (this.seconds > 0) {
|
|
66
66
|
day = this.props.isShowDay ? Math.floor(this.seconds / (60 * 60 * 24)) : 0
|
|
67
|
-
hours =
|
|
68
|
-
|
|
67
|
+
hours = this.props.isShowHour
|
|
68
|
+
? Math.floor(this.seconds / (60 * 60)) - day * 24
|
|
69
|
+
: 0
|
|
70
|
+
minutes = this.props.isShowMinute
|
|
71
|
+
? Math.floor(this.seconds / 60) - day * 24 * 60 - hours * 60
|
|
72
|
+
: 0
|
|
69
73
|
seconds =
|
|
70
74
|
Math.floor(this.seconds) -
|
|
71
75
|
day * 24 * 60 * 60 -
|
|
@@ -134,7 +138,8 @@ export default class AtCountdown extends React.Component<
|
|
|
134
138
|
format,
|
|
135
139
|
isShowDay,
|
|
136
140
|
isCard,
|
|
137
|
-
isShowHour
|
|
141
|
+
isShowHour,
|
|
142
|
+
isShowMinute
|
|
138
143
|
} = this.props
|
|
139
144
|
const { _day, _hours, _minutes, _seconds } = this.state
|
|
140
145
|
|
|
@@ -150,25 +155,15 @@ export default class AtCountdown extends React.Component<
|
|
|
150
155
|
style={customStyle}
|
|
151
156
|
>
|
|
152
157
|
{isShowDay && (
|
|
153
|
-
<AtCountdownItem
|
|
158
|
+
<AtCountdownItem num={_day} separator={format?.day || '天'} />
|
|
154
159
|
)}
|
|
155
160
|
{isShowHour && (
|
|
156
|
-
<AtCountdownItem
|
|
157
|
-
isCard={isCard}
|
|
158
|
-
num={_hours}
|
|
159
|
-
separator={format!.hours}
|
|
160
|
-
/>
|
|
161
|
+
<AtCountdownItem num={_hours} separator={format?.hours || ''} />
|
|
161
162
|
)}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
/>
|
|
167
|
-
<AtCountdownItem
|
|
168
|
-
isCard={isCard}
|
|
169
|
-
num={_seconds}
|
|
170
|
-
separator={format!.seconds}
|
|
171
|
-
/>
|
|
163
|
+
{isShowMinute && (
|
|
164
|
+
<AtCountdownItem num={_minutes} separator={format?.minutes || ''} />
|
|
165
|
+
)}
|
|
166
|
+
<AtCountdownItem num={_seconds} separator={format?.seconds || ''} />
|
|
172
167
|
</View>
|
|
173
168
|
)
|
|
174
169
|
}
|
|
@@ -180,6 +175,7 @@ AtCountdown.defaultProps = {
|
|
|
180
175
|
isCard: false,
|
|
181
176
|
isShowDay: false,
|
|
182
177
|
isShowHour: true,
|
|
178
|
+
isShowMinute: true,
|
|
183
179
|
format: {
|
|
184
180
|
day: '天',
|
|
185
181
|
hours: '时',
|
|
@@ -198,6 +194,7 @@ AtCountdown.propTypes = {
|
|
|
198
194
|
isCard: PropTypes.bool,
|
|
199
195
|
isShowDay: PropTypes.bool,
|
|
200
196
|
isShowHour: PropTypes.bool,
|
|
197
|
+
isShowMinute: PropTypes.bool,
|
|
201
198
|
format: PropTypes.object,
|
|
202
199
|
day: PropTypes.number,
|
|
203
200
|
hours: PropTypes.number,
|
package/types/countdown.d.ts
CHANGED
|
@@ -41,6 +41,11 @@ export interface AtCountDownProps extends AtComponent {
|
|
|
41
41
|
* @default true
|
|
42
42
|
*/
|
|
43
43
|
isShowHour?: boolean
|
|
44
|
+
/**
|
|
45
|
+
* 是否显示分钟
|
|
46
|
+
* @default true
|
|
47
|
+
*/
|
|
48
|
+
isShowMinute?: boolean
|
|
44
49
|
/**
|
|
45
50
|
* 格式化分割符号
|
|
46
51
|
* @default { day: '天', hours: '时', minutes: '分', seconds: '秒' }
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2018 koppt
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|