@cloudbase/weda-ui 3.10.1 → 3.10.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-layout.js +0 -1
- package/dist/configs/components/wd-menu-layout.js +1 -1
- package/dist/configs/components/wd-menu-list.js +1 -1
- package/dist/configs/components/wd-tabbar.js +1 -1
- package/dist/configs/components/wd-table.d.ts +12 -0
- package/dist/configs/components/wd-table.js +33 -0
- package/dist/configs/index.d.ts +24 -0
- package/dist/style/index.css +13 -0
- package/dist/style/index.scss +1 -1
- package/dist/style/weda-ui.min.css +2 -2
- package/dist/web/components/form/uploader/uploader.h5.js +1 -1
- package/dist/web/components/form/uploader/uploader.pc.js +1 -1
- package/dist/web/components/form/uploader/util.d.ts +1 -0
- package/dist/web/components/form/uploader/util.js +2 -1
- package/dist/web/components/form/uploaderFile/uploadFile.h5.js +4 -3
- package/dist/web/components/form/uploaderFile/uploadFile.pc.js +3 -1
- package/dist/web/components/formdetail/index.css +0 -6
- package/dist/web/components/wd-menu-list/CommonMenuList.js +1 -1
- package/dist/web/components/wd-menu-list/HorizontalMenuList.js +1 -1
- package/dist/web/components/wd-table/components/FieldRender/index.js +4 -4
- package/dist/web/components/wd-table/components/ModalTable/index.js +1 -1
- package/dist/web/components/wd-table/components/Table/index.d.ts +4 -2
- package/dist/web/components/wd-table/components/Table/index.js +12 -3
- package/dist/web/components/wd-table/wd-table.js +8 -3
- package/dist/web/components/wd-textarea/wd-textarea.js +5 -2
- package/package.json +1 -1
|
@@ -105,7 +105,7 @@ export function ImageUploaderH5(props) {
|
|
|
105
105
|
const allFile = await upload(files);
|
|
106
106
|
handleChange(allFile);
|
|
107
107
|
};
|
|
108
|
-
return (_jsx("div", { className: cls, id: id, style: style, children: _jsxs("div", { className: classNames('weui-uploader weui-cells weui-cells_form weda-formcells', layout, layoutCls), children: [_jsx("div", { className: classNames('weui-uploader__hd', layout), children: _jsx(UploaderLabel, { layout: layout, label: label, labelVisible: labelVisible, currentCount: tempFile.length, maxCount: finalMaxImgCount, requiredFlag: requiredFlag }) }), _jsxs("div", { className: "weui-uploader__bd", children: [_jsxs("ul", { className: "weui-uploader__files", id: "uploaderFiles", children: [(_a = (tempFile !== null && tempFile !== void 0 ? tempFile : [])) === null || _a === void 0 ? void 0 : _a.map((f) => (_jsx(SingleImage, { tempFile: f, deleteBySrc: deleteFile, disabled: disabled || readOnly || sourceType === 'album', imgTypeCls: imgTypeCls }, f === null || f === void 0 ? void 0 : f.key))), tempFile.length < 1 && readOnly && _jsx(_Fragment, { children: "
|
|
108
|
+
return (_jsx("div", { className: cls, id: id, style: style, children: _jsxs("div", { className: classNames('weui-uploader weui-cells weui-cells_form weda-formcells', layout, layoutCls), children: [_jsx("div", { className: classNames('weui-uploader__hd', layout), children: _jsx(UploaderLabel, { layout: layout, label: label, labelVisible: labelVisible, currentCount: tempFile.length, maxCount: finalMaxImgCount, requiredFlag: requiredFlag }) }), _jsxs("div", { className: "weui-uploader__bd", children: [_jsxs("ul", { className: "weui-uploader__files", id: "uploaderFiles", children: [(_a = (tempFile !== null && tempFile !== void 0 ? tempFile : [])) === null || _a === void 0 ? void 0 : _a.map((f) => (_jsx(SingleImage, { tempFile: f, deleteBySrc: deleteFile, disabled: disabled || readOnly || sourceType === 'album', imgTypeCls: imgTypeCls }, f === null || f === void 0 ? void 0 : f.key))), tempFile.length < 1 && readOnly && _jsx(_Fragment, { children: "-" })] }), showAdd && !readOnly && (_jsx("div", { className: `weui-uploader__input-box ${imgTypeCls}`, children: !disabled &&
|
|
109
109
|
sourceType !== 'album' &&
|
|
110
110
|
(sourceType === 'camera' ? (_jsx("input", { ref: inputRef, onClick: () => {
|
|
111
111
|
inputRef.current && (inputRef.current.value = '');
|
|
@@ -119,7 +119,7 @@ export function UploaderPCInner(props) {
|
|
|
119
119
|
tips && (extraProps['title'] = tips);
|
|
120
120
|
maxSize && (extraProps['maxSize'] = maxSize * 1024 * 1024);
|
|
121
121
|
const hasActions = !uploading && !readOnly && !(disabled || sourceType === 'camera');
|
|
122
|
-
return (_jsx(ConfigProvider, { classPrefix: "wedatea2td", children: _jsxs("div", { className: "_weda-fn-upload-result", children: [tempFile === null || tempFile === void 0 ? void 0 : tempFile.map((d) => (_jsx("div", { className: `_weda-fn-upload-result__item ${imgTypeCls}`, children: _jsx(TcbImage, { tempFile: d, imgTypeCls: imgTypeCls, isZoom: true, preivewIcon: "td:browse", actions: hasActions && (_jsx(WdIcon, { className: `${CLASS_PREFIX}__image-actions-delete`, name: "td:delete", onClick: () => deleteHandle(d), size: "sm" })) }) }, d.key))), _jsxs("div", { className: `${CLASS_PREFIX}__input-box`, children: [readOnly && tempFile.length < 1 && _jsx("div", { children: "
|
|
122
|
+
return (_jsx(ConfigProvider, { classPrefix: "wedatea2td", children: _jsxs("div", { className: "_weda-fn-upload-result", children: [tempFile === null || tempFile === void 0 ? void 0 : tempFile.map((d) => (_jsx("div", { className: `_weda-fn-upload-result__item ${imgTypeCls}`, children: _jsx(TcbImage, { tempFile: d, imgTypeCls: imgTypeCls, isZoom: true, preivewIcon: "td:browse", actions: hasActions && (_jsx(WdIcon, { className: `${CLASS_PREFIX}__image-actions-delete`, name: "td:delete", onClick: () => deleteHandle(d), size: "sm" })) }) }, d.key))), _jsxs("div", { className: `${CLASS_PREFIX}__input-box`, children: [readOnly && tempFile.length < 1 && _jsx("div", { children: "-" }), sourceType === 'camera' || (disabled && !readOnly) ? (_jsx("li", { className: `_weda-fn-upload-result__item wedatea2td-disabled ${imgTypeCls}`, children: _jsxs("div", { className: "_weda-fn-upload-result__status", children: [_jsx("i", { className: "wedatea2td-icon wedatea2td-icon-plus", role: "img", "aria-label": "plus" }), _jsx("span", { className: "wedatea2td-mt-1n wedatea2td-text-label wedatea2td-fz-reset", children: btnTitle })] }) })) : (((!single && tempFile.length < maxUploadCount) ||
|
|
123
123
|
(single && tempFile.length < 1 && !uploading)) &&
|
|
124
124
|
!readOnly && (
|
|
125
125
|
// single 模式时,当数组为空且不在上传文件过程中时显示
|
|
@@ -34,13 +34,14 @@ export const uploadTcbMulti = async (files, props) => {
|
|
|
34
34
|
const result = await Promise.all(promiseAll);
|
|
35
35
|
return result;
|
|
36
36
|
};
|
|
37
|
+
export const filenameRegex = /[^a-zA-Z0-9\u4e00-\u9fff-*!_.]/g;
|
|
37
38
|
const uploadToTcb = async (item, props) => {
|
|
38
39
|
var _a, _b;
|
|
39
40
|
const { onUploadProgress, onUploadFinish, onUploadError } = props;
|
|
40
41
|
const { file, uploadPath } = item;
|
|
41
42
|
try {
|
|
42
43
|
const tcb = await getCloudInstance();
|
|
43
|
-
const cloudPath = `${uploadPath}/${randomStr()}-${(_a = file === null || file === void 0 ? void 0 : file.name) === null || _a === void 0 ? void 0 : _a.replace(
|
|
44
|
+
const cloudPath = `${uploadPath}/${randomStr()}-${(_a = file === null || file === void 0 ? void 0 : file.name) === null || _a === void 0 ? void 0 : _a.replace(filenameRegex, '-')}`;
|
|
44
45
|
const { fileID } = await tcb.uploadFile({
|
|
45
46
|
cloudPath,
|
|
46
47
|
filePath: file,
|
|
@@ -13,6 +13,7 @@ import { WdButton } from '../../wd-button/wd-button';
|
|
|
13
13
|
import { toBase64Uri } from '../../../utils/file2base64';
|
|
14
14
|
import { isNil } from '../../../utils/lodash';
|
|
15
15
|
import { errorHandler } from '../../../utils/error';
|
|
16
|
+
import { filenameRegex } from '../uploader/util';
|
|
16
17
|
// 默认组件类前缀
|
|
17
18
|
const CLASS_PREFIX = 'weda-upload-file-mobile';
|
|
18
19
|
// 默认图片类型
|
|
@@ -256,12 +257,12 @@ const TcbFileUpload = ({ id, file, disabled, formType }) => {
|
|
|
256
257
|
}, [file === null || file === void 0 ? void 0 : file._uuid]);
|
|
257
258
|
// 上传过程
|
|
258
259
|
const handleUpload = async (file) => {
|
|
259
|
-
var _a;
|
|
260
|
+
var _a, _b;
|
|
260
261
|
const tcb = await getCloudInstance();
|
|
261
262
|
try {
|
|
262
263
|
setStatus('UPLOAD_STATUS_PENDING');
|
|
263
264
|
const { fileID } = await tcb.uploadFile({
|
|
264
|
-
cloudPath: `${uploadPath}/${randomStr()}-${file === null || file === void 0 ? void 0 : file.name}`,
|
|
265
|
+
cloudPath: `${uploadPath}/${randomStr()}-${(_a = file === null || file === void 0 ? void 0 : file.name) === null || _a === void 0 ? void 0 : _a.replace(filenameRegex, '-')}`,
|
|
265
266
|
filePath: file,
|
|
266
267
|
onUploadProgress: (progressEvent) => {
|
|
267
268
|
let percent = 0;
|
|
@@ -281,7 +282,7 @@ const TcbFileUpload = ({ id, file, disabled, formType }) => {
|
|
|
281
282
|
id,
|
|
282
283
|
});
|
|
283
284
|
setStatus('UPLOAD_STATUS_ERROR');
|
|
284
|
-
(
|
|
285
|
+
(_b = events === null || events === void 0 ? void 0 : events.error) === null || _b === void 0 ? void 0 : _b.call(events, err);
|
|
285
286
|
}
|
|
286
287
|
};
|
|
287
288
|
return (_jsxs("div", { className: `${CLASS_PREFIX}__item`, role: "TcbFileUpload", children: [_jsx("div", { className: `${CLASS_PREFIX}__item-left`, children: _jsx(UploadFileStatus, { status: status, percent: percent, size: size, title: title, percentSize: (((file === null || file === void 0 ? void 0 : file.size) / 1024) * percent) / 100, formType: formType }) }), _jsx("div", { className: `${CLASS_PREFIX}__btn-group`, children: _jsx(UploadFileAction, { file: file, uuid: file === null || file === void 0 ? void 0 : file._uuid, status: status, onCancel: (uuid) => {
|
|
@@ -14,6 +14,7 @@ import { getParentForm } from '../../../utils/widget-api';
|
|
|
14
14
|
import { toBase64Uri } from '../../../utils/file2base64';
|
|
15
15
|
import { isNil } from '../../../utils/lodash';
|
|
16
16
|
import { errorHandler } from '../../../utils/error';
|
|
17
|
+
import { filenameRegex } from '../uploader/util';
|
|
17
18
|
// 默认组件类前缀
|
|
18
19
|
const CLASS_PREFIX = 'weda-upload-file-pc';
|
|
19
20
|
// 上传状态字典
|
|
@@ -257,11 +258,12 @@ const TcbFileUpload = ({ id, file, disabled, formType }) => {
|
|
|
257
258
|
}, [file === null || file === void 0 ? void 0 : file._uuid]);
|
|
258
259
|
// 上传过程
|
|
259
260
|
const handleUpload = async (file) => {
|
|
261
|
+
var _a;
|
|
260
262
|
const tcb = await getCloudInstance();
|
|
261
263
|
try {
|
|
262
264
|
setStatus('0');
|
|
263
265
|
const { fileID } = await tcb.uploadFile({
|
|
264
|
-
cloudPath: `${uploadPath}/${randomStr()}-${file === null || file === void 0 ? void 0 : file.name}`,
|
|
266
|
+
cloudPath: `${uploadPath}/${randomStr()}-${(_a = file === null || file === void 0 ? void 0 : file.name) === null || _a === void 0 ? void 0 : _a.replace(filenameRegex, '-')}`,
|
|
265
267
|
filePath: file,
|
|
266
268
|
onUploadProgress: (progressEvent) => {
|
|
267
269
|
let percent = 0;
|
|
@@ -466,12 +466,6 @@
|
|
|
466
466
|
display: none;
|
|
467
467
|
}
|
|
468
468
|
|
|
469
|
-
.form-detail-wrap.form-detail-table
|
|
470
|
-
.form-detail-group-parent-container
|
|
471
|
-
[data-role='wd-col']-lg.formrichtext
|
|
472
|
-
.bf-content {
|
|
473
|
-
height: 161px;
|
|
474
|
-
}
|
|
475
469
|
.form-detail-wrap .wd-grid-row > div,
|
|
476
470
|
.form-detail-wrap .wd-grid .wd-grid-row > div {
|
|
477
471
|
margin: 0;
|
|
@@ -24,7 +24,7 @@ export const CommonMenuList = forwardRef(function CommonMenuList(props, ref) {
|
|
|
24
24
|
const menuData = useMemo(() => {
|
|
25
25
|
return getMenuList(props.menu);
|
|
26
26
|
}, [props.menu]);
|
|
27
|
-
const setSelectedInfo = useCallback((params = {}, isNavigate = false) => {
|
|
27
|
+
const setSelectedInfo = useCallback(({ params = {}, isNavigate = false, } = {}) => {
|
|
28
28
|
const { key, item } = params || {};
|
|
29
29
|
let selectItem = item;
|
|
30
30
|
if (key || !item) {
|
|
@@ -26,7 +26,7 @@ export const HorizontalMenuList = forwardRef(function HorizontalMenuList(props,
|
|
|
26
26
|
const menuData = useMemo(() => {
|
|
27
27
|
return getMenuList(props.menu);
|
|
28
28
|
}, [props.menu]);
|
|
29
|
-
const setSelectedInfo = useCallback((params = {}, isNavigate = false) => {
|
|
29
|
+
const setSelectedInfo = useCallback(({ params = {}, isNavigate = false, } = {}) => {
|
|
30
30
|
const { key, item } = params || {};
|
|
31
31
|
let selectItem = item;
|
|
32
32
|
if (key || !item) {
|
|
@@ -136,12 +136,12 @@ export function getFieldRender(field = {}, extra = {}) {
|
|
|
136
136
|
const primaryField = ((_b = (_a = field === null || field === void 0 ? void 0 : field.parentDatasource) === null || _a === void 0 ? void 0 : _a.schema) === null || _b === void 0 ? void 0 : _b['x-primary-column']) || '';
|
|
137
137
|
const relatedField = (_c = extra === null || extra === void 0 ? void 0 : extra.columnSet) === null || _c === void 0 ? void 0 : _c.relatedField;
|
|
138
138
|
if (typeof fieldValue === 'string') {
|
|
139
|
-
return (_jsx(WdTag, { range: fieldValue === null || fieldValue === void 0 ? void 0 : fieldValue.split(',').map((i) => ({
|
|
139
|
+
return fieldValue && fieldValue !== '-' ? (_jsx(WdTag, { range: fieldValue === null || fieldValue === void 0 ? void 0 : fieldValue.split(',').map((i) => ({
|
|
140
140
|
label: i,
|
|
141
141
|
value: i,
|
|
142
142
|
prefixType: 'inner',
|
|
143
143
|
prefixIcon: 'td:link-1',
|
|
144
|
-
})), tagStyleType: 'light', tagStyleWidthCols: 4 }));
|
|
144
|
+
})), tagStyleType: 'light', tagStyleWidthCols: 4 })) : ('-');
|
|
145
145
|
}
|
|
146
146
|
const val = fieldValue[relatedField] || fieldValue[primaryField];
|
|
147
147
|
return val ? (_jsx(WdTag, { range: val === null || val === void 0 ? void 0 : val.split(',').map((i) => ({
|
|
@@ -194,12 +194,12 @@ export function getFieldRender(field = {}, extra = {}) {
|
|
|
194
194
|
const primaryField = ((_e = (_d = field === null || field === void 0 ? void 0 : field.parentDatasource) === null || _d === void 0 ? void 0 : _d.schema) === null || _e === void 0 ? void 0 : _e['x-primary-column']) || '';
|
|
195
195
|
const relatedField = (_f = extra === null || extra === void 0 ? void 0 : extra.columnSet) === null || _f === void 0 ? void 0 : _f.relatedField;
|
|
196
196
|
const _readValue = fieldValue[relatedField] || fieldValue[primaryField];
|
|
197
|
-
return (_jsx(WdTag, { range: _readValue === null || _readValue === void 0 ? void 0 : _readValue.split(',').map((i) => ({
|
|
197
|
+
return _readValue ? (_jsx(WdTag, { range: _readValue === null || _readValue === void 0 ? void 0 : _readValue.split(',').map((i) => ({
|
|
198
198
|
label: i,
|
|
199
199
|
value: i,
|
|
200
200
|
prefixType: 'inner',
|
|
201
201
|
prefixIcon: 'td:link-1',
|
|
202
|
-
})), tagStyleType: 'light', tagStyleWidthCols: 4 }));
|
|
202
|
+
})), tagStyleType: 'light', tagStyleWidthCols: 4 })) : ('-');
|
|
203
203
|
}
|
|
204
204
|
else {
|
|
205
205
|
return (_jsx(QuoteModal, { className: "e-object-view-modal", caption: title, size: MODAL_SIZE, text: detailText, children: objectRender({
|
|
@@ -220,7 +220,7 @@ enablePagination = true, columnSelectType = 'select', defaultPageIndex = _defaul
|
|
|
220
220
|
const renderTable = () => {
|
|
221
221
|
return (_jsx(Table, { events: events, emptyText: emptyText, isH5: isH5, isNoDataSourceBind: isNoDataSourceBind, className: `${tableClassList} modal-table`, recordKey: recordKey, currentSize: tableHightSize, defaultPageIndex: defaultPageIndex, defaultPageSize: defaultPageSize, sortColumns: sortColumns, enablePagination: !isH5 && enablePagination, columnSelectType: columnSelectType, columns: columns, records: tableRecords, sort: queryParams.sort, selectedKeys: [], onSelectChange: () => { }, isError: false, isLoading: isTableLoading, rowColor: rowColor, queryParams: queryParams, total: total, setColumns: undefined, onQueryChange: (query) => {
|
|
222
222
|
setQueryParams({ ...queryParams, ...query });
|
|
223
|
-
}, rowClick: () => { }, errorObj: errorObj }));
|
|
223
|
+
}, rowClick: () => { }, cellClick: () => { }, errorObj: errorObj }));
|
|
224
224
|
};
|
|
225
225
|
return (_jsx(ConfigProvider, { classPrefix: classPrefix, children: _jsx(EnumHoc, { fields: authFields, children: _jsx("div", { className: classNames(wrapClassList, className), style: style, id: id, children: renderTable() }) }) }));
|
|
226
226
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const BaseTableCom: ({ events, recordKey, className, columns, setColumns, records, sortColumns, sort, onSelectChange, selectedKeys, rowColor, isError, errorObj, isLoading, queryParams, total, onQueryChange, enablePagination, columnSelectType, defaultPageSize, defaultPageIndex, rowClick, currentSize, isNoDataSourceBind, isH5, emptyText: _emptyText, __innerSlot, }: {
|
|
2
|
+
export declare const BaseTableCom: ({ events, recordKey, className, columns, setColumns, records, sortColumns, sort, onSelectChange, selectedKeys, rowColor, isError, errorObj, isLoading, queryParams, total, onQueryChange, enablePagination, columnSelectType, defaultPageSize, defaultPageIndex, rowClick, cellClick, currentSize, isNoDataSourceBind, isH5, emptyText: _emptyText, __innerSlot, }: {
|
|
3
3
|
events: any;
|
|
4
4
|
recordKey: any;
|
|
5
5
|
className: any;
|
|
@@ -22,13 +22,14 @@ export declare const BaseTableCom: ({ events, recordKey, className, columns, set
|
|
|
22
22
|
defaultPageSize: any;
|
|
23
23
|
defaultPageIndex: any;
|
|
24
24
|
rowClick: any;
|
|
25
|
+
cellClick: any;
|
|
25
26
|
currentSize: any;
|
|
26
27
|
isNoDataSourceBind: any;
|
|
27
28
|
isH5: any;
|
|
28
29
|
emptyText: any;
|
|
29
30
|
__innerSlot?: React.ReactNode;
|
|
30
31
|
}) => JSX.Element;
|
|
31
|
-
export declare const BaseTable: React.MemoExoticComponent<({ events, recordKey, className, columns, setColumns, records, sortColumns, sort, onSelectChange, selectedKeys, rowColor, isError, errorObj, isLoading, queryParams, total, onQueryChange, enablePagination, columnSelectType, defaultPageSize, defaultPageIndex, rowClick, currentSize, isNoDataSourceBind, isH5, emptyText: _emptyText, __innerSlot, }: {
|
|
32
|
+
export declare const BaseTable: React.MemoExoticComponent<({ events, recordKey, className, columns, setColumns, records, sortColumns, sort, onSelectChange, selectedKeys, rowColor, isError, errorObj, isLoading, queryParams, total, onQueryChange, enablePagination, columnSelectType, defaultPageSize, defaultPageIndex, rowClick, cellClick, currentSize, isNoDataSourceBind, isH5, emptyText: _emptyText, __innerSlot, }: {
|
|
32
33
|
events: any;
|
|
33
34
|
recordKey: any;
|
|
34
35
|
className: any;
|
|
@@ -51,6 +52,7 @@ export declare const BaseTable: React.MemoExoticComponent<({ events, recordKey,
|
|
|
51
52
|
defaultPageSize: any;
|
|
52
53
|
defaultPageIndex: any;
|
|
53
54
|
rowClick: any;
|
|
55
|
+
cellClick: any;
|
|
54
56
|
currentSize: any;
|
|
55
57
|
isNoDataSourceBind: any;
|
|
56
58
|
isH5: any;
|
|
@@ -33,7 +33,7 @@ const renderStatus = ({ isH5, status, isNoDataSourceBind, _emptyText, errorObj,
|
|
|
33
33
|
// eslint-disable-next-line complexity
|
|
34
34
|
export const BaseTableCom = ({ events, recordKey, className, columns, setColumns, records, sortColumns, sort, onSelectChange, selectedKeys, rowColor, isError, errorObj, isLoading, queryParams, total = defaultTotal,
|
|
35
35
|
// refreshTable,
|
|
36
|
-
onQueryChange, enablePagination, columnSelectType, defaultPageSize, defaultPageIndex, rowClick, currentSize, isNoDataSourceBind, isH5, emptyText: _emptyText, __innerSlot = (_jsx(_Fragment, {})), }) => {
|
|
36
|
+
onQueryChange, enablePagination, columnSelectType, defaultPageSize, defaultPageIndex, rowClick, cellClick, currentSize, isNoDataSourceBind, isH5, emptyText: _emptyText, __innerSlot = (_jsx(_Fragment, {})), }) => {
|
|
37
37
|
var _a;
|
|
38
38
|
const inEditor = isInIde();
|
|
39
39
|
const tableRef = useRef(null);
|
|
@@ -87,8 +87,17 @@ onQueryChange, enablePagination, columnSelectType, defaultPageSize, defaultPageI
|
|
|
87
87
|
: undefined,
|
|
88
88
|
},
|
|
89
89
|
className: rowColor ? 'modal-table-rowcolor' : '',
|
|
90
|
-
onClick: () => {
|
|
91
|
-
rowClick
|
|
90
|
+
onClick: (e) => {
|
|
91
|
+
if (rowClick) {
|
|
92
|
+
rowClick(e, context);
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
}),
|
|
96
|
+
cell: (props, context) => ({
|
|
97
|
+
onClick: (e) => {
|
|
98
|
+
if (cellClick) {
|
|
99
|
+
cellClick(e, context);
|
|
100
|
+
}
|
|
92
101
|
},
|
|
93
102
|
}),
|
|
94
103
|
}),
|
|
@@ -674,13 +674,13 @@ export const WdTable = forwardRef(function TableComp(tableProps, ref) {
|
|
|
674
674
|
}, [isH5]);
|
|
675
675
|
const hasFilterButton = !!filterFieldsData.length && !isExpression;
|
|
676
676
|
// 行点击事件
|
|
677
|
-
const rowClick = (context) => {
|
|
677
|
+
const rowClick = (e, context) => {
|
|
678
678
|
if (events === null || events === void 0 ? void 0 : events.tabTableRow) {
|
|
679
679
|
events.tabTableRow({
|
|
680
680
|
record: context.record,
|
|
681
681
|
rowKey: context.rowKey,
|
|
682
682
|
recordIndex: context.recordIndex,
|
|
683
|
-
});
|
|
683
|
+
}, { originEvent: e });
|
|
684
684
|
}
|
|
685
685
|
setRowData({
|
|
686
686
|
record: context.record,
|
|
@@ -688,6 +688,11 @@ export const WdTable = forwardRef(function TableComp(tableProps, ref) {
|
|
|
688
688
|
recordIndex: context.recordIndex,
|
|
689
689
|
});
|
|
690
690
|
};
|
|
691
|
+
const cellClick = (e, context) => {
|
|
692
|
+
if (events === null || events === void 0 ? void 0 : events.cellClick) {
|
|
693
|
+
events.cellClick(context, { originEvent: e });
|
|
694
|
+
}
|
|
695
|
+
};
|
|
691
696
|
// 选择事件
|
|
692
697
|
const onSelectChange = (keys, context, empty = false) => {
|
|
693
698
|
if (empty) {
|
|
@@ -750,7 +755,7 @@ export const WdTable = forwardRef(function TableComp(tableProps, ref) {
|
|
|
750
755
|
enableTableHeightSizeBtn ||
|
|
751
756
|
hasFilterButton) && (_jsx(ToolBar, { hasFilterButton: hasFilterButton, total: total, refreshTable: onRefreshBtnClick, setTableHightSize: setTableHightSize, currentSize: tableHightSize, setOpenMobileFilter: () => {
|
|
752
757
|
setOpenMobileFilter(true);
|
|
753
|
-
}, enableRefreshBtn: enableRefreshBtn, enableTableHeightSizeBtn: enableTableHeightSizeBtn, enablePagination: enablePagination })), _jsx(Table, { events: events, emptyText: emptyText, isH5: isH5, isNoDataSourceBind: isNoDataSourceBind, className: tableClassList, recordKey: recordKey, currentSize: tableHightSize, defaultPageIndex: defaultPageIndex, defaultPageSize: defaultPageSize, sortColumns: sortColumns, enablePagination: !isH5 && enablePagination, columnSelectType: columnSelectType, columns: columns, setColumns: setColumns, records: tableRecords, sort: queryParams.sort, selectedKeys: selectedKeys, onSelectChange: onSelectChange, isLoading: isTableLoading, rowColor: rowColor, queryParams: queryParams, total: total, onQueryChange: onQueryChange, rowClick: rowClick, isError: errorStatus, errorObj: errorMsg, __innerSlot: __innerSlot }), isH5 && enableGlobalButton && !isNoDataSourceBind && (_jsx("div", { className: `${classPrefix}-h5-table-wrap-footer`, children: _jsx(GlobalButton, { classPrefix: classPrefix, slots: slots === null || slots === void 0 ? void 0 : slots.globalButton }) }))] }), _jsx(ImportFileModal, { columnSets: columnSets, dbName: dbName, datasourceTitle: datasourceTitle, fields: fields, setIsImportFileModalByApiVisible: setIsImportFileModalByApiVisible, isImportFileModalByApiVisible: isImportFileModalByApiVisible, setIsInOrOutRecordModalVisible: setIsInOrOutRecordModalVisible, refresh: refreshTable, supportManyRelated: supportManyRelated }), _jsx(ExportFileModal, { whereList: wList, fields: fields, columns: mapColumKey(columns), isExportFileModalByApiVisible: isExportFileModalByApiVisible, selectedKeys: selectedKeys, dbName: dbName, query: query, setIsExportFileModalByApiVisible: setIsExportFileModalByApiVisible, setIsInOrOutRecordModalVisible: setIsInOrOutRecordModalVisible, supportManyRelated: supportManyRelated }), _jsx(InOrOutRecordModal, { dbName: dbName, isInOrOutRecordModalVisible: isInOrOutRecordModalVisible, setIsImportFileModalByApiVisible: setIsImportFileModalByApiVisible, setIsExportFileModalByApiVisible: setIsExportFileModalByApiVisible, setIsInOrOutRecordModalVisible: setIsInOrOutRecordModalVisible }), isH5 && (_jsx(Modal, { overlayClassName: `${classPrefix}-h5-table-overlay`, className: `${classPrefix}-h5-table-option-modal-wrap`, disableCloseIcon: true, title: "\u64CD\u4F5C", visible: isMobileOptionVisible, outerRef: modalRef, events: {
|
|
758
|
+
}, enableRefreshBtn: enableRefreshBtn, enableTableHeightSizeBtn: enableTableHeightSizeBtn, enablePagination: enablePagination })), _jsx(Table, { events: events, emptyText: emptyText, isH5: isH5, isNoDataSourceBind: isNoDataSourceBind, className: tableClassList, recordKey: recordKey, currentSize: tableHightSize, defaultPageIndex: defaultPageIndex, defaultPageSize: defaultPageSize, sortColumns: sortColumns, enablePagination: !isH5 && enablePagination, columnSelectType: columnSelectType, columns: columns, setColumns: setColumns, records: tableRecords, sort: queryParams.sort, selectedKeys: selectedKeys, onSelectChange: onSelectChange, isLoading: isTableLoading, rowColor: rowColor, queryParams: queryParams, total: total, onQueryChange: onQueryChange, rowClick: rowClick, cellClick: cellClick, isError: errorStatus, errorObj: errorMsg, __innerSlot: __innerSlot }), isH5 && enableGlobalButton && !isNoDataSourceBind && (_jsx("div", { className: `${classPrefix}-h5-table-wrap-footer`, children: _jsx(GlobalButton, { classPrefix: classPrefix, slots: slots === null || slots === void 0 ? void 0 : slots.globalButton }) }))] }), _jsx(ImportFileModal, { columnSets: columnSets, dbName: dbName, datasourceTitle: datasourceTitle, fields: fields, setIsImportFileModalByApiVisible: setIsImportFileModalByApiVisible, isImportFileModalByApiVisible: isImportFileModalByApiVisible, setIsInOrOutRecordModalVisible: setIsInOrOutRecordModalVisible, refresh: refreshTable, supportManyRelated: supportManyRelated }), _jsx(ExportFileModal, { whereList: wList, fields: fields, columns: mapColumKey(columns), isExportFileModalByApiVisible: isExportFileModalByApiVisible, selectedKeys: selectedKeys, dbName: dbName, query: query, setIsExportFileModalByApiVisible: setIsExportFileModalByApiVisible, setIsInOrOutRecordModalVisible: setIsInOrOutRecordModalVisible, supportManyRelated: supportManyRelated }), _jsx(InOrOutRecordModal, { dbName: dbName, isInOrOutRecordModalVisible: isInOrOutRecordModalVisible, setIsImportFileModalByApiVisible: setIsImportFileModalByApiVisible, setIsExportFileModalByApiVisible: setIsExportFileModalByApiVisible, setIsInOrOutRecordModalVisible: setIsInOrOutRecordModalVisible }), isH5 && (_jsx(Modal, { overlayClassName: `${classPrefix}-h5-table-overlay`, className: `${classPrefix}-h5-table-option-modal-wrap`, disableCloseIcon: true, title: "\u64CD\u4F5C", visible: isMobileOptionVisible, outerRef: modalRef, events: {
|
|
754
759
|
close: () => {
|
|
755
760
|
setIsMobileOptionVisible(false);
|
|
756
761
|
},
|
|
@@ -26,7 +26,7 @@ export const WdTextarea = forwardRef(function WdTextarea(props, ref) {
|
|
|
26
26
|
const size = useSize(props);
|
|
27
27
|
const textareaRef = useRef(null);
|
|
28
28
|
const counter = typeof value === 'string' ? value.length : 0;
|
|
29
|
-
const
|
|
29
|
+
const [isFocus, setIsFocus] = useState(focus);
|
|
30
30
|
const root = `${classPrefix}-${classRoot}`;
|
|
31
31
|
const inputWrap = `${classPrefix}-form-input-wrap`;
|
|
32
32
|
const textareaWrap = `${classPrefix}-form-textarea-wrap`;
|
|
@@ -34,6 +34,7 @@ export const WdTextarea = forwardRef(function WdTextarea(props, ref) {
|
|
|
34
34
|
'size-width-hundred': true,
|
|
35
35
|
'is-disabled': disabled,
|
|
36
36
|
'textarea-restriction': counterVisible,
|
|
37
|
+
'is-focused': isFocus,
|
|
37
38
|
});
|
|
38
39
|
const countCls = `${textareaWrap}__label ${root}-${classRoot}__count-text`;
|
|
39
40
|
const displayValue = (_a = (zhRef.current ? zhValue : value)) !== null && _a !== void 0 ? _a : '';
|
|
@@ -71,10 +72,12 @@ export const WdTextarea = forwardRef(function WdTextarea(props, ref) {
|
|
|
71
72
|
};
|
|
72
73
|
const onFocus = function (e) {
|
|
73
74
|
var _a;
|
|
75
|
+
setIsFocus(true);
|
|
74
76
|
(_a = events.focus) === null || _a === void 0 ? void 0 : _a.call(events, { value: e.target.value }, { originEvent: e });
|
|
75
77
|
};
|
|
76
78
|
const onBlur = function (e) {
|
|
77
79
|
var _a;
|
|
80
|
+
setIsFocus(false);
|
|
78
81
|
(_a = events.blur) === null || _a === void 0 ? void 0 : _a.call(events, { value: e.target.value }, { originEvent: e });
|
|
79
82
|
};
|
|
80
83
|
const handleZhStart = () => {
|
|
@@ -105,5 +108,5 @@ export const WdTextarea = forwardRef(function WdTextarea(props, ref) {
|
|
|
105
108
|
disabled,
|
|
106
109
|
readOnly,
|
|
107
110
|
}), [innerHandle, name, value, label, required, visible, disabled, readOnly]);
|
|
108
|
-
return (visible && (_jsx(WdFormItem, { ...props, validateErrorMsg: validateErrorMsg, validateState: validateState, readOnly: readOnly, disabled: disabled, readValue: value, classRoot: classRoot, inputId: inputId, layout: props.layout, children: _jsxs("div", { className: cls,
|
|
111
|
+
return (visible && (_jsx(WdFormItem, { ...props, validateErrorMsg: validateErrorMsg, validateState: validateState, readOnly: readOnly, disabled: disabled, readValue: value, classRoot: classRoot, inputId: inputId, layout: props.layout, children: _jsxs("div", { className: cls, children: [_jsx("textarea", { id: inputId, ref: textareaRef, rows: 2, placeholder: placeholder, name: name, value: displayValue, maxLength: maxLength, autoFocus: focus, disabled: disabled, readOnly: readOnly, onChange: onChange, onFocus: onFocus, onBlur: onBlur, onKeyDown: handleKeyDown, onCompositionStart: handleZhStart, onCompositionEnd: handleZhEnd, ...startWithOnProps }), counterVisible && (_jsxs("label", { className: countCls, children: [counter, "/", maxLength] }))] }) })));
|
|
109
112
|
});
|