@tarojs/plugin-platform-harmony-ets 3.7.0-alpha.27
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/LICENSE +160 -0
- package/dist/apis/apis.ts +15 -0
- package/dist/apis/base/index.ts +5 -0
- package/dist/apis/base/system.ts +77 -0
- package/dist/apis/device/accelerometer.ts +76 -0
- package/dist/apis/device/battery.ts +24 -0
- package/dist/apis/device/clipboard.ts +70 -0
- package/dist/apis/device/index.ts +9 -0
- package/dist/apis/device/keyboard.ts +62 -0
- package/dist/apis/device/memory.ts +4 -0
- package/dist/apis/device/network.ts +72 -0
- package/dist/apis/device/phone.ts +43 -0
- package/dist/apis/device/screen.ts +79 -0
- package/dist/apis/device/vibrate.ts +24 -0
- package/dist/apis/files/index.ts +135 -0
- package/dist/apis/files/manager.ts +941 -0
- package/dist/apis/framework/index.ts +32 -0
- package/dist/apis/index.ts +124 -0
- package/dist/apis/location/index.ts +133 -0
- package/dist/apis/media/common.ts +74 -0
- package/dist/apis/media/image.ts +122 -0
- package/dist/apis/media/index.ts +3 -0
- package/dist/apis/media/video.ts +86 -0
- package/dist/apis/navigate/index.ts +8 -0
- package/dist/apis/network/downloadFile.ts +113 -0
- package/dist/apis/network/index.ts +4 -0
- package/dist/apis/network/request.ts +113 -0
- package/dist/apis/network/uploadFile.ts +158 -0
- package/dist/apis/network/webSocket.ts +130 -0
- package/dist/apis/open-api/index.ts +7 -0
- package/dist/apis/open-api/user-info/index.ts +85 -0
- package/dist/apis/page/index.ts +92 -0
- package/dist/apis/route/index.ts +138 -0
- package/dist/apis/storage/index.ts +133 -0
- package/dist/apis/tabbar/index.ts +147 -0
- package/dist/apis/ui/animation.ts +222 -0
- package/dist/apis/ui/background.ts +35 -0
- package/dist/apis/ui/index.ts +14 -0
- package/dist/apis/ui/interaction/index.ts +195 -0
- package/dist/apis/ui/navigation-bar/index.ts +33 -0
- package/dist/apis/ui/pull-down-refresh.ts +41 -0
- package/dist/apis/utils/handler.ts +116 -0
- package/dist/apis/utils/index.ts +85 -0
- package/dist/apis/utils/types.ts +12 -0
- package/dist/apis/utils/validate.ts +87 -0
- package/dist/apis/wxml/IntersectionObserver.ts +119 -0
- package/dist/apis/wxml/index.ts +12 -0
- package/dist/apis/wxml/nodesRef.ts +56 -0
- package/dist/apis/wxml/selectorQuery.ts +287 -0
- package/dist/components/components-react.js +51 -0
- package/dist/components/components-react.js.map +1 -0
- package/dist/components-harmony/button/index.css +109 -0
- package/dist/components-harmony/button/index.hml +31 -0
- package/dist/components-harmony/button/index.js +105 -0
- package/dist/components-harmony/camera/index.hml +6 -0
- package/dist/components-harmony/camera/index.js +12 -0
- package/dist/components-harmony/checkbox/index.hml +11 -0
- package/dist/components-harmony/checkbox/index.js +60 -0
- package/dist/components-harmony/checkbox-group/index.hml +3 -0
- package/dist/components-harmony/checkbox-group/index.js +22 -0
- package/dist/components-harmony/cover-image/index.css +4 -0
- package/dist/components-harmony/cover-image/index.hml +9 -0
- package/dist/components-harmony/cover-image/index.js +15 -0
- package/dist/components-harmony/form/index.hml +10 -0
- package/dist/components-harmony/form/index.js +11 -0
- package/dist/components-harmony/icon/index.css +27 -0
- package/dist/components-harmony/icon/index.hml +54 -0
- package/dist/components-harmony/icon/index.js +17 -0
- package/dist/components-harmony/image/index.css +5 -0
- package/dist/components-harmony/image/index.hml +11 -0
- package/dist/components-harmony/image/index.js +28 -0
- package/dist/components-harmony/input/index.hml +21 -0
- package/dist/components-harmony/input/index.js +98 -0
- package/dist/components-harmony/label/index.hml +3 -0
- package/dist/components-harmony/label/index.js +6 -0
- package/dist/components-harmony/navbar/index.css +56 -0
- package/dist/components-harmony/navbar/index.hml +9 -0
- package/dist/components-harmony/navbar/index.js +30 -0
- package/dist/components-harmony/navigator/index.css +8 -0
- package/dist/components-harmony/navigator/index.hml +9 -0
- package/dist/components-harmony/navigator/index.js +104 -0
- package/dist/components-harmony/picker/index.hml +25 -0
- package/dist/components-harmony/picker/index.js +132 -0
- package/dist/components-harmony/picker-view/index.hml +23 -0
- package/dist/components-harmony/picker-view/index.js +161 -0
- package/dist/components-harmony/picker-view-column/index.hml +3 -0
- package/dist/components-harmony/picker-view-column/index.js +3 -0
- package/dist/components-harmony/progress/index.css +4 -0
- package/dist/components-harmony/progress/index.hml +28 -0
- package/dist/components-harmony/progress/index.js +23 -0
- package/dist/components-harmony/radio/index.hml +11 -0
- package/dist/components-harmony/radio/index.js +41 -0
- package/dist/components-harmony/radio-group/index.hml +3 -0
- package/dist/components-harmony/radio-group/index.js +11 -0
- package/dist/components-harmony/rich-text/index.hml +5 -0
- package/dist/components-harmony/rich-text/index.js +16 -0
- package/dist/components-harmony/scroll-view/index.css +5 -0
- package/dist/components-harmony/scroll-view/index.hml +12 -0
- package/dist/components-harmony/scroll-view/index.js +65 -0
- package/dist/components-harmony/slider/index.hml +16 -0
- package/dist/components-harmony/slider/index.js +53 -0
- package/dist/components-harmony/swiper/index.css +3 -0
- package/dist/components-harmony/swiper/index.hml +14 -0
- package/dist/components-harmony/swiper/index.js +19 -0
- package/dist/components-harmony/switch/index.hml +7 -0
- package/dist/components-harmony/switch/index.js +16 -0
- package/dist/components-harmony/tabbar/index.css +7 -0
- package/dist/components-harmony/tabbar/index.hml +26 -0
- package/dist/components-harmony/tabbar/index.js +42 -0
- package/dist/components-harmony/textarea/index.hml +24 -0
- package/dist/components-harmony/textarea/index.js +92 -0
- package/dist/components-harmony/utils/index.js +41 -0
- package/dist/components-harmony/video/index.hml +7 -0
- package/dist/components-harmony/video/index.js +73 -0
- package/dist/components-harmony/web-view/index.hml +8 -0
- package/dist/components-harmony/web-view/index.js +22 -0
- package/dist/components-harmony-ets/base.ets +63 -0
- package/dist/components-harmony-ets/button.ets +119 -0
- package/dist/components-harmony-ets/checkbox.ets +219 -0
- package/dist/components-harmony-ets/element.ets +223 -0
- package/dist/components-harmony-ets/form.ets +149 -0
- package/dist/components-harmony-ets/icon.ets +84 -0
- package/dist/components-harmony-ets/image.ets +85 -0
- package/dist/components-harmony-ets/index.ts +49 -0
- package/dist/components-harmony-ets/innerHtml.ets +79 -0
- package/dist/components-harmony-ets/input.ets +195 -0
- package/dist/components-harmony-ets/label.ets +111 -0
- package/dist/components-harmony-ets/picker.ets +370 -0
- package/dist/components-harmony-ets/radio.ets +225 -0
- package/dist/components-harmony-ets/richText.ets +97 -0
- package/dist/components-harmony-ets/scrollView.ets +199 -0
- package/dist/components-harmony-ets/slider.ets +159 -0
- package/dist/components-harmony-ets/swiper.ets +204 -0
- package/dist/components-harmony-ets/switch.ets +113 -0
- package/dist/components-harmony-ets/text.ets +97 -0
- package/dist/components-harmony-ets/textArea.ets +169 -0
- package/dist/components-harmony-ets/utils/AttributeManager.ets +250 -0
- package/dist/components-harmony-ets/utils/DynamicCenter.ts +48 -0
- package/dist/components-harmony-ets/utils/constant/event.ets +25 -0
- package/dist/components-harmony-ets/utils/constant/icon.ts +19 -0
- package/dist/components-harmony-ets/utils/constant/style.ets +88 -0
- package/dist/components-harmony-ets/utils/events.ts +24 -0
- package/dist/components-harmony-ets/utils/flexManager.ets +107 -0
- package/dist/components-harmony-ets/utils/helper.ets +99 -0
- package/dist/components-harmony-ets/utils/htmlParser/HarmonyHTMLParser.ts +103 -0
- package/dist/components-harmony-ets/utils/htmlParser/index.ts +56 -0
- package/dist/components-harmony-ets/utils/index.ts +83 -0
- package/dist/components-harmony-ets/utils/styles.ets +91 -0
- package/dist/components-harmony-ets/video.ets +161 -0
- package/dist/components-harmony-ets/view.ets +79 -0
- package/dist/index.js +1183 -0
- package/dist/index.js.map +1 -0
- package/dist/runtime-ets/bom/document.ts +38 -0
- package/dist/runtime-ets/bom/getComputedStyle.ts +5 -0
- package/dist/runtime-ets/bom/navigator.ts +21 -0
- package/dist/runtime-ets/bom/raf.ts +37 -0
- package/dist/runtime-ets/bom/window.ts +44 -0
- package/dist/runtime-ets/constant.ts +29 -0
- package/dist/runtime-ets/current.ts +16 -0
- package/dist/runtime-ets/dom/class-list.ts +117 -0
- package/dist/runtime-ets/dom/comment.ts +10 -0
- package/dist/runtime-ets/dom/cssStyleDeclaration.ts +105 -0
- package/dist/runtime-ets/dom/document.ts +108 -0
- package/dist/runtime-ets/dom/element.ts +457 -0
- package/dist/runtime-ets/dom/event.ts +164 -0
- package/dist/runtime-ets/dom/eventTarget.ts +98 -0
- package/dist/runtime-ets/dom/node.ts +215 -0
- package/dist/runtime-ets/dom/stylesheet/index.ts +687 -0
- package/dist/runtime-ets/dom/stylesheet/type.ts +136 -0
- package/dist/runtime-ets/dom/stylesheet/util.ts +134 -0
- package/dist/runtime-ets/dom/text.ts +19 -0
- package/dist/runtime-ets/index.ts +19 -0
- package/dist/runtime-ets/interface/event.ts +9 -0
- package/dist/runtime-ets/interface/index.ts +1 -0
- package/dist/runtime-ets/utils/bind.ts +35 -0
- package/dist/runtime-ets/utils/index.ts +135 -0
- package/dist/runtime-ets/utils/info.ts +128 -0
- package/dist/runtime-framework/react/app.ts +256 -0
- package/dist/runtime-framework/react/connect.ts +24 -0
- package/dist/runtime-framework/react/constant.ts +5 -0
- package/dist/runtime-framework/react/hooks.ts +101 -0
- package/dist/runtime-framework/react/index.ts +16 -0
- package/dist/runtime-framework/react/page.ts +263 -0
- package/dist/runtime-framework/react/utils/index.ts +25 -0
- package/dist/runtime-framework/react/utils/is.ts +46 -0
- package/dist/runtime-framework/solid/README.md +99 -0
- package/dist/runtime-framework/solid/app.ts +200 -0
- package/dist/runtime-framework/solid/connect.ts +11 -0
- package/dist/runtime-framework/solid/contant.ts +5 -0
- package/dist/runtime-framework/solid/hooks.ts +88 -0
- package/dist/runtime-framework/solid/index.ts +10 -0
- package/dist/runtime-framework/solid/page.ts +202 -0
- package/dist/runtime-framework/solid/reconciler/h.ts +132 -0
- package/dist/runtime-framework/solid/reconciler/index.ts +3 -0
- package/dist/runtime-framework/solid/reconciler/props.ts +151 -0
- package/dist/runtime-framework/solid/reconciler/render.ts +61 -0
- package/dist/runtime-framework/solid/reconciler/use.ts +8 -0
- package/dist/runtime-framework/solid/utils/index.ts +49 -0
- package/dist/runtime-framework/solid/utils/is.ts +46 -0
- package/dist/runtime-utils.js +4149 -0
- package/dist/runtime-utils.js.map +1 -0
- package/dist/runtime.js +4150 -0
- package/dist/runtime.js.map +1 -0
- package/dist/template/container.js +7 -0
- package/index.js +4 -0
- package/package.json +54 -0
- package/types/api.d.ts +4 -0
- package/types/component.d.ts +4 -0
- package/types/harmony.d.ts +11 -0
- package/types/runtime.d.ts +15 -0
- package/types/taro.d.ts +7 -0
- package/types/webpack-sources.d.ts +108 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<div class="progress">
|
|
2
|
+
<div
|
|
3
|
+
if="{{showInfo && type == 'horizontal'}}"
|
|
4
|
+
class="progress-horizontal-showInfo"
|
|
5
|
+
style="min-height: {{fontSize}}px;"
|
|
6
|
+
>
|
|
7
|
+
<progress
|
|
8
|
+
style="color: {{progressColor}};background-color:{{progressBgColor}};stroke-width:{{strokeWidth}}"
|
|
9
|
+
type="{{type}}"
|
|
10
|
+
percent="{{percent}}"
|
|
11
|
+
secondarypercent="{{secondarypercent}}"
|
|
12
|
+
clockwise="{{clockwise}}"
|
|
13
|
+
>
|
|
14
|
+
</progress>
|
|
15
|
+
<text
|
|
16
|
+
style="font-size: {{fontSize}};width: 80px; text-align: center;"
|
|
17
|
+
>{{percent}}%</text>
|
|
18
|
+
</div>
|
|
19
|
+
<progress
|
|
20
|
+
else
|
|
21
|
+
style="color: {{progressColor}};background-color:{{progressBgColor}};stroke-width:{{strokeWidth}}"
|
|
22
|
+
type="{{type}}"
|
|
23
|
+
percent="{{percent}}"
|
|
24
|
+
secondarypercent="{{secondarypercent}}"
|
|
25
|
+
clockwise="{{clockwise}}"
|
|
26
|
+
>
|
|
27
|
+
</progress>
|
|
28
|
+
</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { covertHex3ToHex6 } from '../utils'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
props: [
|
|
5
|
+
'type',
|
|
6
|
+
'percent',
|
|
7
|
+
'secondarypercent',
|
|
8
|
+
'clockwise',
|
|
9
|
+
'showInfo',
|
|
10
|
+
'fontSize',
|
|
11
|
+
'strokeWidth',
|
|
12
|
+
'activeColor',
|
|
13
|
+
'backgroundColor'
|
|
14
|
+
],
|
|
15
|
+
computed: {
|
|
16
|
+
progressColor () {
|
|
17
|
+
return covertHex3ToHex6(this.activeColor)
|
|
18
|
+
},
|
|
19
|
+
progressBgColor () {
|
|
20
|
+
return covertHex3ToHex6(this.backgroundColor)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
props: [
|
|
3
|
+
'id',
|
|
4
|
+
'name',
|
|
5
|
+
'groupId',
|
|
6
|
+
'value',
|
|
7
|
+
'checked',
|
|
8
|
+
'disabled'
|
|
9
|
+
],
|
|
10
|
+
|
|
11
|
+
computed: {
|
|
12
|
+
nameValue () {
|
|
13
|
+
let name = this.name
|
|
14
|
+
if (this.groupId) {
|
|
15
|
+
name = this.groupId
|
|
16
|
+
}
|
|
17
|
+
return name
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
onChange (e) {
|
|
22
|
+
if (e.checked) {
|
|
23
|
+
const radioGroup = this.findRadioGroup()
|
|
24
|
+
if (radioGroup && radioGroup.onChange) {
|
|
25
|
+
radioGroup.onChange({ id: this.id, value: e.value })
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
findRadioGroup () {
|
|
31
|
+
let parent = this.$parent()
|
|
32
|
+
while (parent) {
|
|
33
|
+
if (!parent.$child) break
|
|
34
|
+
const radioGroup = parent.$child(this.groupId)
|
|
35
|
+
if (radioGroup) {
|
|
36
|
+
return radioGroup
|
|
37
|
+
}
|
|
38
|
+
parent = parent.$parent()
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
props: {
|
|
3
|
+
id: String,
|
|
4
|
+
cls: String,
|
|
5
|
+
nodes: String || Array
|
|
6
|
+
},
|
|
7
|
+
computed: {
|
|
8
|
+
nodeData () {
|
|
9
|
+
if (this.nodes && Array.isArray(this.nodes)) {
|
|
10
|
+
console.error('暂不支持节点列表参数')
|
|
11
|
+
return ''
|
|
12
|
+
}
|
|
13
|
+
return this.nodes
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { createOption } from '../utils'
|
|
2
|
+
|
|
3
|
+
export default createOption({
|
|
4
|
+
props: {
|
|
5
|
+
id: String,
|
|
6
|
+
scrollX: {
|
|
7
|
+
default: false
|
|
8
|
+
},
|
|
9
|
+
scrollY: {
|
|
10
|
+
default: false
|
|
11
|
+
},
|
|
12
|
+
scrollTop: Number,
|
|
13
|
+
scrollLeft: Number,
|
|
14
|
+
scrollWithAnimation: {
|
|
15
|
+
default: false
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
computed: {
|
|
19
|
+
flexDirection () {
|
|
20
|
+
return this.scrollX ? 'row' : (this.scrollY && 'column')
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
onInit () {
|
|
24
|
+
this.$watch('scrollTop', 'onScrollTopChange')
|
|
25
|
+
this.$watch('scrollLeft', 'onScrollLeftChange')
|
|
26
|
+
},
|
|
27
|
+
onScrollTopChange (newVal) {
|
|
28
|
+
this.scrollTo('y', newVal)
|
|
29
|
+
},
|
|
30
|
+
onScrollLeftChange (newVal) {
|
|
31
|
+
this.scrollTo('x', newVal)
|
|
32
|
+
},
|
|
33
|
+
scrollTo (direction, offset) {
|
|
34
|
+
const el = this.$refs.el
|
|
35
|
+
const options = {
|
|
36
|
+
smooth: this.scrollWithAnimation
|
|
37
|
+
}
|
|
38
|
+
options['d' + direction] = offset - el.getScrollOffset()[direction]
|
|
39
|
+
el.scrollBy(options)
|
|
40
|
+
},
|
|
41
|
+
onReachStart () {
|
|
42
|
+
this.triggerScrollToUpper('left')
|
|
43
|
+
},
|
|
44
|
+
onReachEnd () {
|
|
45
|
+
this.triggerScrollToLower('right')
|
|
46
|
+
},
|
|
47
|
+
onReachTop () {
|
|
48
|
+
this.triggerScrollToUpper('top')
|
|
49
|
+
},
|
|
50
|
+
onReachBottom () {
|
|
51
|
+
this.triggerScrollToLower('bottom')
|
|
52
|
+
},
|
|
53
|
+
triggerScrollToUpper (direction) {
|
|
54
|
+
this.$trigger('scrolltoupper', {
|
|
55
|
+
type: 'scrolltoupper',
|
|
56
|
+
detail: { direction }
|
|
57
|
+
})
|
|
58
|
+
},
|
|
59
|
+
triggerScrollToLower (direction) {
|
|
60
|
+
this.$trigger('scrolltolower', {
|
|
61
|
+
type: 'scrolltolower',
|
|
62
|
+
detail: { direction }
|
|
63
|
+
})
|
|
64
|
+
}
|
|
65
|
+
})
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<div>
|
|
2
|
+
<slider
|
|
3
|
+
id="{{id}}"
|
|
4
|
+
style="color: {{color}};selected-color: {{selectedColor}};block-color: {{sliderBlockColor}}"
|
|
5
|
+
min="{{min}}"
|
|
6
|
+
max="{{max}}"
|
|
7
|
+
step="{{step}}"
|
|
8
|
+
disabled="{{disabled}}"
|
|
9
|
+
value="{{value}}"
|
|
10
|
+
showsteps="{{showsteps}}"
|
|
11
|
+
showtips="{{showtips}}"
|
|
12
|
+
onchange="onChange"
|
|
13
|
+
></slider>
|
|
14
|
+
<text if="{{showValue}}" style="width: {{valueWidth}}; font-size: 14vp; color: gray">{{currentValue}}</text>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { covertHex3ToHex6, createOption } from '../utils'
|
|
2
|
+
|
|
3
|
+
export default createOption({
|
|
4
|
+
props: [
|
|
5
|
+
'id',
|
|
6
|
+
'min',
|
|
7
|
+
'max',
|
|
8
|
+
'step',
|
|
9
|
+
'disabled',
|
|
10
|
+
'value',
|
|
11
|
+
'backgroundcolor',
|
|
12
|
+
'activecolor',
|
|
13
|
+
'blockColor',
|
|
14
|
+
'showValue',
|
|
15
|
+
'showsteps',
|
|
16
|
+
'showtips'
|
|
17
|
+
// 命名规则不一致因为 internalComponents 中有些使用驼峰,有些是短线,和其保持一致
|
|
18
|
+
],
|
|
19
|
+
computed: {
|
|
20
|
+
color () {
|
|
21
|
+
return covertHex3ToHex6(this.backgroundcolor)
|
|
22
|
+
},
|
|
23
|
+
selectedColor () {
|
|
24
|
+
return covertHex3ToHex6(this.activecolor)
|
|
25
|
+
},
|
|
26
|
+
sliderBlockColor () {
|
|
27
|
+
return covertHex3ToHex6(this.blockColor)
|
|
28
|
+
},
|
|
29
|
+
valueWidth () {
|
|
30
|
+
if (!this.showValue) {
|
|
31
|
+
return '0px'
|
|
32
|
+
}
|
|
33
|
+
let baseWidth = 28
|
|
34
|
+
const maxLen = Math.max(this.min.toString()?.length, this.max.toString()?.length, this.step.toString()?.length)
|
|
35
|
+
if (maxLen > 3) {
|
|
36
|
+
baseWidth = baseWidth + (maxLen - 3) * 15
|
|
37
|
+
}
|
|
38
|
+
return baseWidth + 'vp'
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
data () {
|
|
42
|
+
return {
|
|
43
|
+
currentValue: this.value || 0
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
onChange (e) {
|
|
47
|
+
if (e.isEnd === 'true') {
|
|
48
|
+
this.$trigger('change', { progress: e.progress, isEnd: e.isEnd, value: e.value })
|
|
49
|
+
}
|
|
50
|
+
this.$trigger('changing', { progress: e.progress, isEnd: e.isEnd, value: e.value })
|
|
51
|
+
this.currentValue = e.value
|
|
52
|
+
}
|
|
53
|
+
})
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<swiper
|
|
2
|
+
style="indicator-color: {{indicatorColor}};indicator-selected-color: {{indicatorActiveColor}}"
|
|
3
|
+
id="{{id}}"
|
|
4
|
+
index="{{current}}"
|
|
5
|
+
autoplay="{{autoplay}}"
|
|
6
|
+
interval="{{interval}}"
|
|
7
|
+
indicator="{{indicatorDots}}"
|
|
8
|
+
duration="{{duration}}"
|
|
9
|
+
loop="{{circular}}"
|
|
10
|
+
vertical="{{vertical}}"
|
|
11
|
+
@change="onChange"
|
|
12
|
+
>
|
|
13
|
+
<slot></slot>
|
|
14
|
+
</swiper>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createOption } from '../utils'
|
|
2
|
+
|
|
3
|
+
export default createOption({
|
|
4
|
+
props: [
|
|
5
|
+
'id',
|
|
6
|
+
'indicatorDots',
|
|
7
|
+
'indicatorColor',
|
|
8
|
+
'indicatorActiveColor',
|
|
9
|
+
'autoplay',
|
|
10
|
+
'current',
|
|
11
|
+
'interval',
|
|
12
|
+
'duration',
|
|
13
|
+
'circular',
|
|
14
|
+
'vertical'
|
|
15
|
+
],
|
|
16
|
+
onChange (e) {
|
|
17
|
+
this.$trigger('change', { current: e.index })
|
|
18
|
+
}
|
|
19
|
+
})
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<div class="switch">
|
|
2
|
+
<input if="{{type === 'checkbox'}}" id="{{id}}" type="checkbox" checked="{{checked}}"
|
|
3
|
+
disabled="{{disabled}}" @change="onChange"></input>
|
|
4
|
+
<switch else id="{{id}}" checked="{{checked}}" disabled="{{disabled}}" showtext="{{showtext}}"
|
|
5
|
+
texton="{{texton}}" textoff="{{textoff}}" @change="onChange">
|
|
6
|
+
</switch>
|
|
7
|
+
</div>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createOption } from '../utils'
|
|
2
|
+
|
|
3
|
+
export default createOption({
|
|
4
|
+
props: [
|
|
5
|
+
'id',
|
|
6
|
+
'type',
|
|
7
|
+
'checked',
|
|
8
|
+
'disabled',
|
|
9
|
+
'showtext',
|
|
10
|
+
'texton',
|
|
11
|
+
'textoff'
|
|
12
|
+
],
|
|
13
|
+
onChange (e) {
|
|
14
|
+
this.$trigger('change', { value: e.checked })
|
|
15
|
+
}
|
|
16
|
+
})
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<toolbar style="border-color: {{borderStyle}};background-color: {{backgroundColor}};">
|
|
2
|
+
<block
|
|
3
|
+
for="{{tabbarData.list}}"
|
|
4
|
+
tid="pagePath"
|
|
5
|
+
>
|
|
6
|
+
<!--
|
|
7
|
+
选用 if else 这种冗余的写法是因为这种写法:
|
|
8
|
+
color: {{$idx == selected ? selectedColor: color}}; 在 props 更新时不能正确触发 computed
|
|
9
|
+
待框架修复这个问题或能兼容 Hex3 后,可以进行合并。
|
|
10
|
+
-->
|
|
11
|
+
<toolbar-item if="{{$idx != selected}}"
|
|
12
|
+
icon="{{$item.iconPath}}"
|
|
13
|
+
value="{{$item.text}}"
|
|
14
|
+
style="color: {{color}};background-color: transparent;"
|
|
15
|
+
onclick="jump($item.pagePath)"
|
|
16
|
+
>
|
|
17
|
+
</toolbar-item>
|
|
18
|
+
<toolbar-item else
|
|
19
|
+
icon="{{$item.selectedIconPath}}"
|
|
20
|
+
value="{{$item.text}}"
|
|
21
|
+
style="color: {{selectedColor}};background-color: transparent;"
|
|
22
|
+
onclick="jump($item.pagePath)"
|
|
23
|
+
>
|
|
24
|
+
</toolbar-item>
|
|
25
|
+
</block>
|
|
26
|
+
</toolbar>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import router from '@system.router'
|
|
2
|
+
|
|
3
|
+
import { covertHex3ToHex6 } from '../utils'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
props: {
|
|
7
|
+
tabbarData: {
|
|
8
|
+
default: {}
|
|
9
|
+
},
|
|
10
|
+
selected: Number
|
|
11
|
+
},
|
|
12
|
+
computed: {
|
|
13
|
+
borderStyle () {
|
|
14
|
+
return this.tabbarData.borderStyle || 'black'
|
|
15
|
+
},
|
|
16
|
+
color () {
|
|
17
|
+
return covertHex3ToHex6(this.tabbarData.color)
|
|
18
|
+
},
|
|
19
|
+
selectedColor () {
|
|
20
|
+
return covertHex3ToHex6(this.tabbarData.selectedColor)
|
|
21
|
+
},
|
|
22
|
+
backgroundColor () {
|
|
23
|
+
return covertHex3ToHex6(this.tabbarData.backgroundColor)
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
jump (pagePath) {
|
|
27
|
+
// TODO 如果跳的 tabbar 页已打开过,优先复用
|
|
28
|
+
const app = getApp()
|
|
29
|
+
const pages = app.pageStack
|
|
30
|
+
|
|
31
|
+
for (let i = 0; i < pages.length; i++) {
|
|
32
|
+
const item = pages[i]
|
|
33
|
+
if (item === pagePath) {
|
|
34
|
+
return router.back({
|
|
35
|
+
uri: item
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
router.push({ uri: pagePath })
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<textarea
|
|
2
|
+
id={{id}}
|
|
3
|
+
value="{{value}}"
|
|
4
|
+
placeholder="{{placeholder}}"
|
|
5
|
+
maxlength="{{maxlength}}"
|
|
6
|
+
disabled="{{disabled}}"
|
|
7
|
+
headericon="{{headericon}}"
|
|
8
|
+
extend="{{autoHeight}}"
|
|
9
|
+
showcounter="{{showcounter}}"
|
|
10
|
+
menuoptions="{{menuoptions}}"
|
|
11
|
+
autofocus="{{autoFocus}}"
|
|
12
|
+
selectedstart="{{selectionStart}}"
|
|
13
|
+
selectedend="{{selectionEnd}}"
|
|
14
|
+
softkeyboardenabled="{{softkeyboardenabled}}"
|
|
15
|
+
@change="onInput"
|
|
16
|
+
@focus="onFocus"
|
|
17
|
+
@blur="onBlur"
|
|
18
|
+
@translate="onTranslate"
|
|
19
|
+
@share="onShare"
|
|
20
|
+
@search="onSearch"
|
|
21
|
+
@optionselect="onOptionSelect"
|
|
22
|
+
@selectchange="onSelectChange"
|
|
23
|
+
>
|
|
24
|
+
</textarea>
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import window from '@ohos.window'
|
|
2
|
+
|
|
3
|
+
import { createOption } from '../utils'
|
|
4
|
+
|
|
5
|
+
export default createOption({
|
|
6
|
+
data () {
|
|
7
|
+
return {
|
|
8
|
+
textareaValue: this.value || '',
|
|
9
|
+
height: 0
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
props: [
|
|
14
|
+
'id',
|
|
15
|
+
'value',
|
|
16
|
+
'disabled',
|
|
17
|
+
'placeholder',
|
|
18
|
+
'maxlength',
|
|
19
|
+
'autoFocus',
|
|
20
|
+
'autoHeight',
|
|
21
|
+
'selectionStart',
|
|
22
|
+
'selectionEnd',
|
|
23
|
+
'headericon',
|
|
24
|
+
'showcounter',
|
|
25
|
+
'menuoptions',
|
|
26
|
+
'softkeyboardenabled'
|
|
27
|
+
],
|
|
28
|
+
|
|
29
|
+
onInit () {
|
|
30
|
+
this.windowClass = window.getTopWindow()
|
|
31
|
+
this.windowClass.then(win => {
|
|
32
|
+
win.on('keyboardHeightChange', (err, data) => {
|
|
33
|
+
if (!err) {
|
|
34
|
+
if (this.height !== data.height) {
|
|
35
|
+
this.onKeyboardHeightChange(data.height)
|
|
36
|
+
}
|
|
37
|
+
this.height = data.height
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
})
|
|
41
|
+
this.$watch('value', 'onPropertyChange')
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
onPropertyChange (newV) {
|
|
45
|
+
this.textareaValue = newV
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
onInput (e) {
|
|
49
|
+
this.textareaValue = e.value
|
|
50
|
+
this.$trigger('input', {
|
|
51
|
+
value: e.text, cursor: e.text.length, keyCode: null
|
|
52
|
+
})
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
onFocus () {
|
|
56
|
+
this.$trigger('focus', {
|
|
57
|
+
value: this.textareaValue, height: this.height
|
|
58
|
+
})
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
onBlur () {
|
|
62
|
+
this.$trigger('blur', {
|
|
63
|
+
value: this.textareaValue, height: this.height
|
|
64
|
+
})
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
onTranslate (e) {
|
|
68
|
+
this.$trigger('translate', e)
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
onShare (e) {
|
|
72
|
+
this.$trigger('share', e)
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
onSearch (e) {
|
|
76
|
+
this.$trigger('search', e)
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
onOptionSelect (e) {
|
|
80
|
+
this.$trigger('optionselect', e)
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
onSelectChange (e) {
|
|
84
|
+
this.$trigger('selectchange', e)
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
onKeyboardHeightChange (height) {
|
|
88
|
+
this.$trigger('keyboardheightchange', {
|
|
89
|
+
height, duration: 0
|
|
90
|
+
})
|
|
91
|
+
}
|
|
92
|
+
})
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export function covertHex3ToHex6 (color) {
|
|
2
|
+
return color && color.replace(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i, '#$1$1$2$2$3$3')
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export function createOption (option) {
|
|
6
|
+
option.$trigger = function (event, params) {
|
|
7
|
+
this.$emit(event, { id: this.id, ...params })
|
|
8
|
+
}
|
|
9
|
+
return option
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function queryToJson (str) {
|
|
13
|
+
const dec = decodeURIComponent
|
|
14
|
+
const qp = str.split('&')
|
|
15
|
+
const ret = {}
|
|
16
|
+
let name
|
|
17
|
+
let val
|
|
18
|
+
for (let i = 0, l = qp.length, item; i < l; ++i) {
|
|
19
|
+
item = qp[i]
|
|
20
|
+
if (item.length) {
|
|
21
|
+
const s = item.indexOf('=')
|
|
22
|
+
if (s < 0) {
|
|
23
|
+
name = dec(item)
|
|
24
|
+
val = ''
|
|
25
|
+
} else {
|
|
26
|
+
name = dec(item.slice(0, s))
|
|
27
|
+
val = dec(item.slice(s + 1))
|
|
28
|
+
}
|
|
29
|
+
if (typeof ret[name] === 'string') {
|
|
30
|
+
ret[name] = [ret[name]]
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (Array.isArray(ret[name])) {
|
|
34
|
+
ret[name].push(val)
|
|
35
|
+
} else {
|
|
36
|
+
ret[name] = val
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return ret
|
|
41
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<div>
|
|
2
|
+
<video id="{{id}}" style="object-fit:{{objectFit}};" src="{{src}}" muted="{{muted}}"
|
|
3
|
+
autoplay="{{autoplay}}" poster="{{poster}}" controls="{{controls}}" direction="{{videoDirection}}" loop="{{loop}}" starttime="{{initialTime}}"
|
|
4
|
+
speed="{{speed}}" @prepared="preparedCallback" @start="startCallback" @pause="pauseCallback"
|
|
5
|
+
@finish="finishCallback" @stop="stopCallback" @error="errorCallback" @seeked="seekedCallback"
|
|
6
|
+
@timeupdate="timeupdateCallback" @fullscreenchange="fullscreenChangeCallback" @click="clickCallback"></video>
|
|
7
|
+
</div>
|