@cloudbase/weda-ui 3.4.1 → 3.4.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/actions/showModal.json +21 -0
- package/dist/configs/actions/showToast.json +11 -2
- package/dist/configs/components/button.json +1 -1
- package/dist/configs/components/calendar.json +1 -1
- package/dist/configs/components/carousel.json +1 -1
- package/dist/configs/components/chart/bar.json +2 -2
- package/dist/configs/components/chart/line.json +2 -2
- package/dist/configs/components/chart/pie.json +2 -2
- package/dist/configs/components/chart/statisticsCard.json +6 -6
- package/dist/configs/components/container.json +1 -1
- package/dist/configs/components/dataView.json +2 -2
- package/dist/configs/components/form/departTreeSelect.json +1 -1
- package/dist/configs/components/form/form.json +1 -1
- package/dist/configs/components/form/location.json +1 -1
- package/dist/configs/components/form/richText.json +1 -1
- package/dist/configs/components/form/uploader.json +1 -1
- package/dist/configs/components/form/uploaderFile.json +1 -1
- package/dist/configs/components/form/userTreeSelect.json +1 -1
- package/dist/configs/components/formdetail.json +1 -1
- package/dist/configs/components/graphicCard.json +1 -1
- package/dist/configs/components/image.json +1 -1
- package/dist/configs/components/link.json +1 -1
- package/dist/configs/components/listView.json +39 -9
- package/dist/configs/components/lottery.json +1 -1
- package/dist/configs/components/modal.json +2 -1
- package/dist/configs/components/navLayout.json +1 -1
- package/dist/configs/components/navigationBar.json +1 -1
- package/dist/configs/components/richtextview.json +1 -1
- package/dist/configs/components/scrollVeiw.json +93 -72
- package/dist/configs/components/swiper.json +1 -1
- package/dist/configs/components/tabs.json +1 -1
- package/dist/configs/components/text.json +1 -1
- package/dist/configs/components/wedaVideo.json +1 -1
- package/dist/configs/components/wxOpenApi/phone.json +1 -1
- package/dist/configs/components/wxOpenApi/phoneCode.json +1 -1
- package/dist/configs/components/wxOpenApi/share.json +9 -8
- package/dist/configs/components/wxOpenApi/userInfo.json +3 -3
- package/dist/web/components/form/form/index.js +18 -7
- package/dist/web/components/form/userOrgSelect/comTool.js +2 -4
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +3 -4
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.js +3 -4
- package/dist/web/components/form/userOrgSelect/userTreeSelect.h5.js +4 -6
- package/dist/web/components/form/userOrgSelect/userTreeSelect.pc.js +30 -28
- package/dist/web/components/listView/interface.d.ts +1 -1
- package/package.json +11 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useEffect
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import { renderDecorator } from '../renderDecorator';
|
|
3
3
|
import { isInIde, filterStrList } from '../../../utils/platform';
|
|
4
4
|
import classNames from 'classnames';
|
|
@@ -36,7 +36,7 @@ decorator, matchButtonWidth = false, modelOpen = false, dropDownStyle = defaultD
|
|
|
36
36
|
errorStatus: false,
|
|
37
37
|
errorMessage: null,
|
|
38
38
|
});
|
|
39
|
-
const getDefaultUser =
|
|
39
|
+
const getDefaultUser = async (defaultValue) => {
|
|
40
40
|
var _a;
|
|
41
41
|
try {
|
|
42
42
|
setErrorInfo({ errorStatus: false, errorMessage: null });
|
|
@@ -86,7 +86,7 @@ decorator, matchButtonWidth = false, modelOpen = false, dropDownStyle = defaultD
|
|
|
86
86
|
catch (e) {
|
|
87
87
|
setErrorInfo({ errorStatus: true, errorMessage: e });
|
|
88
88
|
}
|
|
89
|
-
}
|
|
89
|
+
};
|
|
90
90
|
useEffect(() => {
|
|
91
91
|
// 初始化数据
|
|
92
92
|
const initOrgsData = async () => {
|
|
@@ -114,16 +114,14 @@ decorator, matchButtonWidth = false, modelOpen = false, dropDownStyle = defaultD
|
|
|
114
114
|
setOpen(modelOpen);
|
|
115
115
|
}, [modelOpen]);
|
|
116
116
|
useEffect(() => {
|
|
117
|
-
if ((defaultValue &&
|
|
118
|
-
!isObjectEqual(
|
|
119
|
-
(confirmValue &&
|
|
120
|
-
!isObjectEqual(prevConfirmRef.current !== confirmValue)) ||
|
|
117
|
+
if ((defaultValue && !isObjectEqual(prevDefaultRef.current, defaultValue)) ||
|
|
118
|
+
(confirmValue && !isObjectEqual(prevConfirmRef.current, confirmValue)) ||
|
|
121
119
|
defaultValueType === 'loginUser') {
|
|
122
120
|
getDefaultUser(defaultValue);
|
|
123
121
|
prevDefaultRef.current = defaultValue;
|
|
124
122
|
prevConfirmRef.current = confirmValue;
|
|
125
123
|
}
|
|
126
|
-
}, [defaultValueType, confirmValue]);
|
|
124
|
+
}, [defaultValueType, confirmValue, defaultValue]);
|
|
127
125
|
useEffect(() => {
|
|
128
126
|
if (open) {
|
|
129
127
|
setErrorInfo({ errorStatus: false, errorMessage: null });
|
|
@@ -134,14 +132,34 @@ decorator, matchButtonWidth = false, modelOpen = false, dropDownStyle = defaultD
|
|
|
134
132
|
}
|
|
135
133
|
}
|
|
136
134
|
}, [open, orgsTreeData, curSelectData]);
|
|
137
|
-
|
|
135
|
+
useEffect(() => {
|
|
138
136
|
var _a;
|
|
137
|
+
const userIdList = [];
|
|
138
|
+
const userList = curSelectData.map((d) => {
|
|
139
|
+
var _a;
|
|
140
|
+
const realUserId = removeMarkString([d === null || d === void 0 ? void 0 : d.value]).toString();
|
|
141
|
+
userIdList.push(realUserId);
|
|
142
|
+
return {
|
|
143
|
+
userId: realUserId,
|
|
144
|
+
content: (_a = d === null || d === void 0 ? void 0 : d.data) === null || _a === void 0 ? void 0 : _a.content,
|
|
145
|
+
};
|
|
146
|
+
});
|
|
147
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(multiple ? userIdList : userIdList[0]);
|
|
148
|
+
(_a = events === null || events === void 0 ? void 0 : events.change) === null || _a === void 0 ? void 0 : _a.call(events, multiple
|
|
149
|
+
? {
|
|
150
|
+
value: userIdList.length > 0 ? userIdList : null,
|
|
151
|
+
data: userList.length > 0 ? userList : null,
|
|
152
|
+
}
|
|
153
|
+
: {
|
|
154
|
+
value: userIdList.length > 0 ? userIdList[0] : null,
|
|
155
|
+
data: userList.length > 0 ? userList[0] : null,
|
|
156
|
+
});
|
|
157
|
+
}, [curSelectData]);
|
|
158
|
+
const reset = (close) => {
|
|
139
159
|
setSelectIds([]);
|
|
140
160
|
setCurSelectData([]);
|
|
141
161
|
setActiveIds([]);
|
|
142
162
|
setErrorInfo({ errorStatus: false, errorMessage: null });
|
|
143
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(value);
|
|
144
|
-
(_a = events === null || events === void 0 ? void 0 : events.change) === null || _a === void 0 ? void 0 : _a.call(events, { value, data: null });
|
|
145
163
|
close && setOpen(false);
|
|
146
164
|
};
|
|
147
165
|
// 外层组件类
|
|
@@ -173,7 +191,6 @@ decorator, matchButtonWidth = false, modelOpen = false, dropDownStyle = defaultD
|
|
|
173
191
|
}
|
|
174
192
|
};
|
|
175
193
|
const onConfirm = () => {
|
|
176
|
-
var _a, _b;
|
|
177
194
|
const nodeList = [];
|
|
178
195
|
const idList = [];
|
|
179
196
|
const selectItem = [];
|
|
@@ -185,7 +202,7 @@ decorator, matchButtonWidth = false, modelOpen = false, dropDownStyle = defaultD
|
|
|
185
202
|
nodeList.push(node);
|
|
186
203
|
idList.push((node === null || node === void 0 ? void 0 : node.userId) || selectId);
|
|
187
204
|
selectItem.push({
|
|
188
|
-
value: node === null || node === void 0 ? void 0 : node.userId,
|
|
205
|
+
value: (node === null || node === void 0 ? void 0 : node.userId) || selectId,
|
|
189
206
|
data: node,
|
|
190
207
|
});
|
|
191
208
|
}
|
|
@@ -195,21 +212,6 @@ decorator, matchButtonWidth = false, modelOpen = false, dropDownStyle = defaultD
|
|
|
195
212
|
else {
|
|
196
213
|
setCurSelectData([]);
|
|
197
214
|
}
|
|
198
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(multiple ? idList : (_a = selectItem[0]) === null || _a === void 0 ? void 0 : _a.value);
|
|
199
|
-
(_b = events === null || events === void 0 ? void 0 : events.change) === null || _b === void 0 ? void 0 : _b.call(events, multiple
|
|
200
|
-
? {
|
|
201
|
-
value: idList,
|
|
202
|
-
data: nodeList.concat(curSelectData.length > 0
|
|
203
|
-
? curSelectData.map((item) => {
|
|
204
|
-
var _a;
|
|
205
|
-
return {
|
|
206
|
-
id: item === null || item === void 0 ? void 0 : item.value,
|
|
207
|
-
content: (_a = item === null || item === void 0 ? void 0 : item.data) === null || _a === void 0 ? void 0 : _a.content,
|
|
208
|
-
};
|
|
209
|
-
})
|
|
210
|
-
: []),
|
|
211
|
-
}
|
|
212
|
-
: selectItem[0]);
|
|
213
215
|
setOpen(false);
|
|
214
216
|
};
|
|
215
217
|
return renderDecorator(React.createElement(ConfigProvider, { classPrefix: "wedatea2td" },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/weda-ui",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.2",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index",
|
|
6
6
|
"miniprogram": "mpdist",
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@loadable/component": "^5.15.2",
|
|
61
61
|
"@react-hookz/web": "^14.2.2",
|
|
62
|
+
"@sinclair/typebox": "^0.25.1",
|
|
62
63
|
"@tcwd/style-wedatheme": "^1.0.4",
|
|
63
64
|
"@use-gesture/react": "^10.2.14",
|
|
64
65
|
"dayjs": "^1.10.7",
|
|
@@ -95,6 +96,7 @@
|
|
|
95
96
|
"@cypress/skip-test": "^2.6.1",
|
|
96
97
|
"@cypress/webpack-dev-server": "~2.0.0",
|
|
97
98
|
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
|
99
|
+
"@shopify/semaphore": "^3.0.1",
|
|
98
100
|
"@size-limit/preset-big-lib": "^7.0.8",
|
|
99
101
|
"@storybook/addon-actions": "^6.5.9",
|
|
100
102
|
"@storybook/addon-essentials": "^6.5.9",
|
|
@@ -107,7 +109,9 @@
|
|
|
107
109
|
"@testing-library/jest-dom": "^5.16.4",
|
|
108
110
|
"@testing-library/react": "^12.1.5",
|
|
109
111
|
"@testing-library/react-hooks": "^8.0.1",
|
|
112
|
+
"@types/glob": "^8.0.0",
|
|
110
113
|
"@types/jest": "^27.5.1",
|
|
114
|
+
"@types/make-fetch-happen": "^10.0.0",
|
|
111
115
|
"@types/resize-observer-browser": "^0.1.7",
|
|
112
116
|
"@types/testing-library__jest-dom": "^5.14.5",
|
|
113
117
|
"@typescript-eslint/eslint-plugin": "^5.30.5",
|
|
@@ -129,12 +133,15 @@
|
|
|
129
133
|
"eslint-plugin-react": "^7.30.1",
|
|
130
134
|
"eslint-plugin-rulesdir": "^0.2.1",
|
|
131
135
|
"eslint-plugin-storybook": "^0.5.13",
|
|
136
|
+
"glob": "^8.0.3",
|
|
132
137
|
"husky": "^8.0.1",
|
|
133
138
|
"identity-obj-proxy": "^3.0.0",
|
|
134
139
|
"jest": "^27.5.1",
|
|
135
140
|
"jest-canvas-mock": "^2.4.0",
|
|
136
141
|
"jest-environment-jsdom": "^27",
|
|
137
142
|
"jest-preview": "^0.2.6",
|
|
143
|
+
"json-schema-to-ts": "^2.5.5",
|
|
144
|
+
"make-fetch-happen": "^11.0.1",
|
|
138
145
|
"miniprogram-simulate": "^1.5.7",
|
|
139
146
|
"mkdirp": "^1.0.4",
|
|
140
147
|
"mochawesome": "^7.1.3",
|
|
@@ -147,6 +154,7 @@
|
|
|
147
154
|
"react-dom": "^16",
|
|
148
155
|
"react-scripts": "^5.0.1",
|
|
149
156
|
"react-test-renderer": "^16",
|
|
157
|
+
"recast": "^0.21.5",
|
|
150
158
|
"regenerator-runtime": "^0.13.9",
|
|
151
159
|
"resize-observer-polyfill": "^1.5.1",
|
|
152
160
|
"rimraf": "^3.0.2",
|
|
@@ -154,8 +162,10 @@
|
|
|
154
162
|
"start-server-and-test": "^1.14.0",
|
|
155
163
|
"swc-loader": "0.2.3",
|
|
156
164
|
"swc-plugin-coverage-instrument": "^0.0.7",
|
|
165
|
+
"ts-branding": "^1.0.2",
|
|
157
166
|
"ts-loader": "^9.3.1",
|
|
158
167
|
"ts-node": "^10.9.1",
|
|
168
|
+
"type-fest": "^3.0.0",
|
|
159
169
|
"typescript": "^4.7.4",
|
|
160
170
|
"webpack": "^5.73.0",
|
|
161
171
|
"webpack-cli": "^4.10.0",
|