@cloudbase/weda-ui 3.24.1 → 3.25.0
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/dataView.js +1 -0
- package/dist/configs/components/listView.js +1 -0
- package/dist/configs/components/wd-form-arr.js +4 -1
- package/dist/configs/components/wd-select-multiple.js +1 -0
- package/dist/configs/components/wd-select.js +1 -0
- package/dist/configs/components/wd-table.js +1 -0
- package/dist/configs/components/wd-text.js +2 -2
- package/dist/configs/type-utils/type-form.js +6 -4
- package/dist/configs/utils/field.d.ts +1 -0
- package/dist/configs/utils/field.js +151 -0
- package/dist/style/index.css +6 -0
- package/dist/style/index.scss +1 -1
- package/dist/style/weda-ui.min.css +2 -2
- package/dist/web/components/form-input-hooks/index.js +12 -4
- package/dist/web/components/formdetail/index.js +1 -0
- package/dist/web/components/wd-button/wd-button.js +5 -5
- package/dist/web/components/wd-form/hoc/form-container-decorator.js +2 -2
- package/dist/web/components/wd-form-item/wd-form-item.js +9 -11
- package/dist/web/components/wd-table/table-with-form.js +28 -14
- package/dist/web/components/wd-table/wd-table.js +12 -2
- package/dist/web/utils/hooks/useCanPreview.js +1 -1
- package/package.json +4 -3
|
@@ -20,11 +20,11 @@ import { useFormField } from '../wd-form/contexts/form-field-context';
|
|
|
20
20
|
import { useFormFieldObj } from '../wd-form/contexts/form-field-obj-context';
|
|
21
21
|
import { errorHandler } from '../../utils/error';
|
|
22
22
|
const logger = debug('wd-form-item');
|
|
23
|
-
const SET_VALUE_DEBOUNCE_TIMEOUT = 250;
|
|
24
23
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
25
24
|
export function useParentForm(widgetIgnored) {
|
|
26
25
|
return useFormWidget();
|
|
27
26
|
}
|
|
27
|
+
const regex = /^[a-zA-Z_$][\w$]*(?:\[\d+\])*(?:\.[a-zA-Z_$][\w$]*(?:\[\d+\])*)*$/;
|
|
28
28
|
// 转换路径
|
|
29
29
|
const convertPathToArray = (path) => {
|
|
30
30
|
return path
|
|
@@ -46,7 +46,11 @@ export function useFormInputTrait(inputParams) {
|
|
|
46
46
|
const formFieldObjsContext = useFormFieldObj();
|
|
47
47
|
const [isChange, setIsChange] = useState(false);
|
|
48
48
|
const name = useMemo(() => {
|
|
49
|
-
if (isNil(_name)
|
|
49
|
+
if (isNil(_name)) {
|
|
50
|
+
console.warn(`组件 ${$widget.id} 表单key(表单输入类组件 name 属性)没设置或为空串的时候不受表单容器控制`);
|
|
51
|
+
return ''; // 或者 return null; 根据你的后续逻辑决定
|
|
52
|
+
}
|
|
53
|
+
if (typeof _name === 'string' && _name.length === 0) {
|
|
50
54
|
// name 没设置或为空串的时候不受表单容器控制
|
|
51
55
|
console.warn(`组件 ${$widget.id} 表单key(表单输入类组件 name 属性)没设置或为空串的时候不受表单容器控制`);
|
|
52
56
|
}
|
|
@@ -55,10 +59,14 @@ export function useFormInputTrait(inputParams) {
|
|
|
55
59
|
}, [$widget.id, _name]);
|
|
56
60
|
// namePath 用于标识表单项的属性路径,用于容器通过lodash.set/get管理表单项的值
|
|
57
61
|
const namePath = useMemo(() => {
|
|
62
|
+
var _a;
|
|
63
|
+
if (!name) {
|
|
64
|
+
return [];
|
|
65
|
+
}
|
|
58
66
|
if (formFieldObjsContext === null || formFieldObjsContext === void 0 ? void 0 : formFieldObjsContext.isChildField) {
|
|
59
|
-
return formFieldObjsContext === null || formFieldObjsContext === void 0 ? void 0 : formFieldObjsContext.namePath.concat(name);
|
|
67
|
+
return ((_a = formFieldObjsContext === null || formFieldObjsContext === void 0 ? void 0 : formFieldObjsContext.namePath) !== null && _a !== void 0 ? _a : []).concat(name);
|
|
60
68
|
}
|
|
61
|
-
else if (
|
|
69
|
+
else if (regex.test(name)) {
|
|
62
70
|
// 兼容 formDetail 中 的 name 写法
|
|
63
71
|
return convertPathToArray(name);
|
|
64
72
|
}
|
|
@@ -167,6 +167,7 @@ const FormDetailCom = forwardRef(function FormDetail(props, ref) {
|
|
|
167
167
|
if (isWdFormDetail) {
|
|
168
168
|
data = initialValues;
|
|
169
169
|
}
|
|
170
|
+
data = data.map((i, index) => ({ ...i, _id: index }));
|
|
170
171
|
setContextData(data);
|
|
171
172
|
(_a = events === null || events === void 0 ? void 0 : events.onDataChange) === null || _a === void 0 ? void 0 : _a.call(events, {
|
|
172
173
|
data,
|
|
@@ -70,14 +70,14 @@ export const WdButton = forwardRef(function WdButton(props, ref) {
|
|
|
70
70
|
case 'reset':
|
|
71
71
|
// 调用父级表单容器的重置
|
|
72
72
|
parentForm = getParentForm($widget);
|
|
73
|
-
if (parentForm.reset) {
|
|
74
|
-
parentForm
|
|
73
|
+
if ((parentForm === null || parentForm === void 0 ? void 0 : parentForm.reset) && typeof (parentForm === null || parentForm === void 0 ? void 0 : parentForm.reset) === 'function') {
|
|
74
|
+
parentForm.reset();
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
// 老逻辑兼容
|
|
78
78
|
parentForm = getParentForm($node);
|
|
79
|
-
if (parentForm.reset) {
|
|
80
|
-
parentForm
|
|
79
|
+
if ((parentForm === null || parentForm === void 0 ? void 0 : parentForm.reset) && typeof (parentForm === null || parentForm === void 0 ? void 0 : parentForm.reset) === 'function') {
|
|
80
|
+
parentForm.reset();
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
83
|
break;
|
|
@@ -111,5 +111,5 @@ export const WdButton = forwardRef(function WdButton(props, ref) {
|
|
|
111
111
|
openType,
|
|
112
112
|
};
|
|
113
113
|
}, [text, theme, variant, size, block, disabled, formType, openType]);
|
|
114
|
-
return (_jsxs("button", { className: classNames(classes, className), disabled: disabled, type: formType, style: style, id: id, ...propsStartWithOn, onClick: onClick, children: [iconPosition === 'before' && iconType === 'text-with-icon' && _jsx(Icon, {}), iconType === 'icon-only' ?
|
|
114
|
+
return (_jsxs("button", { className: classNames(classes, className), disabled: disabled, type: formType, style: style, id: id, ...propsStartWithOn, onClick: onClick, children: [iconPosition === 'before' && iconType === 'text-with-icon' && _jsx(Icon, {}), iconType === 'icon-only' ? _jsx(Icon, {}) : _jsx("span", { className: `${classPrefix}-btn__text`, children: textToString(text) }), iconPosition === 'after' && iconType === 'text-with-icon' && _jsx(Icon, {})] }));
|
|
115
115
|
});
|
|
@@ -15,7 +15,7 @@ import { useFormFieldObj } from '../contexts/form-field-obj-context';
|
|
|
15
15
|
*/
|
|
16
16
|
export function withFormContainer(Component) {
|
|
17
17
|
const WithFormContainer = React.forwardRef((props, ref) => {
|
|
18
|
-
var _a
|
|
18
|
+
var _a;
|
|
19
19
|
const { ...componentProps } = props;
|
|
20
20
|
const formField = useFormField();
|
|
21
21
|
const formFieldObjsContext = useFormFieldObj();
|
|
@@ -54,7 +54,7 @@ export function withFormContainer(Component) {
|
|
|
54
54
|
// 顶层没有表单容器,则组件自己管理值
|
|
55
55
|
// 非table组件,直接渲染原始组件,值交给顶层表单容器管理
|
|
56
56
|
// 在表单容器内,table组件,如果结合嵌套组件使用,则将组件值交给顶层表单容器管理,否则自己管理
|
|
57
|
-
const shouldUseProvider = formField ? !formFieldObjsContext && (
|
|
57
|
+
const shouldUseProvider = formField ? !formFieldObjsContext && (props === null || props === void 0 ? void 0 : props.componentType) === 'table' : true;
|
|
58
58
|
if (!shouldUseProvider) {
|
|
59
59
|
return _jsx(Component, { ...props, ref: ref, isInformContainer: true });
|
|
60
60
|
}
|
|
@@ -17,24 +17,21 @@ const Label = React.memo(function Label({ labelCls, labelStyle, itemWrap, inputI
|
|
|
17
17
|
const Item = React.memo(function Item({ itemWrap, testId, controlWrapCls, readOnly, before, after, readValue, readBeforeAfter, format, value, children, }) {
|
|
18
18
|
return (_jsx("div", { className: `${itemWrap}__control`, "data-testid": testId, children: _jsx("div", { className: controlWrapCls, children: _jsx(WdFormItemReadOnly, { readOnly: readOnly, readValue: readValue, version: "wd", before: before, after: after, readBeforeAfter: readBeforeAfter, format: format, value: value, children: children }) }) }));
|
|
19
19
|
});
|
|
20
|
-
const
|
|
21
|
-
const { mode, labelProps, itemProps, children } = props || {};
|
|
20
|
+
const LabelContainerComp = React.memo(function LabelContainer(props) {
|
|
21
|
+
const { isH5, isRoot, labelVisible, mode, labelProps, itemProps, children } = props || {};
|
|
22
22
|
const cardRef = React.createRef();
|
|
23
23
|
const [iconName, setIconName] = useState('chevronup');
|
|
24
24
|
const headerSlot = (_jsxs(_Fragment, { children: [_jsx(WdIcon, { name: iconName, events: {
|
|
25
25
|
tap: () => {
|
|
26
26
|
setIconName(iconName === 'chevrondown' ? 'chevronup' : 'chevrondown');
|
|
27
27
|
},
|
|
28
|
-
} }), _jsx(Label, { ...labelProps })] }));
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
} }), (labelVisible || (!isH5 && isRoot)) && _jsx(Label, { ...labelProps })] }));
|
|
29
|
+
const showLabel = isRoot && labelVisible;
|
|
30
|
+
if (mode === 'custom' || mode === 'table' || mode === 'web-table') {
|
|
31
|
+
return (_jsxs(_Fragment, { children: [showLabel && _jsx(Label, { ...labelProps }), _jsx(Item, { ...itemProps, children: children }), ' '] }));
|
|
31
32
|
}
|
|
32
33
|
const contentSlot = _jsx(Item, { ...itemProps, children: children });
|
|
33
|
-
return (_jsx(WdCard, { ref: cardRef, className: iconName === 'chevrondown' ? 'wd-card-content__hidden' : '', showContent: true, headerSlot: headerSlot, contentSlot: contentSlot, events: { tap: () => { } } }));
|
|
34
|
-
});
|
|
35
|
-
const LabelContainerComp = React.memo(function LabelContainerComp({ isRoot, isH5, mode, labelProps, itemProps, children, }) {
|
|
36
|
-
const showLabel = isRoot && !isH5;
|
|
37
|
-
return (_jsxs(_Fragment, { children: [showLabel && _jsx(Label, { ...labelProps }), _jsx(LabelContainer, { isRoot: isRoot, labelProps: labelProps, itemProps: itemProps, mode: mode, children: children })] }));
|
|
34
|
+
return (_jsxs(_Fragment, { children: [showLabel && !isH5 && _jsx(Label, { ...labelProps }), ' ', _jsx(WdCard, { ref: cardRef, className: iconName === 'chevrondown' ? 'wd-card-content__hidden' : '', showContent: true, headerSlot: headerSlot, contentSlot: contentSlot, events: { tap: () => { } } })] }));
|
|
38
35
|
});
|
|
39
36
|
/**
|
|
40
37
|
* 表单项包裹,包括标题、文本提示、校验
|
|
@@ -152,5 +149,6 @@ export const WdFormItem = React.memo(function WdFormItem(props) {
|
|
|
152
149
|
};
|
|
153
150
|
if (!visible)
|
|
154
151
|
return null;
|
|
155
|
-
|
|
152
|
+
const labelClass = classNames({ [`${itemWrap}`]: true, [`${itemWrap}__vertical`]: hasLabelContainer && isH5 });
|
|
153
|
+
return (_jsxs("div", { className: cls, id: isRoot ? id : null, style: style, children: [_jsx("div", { className: labelClass, children: hasLabelContainer ? (_jsx(LabelContainerComp, { isRoot: isRoot, isH5: isH5, mode: props === null || props === void 0 ? void 0 : props.mode, labelProps: labelProps, itemProps: itemProps, labelVisible: labelVisible, children: children })) : (_jsxs(_Fragment, { children: [labelVisible && _jsx(Label, { ...labelProps }), _jsx(Item, { ...itemProps, children: children })] })) }), Message, Help] }));
|
|
156
154
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from 'react';
|
|
2
|
+
import React, { forwardRef, useMemo, useState } from 'react';
|
|
3
3
|
import { useDeepCompareEffect } from '@react-hookz/web';
|
|
4
4
|
import { Table } from './components';
|
|
5
5
|
// eslint-disable-next-line tree-shaking/no-side-effects-in-initialization
|
|
@@ -7,26 +7,40 @@ import { withFormContainer } from '../wd-form/hoc/form-container-decorator';
|
|
|
7
7
|
import { useFormField } from '../wd-form/contexts/form-field-context';
|
|
8
8
|
import { useFormFieldObj } from '../wd-form/contexts/form-field-obj-context';
|
|
9
9
|
import { useSetWidgetApi } from '../../utils/widget-api/use-set-widget-api';
|
|
10
|
-
|
|
10
|
+
import isObjectEqual from '../../utils/isObjectEqual';
|
|
11
|
+
export const TableWithForm = withFormContainer(React.memo(forwardRef(function TableComp(tableProps, ref) {
|
|
12
|
+
var _a, _b;
|
|
11
13
|
const { records = [] } = tableProps;
|
|
12
14
|
const formField = useFormField();
|
|
13
|
-
const { formFieldsValue = [], setFieldValue, setFormFieldsValue } = formField || {};
|
|
15
|
+
const { formFieldsValue = [], setFieldValue, setFormFieldsValue, getFieldValue } = formField || {};
|
|
14
16
|
const formFieldObjsContext = useFormFieldObj();
|
|
17
|
+
const [columns, setColumns] = useState(tableProps.columns);
|
|
18
|
+
const isEditorMode = (_b = (_a = window.$w) === null || _a === void 0 ? void 0 : _a.wedaContext) === null || _b === void 0 ? void 0 : _b.isEditorMode;
|
|
19
|
+
const parentNamePath = tableProps.isInformContainer && (formFieldObjsContext === null || formFieldObjsContext === void 0 ? void 0 : formFieldObjsContext.isChildField) ? formFieldObjsContext === null || formFieldObjsContext === void 0 ? void 0 : formFieldObjsContext.namePath : null;
|
|
20
|
+
const tableValue = useMemo(() => {
|
|
21
|
+
return parentNamePath && getFieldValue ? getFieldValue({ namePath: parentNamePath }) : formFieldsValue;
|
|
22
|
+
}, [formFieldsValue, getFieldValue, parentNamePath]);
|
|
15
23
|
useDeepCompareEffect(() => {
|
|
24
|
+
if (!isObjectEqual(tableProps.columns, columns, true)) {
|
|
25
|
+
setColumns(tableProps.columns);
|
|
26
|
+
}
|
|
27
|
+
}, [tableProps.columns]);
|
|
28
|
+
useDeepCompareEffect(() => {
|
|
29
|
+
// records变化时,同步更新value
|
|
16
30
|
const value = [...records];
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
setFieldValue({ namePath: parentNamePath, value });
|
|
22
|
-
}
|
|
31
|
+
const parentNamePath = tableProps.isInformContainer && (formFieldObjsContext === null || formFieldObjsContext === void 0 ? void 0 : formFieldObjsContext.isChildField) ? formFieldObjsContext === null || formFieldObjsContext === void 0 ? void 0 : formFieldObjsContext.namePath : null;
|
|
32
|
+
if (setFieldValue && parentNamePath && !isObjectEqual(tableValue, value)) {
|
|
33
|
+
// 情况1: 在表单容器内且是子字段,通过父路径设置值
|
|
34
|
+
setFieldValue({ namePath: parentNamePath, value });
|
|
23
35
|
}
|
|
24
|
-
else if (setFormFieldsValue) {
|
|
36
|
+
else if (setFormFieldsValue && !isObjectEqual(tableValue, value)) {
|
|
37
|
+
// 情况2: 不在表单容器内,或者是表单容器但非子字段,直接设置表单值
|
|
25
38
|
setFormFieldsValue(value);
|
|
26
39
|
}
|
|
27
40
|
}, [formFieldObjsContext === null || formFieldObjsContext === void 0 ? void 0 : formFieldObjsContext.namePath, records, tableProps.isInformContainer, formFieldObjsContext === null || formFieldObjsContext === void 0 ? void 0 : formFieldObjsContext.isChildField]);
|
|
28
41
|
useSetWidgetApi(() => ({
|
|
29
|
-
value:
|
|
30
|
-
}), [
|
|
31
|
-
|
|
32
|
-
})
|
|
42
|
+
value: tableValue,
|
|
43
|
+
}), [tableValue], ref);
|
|
44
|
+
// 非编辑模式缓存columns
|
|
45
|
+
return _jsx(Table, { ...tableProps, columns: isEditorMode ? tableProps.columns : columns });
|
|
46
|
+
})));
|
|
@@ -552,7 +552,16 @@ export const WdTable = forwardRef(function TableComp(tableProps, ref) {
|
|
|
552
552
|
},
|
|
553
553
|
// 设置选中项
|
|
554
554
|
setSelectedKeys: (params) => {
|
|
555
|
-
|
|
555
|
+
var _a, _b;
|
|
556
|
+
if (!(params === null || params === void 0 ? void 0 : params.selectedKeys) || params.selectedKeys.length === 0) {
|
|
557
|
+
onSelectChange([], {}, true);
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
const recordsMap = new Map(dataRef.current.tableRecords.map((item) => [item[recordKey], item]));
|
|
561
|
+
const records = (_b = (_a = params === null || params === void 0 ? void 0 : params.selectedKeys) === null || _a === void 0 ? void 0 : _a.map((key) => recordsMap.get(key))) === null || _b === void 0 ? void 0 : _b.filter(Boolean);
|
|
562
|
+
const context = { record: records, selectedRecords: records };
|
|
563
|
+
const validSelectedKeys = (records === null || records === void 0 ? void 0 : records.map((record) => record[recordKey])) || [];
|
|
564
|
+
onSelectChange(validSelectedKeys, context, false);
|
|
556
565
|
},
|
|
557
566
|
// 当前页数据
|
|
558
567
|
records: isExpression && !enableTotal && enablePagination
|
|
@@ -682,6 +691,7 @@ export const WdTable = forwardRef(function TableComp(tableProps, ref) {
|
|
|
682
691
|
const onSelectChange = (keys, context, empty = false) => {
|
|
683
692
|
if (empty) {
|
|
684
693
|
setSelectedKeys([]);
|
|
694
|
+
setSelectedRecords([]);
|
|
685
695
|
return;
|
|
686
696
|
}
|
|
687
697
|
setSelectedKeys([].concat(keys));
|
|
@@ -737,7 +747,7 @@ export const WdTable = forwardRef(function TableComp(tableProps, ref) {
|
|
|
737
747
|
setOpenMobileFilter(true);
|
|
738
748
|
}, enableRefreshBtn: enableRefreshBtn, enableTableHeightSizeBtn: enableTableHeightSizeBtn, enablePagination: enablePagination }) }))] })), isH5 && (enablePagination || enableRefreshBtn || enableTableHeightSizeBtn || hasFilterButton) && (_jsx(ToolBar, { hasFilterButton: hasFilterButton, total: total, refreshTable: onRefreshBtnClick, setTableHightSize: setTableHightSize, currentSize: tableHightSize, setOpenMobileFilter: () => {
|
|
739
749
|
setOpenMobileFilter(true);
|
|
740
|
-
}, enableRefreshBtn: enableRefreshBtn, enableTableHeightSizeBtn: enableTableHeightSizeBtn, enablePagination: enablePagination })), _jsx(TableWithForm, { ref: ref, 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: visibleColumns, 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, bottomTip: row__bottom__slot, enableBottomTipSlot: enableBottomTipSlot }), 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: {
|
|
750
|
+
}, enableRefreshBtn: enableRefreshBtn, enableTableHeightSizeBtn: enableTableHeightSizeBtn, enablePagination: enablePagination })), _jsx(TableWithForm, { ref: ref, 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: visibleColumns, 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, bottomTip: row__bottom__slot, enableBottomTipSlot: enableBottomTipSlot, componentType: "table" }), 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: {
|
|
741
751
|
close: () => {
|
|
742
752
|
setIsMobileOptionVisible(false);
|
|
743
753
|
},
|
|
@@ -15,5 +15,5 @@ export function useCanPreview() {
|
|
|
15
15
|
dispose();
|
|
16
16
|
};
|
|
17
17
|
}, [dispose]);
|
|
18
|
-
return ((
|
|
18
|
+
return ((_b = (_a = window.$w) === null || _a === void 0 ? void 0 : _a.wedaContext) === null || _b === void 0 ? void 0 : _b.isEditorMode) || (editorPlatforms === null || editorPlatforms === void 0 ? void 0 : editorPlatforms.includes('MP'));
|
|
19
19
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/weda-ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.25.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index",
|
|
6
6
|
"miniprogram": "mpdist",
|
|
@@ -72,8 +72,9 @@
|
|
|
72
72
|
"postpack": "pinst --enable",
|
|
73
73
|
"test:icon": "node tools/publish-icon/test.mjs",
|
|
74
74
|
"sync-icon": "node tools/publish-icon/sync-icon.mjs",
|
|
75
|
-
"deploy": "node scripts/deploy.mjs && npm run release",
|
|
76
|
-
"release": "node scripts/release.mjs"
|
|
75
|
+
"deploy": "npm run use-node18 && node scripts/deploy.mjs && npm run release",
|
|
76
|
+
"release": "node scripts/release.mjs",
|
|
77
|
+
"use-node18": "node scripts/use-node18.mjs && hash -r && node -v"
|
|
77
78
|
},
|
|
78
79
|
"keywords": [
|
|
79
80
|
"weda",
|