@kengic/uni 0.5.1 → 0.5.2-beta.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.
Files changed (146) hide show
  1. package/dist/uni/uni-ui/uni-badge/uni-badge.vue +222 -219
  2. package/dist/uni/uni-ui/uni-breadcrumb/uni-breadcrumb.vue +29 -29
  3. package/dist/uni/uni-ui/uni-breadcrumb-item/uni-breadcrumb-item.vue +88 -88
  4. package/dist/uni/uni-ui/uni-calendar/calendar.js +936 -532
  5. package/dist/uni/uni-ui/uni-calendar/i18n/en.json +10 -10
  6. package/dist/uni/uni-ui/uni-calendar/i18n/index.js +8 -7
  7. package/dist/uni/uni-ui/uni-calendar/i18n/zh-Hans.json +10 -10
  8. package/dist/uni/uni-ui/uni-calendar/i18n/zh-Hant.json +10 -10
  9. package/dist/uni/uni-ui/uni-calendar/uni-calendar-item.vue +190 -168
  10. package/dist/uni/uni-ui/uni-calendar/uni-calendar.vue +459 -459
  11. package/dist/uni/uni-ui/uni-calendar/util.js +324 -340
  12. package/dist/uni/uni-ui/uni-card/uni-card.vue +8 -1
  13. package/dist/uni/uni-ui/uni-col/uni-col.vue +294 -287
  14. package/dist/uni/uni-ui/uni-collapse/uni-collapse.vue +139 -140
  15. package/dist/uni/uni-ui/uni-collapse-item/uni-collapse-item.vue +381 -378
  16. package/dist/uni/uni-ui/uni-combox/uni-combox.vue +280 -272
  17. package/dist/uni/uni-ui/uni-countdown/i18n/en.json +4 -4
  18. package/dist/uni/uni-ui/uni-countdown/i18n/index.js +8 -7
  19. package/dist/uni/uni-ui/uni-countdown/i18n/zh-Hans.json +4 -4
  20. package/dist/uni/uni-ui/uni-countdown/i18n/zh-Hant.json +4 -4
  21. package/dist/uni/uni-ui/uni-countdown/uni-countdown.vue +249 -257
  22. package/dist/uni/uni-ui/uni-data-checkbox/uni-data-checkbox.vue +832 -813
  23. package/dist/uni/uni-ui/uni-data-picker/keypress.js +42 -42
  24. package/dist/uni/uni-ui/uni-data-picker/uni-data-picker.vue +535 -516
  25. package/dist/uni/uni-ui/uni-data-pickerview/uni-data-picker.js +623 -618
  26. package/dist/uni/uni-ui/uni-data-pickerview/uni-data-pickerview.vue +293 -288
  27. package/dist/uni/uni-ui/uni-data-select/uni-data-select.vue +495 -509
  28. package/dist/uni/uni-ui/uni-dateformat/date-format.js +181 -184
  29. package/dist/uni/uni-ui/uni-dateformat/uni-dateformat.vue +81 -82
  30. package/dist/uni/uni-ui/uni-datetime-picker/calendar-item.vue +176 -170
  31. package/dist/uni/uni-ui/uni-datetime-picker/calendar.vue +926 -920
  32. package/dist/uni/uni-ui/uni-datetime-picker/i18n/en.json +20 -20
  33. package/dist/uni/uni-ui/uni-datetime-picker/i18n/index.js +8 -7
  34. package/dist/uni/uni-ui/uni-datetime-picker/i18n/zh-Hans.json +21 -21
  35. package/dist/uni/uni-ui/uni-datetime-picker/i18n/zh-Hant.json +21 -21
  36. package/dist/uni/uni-ui/uni-datetime-picker/time-picker.vue +921 -926
  37. package/dist/uni/uni-ui/uni-datetime-picker/uni-datetime-picker.vue +1059 -1012
  38. package/dist/uni/uni-ui/uni-datetime-picker/util.js +366 -377
  39. package/dist/uni/uni-ui/uni-drawer/keypress.js +42 -42
  40. package/dist/uni/uni-ui/uni-drawer/uni-drawer.vue +176 -167
  41. package/dist/uni/uni-ui/uni-easyinput/common.js +40 -42
  42. package/dist/uni/uni-ui/uni-easyinput/uni-easyinput.vue +628 -547
  43. package/dist/uni/uni-ui/uni-fab/uni-fab.vue +507 -483
  44. package/dist/uni/uni-ui/uni-fav/i18n/en.json +2 -2
  45. package/dist/uni/uni-ui/uni-fav/i18n/index.js +8 -7
  46. package/dist/uni/uni-ui/uni-fav/i18n/zh-Hans.json +2 -2
  47. package/dist/uni/uni-ui/uni-fav/i18n/zh-Hant.json +2 -2
  48. package/dist/uni/uni-ui/uni-fav/uni-fav.vue +155 -147
  49. package/dist/uni/uni-ui/uni-file-picker/choose-and-upload-file.js +172 -198
  50. package/dist/uni/uni-ui/uni-file-picker/uni-file-picker.vue +636 -634
  51. package/dist/uni/uni-ui/uni-file-picker/upload-file.vue +294 -293
  52. package/dist/uni/uni-ui/uni-file-picker/upload-image.vue +267 -270
  53. package/dist/uni/uni-ui/uni-file-picker/utils.js +81 -82
  54. package/dist/uni/uni-ui/uni-forms/uni-forms.vue +360 -372
  55. package/dist/uni/uni-ui/uni-forms/utils.js +170 -174
  56. package/dist/uni/uni-ui/uni-forms/validate.js +447 -456
  57. package/dist/uni/uni-ui/uni-forms-item/uni-forms-item.vue +497 -497
  58. package/dist/uni/uni-ui/uni-goods-nav/i18n/en.json +4 -4
  59. package/dist/uni/uni-ui/uni-goods-nav/i18n/index.js +8 -7
  60. package/dist/uni/uni-ui/uni-goods-nav/i18n/zh-Hans.json +4 -4
  61. package/dist/uni/uni-ui/uni-goods-nav/i18n/zh-Hant.json +4 -4
  62. package/dist/uni/uni-ui/uni-goods-nav/uni-goods-nav.vue +238 -222
  63. package/dist/uni/uni-ui/uni-grid/uni-grid.vue +134 -134
  64. package/dist/uni/uni-ui/uni-grid-item/uni-grid-item.vue +121 -119
  65. package/dist/uni/uni-ui/uni-group/uni-group.vue +121 -121
  66. package/dist/uni/uni-ui/uni-icons/icons.js +1170 -1168
  67. package/dist/uni/uni-ui/uni-icons/uni-icons.vue +91 -86
  68. package/dist/uni/uni-ui/uni-icons/uniicons.css +166 -166
  69. package/dist/uni/uni-ui/uni-indexed-list/uni-indexed-list-item.vue +129 -129
  70. package/dist/uni/uni-ui/uni-indexed-list/uni-indexed-list.vue +352 -347
  71. package/dist/uni/uni-ui/uni-link/uni-link.vue +134 -119
  72. package/dist/uni/uni-ui/uni-list/uni-list.vue +119 -110
  73. package/dist/uni/uni-ui/uni-list/uni-refresh.vue +14 -14
  74. package/dist/uni/uni-ui/uni-list/uni-refresh.wxs +14 -14
  75. package/dist/uni/uni-ui/uni-list-ad/uni-list-ad.vue +101 -95
  76. package/dist/uni/uni-ui/uni-list-chat/uni-list-chat.scss +18 -18
  77. package/dist/uni/uni-ui/uni-list-chat/uni-list-chat.vue +602 -586
  78. package/dist/uni/uni-ui/uni-list-item/uni-list-item.vue +507 -503
  79. package/dist/uni/uni-ui/uni-load-more/i18n/en.json +3 -3
  80. package/dist/uni/uni-ui/uni-load-more/i18n/index.js +8 -7
  81. package/dist/uni/uni-ui/uni-load-more/i18n/zh-Hans.json +3 -3
  82. package/dist/uni/uni-ui/uni-load-more/i18n/zh-Hant.json +3 -3
  83. package/dist/uni/uni-ui/uni-load-more/uni-load-more.vue +402 -392
  84. package/dist/uni/uni-ui/uni-nav-bar/uni-nav-bar.vue +328 -330
  85. package/dist/uni/uni-ui/uni-nav-bar/uni-status-bar.vue +17 -17
  86. package/dist/uni/uni-ui/uni-notice-bar/uni-notice-bar.vue +422 -401
  87. package/dist/uni/uni-ui/uni-number-box/uni-number-box.vue +211 -205
  88. package/dist/uni/uni-ui/uni-pagination/i18n/en.json +3 -3
  89. package/dist/uni/uni-ui/uni-pagination/i18n/es.json +3 -3
  90. package/dist/uni/uni-ui/uni-pagination/i18n/fr.json +3 -3
  91. package/dist/uni/uni-ui/uni-pagination/i18n/index.js +12 -11
  92. package/dist/uni/uni-ui/uni-pagination/i18n/zh-Hans.json +3 -3
  93. package/dist/uni/uni-ui/uni-pagination/i18n/zh-Hant.json +3 -3
  94. package/dist/uni/uni-ui/uni-pagination/uni-pagination.vue +450 -433
  95. package/dist/uni/uni-ui/uni-popup/uni-popup.vue +404 -404
  96. package/dist/uni/uni-ui/uni-popup-dialog/keypress.js +42 -42
  97. package/dist/uni/uni-ui/uni-popup-dialog/uni-popup-dialog.vue +1 -0
  98. package/dist/uni/uni-ui/uni-popup-message/uni-popup-message.vue +126 -125
  99. package/dist/uni/uni-ui/uni-popup-share/uni-popup-share.vue +172 -172
  100. package/dist/uni/uni-ui/uni-rate/uni-rate.vue +343 -347
  101. package/dist/uni/uni-ui/uni-row/uni-row.vue +180 -182
  102. package/dist/uni/uni-ui/uni-scss/changelog.md +11 -4
  103. package/dist/uni/uni-ui/uni-scss/package.json +73 -73
  104. package/dist/uni/uni-ui/uni-scss/readme.md +2 -1
  105. package/dist/uni/uni-ui/uni-scss/styles/setting/_border.scss +2 -2
  106. package/dist/uni/uni-ui/uni-scss/styles/setting/_color.scss +46 -47
  107. package/dist/uni/uni-ui/uni-scss/styles/setting/_radius.scss +49 -49
  108. package/dist/uni/uni-ui/uni-scss/styles/setting/_space.scss +52 -53
  109. package/dist/uni/uni-ui/uni-scss/styles/setting/_styles.scss +142 -147
  110. package/dist/uni/uni-ui/uni-scss/styles/setting/_text.scss +20 -20
  111. package/dist/uni/uni-ui/uni-scss/styles/setting/_variables.scss +111 -95
  112. package/dist/uni/uni-ui/uni-scss/styles/tools/functions.scss +28 -18
  113. package/dist/uni/uni-ui/uni-scss/theme.scss +10 -7
  114. package/dist/uni/uni-ui/uni-scss/variables.scss +42 -24
  115. package/dist/uni/uni-ui/uni-search-bar/i18n/en.json +3 -3
  116. package/dist/uni/uni-ui/uni-search-bar/i18n/index.js +8 -7
  117. package/dist/uni/uni-ui/uni-search-bar/i18n/zh-Hans.json +2 -2
  118. package/dist/uni/uni-ui/uni-search-bar/i18n/zh-Hant.json +2 -2
  119. package/dist/uni/uni-ui/uni-search-bar/uni-search-bar.vue +290 -281
  120. package/dist/uni/uni-ui/uni-section/uni-section.vue +149 -146
  121. package/dist/uni/uni-ui/uni-segmented-control/uni-segmented-control.vue +141 -131
  122. package/dist/uni/uni-ui/uni-steps/uni-steps.vue +255 -236
  123. package/dist/uni/uni-ui/uni-swipe-action/uni-swipe-action.vue +51 -51
  124. package/dist/uni/uni-ui/uni-swipe-action-item/bindingx.js +276 -282
  125. package/dist/uni/uni-ui/uni-swipe-action-item/isPC.js +10 -10
  126. package/dist/uni/uni-ui/uni-swipe-action-item/mpalipay.js +182 -187
  127. package/dist/uni/uni-ui/uni-swipe-action-item/mpother.js +235 -244
  128. package/dist/uni/uni-ui/uni-swipe-action-item/mpwxs.js +70 -75
  129. package/dist/uni/uni-ui/uni-swipe-action-item/render.js +238 -247
  130. package/dist/uni/uni-ui/uni-swipe-action-item/uni-swipe-action-item.vue +387 -313
  131. package/dist/uni/uni-ui/uni-swipe-action-item/wx.wxs +206 -215
  132. package/dist/uni/uni-ui/uni-swiper-dot/uni-swiper-dot.vue +241 -197
  133. package/dist/uni/uni-ui/uni-table/uni-table.vue +445 -447
  134. package/dist/uni/uni-ui/uni-tag/uni-tag.vue +234 -244
  135. package/dist/uni/uni-ui/uni-tbody/uni-tbody.vue +20 -23
  136. package/dist/uni/uni-ui/uni-td/uni-td.vue +79 -80
  137. package/dist/uni/uni-ui/uni-th/filter-dropdown.vue +510 -503
  138. package/dist/uni/uni-ui/uni-th/uni-th.vue +289 -273
  139. package/dist/uni/uni-ui/uni-thead/uni-thead.vue +115 -114
  140. package/dist/uni/uni-ui/uni-title/uni-title.vue +151 -154
  141. package/dist/uni/uni-ui/uni-tooltip/uni-tooltip.vue +55 -60
  142. package/dist/uni/uni-ui/uni-tr/table-checkbox.vue +162 -163
  143. package/dist/uni/uni-ui/uni-tr/uni-tr.vue +158 -157
  144. package/dist/uni/uni-ui/uni-transition/createAnimation.js +130 -113
  145. package/dist/uni/uni-ui/uni-transition/uni-transition.vue +274 -272
  146. package/package.json +1 -1
@@ -4,221 +4,195 @@ const ERR_MSG_OK = 'chooseAndUploadFile:ok';
4
4
  const ERR_MSG_FAIL = 'chooseAndUploadFile:fail';
5
5
 
6
6
  function chooseImage(opts) {
7
- const {
8
- count,
9
- sizeType = ['original', 'compressed'],
10
- sourceType,
11
- extension
12
- } = opts
13
- return new Promise((resolve, reject) => {
14
- uni.chooseImage({
15
- count,
16
- sizeType,
17
- sourceType,
18
- extension,
19
- success(res) {
20
- resolve(normalizeChooseAndUploadFileRes(res, 'image'));
21
- },
22
- fail(res) {
23
- reject({
24
- errMsg: res.errMsg.replace('chooseImage:fail', ERR_MSG_FAIL),
25
- });
26
- },
27
- });
28
- });
7
+ const { count, sizeType = ['original', 'compressed'], sourceType, extension } = opts;
8
+ return new Promise((resolve, reject) => {
9
+ uni.chooseImage({
10
+ count,
11
+ sizeType,
12
+ sourceType,
13
+ extension,
14
+ success(res) {
15
+ resolve(normalizeChooseAndUploadFileRes(res, 'image'));
16
+ },
17
+ fail(res) {
18
+ reject({
19
+ errMsg: res.errMsg.replace('chooseImage:fail', ERR_MSG_FAIL),
20
+ });
21
+ },
22
+ });
23
+ });
29
24
  }
30
25
 
31
26
  function chooseVideo(opts) {
32
- const {
33
- camera,
34
- compressed,
35
- maxDuration,
36
- sourceType,
37
- extension
38
- } = opts;
39
- return new Promise((resolve, reject) => {
40
- uni.chooseVideo({
41
- camera,
42
- compressed,
43
- maxDuration,
44
- sourceType,
45
- extension,
46
- success(res) {
47
- const {
48
- tempFilePath,
49
- duration,
50
- size,
51
- height,
52
- width
53
- } = res;
54
- resolve(normalizeChooseAndUploadFileRes({
55
- errMsg: 'chooseVideo:ok',
56
- tempFilePaths: [tempFilePath],
57
- tempFiles: [
58
- {
59
- name: (res.tempFile && res.tempFile.name) || '',
60
- path: tempFilePath,
61
- size,
62
- type: (res.tempFile && res.tempFile.type) || '',
63
- width,
64
- height,
65
- duration,
66
- fileType: 'video',
67
- cloudPath: '',
68
- }, ],
69
- }, 'video'));
70
- },
71
- fail(res) {
72
- reject({
73
- errMsg: res.errMsg.replace('chooseVideo:fail', ERR_MSG_FAIL),
74
- });
75
- },
76
- });
77
- });
27
+ const { camera, compressed, maxDuration, sourceType, extension } = opts;
28
+ return new Promise((resolve, reject) => {
29
+ uni.chooseVideo({
30
+ camera,
31
+ compressed,
32
+ maxDuration,
33
+ sourceType,
34
+ extension,
35
+ success(res) {
36
+ const { tempFilePath, duration, size, height, width } = res;
37
+ resolve(
38
+ normalizeChooseAndUploadFileRes(
39
+ {
40
+ errMsg: 'chooseVideo:ok',
41
+ tempFilePaths: [tempFilePath],
42
+ tempFiles: [
43
+ {
44
+ name: (res.tempFile && res.tempFile.name) || '',
45
+ path: tempFilePath,
46
+ size,
47
+ type: (res.tempFile && res.tempFile.type) || '',
48
+ width,
49
+ height,
50
+ duration,
51
+ fileType: 'video',
52
+ cloudPath: '',
53
+ },
54
+ ],
55
+ },
56
+ 'video',
57
+ ),
58
+ );
59
+ },
60
+ fail(res) {
61
+ reject({
62
+ errMsg: res.errMsg.replace('chooseVideo:fail', ERR_MSG_FAIL),
63
+ });
64
+ },
65
+ });
66
+ });
78
67
  }
79
68
 
80
69
  function chooseAll(opts) {
81
- const {
82
- count,
83
- extension
84
- } = opts;
85
- return new Promise((resolve, reject) => {
86
- let chooseFile = uni.chooseFile;
87
- if (typeof wx !== 'undefined' &&
88
- typeof wx.chooseMessageFile === 'function') {
89
- chooseFile = wx.chooseMessageFile;
90
- }
91
- if (typeof chooseFile !== 'function') {
92
- return reject({
93
- errMsg: ERR_MSG_FAIL + ' 请指定 type 类型,该平台仅支持选择 image 或 video。',
94
- });
95
- }
96
- chooseFile({
97
- type: 'all',
98
- count,
99
- extension,
100
- success(res) {
101
- resolve(normalizeChooseAndUploadFileRes(res));
102
- },
103
- fail(res) {
104
- reject({
105
- errMsg: res.errMsg.replace('chooseFile:fail', ERR_MSG_FAIL),
106
- });
107
- },
108
- });
109
- });
70
+ const { count, extension } = opts;
71
+ return new Promise((resolve, reject) => {
72
+ let chooseFile = uni.chooseFile;
73
+ if (typeof wx !== 'undefined' && typeof wx.chooseMessageFile === 'function') {
74
+ chooseFile = wx.chooseMessageFile;
75
+ }
76
+ if (typeof chooseFile !== 'function') {
77
+ return reject({
78
+ errMsg: ERR_MSG_FAIL + ' 请指定 type 类型,该平台仅支持选择 image 或 video。',
79
+ });
80
+ }
81
+ chooseFile({
82
+ type: 'all',
83
+ count,
84
+ extension,
85
+ success(res) {
86
+ resolve(normalizeChooseAndUploadFileRes(res));
87
+ },
88
+ fail(res) {
89
+ reject({
90
+ errMsg: res.errMsg.replace('chooseFile:fail', ERR_MSG_FAIL),
91
+ });
92
+ },
93
+ });
94
+ });
110
95
  }
111
96
 
112
97
  function normalizeChooseAndUploadFileRes(res, fileType) {
113
- res.tempFiles.forEach((item, index) => {
114
- if (!item.name) {
115
- item.name = item.path.substring(item.path.lastIndexOf('/') + 1);
116
- }
117
- if (fileType) {
118
- item.fileType = fileType;
119
- }
120
- item.cloudPath =
121
- Date.now() + '_' + index + item.name.substring(item.name.lastIndexOf('.'));
122
- });
123
- if (!res.tempFilePaths) {
124
- res.tempFilePaths = res.tempFiles.map((file) => file.path);
125
- }
126
- return res;
98
+ res.tempFiles.forEach((item, index) => {
99
+ if (!item.name) {
100
+ item.name = item.path.substring(item.path.lastIndexOf('/') + 1);
101
+ }
102
+ if (fileType) {
103
+ item.fileType = fileType;
104
+ }
105
+ item.cloudPath = Date.now() + '_' + index + item.name.substring(item.name.lastIndexOf('.'));
106
+ });
107
+ if (!res.tempFilePaths) {
108
+ res.tempFilePaths = res.tempFiles.map((file) => file.path);
109
+ }
110
+ return res;
127
111
  }
128
112
 
129
113
  function uploadCloudFiles(files, max = 5, onUploadProgress) {
130
- files = JSON.parse(JSON.stringify(files))
131
- const len = files.length
132
- let count = 0
133
- let self = this
134
- return new Promise(resolve => {
135
- while (count < max) {
136
- next()
137
- }
114
+ files = JSON.parse(JSON.stringify(files));
115
+ const len = files.length;
116
+ let count = 0;
117
+ let self = this;
118
+ return new Promise((resolve) => {
119
+ while (count < max) {
120
+ next();
121
+ }
138
122
 
139
- function next() {
140
- let cur = count++
141
- if (cur >= len) {
142
- !files.find(item => !item.url && !item.errMsg) && resolve(files)
143
- return
144
- }
145
- const fileItem = files[cur]
146
- const index = self.files.findIndex(v => v.uuid === fileItem.uuid)
147
- fileItem.url = ''
148
- delete fileItem.errMsg
123
+ function next() {
124
+ let cur = count++;
125
+ if (cur >= len) {
126
+ !files.find((item) => !item.url && !item.errMsg) && resolve(files);
127
+ return;
128
+ }
129
+ const fileItem = files[cur];
130
+ const index = self.files.findIndex((v) => v.uuid === fileItem.uuid);
131
+ fileItem.url = '';
132
+ delete fileItem.errMsg;
149
133
 
150
- uniCloud
151
- .uploadFile({
152
- filePath: fileItem.path,
153
- cloudPath: fileItem.cloudPath,
154
- fileType: fileItem.fileType,
155
- onUploadProgress: res => {
156
- res.index = index
157
- onUploadProgress && onUploadProgress(res)
158
- }
159
- })
160
- .then(res => {
161
- fileItem.url = res.fileID
162
- fileItem.index = index
163
- if (cur < len) {
164
- next()
165
- }
166
- })
167
- .catch(res => {
168
- fileItem.errMsg = res.errMsg || res.message
169
- fileItem.index = index
170
- if (cur < len) {
171
- next()
172
- }
173
- })
174
- }
175
- })
134
+ uniCloud
135
+ .uploadFile({
136
+ filePath: fileItem.path,
137
+ cloudPath: fileItem.cloudPath,
138
+ fileType: fileItem.fileType,
139
+ onUploadProgress: (res) => {
140
+ res.index = index;
141
+ onUploadProgress && onUploadProgress(res);
142
+ },
143
+ })
144
+ .then((res) => {
145
+ fileItem.url = res.fileID;
146
+ fileItem.index = index;
147
+ if (cur < len) {
148
+ next();
149
+ }
150
+ })
151
+ .catch((res) => {
152
+ fileItem.errMsg = res.errMsg || res.message;
153
+ fileItem.index = index;
154
+ if (cur < len) {
155
+ next();
156
+ }
157
+ });
158
+ }
159
+ });
176
160
  }
177
161
 
178
-
179
-
180
-
181
-
182
- function uploadFiles(choosePromise, {
183
- onChooseFile,
184
- onUploadProgress
185
- }) {
186
- return choosePromise
187
- .then((res) => {
188
- if (onChooseFile) {
189
- const customChooseRes = onChooseFile(res);
190
- if (typeof customChooseRes !== 'undefined') {
191
- return Promise.resolve(customChooseRes).then((chooseRes) => typeof chooseRes === 'undefined' ?
192
- res : chooseRes);
193
- }
194
- }
195
- return res;
196
- })
197
- .then((res) => {
198
- if (res === false) {
199
- return {
200
- errMsg: ERR_MSG_OK,
201
- tempFilePaths: [],
202
- tempFiles: [],
203
- };
204
- }
205
- return res
206
- })
162
+ function uploadFiles(choosePromise, { onChooseFile, onUploadProgress }) {
163
+ return choosePromise
164
+ .then((res) => {
165
+ if (onChooseFile) {
166
+ const customChooseRes = onChooseFile(res);
167
+ if (typeof customChooseRes !== 'undefined') {
168
+ return Promise.resolve(customChooseRes).then((chooseRes) => (typeof chooseRes === 'undefined' ? res : chooseRes));
169
+ }
170
+ }
171
+ return res;
172
+ })
173
+ .then((res) => {
174
+ if (res === false) {
175
+ return {
176
+ errMsg: ERR_MSG_OK,
177
+ tempFilePaths: [],
178
+ tempFiles: [],
179
+ };
180
+ }
181
+ return res;
182
+ });
207
183
  }
208
184
 
209
- function chooseAndUploadFile(opts = {
210
- type: 'all'
211
- }) {
212
- if (opts.type === 'image') {
213
- return uploadFiles(chooseImage(opts), opts);
214
- }
215
- else if (opts.type === 'video') {
216
- return uploadFiles(chooseVideo(opts), opts);
217
- }
218
- return uploadFiles(chooseAll(opts), opts);
185
+ function chooseAndUploadFile(
186
+ opts = {
187
+ type: 'all',
188
+ },
189
+ ) {
190
+ if (opts.type === 'image') {
191
+ return uploadFiles(chooseImage(opts), opts);
192
+ } else if (opts.type === 'video') {
193
+ return uploadFiles(chooseVideo(opts), opts);
194
+ }
195
+ return uploadFiles(chooseAll(opts), opts);
219
196
  }
220
197
 
221
- export {
222
- chooseAndUploadFile,
223
- uploadCloudFiles
224
- };
198
+ export { chooseAndUploadFile, uploadCloudFiles };