@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,51 @@
|
|
|
1
|
+
const View = 'view';
|
|
2
|
+
const Icon = 'icon';
|
|
3
|
+
const Progress = 'progress';
|
|
4
|
+
const RichText = 'rich-text';
|
|
5
|
+
const Text = 'text';
|
|
6
|
+
const Button = 'button';
|
|
7
|
+
const Checkbox = 'checkbox';
|
|
8
|
+
const CheckboxGroup = 'checkbox-group';
|
|
9
|
+
const Form = 'form';
|
|
10
|
+
const Input = 'input';
|
|
11
|
+
const Label = 'label';
|
|
12
|
+
const Picker = 'picker';
|
|
13
|
+
const PickerView = 'picker-view';
|
|
14
|
+
const PickerViewColumn = 'picker-view-column';
|
|
15
|
+
const Radio = 'radio';
|
|
16
|
+
const RadioGroup = 'radio-group';
|
|
17
|
+
const Slider = 'slider';
|
|
18
|
+
const Switch = 'switch';
|
|
19
|
+
const CoverImage = 'cover-image';
|
|
20
|
+
const Textarea = 'textarea';
|
|
21
|
+
const CoverView = 'cover-view';
|
|
22
|
+
const MovableArea = 'movable-area';
|
|
23
|
+
const MovableView = 'movable-view';
|
|
24
|
+
const ScrollView = 'scroll-view';
|
|
25
|
+
const Swiper = 'swiper';
|
|
26
|
+
const SwiperItem = 'swiper-item';
|
|
27
|
+
const Navigator = 'navigator';
|
|
28
|
+
const Audio = 'audio';
|
|
29
|
+
const Camera = 'camera';
|
|
30
|
+
const Image = 'image';
|
|
31
|
+
const LivePlayer = 'live-player';
|
|
32
|
+
const Video = 'video';
|
|
33
|
+
const Canvas = 'canvas';
|
|
34
|
+
const Ad = 'ad';
|
|
35
|
+
const WebView = 'web-view';
|
|
36
|
+
const Block = 'block';
|
|
37
|
+
const Map = 'map';
|
|
38
|
+
const Slot = 'slot';
|
|
39
|
+
const NativeSlot = 'native-slot';
|
|
40
|
+
const CustomWrapper = 'custom-wrapper';
|
|
41
|
+
|
|
42
|
+
// For React.createElement's type
|
|
43
|
+
const Span = 'span';
|
|
44
|
+
const Tabs = 'tabs';
|
|
45
|
+
const TabBar = 'tab-bar';
|
|
46
|
+
const TabContent = 'tab-content';
|
|
47
|
+
const List = 'list';
|
|
48
|
+
const ListItem = 'list-item';
|
|
49
|
+
|
|
50
|
+
export { Ad, Audio, Block, Button, Camera, Canvas, Checkbox, CheckboxGroup, CoverImage, CoverView, CustomWrapper, Form, Icon, Image, Input, Label, List, ListItem, LivePlayer, Map, MovableArea, MovableView, NativeSlot, Navigator, Picker, PickerView, PickerViewColumn, Progress, Radio, RadioGroup, RichText, ScrollView, Slider, Slot, Span, Swiper, SwiperItem, Switch, TabBar, TabContent, Tabs, Text, Textarea, Video, View, WebView };
|
|
51
|
+
//# sourceMappingURL=components-react.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components-react.js","sources":["../../src/components/components-react.ts"],"sourcesContent":["// For React.createElement's type\nexport * from '@tarojs/components/mini'\nexport const Span = 'span'\nexport const Tabs = 'tabs'\nexport const TabBar = 'tab-bar'\nexport const TabContent = 'tab-content'\nexport const List = 'list'\nexport const ListItem = 'list-item'\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEO,MAAM,IAAI,GAAG,OAAM;AACnB,MAAM,IAAI,GAAG,OAAM;AACnB,MAAM,MAAM,GAAG,UAAS;AACxB,MAAM,UAAU,GAAG,cAAa;AAChC,MAAM,IAAI,GAAG,OAAM;AACnB,MAAM,QAAQ,GAAG;;;;"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
div {
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: center;
|
|
4
|
+
margin-top: 20px;
|
|
5
|
+
margin-bottom: 20px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
button {
|
|
9
|
+
height: 98px;
|
|
10
|
+
font-size: 36px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.type-default {
|
|
14
|
+
background-color: #f8f8f8;
|
|
15
|
+
text-color: #000;
|
|
16
|
+
border: 1px solid #eee;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.type-primary {
|
|
20
|
+
background-color: #1aad19;
|
|
21
|
+
text-color: #fff;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.type-warn {
|
|
25
|
+
background-color: #e64340;
|
|
26
|
+
text-color: #fff;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.type-warn-plain {
|
|
30
|
+
background-color: transparent;
|
|
31
|
+
border: 1px solid #e64340;
|
|
32
|
+
text-color: #e64340;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.type-default-plain {
|
|
36
|
+
background-color: transparent;
|
|
37
|
+
border: 1px solid #353535;
|
|
38
|
+
text-color: #353535;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.type-primary-plain {
|
|
42
|
+
background-color: transparent;
|
|
43
|
+
border: 1px solid #1aad19;
|
|
44
|
+
text-color: #1aad19;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.disbaled {
|
|
48
|
+
text-color: hsla(0,0%,100%,.6);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.type-default-disabled {
|
|
52
|
+
background-color: #f7f7f7;
|
|
53
|
+
text-color: rgba(0,0,0,.3);
|
|
54
|
+
border: 1px solid #eee;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.type-primary-disabled {
|
|
58
|
+
background-color: #9ed99d;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.type-warn-disabled {
|
|
62
|
+
background-color: #ec8b89;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.type-default-plain-disabled {
|
|
66
|
+
border-color: rgba(0,0,0,.2);
|
|
67
|
+
text-color: rgba(0,0,0,.2);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.type-primary-plain-disabled {
|
|
71
|
+
border-color: rgba(0,0,0,.2);
|
|
72
|
+
text-color: rgba(0,0,0,.2);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.type-warn-plain-disabled {
|
|
76
|
+
border-color: rgba(0,0,0,.2);
|
|
77
|
+
text-color: rgba(0,0,0,.2);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.type-default-loading {
|
|
81
|
+
background-color: #dedede;
|
|
82
|
+
color: rgba(0,0,0,.6);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.type-warn-loading {
|
|
86
|
+
background-color: #ce3c39;
|
|
87
|
+
color: hsla(0,0%,100%,.6);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.type-primary-loading {
|
|
91
|
+
background-color: #179b16;
|
|
92
|
+
color: hsla(0,0%,100%,.6);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.size-default {
|
|
96
|
+
width: 100%;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.size-mini {
|
|
100
|
+
width: 200px;
|
|
101
|
+
height: 72px;
|
|
102
|
+
font-size: 26px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.button-hover {
|
|
106
|
+
background-color: #dedede;
|
|
107
|
+
text-color: rgba(0,0,0,.6);
|
|
108
|
+
transition: all linear 0.2s;
|
|
109
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<div>
|
|
2
|
+
<input
|
|
3
|
+
type='submit'
|
|
4
|
+
if="{{formType === 'submit'}}"
|
|
5
|
+
id="{{id}}"
|
|
6
|
+
class="{{cls}} {{clsType}} {{clsSize}} {{clsPlain}} {{clsDisable}} {{clsDisableType}} {{clsLoading}} {{clsHover}}"
|
|
7
|
+
disabled="{{disabled}}"
|
|
8
|
+
@touchstart="onTouchStart"
|
|
9
|
+
@touchend="onTouchEnd"
|
|
10
|
+
>{{value}}</input>
|
|
11
|
+
<input
|
|
12
|
+
type='reset'
|
|
13
|
+
elif="{{formType === 'reset'}}"
|
|
14
|
+
id="{{id}}"
|
|
15
|
+
class="{{cls}} {{clsType}} {{clsSize}} {{clsPlain}} {{clsDisable}} {{clsDisableType}} {{clsLoading}} {{clsHover}}"
|
|
16
|
+
disabled="{{disabled}}"
|
|
17
|
+
@touchstart="onTouchStart"
|
|
18
|
+
@touchend="onTouchEnd"
|
|
19
|
+
>{{value}}</input>
|
|
20
|
+
<button
|
|
21
|
+
else
|
|
22
|
+
id="{{id}}"
|
|
23
|
+
class="{{cls}} {{clsType}} {{clsSize}} {{clsPlain}} {{clsDisable}} {{clsDisableType}} {{clsLoading}} {{clsHover}}"
|
|
24
|
+
type="{{harmonyType}}"
|
|
25
|
+
disabled="{{disabled}}"
|
|
26
|
+
waiting="{{loading}}"
|
|
27
|
+
@click="onClick"
|
|
28
|
+
@touchstart="onTouchStart"
|
|
29
|
+
@touchend="onTouchEnd"
|
|
30
|
+
>{{value}}</button>
|
|
31
|
+
</div>
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { createOption } from '../utils'
|
|
2
|
+
|
|
3
|
+
export default createOption({
|
|
4
|
+
props: {
|
|
5
|
+
id: {
|
|
6
|
+
default: ''
|
|
7
|
+
},
|
|
8
|
+
cls: {
|
|
9
|
+
default: ''
|
|
10
|
+
},
|
|
11
|
+
type: {
|
|
12
|
+
default: 'default'
|
|
13
|
+
},
|
|
14
|
+
harmonyType: {
|
|
15
|
+
default: 'capsule'
|
|
16
|
+
},
|
|
17
|
+
size: {
|
|
18
|
+
default: 'default'
|
|
19
|
+
},
|
|
20
|
+
plain: {
|
|
21
|
+
default: false
|
|
22
|
+
},
|
|
23
|
+
disabled: {
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
26
|
+
loading: {
|
|
27
|
+
default: false
|
|
28
|
+
},
|
|
29
|
+
hoverStartTime: {
|
|
30
|
+
default: 20
|
|
31
|
+
},
|
|
32
|
+
hoverStayTime: {
|
|
33
|
+
default: 70
|
|
34
|
+
},
|
|
35
|
+
hoverClass: {
|
|
36
|
+
default: 'button-hover'
|
|
37
|
+
},
|
|
38
|
+
formType: {
|
|
39
|
+
default: null
|
|
40
|
+
},
|
|
41
|
+
cn: {
|
|
42
|
+
default: []
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
data () {
|
|
46
|
+
return {
|
|
47
|
+
hover: false,
|
|
48
|
+
touch: false
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
computed: {
|
|
52
|
+
clsType () {
|
|
53
|
+
return `type-${this.type}`
|
|
54
|
+
},
|
|
55
|
+
clsSize () {
|
|
56
|
+
return `size-${this.size}`
|
|
57
|
+
},
|
|
58
|
+
clsPlain () {
|
|
59
|
+
if (!this.plain) return ''
|
|
60
|
+
return `type-${this.type}-plain`
|
|
61
|
+
},
|
|
62
|
+
clsDisable () {
|
|
63
|
+
if (!this.disabled) return ''
|
|
64
|
+
return 'disabled'
|
|
65
|
+
},
|
|
66
|
+
clsLoading () {
|
|
67
|
+
if (!this.loading) return ''
|
|
68
|
+
return `type-${this.type}-loading`
|
|
69
|
+
},
|
|
70
|
+
clsDisableType () {
|
|
71
|
+
if (!this.disabled) return ''
|
|
72
|
+
if (this.plain) return `type-${this.type}-plain-disabled`
|
|
73
|
+
return `type-${this.type}-disabled`
|
|
74
|
+
},
|
|
75
|
+
clsHover () {
|
|
76
|
+
return this.hover && !this.disabled ? this.hoverClass : ''
|
|
77
|
+
},
|
|
78
|
+
value () {
|
|
79
|
+
return this.cn.map(i => i.v).join('')
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
onTouchStart () {
|
|
83
|
+
this.touch = true
|
|
84
|
+
if (this.hoverClass && !this.disabled) {
|
|
85
|
+
setTimeout(() => {
|
|
86
|
+
if (this.touch) {
|
|
87
|
+
this.hover = true
|
|
88
|
+
}
|
|
89
|
+
}, this.hoverStartTime)
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
onTouchEnd () {
|
|
93
|
+
this.touch = false
|
|
94
|
+
if (this.hoverClass && !this.disabled) {
|
|
95
|
+
setTimeout(() => {
|
|
96
|
+
if (!this.touch) {
|
|
97
|
+
this.hover = false
|
|
98
|
+
}
|
|
99
|
+
}, this.hoverStayTime)
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
onClick () {
|
|
103
|
+
this.$trigger('tap')
|
|
104
|
+
}
|
|
105
|
+
})
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
props: [
|
|
3
|
+
'id',
|
|
4
|
+
'value',
|
|
5
|
+
'name',
|
|
6
|
+
'disabled',
|
|
7
|
+
'checked',
|
|
8
|
+
'groupId',
|
|
9
|
+
'cn'
|
|
10
|
+
],
|
|
11
|
+
computed: {
|
|
12
|
+
textValue () {
|
|
13
|
+
const cn = this.cn
|
|
14
|
+
return cn && cn[0] && cn[0].nn === '#text' ? cn[0].v : ''
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
onAttached () {
|
|
18
|
+
const checkboxGroup = this.findCheckboxGroup()
|
|
19
|
+
if (checkboxGroup && this.checked) {
|
|
20
|
+
checkboxGroup.collectValue(this.value)
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
onChange (e) {
|
|
24
|
+
const checkboxGroup = this.findCheckboxGroup()
|
|
25
|
+
|
|
26
|
+
if (!checkboxGroup) return
|
|
27
|
+
|
|
28
|
+
if (e.checked) {
|
|
29
|
+
checkboxGroup.collectValue(this.value)
|
|
30
|
+
} else {
|
|
31
|
+
checkboxGroup.removeValue(this.value)
|
|
32
|
+
}
|
|
33
|
+
checkboxGroup.onChange()
|
|
34
|
+
},
|
|
35
|
+
onDestroy () {
|
|
36
|
+
let checkboxGroup
|
|
37
|
+
|
|
38
|
+
try {
|
|
39
|
+
// 可能父元素已经卸载了,不 catch 会报错
|
|
40
|
+
checkboxGroup = this.findCheckboxGroup()
|
|
41
|
+
// eslint-disable-next-line no-empty
|
|
42
|
+
} catch (error) {}
|
|
43
|
+
|
|
44
|
+
if (checkboxGroup && this.checked) {
|
|
45
|
+
checkboxGroup.removeValue(this.value)
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
findCheckboxGroup () {
|
|
49
|
+
let parent = this.$parent()
|
|
50
|
+
while (parent && parent.$child) {
|
|
51
|
+
// parent.$child(this.groupId) 这是鸿蒙的 bug。
|
|
52
|
+
// 等待修复后,直接 parent 就行
|
|
53
|
+
const checkboxGroup = parent.$child(this.groupId)
|
|
54
|
+
if (checkboxGroup) {
|
|
55
|
+
return checkboxGroup
|
|
56
|
+
}
|
|
57
|
+
parent = parent.$parent()
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createOption } from '../utils'
|
|
2
|
+
|
|
3
|
+
export default createOption({
|
|
4
|
+
data: {
|
|
5
|
+
values: []
|
|
6
|
+
},
|
|
7
|
+
props: [
|
|
8
|
+
'id'
|
|
9
|
+
],
|
|
10
|
+
onChange () {
|
|
11
|
+
this.$trigger('change', { value: this.values })
|
|
12
|
+
},
|
|
13
|
+
collectValue (value) {
|
|
14
|
+
this.values.push(value)
|
|
15
|
+
},
|
|
16
|
+
removeValue (value) {
|
|
17
|
+
const idx = this.values.indexOf(value)
|
|
18
|
+
if (idx > -1) {
|
|
19
|
+
this.values.splice(idx, 1)
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
})
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createOption } from '../utils'
|
|
2
|
+
|
|
3
|
+
export default createOption({
|
|
4
|
+
props: [
|
|
5
|
+
'id',
|
|
6
|
+
'src',
|
|
7
|
+
'alt'
|
|
8
|
+
],
|
|
9
|
+
onLoad (e) {
|
|
10
|
+
this.$trigger('load', { width: e.width, height: e.height })
|
|
11
|
+
},
|
|
12
|
+
onError () {
|
|
13
|
+
this.$trigger('error', { errMsg: '图片加载异常' })
|
|
14
|
+
}
|
|
15
|
+
})
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
@font-face {
|
|
2
|
+
font-family: taroicon;
|
|
3
|
+
src: url('https://storage.360buyimg.com/datapool/iconfont.ttf');
|
|
4
|
+
}
|
|
5
|
+
.taro-icon {
|
|
6
|
+
font-family: taroicon;
|
|
7
|
+
font-size: 23vp;
|
|
8
|
+
font-style: normal;
|
|
9
|
+
}
|
|
10
|
+
.icon-success,
|
|
11
|
+
.icon-success_no_circle,
|
|
12
|
+
.icon-download,
|
|
13
|
+
.icon-info_circle {
|
|
14
|
+
color: #09bb07;
|
|
15
|
+
}
|
|
16
|
+
.icon-info,
|
|
17
|
+
.icon-waiting {
|
|
18
|
+
color: #10aeff;
|
|
19
|
+
}
|
|
20
|
+
.icon-warn,
|
|
21
|
+
.icon-cancel {
|
|
22
|
+
color: #f76260;
|
|
23
|
+
}
|
|
24
|
+
.icon-clear,
|
|
25
|
+
.icon-search {
|
|
26
|
+
color: #b2b2b2;
|
|
27
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<div
|
|
2
|
+
id="{{id}}"
|
|
3
|
+
>
|
|
4
|
+
<text
|
|
5
|
+
if="{{type === 'success'}}"
|
|
6
|
+
class="taro-icon icon-success"
|
|
7
|
+
style=" color: {{iconColor}};font-size: {{size}}vp;min-width: {{size}}vp;"
|
|
8
|
+
></text>
|
|
9
|
+
<text
|
|
10
|
+
if="{{type === 'success_no_circle'}}"
|
|
11
|
+
class="taro-icon icon-success_no_circle"
|
|
12
|
+
style=" color: {{iconColor}};font-size: {{size}}vp;min-width: {{size}}vp;"
|
|
13
|
+
></text>
|
|
14
|
+
<text
|
|
15
|
+
if="{{type === 'info'}}"
|
|
16
|
+
class="taro-icon icon-info"
|
|
17
|
+
style=" color: {{iconColor}};font-size: {{size}}vp;min-width: {{size}}vp;"
|
|
18
|
+
></text>
|
|
19
|
+
<text
|
|
20
|
+
if="{{type === 'info_circle'}}"
|
|
21
|
+
class="taro-icon icon-info_circle"
|
|
22
|
+
style=" color: {{iconColor}};font-size: {{size}}vp;min-width: {{size}}vp;"
|
|
23
|
+
></text>
|
|
24
|
+
<text
|
|
25
|
+
if="{{type === 'warn'}}"
|
|
26
|
+
class="taro-icon icon-warn"
|
|
27
|
+
style=" color: {{iconColor}};font-size: {{size}}vp;min-width: {{size}}vp;"
|
|
28
|
+
></text>
|
|
29
|
+
<text
|
|
30
|
+
if="{{type === 'waiting'}}"
|
|
31
|
+
class="taro-icon icon-waiting"
|
|
32
|
+
style=" color: {{iconColor}};font-size: {{size}}vp;min-width: {{size}}vp;"
|
|
33
|
+
></text>
|
|
34
|
+
<text
|
|
35
|
+
if="{{type === 'cancel'}}"
|
|
36
|
+
class="taro-icon icon-cancel"
|
|
37
|
+
style=" color: {{iconColor}};font-size: {{size}}vp;min-width: {{size}}vp;"
|
|
38
|
+
></text>
|
|
39
|
+
<text
|
|
40
|
+
if="{{type === 'download'}}"
|
|
41
|
+
class="taro-icon icon-download"
|
|
42
|
+
style=" color: {{iconColor}};font-size: {{size}}vp;min-width: {{size}}vp;"
|
|
43
|
+
></text>
|
|
44
|
+
<text
|
|
45
|
+
if="{{type === 'search'}}"
|
|
46
|
+
class="taro-icon icon-search"
|
|
47
|
+
style=" color: {{iconColor}};font-size: {{size}}vp;min-width: {{size}}vp;"
|
|
48
|
+
></text>
|
|
49
|
+
<text
|
|
50
|
+
if="{{type === 'clear'}}"
|
|
51
|
+
class="taro-icon icon-clear"
|
|
52
|
+
style=" color: {{iconColor}};font-size: {{size}}vp;min-width: {{size}}vp;"
|
|
53
|
+
></text>
|
|
54
|
+
</div>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createOption } from '../utils'
|
|
2
|
+
|
|
3
|
+
const modeMap = {
|
|
4
|
+
scaleToFill: 'fill',
|
|
5
|
+
aspectFit: 'contain',
|
|
6
|
+
aspectFill: 'cover'
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default createOption({
|
|
10
|
+
props: [
|
|
11
|
+
'id',
|
|
12
|
+
'mode',
|
|
13
|
+
'src',
|
|
14
|
+
'alt',
|
|
15
|
+
'style'
|
|
16
|
+
],
|
|
17
|
+
computed: {
|
|
18
|
+
objectFit () {
|
|
19
|
+
return modeMap[this.mode] || ''
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
onLoad (e) {
|
|
23
|
+
this.$trigger('load', { width: e.width, height: e.height })
|
|
24
|
+
},
|
|
25
|
+
onError () {
|
|
26
|
+
this.$trigger('error', { errMsg: '图片加载异常' })
|
|
27
|
+
}
|
|
28
|
+
})
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<div>
|
|
2
|
+
<input
|
|
3
|
+
id="{{ id }}"
|
|
4
|
+
value="{{ value }}"
|
|
5
|
+
name="{{ name }}"
|
|
6
|
+
type="{{ realType }}"
|
|
7
|
+
placeholder="{{ placeholder }}"
|
|
8
|
+
style="placeholder-color: {{placeholderColor}};"
|
|
9
|
+
autofocus="{{ focus }}"
|
|
10
|
+
enterkeytype="{{ confirmType }}"
|
|
11
|
+
maxlength="{{ maxlength }}"
|
|
12
|
+
disabled="{{ disabled }}"
|
|
13
|
+
|
|
14
|
+
@change="onInput"
|
|
15
|
+
@focus="onFocus"
|
|
16
|
+
@blur="onBlur"
|
|
17
|
+
@enterkeyclick="onEnterKeyClick"
|
|
18
|
+
>
|
|
19
|
+
</input>
|
|
20
|
+
</div>
|
|
21
|
+
|