@vtj/materials 0.9.30 → 0.10.1-alpha.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.
Files changed (56) hide show
  1. package/dist/assets/antdv/index.umd.js +2 -2
  2. package/dist/assets/charts/index.umd.js +2 -2
  3. package/dist/assets/element/index.umd.js +2 -2
  4. package/dist/assets/ui/index.umd.js +2 -2
  5. package/dist/assets/uni-h5/index.umd.js +7 -0
  6. package/dist/assets/vant/index.umd.js +5 -5
  7. package/dist/deps/@vtj/charts/index.umd.js +2 -2
  8. package/dist/deps/@vtj/icons/index.umd.js +2 -2
  9. package/dist/deps/@vtj/icons/style.css +1 -1
  10. package/dist/deps/@vtj/ui/index.umd.js +2 -2
  11. package/dist/deps/@vtj/uni/index.umd.js +7 -0
  12. package/dist/deps/@vtj/uni/style.css +1 -0
  13. package/dist/deps/@vtj/utils/index.umd.js +2 -2
  14. package/dist/deps/@vueuse/core/index.iife.min.js +1 -1
  15. package/dist/deps/uni-app/index.umd.js +1 -0
  16. package/dist/deps/uni-h5/index.umd.js +19 -0
  17. package/dist/deps/uni-h5/style.css +1 -0
  18. package/dist/deps/uni-h5-vue/index.umd.js +8 -0
  19. package/package.json +15 -8
  20. package/src/uni-app/index.ts +1 -0
  21. package/src/uni-h5/components/Switch.ts +36 -0
  22. package/src/uni-h5/components/audio.ts +69 -0
  23. package/src/uni-h5/components/button.ts +206 -0
  24. package/src/uni-h5/components/canvas.ts +50 -0
  25. package/src/uni-h5/components/checkbox.ts +81 -0
  26. package/src/uni-h5/components/coverImage.ts +18 -0
  27. package/src/uni-h5/components/coverView.ts +19 -0
  28. package/src/uni-h5/components/editor.ts +49 -0
  29. package/src/uni-h5/components/form.ts +53 -0
  30. package/src/uni-h5/components/icon.ts +44 -0
  31. package/src/uni-h5/components/image.ts +80 -0
  32. package/src/uni-h5/components/index.ts +119 -0
  33. package/src/uni-h5/components/input.ts +220 -0
  34. package/src/uni-h5/components/label.ts +17 -0
  35. package/src/uni-h5/components/map.ts +207 -0
  36. package/src/uni-h5/components/matchMedia.ts +59 -0
  37. package/src/uni-h5/components/movableArea.ts +31 -0
  38. package/src/uni-h5/components/movableView.ts +97 -0
  39. package/src/uni-h5/components/navigator.ts +90 -0
  40. package/src/uni-h5/components/picker.ts +81 -0
  41. package/src/uni-h5/components/pickerView.ts +163 -0
  42. package/src/uni-h5/components/progress.ts +71 -0
  43. package/src/uni-h5/components/radio.ts +127 -0
  44. package/src/uni-h5/components/richText.ts +67 -0
  45. package/src/uni-h5/components/scrollView.ts +157 -0
  46. package/src/uni-h5/components/slider.ts +75 -0
  47. package/src/uni-h5/components/swiper.ts +220 -0
  48. package/src/uni-h5/components/text.ts +38 -0
  49. package/src/uni-h5/components/textarea.ts +169 -0
  50. package/src/uni-h5/components/video.ts +276 -0
  51. package/src/uni-h5/components/view.ts +39 -0
  52. package/src/uni-h5/components/webView.ts +54 -0
  53. package/src/uni-h5/index.ts +11 -0
  54. package/src/uni-h5/style.scss +59 -0
  55. package/src/uni-h5-vue/index.ts +2 -0
  56. package/src/version.ts +2 -2
@@ -0,0 +1,206 @@
1
+ import type { MaterialDescription } from '@vtj/core';
2
+
3
+ const desc: MaterialDescription = {
4
+ name: 'Button',
5
+ label: '按钮',
6
+ categoryId: 'form',
7
+ props: [
8
+ {
9
+ name: 'size',
10
+ title: '按钮的大小',
11
+ defaultValue: 'default',
12
+ setters: 'SelectSetter',
13
+ options: ['default', 'mini']
14
+ },
15
+ {
16
+ name: 'type',
17
+ title: '按钮的样式类型',
18
+ defaultValue: 'default',
19
+ setters: 'SelectSetter',
20
+ options: ['primary', 'default', 'warn']
21
+ },
22
+ {
23
+ name: 'plain',
24
+ title: '按钮是否镂空,背景色透明',
25
+ defaultValue: false,
26
+ setters: 'BooleanSetter'
27
+ },
28
+ {
29
+ name: 'disabled',
30
+ title: '是否禁用',
31
+ defaultValue: false,
32
+ setters: 'BooleanSetter'
33
+ },
34
+ {
35
+ name: 'loading',
36
+ title: '名称前是否带 loading 图标',
37
+ defaultValue: false,
38
+ setters: 'BooleanSetter'
39
+ },
40
+ {
41
+ name: 'form-type',
42
+ title: '用于 <form> 组件,点击分别会触发 <form> 组件的 submit/reset 事件',
43
+ setters: 'SelectSetter',
44
+ options: ['submit', 'reset']
45
+ },
46
+ {
47
+ name: 'open-type',
48
+ title: '开放能力',
49
+ setters: 'SelectSetter',
50
+ options: [
51
+ 'feedback',
52
+ 'share',
53
+ 'getUserInfo',
54
+ 'contact',
55
+ 'getPhoneNumber',
56
+ 'launchApp',
57
+ 'openSetting',
58
+ 'chooseAvatar',
59
+ 'agreePrivacyAuthorization',
60
+ 'uploadDouyinVideo',
61
+ 'im',
62
+ 'getAuthorize',
63
+ 'lifestyle',
64
+ 'contactShare',
65
+ 'openGroupProfile',
66
+ 'openGuildProfile',
67
+ 'openPublicProfile',
68
+ 'shareMessageToFriend',
69
+ 'addFriend',
70
+ 'addColorSign',
71
+ 'addGroupApp',
72
+ 'addToFavorites',
73
+ 'chooseAddress',
74
+ 'chooseInvoiceTitle',
75
+ 'login',
76
+ 'subscribe',
77
+ 'favorite',
78
+ 'watchLater',
79
+ 'openProfile'
80
+ ]
81
+ },
82
+ {
83
+ name: 'hover-class',
84
+ title: '指定按钮按下去的样式类',
85
+ defaultValue: 'button-hover',
86
+ setters: 'StringSetter'
87
+ },
88
+ {
89
+ name: 'hover-start-time',
90
+ title: '按住后多久出现点击态,单位毫秒',
91
+ defaultValue: 20,
92
+ setters: 'NumberSetter'
93
+ },
94
+ {
95
+ name: 'hover-stay-time',
96
+ title: '手指松开后点击态保留时间,单位毫秒',
97
+ defaultValue: 70,
98
+ setters: 'NumberSetter'
99
+ },
100
+ {
101
+ name: 'app-parameter',
102
+ title: '打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效',
103
+ setters: 'StringSetter'
104
+ },
105
+ {
106
+ name: 'hover-stop-propagation',
107
+ title: '指定是否阻止本节点的祖先节点出现点击态',
108
+ defaultValue: false,
109
+ setters: 'BooleanSetter'
110
+ },
111
+ {
112
+ name: 'lang',
113
+ title: '指定返回用户信息的语言',
114
+ defaultValue: 'en',
115
+ setters: 'SelectSetter',
116
+ options: ['en', 'zh_CN', 'zh_TW']
117
+ },
118
+ {
119
+ name: 'session-from',
120
+ title: '会话来源,open-type="contact"时有效',
121
+ setters: 'StringSetter'
122
+ },
123
+ {
124
+ name: 'send-message-title',
125
+ title: '会话内消息卡片标题,open-type="contact"时有效',
126
+ setters: 'StringSetter'
127
+ },
128
+ {
129
+ name: 'send-message-path',
130
+ title: '会话内消息卡片点击跳转小程序路径,open-type="contact"时有效',
131
+ setters: 'StringSetter'
132
+ },
133
+ {
134
+ name: 'send-message-img',
135
+ title: '会话内消息卡片图片,open-type="contact"时有效',
136
+ setters: 'StringSetter'
137
+ },
138
+ {
139
+ name: 'show-message-card',
140
+ title: '是否显示会话内消息卡片',
141
+ defaultValue: false,
142
+ setters: 'BooleanSetter'
143
+ },
144
+ {
145
+ name: 'group-id',
146
+ title: '打开群资料卡时,传递的群号',
147
+ setters: 'StringSetter'
148
+ },
149
+ {
150
+ name: 'guild-id',
151
+ title: '打开频道页面时,传递的频道号',
152
+ setters: 'StringSetter'
153
+ },
154
+ {
155
+ name: 'public-id',
156
+ title: '打开公众号资料卡时,传递的号码',
157
+ setters: 'StringSetter'
158
+ },
159
+ {
160
+ name: 'data-im-id',
161
+ title: '客服的抖音号',
162
+ setters: 'StringSetter'
163
+ },
164
+ {
165
+ name: 'data-im-type',
166
+ title: 'IM卡片类型',
167
+ setters: 'StringSetter'
168
+ },
169
+ {
170
+ name: 'data-goods-id',
171
+ title: '商品的id',
172
+ setters: 'StringSetter'
173
+ },
174
+ {
175
+ name: 'data-order-id',
176
+ title: '订单的id,仅支持交易2.0订单',
177
+ setters: 'StringSetter'
178
+ },
179
+ {
180
+ name: 'data-biz-line',
181
+ title: '商品类型,“1”代表生活服务,“2”代表泛知识。',
182
+ setters: 'StringSetter'
183
+ }
184
+ ],
185
+ events: [
186
+ 'getphonenumber',
187
+ 'getuserinfo',
188
+ 'error',
189
+ 'opensetting',
190
+ 'launchapp',
191
+ 'contact',
192
+ 'chooseavatar',
193
+ 'agreeprivacyauthorization',
194
+ 'addgroupapp',
195
+ 'chooseaddress',
196
+ 'chooseinvoicetitle',
197
+ 'subscribe',
198
+ 'login',
199
+ 'im'
200
+ ],
201
+ snippet: {
202
+ children: 'Button'
203
+ }
204
+ };
205
+
206
+ export default desc;
@@ -0,0 +1,50 @@
1
+ import type { MaterialDescription } from '@vtj/core';
2
+
3
+ const desc: MaterialDescription = {
4
+ name: 'Canvas',
5
+ label: '画布',
6
+ categoryId: 'media',
7
+ props: [
8
+ {
9
+ name: 'type',
10
+ title: '指定 canvas 类型,支持 2d (2.9.0) 和 webgl',
11
+ defaultValue: '',
12
+ setters: 'SelectSetter',
13
+ options: ['2d', 'webgl']
14
+ },
15
+ {
16
+ name: 'canvas-id',
17
+ title: 'canvas 组件的唯一标识符',
18
+ setters: 'StringSetter'
19
+ },
20
+ {
21
+ name: 'disable-scroll',
22
+ title: '当在 canvas 中移动时且有绑定手势事件时,禁止屏幕滚动以及下拉刷新',
23
+ defaultValue: false,
24
+ setters: 'BooleanSetter'
25
+ },
26
+ {
27
+ name: 'hidpi',
28
+ title: '是否启用高清处理',
29
+ defaultValue: true,
30
+ setters: 'BooleanSetter'
31
+ }
32
+ ],
33
+ events: [
34
+ 'touchstart',
35
+ 'touchmove',
36
+ 'touchend',
37
+ 'touchcancel',
38
+ 'longtap',
39
+ 'error'
40
+ ],
41
+ snippet: {
42
+ props: {
43
+ style: { width: '300px', height: '200px' },
44
+ 'canvas-id': 'firstCanvas',
45
+ id: 'firstCanvas'
46
+ }
47
+ }
48
+ };
49
+
50
+ export default desc;
@@ -0,0 +1,81 @@
1
+ import type { MaterialDescription } from '@vtj/core';
2
+
3
+ const desc: MaterialDescription[] = [
4
+ {
5
+ name: 'CheckboxGroup',
6
+ label: '多选框组',
7
+ categoryId: 'form',
8
+ events: ['change'],
9
+ snippet: {
10
+ children: [
11
+ { name: 'Checkbox', props: { checked: true }, children: '选中' },
12
+ { name: 'Checkbox', props: { checked: false }, children: '未选中' }
13
+ ]
14
+ }
15
+ },
16
+ {
17
+ name: 'Checkbox',
18
+ label: '多选项',
19
+ categoryId: 'form',
20
+ props: [
21
+ {
22
+ name: 'value',
23
+ title:
24
+ '<checkbox> 标识,选中时触发 <checkbox-group> 的 change 事件,并携带 <checkbox> 的 value。',
25
+ setters: 'StringSetter'
26
+ },
27
+ {
28
+ name: 'disabled',
29
+ title: '是否禁用',
30
+ defaultValue: false,
31
+ setters: 'BooleanSetter'
32
+ },
33
+ {
34
+ name: 'checked',
35
+ title: '当前是否选中,可用来设置默认选中',
36
+ defaultValue: false,
37
+ setters: 'BooleanSetter'
38
+ },
39
+ {
40
+ name: 'color',
41
+ title: 'checkbox的颜色,同css的color',
42
+ setters: 'ColorSetter'
43
+ },
44
+ {
45
+ name: 'backgroundColor',
46
+ title: 'checkbox默认的背景颜色',
47
+ defaultValue: '#ffffff',
48
+ setters: 'ColorSetter'
49
+ },
50
+ {
51
+ name: 'borderColor',
52
+ title: 'checkbox默认的边框颜色',
53
+ defaultValue: '#d1d1d1',
54
+ setters: 'ColorSetter'
55
+ },
56
+ {
57
+ name: 'activeBackgroundColor',
58
+ title: 'checkbox选中时的背景颜色,优先级大于color属性',
59
+ defaultValue: '#ffffff',
60
+ setters: 'ColorSetter'
61
+ },
62
+ {
63
+ name: 'activeBorderColor',
64
+ title: 'checkbox选中时的边框颜色',
65
+ defaultValue: '#d1d1d1',
66
+ setters: 'ColorSetter'
67
+ },
68
+ {
69
+ name: 'iconColor',
70
+ title: 'checkbox的图标颜色',
71
+ defaultValue: '#007aff',
72
+ setters: 'ColorSetter'
73
+ }
74
+ ],
75
+ snippet: {
76
+ children: '选项'
77
+ }
78
+ }
79
+ ];
80
+
81
+ export default desc;
@@ -0,0 +1,18 @@
1
+ import type { MaterialDescription } from '@vtj/core';
2
+
3
+ const desc: MaterialDescription = {
4
+ name: 'CoverImage',
5
+ label: '图片视图',
6
+ categoryId: 'container',
7
+ props: [
8
+ {
9
+ name: 'src',
10
+ title: '图标路径。支持本地路径、网络路径。不支持 base64 格式。',
11
+ setters: 'StringSetter'
12
+ }
13
+ ],
14
+ events: ['load', 'error', 'click'],
15
+ snippet: {}
16
+ };
17
+
18
+ export default desc;
@@ -0,0 +1,19 @@
1
+ import type { MaterialDescription } from '@vtj/core';
2
+
3
+ const desc: MaterialDescription = {
4
+ name: 'CoverView',
5
+ label: '文本视图',
6
+ categoryId: 'container',
7
+ props: [
8
+ {
9
+ name: 'scroll-top',
10
+ title:
11
+ '设置顶部滚动偏移量,仅在设置了 overflow-y: scroll 成为滚动元素后生效',
12
+ setters: ['NumberSetter', 'StringSetter']
13
+ }
14
+ ],
15
+ events: ['click'],
16
+ snippet: {}
17
+ };
18
+
19
+ export default desc;
@@ -0,0 +1,49 @@
1
+ import type { MaterialDescription } from '@vtj/core';
2
+
3
+ const desc: MaterialDescription = {
4
+ name: 'Editor',
5
+ label: '富文本编辑器',
6
+ categoryId: 'form',
7
+ props: [
8
+ {
9
+ name: 'read-only',
10
+ title: '设置编辑器为只读',
11
+ defaultValue: false,
12
+ setters: 'BooleanSetter'
13
+ },
14
+ {
15
+ name: 'placeholder',
16
+ title: '提示信息',
17
+ setters: 'BooleanSetter'
18
+ },
19
+ {
20
+ name: 'show-img-size',
21
+ title: '点击图片时显示图片大小控件',
22
+ defaultValue: false,
23
+ setters: 'BooleanSetter'
24
+ },
25
+ {
26
+ name: 'show-img-toolbar',
27
+ title: '点击图片时显示工具栏控件',
28
+ defaultValue: false,
29
+ setters: 'BooleanSetter'
30
+ },
31
+ {
32
+ name: 'show-img-resize',
33
+ title: '点击图片时显示修改尺寸控件',
34
+ defaultValue: false,
35
+ setters: 'BooleanSetter'
36
+ }
37
+ ],
38
+ events: ['ready', 'focus', 'blur', 'input', 'statuschange'],
39
+ snippet: {
40
+ props: {
41
+ placeholder: '开始输入...',
42
+ 'show-img-size': true,
43
+ 'show-img-toolbar': true,
44
+ 'show-img-resize': true
45
+ }
46
+ }
47
+ };
48
+
49
+ export default desc;
@@ -0,0 +1,53 @@
1
+ import type { MaterialDescription } from '@vtj/core';
2
+
3
+ const desc: MaterialDescription = {
4
+ name: 'Form',
5
+ label: '表单',
6
+ categoryId: 'form',
7
+ props: [
8
+ {
9
+ name: 'report-submit',
10
+ title: '是否返回 formId 用于发送模板消息',
11
+ setters: 'BooleanSetter'
12
+ },
13
+ {
14
+ name: 'report-submit-timeout',
15
+ title: '等待一段时间(毫秒数)以确认 formId 是否生效',
16
+ setters: 'NumberSetter'
17
+ }
18
+ ],
19
+ events: ['submit', 'reset'],
20
+ snippet: {
21
+ children: [
22
+ {
23
+ name: 'Label',
24
+ children: [
25
+ { name: 'View', children: '用户名' },
26
+ {
27
+ name: 'Input',
28
+ props: {
29
+ style: { height: '40px', backgroundColor: '#f0f0f0' },
30
+ placeholder: '请输入用户名'
31
+ }
32
+ }
33
+ ]
34
+ },
35
+ {
36
+ name: 'Label',
37
+ children: [
38
+ { name: 'View', children: '密码' },
39
+ {
40
+ name: 'Input',
41
+ props: {
42
+ style: { height: '40px', backgroundColor: '#f0f0f0' },
43
+ placeholder: '请输入密码'
44
+ }
45
+ }
46
+ ]
47
+ },
48
+ { name: 'Button', children: '提交' }
49
+ ]
50
+ }
51
+ };
52
+
53
+ export default desc;
@@ -0,0 +1,44 @@
1
+ import type { MaterialDescription } from '@vtj/core';
2
+
3
+ const desc: MaterialDescription = {
4
+ name: 'Icon',
5
+ label: '图标',
6
+ categoryId: 'basic',
7
+ props: [
8
+ {
9
+ name: 'type',
10
+ title: 'icon的类型',
11
+ setters: 'SelectSetter',
12
+ options: [
13
+ 'success',
14
+ 'success_no_circle',
15
+ 'info',
16
+ 'warn',
17
+ 'waiting',
18
+ 'cancel',
19
+ 'download',
20
+ 'search',
21
+ 'clear'
22
+ ]
23
+ },
24
+ {
25
+ name: 'size',
26
+ title: 'icon的大小, 单位px',
27
+ defaultValue: 23,
28
+ setters: 'NumberSetter'
29
+ },
30
+ {
31
+ name: 'color',
32
+ title: 'icon的颜色,同css的color',
33
+ setters: 'ColorSetter'
34
+ }
35
+ ],
36
+ snippet: {
37
+ props: {
38
+ type: 'success',
39
+ size: 26
40
+ }
41
+ }
42
+ };
43
+
44
+ export default desc;
@@ -0,0 +1,80 @@
1
+ import type { MaterialDescription } from '@vtj/core';
2
+
3
+ const desc: MaterialDescription = {
4
+ name: 'Image',
5
+ label: '图片',
6
+ categoryId: 'media',
7
+ props: [
8
+ {
9
+ name: 'src',
10
+ title: '图片资源地址',
11
+ setters: 'StringSetter'
12
+ },
13
+ {
14
+ name: 'mode',
15
+ title: '图片裁剪、缩放的模式',
16
+ defaultValue: 'scaleToFill',
17
+ setters: 'SelectSetter',
18
+ options: [
19
+ 'scaleToFill',
20
+ 'aspectFit',
21
+ 'aspectFill',
22
+ 'widthFix',
23
+ 'heightFix',
24
+ 'top',
25
+ 'bottom',
26
+ 'center',
27
+ 'left',
28
+ 'right',
29
+ 'top left',
30
+ 'top right',
31
+ 'bottom left',
32
+ 'bottom right'
33
+ ]
34
+ },
35
+ {
36
+ name: 'lazy-load',
37
+ title: '图片懒加载',
38
+ defaultValue: false,
39
+ setters: 'BooleanSetter'
40
+ },
41
+ {
42
+ name: 'fade-show',
43
+ title: '图片显示动画效果',
44
+ defaultValue: true,
45
+ setters: 'BooleanSetter'
46
+ },
47
+ {
48
+ name: 'webp',
49
+ title:
50
+ '在系统不支持webp的情况下是否单独启用webp。默认false,只支持网络资源',
51
+ defaultValue: false,
52
+ setters: 'BooleanSetter'
53
+ },
54
+ {
55
+ name: 'show-menu-by-longpress',
56
+ title: '开启长按图片显示识别小程序码菜单',
57
+ defaultValue: false,
58
+ setters: 'BooleanSetter'
59
+ },
60
+ {
61
+ name: 'draggable',
62
+ title: '是否能拖动图片',
63
+ defaultValue: true,
64
+ setters: 'BooleanSetter'
65
+ }
66
+ ],
67
+ events: ['error', 'load'],
68
+ snippet: {
69
+ props: {
70
+ src: 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/shuijiao.jpg',
71
+ style: {
72
+ width: '200px',
73
+ height: '200px',
74
+ backgroundColor: '#eeeeee'
75
+ }
76
+ }
77
+ }
78
+ };
79
+
80
+ export default desc;