@cloudbase/weda-ui 3.4.11 → 3.4.13
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/common/form-input-required.js +3 -3
- package/dist/configs/components/customer-service.js +3 -0
- package/dist/configs/components/dataView.js +20 -10
- package/dist/configs/components/form-checkbox.js +15 -2
- package/dist/configs/components/form-date.js +1 -1
- package/dist/configs/components/form-depart-tree-select.js +1 -1
- package/dist/configs/components/form-email.js +17 -2
- package/dist/configs/components/form-input.js +17 -2
- package/dist/configs/components/form-location.js +1 -1
- package/dist/configs/components/form-multi-region.js +1 -1
- package/dist/configs/components/form-phone.js +17 -2
- package/dist/configs/components/form-radio.js +15 -2
- package/dist/configs/components/form-rich-text.js +1 -1
- package/dist/configs/components/form-select-multiple.js +362 -0
- package/dist/configs/components/form-select.js +1 -1
- package/dist/configs/components/form-switch.js +16 -3
- package/dist/configs/components/form-text-area.js +15 -2
- package/dist/configs/components/form-time.js +1 -1
- package/dist/configs/components/form-url.js +17 -2
- package/dist/configs/components/form-user-tree-select.js +14 -1
- package/dist/configs/components/listView.js +32 -49
- package/dist/configs/components/table.json +1 -54
- package/dist/configs/components/wd-bubble.js +46 -8
- package/dist/configs/components/wd-button.js +3 -0
- package/dist/configs/components/wd-checkbox.js +464 -0
- package/dist/configs/components/wd-form.js +66 -10
- package/dist/configs/components/wd-input-email.js +37 -0
- package/dist/configs/components/wd-input-phone.js +43 -0
- package/dist/configs/components/wd-input-url.js +37 -0
- package/dist/configs/components/wd-input.js +94 -0
- package/dist/configs/components/wd-official-account.js +87 -0
- package/dist/configs/components/wd-radio.js +443 -0
- package/dist/configs/components/wd-switch.js +315 -0
- package/dist/configs/components/wd-table.js +11 -59
- package/dist/configs/components/wd-textarea.js +82 -0
- package/dist/configs/components/wd-tree.js +443 -0
- package/dist/configs/components/web-view.js +3 -0
- package/dist/configs/index.js +24 -1
- package/dist/configs/type-utils/type-form.js +681 -0
- package/dist/docs/common/components/json-schema-view.js +1 -1
- package/dist/docs/common/components/methods-view.js +1 -1
- package/dist/docs/common/components/properties-view.js +3 -1
- package/dist/docs/common/format.js +7 -7
- package/dist/docs/common/tableView.js +3 -1
- package/dist/enum/index.js +196 -0
- package/dist/style/index.scss +1 -1
- package/dist/web/actions/showMessage/index.js +4 -1
- package/dist/web/components/carousel/index.js +1 -1
- package/dist/web/components/customer-service/customer-service.js +19 -2
- package/dist/web/components/dataView/index.js +16 -3
- package/dist/web/components/flow/common/hooks/useCommonFlowData/flow-get.js +5 -1
- package/dist/web/components/flow/common/request.js +5 -5
- package/dist/web/components/flow/modules/operations/controls-items/flow-task-info-modal.js +90 -0
- package/dist/web/components/form/formcell/index.css +13 -1
- package/dist/web/components/form/formcell/index.js +1 -1
- package/dist/web/components/form/location/components/LocationH5/location.h5.js +1 -1
- package/dist/web/components/form/select/dropdown-select/index.js +9 -3
- package/dist/web/components/form/select/h5.js +18 -8
- package/dist/web/components/form/select/index.js +9 -10
- package/dist/web/components/form/select/region/index.js +1 -1
- package/dist/web/components/form/selectMultiple/dropdown-select/h5.js +111 -0
- package/dist/web/components/form/selectMultiple/dropdown-select/index.css +270 -0
- package/dist/web/components/form/selectMultiple/dropdown-select/index.js +206 -0
- package/dist/web/components/form/selectMultiple/dropdown-select/pc.js +115 -0
- package/dist/web/components/form/selectMultiple/dropdown-select/ui.js +113 -0
- package/dist/web/components/form/selectMultiple/h5.js +40 -0
- package/dist/web/components/form/selectMultiple/index.js +94 -0
- package/dist/web/components/form/selectMultiple/request.js +76 -0
- package/dist/web/components/form/selectMultiple/status/allEmpty.js +5 -0
- package/dist/web/components/form/selectMultiple/status/empty.js +19 -0
- package/dist/web/components/form/selectMultiple/status/index.css +63 -0
- package/dist/web/components/form/selectMultiple/status/index.js +7 -0
- package/dist/web/components/form/selectMultiple/status/loading.js +19 -0
- package/dist/web/components/form/selectMultiple/status/propsType.js +1 -0
- package/dist/web/components/form/selectMultiple/status/retry.js +19 -0
- package/dist/web/components/form/tips/index.css +9 -3
- package/dist/web/components/form/uploader/index.css +10 -0
- package/dist/web/components/form/uploader/uploader.h5.js +60 -62
- package/dist/web/components/form/uploader/uploader.pc.js +48 -41
- package/dist/web/components/form/uploaderFile/uploadFile.h5.js +8 -33
- package/dist/web/components/form/uploaderFile/uploadFile.pc.js +8 -37
- package/dist/web/components/form/userOrgSelect/common/fetch-data-service.js +76 -50
- package/dist/web/components/form/userOrgSelect/common/utils.js +24 -8
- package/dist/web/components/form/userOrgSelect/component/depart-select/depart-select-pc.js +3 -8
- package/dist/web/components/form/userOrgSelect/component/depart-select/index.js +14 -18
- package/dist/web/components/form/userOrgSelect/component/depart-select/org-modal-pc.js +20 -14
- package/dist/web/components/form/userOrgSelect/component/modal-select-h5.js +1 -1
- package/dist/web/components/form/userOrgSelect/component/org-tree.js +21 -9
- package/dist/web/components/form/userOrgSelect/component/user-select-h5/index.js +76 -15
- package/dist/web/components/form/userOrgSelect/component/user-select-pc/user-model.js +2 -7
- package/dist/web/components/form/userOrgSelect/component/user-select-pc/user-select-pc.js +6 -4
- package/dist/web/components/form/userOrgSelect/component/userOrgSelect.css +8 -2
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +25 -51
- package/dist/web/components/form/userOrgSelect/hooks/use-depart-data.js +10 -6
- package/dist/web/components/form-input-hooks/index.js +41 -15
- package/dist/web/components/form-select-multiple/index.js +26 -0
- package/dist/web/components/form-upload-file/index.js +0 -1
- package/dist/web/components/form-user-tree-select/index.js +2 -2
- package/dist/web/components/formdetail/index.css +31 -1
- package/dist/web/components/formdetail/index.js +33 -1
- package/dist/web/components/index.js +27 -11
- package/dist/web/components/listView/index.js +20 -5
- package/dist/web/components/navigationBar/common.js +1 -1
- package/dist/web/components/navigationBar/horizontalMenu.js +1 -1
- package/dist/web/components/navigationBar/index.css +11 -0
- package/dist/web/components/navigationBar/index.js +8 -1
- package/dist/web/components/phone/index.js +26 -1
- package/dist/web/components/phoneCode/index.js +3 -1
- package/dist/web/components/richText/index.css +70 -67
- package/dist/web/components/richText/index.js +311 -251
- package/dist/web/components/richText/richtext.module.css +1 -0
- package/dist/web/components/richTextView/index.css +39 -0
- package/dist/web/components/richTextView/index.js +1 -1
- package/dist/web/components/share/index.js +26 -1
- package/dist/web/components/table/ImportFileModalByApi/uploadCSVFile.js +1 -1
- package/dist/web/components/wd-checkbox/checkbox.js +34 -0
- package/dist/web/components/wd-checkbox/index.js +3 -0
- package/dist/web/components/wd-checkbox-list/checkboxList.js +140 -0
- package/dist/web/components/wd-checkbox-list/index.js +3 -0
- package/dist/web/components/wd-form/hooks/use-remote-value.js +9 -2
- package/dist/web/components/wd-form/index.js +69 -34
- package/dist/web/components/wd-form/wd-form.js +42 -0
- package/dist/web/components/wd-form-cell/index.js +3 -0
- package/dist/web/components/wd-form-cell/wd-form-cell.js +42 -0
- package/dist/web/components/wd-form-item/index.js +4 -0
- package/dist/web/components/wd-form-item/wd-form-item.js +55 -0
- package/dist/web/components/wd-form-item/wd-input-group.js +24 -0
- package/dist/web/components/wd-icon/wd-icon.js +10 -2
- package/dist/web/components/wd-input/index.js +3 -0
- package/dist/web/components/wd-input/wd-input.js +155 -0
- package/dist/web/components/wd-input-email/index.js +3 -0
- package/dist/web/components/wd-input-email/wd-input-email.js +13 -0
- package/dist/web/components/wd-input-group/index.js +3 -0
- package/dist/web/components/wd-input-group/wd-input-group.js +10 -0
- package/dist/web/components/wd-input-phone/index.js +3 -0
- package/dist/web/components/wd-input-phone/wd-input-phone.js +14 -0
- package/dist/web/components/wd-input-url/index.js +3 -0
- package/dist/web/components/wd-input-url/wd-input-url.js +13 -0
- package/dist/web/components/wd-input-wrap/index.js +3 -0
- package/dist/web/components/wd-input-wrap/wd-input-wrap.js +18 -0
- package/dist/web/components/wd-official-account/index.css +29 -0
- package/dist/web/components/wd-official-account/index.js +36 -0
- package/dist/web/components/wd-radio/index.js +3 -0
- package/dist/web/components/wd-radio/wd-radio.js +30 -0
- package/dist/web/components/wd-radio-list/index.js +3 -0
- package/dist/web/components/wd-radio-list/wd-radio-list.js +104 -0
- package/dist/web/components/wd-switch/index.js +3 -0
- package/dist/web/components/wd-switch/wd-switch.js +52 -0
- package/dist/web/components/wd-table/components/FieldRender/index.js +5 -4
- package/dist/web/components/wd-table/components/FilterFieldsPanel/FilterFieldItem.js +4 -0
- package/dist/web/components/wd-table/components/Table/index.js +40 -9
- package/dist/web/components/wd-table/hooks/useQueryParams.js +4 -1
- package/dist/web/components/wd-table/hooks/useTableData.js +6 -1
- package/dist/web/components/wd-table/hooks/useViewFields.js +1 -1
- package/dist/web/components/wd-table/utils/index.js +6 -2
- package/dist/web/components/wd-table/wd-table.js +125 -99
- package/dist/web/components/wd-textarea/index.js +3 -0
- package/dist/web/components/wd-textarea/wd-textarea.js +78 -0
- package/dist/web/components/wd-tree/index.js +3 -0
- package/dist/web/components/wd-tree/utils.js +291 -0
- package/dist/web/components/wd-tree/wd-tree.js +193 -0
- package/dist/web/utils/constant.js +16 -0
- package/dist/web/utils/datasource.js +2 -2
- package/dist/web/utils/date.js +3 -3
- package/dist/web/utils/hooks/useFormLegacy.js +112 -0
- package/dist/web/utils/tool.js +12 -2
- package/dist/web/weda-ui.css +197 -3
- package/package.json +6 -5
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import React, { useState
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
3
|
import { renderDecorator } from '../../renderDecorator';
|
|
4
4
|
import { IconFont } from 'tdesign-icons-react';
|
|
5
5
|
import classNames from '../../../../utils/classnames';
|
|
6
|
-
import {
|
|
6
|
+
import { fetchSearchOrg, getNodeFromTreeByCode } from '../common/utils';
|
|
7
7
|
import { Modal, Button, ConfigProvider, Radio, Status, Bubble, } from 'tea-component';
|
|
8
8
|
import { ModalSearchH5 } from '../component/modal-search-h5';
|
|
9
9
|
import { LoadingStatus, ErrorStatus } from '../component/error-tips';
|
|
@@ -23,24 +23,12 @@ export function DepartTreeSelectH5({ id, className, style, label = '部门选择
|
|
|
23
23
|
});
|
|
24
24
|
const [visible, setVisible] = React.useState(false);
|
|
25
25
|
const [isSearch, setIsSearch] = useState(false);
|
|
26
|
-
// const [showTreeData, setShowTreeData] = useState([]);
|
|
27
26
|
const [showTreeData, setShowTreeData] = useState([]);
|
|
28
|
-
|
|
29
|
-
const [
|
|
27
|
+
// currentItem:到达当前页面是从currentItem部门点击来的
|
|
28
|
+
const [currentItem, setCurrentItem] = useState(null);
|
|
30
29
|
const [searchValue, setSearchValue] = useState('');
|
|
31
30
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
32
31
|
const [loading, setLoading] = useState({ id: null, status: false });
|
|
33
|
-
const [titleText, setTitleText] = useState('');
|
|
34
|
-
const treeNode = getNode(treeData, 'root', 'id');
|
|
35
|
-
useEffect(() => {
|
|
36
|
-
// 仅执行一次
|
|
37
|
-
if (treeData) {
|
|
38
|
-
setShowTreeData(treeNode);
|
|
39
|
-
setOriginalOrgData([{ index: 1, treeData: treeNode, title: '选择部门' }]);
|
|
40
|
-
setTitleText('选择部门');
|
|
41
|
-
}
|
|
42
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
43
|
-
}, [treeData]);
|
|
44
32
|
const handleFocus = (value) => {
|
|
45
33
|
setIsSearch(value);
|
|
46
34
|
};
|
|
@@ -48,8 +36,7 @@ export function DepartTreeSelectH5({ id, className, style, label = '部门选择
|
|
|
48
36
|
setErrorInfo({ errorStatus: false, errorMessage: null });
|
|
49
37
|
handleFocus(false);
|
|
50
38
|
setSearchValue('');
|
|
51
|
-
setShowTreeData(
|
|
52
|
-
// initOrgsData();
|
|
39
|
+
setShowTreeData(treeData);
|
|
53
40
|
};
|
|
54
41
|
const onSearch = debounce((key) => {
|
|
55
42
|
try {
|
|
@@ -59,7 +46,7 @@ export function DepartTreeSelectH5({ id, className, style, label = '部门选择
|
|
|
59
46
|
setShowTreeData(res);
|
|
60
47
|
}
|
|
61
48
|
else {
|
|
62
|
-
setShowTreeData(
|
|
49
|
+
setShowTreeData(treeData);
|
|
63
50
|
}
|
|
64
51
|
}
|
|
65
52
|
catch (e) {
|
|
@@ -69,58 +56,45 @@ export function DepartTreeSelectH5({ id, className, style, label = '部门选择
|
|
|
69
56
|
const onFocus = function () {
|
|
70
57
|
setSearchValue('');
|
|
71
58
|
setVisible(true);
|
|
72
|
-
setShowTreeData(
|
|
59
|
+
setShowTreeData(treeData);
|
|
73
60
|
};
|
|
74
61
|
const onClose = () => {
|
|
75
62
|
setErrorInfo({ errorStatus: false, errorMessage: null });
|
|
76
63
|
setVisible(false);
|
|
77
|
-
setShowTreeData(
|
|
78
|
-
setShowTreeData(treeNode);
|
|
64
|
+
setShowTreeData(treeData);
|
|
79
65
|
};
|
|
80
66
|
const onConfirm = (selectedOrgList = []) => {
|
|
81
67
|
setConfirmOrgList(selectedOrgList);
|
|
82
68
|
setErrorInfo({ errorStatus: false, errorMessage: null });
|
|
83
|
-
setShowTreeData(
|
|
69
|
+
setShowTreeData(treeData);
|
|
84
70
|
setVisible(false);
|
|
85
71
|
};
|
|
86
72
|
// 获取某节点子部门
|
|
87
73
|
const loadItem = (item) => {
|
|
88
74
|
setShowTreeData((item === null || item === void 0 ? void 0 : item.children) ? [].concat(item === null || item === void 0 ? void 0 : item.children) : []);
|
|
89
|
-
|
|
90
|
-
index: count + 1,
|
|
91
|
-
treeData: item === null || item === void 0 ? void 0 : item.children,
|
|
92
|
-
title: item === null || item === void 0 ? void 0 : item.content,
|
|
93
|
-
});
|
|
94
|
-
setCount(count + 1);
|
|
95
|
-
setOriginalOrgData(originalOrgData);
|
|
96
|
-
setTitleText(item === null || item === void 0 ? void 0 : item.content);
|
|
75
|
+
setCurrentItem(item);
|
|
97
76
|
};
|
|
98
|
-
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
setTitleText(item.title);
|
|
108
|
-
setShowTreeData((item === null || item === void 0 ? void 0 : item.treeData) || []);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
setOriginalOrgData(storageOriTreeData);
|
|
77
|
+
// 返回targetItem节点所在的层级
|
|
78
|
+
const returnToLevelOfNode = (targetItem) => {
|
|
79
|
+
if (!targetItem) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
// 已经返回到根节点层级
|
|
83
|
+
if (!targetItem.parentcode || targetItem.parentcode === '!!ROOT') {
|
|
84
|
+
setShowTreeData(treeData);
|
|
85
|
+
setCurrentItem(null);
|
|
116
86
|
}
|
|
117
87
|
else {
|
|
118
|
-
|
|
88
|
+
// 要返回targetItem所在的层级,需要找到targetItem的父节点parent,再显示parent的子节点即可
|
|
89
|
+
const parent = getNodeFromTreeByCode(treeData, targetItem.parentcode);
|
|
90
|
+
setShowTreeData((parent === null || parent === void 0 ? void 0 : parent.children) || []);
|
|
91
|
+
// 标记当前是从根节点进到这一层
|
|
92
|
+
setCurrentItem(parent);
|
|
119
93
|
}
|
|
120
94
|
};
|
|
121
95
|
return renderDecorator(_jsx(ConfigProvider, { classPrefix: "wedatea2td", children: _jsxs("div", { className: subCls, children: [_jsx("div", { className: "weui-cell__bd weui-flex", children: _jsx("input", { className: "weui-input", placeholder: placeholder,
|
|
122
96
|
//value={value}
|
|
123
|
-
value: (confirmOrgList || []).map((e) => e === null || e === void 0 ? void 0 : e.content).join(','), disabled: disabled, name: name, autoFocus: autoFocus, onClick: onFocus, readOnly: true, role: "input" }) }), _jsxs(Modal, { visible: visible, onClose: onClose, destroyOnClose: true, className: `weda-ui weda-select-user-dept__dialog`, children: [_jsxs(Modal.Body, { className: ((_a = selectedOrgList[0]) === null || _a === void 0 ? void 0 : _a.id) ? 'is-selected-value' : '', children: [_jsxs("div", { className: "weda-select-user-dept__dialog-header",
|
|
97
|
+
value: (confirmOrgList || []).map((e) => e === null || e === void 0 ? void 0 : e.content).join(','), disabled: disabled, name: name, autoFocus: autoFocus, onClick: onFocus, readOnly: true, role: "input" }) }), _jsxs(Modal, { disableEscape: true, maskClosable: false, visible: visible, onClose: onClose, destroyOnClose: true, className: `weda-ui weda-select-user-dept__dialog`, children: [_jsxs(Modal.Body, { className: ((_a = selectedOrgList[0]) === null || _a === void 0 ? void 0 : _a.id) ? 'is-selected-value' : '', children: [_jsxs("div", { className: "weda-select-user-dept__dialog-header", children: [_jsx("div", { className: !currentItem ? '' : 'arrow-left', onClick: () => returnToLevelOfNode(currentItem) }), currentItem ? currentItem.content : '选择部门'] }), _jsx(ModalSearchH5, { value: searchValue, onChange: (key) => {
|
|
124
98
|
onSearch(key);
|
|
125
99
|
setSearchValue(key);
|
|
126
100
|
}, onCancel: cancleSearch, isSearch: isSearch, onFocus: () => {
|
|
@@ -64,14 +64,18 @@ const isNoOrgList = {
|
|
|
64
64
|
icon: Icon,
|
|
65
65
|
};
|
|
66
66
|
export const useDepartData = (props) => {
|
|
67
|
-
const { request } = props;
|
|
68
|
-
const { data: treeData, error } = useSWR(
|
|
69
|
-
const tempList = await DescribeOrgs(request);
|
|
67
|
+
const { request, params, displayUncategorizedUsers } = props;
|
|
68
|
+
const { data: treeData, error } = useSWR(`${DescribeOrgs}_${JSON.stringify(params)}`, async () => {
|
|
69
|
+
const tempList = await DescribeOrgs(request, params);
|
|
70
70
|
const orgsData = destr(tempList);
|
|
71
71
|
const { res: tempTreeData, tempOrgList } = buildTreeData(orgsData);
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
// 是否展示非组织节点
|
|
73
|
+
let userDataTotal = 0;
|
|
74
|
+
if (displayUncategorizedUsers) {
|
|
75
|
+
const res = await fetchUserData({ pageNo: 1, pageSize: 1 }, request);
|
|
76
|
+
userDataTotal = res === null || res === void 0 ? void 0 : res.total;
|
|
77
|
+
}
|
|
78
|
+
const finalTempTreeData = userDataTotal > 0
|
|
75
79
|
? (tempTreeData || []).concat(isNoOrgList)
|
|
76
80
|
: tempTreeData;
|
|
77
81
|
return {
|
|
@@ -9,6 +9,7 @@ import { getParentForm, useWedaAppContext } from '../../utils/widget-api';
|
|
|
9
9
|
import { validType } from './validator';
|
|
10
10
|
import { emptyArray, noop } from '../../utils/constant';
|
|
11
11
|
import { useRerender, useSyncedRef, useUnmountEffect } from '@react-hookz/web';
|
|
12
|
+
import { useStatus, convertMethodParam } from '../../utils/hooks/useFormLegacy';
|
|
12
13
|
const logger = debug('wd-form-item');
|
|
13
14
|
export function useParentForm($widget) {
|
|
14
15
|
const { ready } = useWedaAppContext();
|
|
@@ -42,8 +43,9 @@ export function useFormInputTrait(inputParams) {
|
|
|
42
43
|
}
|
|
43
44
|
const eventsRef = useSyncedRef(events);
|
|
44
45
|
const [name] = useSyncValue(inputParams.name);
|
|
45
|
-
const
|
|
46
|
-
const [
|
|
46
|
+
const statusParams = useStatus(inputParams);
|
|
47
|
+
const [disabled, setDisabled] = useSyncValue((_a = statusParams.disabled) !== null && _a !== void 0 ? _a : false);
|
|
48
|
+
const [readOnly, setReadOnly] = useSyncValue(statusParams.readOnly);
|
|
47
49
|
const [validateState, setValidateState] = useState(inputParams.validateStatus);
|
|
48
50
|
const [validateErrorMsg, setValidateErrorMsg] = useState('');
|
|
49
51
|
const [visible, setVisible] = useState(true);
|
|
@@ -90,23 +92,28 @@ export function useFormInputTrait(inputParams) {
|
|
|
90
92
|
}, [setValidateErrorMsg, setValidateState]);
|
|
91
93
|
// 挂在setValue方法到 $widget上
|
|
92
94
|
React.useImperativeHandle(inputRef, () => {
|
|
95
|
+
logger.debug('useImperativeHandle', { name, syncValue });
|
|
93
96
|
const result = {
|
|
94
97
|
setValue(val) {
|
|
95
|
-
|
|
98
|
+
const value = convertMethodParam(val);
|
|
99
|
+
setSyncedValue(value);
|
|
96
100
|
},
|
|
97
101
|
setVisible(val) {
|
|
98
|
-
|
|
102
|
+
const value = convertMethodParam(val);
|
|
103
|
+
if (typeof value !== 'boolean') {
|
|
99
104
|
console.warn('参数需要为boolean');
|
|
100
105
|
return;
|
|
101
106
|
}
|
|
102
|
-
setVisible(
|
|
107
|
+
setVisible(value);
|
|
103
108
|
},
|
|
104
109
|
setHidden() {
|
|
105
110
|
setVisible(false);
|
|
106
111
|
},
|
|
107
|
-
initialDisabled:
|
|
108
|
-
|
|
112
|
+
initialDisabled: statusParams.disabled,
|
|
113
|
+
initialReadOnly: statusParams.readOnly,
|
|
114
|
+
setDisabled(val) {
|
|
109
115
|
const originalValue = disabled;
|
|
116
|
+
const value = convertMethodParam(val);
|
|
110
117
|
setDisabled(value);
|
|
111
118
|
return () => {
|
|
112
119
|
setDisabled(originalValue);
|
|
@@ -115,12 +122,14 @@ export function useFormInputTrait(inputParams) {
|
|
|
115
122
|
clearValue() {
|
|
116
123
|
setSyncedValue(null);
|
|
117
124
|
},
|
|
118
|
-
setReadOnly(
|
|
119
|
-
const
|
|
120
|
-
|
|
125
|
+
setReadOnly(val) {
|
|
126
|
+
const [originalReadOnly, originalDisabled] = [readOnly, disabled];
|
|
127
|
+
const value = convertMethodParam(val);
|
|
128
|
+
setReadOnly(value);
|
|
121
129
|
setDisabled(value);
|
|
122
130
|
return () => {
|
|
123
|
-
|
|
131
|
+
setReadOnly(originalReadOnly);
|
|
132
|
+
setDisabled(originalDisabled);
|
|
124
133
|
};
|
|
125
134
|
},
|
|
126
135
|
async handleValidate() {
|
|
@@ -163,11 +172,27 @@ export function useFormInputTrait(inputParams) {
|
|
|
163
172
|
if (item.pattern) {
|
|
164
173
|
// 正则校验
|
|
165
174
|
// console.log("pattern 校验>>>>")
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
175
|
+
try {
|
|
176
|
+
let reg;
|
|
177
|
+
if (typeof item.pattern === 'string') {
|
|
178
|
+
const m = item.pattern.match(/(\/?)(.+)\1([a-z]*)/i);
|
|
179
|
+
if (m[3] &&
|
|
180
|
+
!/^(?!.*?(.).*?\1)[gmixXsuUAJ]+$/.test(m[3])) {
|
|
181
|
+
reg = RegExp(item.pattern);
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
reg = new RegExp(m[2], m[3]);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
reg = new RegExp(item.pattern);
|
|
189
|
+
}
|
|
190
|
+
if (!reg.test(String(finalValue))) {
|
|
191
|
+
validPromise.push(Promise.resolve(item));
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
170
194
|
}
|
|
195
|
+
catch (e) { }
|
|
171
196
|
}
|
|
172
197
|
}
|
|
173
198
|
});
|
|
@@ -209,6 +234,7 @@ export function useFormInputTrait(inputParams) {
|
|
|
209
234
|
setSyncedValue,
|
|
210
235
|
disabled,
|
|
211
236
|
setDisabled,
|
|
237
|
+
setReadOnly,
|
|
212
238
|
required,
|
|
213
239
|
rules,
|
|
214
240
|
requiredMsg,
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { FormItemWrapper } from '../common/form-item-wrapper';
|
|
4
|
+
import SelectMultiple from '../form/selectMultiple';
|
|
5
|
+
import Tips from '../form/tips';
|
|
6
|
+
import { useFormInputTrait } from '../form-input-hooks';
|
|
7
|
+
const FormSelectMultiple = React.forwardRef(function FormSelectMultiple(props, inputRef) {
|
|
8
|
+
const { className, id, style, events, required, requiredFlag, label, labelVisible, dataSourceName, enumName, format, placeholder, primaryField, range, size, tipBlock, viewId,
|
|
9
|
+
// where,
|
|
10
|
+
...restProps } = props;
|
|
11
|
+
const { value, name, onChange, disabled, layout,
|
|
12
|
+
// readOnly,
|
|
13
|
+
validateErrorMsg, validateState, visible, } = useFormInputTrait({
|
|
14
|
+
name: restProps.name,
|
|
15
|
+
inputRef,
|
|
16
|
+
required,
|
|
17
|
+
...restProps,
|
|
18
|
+
});
|
|
19
|
+
if (!visible) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
return (_jsxs(FormItemWrapper, { children: [_jsx(SelectMultiple, { id: id, style: style, className: className, events: events, name: name, onChange: onChange, disabled: disabled, label: label, labelVisible: labelVisible, layout: layout, requiredFlag: required && requiredFlag, defaultValue: value, enumName: enumName, format: format, placeholder: placeholder, primaryField: primaryField, range: range, size: size, tipBlock: tipBlock, viewId: viewId,
|
|
23
|
+
// where={where}
|
|
24
|
+
dataSourceName: dataSourceName, mode: "selector" }), (validateState === 'error' || validateState === 'warn') && (_jsx(Tips, { tips: validateErrorMsg, type: "warn" }))] }));
|
|
25
|
+
});
|
|
26
|
+
export default FormSelectMultiple;
|
|
@@ -43,5 +43,4 @@ const FormUploadFile = React.forwardRef(function FormUploadFile(props, ref) {
|
|
|
43
43
|
}
|
|
44
44
|
return (_jsxs(FormItemWrapper, { children: [_jsx(UploaderFile, { id: id, style: style, className: className, events: events, name: name, onChange: onChange, disabled: disabled, label: label, labelVisible: labelVisible, layout: layout, requiredFlag: required && requiredFlag, acceptTypes: acceptTypes, defaultValue: value, deleteVisible: deleteVisible, downloadVisible: downloadVisible, maxSize: maxSize, maxUploadCount: maxUploadCount, single: single }), (validateState === 'error' || validateState === 'warn') && (_jsx(Tips, { tips: validateErrorMsg, type: "warn" }))] }));
|
|
45
45
|
});
|
|
46
|
-
FormUploadFile.whyDidYouRender = true;
|
|
47
46
|
export default FormUploadFile;
|
|
@@ -5,7 +5,7 @@ import Tips from '../form/tips';
|
|
|
5
5
|
import { useFormInputTrait } from '../form-input-hooks';
|
|
6
6
|
import { FormItemWrapper } from '../common/form-item-wrapper';
|
|
7
7
|
const FormUserTreeSelect = React.forwardRef(function FormUserTreeSelect(props, inputRef) {
|
|
8
|
-
const { className, id, style, events, required, requiredFlag, label, labelVisible, confirmValue, defaultValueType, multiple, size, where, secondDisplay, ...restProps } = props;
|
|
8
|
+
const { className, id, style, events, required, requiredFlag, label, labelVisible, confirmValue, defaultValueType, multiple, size, where, secondDisplay, corpScope, ...restProps } = props;
|
|
9
9
|
const { value, name,
|
|
10
10
|
// onChange,
|
|
11
11
|
disabled, layout,
|
|
@@ -19,6 +19,6 @@ const FormUserTreeSelect = React.forwardRef(function FormUserTreeSelect(props, i
|
|
|
19
19
|
if (!visible) {
|
|
20
20
|
return null;
|
|
21
21
|
}
|
|
22
|
-
return (_jsxs(FormItemWrapper, { children: [_jsx(UserTreeSelect, { id: id, style: style, className: className, events: events, name: name, checked: value, disabled: disabled, label: label, labelVisible: labelVisible, layout: layout, requiredFlag: required && requiredFlag, confirmValue: confirmValue, defaultValueType: defaultValueType, defaultValue: value, size: size, multiple: multiple, where: where, secondDisplay: secondDisplay }), (validateState === 'error' || validateState === 'warn') && (_jsx(Tips, { tips: validateErrorMsg, type: "warn" }))] }));
|
|
22
|
+
return (_jsxs(FormItemWrapper, { children: [_jsx(UserTreeSelect, { id: id, style: style, className: className, events: events, name: name, checked: value, disabled: disabled, label: label, labelVisible: labelVisible, layout: layout, requiredFlag: required && requiredFlag, confirmValue: confirmValue, defaultValueType: defaultValueType, defaultValue: value, size: size, multiple: multiple, where: where, secondDisplay: secondDisplay, corpScope: corpScope }), (validateState === 'error' || validateState === 'warn') && (_jsx(Tips, { tips: validateErrorMsg, type: "warn" }))] }));
|
|
23
23
|
});
|
|
24
24
|
export default FormUserTreeSelect;
|
|
@@ -228,6 +228,30 @@
|
|
|
228
228
|
float: unset;
|
|
229
229
|
width: 100%;
|
|
230
230
|
}
|
|
231
|
+
|
|
232
|
+
.wd-form--vertical-left
|
|
233
|
+
.form-detail-wrap.pc-form-detail-wrap
|
|
234
|
+
.form-detail-group-parent-container,
|
|
235
|
+
.wd-form--vertical-right
|
|
236
|
+
.form-detail-wrap.pc-form-detail-wrap
|
|
237
|
+
.form-detail-group-parent-container {
|
|
238
|
+
float: unset;
|
|
239
|
+
width: 100%;
|
|
240
|
+
}
|
|
241
|
+
.wd-form--vertical-left
|
|
242
|
+
.form-detail-wrap.pc-form-detail-wrap
|
|
243
|
+
.form-detail-group-label-container {
|
|
244
|
+
float: unset;
|
|
245
|
+
width: 100%;
|
|
246
|
+
}
|
|
247
|
+
.wd-form--vertical-right
|
|
248
|
+
.form-detail-wrap.pc-form-detail-wrap
|
|
249
|
+
.form-detail-group-label-container {
|
|
250
|
+
float: unset;
|
|
251
|
+
width: 100%;
|
|
252
|
+
text-align: right;
|
|
253
|
+
}
|
|
254
|
+
|
|
231
255
|
/* 升级后组件样式兼容 */
|
|
232
256
|
.form-detail-wrap .form-detail-add-button .wd-typography,
|
|
233
257
|
.form-detail-wrap .form-detail-delete-button .wd-typography {
|
|
@@ -400,10 +424,12 @@
|
|
|
400
424
|
}
|
|
401
425
|
.form-detail-table .tableHeaderCellContainer {
|
|
402
426
|
display: flex;
|
|
427
|
+
position: relative;
|
|
403
428
|
}
|
|
404
429
|
.form-detail-table .tableHeaderCellContainer .tableFieldRequired {
|
|
405
430
|
color: #e34d59;
|
|
406
|
-
|
|
431
|
+
position: absolute;
|
|
432
|
+
left: -10px;
|
|
407
433
|
}
|
|
408
434
|
.form-detail-table .wd-grid-col.form-detail-table-option-container {
|
|
409
435
|
background-color: #f3f3f3;
|
|
@@ -442,3 +468,7 @@
|
|
|
442
468
|
.form-detail-wrap .wd-grid-row > div {
|
|
443
469
|
margin: 0;
|
|
444
470
|
}
|
|
471
|
+
|
|
472
|
+
.form-detail-wrap.form-detail-table .weda-ui.gsd-h5-react-formitem > .weda-ui {
|
|
473
|
+
padding: 0;
|
|
474
|
+
}
|
|
@@ -10,6 +10,28 @@ import { useFormInputTrait, useParentForm } from '../form-input-hooks';
|
|
|
10
10
|
import { debug } from '../../utils/console';
|
|
11
11
|
import { noop } from '../../utils/constant';
|
|
12
12
|
import { WdText } from '../wd-text';
|
|
13
|
+
// 获取明细组件子项初始值
|
|
14
|
+
const getChildFormItem = (isPureArray, name, parent) => {
|
|
15
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
16
|
+
let childFormItem = [];
|
|
17
|
+
let fieldSchema = null;
|
|
18
|
+
if ('model' === (parent === null || parent === void 0 ? void 0 : parent.datasourceType)) {
|
|
19
|
+
fieldSchema = (_c = (_b = (_a = parent === null || parent === void 0 ? void 0 : parent.dataSourceProfile) === null || _a === void 0 ? void 0 : _a.schema) === null || _b === void 0 ? void 0 : _b.properties) === null || _c === void 0 ? void 0 : _c[name];
|
|
20
|
+
}
|
|
21
|
+
else if (['connector', 'custom-connector'].includes(parent === null || parent === void 0 ? void 0 : parent.datasourceType)) {
|
|
22
|
+
const method = (parent === null || parent === void 0 ? void 0 : parent.methodCreate) || (parent === null || parent === void 0 ? void 0 : parent.methodUpdate) || (parent === null || parent === void 0 ? void 0 : parent.methodGetItem);
|
|
23
|
+
const inParams = (_f = (_e = (_d = parent === null || parent === void 0 ? void 0 : parent.dataSourceProfile) === null || _d === void 0 ? void 0 : _d.methods) === null || _e === void 0 ? void 0 : _e.find((i) => i.name === method)) === null || _f === void 0 ? void 0 : _f.inParams;
|
|
24
|
+
fieldSchema = (_g = inParams === null || inParams === void 0 ? void 0 : inParams.properties) === null || _g === void 0 ? void 0 : _g[name];
|
|
25
|
+
}
|
|
26
|
+
childFormItem = ((_h = fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.items) === null || _h === void 0 ? void 0 : _h.properties)
|
|
27
|
+
? Object.keys((_j = fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.items) === null || _j === void 0 ? void 0 : _j.properties)
|
|
28
|
+
: [];
|
|
29
|
+
// 纯数组,默认key值为'arrayItem'
|
|
30
|
+
if (isPureArray) {
|
|
31
|
+
childFormItem = ['arrayItem'];
|
|
32
|
+
}
|
|
33
|
+
return childFormItem;
|
|
34
|
+
};
|
|
13
35
|
const logger = debug('form-detail');
|
|
14
36
|
export const reorderContext = (data, name, isPureArray) => data.map((i, index) => {
|
|
15
37
|
const item = { ...i };
|
|
@@ -66,6 +88,7 @@ export const changeHandle = ({ type, name, data, childFormItem, isPureArray, par
|
|
|
66
88
|
return data;
|
|
67
89
|
};
|
|
68
90
|
const FormDetailCom = forwardRef(function FormDetail(props, ref) {
|
|
91
|
+
var _a;
|
|
69
92
|
const { className, id, style, children, events, name, isPureArray, fieldAuth = 'rw', $widget, hasInitValue = false, isWdFormDetail, viewType = 'table', label, } = props;
|
|
70
93
|
const [innerHandle, setInnerHandle] = useState({});
|
|
71
94
|
const inputRef = useRef({});
|
|
@@ -144,6 +167,13 @@ const FormDetailCom = forwardRef(function FormDetail(props, ref) {
|
|
|
144
167
|
setHasScroll(bodyHasScroll);
|
|
145
168
|
}
|
|
146
169
|
}, []);
|
|
170
|
+
// 初始化明细组件子项初始值
|
|
171
|
+
useEffect(() => {
|
|
172
|
+
if ((parent === null || parent === void 0 ? void 0 : parent.dataSourceProfile) && name) {
|
|
173
|
+
const childFormItem = getChildFormItem(isPureArray, name, parent);
|
|
174
|
+
setChildFormItem(childFormItem);
|
|
175
|
+
}
|
|
176
|
+
}, [isPureArray, name, (_a = parent === null || parent === void 0 ? void 0 : parent.dataSourceProfile) === null || _a === void 0 ? void 0 : _a.name]);
|
|
147
177
|
// 初始化context的值
|
|
148
178
|
useEffect(() => {
|
|
149
179
|
logger.debug('initDetailValue', initDetailValue);
|
|
@@ -176,7 +206,9 @@ const FormDetailCom = forwardRef(function FormDetail(props, ref) {
|
|
|
176
206
|
});
|
|
177
207
|
}
|
|
178
208
|
});
|
|
179
|
-
parent
|
|
209
|
+
if (Object.keys(parent.initialValues || {}).length == 0) {
|
|
210
|
+
parent === null || parent === void 0 ? void 0 : parent.setValue(formDetailItemValue);
|
|
211
|
+
}
|
|
180
212
|
setIsInit(false);
|
|
181
213
|
}
|
|
182
214
|
}, [
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
if (process.env.NODE_ENV === 'development') {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
1
|
+
// import React from 'react';
|
|
2
|
+
// if (process.env.NODE_ENV === 'development') {
|
|
3
|
+
// // eslint-disable-next-line rulesdir/no-phantom-deps, @typescript-eslint/no-var-requires
|
|
4
|
+
// import('@welldone-software/why-did-you-render').then((whyDidYouRender) => {
|
|
5
|
+
// whyDidYouRender.default(React, {
|
|
6
|
+
// trackHooks: false,
|
|
7
|
+
// trackAllPureComponents: true,
|
|
8
|
+
// });
|
|
9
|
+
// });
|
|
10
|
+
// }
|
|
11
11
|
import '@tcwd/style-wedatheme/index.css';
|
|
12
12
|
import loadable from '@loadable/component';
|
|
13
13
|
import { fallback } from '../utils/loading-fallback';
|
|
@@ -70,6 +70,7 @@ export { default as Checkbox } from './form/checkbox';
|
|
|
70
70
|
export { default as Radio } from './form/radio';
|
|
71
71
|
export { default as Switch } from './form/switch';
|
|
72
72
|
export { default as Select } from './form/select';
|
|
73
|
+
export { default as SelectMultiple } from './form/selectMultiple';
|
|
73
74
|
// export const Select = loadable(() => import('./form/select'), { fallback });
|
|
74
75
|
export { default as Uploader } from './form/uploader';
|
|
75
76
|
export { default as UploaderFile } from './form/uploaderFile';
|
|
@@ -132,7 +133,6 @@ export { default as Grid } from './grid/grid';
|
|
|
132
133
|
export { default as Repeater } from './repeater';
|
|
133
134
|
export { default as RepeaterItem } from './repeater-item';
|
|
134
135
|
export { default as WebView } from './web-view';
|
|
135
|
-
export { default as WdForm } from './wd-form';
|
|
136
136
|
export { default as FormInput } from './form-input';
|
|
137
137
|
export { default as FormTextArea } from './form-text-area';
|
|
138
138
|
export { default as FormRadio } from './form-radio';
|
|
@@ -153,12 +153,14 @@ export { default as FormImageUploader } from './form-image-uploader';
|
|
|
153
153
|
export { default as FormUploadFile } from './form-upload-file';
|
|
154
154
|
export { default as FormMultiRegion } from './form-multi-region';
|
|
155
155
|
export { default as FormSelect } from './form-select';
|
|
156
|
+
export { default as FormSelectMultiple } from './form-select-multiple';
|
|
156
157
|
export { default as FormDate } from './form-date';
|
|
157
158
|
export { default as FormRegion } from './form-region';
|
|
158
159
|
export { default as FormTime } from './form-time';
|
|
159
160
|
export { default as WdFormDetail } from './formdetail';
|
|
160
161
|
export { default as QrCode } from './qrcode';
|
|
161
162
|
export { default as CustomerService } from './customer-service';
|
|
163
|
+
export { default as WdOfficialAccount } from './wd-official-account';
|
|
162
164
|
import 'weui/dist/style/weui.css';
|
|
163
165
|
import '../weda-ui.css';
|
|
164
166
|
// 组件标准化
|
|
@@ -171,3 +173,17 @@ export { default as WdText } from './wd-text';
|
|
|
171
173
|
export { default as WdImage } from './wd-image';
|
|
172
174
|
export { default as WdBubble } from './wd-bubble';
|
|
173
175
|
export { default as WdIcon } from './wd-icon';
|
|
176
|
+
export { default as WdTree } from './wd-tree';
|
|
177
|
+
export { default as WdForm } from './wd-form';
|
|
178
|
+
export { default as WdTextarea } from './wd-textarea';
|
|
179
|
+
export { default as WdInput } from './wd-input';
|
|
180
|
+
export { default as WdInputEmail } from './wd-input-email';
|
|
181
|
+
export { default as WdInputUrl } from './wd-input-url';
|
|
182
|
+
export { default as WdInputGroup } from './wd-input-group';
|
|
183
|
+
export { default as WdInputPhone } from './wd-input-phone';
|
|
184
|
+
export { default as WdInputWrap } from './wd-input-wrap';
|
|
185
|
+
export { default as WdSwitch } from './wd-switch';
|
|
186
|
+
export { default as WdRadioList } from './wd-radio-list';
|
|
187
|
+
export { default as WdRadio } from './wd-radio';
|
|
188
|
+
export { default as WdCheckboxList } from './wd-checkbox-list';
|
|
189
|
+
export { default as WdCheckbox } from './wd-checkbox';
|
|
@@ -381,13 +381,28 @@ export default React.forwardRef(function ListView(props, ref) {
|
|
|
381
381
|
alertErrorMessage({ message: LISTVIEW_MESSAGE.deleteOne_fail });
|
|
382
382
|
}
|
|
383
383
|
}, [appCloud, isModel, methodRefreshKeepPage]);
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
384
|
+
const { total, pageNo, pageSize: statePageSize } = getContextState();
|
|
385
|
+
// widget api
|
|
386
|
+
useImperativeHandle(ref, () => {
|
|
387
|
+
return {
|
|
388
|
+
// 当前页数据
|
|
389
|
+
records: dataRef.current.records,
|
|
390
|
+
// 当前总数
|
|
391
|
+
total,
|
|
392
|
+
pageNo,
|
|
393
|
+
pageSize: statePageSize,
|
|
394
|
+
// 组件方法
|
|
387
395
|
deleteOne: methodDeleteOne,
|
|
388
396
|
refresh: methodRefresh,
|
|
389
|
-
}
|
|
390
|
-
}
|
|
397
|
+
};
|
|
398
|
+
}, [
|
|
399
|
+
total,
|
|
400
|
+
pageNo,
|
|
401
|
+
statePageSize,
|
|
402
|
+
methodDeleteOne,
|
|
403
|
+
methodRefresh,
|
|
404
|
+
dataRef.current.records,
|
|
405
|
+
]);
|
|
391
406
|
/**
|
|
392
407
|
* 分页,加载更多
|
|
393
408
|
*/
|
|
@@ -6,7 +6,7 @@ const CLASS_PREFIX = 'weda-menu';
|
|
|
6
6
|
// 标题
|
|
7
7
|
export const renderTitle = (navigationStyle) => {
|
|
8
8
|
const { title, titleColor, showTitle, titleFontSize } = navigationStyle;
|
|
9
|
-
return (showTitle && (_jsx("span", { "data-testid": "navigationBar-title", style: {
|
|
9
|
+
return (showTitle && (_jsx("span", { "data-testid": "navigationBar-title", className: "weda-menu__title_text", style: {
|
|
10
10
|
display: 'inline-block',
|
|
11
11
|
color: titleColor,
|
|
12
12
|
fontSize: titleFontSize,
|
|
@@ -64,7 +64,7 @@ const HorizontalMenu = ({ menuData, navigationStyle, selected, setSelected, navi
|
|
|
64
64
|
}, children: renderMenuTitle(navigationStyle, { title }, false) }, key)) : (_jsx(List.SubMenu, { className: `${CLASS_PREFIX}__dropdown-list-item`, label: renderMenuTitle(navigationStyle, { title }, false), children: renderMenuList(children, navigationStyle) }, key));
|
|
65
65
|
}) }));
|
|
66
66
|
};
|
|
67
|
-
return (_jsx(NavMenu, { style: menuStyle, className: `${CLASS_PREFIX}__nav`, left: _jsxs(_Fragment, { children: [_jsx(NavMenu.Item, { type: "logo", className: `${CLASS_PREFIX}__nav-logo`, children: _jsx(MenuLogo, { navigationStyle: navigationStyle, className: `${CLASS_PREFIX}__nav-logo--img` }) }), _jsx(NavMenu.Item, { className: `${CLASS_PREFIX}__nav-title`, children: _jsx("span", { className: `${CLASS_PREFIX}__title`, children: renderTitle(navigationStyle) }) })] }), right: _jsxs("div", { className: `${CLASS_PREFIX}__nav-wrap`, children: [_jsxs(_Fragment, { children: [showButton && position.index > 0 && (_jsxs("div", { className: `${CLASS_PREFIX}__nav-shadow leftButton`, onClick: () => {
|
|
67
|
+
return (_jsx(NavMenu, { style: menuStyle, className: `${CLASS_PREFIX}__nav`, left: _jsxs(_Fragment, { children: [navigationStyle.showLogo && (_jsx(NavMenu.Item, { type: "logo", className: `${CLASS_PREFIX}__nav-logo`, children: _jsx(MenuLogo, { navigationStyle: navigationStyle, className: `${CLASS_PREFIX}__nav-logo--img` }) })), _jsx(NavMenu.Item, { className: `${CLASS_PREFIX}__nav-title`, children: _jsx("span", { className: `${CLASS_PREFIX}__title`, children: renderTitle(navigationStyle) }) })] }), right: _jsxs("div", { className: `${CLASS_PREFIX}__nav-wrap`, children: [_jsxs(_Fragment, { children: [showButton && position.index > 0 && (_jsxs("div", { className: `${CLASS_PREFIX}__nav-shadow leftButton`, onClick: () => {
|
|
68
68
|
const result = position.offset + menuOffset[position.index];
|
|
69
69
|
setPosition({ index: position.index - 1, offset: result });
|
|
70
70
|
}, children: [_jsx("div", { className: `${CLASS_PREFIX}__shadow--icon` }), _jsx("div", { className: `${CLASS_PREFIX}__shadow` }), _jsx("div", { className: `${CLASS_PREFIX}__shadow--white` })] })), _jsx("div", { className: `${CLASS_PREFIX}__nav-content box`, children: _jsx("div", { ref: navWrapRef, className: `${CLASS_PREFIX}__nav-content`, style: { transform: `translate(${position.offset}px, 0px)` }, children: menuData === null || menuData === void 0 ? void 0 : menuData.map((i) => {
|
|
@@ -301,6 +301,17 @@
|
|
|
301
301
|
font-size: 16px;
|
|
302
302
|
color: #000000;
|
|
303
303
|
margin-left: 12px;
|
|
304
|
+
display: flex;
|
|
305
|
+
}
|
|
306
|
+
.weda-menu-horizontal
|
|
307
|
+
.weda-menu__nav
|
|
308
|
+
.weda-menu__nav-title
|
|
309
|
+
.weda-menu__title
|
|
310
|
+
.weda-menu__title_text {
|
|
311
|
+
white-space: nowrap;
|
|
312
|
+
max-width: 300px;
|
|
313
|
+
text-overflow: ellipsis;
|
|
314
|
+
overflow: hidden;
|
|
304
315
|
}
|
|
305
316
|
|
|
306
317
|
.weda-menu-horizontal .weda-menu__nav .wedatea2td-nav__flex-end {
|
|
@@ -155,7 +155,14 @@ export default function NavigationBar({ navigationbar, contentSlot, navigationSl
|
|
|
155
155
|
const MenuRender = () => {
|
|
156
156
|
return (_jsxs("div", { className: `${CLASS_PREFIX}__wrapper`, style: {
|
|
157
157
|
background: (navigationStyle === null || navigationStyle === void 0 ? void 0 : navigationStyle.menuBackgroundColor) || '#fff',
|
|
158
|
-
}, children: [platform !== 'h5' && !isHorizontal && (_jsx(VerticalMenu, { menuData: menuData, navigationStyle: navigationStyle, setMenuData: setMenuData, selected: selected, setSelected: setSelected, navigationSlot: navigationSlot })), platform !== 'h5' && isHorizontal && (_jsx(HorizontalMenu, { menuData: menuData, navigationStyle: navigationStyle, selected: selected, setSelected: setSelected, navigationSlot: navigationSlot })), platform === 'h5' && (_jsx(H5Menu, { menuData: isMultiTerminal ? mobileMenuData : menuData, navigationStyle: navigationStyle, setMenuData:
|
|
158
|
+
}, children: [platform !== 'h5' && !isHorizontal && (_jsx(VerticalMenu, { menuData: menuData, navigationStyle: navigationStyle, setMenuData: setMenuData, selected: selected, setSelected: setSelected, navigationSlot: navigationSlot })), platform !== 'h5' && isHorizontal && (_jsx(HorizontalMenu, { menuData: menuData, navigationStyle: navigationStyle, selected: selected, setSelected: setSelected, navigationSlot: navigationSlot })), platform === 'h5' && (_jsx(H5Menu, { menuData: isMultiTerminal ? mobileMenuData : menuData, navigationStyle: navigationStyle, setMenuData: (menus) => {
|
|
159
|
+
if (isMultiTerminal) {
|
|
160
|
+
setMobileMenuData(menus);
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
setMenuData(menus);
|
|
164
|
+
}
|
|
165
|
+
}, className: className, selected: selected, setSelected: setSelected, navigationSlot: navigationSlot, visible: visible, setVisible: setVisible }))] }));
|
|
159
166
|
};
|
|
160
167
|
return (_jsx(ConfigProvider, { classPrefix: "wedatea2td", children: _jsxs("div", { className: cls, style: navigationWrapStyle, "data-testid": "navigationBar", children: [showNav && _jsx(MenuRender, {}), _jsx("div", { className: "menu-solt", children: contentSlot })] }) }));
|
|
161
168
|
}
|