@tarojs/components 3.6.0-canary.6 → 3.6.0-canary.8
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/react/component-lib/index.js +20 -10
- package/dist/react/component-lib/input.js +3 -4
- package/dist/react/component-lib/reactify-wc.js +9 -46
- package/dist/react/components.js +0 -2
- package/dist/react/react-component-lib/createComponent.js +10 -30
- package/dist/react/react-component-lib/createOverlayComponent.js +8 -37
- package/dist/react/react-component-lib/utils/attachProps.js +9 -18
- package/dist/react/react-component-lib/utils/index.js +6 -9
- package/dist/vue2/component-lib/components.js +22 -11
- package/dist/vue2/component-lib/createFormsComponent.js +0 -5
- package/dist/vue2/component-lib/index.js +6 -8
- package/dist/vue2/component-lib/mixins/refs.js +0 -5
- package/dist/vue2/components.js +0 -3
- package/dist/vue2/index.js +3 -7
- package/dist/vue2/vue-component-lib/utils.js +0 -1
- package/dist/vue3/component-lib/createComponent.js +1 -1
- package/dist/vue3/component-lib/createFormsComponent.js +3 -8
- package/dist/vue3/component-lib/forwardRef.js +0 -2
- package/dist/vue3/component-lib/icon.js +2 -2
- package/dist/vue3/component-lib/image.js +2 -2
- package/dist/vue3/component-lib/index.js +22 -11
- package/dist/vue3/component-lib/scroll-view.js +2 -2
- package/dist/vue3/component-lib/text.js +2 -2
- package/dist/vue3/components.js +0 -2
- package/dist/vue3/index.js +2 -4
- package/dist/vue3/vue-component-lib/utils.js +7 -29
- package/package.json +4 -3
- package/types/Button.d.ts +1 -1
- package/types/Camera.d.ts +1 -1
- package/types/Checkbox.d.ts +1 -1
- package/types/CheckboxGroup.d.ts +1 -1
- package/types/CoverImage.d.ts +1 -1
- package/types/CustomWrapper.d.ts +1 -0
- package/types/Form.d.ts +1 -1
- package/types/Icon.d.ts +1 -1
- package/types/Image.d.ts +1 -1
- package/types/Input.d.ts +15 -1
- package/types/Label.d.ts +1 -1
- package/types/NativeSlot.d.ts +1 -0
- package/types/NavigationBar.d.ts +2 -1
- package/types/Navigator.d.ts +1 -1
- package/types/Picker.d.ts +1 -1
- package/types/PickerView.d.ts +1 -1
- package/types/PickerViewColumn.d.ts +1 -1
- package/types/Progress.d.ts +1 -1
- package/types/Radio.d.ts +1 -1
- package/types/RadioGroup.d.ts +1 -1
- package/types/RichText.d.ts +1 -1
- package/types/ScrollView.d.ts +1 -1
- package/types/ShareElement.d.ts +3 -3
- package/types/Slider.d.ts +1 -1
- package/types/Slot.d.ts +2 -1
- package/types/Swiper.d.ts +1 -1
- package/types/SwiperItem.d.ts +1 -1
- package/types/Switch.d.ts +1 -1
- package/types/Textarea.d.ts +1 -1
- package/types/Video.d.ts +1 -1
- package/types/View.d.ts +1 -1
- package/types/WebView.d.ts +1 -1
- package/virtual-list/index.d.ts +3 -120
- package/virtual-list/index.js +3 -7
- package/virtual-list/domHelpers.js +0 -40
- package/virtual-list/memoize.js +0 -38
- package/virtual-list/react/FixedSizeList.js +0 -193
- package/virtual-list/react/createListComponent.js +0 -654
- package/virtual-list/react/index.d.ts +0 -123
- package/virtual-list/react/index.js +0 -67
- package/virtual-list/timer.js +0 -24
- package/virtual-list/vue/index.js +0 -589
|
@@ -2,33 +2,26 @@ import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
|
2
2
|
import { camelToDashCase } from './case';
|
|
3
3
|
export var attachProps = function attachProps(node, newProps) {
|
|
4
4
|
var oldProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
5
|
-
|
|
6
5
|
// some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first
|
|
7
6
|
if (node instanceof Element) {
|
|
8
7
|
// add any classes in className to the class list
|
|
9
8
|
var className = getClassName(node.classList, newProps, oldProps);
|
|
10
|
-
|
|
11
9
|
if (className !== '') {
|
|
12
10
|
node.className = className;
|
|
13
11
|
}
|
|
14
|
-
|
|
15
12
|
Object.keys(newProps).forEach(function (name) {
|
|
16
13
|
if (name === 'children' || name === 'style' || name === 'ref' || name === 'class' || name === 'className' || name === 'forwardedRef') {
|
|
17
14
|
return;
|
|
18
15
|
}
|
|
19
|
-
|
|
20
16
|
if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
|
|
21
17
|
var eventName = name.substring(2);
|
|
22
18
|
var eventNameLc = eventName.toLowerCase();
|
|
23
|
-
|
|
24
19
|
if (!isCoveredByReact(eventNameLc)) {
|
|
25
20
|
syncEvent(node, eventNameLc, newProps[name]);
|
|
26
21
|
}
|
|
27
22
|
} else {
|
|
28
23
|
node[name] = newProps[name];
|
|
29
|
-
|
|
30
24
|
var propType = _typeof(newProps[name]);
|
|
31
|
-
|
|
32
25
|
if (propType === 'string') {
|
|
33
26
|
node.setAttribute(camelToDashCase(name), newProps[name]);
|
|
34
27
|
}
|
|
@@ -38,14 +31,14 @@ export var attachProps = function attachProps(node, newProps) {
|
|
|
38
31
|
};
|
|
39
32
|
export var getClassName = function getClassName(classList, newProps, oldProps) {
|
|
40
33
|
var newClassProp = newProps.className || newProps.class;
|
|
41
|
-
var oldClassProp = oldProps.className || oldProps.class;
|
|
42
|
-
|
|
34
|
+
var oldClassProp = oldProps.className || oldProps.class;
|
|
35
|
+
// map the classes to Maps for performance
|
|
43
36
|
var currentClasses = arrayToMap(classList);
|
|
44
37
|
var incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []);
|
|
45
38
|
var oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []);
|
|
46
|
-
var finalClassNames = [];
|
|
39
|
+
var finalClassNames = [];
|
|
40
|
+
// loop through each of the current classes on the component
|
|
47
41
|
// to see if it should be a part of the classNames added
|
|
48
|
-
|
|
49
42
|
currentClasses.forEach(function (currentClass) {
|
|
50
43
|
if (incomingPropClasses.has(currentClass)) {
|
|
51
44
|
// add it as its already included in classnames coming in from newProps
|
|
@@ -61,43 +54,41 @@ export var getClassName = function getClassName(classList, newProps, oldProps) {
|
|
|
61
54
|
});
|
|
62
55
|
return finalClassNames.join(' ');
|
|
63
56
|
};
|
|
57
|
+
|
|
64
58
|
/**
|
|
65
59
|
* Checks if an event is supported in the current execution environment.
|
|
66
60
|
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
67
61
|
*/
|
|
68
|
-
|
|
69
62
|
export var isCoveredByReact = function isCoveredByReact(eventNameSuffix) {
|
|
70
63
|
if (typeof document === 'undefined') {
|
|
71
64
|
return true;
|
|
72
65
|
} else {
|
|
73
66
|
var eventName = 'on' + eventNameSuffix;
|
|
74
67
|
var isSupported = (eventName in document);
|
|
75
|
-
|
|
76
68
|
if (!isSupported) {
|
|
77
69
|
var element = document.createElement('div');
|
|
78
70
|
element.setAttribute(eventName, 'return;');
|
|
79
71
|
isSupported = typeof element[eventName] === 'function';
|
|
80
72
|
}
|
|
81
|
-
|
|
82
73
|
return isSupported;
|
|
83
74
|
}
|
|
84
75
|
};
|
|
85
76
|
export var syncEvent = function syncEvent(node, eventName, newEventHandler) {
|
|
86
77
|
var eventStore = node.__events || (node.__events = {});
|
|
87
|
-
var oldEventHandler = eventStore[eventName];
|
|
78
|
+
var oldEventHandler = eventStore[eventName];
|
|
88
79
|
|
|
80
|
+
// Remove old listener so they don't double up.
|
|
89
81
|
if (oldEventHandler) {
|
|
90
82
|
node.removeEventListener(eventName, oldEventHandler);
|
|
91
|
-
}
|
|
92
|
-
|
|
83
|
+
}
|
|
93
84
|
|
|
85
|
+
// Bind new listener.
|
|
94
86
|
node.addEventListener(eventName, eventStore[eventName] = function handler(e) {
|
|
95
87
|
if (newEventHandler) {
|
|
96
88
|
newEventHandler.call(this, e);
|
|
97
89
|
}
|
|
98
90
|
});
|
|
99
91
|
};
|
|
100
|
-
|
|
101
92
|
var arrayToMap = function arrayToMap(arr) {
|
|
102
93
|
var map = new Map();
|
|
103
94
|
arr.forEach(function (s) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
4
|
export var setRef = function setRef(ref, value) {
|
|
4
5
|
if (typeof ref === 'function') {
|
|
5
6
|
ref(value);
|
|
@@ -12,7 +13,6 @@ export var mergeRefs = function mergeRefs() {
|
|
|
12
13
|
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
13
14
|
refs[_key] = arguments[_key];
|
|
14
15
|
}
|
|
15
|
-
|
|
16
16
|
return function (value) {
|
|
17
17
|
refs.forEach(function (ref) {
|
|
18
18
|
setRef(ref, value);
|
|
@@ -21,15 +21,12 @@ export var mergeRefs = function mergeRefs() {
|
|
|
21
21
|
};
|
|
22
22
|
export var createForwardRef = function createForwardRef(ReactComponent, displayName) {
|
|
23
23
|
var forwardRef = function forwardRef(props, ref) {
|
|
24
|
-
return
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
}]));
|
|
24
|
+
return /*#__PURE__*/_jsx(ReactComponent, _objectSpread(_objectSpread({}, props), {}, {
|
|
25
|
+
forwardedRef: ref
|
|
26
|
+
}));
|
|
29
27
|
};
|
|
30
|
-
|
|
31
28
|
forwardRef.displayName = displayName;
|
|
32
|
-
return React.forwardRef(forwardRef);
|
|
29
|
+
return /*#__PURE__*/React.forwardRef(forwardRef);
|
|
33
30
|
};
|
|
34
31
|
export var defineCustomElement = function defineCustomElement(tagName, customElement) {
|
|
35
32
|
if (customElement !== undefined && typeof customElements !== 'undefined' && !customElements.get(tagName)) {
|
|
@@ -3,13 +3,15 @@ import Image from './image';
|
|
|
3
3
|
import Picker from './picker';
|
|
4
4
|
import ScrollView from './scroll-view';
|
|
5
5
|
import Text from './text';
|
|
6
|
-
var components = [
|
|
6
|
+
var components = [
|
|
7
|
+
// 视图容器
|
|
7
8
|
'taro-cover-image', 'taro-cover-view', 'taro-match-media', 'taro-movable-area', 'taro-movable-view', 'taro-page-container', 'taro-root-portal', ['taro-scroll-view', {
|
|
8
9
|
type: 'component',
|
|
9
10
|
component: ScrollView
|
|
10
11
|
}], 'taro-share-element', 'taro-swiper', ['taro-swiper-item', {
|
|
11
12
|
classNames: ['swiper-slide']
|
|
12
|
-
}], 'taro-view',
|
|
13
|
+
}], 'taro-view',
|
|
14
|
+
// 基础内容
|
|
13
15
|
['taro-icon', {
|
|
14
16
|
type: 'component',
|
|
15
17
|
component: Icon
|
|
@@ -18,7 +20,8 @@ var components = [// 视图容器
|
|
|
18
20
|
}], 'taro-rich-text', ['taro-text', {
|
|
19
21
|
type: 'component',
|
|
20
22
|
component: Text
|
|
21
|
-
}],
|
|
23
|
+
}],
|
|
24
|
+
// 表单组件
|
|
22
25
|
'taro-button', ['taro-checkbox', {
|
|
23
26
|
classNames: ['weui-cells_checkbox']
|
|
24
27
|
}], 'taro-checkbox-group', 'taro-editor', 'taro-form', ['taro-input', {
|
|
@@ -43,18 +46,26 @@ var components = [// 视图容器
|
|
|
43
46
|
}], ['taro-textarea', {
|
|
44
47
|
type: 'forms',
|
|
45
48
|
event: 'input'
|
|
46
|
-
}],
|
|
47
|
-
|
|
49
|
+
}],
|
|
50
|
+
// 导航
|
|
51
|
+
'taro-functional-page-navigator', 'taro-navigator',
|
|
52
|
+
// 媒体组件
|
|
48
53
|
'taro-audio', 'taro-camera', ['taro-image', {
|
|
49
54
|
type: 'component',
|
|
50
55
|
component: Image
|
|
51
56
|
}], 'taro-live-player', ['taro-video', {
|
|
52
57
|
classNames: ['taro-video-container']
|
|
53
|
-
}], 'taro-voip-room',
|
|
54
|
-
|
|
55
|
-
'taro-
|
|
56
|
-
|
|
57
|
-
'taro-
|
|
58
|
-
|
|
58
|
+
}], 'taro-voip-room',
|
|
59
|
+
// 地图
|
|
60
|
+
'taro-map',
|
|
61
|
+
// 画布
|
|
62
|
+
'taro-canvas',
|
|
63
|
+
// 开放能力
|
|
64
|
+
'taro-web-view', 'taro-ad', 'taro-ad-custom', 'taro-official-account', 'taro-open-data',
|
|
65
|
+
// 导航栏
|
|
66
|
+
'taro-navigation-bar',
|
|
67
|
+
// 页面属性配置节点
|
|
68
|
+
'taro-page-meta',
|
|
69
|
+
// 其他
|
|
59
70
|
'taro-block', 'taro-custom-wrapper', 'taro-slot'];
|
|
60
71
|
export default components;
|
|
@@ -10,11 +10,9 @@ export default function createFormsComponent(name, event) {
|
|
|
10
10
|
type: Object
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
|
-
|
|
14
13
|
if (name === 'taro-input') {
|
|
15
14
|
props.focus = Boolean;
|
|
16
15
|
}
|
|
17
|
-
|
|
18
16
|
return {
|
|
19
17
|
name: name,
|
|
20
18
|
mixins: [listeners, refs],
|
|
@@ -37,13 +35,10 @@ export default function createFormsComponent(name, event) {
|
|
|
37
35
|
// eslint-disable-next-line
|
|
38
36
|
var self = this;
|
|
39
37
|
var attrs = this.$attrs || {};
|
|
40
|
-
|
|
41
38
|
if (name === 'taro-input') {
|
|
42
39
|
attrs['auto-focus'] = self.focus;
|
|
43
40
|
}
|
|
44
|
-
|
|
45
41
|
var on = _objectSpread({}, self.listeners);
|
|
46
|
-
|
|
47
42
|
on[event] = self[event];
|
|
48
43
|
return createElement("".concat(name, "-core"), {
|
|
49
44
|
class: ['hydrated'].concat(_toConsumableArray(classNames)),
|
|
@@ -8,19 +8,17 @@ components.forEach(function (params) {
|
|
|
8
8
|
Vue.component(params, createComponent(params));
|
|
9
9
|
} else if (params instanceof Array) {
|
|
10
10
|
var _ref = params,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
_ref2 = _slicedToArray(_ref, 2),
|
|
12
|
+
name = _ref2[0],
|
|
13
|
+
props = _ref2[1];
|
|
15
14
|
var classNames = props.classNames,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
_props$type = props.type,
|
|
16
|
+
type = _props$type === void 0 ? 'simple' : _props$type;
|
|
19
17
|
if (type === 'simple') {
|
|
20
18
|
Vue.component(name, createComponent(name, classNames));
|
|
21
19
|
} else if (type === 'forms') {
|
|
22
20
|
var event = props.event,
|
|
23
|
-
|
|
21
|
+
modelValue = props.modelValue;
|
|
24
22
|
Vue.component(name, createFormsComponent(name, event, modelValue, classNames));
|
|
25
23
|
} else if (type === 'component') {
|
|
26
24
|
Vue.component(name, props.component);
|
|
@@ -3,20 +3,17 @@ export var refs = {
|
|
|
3
3
|
mounted: function mounted() {
|
|
4
4
|
if (this.$parent && _typeof(this.$parent.$refs) === 'object' && Object.keys(this.$parent.$refs).length) {
|
|
5
5
|
var _refs = this.$parent.$refs;
|
|
6
|
-
|
|
7
6
|
if (this._refCacheKey) {
|
|
8
7
|
_refs[this._refCacheKey] = this.$el;
|
|
9
8
|
} else {
|
|
10
9
|
for (var key in _refs) {
|
|
11
10
|
var ref = _refs[key];
|
|
12
|
-
|
|
13
11
|
if (ref === this) {
|
|
14
12
|
this._refCacheKey = key;
|
|
15
13
|
_refs[key] = this.$el;
|
|
16
14
|
break;
|
|
17
15
|
} else if (Array.isArray(ref)) {
|
|
18
16
|
var index = ref.indexOf(this);
|
|
19
|
-
|
|
20
17
|
if (index > -1) {
|
|
21
18
|
ref[index] = this.$el;
|
|
22
19
|
break;
|
|
@@ -29,14 +26,12 @@ export var refs = {
|
|
|
29
26
|
beforeDestroy: function beforeDestroy() {
|
|
30
27
|
if (this.$parent && _typeof(this.$parent.$refs) === 'object' && Object.keys(this.$parent.$refs).length) {
|
|
31
28
|
var _refs2 = this.$parent.$refs;
|
|
32
|
-
|
|
33
29
|
if (this._refCacheKey) {
|
|
34
30
|
_refs2[this._refCacheKey] = this;
|
|
35
31
|
} else {
|
|
36
32
|
for (var key in _refs2) {
|
|
37
33
|
if (Array.isArray(_refs2[key])) {
|
|
38
34
|
var index = _refs2[key].indexOf(this.$el);
|
|
39
|
-
|
|
40
35
|
if (index > -1) {
|
|
41
36
|
_refs2[key][index] = this;
|
|
42
37
|
break;
|
package/dist/vue2/components.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
-
|
|
3
2
|
/* eslint-disable */
|
|
4
|
-
|
|
5
3
|
/* tslint:disable */
|
|
6
|
-
|
|
7
4
|
/* auto-generated vue proxies */
|
|
8
5
|
import Vue from 'vue';
|
|
9
6
|
import { createCommonRender, createCommonMethod } from './vue-component-lib/utils';
|
package/dist/vue2/index.js
CHANGED
|
@@ -4,19 +4,15 @@ import Vue from 'vue';
|
|
|
4
4
|
import * as components from './components';
|
|
5
5
|
export function initVue2Components() {
|
|
6
6
|
var _Vue$config$ignoredEl;
|
|
7
|
-
|
|
8
7
|
var ignoredElements = [/^taro-/, 'root', 'block'];
|
|
9
|
-
|
|
10
8
|
if (!((_Vue$config$ignoredEl = Vue.config.ignoredElements) !== null && _Vue$config$ignoredEl !== void 0 && _Vue$config$ignoredEl.includes(ignoredElements[0]))) {
|
|
11
9
|
Vue.config.ignoredElements = [].concat(_toConsumableArray(Vue.config.ignoredElements), ignoredElements);
|
|
12
10
|
}
|
|
13
|
-
|
|
14
11
|
Object.entries(components).forEach(function (params) {
|
|
15
12
|
var _ref = params,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
_ref2 = _slicedToArray(_ref, 2),
|
|
14
|
+
name = _ref2[0],
|
|
15
|
+
definition = _ref2[1];
|
|
20
16
|
if (definition) {
|
|
21
17
|
var tagName = 'taro' + name.replace(new RegExp('([A-Z])', 'g'), '-$1').toLowerCase();
|
|
22
18
|
Vue.component(tagName, definition);
|
|
@@ -27,7 +27,6 @@ export var createCommonRender = function createCommonRender(tagName) {
|
|
|
27
27
|
export var createCommonMethod = function createCommonMethod(methodName) {
|
|
28
28
|
return function () {
|
|
29
29
|
var _this$$refs$wc;
|
|
30
|
-
|
|
31
30
|
(_this$$refs$wc = this.$refs.wc)[methodName].apply(_this$$refs$wc, arguments);
|
|
32
31
|
};
|
|
33
32
|
};
|
|
@@ -7,7 +7,7 @@ export default function createComponent(name) {
|
|
|
7
7
|
emits: ['tap'],
|
|
8
8
|
setup: function setup(__props, _ref) {
|
|
9
9
|
var slots = _ref.slots,
|
|
10
|
-
|
|
10
|
+
emit = _ref.emit;
|
|
11
11
|
var forwardRef = useForwardRef();
|
|
12
12
|
return function () {
|
|
13
13
|
return h("".concat(name, "-core"), {
|
|
@@ -9,25 +9,20 @@ export default function createFormsComponent(name, eventName) {
|
|
|
9
9
|
var props = {
|
|
10
10
|
modelValue: null
|
|
11
11
|
};
|
|
12
|
-
|
|
13
12
|
if (name === 'taro-input') {
|
|
14
13
|
props.focus = Boolean;
|
|
15
14
|
}
|
|
16
|
-
|
|
17
15
|
return {
|
|
18
16
|
emits: ['tap', 'update:modelValue'],
|
|
19
17
|
props: props,
|
|
20
18
|
setup: function setup(props, _ref) {
|
|
21
19
|
var slots = _ref.slots,
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
emit = _ref.emit;
|
|
24
21
|
var _toRefs = toRefs(props),
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
model = _toRefs.modelValue,
|
|
23
|
+
focus = _toRefs.focus;
|
|
28
24
|
var attrs = computed(function () {
|
|
29
25
|
var _ref2;
|
|
30
|
-
|
|
31
26
|
return name === 'taro-input' ? (_ref2 = {}, _defineProperty(_ref2, modelValue, model.value), _defineProperty(_ref2, 'auto-focus', focus.value), _ref2) : _defineProperty({}, modelValue, model.value);
|
|
32
27
|
});
|
|
33
28
|
var forwardRef = useForwardRef();
|
|
@@ -4,8 +4,8 @@ export default {
|
|
|
4
4
|
emits: ['tap'],
|
|
5
5
|
setup: function setup(__props, _ref) {
|
|
6
6
|
var slots = _ref.slots,
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
emit = _ref.emit,
|
|
8
|
+
attrs = _ref.attrs;
|
|
9
9
|
var iconType = attrs.type.replace(/_/g, '-');
|
|
10
10
|
var forwardRef = useForwardRef();
|
|
11
11
|
return function () {
|
|
@@ -4,8 +4,8 @@ export default {
|
|
|
4
4
|
emits: ['tap'],
|
|
5
5
|
setup: function setup(__props, _ref) {
|
|
6
6
|
var slots = _ref.slots,
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
emit = _ref.emit,
|
|
8
|
+
attrs = _ref.attrs;
|
|
9
9
|
var forwardRef = useForwardRef();
|
|
10
10
|
return function () {
|
|
11
11
|
return h('taro-image-core', {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import createComponent from './createComponent';
|
|
2
|
-
import createFormsComponent from './createFormsComponent';
|
|
2
|
+
import createFormsComponent from './createFormsComponent';
|
|
3
3
|
|
|
4
|
+
// 视图容器
|
|
4
5
|
export var CoverImage = createComponent('taro-cover-image');
|
|
5
6
|
export var CoverView = createComponent('taro-cover-view');
|
|
6
7
|
export var MatchMedia = createComponent('taro-match-media');
|
|
@@ -12,13 +13,15 @@ export { default as ScrollView } from './scroll-view';
|
|
|
12
13
|
export var ShareElement = createComponent('taro-share-element');
|
|
13
14
|
export var Swiper = createComponent('taro-swiper');
|
|
14
15
|
export var SwiperItem = createComponent('taro-swiper-item', ['swiper-slide']);
|
|
15
|
-
export var View = createComponent('taro-view');
|
|
16
|
+
export var View = createComponent('taro-view');
|
|
16
17
|
|
|
18
|
+
// 基础内容
|
|
17
19
|
export { default as Icon } from './icon';
|
|
18
20
|
export var Progress = createComponent('taro-progress', ['weui-progress']);
|
|
19
21
|
export var RichText = createComponent('taro-rich-text');
|
|
20
|
-
export { default as Text } from './text';
|
|
22
|
+
export { default as Text } from './text';
|
|
21
23
|
|
|
24
|
+
// 表单组件
|
|
22
25
|
export var Button = createComponent('taro-button');
|
|
23
26
|
export var Checkbox = createComponent('taro-checkbox', ['weui-cells_checkbox']);
|
|
24
27
|
export var CheckboxGroup = createComponent('taro-checkbox-group');
|
|
@@ -34,32 +37,40 @@ export var Radio = createComponent('taro-radio', ['weui-cells_checkbox']);
|
|
|
34
37
|
export var RadioGroup = createComponent('taro-radio-group', ['weui-cells_radiogroup']);
|
|
35
38
|
export var Slider = createFormsComponent('taro-slider', 'change', 'value', ['weui-slider-box']);
|
|
36
39
|
export var Switch = createFormsComponent('taro-switch', 'change', 'checked');
|
|
37
|
-
export var Textarea = createFormsComponent('taro-textarea', 'input');
|
|
40
|
+
export var Textarea = createFormsComponent('taro-textarea', 'input');
|
|
38
41
|
|
|
42
|
+
// 导航
|
|
39
43
|
export var FunctionalPageNavigator = createComponent('taro-functional-page-navigator');
|
|
40
|
-
export var Navigator = createComponent('taro-navigator');
|
|
44
|
+
export var Navigator = createComponent('taro-navigator');
|
|
41
45
|
|
|
46
|
+
// 媒体组件
|
|
42
47
|
export var Audio = createComponent('taro-audio');
|
|
43
48
|
export var Camera = createComponent('taro-camera');
|
|
44
49
|
export { default as Image } from './image';
|
|
45
50
|
export var LivePlayer = createComponent('taro-live-player');
|
|
46
51
|
export var Video = createComponent('taro-video', ['taro-video-container']);
|
|
47
|
-
export var VoipRoom = createComponent('taro-voip-room');
|
|
52
|
+
export var VoipRoom = createComponent('taro-voip-room');
|
|
48
53
|
|
|
49
|
-
|
|
54
|
+
// 地图
|
|
55
|
+
export var Map = createComponent('taro-map');
|
|
50
56
|
|
|
51
|
-
|
|
57
|
+
// 画布
|
|
58
|
+
export var Canvas = createComponent('taro-canvas');
|
|
52
59
|
|
|
60
|
+
// 开放能力
|
|
53
61
|
export var WebView = createComponent('taro-web-view');
|
|
54
62
|
export var Ad = createComponent('taro-ad');
|
|
55
63
|
export var AdCustom = createComponent('taro-ad-custom');
|
|
56
64
|
export var OfficialAccount = createComponent('taro-official-account');
|
|
57
|
-
export var OpenData = createComponent('taro-open-data');
|
|
65
|
+
export var OpenData = createComponent('taro-open-data');
|
|
58
66
|
|
|
59
|
-
|
|
67
|
+
// 导航栏
|
|
68
|
+
export var NavigationBar = createComponent('taro-navigation-bar');
|
|
60
69
|
|
|
61
|
-
|
|
70
|
+
// 页面属性配置节点
|
|
71
|
+
export var PageMeta = createComponent('taro-page-meta');
|
|
62
72
|
|
|
73
|
+
// 其他
|
|
63
74
|
export var Block = createComponent('taro-block');
|
|
64
75
|
export var CustomWrapper = createComponent('taro-custom-wrapper');
|
|
65
76
|
export var Slot = createComponent('taro-slot');
|
|
@@ -4,8 +4,8 @@ export default {
|
|
|
4
4
|
emits: ['tap', 'scroll'],
|
|
5
5
|
setup: function setup(__props, _ref) {
|
|
6
6
|
var slots = _ref.slots,
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
emit = _ref.emit,
|
|
8
|
+
attrs = _ref.attrs;
|
|
9
9
|
var forwardRef = useForwardRef();
|
|
10
10
|
return function () {
|
|
11
11
|
return h('taro-scroll-view-core', {
|
|
@@ -4,8 +4,8 @@ export default {
|
|
|
4
4
|
emits: ['tap'],
|
|
5
5
|
setup: function setup(__props, _ref) {
|
|
6
6
|
var slots = _ref.slots,
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
emit = _ref.emit,
|
|
8
|
+
attrs = _ref.attrs;
|
|
9
9
|
var forwardRef = useForwardRef();
|
|
10
10
|
return function () {
|
|
11
11
|
return h('taro-text-core', {
|
package/dist/vue3/components.js
CHANGED
package/dist/vue3/index.js
CHANGED
|
@@ -4,12 +4,10 @@ export function initVue3Components(app) {
|
|
|
4
4
|
app.config.isCustomElement = function (tag) {
|
|
5
5
|
return /^taro-/.test(tag) || tag === 'root' || tag === 'block';
|
|
6
6
|
};
|
|
7
|
-
|
|
8
7
|
Object.entries(components).forEach(function (_ref) {
|
|
9
8
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
name = _ref2[0],
|
|
10
|
+
component = _ref2[1];
|
|
13
11
|
if (component) {
|
|
14
12
|
var tagName = 'taro' + name.replace(new RegExp('([A-Z])', 'g'), '-$1').toLowerCase();
|
|
15
13
|
app.component(tagName, component);
|