@cloudbase/weda-ui 2.0.12 → 2.0.26
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/package.json +36 -33
- package/src/configs/components/form/textarea.json +8 -0
- package/src/configs/components/graphicCard.json +1 -1
- package/src/configs/components/navLayout.json +2 -1
- package/src/configs/components/wedaVideo.json +12 -9
- package/src/mp/components/calendar/index.js +4 -1
- package/src/mp/components/calendar/index.json +2 -1
- package/src/mp/components/calendar/index.wxml +1 -1
- package/src/mp/components/calendar/index.wxss +17 -16
- package/src/mp/components/chart/statisticsCard/index.wxss +7 -10
- package/src/mp/components/form/checkbox/index.js +5 -1
- package/src/mp/components/form/input/index.js +1 -1
- package/src/mp/components/form/radio/index.js +5 -1
- package/src/mp/components/form/select/index.js +2 -2
- package/src/mp/components/form/textarea/index.js +6 -0
- package/src/mp/components/form/textarea/index.wxml +1 -1
- package/src/mp/components/graphicCard/index.wxss +6 -6
- package/src/mp/components/listView/index.wxss +2 -2
- package/src/mp/components/navLayout/index.wxss +10 -10
- package/src/mp/components/navigationBar/index.wxss +10 -10
- package/src/mp/components/richText/index.wxml +1 -1
- package/src/mp/components/richText/index.wxss +7 -5
- package/src/mp/components/tabs/index.wxss +1 -2
- package/src/mp/style/weda-ui.wxss +4 -2
- package/src/web/components/calendar/index.css +27 -40
- package/src/web/components/chart/statisticsCard/index.css +9 -8
- package/src/web/components/form/formcell/index.css +1 -14
- package/src/web/components/form/input/index.css +4 -0
- package/src/web/components/form/location/common/mapChoose.css +13 -11
- package/src/web/components/form/location/components/LocationH5/index.css +19 -19
- package/src/web/components/form/select/h5.tsx +1 -1
- package/src/web/components/form/select/index.tsx +1 -1
- package/src/web/components/form/textarea/index.tsx +12 -0
- package/src/web/components/form/uploader/index.css +10 -0
- package/src/web/components/form/uploader/uploader.h5.tsx +3 -6
- package/src/web/components/form/uploader/uploader.pc.tsx +3 -6
- package/src/web/components/form/uploaderFile/index.css +24 -23
- package/src/web/components/form/uploaderFile/uploadFile.h5.tsx +9 -4
- package/src/web/components/form/uploaderFile/uploadFile.pc.tsx +7 -4
- package/src/web/components/graphicCard/index.css +6 -6
- package/src/web/components/listView/index.css +8 -8
- package/src/web/components/lottery/index.tsx +1 -1
- package/src/web/components/navLayout/index.css +25 -25
- package/src/web/components/navigationBar/index.css +26 -26
- package/src/web/components/richTextView/index.css +7 -3
- package/src/web/components/tabs/index.css +1 -2
- package/src/web/components/wedaVideo/index.tsx +14 -4
- package/src/web/utils/platform.js +13 -0
- package/src/web/weda-ui.css +7 -9
- package/src/docs/common/format.tsx +0 -115
- package/src/docs/common/tableView.css +0 -164
- package/src/docs/common/tableView.tsx +0 -283
- package/src/docs/compsdocs/chart/Bar.mdx +0 -159
- package/src/docs/compsdocs/chart/Line.mdx +0 -100
- package/src/docs/compsdocs/chart/Pie.mdx +0 -83
- package/src/docs/compsdocs/chart/_category_.json +0 -1
- package/src/docs/compsdocs/chart/statisticsCard.mdx +0 -51
- package/src/docs/compsdocs/database/DataView.mdx +0 -33
- package/src/docs/compsdocs/database/ListView.mdx +0 -33
- package/src/docs/compsdocs/database/_category_.json +0 -1
- package/src/docs/compsdocs/form/Form.mdx +0 -35
- package/src/docs/compsdocs/form/FormCheckbox.mdx +0 -35
- package/src/docs/compsdocs/form/FormDate.mdx +0 -30
- package/src/docs/compsdocs/form/FormEmail.mdx +0 -30
- package/src/docs/compsdocs/form/FormImageUploader.mdx +0 -31
- package/src/docs/compsdocs/form/FormInput.mdx +0 -30
- package/src/docs/compsdocs/form/FormLocation.mdx +0 -64
- package/src/docs/compsdocs/form/FormPhone.mdx +0 -30
- package/src/docs/compsdocs/form/FormRadio.mdx +0 -35
- package/src/docs/compsdocs/form/FormRegion.mdx +0 -30
- package/src/docs/compsdocs/form/FormSelect.mdx +0 -35
- package/src/docs/compsdocs/form/FormSwitch.mdx +0 -30
- package/src/docs/compsdocs/form/FormTextarea.mdx +0 -30
- package/src/docs/compsdocs/form/FormTime.mdx +0 -30
- package/src/docs/compsdocs/form/FormUploadFile.mdx +0 -30
- package/src/docs/compsdocs/form/FormUrl.mdx +0 -30
- package/src/docs/compsdocs/form/_category_.json +0 -1
- package/src/docs/compsdocs/grid/Card.mdx +0 -31
- package/src/docs/compsdocs/grid/Container.mdx +0 -41
- package/src/docs/compsdocs/grid/Footer.mdx +0 -31
- package/src/docs/compsdocs/grid/GridLayout.mdx +0 -31
- package/src/docs/compsdocs/grid/Header.mdx +0 -31
- package/src/docs/compsdocs/grid/Layout.mdx +0 -25
- package/src/docs/compsdocs/grid/List.mdx +0 -31
- package/src/docs/compsdocs/grid/ScrollView.mdx +0 -37
- package/src/docs/compsdocs/grid/Swiper.mdx +0 -57
- package/src/docs/compsdocs/grid/_category_.json +0 -1
- package/src/docs/compsdocs/media/Icon.mdx +0 -31
- package/src/docs/compsdocs/media/Image.mdx +0 -55
- package/src/docs/compsdocs/media/_category_.json +0 -1
- package/src/docs/compsdocs/model/ModelCreate.mdx +0 -44
- package/src/docs/compsdocs/model/ModelDetail.mdx +0 -44
- package/src/docs/compsdocs/model/ModelTable.mdx +0 -156
- package/src/docs/compsdocs/model/ModelUpdate.mdx +0 -44
- package/src/docs/compsdocs/model/PageLayout.mdx +0 -21
- package/src/docs/compsdocs/model/_category_.json +0 -1
- package/src/docs/compsdocs/navmenu/Classification.mdx +0 -37
- package/src/docs/compsdocs/navmenu/NavBar.mdx +0 -52
- package/src/docs/compsdocs/navmenu/NavLayout.mdx +0 -29
- package/src/docs/compsdocs/navmenu/TabBar.mdx +0 -43
- package/src/docs/compsdocs/navmenu/TabBarItem.mdx +0 -29
- package/src/docs/compsdocs/navmenu/_category_.json +0 -1
- package/src/docs/compsdocs/senior/Lottery.mdx +0 -45
- package/src/docs/compsdocs/senior/Modal.mdx +0 -57
- package/src/docs/compsdocs/senior/SlotMachine.mdx +0 -49
- package/src/docs/compsdocs/senior/_category_.json +0 -1
- package/src/docs/compsdocs/show/Calendar.mdx +0 -29
- package/src/docs/compsdocs/show/Divider.mdx +0 -31
- package/src/docs/compsdocs/show/GraphicCard.mdx +0 -29
- package/src/docs/compsdocs/show/Item.mdx +0 -31
- package/src/docs/compsdocs/show/ItemList.mdx +0 -48
- package/src/docs/compsdocs/show/Media.mdx +0 -25
- package/src/docs/compsdocs/show/StatusTip.mdx +0 -25
- package/src/docs/compsdocs/show/Swiper.mdx +0 -33
- package/src/docs/compsdocs/show/Tabs.mdx +0 -37
- package/src/docs/compsdocs/show/_category_.json +0 -1
- package/src/docs/compsdocs/show/button.mdx +0 -25
- package/src/docs/compsdocs/text/Link.mdx +0 -43
- package/src/docs/compsdocs/text/RichTextView.mdx +0 -35
- package/src/docs/compsdocs/text/Text.mdx +0 -31
- package/src/docs/compsdocs/text/Title.mdx +0 -31
- package/src/docs/compsdocs/text/_category_.json +0 -1
- package/src/docs/compsdocs/wxOpen/Phone.mdx +0 -59
- package/src/docs/compsdocs/wxOpen/Share.mdx +0 -45
- package/src/docs/compsdocs/wxOpen/UserInfo.mdx +0 -59
- package/src/docs/compsdocs/wxOpen/_category_.json +0 -4
|
@@ -141,3 +141,16 @@ const reg =
|
|
|
141
141
|
/(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/;
|
|
142
142
|
|
|
143
143
|
export const isUrl = (path) => reg.test(path);
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* 生成随机数
|
|
147
|
+
*/
|
|
148
|
+
export const randomUuid = () => {
|
|
149
|
+
var s = [];
|
|
150
|
+
var hexDigits = '0123456789abcdef';
|
|
151
|
+
for (var i = 0; i < 32; i++) {
|
|
152
|
+
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
|
|
153
|
+
}
|
|
154
|
+
var uuid = s.join('');
|
|
155
|
+
return uuid;
|
|
156
|
+
};
|
package/src/web/weda-ui.css
CHANGED
|
@@ -40,19 +40,13 @@ body .weda-ui {
|
|
|
40
40
|
background-color: var(--weui-TAG-TEXT-BLUE);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
.weda-ui .wedatea2td-form__controls {
|
|
44
|
-
font-size: 1rem;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
43
|
@media (min-width: 1024px) {
|
|
48
44
|
.weda-ui .weui-cells {
|
|
49
45
|
/* prettier-ignore */
|
|
50
|
-
font-size:
|
|
46
|
+
font-size: 1em;
|
|
51
47
|
}
|
|
52
48
|
}
|
|
53
49
|
@media (min-width: 1024px) {
|
|
54
|
-
.weda-ui .weui-cell {
|
|
55
|
-
}
|
|
56
50
|
.weui .weui-cell_active:active {
|
|
57
51
|
background-color: unset !important;
|
|
58
52
|
}
|
|
@@ -67,14 +61,18 @@ body .weda-ui {
|
|
|
67
61
|
}
|
|
68
62
|
|
|
69
63
|
.weda-ui .weui-cell {
|
|
70
|
-
font-size:
|
|
64
|
+
font-size: inherit; /* 要让内联样式生效 */
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.weda-ui .weui-cells {
|
|
68
|
+
font-size: 1em;
|
|
71
69
|
}
|
|
72
70
|
|
|
73
71
|
.weui-picker a:link:hover {
|
|
74
72
|
text-decoration: none;
|
|
75
73
|
}
|
|
76
74
|
|
|
77
|
-
.
|
|
75
|
+
.weda-formcells__pc.vertical .wedatea2td-form__label label {
|
|
78
76
|
width: auto; /* vertcal 情况下label不固定宽度 */
|
|
79
77
|
}
|
|
80
78
|
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
export interface ICompsConfig {
|
|
2
|
-
type: String;
|
|
3
|
-
name: string;
|
|
4
|
-
title: string;
|
|
5
|
-
description: string;
|
|
6
|
-
'x-platforms': string[];
|
|
7
|
-
default: string;
|
|
8
|
-
platforms: string;
|
|
9
|
-
'x-index': number;
|
|
10
|
-
}
|
|
11
|
-
export type TCompsConfig = ICompsConfig;
|
|
12
|
-
|
|
13
|
-
export const sortBy = (props) => {
|
|
14
|
-
return function (a, b) {
|
|
15
|
-
return a[props] - b[props];
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const objFormat = (args: any, type, origin) => {
|
|
20
|
-
//判断属性title值是否为拓展写法
|
|
21
|
-
const uuidReg = /(?<=text)\('(.*)(?=',)/;
|
|
22
|
-
let transformData: any = [];
|
|
23
|
-
for (let i in args) {
|
|
24
|
-
if (type && type == 'event') {
|
|
25
|
-
transformData.push({
|
|
26
|
-
name: origin == 'lowCode' ? args[i]?.name : args[i]?.title,
|
|
27
|
-
title: origin == 'lowCode' ? args[i]?.eventName : args[i]?.name,
|
|
28
|
-
description: args[i]?.remarks || '-',
|
|
29
|
-
platforms: args[i]['x-platforms']
|
|
30
|
-
? args[i]['x-platforms'].indexOf('MP') > -1
|
|
31
|
-
? '小程序端'
|
|
32
|
-
: args[i]['x-platforms'].indexOf('WEB') > -1
|
|
33
|
-
? 'web端'
|
|
34
|
-
: '兼容三端'
|
|
35
|
-
: '兼容三端',
|
|
36
|
-
});
|
|
37
|
-
} else if (type && type == 'attribute' && args[i].type != 'slot') {
|
|
38
|
-
if (
|
|
39
|
-
args[i]?.display == false ||
|
|
40
|
-
args[i]?.isReactNode == true ||
|
|
41
|
-
args[i]['x-component'] == 'sub-category-title' ||
|
|
42
|
-
args[i]['x-component'] == 'Divider'
|
|
43
|
-
) {
|
|
44
|
-
continue;
|
|
45
|
-
}
|
|
46
|
-
transformData.push({
|
|
47
|
-
code: i,
|
|
48
|
-
title:
|
|
49
|
-
args[i].title.indexOf('{{') != -1
|
|
50
|
-
? args[i]?.title.match(uuidReg)[1]
|
|
51
|
-
: args[i]?.title,
|
|
52
|
-
description: args[i]?.remarks || '-',
|
|
53
|
-
type: args[i]?.type || '-',
|
|
54
|
-
default: JSON.stringify(args[i]?.default) || '-',
|
|
55
|
-
'x-index': args[i]['x-index'] ? args[i]['x-index'] : 999999,
|
|
56
|
-
'x-category': args[i]['x-category']
|
|
57
|
-
? args[i]['x-category']
|
|
58
|
-
: '基础属性',
|
|
59
|
-
});
|
|
60
|
-
} else if (type && type == 'slot' && args[i].type == 'slot') {
|
|
61
|
-
transformData.push({
|
|
62
|
-
code: i,
|
|
63
|
-
title: args[i]?.title,
|
|
64
|
-
description: args[i]?.description || '-',
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
if (type && type == 'attribute') transformData.sort(sortBy('x-index'));
|
|
70
|
-
|
|
71
|
-
if (type && type == 'attribute') {
|
|
72
|
-
transformData = groupByType(transformData, 'x-category');
|
|
73
|
-
}
|
|
74
|
-
return transformData;
|
|
75
|
-
};
|
|
76
|
-
function groupByType(arr, param) {
|
|
77
|
-
var map = {};
|
|
78
|
-
var dest = [];
|
|
79
|
-
var structureMap = [];
|
|
80
|
-
var storgeType = [];
|
|
81
|
-
for (var i = 0; i < arr.length; i++) {
|
|
82
|
-
var ai = arr[i];
|
|
83
|
-
if (ai[param] && !map[ai[param]]) {
|
|
84
|
-
dest.push({
|
|
85
|
-
name: ai[param],
|
|
86
|
-
data: [ai],
|
|
87
|
-
});
|
|
88
|
-
map[ai[param]] = ai;
|
|
89
|
-
} else if (!ai[param]) {
|
|
90
|
-
dest.push({
|
|
91
|
-
name: '基础属性',
|
|
92
|
-
data: [ai],
|
|
93
|
-
});
|
|
94
|
-
map[ai[param]] = ai;
|
|
95
|
-
} else {
|
|
96
|
-
for (var j = 0; j < dest.length; j++) {
|
|
97
|
-
var dj = dest[j];
|
|
98
|
-
if (dj.name == ai[param]) {
|
|
99
|
-
dj.data.push(ai);
|
|
100
|
-
break;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
for (var k = 0; k < dest.length; k++) {
|
|
106
|
-
if (k == 0 && dest[k]?.name != '基础属性') {
|
|
107
|
-
storgeType = storgeType.concat(dest[k]?.data);
|
|
108
|
-
continue;
|
|
109
|
-
}
|
|
110
|
-
structureMap = structureMap.concat(dest[k]?.data);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
storgeType.length != 0 ? structureMap.push(...storgeType) : null;
|
|
114
|
-
return structureMap;
|
|
115
|
-
}
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
.tableview {
|
|
2
|
-
width: 700px;
|
|
3
|
-
table-layout: fixed;
|
|
4
|
-
}
|
|
5
|
-
.tr-width-1 {
|
|
6
|
-
width: 100px;
|
|
7
|
-
}
|
|
8
|
-
.tr-width-2 {
|
|
9
|
-
width: 200px;
|
|
10
|
-
}
|
|
11
|
-
.tr-width-3 {
|
|
12
|
-
width: 300px;
|
|
13
|
-
}
|
|
14
|
-
.tr-width-4 {
|
|
15
|
-
width: 400px;
|
|
16
|
-
}
|
|
17
|
-
.tr-width-6 {
|
|
18
|
-
width: 600px;
|
|
19
|
-
}
|
|
20
|
-
.tr-width-7 {
|
|
21
|
-
width: 700px;
|
|
22
|
-
}
|
|
23
|
-
.custom-table--body-wrapper.is-fixed {
|
|
24
|
-
overflow-y: hidden;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.custom-table--fixed-wrapper {
|
|
28
|
-
box-shadow: 4px 0px 4px rgba(0, 0, 0, 0.1);
|
|
29
|
-
|
|
30
|
-
left: 0;
|
|
31
|
-
top: 0;
|
|
32
|
-
bottom: 0;
|
|
33
|
-
width: 800px;
|
|
34
|
-
background-color: #fff;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.custom-table td,
|
|
38
|
-
.custom-table th {
|
|
39
|
-
white-space: nowrap;
|
|
40
|
-
overflow: hidden;
|
|
41
|
-
height: 42px;
|
|
42
|
-
padding: 2px !important;
|
|
43
|
-
}
|
|
44
|
-
.custom-table .table {
|
|
45
|
-
table-layout: fixed;
|
|
46
|
-
margin-bottom: 0;
|
|
47
|
-
}
|
|
48
|
-
/** 底部边框 */
|
|
49
|
-
.custom-table::after {
|
|
50
|
-
content: '';
|
|
51
|
-
display: block;
|
|
52
|
-
height: 0px;
|
|
53
|
-
position: relative;
|
|
54
|
-
top: -1px;
|
|
55
|
-
border-bottom: 1px solid #ddd;
|
|
56
|
-
}
|
|
57
|
-
/** 右侧边框 */
|
|
58
|
-
.custom-table::before {
|
|
59
|
-
content: '';
|
|
60
|
-
display: block;
|
|
61
|
-
position: absolute;
|
|
62
|
-
top: 0;
|
|
63
|
-
bottom: 0;
|
|
64
|
-
right: 0;
|
|
65
|
-
border-right: 1px solid #ddd;
|
|
66
|
-
}
|
|
67
|
-
.custom-table th.gutter {
|
|
68
|
-
width: 15px;
|
|
69
|
-
padding: 0;
|
|
70
|
-
}
|
|
71
|
-
.tea-table__header {
|
|
72
|
-
overflow: hidden;
|
|
73
|
-
margin-bottom: -18px;
|
|
74
|
-
}
|
|
75
|
-
.tea-table__box {
|
|
76
|
-
border-collapse: collapse;
|
|
77
|
-
table-layout: fixed;
|
|
78
|
-
width: 100%;
|
|
79
|
-
position: relative;
|
|
80
|
-
border-spacing: 0px;
|
|
81
|
-
}
|
|
82
|
-
.tea-text-overflow,
|
|
83
|
-
.tea-text-truncate {
|
|
84
|
-
display: flex;
|
|
85
|
-
vertical-align: middle;
|
|
86
|
-
white-space: nowrap;
|
|
87
|
-
text-overflow: ellipsis;
|
|
88
|
-
max-width: 100%;
|
|
89
|
-
overflow: hidden;
|
|
90
|
-
}
|
|
91
|
-
.tea-table__header thead {
|
|
92
|
-
background-color: transparent;
|
|
93
|
-
border-width: 0px;
|
|
94
|
-
border-style: initial;
|
|
95
|
-
border-color: initial;
|
|
96
|
-
border-image: initial;
|
|
97
|
-
}
|
|
98
|
-
colgroup {
|
|
99
|
-
display: table-column-group;
|
|
100
|
-
}
|
|
101
|
-
.tea-table__box tr {
|
|
102
|
-
outline: none 0px;
|
|
103
|
-
transition: background-color 0.1s linear 0s;
|
|
104
|
-
}
|
|
105
|
-
.tea-table__box th {
|
|
106
|
-
position: relative;
|
|
107
|
-
padding: 10px;
|
|
108
|
-
border-bottom: 1px solid rgb(231, 234, 239);
|
|
109
|
-
}
|
|
110
|
-
.tea-table__box th > div {
|
|
111
|
-
position: relative;
|
|
112
|
-
color: rgb(0 0 0 / 77%);
|
|
113
|
-
padding: 0px;
|
|
114
|
-
display: inline-block;
|
|
115
|
-
vertical-align: middle;
|
|
116
|
-
font-size: 16px;
|
|
117
|
-
width: 100%;
|
|
118
|
-
overflow-wrap: break-word;
|
|
119
|
-
word-break: break-word;
|
|
120
|
-
}
|
|
121
|
-
.tea-table__box tr > td {
|
|
122
|
-
color: rgb(0 0 0);
|
|
123
|
-
padding: 10px;
|
|
124
|
-
vertical-align: middle;
|
|
125
|
-
font-size: 16px;
|
|
126
|
-
vertical-align: top;
|
|
127
|
-
}
|
|
128
|
-
.tea-table__box tr > td > code {
|
|
129
|
-
color: #c7254e;
|
|
130
|
-
font-size: 85%;
|
|
131
|
-
border: none;
|
|
132
|
-
}
|
|
133
|
-
.tea-text-overflow,
|
|
134
|
-
.tea-text-truncate {
|
|
135
|
-
display: flex;
|
|
136
|
-
vertical-align: middle;
|
|
137
|
-
white-space: nowrap;
|
|
138
|
-
text-overflow: ellipsis;
|
|
139
|
-
max-width: 100%;
|
|
140
|
-
overflow: hidden;
|
|
141
|
-
}
|
|
142
|
-
table {
|
|
143
|
-
display: table;
|
|
144
|
-
border-collapse: separate;
|
|
145
|
-
box-sizing: border-box;
|
|
146
|
-
text-indent: initial;
|
|
147
|
-
border-spacing: 2px;
|
|
148
|
-
border-color: grey;
|
|
149
|
-
}
|
|
150
|
-
.tea-table__body {
|
|
151
|
-
border-bottom: 1px solid rgb(207, 213, 222);
|
|
152
|
-
overflow: auto;
|
|
153
|
-
}
|
|
154
|
-
colgroup {
|
|
155
|
-
display: table-column-group;
|
|
156
|
-
}
|
|
157
|
-
col {
|
|
158
|
-
display: table-column;
|
|
159
|
-
}
|
|
160
|
-
.hash-link {
|
|
161
|
-
opacity: 0;
|
|
162
|
-
padding-left: 0.5rem;
|
|
163
|
-
transition: opacity var(--ifm-transition-fast);
|
|
164
|
-
}
|
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
import React, { useRef, useContext } from 'react';
|
|
2
|
-
import { components } from '../../configs/index';
|
|
3
|
-
import { objFormat, ICompsConfig } from './format';
|
|
4
|
-
import './tableView.css';
|
|
5
|
-
export interface ComponentDocument {
|
|
6
|
-
exampleMap?: {
|
|
7
|
-
[key: string]: {
|
|
8
|
-
component: React.ComponentType;
|
|
9
|
-
code: string;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
codeMap?: {
|
|
13
|
-
[key: string]: {
|
|
14
|
-
code: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
data?: {
|
|
18
|
-
[key: string]: {
|
|
19
|
-
code: string;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
function createFragment(nodes: React.ReactNodeArray) {
|
|
24
|
-
return React.createElement(React.Fragment, {}, ...nodes);
|
|
25
|
-
}
|
|
26
|
-
export interface TableLayoutViewProps {
|
|
27
|
-
componentKey?: string;
|
|
28
|
-
document: ComponentDocument;
|
|
29
|
-
variables?: object;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function getCompsMeta(key, type, origin) {
|
|
33
|
-
var compsMeta: ICompsConfig;
|
|
34
|
-
try {
|
|
35
|
-
switch (origin) {
|
|
36
|
-
case 'lowCode':
|
|
37
|
-
var metaLowcode = require('/docs/lowcode/components/wedaUI/lowcode-comps/weda_standard/comps/' +
|
|
38
|
-
key +
|
|
39
|
-
'.comp.json');
|
|
40
|
-
if (type && type == 'event') {
|
|
41
|
-
compsMeta = metaLowcode['emitEvents'];
|
|
42
|
-
} else if (type && (type == 'attribute' || type == 'slot')) {
|
|
43
|
-
compsMeta = metaLowcode['dataForm'];
|
|
44
|
-
} else if (type && type == 'description') {
|
|
45
|
-
compsMeta = metaLowcode['meta'];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return compsMeta;
|
|
49
|
-
case 'sourceCode':
|
|
50
|
-
if (type && type == 'event') {
|
|
51
|
-
compsMeta = components[key]['events'] || {};
|
|
52
|
-
} else if (type && (type == 'attribute' || type == 'slot')) {
|
|
53
|
-
compsMeta = components[key]['data']['properties'] || {};
|
|
54
|
-
} else if (type && type == 'description') {
|
|
55
|
-
compsMeta = components[key]['meta'] || {};
|
|
56
|
-
}
|
|
57
|
-
return compsMeta;
|
|
58
|
-
}
|
|
59
|
-
} catch (e) {
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
export default function TableLayoutView({ componentKey, type, origin }) {
|
|
64
|
-
var compsMeta = getCompsMeta(componentKey, type, origin);
|
|
65
|
-
var tableView = [];
|
|
66
|
-
if (compsMeta && type != 'description') {
|
|
67
|
-
tableView = objFormat(compsMeta, type, origin);
|
|
68
|
-
} else {
|
|
69
|
-
tableView.push(compsMeta);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return (
|
|
73
|
-
<>
|
|
74
|
-
{type == 'attribute' && tableView.length > 0 && (
|
|
75
|
-
<>
|
|
76
|
-
<div className="tea-table__header">
|
|
77
|
-
<table className="tea-table__box">
|
|
78
|
-
<colgroup>
|
|
79
|
-
<col style={{ width: '18%' }}></col>
|
|
80
|
-
<col style={{ width: '10%' }}></col>
|
|
81
|
-
<col style={{ width: '15%' }}></col>
|
|
82
|
-
<col style={{ width: '25%' }}></col>
|
|
83
|
-
<col style={{ width: 'auto' }}></col>
|
|
84
|
-
</colgroup>
|
|
85
|
-
<thead>
|
|
86
|
-
<tr>
|
|
87
|
-
<th className="">
|
|
88
|
-
<div>
|
|
89
|
-
<span className="tea-text-overflow" title="属性名">
|
|
90
|
-
属性名
|
|
91
|
-
</span>
|
|
92
|
-
</div>
|
|
93
|
-
</th>
|
|
94
|
-
<th className="">
|
|
95
|
-
<div>
|
|
96
|
-
<span className="tea-text-overflow" title="类型">
|
|
97
|
-
类型
|
|
98
|
-
</span>
|
|
99
|
-
</div>
|
|
100
|
-
</th>
|
|
101
|
-
<th className="">
|
|
102
|
-
<div>
|
|
103
|
-
<span className="tea-text-overflow" title="属性分组">
|
|
104
|
-
属性分组
|
|
105
|
-
</span>
|
|
106
|
-
</div>
|
|
107
|
-
</th>
|
|
108
|
-
<th className="">
|
|
109
|
-
<div>
|
|
110
|
-
<span className="tea-text-overflow" title="默认值">
|
|
111
|
-
默认值
|
|
112
|
-
</span>
|
|
113
|
-
</div>
|
|
114
|
-
</th>
|
|
115
|
-
<th className="">
|
|
116
|
-
<div>
|
|
117
|
-
<span className="tea-text-overflow" title="说明">
|
|
118
|
-
说明
|
|
119
|
-
</span>
|
|
120
|
-
</div>
|
|
121
|
-
</th>
|
|
122
|
-
</tr>
|
|
123
|
-
</thead>
|
|
124
|
-
</table>
|
|
125
|
-
</div>
|
|
126
|
-
<table className="tea-table__box">
|
|
127
|
-
<colgroup>
|
|
128
|
-
<col style={{ width: '18%' }}></col>
|
|
129
|
-
<col style={{ width: '10%' }}></col>
|
|
130
|
-
<col style={{ width: '15%' }}></col>
|
|
131
|
-
<col style={{ width: '25%' }}></col>
|
|
132
|
-
<col style={{ width: 'auto' }}></col>
|
|
133
|
-
</colgroup>
|
|
134
|
-
<tbody>
|
|
135
|
-
{tableView.map((row, index) => (
|
|
136
|
-
<tr key={index}>
|
|
137
|
-
<td>{row.title}</td>
|
|
138
|
-
<td>
|
|
139
|
-
<code>{row.type}</code>
|
|
140
|
-
</td>
|
|
141
|
-
<td>{row['x-category']}</td>
|
|
142
|
-
<td>{row.default}</td>
|
|
143
|
-
<td>{row.description}</td>
|
|
144
|
-
</tr>
|
|
145
|
-
))}
|
|
146
|
-
</tbody>
|
|
147
|
-
</table>
|
|
148
|
-
</>
|
|
149
|
-
)}
|
|
150
|
-
{type == 'slot' && tableView.length > 0 && (
|
|
151
|
-
<>
|
|
152
|
-
<div className="tea-table__header">
|
|
153
|
-
<table className="tea-table__box">
|
|
154
|
-
<colgroup>
|
|
155
|
-
<col style={{ width: '18%' }}></col>
|
|
156
|
-
<col style={{ width: 'auto' }}></col>
|
|
157
|
-
</colgroup>
|
|
158
|
-
<thead>
|
|
159
|
-
<tr>
|
|
160
|
-
<th className="">
|
|
161
|
-
<div>
|
|
162
|
-
<span className="tea-text-overflow" title="属性名">
|
|
163
|
-
名称
|
|
164
|
-
</span>
|
|
165
|
-
</div>
|
|
166
|
-
</th>
|
|
167
|
-
<th className="">
|
|
168
|
-
<div>
|
|
169
|
-
<span className="tea-text-overflow" title="类型">
|
|
170
|
-
说明
|
|
171
|
-
</span>
|
|
172
|
-
</div>
|
|
173
|
-
</th>
|
|
174
|
-
</tr>
|
|
175
|
-
</thead>
|
|
176
|
-
</table>
|
|
177
|
-
</div>
|
|
178
|
-
<table className="tea-table__box">
|
|
179
|
-
<colgroup>
|
|
180
|
-
<col style={{ width: '18%' }}></col>
|
|
181
|
-
<col style={{ width: 'auto' }}></col>
|
|
182
|
-
</colgroup>
|
|
183
|
-
<tbody>
|
|
184
|
-
{tableView.map((row, index) => (
|
|
185
|
-
<tr key={index}>
|
|
186
|
-
<td>{row.code}</td>
|
|
187
|
-
<td>{row.description}</td>
|
|
188
|
-
</tr>
|
|
189
|
-
))}
|
|
190
|
-
</tbody>
|
|
191
|
-
</table>
|
|
192
|
-
</>
|
|
193
|
-
)}
|
|
194
|
-
{type == 'event' && tableView.length > 0 && (
|
|
195
|
-
<>
|
|
196
|
-
<div className="tea-table__header">
|
|
197
|
-
<table className="tea-table__box">
|
|
198
|
-
<colgroup>
|
|
199
|
-
<col style={{ width: '18%' }}></col>
|
|
200
|
-
<col style={{ width: '25%' }}></col>
|
|
201
|
-
<col style={{ width: '16%' }}></col>
|
|
202
|
-
<col style={{ width: 'auto' }}></col>
|
|
203
|
-
</colgroup>
|
|
204
|
-
<thead>
|
|
205
|
-
<tr>
|
|
206
|
-
<th className="">
|
|
207
|
-
<div>
|
|
208
|
-
<span className="tea-text-overflow" title="事件名">
|
|
209
|
-
事件名
|
|
210
|
-
</span>
|
|
211
|
-
</div>
|
|
212
|
-
</th>
|
|
213
|
-
<th className="">
|
|
214
|
-
<div>
|
|
215
|
-
<span className="tea-text-overflow" title="事件code">
|
|
216
|
-
事件code
|
|
217
|
-
</span>
|
|
218
|
-
</div>
|
|
219
|
-
</th>
|
|
220
|
-
<th className="">
|
|
221
|
-
<div>
|
|
222
|
-
<span className="tea-text-overflow" title="适用情况">
|
|
223
|
-
适用情况
|
|
224
|
-
</span>
|
|
225
|
-
</div>
|
|
226
|
-
</th>
|
|
227
|
-
<th className="">
|
|
228
|
-
<div>
|
|
229
|
-
<span className="tea-text-overflow" title="说明">
|
|
230
|
-
说明
|
|
231
|
-
</span>
|
|
232
|
-
</div>
|
|
233
|
-
</th>
|
|
234
|
-
</tr>
|
|
235
|
-
</thead>
|
|
236
|
-
</table>
|
|
237
|
-
</div>
|
|
238
|
-
<table className="tea-table__box">
|
|
239
|
-
<colgroup>
|
|
240
|
-
<col style={{ width: '18%' }}></col>
|
|
241
|
-
<col style={{ width: '25%' }}></col>
|
|
242
|
-
<col style={{ width: '16%' }}></col>
|
|
243
|
-
<col style={{ width: 'auto' }}></col>
|
|
244
|
-
</colgroup>
|
|
245
|
-
<tbody>
|
|
246
|
-
{tableView.map((row, index) => (
|
|
247
|
-
<tr key={index}>
|
|
248
|
-
<td>{row.name}</td>
|
|
249
|
-
<td>
|
|
250
|
-
<code>{row.title}</code>
|
|
251
|
-
</td>
|
|
252
|
-
<td>{row.platforms}</td>
|
|
253
|
-
<td>{row.description}</td>
|
|
254
|
-
</tr>
|
|
255
|
-
))}
|
|
256
|
-
</tbody>
|
|
257
|
-
</table>
|
|
258
|
-
</>
|
|
259
|
-
)}
|
|
260
|
-
{type == 'description' && tableView.length > 0 && (
|
|
261
|
-
<>
|
|
262
|
-
<h2>
|
|
263
|
-
<a
|
|
264
|
-
aria-hidden="true"
|
|
265
|
-
className="anchor enhancedAnchor_node_modules-@docusaurus-theme-classic-lib-next-theme-Heading-styles-module"
|
|
266
|
-
id="适用场景"
|
|
267
|
-
></a>
|
|
268
|
-
适用场景
|
|
269
|
-
<a className="hash-link" href="#适用场景" title="标题的直接链接">
|
|
270
|
-
#
|
|
271
|
-
</a>
|
|
272
|
-
</h2>
|
|
273
|
-
<p>
|
|
274
|
-
{tableView[0]?.description
|
|
275
|
-
? tableView[0]?.description
|
|
276
|
-
: tableView[0]?.desc}
|
|
277
|
-
</p>
|
|
278
|
-
</>
|
|
279
|
-
)}
|
|
280
|
-
{tableView.length == 0 && <p>无</p>}
|
|
281
|
-
</>
|
|
282
|
-
);
|
|
283
|
-
}
|