@solar-taro/plugin-vant 0.0.0
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/README.md +11 -0
- package/index.d.ts +2 -0
- package/index.js +137 -0
- package/index.js.map +1 -0
- package/package.json +14 -0
package/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# plugin-vant
|
|
2
|
+
|
|
3
|
+
This library was generated with [Nx](https://nx.dev).
|
|
4
|
+
|
|
5
|
+
## Building
|
|
6
|
+
|
|
7
|
+
Run `nx build plugin-vant` to build the library.
|
|
8
|
+
|
|
9
|
+
## Running unit tests
|
|
10
|
+
|
|
11
|
+
Run `nx test plugin-vant` to execute the unit tests via [Vitest](https://vitest.dev/).
|
package/index.d.ts
ADDED
package/index.js
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* .vue 编译后会将 `@event-name` 编译为 `onEventName`,
|
|
5
|
+
* 这里我们简单加上 `on` 前缀就可以了
|
|
6
|
+
* @param name
|
|
7
|
+
*/
|
|
8
|
+
function event(name) {
|
|
9
|
+
return 'on' + name;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 收集 sun-mini-core/components 中用到的第三方小程序组件及其属性/事件
|
|
13
|
+
*
|
|
14
|
+
* taro 会在编译期间自动收集**应用程序级别**中显式出现过的第三方小程序组件来生成静态模板,
|
|
15
|
+
* 而这里是一个组件库,taro 并不会扫描到这里,所以我们需要自己收集用到的第三方小程序组件
|
|
16
|
+
*/
|
|
17
|
+
const COMPONENTS = {
|
|
18
|
+
'van-cell': [
|
|
19
|
+
'class',
|
|
20
|
+
'title',
|
|
21
|
+
'label',
|
|
22
|
+
'size',
|
|
23
|
+
'clickable',
|
|
24
|
+
event('tap'),
|
|
25
|
+
],
|
|
26
|
+
'van-button': [
|
|
27
|
+
'type',
|
|
28
|
+
'size',
|
|
29
|
+
'round',
|
|
30
|
+
'hairline',
|
|
31
|
+
'color',
|
|
32
|
+
'block',
|
|
33
|
+
event('tap'),
|
|
34
|
+
event('click'),
|
|
35
|
+
],
|
|
36
|
+
'van-popup': [
|
|
37
|
+
'show',
|
|
38
|
+
'position',
|
|
39
|
+
'round',
|
|
40
|
+
'close-on-click-overlay',
|
|
41
|
+
event('close')
|
|
42
|
+
],
|
|
43
|
+
'van-picker': [
|
|
44
|
+
'title',
|
|
45
|
+
'show-toolbar',
|
|
46
|
+
'value-key',
|
|
47
|
+
'columns',
|
|
48
|
+
'loading',
|
|
49
|
+
event('cancel'),
|
|
50
|
+
event('confirm'),
|
|
51
|
+
event('change')
|
|
52
|
+
],
|
|
53
|
+
'van-search': [
|
|
54
|
+
'label',
|
|
55
|
+
'value',
|
|
56
|
+
'shape',
|
|
57
|
+
'readonly',
|
|
58
|
+
'input-align',
|
|
59
|
+
'placeholder',
|
|
60
|
+
'use-right-icon-slot',
|
|
61
|
+
'clearable',
|
|
62
|
+
'disabled',
|
|
63
|
+
event('change'),
|
|
64
|
+
event('click-input')
|
|
65
|
+
],
|
|
66
|
+
'van-empty': [
|
|
67
|
+
'image',
|
|
68
|
+
'description',
|
|
69
|
+
],
|
|
70
|
+
'van-icon': [
|
|
71
|
+
'class',
|
|
72
|
+
'class-prefix',
|
|
73
|
+
'slot',
|
|
74
|
+
'name',
|
|
75
|
+
'color',
|
|
76
|
+
event('tap')
|
|
77
|
+
],
|
|
78
|
+
'van-overlay': [
|
|
79
|
+
'show'
|
|
80
|
+
],
|
|
81
|
+
'van-field': [
|
|
82
|
+
'label',
|
|
83
|
+
'value',
|
|
84
|
+
'readonly',
|
|
85
|
+
'placeholder',
|
|
86
|
+
'required',
|
|
87
|
+
'disabled',
|
|
88
|
+
event('click-input'),
|
|
89
|
+
],
|
|
90
|
+
'van-action-sheet': [
|
|
91
|
+
'show',
|
|
92
|
+
'title',
|
|
93
|
+
'actions',
|
|
94
|
+
'cancel-text',
|
|
95
|
+
'close-on-click-overlay',
|
|
96
|
+
event('select'),
|
|
97
|
+
event('close'),
|
|
98
|
+
event('cancel')
|
|
99
|
+
],
|
|
100
|
+
'van-datetime-picker': [
|
|
101
|
+
'id',
|
|
102
|
+
'type',
|
|
103
|
+
'show-toolbar',
|
|
104
|
+
'value',
|
|
105
|
+
'min-date',
|
|
106
|
+
'max-date',
|
|
107
|
+
event('modify'),
|
|
108
|
+
event('change'),
|
|
109
|
+
],
|
|
110
|
+
'van-dialog': [
|
|
111
|
+
'show',
|
|
112
|
+
'title',
|
|
113
|
+
'use-slot',
|
|
114
|
+
'show-cancel-button',
|
|
115
|
+
'cancel-button-text',
|
|
116
|
+
'confirm-button-text',
|
|
117
|
+
'confirm-button-id',
|
|
118
|
+
'confirm-button-open-type',
|
|
119
|
+
event('agreeprivacyauthorization')
|
|
120
|
+
]
|
|
121
|
+
};
|
|
122
|
+
exports.default = (context) => {
|
|
123
|
+
context.modifyComponentConfig(({ componentConfig }) => {
|
|
124
|
+
Object.keys(COMPONENTS).forEach(compName => {
|
|
125
|
+
const attrs = COMPONENTS[compName];
|
|
126
|
+
const attrSet = componentConfig.thirdPartyComponents.get(compName);
|
|
127
|
+
if (attrSet) {
|
|
128
|
+
attrs.forEach(attr => attrSet.add(attr));
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
componentConfig.thirdPartyComponents.set(compName, new Set(attrs));
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
componentConfig.includes.add('slot-view');
|
|
135
|
+
});
|
|
136
|
+
};
|
|
137
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/plugin-vant/src/index.ts"],"names":[],"mappings":";;AAOA;;;;GAIG;AACH,SAAS,KAAK,CAAC,IAAY;IACzB,OAAO,IAAI,GAAG,IAAI,CAAC;AACrB,CAAC;AAED;;;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
+
"dependencies": {
|
|
9
|
+
"tslib": "^2.3.0"
|
|
10
|
+
},
|
|
11
|
+
"types": "./index.d.ts",
|
|
12
|
+
"main": "./index.js",
|
|
13
|
+
"type": "commonjs"
|
|
14
|
+
}
|