@tarojs/taro-h5 3.4.0-beta.3 → 3.4.0

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.
@@ -52,10 +52,10 @@ const showToast = (options = { title: '' }) => {
52
52
  options.mask = !!options.mask;
53
53
  let errMsg = '';
54
54
  if (!toast.el) {
55
- errMsg = toast.create(options, 'loading');
55
+ errMsg = toast.create(options, 'toast');
56
56
  }
57
57
  else {
58
- errMsg = toast.show(options, 'loading');
58
+ errMsg = toast.show(options, 'toast');
59
59
  }
60
60
  return handle.success({ errMsg });
61
61
  };
@@ -148,7 +148,7 @@ const showModal = async (options = {}) => {
148
148
  }
149
149
  if (options.cancelText.replace(/[\u0391-\uFFE5]/g, 'aa').length > 8) {
150
150
  return handle.fail({
151
- errMsg: 'showModal:fail cancelText length should not larger then 4 Chinese characters'
151
+ errMsg: 'cancelText length should not larger then 4 Chinese characters'
152
152
  });
153
153
  }
154
154
  if (typeof options.confirmText !== 'string') {
@@ -162,7 +162,7 @@ const showModal = async (options = {}) => {
162
162
  }
163
163
  if (options.confirmText.replace(/[\u0391-\uFFE5]/g, 'aa').length > 8) {
164
164
  return handle.fail({
165
- errMsg: 'showModal:fail confirmText length should not larger then 4 Chinese characters'
165
+ errMsg: 'confirmText length should not larger then 4 Chinese characters'
166
166
  });
167
167
  }
168
168
  if (typeof options.cancelColor !== 'string') {
@@ -219,10 +219,10 @@ const showActionSheet = async (options = { itemList: [] }) => {
219
219
  });
220
220
  }
221
221
  if (options.itemList.length < 1) {
222
- return handle.fail({ errMsg: 'showActionSheet:fail parameter error: parameter.itemList should have at least 1 item' });
222
+ return handle.fail({ errMsg: 'parameter error: parameter.itemList should have at least 1 item' });
223
223
  }
224
224
  if (options.itemList.length > 6) {
225
- return handle.fail({ errMsg: 'showActionSheet:fail parameter error: parameter.itemList should not be large than 6' });
225
+ return handle.fail({ errMsg: 'parameter error: parameter.itemList should not be large than 6' });
226
226
  }
227
227
  for (let i = 0; i < options.itemList.length; i++) {
228
228
  if (typeof options.itemList[i] !== 'string') {
@@ -11,7 +11,7 @@ export function setNavigationBarTitle(options) {
11
11
  return Promise.reject(res);
12
12
  }
13
13
  const { title, success, fail, complete } = options;
14
- const handle = new MethodHandler({ name: 'makePhoneCall', success, fail, complete });
14
+ const handle = new MethodHandler({ name: 'setNavigationBarTitle', success, fail, complete });
15
15
  if (!title || typeof title !== 'string') {
16
16
  return handle.fail({
17
17
  errMsg: getParameterError({
package/dist/index.cjs.js CHANGED
@@ -6816,7 +6816,7 @@ function setNavigationBarTitle(options) {
6816
6816
  return Promise.reject(res);
6817
6817
  }
6818
6818
  const { title, success, fail, complete } = options;
6819
- const handle = new MethodHandler({ name: 'makePhoneCall', success, fail, complete });
6819
+ const handle = new MethodHandler({ name: 'setNavigationBarTitle', success, fail, complete });
6820
6820
  if (!title || typeof title !== 'string') {
6821
6821
  return handle.fail({
6822
6822
  errMsg: getParameterError({
@@ -7903,10 +7903,10 @@ const showToast = (options = { title: '' }) => {
7903
7903
  options.mask = !!options.mask;
7904
7904
  let errMsg = '';
7905
7905
  if (!toast.el) {
7906
- errMsg = toast.create(options, 'loading');
7906
+ errMsg = toast.create(options, 'toast');
7907
7907
  }
7908
7908
  else {
7909
- errMsg = toast.show(options, 'loading');
7909
+ errMsg = toast.show(options, 'toast');
7910
7910
  }
7911
7911
  return handle.success({ errMsg });
7912
7912
  };
@@ -7999,7 +7999,7 @@ const showModal = async (options = {}) => {
7999
7999
  }
8000
8000
  if (options.cancelText.replace(/[\u0391-\uFFE5]/g, 'aa').length > 8) {
8001
8001
  return handle.fail({
8002
- errMsg: 'showModal:fail cancelText length should not larger then 4 Chinese characters'
8002
+ errMsg: 'cancelText length should not larger then 4 Chinese characters'
8003
8003
  });
8004
8004
  }
8005
8005
  if (typeof options.confirmText !== 'string') {
@@ -8013,7 +8013,7 @@ const showModal = async (options = {}) => {
8013
8013
  }
8014
8014
  if (options.confirmText.replace(/[\u0391-\uFFE5]/g, 'aa').length > 8) {
8015
8015
  return handle.fail({
8016
- errMsg: 'showModal:fail confirmText length should not larger then 4 Chinese characters'
8016
+ errMsg: 'confirmText length should not larger then 4 Chinese characters'
8017
8017
  });
8018
8018
  }
8019
8019
  if (typeof options.cancelColor !== 'string') {
@@ -8070,10 +8070,10 @@ const showActionSheet = async (options = { itemList: [] }) => {
8070
8070
  });
8071
8071
  }
8072
8072
  if (options.itemList.length < 1) {
8073
- return handle.fail({ errMsg: 'showActionSheet:fail parameter error: parameter.itemList should have at least 1 item' });
8073
+ return handle.fail({ errMsg: 'parameter error: parameter.itemList should have at least 1 item' });
8074
8074
  }
8075
8075
  if (options.itemList.length > 6) {
8076
- return handle.fail({ errMsg: 'showActionSheet:fail parameter error: parameter.itemList should not be large than 6' });
8076
+ return handle.fail({ errMsg: 'parameter error: parameter.itemList should not be large than 6' });
8077
8077
  }
8078
8078
  for (let i = 0; i < options.itemList.length; i++) {
8079
8079
  if (typeof options.itemList[i] !== 'string') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tarojs/taro-h5",
3
- "version": "3.4.0-beta.3",
3
+ "version": "3.4.0",
4
4
  "description": "Taro h5 framework",
5
5
  "main:h5": "dist/index.js",
6
6
  "main": "dist/index.cjs.js",
@@ -13,10 +13,11 @@
13
13
  "sideEffects": false,
14
14
  "scripts": {
15
15
  "test": "jest",
16
+ "test:ci": "jest -i --coverage false",
16
17
  "test:dev": "jest --watch",
17
18
  "test:coverage": "jest --coverage",
18
19
  "copy:assets": "copy src/**/*.css dist",
19
- "build": "tsc & npm run copy:assets & rollup -c",
20
+ "build": "tsc & rollup -c & npm run copy:assets",
20
21
  "dev": "tsc -w & npm run copy:assets"
21
22
  },
22
23
  "repository": {
@@ -29,14 +30,14 @@
29
30
  "author": "O2Team",
30
31
  "license": "MIT",
31
32
  "dependencies": {
32
- "@tarojs/api": "3.4.0-beta.3",
33
- "@tarojs/router": "3.4.0-beta.3",
34
- "@tarojs/runtime": "3.4.0-beta.3",
35
- "@tarojs/taro": "3.4.0-beta.3",
33
+ "@tarojs/api": "3.4.0",
34
+ "@tarojs/router": "3.4.0",
35
+ "@tarojs/runtime": "3.4.0",
36
+ "@tarojs/taro": "3.4.0",
36
37
  "base64-js": "^1.3.0",
37
38
  "jsonp-retry": "^1.0.3",
38
39
  "mobile-detect": "^1.4.2",
39
40
  "whatwg-fetch": "^3.4.0"
40
41
  },
41
- "gitHead": "2ef7e8c10c9e5784e98bb1ad3a803d5fd6a46c8b"
42
+ "gitHead": "a0e97bc937f878cc059f54748c9a3829fa3f4664"
42
43
  }
@@ -62,9 +62,9 @@ const showToast: typeof Taro.showToast = (options = { title: '' }) => {
62
62
 
63
63
  let errMsg = ''
64
64
  if (!toast.el) {
65
- errMsg = toast.create(options, 'loading')
65
+ errMsg = toast.create(options, 'toast')
66
66
  } else {
67
- errMsg = toast.show(options, 'loading')
67
+ errMsg = toast.show(options, 'toast')
68
68
  }
69
69
  return handle.success({ errMsg })
70
70
  }
@@ -167,7 +167,7 @@ const showModal: typeof Taro.showModal = async (options = {}) => {
167
167
 
168
168
  if (options.cancelText.replace(/[\u0391-\uFFE5]/g, 'aa').length > 8) {
169
169
  return handle.fail({
170
- errMsg: 'showModal:fail cancelText length should not larger then 4 Chinese characters'
170
+ errMsg: 'cancelText length should not larger then 4 Chinese characters'
171
171
  })
172
172
  }
173
173
 
@@ -183,7 +183,7 @@ const showModal: typeof Taro.showModal = async (options = {}) => {
183
183
 
184
184
  if (options.confirmText.replace(/[\u0391-\uFFE5]/g, 'aa').length > 8) {
185
185
  return handle.fail({
186
- errMsg: 'showModal:fail confirmText length should not larger then 4 Chinese characters'
186
+ errMsg: 'confirmText length should not larger then 4 Chinese characters'
187
187
  })
188
188
  }
189
189
 
@@ -246,11 +246,11 @@ const showActionSheet: typeof Taro.showActionSheet = async (options = { itemList
246
246
  }
247
247
 
248
248
  if (options.itemList.length < 1) {
249
- return handle.fail({ errMsg: 'showActionSheet:fail parameter error: parameter.itemList should have at least 1 item' })
249
+ return handle.fail({ errMsg: 'parameter error: parameter.itemList should have at least 1 item' })
250
250
  }
251
251
 
252
252
  if (options.itemList.length > 6) {
253
- return handle.fail({ errMsg: 'showActionSheet:fail parameter error: parameter.itemList should not be large than 6' })
253
+ return handle.fail({ errMsg: 'parameter error: parameter.itemList should not be large than 6' })
254
254
  }
255
255
 
256
256
  for (let i = 0; i < options.itemList.length; i++) {
@@ -16,7 +16,7 @@ export function setNavigationBarTitle (options) {
16
16
  }
17
17
 
18
18
  const { title, success, fail, complete } = options
19
- const handle = new MethodHandler({ name: 'makePhoneCall', success, fail, complete })
19
+ const handle = new MethodHandler({ name: 'setNavigationBarTitle', success, fail, complete })
20
20
 
21
21
  if (!title || typeof title !== 'string') {
22
22
  return handle.fail({
@@ -12,7 +12,7 @@ export function shouldBeObject (target: unknown) {
12
12
  }
13
13
  }
14
14
 
15
- export function findDOM (inst): TaroElement | HTMLElement | undefined {
15
+ export function findDOM (inst?): TaroElement | HTMLElement | undefined {
16
16
  const runtimeHooks = container.get<IHooks>(SERVICE_IDENTIFIER.Hooks)
17
17
 
18
18
  if (inst) {