@cloudbase/weda-ui 3.13.1 → 3.13.2
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/configs/components/wd-upload-image.d.ts +7 -2
- package/dist/configs/components/wd-upload-image.js +40 -6
- package/dist/configs/index.d.ts +14 -4
- package/dist/configs/type-utils/classes.js +1 -1
- package/dist/style/weda-ui.min.css +2 -2
- package/dist/web/components/echart/echart.js +3 -4
- package/dist/web/components/form/uploader/uploader.h5.js +14 -17
- package/dist/web/components/form/uploader/uploader.pc.js +3 -3
- package/dist/web/components/wd-location/wd-location.css +7 -10
- package/dist/web/components/wd-location/wd-location.js +4 -0
- package/dist/web/components/wd-select/relationSelect/relationSelect.js +8 -3
- package/dist/web/components/wd-select/select/selectUI.js +1 -1
- package/dist/web/components/wd-select/wd-select.css +12 -22
- package/dist/web/components/wd-table/components/FieldRender/index.d.ts +3 -3
- package/dist/web/components/wd-table/components/FieldRender/index.js +31 -46
- package/dist/web/components/wd-table/hooks/useChooseList.d.ts +2 -1
- package/dist/web/components/wd-table/hooks/useChooseList.js +15 -3
- package/dist/web/utils/moment.js +3 -0
- package/package.json +4 -4
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { useState, useEffect, useCallback } from 'react';
|
|
2
2
|
const defaultPage = 1;
|
|
3
|
+
const getUniqueOption = (option) => {
|
|
4
|
+
var _a;
|
|
5
|
+
const optionMap = option.reduce((acc, item) => {
|
|
6
|
+
if (!acc[item.value]) {
|
|
7
|
+
acc[item.value] = item;
|
|
8
|
+
}
|
|
9
|
+
return acc;
|
|
10
|
+
}, {});
|
|
11
|
+
const uniqueOption = (_a = Object.values(optionMap)) === null || _a === void 0 ? void 0 : _a.filter((item) => item === null || item === void 0 ? void 0 : item.value);
|
|
12
|
+
return uniqueOption;
|
|
13
|
+
};
|
|
3
14
|
const getDataBase = (format, fields) => {
|
|
4
15
|
const filter = fields.filter((item) => (item === null || item === void 0 ? void 0 : item.format) === format);
|
|
5
16
|
const data = filter === null || filter === void 0 ? void 0 : filter.map((item) => {
|
|
@@ -43,7 +54,7 @@ export const mapResult = (records, primaryColumn) => {
|
|
|
43
54
|
extra: childItem,
|
|
44
55
|
}));
|
|
45
56
|
};
|
|
46
|
-
export const useChooseList = ({ dataSourceAPI, queryParams, childDbName, primaryColumn, value }) => {
|
|
57
|
+
export const useChooseList = ({ dataSourceAPI, queryParams, childDbName, primaryColumn, value, isInsertSelectedValue = true, }) => {
|
|
47
58
|
const [option, setOption] = useState([]);
|
|
48
59
|
const [total, setTotal] = useState(0);
|
|
49
60
|
const [loading, setLoading] = useState(true);
|
|
@@ -63,7 +74,7 @@ export const useChooseList = ({ dataSourceAPI, queryParams, childDbName, primary
|
|
|
63
74
|
db: childDbName,
|
|
64
75
|
}),
|
|
65
76
|
];
|
|
66
|
-
if (value) {
|
|
77
|
+
if (value && isInsertSelectedValue) {
|
|
67
78
|
if (isMultiple) {
|
|
68
79
|
value.forEach((i) => {
|
|
69
80
|
if (i) {
|
|
@@ -83,7 +94,7 @@ export const useChooseList = ({ dataSourceAPI, queryParams, childDbName, primary
|
|
|
83
94
|
let transformedRecords = [...((result === null || result === void 0 ? void 0 : result.records) || [])];
|
|
84
95
|
const itemResult = [...rest];
|
|
85
96
|
// 若下拉列表中无选中值,则将选中值插到数组头部
|
|
86
|
-
if ((isMultiple && (value === null || value === void 0 ? void 0 : value.length)) || value) {
|
|
97
|
+
if ((isMultiple && (value === null || value === void 0 ? void 0 : value.length) && isInsertSelectedValue) || (value && isInsertSelectedValue)) {
|
|
87
98
|
itemResult.forEach((i) => {
|
|
88
99
|
transformedRecords = unshiftVal(transformedRecords, i, option);
|
|
89
100
|
});
|
|
@@ -92,6 +103,7 @@ export const useChooseList = ({ dataSourceAPI, queryParams, childDbName, primary
|
|
|
92
103
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.pageNo) > defaultPage) {
|
|
93
104
|
optionRes = [...option, ...optionRes];
|
|
94
105
|
}
|
|
106
|
+
optionRes = getUniqueOption(optionRes);
|
|
95
107
|
setOption(optionRes);
|
|
96
108
|
setTotal(result === null || result === void 0 ? void 0 : result.total);
|
|
97
109
|
setLoading(false);
|
package/dist/web/utils/moment.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/weda-ui",
|
|
3
|
-
"version": "3.13.
|
|
3
|
+
"version": "3.13.2",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index",
|
|
6
6
|
"miniprogram": "mpdist",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"description": "腾讯云微搭低代码组件库模板",
|
|
86
86
|
"dependencies": {
|
|
87
87
|
"@antv/g6": "^4.8.5",
|
|
88
|
-
"@cloudbase/weda-client": "^1.1.
|
|
88
|
+
"@cloudbase/weda-client": "^1.1.15",
|
|
89
89
|
"@codemirror/autocomplete": "^6.16.0",
|
|
90
90
|
"@codemirror/lang-javascript": "^6.2.2",
|
|
91
91
|
"@codemirror/lang-json": "^6.0.1",
|
|
@@ -147,9 +147,9 @@
|
|
|
147
147
|
"@babel/preset-env": "^7.22.15",
|
|
148
148
|
"@babel/preset-react": "^7.22.15",
|
|
149
149
|
"@babel/preset-typescript": "^7.22.15",
|
|
150
|
-
"@cloudbase/cals": "^1.2.
|
|
150
|
+
"@cloudbase/cals": "^1.2.7",
|
|
151
151
|
"@cloudbase/lowcode-cli": "^0.22.0",
|
|
152
|
-
"@cloudbase/weda-cloud-sdk": "^1.0.
|
|
152
|
+
"@cloudbase/weda-cloud-sdk": "^1.0.96",
|
|
153
153
|
"@commitlint/cli": "^16.0.2",
|
|
154
154
|
"@commitlint/config-conventional": "^17.7.0",
|
|
155
155
|
"@craco/craco": "^7.1.0",
|