@tarojs/plugin-platform-harmony-ets 4.0.0-alpha.36 → 4.0.0-alpha.37
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/dist/apis/base/weapp/life-cycle.ts +1 -1
- package/dist/apis/framework/index.ts +1 -1
- package/dist/apis/media/image/index.ts +135 -124
- package/dist/apis/route/index.ts +2 -1
- package/dist/apis/ui/background.ts +1 -1
- package/dist/apis/ui/navigation-bar/index.ts +1 -1
- package/dist/apis/ui/tab-bar.ts +2 -1
- package/dist/components-harmony-ets/button.ets +1 -1
- package/dist/components-harmony-ets/checkbox.ets +2 -1
- package/dist/components-harmony-ets/form.ets +1 -0
- package/dist/components-harmony-ets/index.ets +90 -37
- package/dist/components-harmony-ets/input.ets +2 -2
- package/dist/components-harmony-ets/label.ets +2 -1
- package/dist/components-harmony-ets/listView.ets +1 -1
- package/dist/components-harmony-ets/movableArea.ets +3 -3
- package/dist/components-harmony-ets/navigationBar.ets +1 -1
- package/dist/components-harmony-ets/pageMeta.ets +1 -1
- package/dist/components-harmony-ets/pseudo.ets +1 -1
- package/dist/components-harmony-ets/radio.ets +3 -2
- package/dist/components-harmony-ets/scrollList.ets +2 -2
- package/dist/components-harmony-ets/scrollView.ets +1 -1
- package/dist/components-harmony-ets/slider.ets +1 -1
- package/dist/components-harmony-ets/style.ets +6 -7
- package/dist/components-harmony-ets/swiper.ets +1 -1
- package/dist/components-harmony-ets/switch.ets +1 -1
- package/dist/components-harmony-ets/text.ets +2 -2
- package/dist/components-harmony-ets/utils/helper.ets +2 -2
- package/dist/components-harmony-ets/utils/styles.ets +6 -5
- package/dist/components-harmony-ets/video.ets +1 -1
- package/dist/components-harmony-ets/view.ets +2 -1
- package/dist/components-harmony-ets/webView.ets +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/runtime-ets/bom/document.ts +2 -1
- package/dist/runtime-ets/bom/getComputedStyle.ts +2 -1
- package/dist/runtime-ets/bom/navigator.ts +21 -1
- package/dist/runtime-ets/bom/raf.ts +37 -1
- package/dist/runtime-ets/bom/window.ts +5 -4
- package/dist/runtime-ets/constant.ts +10 -17
- package/dist/runtime-ets/current.ts +1 -0
- package/dist/runtime-ets/dom/document.ts +1 -1
- package/dist/runtime-ets/dom/element/canvas.ts +2 -3
- package/dist/runtime-ets/dom/element/element.ts +5 -6
- package/dist/runtime-ets/dom/element/movableView.ts +8 -12
- package/dist/runtime-ets/dom/eventTarget.ts +1 -1
- package/dist/runtime-ets/dom/node.ts +3 -2
- package/dist/runtime-ets/index.ts +7 -21
- package/dist/runtime-ets/interface/index.ts +0 -6
- package/dist/runtime-ets/utils/index.ts +6 -4
- package/dist/runtime-framework/react/app.ts +2 -1
- package/dist/runtime-framework/react/hooks.ts +1 -1
- package/dist/runtime-framework/react/native-page.ts +15 -44
- package/dist/runtime-framework/react/page.ts +2 -1
- package/dist/runtime-framework/solid/app.ts +2 -1
- package/dist/runtime-framework/solid/hooks.ts +1 -1
- package/dist/runtime-framework/solid/page.ts +2 -1
- package/dist/runtime-utils.js +166 -134
- package/dist/runtime-utils.js.map +1 -1
- package/dist/runtime.js +166 -134
- package/dist/runtime.js.map +1 -1
- package/package.json +9 -9
- package/dist/runtime-ets/bom/URL.ts +0 -2
- package/dist/runtime-ets/bom/history.ts +0 -1
- package/dist/runtime-ets/bom/location.ts +0 -1
- package/dist/runtime-ets/dom/event-source.ts +0 -1
- package/dist/runtime-ets/emitter/emitter.ts +0 -1
- package/dist/runtime-ets/env.ts +0 -1
- package/dist/runtime-ets/utils/router.ts +0 -9
|
@@ -24,4 +24,4 @@ export { Current, getCurrentInstance } from '@tarojs/runtime'
|
|
|
24
24
|
|
|
25
25
|
export const requirePlugin = temporarilyNotSupport('requirePlugin')
|
|
26
26
|
|
|
27
|
-
export { eventCenter, Events, History } from '@tarojs/runtime'
|
|
27
|
+
export { eventCenter, Events, History } from '@tarojs/runtime/dist/runtime.esm'
|
|
@@ -16,7 +16,8 @@ import { Current } from '@tarojs/runtime'
|
|
|
16
16
|
import { isNull } from '@tarojs/shared'
|
|
17
17
|
|
|
18
18
|
import { getSystemInfoSync } from '../../base'
|
|
19
|
-
import { callAsyncFail, callAsyncSuccess, temporarilyNotSupport, validateParams } from '../../utils'
|
|
19
|
+
import { callAsyncFail, callAsyncSuccess, requestPermissions, temporarilyNotSupport, validateParams } from '../../utils'
|
|
20
|
+
import { IMAGE_PERMISSION } from '../../utils/permissions'
|
|
20
21
|
|
|
21
22
|
import type Taro from '@tarojs/taro/types'
|
|
22
23
|
|
|
@@ -112,143 +113,117 @@ async function saveImage(compressedImageData, compressedImageUri) {
|
|
|
112
113
|
|
|
113
114
|
export const compressImage: typeof Taro.compressImage = function (options) {
|
|
114
115
|
return new Promise((resolve, reject) => {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
116
|
+
requestPermissions(IMAGE_PERMISSION).then(() => {
|
|
117
|
+
try {
|
|
118
|
+
validateParams('compressImage', options, compressImageSchema)
|
|
119
|
+
} catch (error) {
|
|
120
|
+
const res = { errMsg: error.message }
|
|
121
|
+
return callAsyncFail(reject, res, options)
|
|
122
|
+
}
|
|
123
|
+
const { src, quality = 80, compressedWidth, compressedHeight } = options
|
|
124
|
+
const srcAfterCompress = src.includes('_after_compress') ? src : src.split('.').join('_after_compress.')
|
|
125
|
+
const file = fs.openSync(src, fs.OpenMode.READ_ONLY)
|
|
126
|
+
|
|
127
|
+
// const stat = fs.statSync(file.fd)
|
|
128
|
+
// console.log('[Taro] 压缩前图片的大小为:', stat.size)
|
|
129
|
+
|
|
130
|
+
const source = image.createImageSource(file.fd)
|
|
131
|
+
if (isNull(source)) {
|
|
132
|
+
const createImageSourceError = { errMsg: 'compressImage fail: createImageSource has failed.' }
|
|
133
|
+
callAsyncFail(reject, createImageSourceError, options)
|
|
134
|
+
return
|
|
135
|
+
}
|
|
134
136
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
const width = source.getImageInfoSync().size.width
|
|
138
|
+
const height = source.getImageInfoSync().size.height
|
|
139
|
+
let wantWidth = compressedWidth || compressedHeight || 0
|
|
140
|
+
let wantHeight = compressedHeight || compressedWidth || 0
|
|
139
141
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
if (width > wantWidth || height > wantHeight) {
|
|
143
|
+
const heightRatio = height / wantHeight
|
|
144
|
+
const widthRatio = width / wantWidth
|
|
145
|
+
const finalRatio = heightRatio < widthRatio ? heightRatio : widthRatio
|
|
144
146
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
147
|
+
wantWidth = Math.round(width / finalRatio)
|
|
148
|
+
wantHeight = Math.round(height / finalRatio)
|
|
149
|
+
}
|
|
148
150
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
fs.closeSync(file)
|
|
157
|
-
const res = { errMsg: error }
|
|
158
|
-
callAsyncFail(reject, res, options)
|
|
159
|
-
} else {
|
|
160
|
-
const packer = image.createImagePacker(file.fd)
|
|
161
|
-
if (isNull(packer)) {
|
|
151
|
+
const decodingOptions = {
|
|
152
|
+
editable: true,
|
|
153
|
+
desiredPixelFormat: image.PixelMapFormat.RGBA_8888,
|
|
154
|
+
desiredSize: { width: wantWidth, height: wantHeight }
|
|
155
|
+
}
|
|
156
|
+
source.createPixelMap(decodingOptions, (error, pixelMap) => {
|
|
157
|
+
if (error !== undefined) {
|
|
162
158
|
fs.closeSync(file)
|
|
163
|
-
const
|
|
164
|
-
callAsyncFail(reject,
|
|
165
|
-
|
|
166
|
-
|
|
159
|
+
const res = { errMsg: error }
|
|
160
|
+
callAsyncFail(reject, res, options)
|
|
161
|
+
} else {
|
|
162
|
+
const packer = image.createImagePacker(file.fd)
|
|
163
|
+
if (isNull(packer)) {
|
|
164
|
+
fs.closeSync(file)
|
|
165
|
+
const createImagePackerError = { errMsg: 'compressImage fail: createImagePacker has failed.' }
|
|
166
|
+
callAsyncFail(reject, createImagePackerError, options)
|
|
167
|
+
return
|
|
168
|
+
}
|
|
167
169
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
170
|
+
const isPNG = src.endsWith('.png')
|
|
171
|
+
const packingOptionsOHOS: IPackingOptionOHOS = {
|
|
172
|
+
format: isPNG ? 'image/png' : 'image/jpeg',
|
|
173
|
+
quality: quality
|
|
174
|
+
}
|
|
175
|
+
packer.packing(pixelMap, packingOptionsOHOS).then((value) => {
|
|
176
|
+
fs.closeSync(file)
|
|
177
|
+
saveImage(value, srcAfterCompress).then(result => {
|
|
178
|
+
callAsyncSuccess(resolve, { tempFilePath: result.imageUri }, options)
|
|
179
|
+
})
|
|
180
|
+
}).catch((error) => {
|
|
181
|
+
fs.closeSync(file)
|
|
182
|
+
callAsyncFail(reject, error, options)
|
|
177
183
|
})
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
184
|
+
}
|
|
185
|
+
})
|
|
186
|
+
}, (error: string) => {
|
|
187
|
+
const res = { errMsg: error }
|
|
188
|
+
return callAsyncFail(reject, res, options)
|
|
183
189
|
})
|
|
184
190
|
})
|
|
185
191
|
}
|
|
186
192
|
|
|
187
193
|
export const chooseImage: typeof Taro.chooseImage = function (options) {
|
|
188
194
|
return new Promise((resolve, reject) => {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
const { count = 9 } = options
|
|
197
|
-
const photoViewPicker = new picker.PhotoViewPicker()
|
|
198
|
-
let sizeType = options.sizeType
|
|
199
|
-
|
|
200
|
-
if (!sizeType || !sizeType.length) {
|
|
201
|
-
sizeType = ['compressed', 'original']
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
photoSelectOptions.maxSelectNumber = count // 选择媒体文件的最大数目
|
|
205
|
-
photoSelectOptions.MIMEType = picker.PhotoViewMIMETypes.IMAGE_TYPE // 过滤选择媒体文件类型为IMAGE
|
|
195
|
+
requestPermissions(IMAGE_PERMISSION).then(() => {
|
|
196
|
+
try {
|
|
197
|
+
validateParams('chooseImage', options, chooseImageSchema)
|
|
198
|
+
} catch (error) {
|
|
199
|
+
const res = { errMsg: error.message }
|
|
200
|
+
return callAsyncFail(reject, res, options)
|
|
201
|
+
}
|
|
206
202
|
|
|
207
|
-
|
|
208
|
-
const
|
|
209
|
-
|
|
203
|
+
const { count = 9 } = options
|
|
204
|
+
const photoViewPicker = new picker.PhotoViewPicker()
|
|
205
|
+
let sizeType = options.sizeType
|
|
210
206
|
|
|
211
|
-
if (
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
const file = fs.openSync(uri, fs.OpenMode.READ_ONLY)
|
|
215
|
-
const stat = fs.statSync(file.fd)
|
|
216
|
-
const size = stat.size
|
|
207
|
+
if (!sizeType || !sizeType.length) {
|
|
208
|
+
sizeType = ['compressed', 'original']
|
|
209
|
+
}
|
|
217
210
|
|
|
218
|
-
|
|
219
|
-
|
|
211
|
+
photoSelectOptions.maxSelectNumber = count // 选择媒体文件的最大数目
|
|
212
|
+
photoSelectOptions.MIMEType = picker.PhotoViewMIMETypes.IMAGE_TYPE // 过滤选择媒体文件类型为IMAGE
|
|
220
213
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
}
|
|
225
|
-
})
|
|
226
|
-
|
|
227
|
-
result.tempFiles = tempFiles
|
|
228
|
-
result.tempFilePaths = tempFilePaths
|
|
229
|
-
|
|
230
|
-
callAsyncSuccess(resolve, result, options)
|
|
231
|
-
} else {
|
|
232
|
-
const actions: Promise<string>[] = photoSelectResult.photoUris.map(uri => {
|
|
233
|
-
return new Promise<string>(resolve => {
|
|
234
|
-
compressImage({
|
|
235
|
-
src: uri,
|
|
236
|
-
compressedWidth: getSystemInfoSync().screenWidth / 2,
|
|
237
|
-
compressedHeight: getSystemInfoSync().screenHeight / 2,
|
|
238
|
-
success: (compressResult) => {
|
|
239
|
-
resolve(compressResult.tempFilePath)
|
|
240
|
-
}
|
|
241
|
-
})
|
|
242
|
-
})
|
|
243
|
-
})
|
|
214
|
+
photoViewPicker.select(photoSelectOptions).then((photoSelectResult) => {
|
|
215
|
+
const result: IChooseImageData = {}
|
|
216
|
+
const isOrigin = photoSelectResult.isOriginalPhoto
|
|
244
217
|
|
|
245
|
-
|
|
246
|
-
const
|
|
218
|
+
if (isOrigin) {
|
|
219
|
+
const tempFilePaths: string[] = []
|
|
220
|
+
const tempFiles = photoSelectResult.photoUris.map(uri => {
|
|
247
221
|
const file = fs.openSync(uri, fs.OpenMode.READ_ONLY)
|
|
248
222
|
const stat = fs.statSync(file.fd)
|
|
249
|
-
const size
|
|
223
|
+
const size = stat.size
|
|
250
224
|
|
|
251
225
|
fs.closeSync(file)
|
|
226
|
+
tempFilePaths.push(uri)
|
|
252
227
|
|
|
253
228
|
return {
|
|
254
229
|
size,
|
|
@@ -256,17 +231,53 @@ export const chooseImage: typeof Taro.chooseImage = function (options) {
|
|
|
256
231
|
}
|
|
257
232
|
})
|
|
258
233
|
|
|
259
|
-
result.tempFilePaths = tempFilePaths
|
|
260
234
|
result.tempFiles = tempFiles
|
|
235
|
+
result.tempFilePaths = tempFilePaths
|
|
261
236
|
|
|
262
237
|
callAsyncSuccess(resolve, result, options)
|
|
263
|
-
}
|
|
264
|
-
const
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
238
|
+
} else {
|
|
239
|
+
const actions: Promise<string>[] = photoSelectResult.photoUris.map(uri => {
|
|
240
|
+
return new Promise<string>(resolve => {
|
|
241
|
+
compressImage({
|
|
242
|
+
src: uri,
|
|
243
|
+
compressedWidth: getSystemInfoSync().screenWidth / 2,
|
|
244
|
+
compressedHeight: getSystemInfoSync().screenHeight / 2,
|
|
245
|
+
success: (compressResult) => {
|
|
246
|
+
resolve(compressResult.tempFilePath)
|
|
247
|
+
}
|
|
248
|
+
})
|
|
249
|
+
})
|
|
250
|
+
})
|
|
251
|
+
|
|
252
|
+
Promise.all(actions).then(tempFilePaths => {
|
|
253
|
+
const tempFiles = tempFilePaths.map(uri => {
|
|
254
|
+
const file = fs.openSync(uri, fs.OpenMode.READ_ONLY)
|
|
255
|
+
const stat = fs.statSync(file.fd)
|
|
256
|
+
const size: number = stat.size
|
|
257
|
+
|
|
258
|
+
fs.closeSync(file)
|
|
259
|
+
|
|
260
|
+
return {
|
|
261
|
+
size,
|
|
262
|
+
path: uri,
|
|
263
|
+
}
|
|
264
|
+
})
|
|
265
|
+
|
|
266
|
+
result.tempFilePaths = tempFilePaths
|
|
267
|
+
result.tempFiles = tempFiles
|
|
268
|
+
|
|
269
|
+
callAsyncSuccess(resolve, result, options)
|
|
270
|
+
}).catch(error => {
|
|
271
|
+
const res = { errMsg: error }
|
|
272
|
+
return callAsyncFail(reject, res, options)
|
|
273
|
+
})
|
|
274
|
+
}
|
|
275
|
+
}).catch((error) => {
|
|
276
|
+
callAsyncFail(reject, error, options)
|
|
277
|
+
})
|
|
278
|
+
}, (error: string) => {
|
|
279
|
+
const res = { errMsg: error }
|
|
280
|
+
return callAsyncFail(reject, res, options)
|
|
270
281
|
})
|
|
271
282
|
})
|
|
272
283
|
}
|
package/dist/apis/route/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import router from '@ohos.router'
|
|
2
|
-
import {
|
|
2
|
+
import { window } from '@tarojs/runtime' // eslint-disable-line import/no-duplicates
|
|
3
|
+
import { eventCenter } from '@tarojs/runtime/dist/runtime.esm' // eslint-disable-line import/no-duplicates
|
|
3
4
|
import { queryToJson } from '@tarojs/shared'
|
|
4
5
|
|
|
5
6
|
import { callAsyncFail, callAsyncSuccess } from '../utils'
|
package/dist/apis/ui/tab-bar.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Current
|
|
1
|
+
import { Current } from '@tarojs/runtime' // eslint-disable-line import/no-duplicates
|
|
2
|
+
import { eventCenter } from '@tarojs/runtime/dist/runtime.esm' // eslint-disable-line import/no-duplicates
|
|
2
3
|
|
|
3
4
|
import { callAsyncFail, callAsyncSuccess } from '../utils'
|
|
4
5
|
|
|
@@ -4,7 +4,7 @@ import { BUTTON_THEME_COLOR } from './utils/constant/style'
|
|
|
4
4
|
import { TOUCH_EVENT_MAP } from './utils/constant/event'
|
|
5
5
|
import { shouldBindEvent, getNodeThresholds } from './utils/helper'
|
|
6
6
|
|
|
7
|
-
import type { TaroAny,
|
|
7
|
+
import type { TaroAny, TaroEvent, TaroButtonElement, TaroStyleType } from '@tarojs/runtime'
|
|
8
8
|
|
|
9
9
|
interface ButtonAttrs {
|
|
10
10
|
disabled?: boolean
|
|
@@ -4,7 +4,8 @@ import commonStyleModify, { rowModify, columnModify } from './style'
|
|
|
4
4
|
import { FlexManager } from './utils/flexManager'
|
|
5
5
|
import { shouldBindEvent, getNodeThresholds } from './utils/helper'
|
|
6
6
|
|
|
7
|
-
import type { TaroAny, TaroCheckboxElement, TaroCheckboxGroupElement
|
|
7
|
+
import type { TaroAny, TaroEvent, TaroCheckboxElement, TaroCheckboxGroupElement } from '@tarojs/runtime'
|
|
8
|
+
import { isUndefined } from '@tarojs/shared'
|
|
8
9
|
|
|
9
10
|
interface CheckboxOptions {
|
|
10
11
|
name?: string
|
|
@@ -7,6 +7,7 @@ import { FlexManager } from './utils/flexManager'
|
|
|
7
7
|
import { shouldBindEvent, getNodeThresholds } from './utils/helper'
|
|
8
8
|
|
|
9
9
|
import type { TaroAny, TaroFormElement } from '@tarojs/runtime'
|
|
10
|
+
import { isUndefined } from '@tarojs/shared'
|
|
10
11
|
|
|
11
12
|
@Component
|
|
12
13
|
export default struct TaroForm {
|
|
@@ -1,39 +1,92 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
import TaroImage, { getImageMode } from './image'
|
|
2
|
+
import TaroText from './text'
|
|
3
|
+
import TaroView from './view'
|
|
4
|
+
import TaroIcon from './icon'
|
|
5
|
+
import TaroForm from './form'
|
|
6
|
+
import TaroLabel from './label'
|
|
7
|
+
import TaroInput from './input'
|
|
8
|
+
import TaroVideo from './video'
|
|
9
|
+
import TaroCanvas from './canvas'
|
|
10
|
+
import TaroButton from './button'
|
|
11
|
+
import TaroPicker from './picker'
|
|
12
|
+
import TaroSlider from './slider'
|
|
13
|
+
import TaroSwitch from './switch'
|
|
14
|
+
import TaroSwiper from './swiper'
|
|
15
|
+
import TaroWebView from './webView'
|
|
16
|
+
import TaroTextArea from './textArea'
|
|
17
|
+
import TaroRichText from './richText'
|
|
18
|
+
import TaroProgress from './progress'
|
|
19
|
+
import TaroInnerHtml from './innerHtml'
|
|
20
|
+
import TaroScrollView from './scrollView'
|
|
21
|
+
import TaroMovableArea from './movableArea'
|
|
22
|
+
import TaroMovableView from './movableView'
|
|
23
|
+
import { TaroRadio, TaroRadioGroup } from './radio'
|
|
24
|
+
import { TaroCheckboxGroup, TaroCheckbox } from './checkbox'
|
|
25
|
+
import TaroPageMeta from './pageMeta'
|
|
26
|
+
import TaroNavigationBar from './navigationBar'
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
import TaroListView from './listView'
|
|
29
|
+
import TaroStickySection from './stickySection'
|
|
30
|
+
import TaroScrollList from './scrollList'
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
import commonStyleModify, { rowModify, columnModify, textModify, setNormalTextAttributeIntoInstance } from './style'
|
|
33
|
+
import { getButtonColor } from './button'
|
|
34
|
+
import { FlexManager } from './utils/flexManager'
|
|
35
|
+
import { DynamicCenter } from './utils/DynamicCenter'
|
|
36
|
+
import { TOUCH_EVENT_MAP } from './utils/constant/event'
|
|
37
|
+
import { BUTTON_THEME_COLOR } from './utils/constant/style'
|
|
38
|
+
import { getStyleAttr } from './utils/styles'
|
|
39
|
+
import { shouldBindEvent, getNodeThresholds, getNormalAttributes, getFontAttributes } from './utils/helper'
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
textModify,
|
|
43
|
+
getStyleAttr,
|
|
44
|
+
FlexManager,
|
|
45
|
+
DynamicCenter,
|
|
46
|
+
getButtonColor,
|
|
47
|
+
TOUCH_EVENT_MAP,
|
|
48
|
+
shouldBindEvent,
|
|
49
|
+
getFontAttributes,
|
|
50
|
+
commonStyleModify,
|
|
51
|
+
rowModify,
|
|
52
|
+
columnModify,
|
|
53
|
+
getNodeThresholds,
|
|
54
|
+
BUTTON_THEME_COLOR,
|
|
55
|
+
getNormalAttributes,
|
|
56
|
+
setNormalTextAttributeIntoInstance,
|
|
57
|
+
getImageMode,
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export {
|
|
61
|
+
TaroImage,
|
|
62
|
+
TaroCanvas,
|
|
63
|
+
TaroText,
|
|
64
|
+
TaroView,
|
|
65
|
+
TaroIcon,
|
|
66
|
+
TaroForm,
|
|
67
|
+
TaroLabel,
|
|
68
|
+
TaroInput,
|
|
69
|
+
TaroVideo,
|
|
70
|
+
TaroButton,
|
|
71
|
+
TaroPicker,
|
|
72
|
+
TaroSlider,
|
|
73
|
+
TaroSwitch,
|
|
74
|
+
TaroSwiper,
|
|
75
|
+
TaroWebView,
|
|
76
|
+
TaroTextArea,
|
|
77
|
+
TaroRichText,
|
|
78
|
+
TaroProgress,
|
|
79
|
+
TaroInnerHtml,
|
|
80
|
+
TaroScrollView,
|
|
81
|
+
TaroMovableArea,
|
|
82
|
+
TaroMovableView,
|
|
83
|
+
TaroRadio,
|
|
84
|
+
TaroRadioGroup,
|
|
85
|
+
TaroCheckboxGroup,
|
|
86
|
+
TaroCheckbox,
|
|
87
|
+
TaroPageMeta,
|
|
88
|
+
TaroNavigationBar,
|
|
89
|
+
TaroListView,
|
|
90
|
+
TaroStickySection,
|
|
91
|
+
TaroScrollList
|
|
92
|
+
}
|
|
@@ -4,7 +4,7 @@ import commonStyleModify from './style'
|
|
|
4
4
|
import { parseStyles, shouldBindEvent, getNodeThresholds, getStyleAttr } from './utils/helper'
|
|
5
5
|
import { INPUT_TYPE_MAP, INPUT_CONFIRM_MAP } from './utils/constant/style'
|
|
6
6
|
|
|
7
|
-
import type {
|
|
7
|
+
import type { TaroStyleType, TaroAny, TaroInputElement, TaroEvent } from '@tarojs/runtime'
|
|
8
8
|
|
|
9
9
|
interface InputAttrs {
|
|
10
10
|
textAlign?: TextAlign
|
|
@@ -91,7 +91,7 @@ export default struct TaroInput {
|
|
|
91
91
|
.placeholderFont(getPlaceholderFont(this.node))
|
|
92
92
|
.enterKeyType(INPUT_CONFIRM_MAP.get(this.node._attrs?.confirmType) || EnterKeyType.Done)
|
|
93
93
|
.padding(0) // Note: 移出 Input 默认 padding 设置
|
|
94
|
-
.backgroundColor(getStyleAttr(this.node, "backgroundColor"))
|
|
94
|
+
.backgroundColor(getStyleAttr(this.node, "backgroundColor"))//
|
|
95
95
|
.attributeModifier(commonStyleModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
|
|
96
96
|
.styles(this.node?.hmStyle)
|
|
97
97
|
.attrs(getAttributes(this.node))
|
|
@@ -6,7 +6,8 @@ import { TOUCH_EVENT_MAP } from './utils/constant/event'
|
|
|
6
6
|
import { FlexManager } from './utils/flexManager'
|
|
7
7
|
import { shouldBindEvent, getNodeThresholds } from './utils/helper'
|
|
8
8
|
|
|
9
|
-
import type {
|
|
9
|
+
import type { TaroLabelElement, TaroElement, TaroAny, TaroRadioElement, TaroCheckboxElement } from '@tarojs/runtime'
|
|
10
|
+
import { isUndefined } from '@tarojs/shared'
|
|
10
11
|
|
|
11
12
|
function handleTargetChange (id: string) {
|
|
12
13
|
const taro: TaroAny = Current.taro
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import type { TaroAny, TaroMovableAreaElement, TaroMovableViewElement } from '@tarojs/runtime'
|
|
1
2
|
import { isTaroMovableViewElement } from '@tarojs/runtime'
|
|
2
3
|
import commonStyleModify, { rowModify, columnModify } from './style'
|
|
3
4
|
|
|
4
5
|
import { FlexManager } from './utils/flexManager'
|
|
5
|
-
|
|
6
|
-
import type { TaroAny, TaroMovableAreaElement } from '@tarojs/runtime'
|
|
6
|
+
import { isUndefined } from '@tarojs/shared'
|
|
7
7
|
|
|
8
8
|
@Component
|
|
9
9
|
export default struct TaroMovableArea {
|
|
@@ -123,4 +123,4 @@ function sizeChangeHandle(node: TaroMovableAreaElement, newValue: Area | SizeOpt
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
})
|
|
126
|
-
}
|
|
126
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getFontAttributes } from './utils/helper'
|
|
2
2
|
import { pseudoModify } from './style'
|
|
3
3
|
|
|
4
|
-
import type {
|
|
4
|
+
import type { TaroViewElement, TaroStyleType, TaroTextStyleType, TaroAny } from '@tarojs/runtime'
|
|
5
5
|
|
|
6
6
|
@Extend(Flex)
|
|
7
7
|
function flexAttrs (style: TaroStyleType) {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { eventHandler, getComponentEventCallback, AREA_CHANGE_EVENT_NAME, VISIBLE_CHANGE_EVENT_NAME, createTaroEvent } from '@tarojs/runtime'
|
|
2
2
|
|
|
3
3
|
import commonStyleModify, { rowModify, columnModify } from './style'
|
|
4
4
|
import { TOUCH_EVENT_MAP } from './utils/constant/event'
|
|
5
5
|
import { FlexManager } from './utils/flexManager'
|
|
6
6
|
import { shouldBindEvent, getNodeThresholds } from './utils/helper'
|
|
7
7
|
|
|
8
|
-
import
|
|
8
|
+
import { TaroEvent, TaroAny, HarmonyType, TaroRadioGroupElement, TaroRadioElement } from '@tarojs/runtime'
|
|
9
|
+
import { isUndefined } from '@tarojs/shared'
|
|
9
10
|
|
|
10
11
|
interface RadioAttrs {
|
|
11
12
|
radioStyle?: HarmonyType.RadioStyle
|
|
@@ -4,7 +4,7 @@ import commonStyleModify from './style'
|
|
|
4
4
|
import { TOUCH_EVENT_MAP } from './utils/constant/event'
|
|
5
5
|
import { getNodeThresholds, shouldBindEvent } from './utils/helper'
|
|
6
6
|
|
|
7
|
-
import type { TaroAny, TaroEvent
|
|
7
|
+
import type { TaroScrollViewElement, TaroAny, TaroEvent } from '@tarojs/runtime'
|
|
8
8
|
|
|
9
9
|
interface ScrollViewAttrs {
|
|
10
10
|
scrollBar: BarState
|
|
@@ -62,7 +62,7 @@ export default struct TaroScrollList {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
handleScroll = (scrollOffset: number) => {
|
|
65
|
+
handleScroll = (scrollOffset: number) => {
|
|
66
66
|
handleScrollEvent(this.node, 'scroll', scrollOffset)
|
|
67
67
|
}
|
|
68
68
|
|
|
@@ -6,7 +6,7 @@ import { FlexManager } from './utils/flexManager'
|
|
|
6
6
|
import { TOUCH_EVENT_MAP } from './utils/constant/event'
|
|
7
7
|
import { getNodeThresholds, getStyleAttr, shouldBindEvent } from './utils/helper'
|
|
8
8
|
|
|
9
|
-
import type { TaroAny,
|
|
9
|
+
import type { TaroAny, TaroScrollViewElement, TaroEvent } from '@tarojs/runtime'
|
|
10
10
|
|
|
11
11
|
interface ScrollViewAttrs {
|
|
12
12
|
scrollBar: BarState
|