@cloudbase/weda-ui 3.19.0 → 3.20.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/wd-form.d.ts +2 -2
- package/dist/configs/components/wd-form.js +2 -3
- package/dist/configs/components/wd-table.d.ts +3 -3
- package/dist/configs/index.d.ts +6 -6
- package/dist/configs/type-utils/type-form.d.ts +2 -2
- package/dist/style/weda-ui.min.css +1 -1
- package/dist/web/components/form-input-hooks/index.d.ts +3 -1
- package/dist/web/components/form-input-hooks/index.js +93 -54
- package/dist/web/components/form-rich-text/index.d.ts +1 -1
- package/dist/web/components/form-rich-text/index.js +6 -2
- package/dist/web/components/formdetail/index.d.ts +1 -1
- package/dist/web/components/formdetail/index.js +28 -42
- package/dist/web/components/richText/index.js +9 -3
- package/dist/web/components/wd-form/contexts/form-field-arr-context.d.ts +21 -0
- package/dist/web/components/wd-form/contexts/form-field-arr-context.js +10 -0
- package/dist/web/components/wd-form/contexts/form-field-context.d.ts +19 -0
- package/dist/web/components/wd-form/contexts/form-field-context.js +10 -0
- package/dist/web/components/wd-form/contexts/form-field-obj-context.d.ts +13 -0
- package/dist/web/components/wd-form/contexts/form-field-obj-context.js +10 -0
- package/dist/web/components/wd-form/form-utils.d.ts +1 -0
- package/dist/web/components/wd-form/form-utils.js +32 -0
- package/dist/web/components/wd-form/index.d.ts +4 -4
- package/dist/web/components/wd-form/index.js +137 -191
- package/dist/web/components/wd-form-item/wd-form-item.d.ts +2 -2
- package/dist/web/components/wd-form-item/wd-form-item.js +96 -14
- package/dist/web/components/wd-form-obj/base-form-obj.js +57 -197
- package/dist/web/components/wd-input/wd-input.js +1 -1
- package/dist/web/components/wd-input-number/wd-input-number.js +40 -2
- package/dist/web/components/wd-rich-text/wd-rich-text.d.ts +1 -1
- package/dist/web/components/wd-rich-text/wd-rich-text.js +7 -3
- package/dist/web/components/wd-table/components/Table/index.js +14 -9
- package/dist/web/components/wd-table/utils/index.d.ts +0 -1
- package/dist/web/components/wd-table/utils/index.js +1 -1
- package/dist/web/utils/widget-api/index.d.ts +0 -14
- package/dist/web/utils/widget-api/index.js +0 -7
- package/package.json +1 -1
|
@@ -5,11 +5,10 @@ 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 } = Table.addons;
|
|
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';
|
|
13
12
|
const { LoadingTip } = StatusTip;
|
|
14
13
|
const defaultTotal = 0;
|
|
15
14
|
const pageIndexSpan = 1;
|
|
@@ -17,7 +16,7 @@ const miniPageSize = 10;
|
|
|
17
16
|
// h5 端表格高度
|
|
18
17
|
const tableHeight = { sm: 500, md: 580, lg: 880 };
|
|
19
18
|
const tableHeaderHeight = 51;
|
|
20
|
-
const renderStatus = ({ isH5, status, isNoDataSourceBind, _emptyText, errorObj, __innerSlot }) => {
|
|
19
|
+
const renderStatus = ({ isH5, status, isNoDataSourceBind, _emptyText, errorObj, __innerSlot, }) => {
|
|
21
20
|
var _a, _b;
|
|
22
21
|
const text = {
|
|
23
22
|
loading: '数据加载中,请稍候...',
|
|
@@ -40,7 +39,9 @@ onQueryChange, enablePagination, columnSelectType, defaultPageSize, defaultPageI
|
|
|
40
39
|
const tableRef = useRef(null);
|
|
41
40
|
const { classPrefix } = useConfig();
|
|
42
41
|
// 是否展示全局loading
|
|
43
|
-
const isShowLoading = isH5
|
|
42
|
+
const isShowLoading = isH5
|
|
43
|
+
? (queryParams === null || queryParams === void 0 ? void 0 : queryParams.pageIndex) === pageIndexSpan && isLoading
|
|
44
|
+
: isLoading;
|
|
44
45
|
// table状态样式
|
|
45
46
|
const showStatus = isShowLoading || isError || !(records === null || records === void 0 ? void 0 : records.length);
|
|
46
47
|
const classes = {
|
|
@@ -63,7 +64,7 @@ onQueryChange, enablePagination, columnSelectType, defaultPageSize, defaultPageI
|
|
|
63
64
|
onQueryChange({ sort });
|
|
64
65
|
}
|
|
65
66
|
events === null || events === void 0 ? void 0 : events.sort({
|
|
66
|
-
sort: sort.map((i) => ({ orderType: i.order, orderBy:
|
|
67
|
+
sort: sort.map((i) => ({ orderType: i.order, orderBy: i.by })),
|
|
67
68
|
});
|
|
68
69
|
},
|
|
69
70
|
}),
|
|
@@ -147,16 +148,20 @@ onQueryChange, enablePagination, columnSelectType, defaultPageSize, defaultPageI
|
|
|
147
148
|
tableAddons.push(selectable({
|
|
148
149
|
value: selectedKeys,
|
|
149
150
|
onChange: onSelectChange,
|
|
150
|
-
render: (element, { disabled }) =>
|
|
151
|
-
targetColumnKey: (columns === null || columns === void 0 ? void 0 : columns.length) && columnSelectType === 'select'
|
|
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,
|
|
152
155
|
}));
|
|
153
156
|
}
|
|
154
157
|
else if (columnSelectType === 'radio') {
|
|
155
158
|
tableAddons.push(radioable({
|
|
156
159
|
value: selectedKeys === null || selectedKeys === void 0 ? void 0 : selectedKeys[0],
|
|
157
160
|
onChange: onSelectChange,
|
|
158
|
-
render: (element, { disabled }) =>
|
|
159
|
-
targetColumnKey: (columns === null || columns === void 0 ? void 0 : columns.length) && columnSelectType === 'radio'
|
|
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,
|
|
160
165
|
}));
|
|
161
166
|
}
|
|
162
167
|
const showLoadingBottomTip = isLoading && (queryParams === null || queryParams === void 0 ? void 0 : queryParams.pageIndex) !== pageIndexSpan;
|
|
@@ -20,7 +20,6 @@ export declare const getSearchValues: (searchValues?: any[]) => {
|
|
|
20
20
|
}[];
|
|
21
21
|
relatedSearchValues: any;
|
|
22
22
|
};
|
|
23
|
-
export declare const orderByFieldKey: (key: any, columns: any) => any;
|
|
24
23
|
export declare const getQueryParams: ({ queryParams, wList, viewFieldsData, connectorParams, isModel, isViewTable, authFields, supportManyRelated, columns, selectFieldType, selectFields, isSupportMultipleSort, }: any) => {
|
|
25
24
|
pageNo: number;
|
|
26
25
|
pageSize: number;
|
|
@@ -188,7 +188,7 @@ export const getSearchValues = (searchValues = []) => {
|
|
|
188
188
|
relatedSearchValues,
|
|
189
189
|
};
|
|
190
190
|
};
|
|
191
|
-
|
|
191
|
+
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
|
};
|
|
@@ -7,22 +7,8 @@ export declare function useWedaAppContext(): {
|
|
|
7
7
|
export declare const FormDetailStatusContext: import("react").Context<string>;
|
|
8
8
|
export declare const useFormDetailContext: () => string;
|
|
9
9
|
export declare const FormObjContext: import("react").Context<{
|
|
10
|
-
formObjName: string;
|
|
11
10
|
status: 'edit' | 'disabled' | 'readOnly';
|
|
12
|
-
valueChangeFromChild: (params: {
|
|
13
|
-
name: string;
|
|
14
|
-
value: any;
|
|
15
|
-
}) => void;
|
|
16
|
-
addFormItem: (name: string, $widget: IWidget) => () => void;
|
|
17
11
|
}>;
|
|
18
12
|
export declare const useFormObjContext: () => {
|
|
19
|
-
formObjName: string;
|
|
20
13
|
status: 'edit' | 'disabled' | 'readOnly';
|
|
21
|
-
valueChangeFromChild: (params: {
|
|
22
|
-
name: string;
|
|
23
|
-
value: any;
|
|
24
|
-
}) => void;
|
|
25
|
-
addFormItem: (name: string, $widget: IWidget) => () => void;
|
|
26
14
|
};
|
|
27
|
-
export declare const FormObjWidgetContext: import("react").Context<IWidget>;
|
|
28
|
-
export declare const useFormObjWidget: () => IWidget;
|
|
@@ -57,15 +57,8 @@ export const useFormDetailContext = () => {
|
|
|
57
57
|
};
|
|
58
58
|
// 共享嵌套表单状态
|
|
59
59
|
export const FormObjContext = createContext({
|
|
60
|
-
formObjName: '',
|
|
61
60
|
status: 'edit',
|
|
62
|
-
valueChangeFromChild: () => { },
|
|
63
|
-
addFormItem: () => () => { },
|
|
64
61
|
}, 'FormObj');
|
|
65
62
|
export const useFormObjContext = () => {
|
|
66
63
|
return useContext(FormObjContext);
|
|
67
64
|
};
|
|
68
|
-
export const FormObjWidgetContext = createContext(null, 'FormObjWidget');
|
|
69
|
-
export const useFormObjWidget = () => {
|
|
70
|
-
return useContext(FormObjWidgetContext);
|
|
71
|
-
};
|