@cloudbase/weda-ui 0.2.16 → 0.2.17

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 (86) hide show
  1. package/README.md +39 -170
  2. package/package.json +17 -10
  3. package/src/configs/components/chart/bar.json +711 -0
  4. package/src/configs/components/chart/line.json +666 -0
  5. package/src/configs/components/chart/pie.json +487 -0
  6. package/src/configs/components/listView.json +2 -1
  7. package/src/configs/index.js +7 -0
  8. package/src/mp/components/chart/bar/index.js +254 -0
  9. package/src/mp/components/chart/bar/index.json +6 -0
  10. package/src/mp/components/chart/bar/index.wxml +3 -0
  11. package/src/mp/components/chart/bar/index.wxss +9 -0
  12. package/src/mp/components/chart/common/config/bar.js +50 -0
  13. package/src/mp/components/chart/common/config/global.js +16 -0
  14. package/src/mp/components/chart/common/config/line.js +48 -0
  15. package/src/mp/components/chart/common/config/pie.js +36 -0
  16. package/src/mp/components/chart/common/core/eChartBar.js +262 -0
  17. package/src/mp/components/chart/common/core/eChartBase.js +371 -0
  18. package/src/mp/components/chart/common/core/eChartLine.js +228 -0
  19. package/src/mp/components/chart/common/core/eChartPie.js +166 -0
  20. package/src/mp/components/chart/common/lib/echarts.min.js +18 -0
  21. package/src/mp/components/chart/ec-canvas/ec-canvas.js +277 -0
  22. package/src/mp/components/chart/ec-canvas/ec-canvas.json +4 -0
  23. package/src/mp/components/chart/ec-canvas/ec-canvas.wxml +4 -0
  24. package/src/mp/components/chart/ec-canvas/ec-canvas.wxss +4 -0
  25. package/src/mp/components/chart/ec-canvas/wx-canvas.js +107 -0
  26. package/src/mp/components/chart/line/index.js +243 -0
  27. package/src/mp/components/chart/line/index.json +6 -0
  28. package/src/mp/components/chart/line/index.wxml +3 -0
  29. package/src/mp/components/chart/line/index.wxss +9 -0
  30. package/src/mp/components/chart/pie/index.js +178 -0
  31. package/src/mp/components/chart/pie/index.json +6 -0
  32. package/src/mp/components/chart/pie/index.wxml +4 -0
  33. package/src/mp/components/chart/pie/index.wxss +9 -0
  34. package/src/mp/components/dataView/index.json +1 -1
  35. package/src/mp/components/form/radio/index.js +5 -0
  36. package/src/mp/components/form/select/index.wxml +4 -4
  37. package/src/mp/components/form/textarea/index.wxml +6 -5
  38. package/src/mp/components/form/uploader/index.js +42 -22
  39. package/src/mp/components/form/uploader/index.wxml +15 -3
  40. package/src/mp/components/form/uploaderFile/index.js +58 -30
  41. package/src/mp/components/graphicCard/index.js +26 -28
  42. package/src/mp/components/internals/listView/arrow-right-line.svg +3 -0
  43. package/src/mp/components/internals/listView/index.js +286 -0
  44. package/src/mp/components/internals/listView/index.json +4 -0
  45. package/src/mp/components/internals/listView/index.wxml +40 -0
  46. package/src/mp/components/internals/listView/index.wxss +150 -0
  47. package/src/mp/components/internals/listView/more-line.svg +3 -0
  48. package/src/mp/components/listView/index.js +17 -24
  49. package/src/mp/components/listView/index.wxml +1 -1
  50. package/src/mp/components/navLayout/index.js +3 -3
  51. package/src/mp/index.json +3 -0
  52. package/src/mp/utils/platform.js +15 -0
  53. package/src/setupTests.js +2 -1
  54. package/src/web/components/chart/bar/index.tsx +139 -0
  55. package/src/web/components/chart/common/config/bar.js +49 -0
  56. package/src/web/components/chart/common/config/global.js +16 -0
  57. package/src/web/components/chart/common/config/line.js +50 -0
  58. package/src/web/components/chart/common/config/pie.js +37 -0
  59. package/src/web/components/chart/common/core/eChartBar.js +264 -0
  60. package/src/web/components/chart/common/core/eChartBase.ts +379 -0
  61. package/src/web/components/chart/common/core/eChartLine.js +229 -0
  62. package/src/web/components/chart/common/core/eChartPie.js +170 -0
  63. package/src/web/components/chart/common/core/type.ts +34 -0
  64. package/src/web/components/chart/common/echart.css +106 -0
  65. package/src/web/components/chart/common/echarts.ts +33 -0
  66. package/src/web/components/chart/common/useChart.tsx +69 -0
  67. package/src/web/components/chart/line/index.tsx +135 -0
  68. package/src/web/components/chart/pie/index.tsx +99 -0
  69. package/src/web/components/form/location/components/LocationH5/location.h5.jsx +3 -3
  70. package/src/web/components/form/location/components/LocationPC/location.PC.jsx +2 -2
  71. package/src/web/components/form/select/h5.tsx +3 -1
  72. package/src/web/components/form/select/time.jsx +1 -0
  73. package/src/web/components/form/uploader/uploader.h5.tsx +19 -17
  74. package/src/web/components/form/uploader/uploader.pc.tsx +13 -16
  75. package/src/web/components/form/uploaderFile/uploadFile.h5.tsx +35 -37
  76. package/src/web/components/form/uploaderFile/uploadFile.pc.tsx +15 -21
  77. package/src/web/components/graphicCard/index.css +1 -5
  78. package/src/web/components/graphicCard/index.tsx +4 -3
  79. package/src/web/components/index.js +5 -2
  80. package/src/web/utils/platform.js +1 -1
  81. package/src/web/utils/tcb.js +3 -15
  82. package/CHANGELOG.md +0 -240
  83. package/src/.DS_Store +0 -0
  84. package/src/configs/.DS_Store +0 -0
  85. package/src/mp/.gitignore +0 -10
  86. package/src/web/.DS_Store +0 -0
@@ -0,0 +1,487 @@
1
+ {
2
+ "$schema": "https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/schema/lcds_component.json",
3
+ "data": {
4
+ "type": "object",
5
+ "properties": {
6
+ "chartType": {
7
+ "title": "图形类型",
8
+ "type": "string",
9
+ "default": "pie",
10
+ "x-component": "radio",
11
+ "x-index": 10,
12
+ "enum": [
13
+ {
14
+ "label": "饼形",
15
+ "value": "pie"
16
+ },
17
+ {
18
+ "label": "环形",
19
+ "value": "ring"
20
+ }
21
+ ]
22
+ },
23
+ "isTitle": {
24
+ "title": "显示标题",
25
+ "type": "boolean",
26
+ "default": true,
27
+ "x-index": 20,
28
+ "x-linkages": [
29
+ {
30
+ "type": "value:visible",
31
+ "target": "*(title)",
32
+ "condition": "{{ $self.value }}"
33
+ }
34
+ ]
35
+ },
36
+ "title": {
37
+ "title": "图表标题",
38
+ "default": "饼图标题",
39
+ "type": "string",
40
+ "x-index": 30
41
+ },
42
+ "dataSource": {
43
+ "type": "object",
44
+ "title": "数据源",
45
+ "x-index": 40,
46
+ "x-component": "chart-datasource-select",
47
+ "x-component-props": {
48
+ "postChange": {
49
+ "addOrUpdateComponentDataBinds": {
50
+ "dataBind": {
51
+ "propertyPath": "filterData",
52
+ "bindDataPath": "[]",
53
+ "type": "expression",
54
+ "extra": {}
55
+ }
56
+ }
57
+ }
58
+ },
59
+ "x-linkages": [
60
+ {
61
+ "type": "value:visible",
62
+ "target": "*(filterData)",
63
+ "condition": "{{ $self.value.type ==='database' || $self.value.type ==='cloud-integration' }}"
64
+ },
65
+ {
66
+ "type": "value:schema",
67
+ "condition": "{{ !!$self.value.name }}",
68
+ "target": "filterData",
69
+ "schema": {
70
+ "x-component-props": "{{{selectedDataSourceName: $self.value.name}}}"
71
+ }
72
+ },
73
+ {
74
+ "type": "value:visible",
75
+ "target": "*(xFieldShow,xField,xStatistics,xIsCountEmpty,yField)",
76
+ "condition": "{{ $self.value.type ==='database' }}"
77
+ }
78
+ ]
79
+ },
80
+ "filterData": {
81
+ "title": "数据筛选",
82
+ "x-index": 50,
83
+ "x-component": "condition-select",
84
+ "x-component-props": {
85
+ "dataSourceNamePropKey": "dataSource",
86
+ "customRelOptions": {
87
+ "string": [
88
+ {
89
+ "value": "eq",
90
+ "text": "等于"
91
+ },
92
+ {
93
+ "value": "neq",
94
+ "text": "不等于"
95
+ },
96
+ {
97
+ "value": "in",
98
+ "text": "包含"
99
+ },
100
+ {
101
+ "value": "nin",
102
+ "text": "不包含"
103
+ }
104
+ ],
105
+ "boolean": [
106
+ {
107
+ "value": "eq",
108
+ "text": "等于"
109
+ }
110
+ ],
111
+ "number": [
112
+ {
113
+ "value": "eq",
114
+ "text": "等于",
115
+ "type": "equal"
116
+ },
117
+ {
118
+ "value": "neq",
119
+ "text": "不等于",
120
+ "type": "unequal"
121
+ },
122
+ {
123
+ "value": "gt",
124
+ "text": "大于",
125
+ "type": "greater"
126
+ },
127
+ {
128
+ "value": "gte",
129
+ "text": "大于等于",
130
+ "type": "greater_or_equal"
131
+ },
132
+ {
133
+ "value": "lt",
134
+ "text": "小于",
135
+ "type": "less"
136
+ },
137
+ {
138
+ "value": "lte",
139
+ "text": "小于等于",
140
+ "type": "less_or_equal"
141
+ }
142
+ ],
143
+ "array": [
144
+ {
145
+ "value": "eq",
146
+ "text": "等于"
147
+ },
148
+ {
149
+ "value": "in",
150
+ "text": "包含"
151
+ }
152
+ ],
153
+ "object": [
154
+ {
155
+ "value": "eq",
156
+ "text": "等于"
157
+ },
158
+ {
159
+ "value": "in",
160
+ "text": "包含"
161
+ }
162
+ ],
163
+ "keyVarType": [
164
+ {
165
+ "value": "eq",
166
+ "text": "等于"
167
+ },
168
+ {
169
+ "value": "neq",
170
+ "text": "不等于"
171
+ },
172
+ {
173
+ "value": "gt",
174
+ "text": "大于"
175
+ },
176
+ {
177
+ "value": "lt",
178
+ "text": "小于"
179
+ }
180
+ ]
181
+ }
182
+ },
183
+ "x-props": {
184
+ "data-hidebind": true,
185
+ "data-hideBindValue": true,
186
+ "data-withBindMeta": true
187
+ }
188
+ },
189
+ "setColor": {
190
+ "type": "array",
191
+ "title": "配色",
192
+ "x-index": 60,
193
+ "x-component": "color-plate"
194
+ },
195
+ "dimensionalityShow": {
196
+ "x-index": 70,
197
+ "x-category": "基础属性",
198
+ "x-component": "sub-category-title",
199
+ "x-component-props": {
200
+ "text": "维度"
201
+ }
202
+ },
203
+ "xField": {
204
+ "type": "object",
205
+ "title": "字段选择",
206
+ "x-index": 80,
207
+ "x-category": "基础属性",
208
+ "x-component": "data-source-field-select",
209
+ "x-datasource-method-reset": "",
210
+ "x-component-props": {
211
+ "dataSourceNamePropKey": "dataSource",
212
+ "isMethod": true
213
+ },
214
+ "x-linkages": [
215
+ {
216
+ "type": "value:schema",
217
+ "condition": "{{ $self.inputed && !!$self.value }}",
218
+ "target": "xStatistics",
219
+ "schema": {
220
+ "enum": "{{$self.value.format ==='datetime' ? [{'label':'年','value':'y'},{'label':'月','value':'m'},{'label':'周','value':'w'},{'label':'日','value':'d'},{'label':'时','value':'h'},{'label':'分','value':'min'}] : ($self.value.format ==='date'? [{'label':'年','value':'y'},{'label':'月','value':'m'},{'label':'周','value':'w'},{'label':'日','value':'d'}] : []) }}"
221
+ }
222
+ },
223
+ {
224
+ "type": "value:state",
225
+ "target": "xStatistics",
226
+ "condition": "{{ $self.inputed && !!$self.value }}",
227
+ "state": {
228
+ "value": "{{$self.value.format ==='datetime' ? 'y':$self.value.format ==='date'?'y':''}}"
229
+ }
230
+ },
231
+ {
232
+ "type": "value:visible",
233
+ "target": "*(xStatistics)",
234
+ "condition": "{{ $self.value && ($self.value.format ==='datetime' || $self.value.format ==='date') }}"
235
+ },
236
+ {
237
+ "type": "value:visible",
238
+ "target": "*(xIsCountEmpty)",
239
+ "condition": "{{ $self.value && ($self.value.format !=='datetime' && $self.value.format !=='date') }}"
240
+ }
241
+ ]
242
+ },
243
+ "xStatistics": {
244
+ "title": "统计维度",
245
+ "type": "string",
246
+ "x-category": "基础属性",
247
+ "x-index": 90,
248
+ "enum": []
249
+ },
250
+ "xIsCountEmpty": {
251
+ "title": "统计空值",
252
+ "type": "boolean",
253
+ "default": false,
254
+ "x-index": 100
255
+ },
256
+ "yFieldSubTitle": {
257
+ "x-index": 105,
258
+ "x-component": "sub-category-title",
259
+ "x-component-props": {
260
+ "text": "数值"
261
+ }
262
+ },
263
+ "yField": {
264
+ "type": "object",
265
+ "title": "字段选择",
266
+ "x-index": 110,
267
+ "x-category": "基础属性",
268
+ "x-component": "chart-y-field-select",
269
+ "x-component-props": {
270
+ "isMethod": true,
271
+ "dataSourceNamePropKey": "dataSource",
272
+ "maxFieldCount": 1
273
+ }
274
+ },
275
+ "legendShow": {
276
+ "x-index": 120,
277
+ "x-category": "基础属性",
278
+ "x-component": "sub-category-title",
279
+ "x-component-props": {
280
+ "text": "图例"
281
+ }
282
+ },
283
+ "isLegend": {
284
+ "title": "显示图例",
285
+ "type": "boolean",
286
+ "default": true,
287
+ "x-category": "基础属性",
288
+ "x-index": 130,
289
+ "x-linkages": [
290
+ {
291
+ "type": "value:visible",
292
+ "target": "*(legend)",
293
+ "condition": "{{ $self.value }}"
294
+ }
295
+ ]
296
+ },
297
+ "legend2": {
298
+ "title": "图例位置",
299
+ "type": "string",
300
+ "default": "bottom",
301
+ "x-category": "基础属性",
302
+ "x-index": 140,
303
+ "x-platforms": ["PCWEB"],
304
+ "enum": [
305
+ {
306
+ "value": "top",
307
+ "label": "上方"
308
+ },
309
+ {
310
+ "value": "bottom",
311
+ "label": "下方"
312
+ },
313
+ {
314
+ "value": "left",
315
+ "label": "左侧"
316
+ },
317
+ {
318
+ "value": "right",
319
+ "label": "右侧"
320
+ }
321
+ ]
322
+ },
323
+ "legend": {
324
+ "title": "图例位置",
325
+ "type": "string",
326
+ "default": "bottom",
327
+ "x-category": "基础属性",
328
+ "x-index": 150,
329
+ "x-platforms": ["MOBILEWEB", "MP"],
330
+ "enum": [
331
+ {
332
+ "value": "top",
333
+ "label": "上方"
334
+ },
335
+ {
336
+ "value": "bottom",
337
+ "label": "下方"
338
+ }
339
+ ]
340
+ },
341
+ "dataTagShow": {
342
+ "x-index": 160,
343
+ "x-category": "高级属性",
344
+ "x-component": "sub-category-title",
345
+ "x-component-props": {
346
+ "text": "数据标签"
347
+ }
348
+ },
349
+ "isSeriesShowSymbol": {
350
+ "title": "显示数值",
351
+ "type": "boolean",
352
+ "x-index": 170,
353
+ "default": true,
354
+ "x-category": "高级属性"
355
+ },
356
+ "isPercent": {
357
+ "title": "显示百分比",
358
+ "type": "boolean",
359
+ "x-index": 180,
360
+ "default": false,
361
+ "x-category": "高级属性"
362
+ },
363
+ "unitShow": {
364
+ "x-index": 190,
365
+ "x-category": "高级属性",
366
+ "x-component": "sub-category-title",
367
+ "x-component-props": {
368
+ "text": "显示单位"
369
+ }
370
+ },
371
+ "isUnit": {
372
+ "title": "显示单位",
373
+ "type": "boolean",
374
+ "x-index": 200,
375
+ "default": false,
376
+ "x-category": "高级属性",
377
+ "x-linkages": [
378
+ {
379
+ "type": "value:visible",
380
+ "target": "*(unit,decimalDigits,suffix)",
381
+ "condition": "{{ $self.value }}"
382
+ }
383
+ ]
384
+ },
385
+ "unit": {
386
+ "type": "number",
387
+ "title": "数值量级",
388
+ "default": 1,
389
+ "x-category": "高级属性",
390
+ "x-index": 210,
391
+ "enum": [
392
+ {
393
+ "label": "个",
394
+ "value": 1
395
+ },
396
+ {
397
+ "label": "十",
398
+ "value": 10
399
+ },
400
+ {
401
+ "label": "百",
402
+ "value": 100
403
+ },
404
+ {
405
+ "label": "千",
406
+ "value": 1000
407
+ },
408
+ {
409
+ "label": "万",
410
+ "value": 10000
411
+ },
412
+ {
413
+ "label": "十万",
414
+ "value": 100000
415
+ },
416
+ {
417
+ "label": "百万",
418
+ "value": 1000000
419
+ },
420
+ {
421
+ "label": "千万",
422
+ "value": 10000000
423
+ },
424
+ {
425
+ "label": "亿",
426
+ "value": 100000000
427
+ }
428
+ ],
429
+ "x-linkages": [
430
+ {
431
+ "type": "value:state",
432
+ "target": "suffix",
433
+ "condition": "{{ $self.inputed && $self.value!==1 }}",
434
+ "state": {
435
+ "value": "{{$self.props.enum.find(s=>s.value===$self.value) ? $self.props.enum.find(s=>s.value===$self.value).label: '' }}"
436
+ }
437
+ },
438
+ {
439
+ "type": "value:state",
440
+ "target": "suffix",
441
+ "condition": "{{ $self.inputed && $self.value===1 }}",
442
+ "state": {
443
+ "value": ""
444
+ }
445
+ }
446
+ ]
447
+ },
448
+ "decimalDigits": {
449
+ "title": "小数位数",
450
+ "type": "number",
451
+ "default": 0,
452
+ "x-props": {
453
+ "max": 10,
454
+ "min": 0
455
+ },
456
+ "x-index": 220,
457
+ "x-category": "高级属性",
458
+ "x-linkages": [
459
+ {
460
+ "type": "value:state",
461
+ "target": "decimalDigits",
462
+ "condition": "{{ $self.value == '' || isNaN($self.value) || $self.value < 0 }}",
463
+ "state": {
464
+ "value": 0
465
+ }
466
+ }
467
+ ]
468
+ },
469
+ "suffix": {
470
+ "title": "后缀",
471
+ "type": "string",
472
+ "default": "",
473
+ "x-index": 230,
474
+ "x-category": "高级属性"
475
+ }
476
+ }
477
+ },
478
+ "events": [],
479
+ "meta": {
480
+ "title": "饼图",
481
+ "description": "饼图",
482
+ "icon": "//imgcache.qq.com/qcloud/lowcode/static/ide/left-material-icon/PieChart.svg",
483
+ "category": "图表组件",
484
+ "componentOrder": 1,
485
+ "visible": ["APP"]
486
+ }
487
+ }
@@ -108,7 +108,8 @@
108
108
  },
109
109
  {
110
110
  "value": "unequal",
111
- "text": "不等于"
111
+ "text": "不等于",
112
+ "type": "unequal"
112
113
  },
113
114
  {
114
115
  "value": "greater",
@@ -35,6 +35,10 @@ import showToast from './actions/showToast.json';
35
35
  import showModal from './actions/showModal.json';
36
36
 
37
37
  import ListView from './components/listView.json';
38
+ import Line from './components/chart/line.json';
39
+ import Bar from './components/chart/bar.json';
40
+ import Pie from './components/chart/pie.json';
41
+
38
42
  import DataView from './components/dataView.json';
39
43
  import StatisticsCard from './components/chart/statisticsCard.json';
40
44
  import GraphicCard from './components/graphicCard.json';
@@ -74,6 +78,9 @@ export const components = {
74
78
  ListView,
75
79
  DataView,
76
80
  NavLayout,
81
+ Line,
82
+ Bar,
83
+ Pie,
77
84
  StatisticsCard,
78
85
  GraphicCard,
79
86
  };