@cloudbase/weda-ui 3.20.0 → 3.20.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/chart/bar.js +2 -2
- package/dist/configs/components/chart/line.js +2 -2
- package/dist/configs/components/chart/pie.js +2 -2
- package/dist/configs/components/chart/statisticsCard.json +5 -12
- package/dist/configs/components/form/location.json +3 -9
- package/dist/configs/components/form-location.d.ts +2 -2
- package/dist/configs/components/form-location.js +1 -1
- package/dist/configs/components/scrollVeiw.json +43 -79
- package/dist/configs/components/wd-calendar.d.ts +4 -0
- package/dist/configs/components/wd-calendar.js +23 -1
- package/dist/configs/components/wd-cascader.d.ts +7 -12
- package/dist/configs/components/wd-cascader.js +12 -1
- package/dist/configs/components/wd-checkbox.d.ts +4 -1
- package/dist/configs/components/wd-checkbox.js +11 -1
- package/dist/configs/components/wd-form.js +2 -1
- package/dist/configs/components/wd-location.d.ts +2 -2
- package/dist/configs/components/wd-location.js +1 -1
- package/dist/configs/components/wd-radio.d.ts +4 -1
- package/dist/configs/components/wd-select-multiple.d.ts +4 -1
- package/dist/configs/components/wd-select-multiple.js +11 -1
- package/dist/configs/components/wd-select.d.ts +4 -1
- package/dist/configs/components/wd-table.js +3 -2
- package/dist/configs/components/wd-tag-select.d.ts +4 -1
- package/dist/configs/components/wd-tag-select.js +11 -1
- package/dist/configs/components/wd-top-tab.d.ts +1 -1
- package/dist/configs/components/wd-top-tab.js +2 -1
- package/dist/configs/index.d.ts +102 -60
- package/dist/configs/type-utils/type-form.d.ts +10 -4
- package/dist/configs/type-utils/type-form.js +31 -4
- package/dist/enum/index.js +1 -0
- package/dist/style/index.css +1 -0
- package/dist/style/index.scss +1 -1
- package/dist/style/weda-ui.min.css +2 -2
- package/dist/web/components/form/location/common/propsConfig.d.ts +3 -3
- package/dist/web/components/form/location/common/propsConfig.js +2 -2
- package/dist/web/components/form/location/components/LocationH5/location.h5.js +36 -27
- package/dist/web/components/form/location/components/LocationPC/Header.js +2 -2
- package/dist/web/components/form/location/components/LocationPC/location.PC.js +38 -41
- package/dist/web/components/form-location/index.d.ts +1 -1
- package/dist/web/components/form-location/index.js +3 -3
- package/dist/web/components/form-rich-text/index.d.ts +2 -2
- package/dist/web/components/form-rich-text/index.js +2 -2
- package/dist/web/components/wd-calendar/wd-calendar.js +4 -11
- package/dist/web/components/wd-calendar/weeks.d.ts +1 -1
- package/dist/web/components/wd-calendar/weeks.js +2 -2
- package/dist/web/components/wd-form/form-utils.d.ts +0 -1
- package/dist/web/components/wd-form/form-utils.js +0 -32
- package/dist/web/components/wd-form/index.js +17 -7
- package/dist/web/components/wd-form-obj/base-form-obj.js +9 -0
- package/dist/web/components/wd-input-number/wd-input-number.js +3 -15
- package/dist/web/components/wd-location/wd-location.d.ts +1 -1
- package/dist/web/components/wd-location/wd-location.js +2 -2
- package/dist/web/components/wd-select/select/selectUI.js +12 -2
- package/dist/web/components/wd-table/components/ExportFileModalByApi/index.js +3 -2
- package/dist/web/components/wd-table/components/Table/index.js +9 -14
- package/dist/web/components/wd-table/hooks/useTableData.js +8 -3
- package/dist/web/components/wd-table/utils/index.d.ts +1 -0
- package/dist/web/components/wd-table/utils/index.js +1 -1
- package/package.json +1 -1
|
@@ -5,10 +5,11 @@ import { Icon, Table, StatusTip, ConfigProvider } from 'tea-component';
|
|
|
5
5
|
import { useResizeObserver } from '@react-hookz/web';
|
|
6
6
|
import { useConfig } from '../../../../utils/config-context';
|
|
7
7
|
import { isInIde } from '../../../../utils/platform';
|
|
8
|
-
const { sortable, radioable, selectable, injectable, pageable, autotip, scrollable, columnsResizable
|
|
8
|
+
const { sortable, radioable, selectable, injectable, pageable, autotip, scrollable, columnsResizable } = Table.addons;
|
|
9
9
|
import StatusContent from '../../../statusContent';
|
|
10
10
|
import classNames from '../../../../utils/classnames';
|
|
11
11
|
import { setTableHeaderStyle } from './util';
|
|
12
|
+
import { orderByFieldKey } from '../../utils/index';
|
|
12
13
|
const { LoadingTip } = StatusTip;
|
|
13
14
|
const defaultTotal = 0;
|
|
14
15
|
const pageIndexSpan = 1;
|
|
@@ -16,7 +17,7 @@ const miniPageSize = 10;
|
|
|
16
17
|
// h5 端表格高度
|
|
17
18
|
const tableHeight = { sm: 500, md: 580, lg: 880 };
|
|
18
19
|
const tableHeaderHeight = 51;
|
|
19
|
-
const renderStatus = ({ isH5, status, isNoDataSourceBind, _emptyText, errorObj, __innerSlot
|
|
20
|
+
const renderStatus = ({ isH5, status, isNoDataSourceBind, _emptyText, errorObj, __innerSlot }) => {
|
|
20
21
|
var _a, _b;
|
|
21
22
|
const text = {
|
|
22
23
|
loading: '数据加载中,请稍候...',
|
|
@@ -39,9 +40,7 @@ onQueryChange, enablePagination, columnSelectType, defaultPageSize, defaultPageI
|
|
|
39
40
|
const tableRef = useRef(null);
|
|
40
41
|
const { classPrefix } = useConfig();
|
|
41
42
|
// 是否展示全局loading
|
|
42
|
-
const isShowLoading = isH5
|
|
43
|
-
? (queryParams === null || queryParams === void 0 ? void 0 : queryParams.pageIndex) === pageIndexSpan && isLoading
|
|
44
|
-
: isLoading;
|
|
43
|
+
const isShowLoading = isH5 ? (queryParams === null || queryParams === void 0 ? void 0 : queryParams.pageIndex) === pageIndexSpan && isLoading : isLoading;
|
|
45
44
|
// table状态样式
|
|
46
45
|
const showStatus = isShowLoading || isError || !(records === null || records === void 0 ? void 0 : records.length);
|
|
47
46
|
const classes = {
|
|
@@ -64,7 +63,7 @@ onQueryChange, enablePagination, columnSelectType, defaultPageSize, defaultPageI
|
|
|
64
63
|
onQueryChange({ sort });
|
|
65
64
|
}
|
|
66
65
|
events === null || events === void 0 ? void 0 : events.sort({
|
|
67
|
-
sort: sort.map((i) => ({ orderType: i.order, orderBy: i.by })),
|
|
66
|
+
sort: sort.map((i) => ({ orderType: i.order, orderBy: orderByFieldKey(i.by, columns) })),
|
|
68
67
|
});
|
|
69
68
|
},
|
|
70
69
|
}),
|
|
@@ -148,20 +147,16 @@ onQueryChange, enablePagination, columnSelectType, defaultPageSize, defaultPageI
|
|
|
148
147
|
tableAddons.push(selectable({
|
|
149
148
|
value: selectedKeys,
|
|
150
149
|
onChange: onSelectChange,
|
|
151
|
-
render: (element, { disabled }) => disabled ? _jsx(Icon, { type: "loading" }) : element,
|
|
152
|
-
targetColumnKey: (columns === null || columns === void 0 ? void 0 : columns.length) && columnSelectType === 'select'
|
|
153
|
-
? 'weda_select'
|
|
154
|
-
: undefined,
|
|
150
|
+
render: (element, { disabled }) => (disabled ? _jsx(Icon, { type: "loading" }) : element),
|
|
151
|
+
targetColumnKey: (columns === null || columns === void 0 ? void 0 : columns.length) && columnSelectType === 'select' ? 'weda_select' : undefined,
|
|
155
152
|
}));
|
|
156
153
|
}
|
|
157
154
|
else if (columnSelectType === 'radio') {
|
|
158
155
|
tableAddons.push(radioable({
|
|
159
156
|
value: selectedKeys === null || selectedKeys === void 0 ? void 0 : selectedKeys[0],
|
|
160
157
|
onChange: onSelectChange,
|
|
161
|
-
render: (element, { disabled }) => disabled ? _jsx(Icon, { type: "loading" }) : element,
|
|
162
|
-
targetColumnKey: (columns === null || columns === void 0 ? void 0 : columns.length) && columnSelectType === 'radio'
|
|
163
|
-
? 'weda_radio'
|
|
164
|
-
: undefined,
|
|
158
|
+
render: (element, { disabled }) => (disabled ? _jsx(Icon, { type: "loading" }) : element),
|
|
159
|
+
targetColumnKey: (columns === null || columns === void 0 ? void 0 : columns.length) && columnSelectType === 'radio' ? 'weda_radio' : undefined,
|
|
165
160
|
}));
|
|
166
161
|
}
|
|
167
162
|
const showLoadingBottomTip = isLoading && (queryParams === null || queryParams === void 0 ? void 0 : queryParams.pageIndex) !== pageIndexSpan;
|
|
@@ -19,12 +19,15 @@ export const useTableData = ({ dataSourceAPI, connectorMethod, query, events, is
|
|
|
19
19
|
const fetchVersion = (fetchRef.current.version = getUuid());
|
|
20
20
|
let data = { records: [], total: 0 };
|
|
21
21
|
setTableLoading(true);
|
|
22
|
+
let canCallQuerySuccess = true;
|
|
22
23
|
try {
|
|
23
24
|
if (isModel) {
|
|
24
25
|
if (supportManyRelated) {
|
|
25
26
|
// select为空对象时报错,避免传空对象给数组
|
|
26
27
|
const select = (query === null || query === void 0 ? void 0 : query.select) || {};
|
|
28
|
+
canCallQuerySuccess = false;
|
|
27
29
|
if (Object.keys(select).length !== 0) {
|
|
30
|
+
canCallQuerySuccess = true;
|
|
28
31
|
data = await dataSourceAPI.getRecordListV2(query, { swr });
|
|
29
32
|
data.records = data.records || [];
|
|
30
33
|
}
|
|
@@ -50,9 +53,11 @@ export const useTableData = ({ dataSourceAPI, connectorMethod, query, events, is
|
|
|
50
53
|
else {
|
|
51
54
|
setTableData(records);
|
|
52
55
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
if (canCallQuerySuccess) {
|
|
57
|
+
events === null || events === void 0 ? void 0 : events.querySuccess({
|
|
58
|
+
data: Object.assign({}, data, query),
|
|
59
|
+
});
|
|
60
|
+
}
|
|
56
61
|
(records === null || records === void 0 ? void 0 : records.length) === 0 &&
|
|
57
62
|
(events === null || events === void 0 ? void 0 : events.queryEmpty({
|
|
58
63
|
data: Object.assign({}, data, query),
|
|
@@ -20,6 +20,7 @@ export declare const getSearchValues: (searchValues?: any[]) => {
|
|
|
20
20
|
}[];
|
|
21
21
|
relatedSearchValues: any;
|
|
22
22
|
};
|
|
23
|
+
export declare const orderByFieldKey: (key: any, columns: any) => any;
|
|
23
24
|
export declare const getQueryParams: ({ queryParams, wList, viewFieldsData, connectorParams, isModel, isViewTable, authFields, supportManyRelated, columns, selectFieldType, selectFields, isSupportMultipleSort, }: any) => {
|
|
24
25
|
pageNo: number;
|
|
25
26
|
pageSize: number;
|
|
@@ -188,7 +188,7 @@ export const getSearchValues = (searchValues = []) => {
|
|
|
188
188
|
relatedSearchValues,
|
|
189
189
|
};
|
|
190
190
|
};
|
|
191
|
-
const orderByFieldKey = (key, columns) => {
|
|
191
|
+
export const orderByFieldKey = (key, columns) => {
|
|
192
192
|
var _a;
|
|
193
193
|
return ((_a = columns === null || columns === void 0 ? void 0 : columns.find((i) => key === (i === null || i === void 0 ? void 0 : i.slotKey))) === null || _a === void 0 ? void 0 : _a.fieldKey) || key;
|
|
194
194
|
};
|