@cloudbase/weda-ui 3.9.8 → 3.10.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.d.ts +31 -0
- package/dist/configs/components/dataView.js +53 -16
- package/dist/configs/components/grid/col.d.ts +1 -1
- package/dist/configs/components/grid/col.js +1 -1
- package/dist/configs/components/grid/grid.d.ts +1 -1
- package/dist/configs/components/grid/grid.js +1 -1
- package/dist/configs/components/grid/row.d.ts +1 -1
- package/dist/configs/components/grid/row.js +1 -1
- package/dist/configs/components/listView.d.ts +148 -444
- package/dist/configs/components/listView.js +991 -703
- package/dist/configs/components/wd-bubble.d.ts +6 -6
- package/dist/configs/components/wd-cascader.d.ts +1 -1
- package/dist/configs/components/wd-checkbox.d.ts +1 -1
- package/dist/configs/components/wd-code-editor.d.ts +1 -1
- package/dist/configs/components/wd-date-range.d.ts +1 -1
- package/dist/configs/components/wd-date.d.ts +1 -1
- package/dist/configs/components/wd-department.d.ts +1 -1
- package/dist/configs/components/wd-form-arr.d.ts +1 -1
- package/dist/configs/components/wd-form-detail.d.ts +1 -1
- package/dist/configs/components/wd-form-obj.d.ts +1 -1
- package/dist/configs/components/wd-form.js +2 -1
- package/dist/configs/components/wd-input-email.d.ts +4 -3
- package/dist/configs/components/wd-input-number.d.ts +2 -2
- package/dist/configs/components/wd-input-phone.d.ts +4 -3
- package/dist/configs/components/wd-input-url.d.ts +4 -3
- package/dist/configs/components/wd-input.d.ts +3 -1
- package/dist/configs/components/wd-location.d.ts +1 -1
- package/dist/configs/components/wd-member.d.ts +1 -1
- package/dist/configs/components/wd-modal.js +2 -0
- package/dist/configs/components/wd-progress.d.ts +2 -2
- package/dist/configs/components/wd-radio.d.ts +1 -1
- package/dist/configs/components/wd-rating.d.ts +2 -2
- package/dist/configs/components/wd-region.d.ts +1 -1
- package/dist/configs/components/wd-rich-text.d.ts +1 -1
- package/dist/configs/components/wd-select-multiple.d.ts +18 -1
- package/dist/configs/components/wd-select-multiple.js +17 -1
- package/dist/configs/components/wd-select.d.ts +18 -1
- package/dist/configs/components/wd-select.js +16 -0
- package/dist/configs/components/wd-side-tab.d.ts +12 -0
- package/dist/configs/components/wd-side-tab.js +47 -3
- package/dist/configs/components/wd-switch.d.ts +2 -2
- package/dist/configs/components/wd-table.d.ts +4 -4
- package/dist/configs/components/wd-table.js +2 -1
- package/dist/configs/components/wd-tag-select.d.ts +3 -3
- package/dist/configs/components/wd-tag.d.ts +21 -21
- package/dist/configs/components/wd-textarea.d.ts +8 -1
- package/dist/configs/components/wd-textarea.js +1 -0
- package/dist/configs/components/wd-time.d.ts +1 -1
- package/dist/configs/components/wd-top-tab.d.ts +12 -0
- package/dist/configs/components/wd-top-tab.js +47 -3
- package/dist/configs/components/wd-upload-file.d.ts +5 -1
- package/dist/configs/components/wd-upload-file.js +15 -0
- package/dist/configs/components/wd-upload-image.d.ts +1 -1
- package/dist/configs/index.d.ts +883 -1407
- package/dist/configs/type-utils/index.d.ts +1 -1
- package/dist/configs/type-utils/type-form.d.ts +29 -14
- package/dist/configs/type-utils/type-form.js +43 -10
- package/dist/configs/type-utils/x-runtime-default.d.ts +6 -0
- package/dist/configs/type-utils/x-runtime-default.js +6 -0
- package/dist/configs/utils/constants.d.ts +2 -0
- package/dist/configs/utils/constants.js +3 -0
- package/dist/configs/utils/get-combinations.d.ts +1 -0
- package/dist/configs/utils/get-combinations.js +13 -0
- package/dist/style/components/grid/grid.css +1288 -0
- package/dist/style/index.css +10478 -0
- package/dist/style/index.scss +1 -1
- package/dist/style/weda-ui.min.css +4 -0
- package/dist/web/actions/showMessage/index.js +5 -0
- package/dist/web/components/carousel/index.js +5 -0
- package/dist/web/components/chart/common/core/eChartBase.js +5 -0
- package/dist/web/components/chart/statisticsCard/index.js +6 -1
- package/dist/web/components/form/form/index.js +9 -1
- package/dist/web/components/form/location/common/mapChoose.js +17 -3
- package/dist/web/components/form/location/common/mapView.js +18 -5
- package/dist/web/components/form/select/dropdown-select/h5.d.ts +3 -1
- package/dist/web/components/form/select/dropdown-select/h5.js +20 -20
- package/dist/web/components/form/select/dropdown-select/index.css +8 -0
- package/dist/web/components/form/select/dropdown-select/index.d.ts +6 -1
- package/dist/web/components/form/select/dropdown-select/index.js +64 -30
- package/dist/web/components/form/select/dropdown-select/pc.d.ts +2 -1
- package/dist/web/components/form/select/dropdown-select/pc.js +3 -3
- package/dist/web/components/form/select/dropdown-select/ui.d.ts +5 -0
- package/dist/web/components/form/select/dropdown-select/ui.js +8 -4
- package/dist/web/components/form/select/formats-util.d.ts +1 -0
- package/dist/web/components/form/select/formats-util.js +8 -0
- package/dist/web/components/form/select/h5.d.ts +1 -1
- package/dist/web/components/form/select/h5.js +6 -3
- package/dist/web/components/form/select/index.css +34 -3
- package/dist/web/components/form/select/index.d.ts +3 -0
- package/dist/web/components/form/select/index.js +6 -3
- package/dist/web/components/form/select/region/index.js +5 -1
- package/dist/web/components/form/select/request.js +2 -1
- package/dist/web/components/form/select/status/index.d.ts +2 -0
- package/dist/web/components/form/select/status/index.js +2 -0
- package/dist/web/components/form/selectMultiple/dropdown-select/h5.d.ts +3 -1
- package/dist/web/components/form/selectMultiple/dropdown-select/h5.js +31 -31
- package/dist/web/components/form/selectMultiple/dropdown-select/index.css +23 -0
- package/dist/web/components/form/selectMultiple/dropdown-select/index.d.ts +6 -1
- package/dist/web/components/form/selectMultiple/dropdown-select/index.js +58 -24
- package/dist/web/components/form/selectMultiple/dropdown-select/pc.d.ts +2 -1
- package/dist/web/components/form/selectMultiple/dropdown-select/pc.js +2 -2
- package/dist/web/components/form/selectMultiple/dropdown-select/ui.d.ts +5 -0
- package/dist/web/components/form/selectMultiple/dropdown-select/ui.js +7 -5
- package/dist/web/components/form/selectMultiple/h5.d.ts +1 -1
- package/dist/web/components/form/selectMultiple/h5.js +6 -3
- package/dist/web/components/form/selectMultiple/index.d.ts +5 -0
- package/dist/web/components/form/selectMultiple/index.js +7 -4
- package/dist/web/components/form/selectMultiple/request.js +2 -1
- package/dist/web/components/form/selectMultiple/status/index.d.ts +2 -0
- package/dist/web/components/form/selectMultiple/status/index.js +2 -0
- package/dist/web/components/form/uploader/index.css +26 -0
- package/dist/web/components/form/uploader/uploader.h5.d.ts +11 -3
- package/dist/web/components/form/uploader/uploader.h5.js +32 -96
- package/dist/web/components/form/uploader/uploader.pc.d.ts +9 -1
- package/dist/web/components/form/uploader/uploader.pc.js +36 -100
- package/dist/web/components/form/uploader/useUploadFile.d.ts +16 -0
- package/dist/web/components/form/uploader/useUploadFile.js +99 -0
- package/dist/web/components/form/uploader/util.d.ts +2 -0
- package/dist/web/components/form/uploader/util.js +87 -0
- package/dist/web/components/form/uploaderFile/uploadFile.h5.d.ts +2 -1
- package/dist/web/components/form/uploaderFile/uploadFile.h5.js +14 -4
- package/dist/web/components/form/uploaderFile/uploadFile.pc.d.ts +2 -1
- package/dist/web/components/form/uploaderFile/uploadFile.pc.js +21 -5
- package/dist/web/components/form/userOrgSelect/component/user-select-pc/user-model.js +5 -0
- package/dist/web/components/form/userOrgSelect/component/userOrgSelect.css +8 -0
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +6 -0
- package/dist/web/components/form-date/index.d.ts +9 -10
- package/dist/web/components/form-depart-tree-select/index.d.ts +8 -8
- package/dist/web/components/form-email/index.d.ts +12 -19
- package/dist/web/components/form-image-uploader/index.d.ts +10 -13
- package/dist/web/components/form-input/index.d.ts +4 -4
- package/dist/web/components/form-input-hooks/index.js +7 -1
- package/dist/web/components/form-location/index.d.ts +8 -7
- package/dist/web/components/form-multi-region/index.d.ts +9 -10
- package/dist/web/components/form-phone/index.d.ts +12 -19
- package/dist/web/components/form-radio/index.d.ts +7 -6
- package/dist/web/components/form-region/index.d.ts +9 -10
- package/dist/web/components/form-rich-text/index.d.ts +8 -9
- package/dist/web/components/form-select/index.d.ts +12 -16
- package/dist/web/components/form-select-multiple/index.d.ts +9 -10
- package/dist/web/components/form-switch/index.d.ts +8 -7
- package/dist/web/components/form-text-area/index.d.ts +12 -19
- package/dist/web/components/form-time/index.d.ts +9 -10
- package/dist/web/components/form-upload-file/index.d.ts +10 -13
- package/dist/web/components/form-url/index.d.ts +12 -19
- package/dist/web/components/form-user-tree-select/index.d.ts +8 -8
- package/dist/web/components/grid/col.d.ts +6 -9
- package/dist/web/components/grid/grid.d.ts +6 -14
- package/dist/web/components/grid/row.d.ts +6 -12
- package/dist/web/components/listView/index.d.ts +21 -2
- package/dist/web/components/listView/index.js +0 -3
- package/dist/web/components/listView/interface.d.ts +4 -4
- package/dist/web/components/lottery/index.d.ts +13 -15
- package/dist/web/components/navigationBar/index.css +2 -1
- package/dist/web/components/richText/index.js +6 -0
- package/dist/web/components/richTextView/useImgTransform.js +6 -1
- package/dist/web/components/table/ImportFileModalByApi/index.js +6 -1
- package/dist/web/components/table/ImportFileModalByApi/uploadCSVFile.js +6 -1
- package/dist/web/components/wd-audio/wd-audio.js +5 -0
- package/dist/web/components/wd-canvas/wd-canvas.js +6 -1
- package/dist/web/components/wd-code-editor/wd-code-editor.js +7 -2
- package/dist/web/components/wd-date/elements/WheelPicker.js +7 -1
- package/dist/web/components/wd-form/index.d.ts +26 -40
- package/dist/web/components/wd-form/index.js +9 -2
- package/dist/web/components/wd-form-item/wd-form-item-read-only.d.ts +2 -0
- package/dist/web/components/wd-form-item/wd-form-item-read-only.js +15 -2
- package/dist/web/components/wd-form-item/wd-form-item.js +4 -3
- package/dist/web/components/wd-input/wd-input.d.ts +20 -42
- package/dist/web/components/wd-input-email/wd-input-email.d.ts +19 -41
- package/dist/web/components/wd-input-phone/wd-input-phone.d.ts +20 -42
- package/dist/web/components/wd-input-url/wd-input-url.d.ts +19 -41
- package/dist/web/components/wd-select/relationalSetting.d.ts +7 -0
- package/dist/web/components/wd-select/relationalSetting.js +15 -0
- package/dist/web/components/wd-select/wd-select.css +43 -0
- package/dist/web/components/wd-select/wd-select.d.ts +2 -0
- package/dist/web/components/wd-select/wd-select.js +25 -6
- package/dist/web/components/wd-select-multiple/wd-select-multiple.css +4 -0
- package/dist/web/components/wd-select-multiple/wd-select-multiple.d.ts +6 -0
- package/dist/web/components/wd-select-multiple/wd-select-multiple.js +25 -6
- package/dist/web/components/wd-table/components/FieldRender/Form/Enum.js +18 -4
- package/dist/web/components/wd-table/components/FieldRender/index.js +34 -5
- package/dist/web/components/wd-table/utils/index.js +18 -4
- package/dist/web/components/wd-tabs/tabs-h5.js +2 -3
- package/dist/web/components/wd-tabs/tabs-pc.js +2 -3
- package/dist/web/components/wd-tabs/util.d.ts +1 -0
- package/dist/web/components/wd-tabs/util.js +21 -0
- package/dist/web/components/wd-textarea/wd-textarea.js +11 -1
- package/dist/web/components/wd-unified-link/utils.js +1 -1
- package/dist/web/components/wd-upload-file/wd-upload-file.js +2 -2
- package/dist/web/components/web-view/web-view.d.ts +14 -20
- package/dist/web/utils/color.js +5 -0
- package/dist/web/utils/datasource.js +30 -20
- package/dist/web/utils/error.d.ts +3 -1
- package/dist/web/utils/error.js +9 -4
- package/dist/web/utils/file.js +4 -1
- package/dist/web/utils/getModelParams.js +27 -2
- package/dist/web/utils/hooks/EnumHoc.js +3 -1
- package/dist/web/utils/hooks/useRecycle.d.ts +4 -0
- package/dist/web/utils/loadIconCss.js +2 -1
- package/dist/web/utils/moment.js +2 -1
- package/dist/web/utils/platform.js +5 -2
- package/dist/web/utils/tcb.js +5 -3
- package/dist/web/weda-ui.css +8 -4
- package/package.json +8 -3
|
@@ -4,50 +4,28 @@ import type { DataType, EventsType } from '../../../configs/components/wd-input'
|
|
|
4
4
|
/**
|
|
5
5
|
* 标准化:电话输入组件
|
|
6
6
|
*/
|
|
7
|
-
export declare const WdInputPhone: React.ForwardRefExoticComponent<CommonPropsType &
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
value: import("@sinclair/typebox").TString;
|
|
25
|
-
}>;
|
|
26
|
-
}, {
|
|
27
|
-
name: string;
|
|
28
|
-
title: string;
|
|
29
|
-
detail: import("@sinclair/typebox").TObject<{
|
|
30
|
-
value: import("@sinclair/typebox").TString;
|
|
31
|
-
}>;
|
|
32
|
-
}, {
|
|
33
|
-
name: string;
|
|
34
|
-
title: string;
|
|
35
|
-
detail: import("@sinclair/typebox").TObject<{
|
|
36
|
-
originValue: import("@sinclair/typebox").TString;
|
|
37
|
-
}>;
|
|
38
|
-
}, {
|
|
39
|
-
name: string;
|
|
40
|
-
title: string;
|
|
41
|
-
description: string;
|
|
42
|
-
detail: import("@sinclair/typebox").TObject<{
|
|
43
|
-
type: import("@sinclair/typebox").TString;
|
|
44
|
-
}>;
|
|
45
|
-
}]>> & import("type-fest").Simplify<{
|
|
7
|
+
export declare const WdInputPhone: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
8
|
+
events: {
|
|
9
|
+
[x: string]: ((eventDetail: {
|
|
10
|
+
value: string;
|
|
11
|
+
}, ...args: unknown[]) => unknown) | ((eventDetail: {
|
|
12
|
+
value: string;
|
|
13
|
+
}, ...args: unknown[]) => unknown) | ((eventDetail: {
|
|
14
|
+
value: string;
|
|
15
|
+
}, ...args: unknown[]) => unknown) | ((eventDetail: {
|
|
16
|
+
value: string;
|
|
17
|
+
}, ...args: unknown[]) => unknown) | ((eventDetail: {
|
|
18
|
+
originValue: string;
|
|
19
|
+
}, ...args: unknown[]) => unknown) | ((eventDetail: {
|
|
20
|
+
type: string;
|
|
21
|
+
}, ...args: unknown[]) => unknown);
|
|
22
|
+
};
|
|
23
|
+
} & {
|
|
46
24
|
type?: string;
|
|
25
|
+
name?: string;
|
|
47
26
|
label?: string;
|
|
48
27
|
template?: string;
|
|
49
28
|
focus?: boolean;
|
|
50
|
-
name?: string;
|
|
51
29
|
required?: boolean;
|
|
52
30
|
extra?: string;
|
|
53
31
|
size?: string;
|
|
@@ -79,11 +57,11 @@ export declare const WdInputPhone: React.ForwardRefExoticComponent<CommonPropsTy
|
|
|
79
57
|
borderedPc?: boolean;
|
|
80
58
|
rules?: {
|
|
81
59
|
format: string;
|
|
82
|
-
pattern: string;
|
|
83
60
|
message: string;
|
|
61
|
+
pattern: string;
|
|
84
62
|
}[];
|
|
85
63
|
requiredFlag?: boolean;
|
|
86
64
|
requiredMsg?: string;
|
|
87
65
|
isConvert?: boolean;
|
|
88
|
-
}
|
|
66
|
+
} & React.RefAttributes<any>>;
|
|
89
67
|
export type WdInputPhoneProps = CommonPropsType & EventsType & DataType;
|
|
@@ -4,49 +4,27 @@ import type { DataType, EventsType } from '../../../configs/components/wd-input-
|
|
|
4
4
|
/**
|
|
5
5
|
* 标准化:URL输入组件
|
|
6
6
|
*/
|
|
7
|
-
export declare const WdInputUrl: React.ForwardRefExoticComponent<CommonPropsType &
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}>;
|
|
26
|
-
}, {
|
|
27
|
-
name: string;
|
|
28
|
-
title: string;
|
|
29
|
-
detail: import("@sinclair/typebox").TObject<{
|
|
30
|
-
value: import("@sinclair/typebox").TString;
|
|
31
|
-
}>;
|
|
32
|
-
}, {
|
|
33
|
-
name: string;
|
|
34
|
-
title: string;
|
|
35
|
-
detail: import("@sinclair/typebox").TObject<{
|
|
36
|
-
originValue: import("@sinclair/typebox").TString;
|
|
37
|
-
}>;
|
|
38
|
-
}, {
|
|
39
|
-
name: string;
|
|
40
|
-
title: string;
|
|
41
|
-
description: string;
|
|
42
|
-
detail: import("@sinclair/typebox").TObject<{
|
|
43
|
-
type: import("@sinclair/typebox").TString;
|
|
44
|
-
}>;
|
|
45
|
-
}]>> & import("type-fest").Simplify<{
|
|
7
|
+
export declare const WdInputUrl: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
8
|
+
events: {
|
|
9
|
+
[x: string]: ((eventDetail: {
|
|
10
|
+
value: string;
|
|
11
|
+
}, ...args: unknown[]) => unknown) | ((eventDetail: {
|
|
12
|
+
value: string;
|
|
13
|
+
}, ...args: unknown[]) => unknown) | ((eventDetail: {
|
|
14
|
+
value: string;
|
|
15
|
+
}, ...args: unknown[]) => unknown) | ((eventDetail: {
|
|
16
|
+
value: string;
|
|
17
|
+
}, ...args: unknown[]) => unknown) | ((eventDetail: {
|
|
18
|
+
originValue: string;
|
|
19
|
+
}, ...args: unknown[]) => unknown) | ((eventDetail: {
|
|
20
|
+
type: string;
|
|
21
|
+
}, ...args: unknown[]) => unknown);
|
|
22
|
+
};
|
|
23
|
+
} & {
|
|
24
|
+
name?: string;
|
|
46
25
|
label?: string;
|
|
47
26
|
template?: string;
|
|
48
27
|
focus?: boolean;
|
|
49
|
-
name?: string;
|
|
50
28
|
required?: boolean;
|
|
51
29
|
extra?: string;
|
|
52
30
|
size?: string;
|
|
@@ -77,5 +55,5 @@ export declare const WdInputUrl: React.ForwardRefExoticComponent<CommonPropsType
|
|
|
77
55
|
requiredFlag?: boolean;
|
|
78
56
|
requiredMsg?: string;
|
|
79
57
|
isConvert?: boolean;
|
|
80
|
-
}
|
|
58
|
+
} & React.RefAttributes<any>>;
|
|
81
59
|
export type WdInputUrlProps = CommonPropsType & EventsType & DataType;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import WdIcon from '../wd-icon';
|
|
3
|
+
import { useConfig } from '../../utils/config-context';
|
|
4
|
+
import { useSize } from '../../utils/hooks/useFormLegacy';
|
|
5
|
+
import classNames from '../../utils/classnames';
|
|
6
|
+
export const RelationalSetting = ({ refresh, setting, size: _size, enableRelationalSetting, enableRelationalRefresh, }) => {
|
|
7
|
+
const { classPrefix } = useConfig();
|
|
8
|
+
const size = useSize({ size: _size });
|
|
9
|
+
const cls = classNames(`${classPrefix}-form-select-relational-setting--group`, `${classPrefix}-form-input-group`, `${classPrefix}-event-tap`, `size-height-${size}`);
|
|
10
|
+
return (_jsxs("div", { className: `${classPrefix}-form-select-relational-setting--wrap`, children: [enableRelationalRefresh && (_jsx("div", { className: cls, children: _jsx(WdIcon, { events: {
|
|
11
|
+
tap: refresh,
|
|
12
|
+
}, size: 'xs', name: 'td:refresh', type: 'inner' }) })), enableRelationalSetting && (_jsx("div", { className: cls, children: _jsx(WdIcon, { events: {
|
|
13
|
+
tap: setting,
|
|
14
|
+
}, size: 'xs', name: 'td:setting', type: 'inner' }) }))] }));
|
|
15
|
+
};
|
|
@@ -58,6 +58,49 @@
|
|
|
58
58
|
color: var(--wd-color-text-placeholder) !important;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
.wd-form--vertical-left
|
|
62
|
+
.wd-h5-select-root
|
|
63
|
+
.wd-form-select-relational-setting--wrap {
|
|
64
|
+
top: 16px;
|
|
65
|
+
}
|
|
66
|
+
.wd-form-select-relational-setting--wrap {
|
|
67
|
+
display: flex;
|
|
68
|
+
}
|
|
69
|
+
.wd-form.wd-pc-form
|
|
70
|
+
.wd-form-input-group.wd-form-select-relational-setting--group,
|
|
71
|
+
.wd-form-input-group.wd-form-select-relational-setting--group {
|
|
72
|
+
width: auto;
|
|
73
|
+
}
|
|
74
|
+
.wd-form-select-relational-setting--group {
|
|
75
|
+
padding: 0 5px;
|
|
76
|
+
display: flex;
|
|
77
|
+
cursor: pointer;
|
|
78
|
+
margin-left: 2px;
|
|
79
|
+
}
|
|
80
|
+
.wd-form-select-relational-setting--group .wd-link {
|
|
81
|
+
display: flex;
|
|
82
|
+
}
|
|
83
|
+
.wd-select-select
|
|
84
|
+
.wd-form-input-wrap__content
|
|
85
|
+
> .weda-ui-custom-picker__status {
|
|
86
|
+
padding-left: 5px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.wd-add-relation-button-wrap {
|
|
90
|
+
font-size: 14px;
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
margin-right: 20px;
|
|
94
|
+
color: var(--wd-color-brand, #0052d9);
|
|
95
|
+
cursor: pointer;
|
|
96
|
+
}
|
|
97
|
+
.wd-add-relation-button-wrap .wd-icon {
|
|
98
|
+
margin-right: 5px;
|
|
99
|
+
}
|
|
100
|
+
.wd-tag-root {
|
|
101
|
+
cursor: pointer;
|
|
102
|
+
}
|
|
103
|
+
|
|
61
104
|
.wd-pc-select-root .wd-form-item-wrap__control {
|
|
62
105
|
overflow: hidden;
|
|
63
106
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { CommonPropsType } from '../../types';
|
|
3
3
|
import type { DataType } from '../../../configs/components/wd-select';
|
|
4
|
+
import { AttachContainer } from 'tea-component/lib/_util/get-overlay-root';
|
|
4
5
|
import './style';
|
|
5
6
|
/**
|
|
6
7
|
* 下拉单选-标准化
|
|
@@ -12,4 +13,5 @@ export interface WdSelectProps extends CommonPropsType, DataType {
|
|
|
12
13
|
primaryField?: string;
|
|
13
14
|
viewId?: string;
|
|
14
15
|
dataSourceName?: string;
|
|
16
|
+
popupContainer?: AttachContainer;
|
|
15
17
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import React, { forwardRef, useState, useCallback } from 'react';
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { forwardRef, useState, useCallback, useRef } from 'react';
|
|
3
3
|
import { useHandleClear, useFixedIcon, SELECT_ICON_H5, SELECT_ICON_PC, } from '../../utils/hooks/useFormLegacy';
|
|
4
4
|
import { useFormInputTrait } from '../../components/form-input-hooks';
|
|
5
5
|
import { WdFormItem, WdInputGroup, WdInputWrap } from '../wd-form-item';
|
|
6
6
|
import Select from '../form/select';
|
|
7
|
+
import { isFormatWithRelation } from '../form/select/formats-util';
|
|
7
8
|
import { emptyObject } from '../../utils/constant';
|
|
8
9
|
import { RecycleProvider } from '../../utils/hooks/useRecycle';
|
|
9
10
|
import { useSelected } from '../../utils/hooks/use-selected';
|
|
@@ -11,17 +12,19 @@ import { useDebouncedCallback, useSyncedRef } from '@react-hookz/web';
|
|
|
11
12
|
import { useSetWidgetApi } from '../../utils/widget-api/use-set-widget-api';
|
|
12
13
|
import { useDelayEvents } from '../../utils/hooks/use-delay-events';
|
|
13
14
|
import { X_RUNTIME_DEFAULT } from '../../../configs/type-utils/x-runtime-default';
|
|
15
|
+
import { RelationalSetting } from './relationalSetting';
|
|
14
16
|
import './style';
|
|
15
17
|
/**
|
|
16
18
|
* 下拉单选-标准化
|
|
17
19
|
*/
|
|
18
20
|
export const WdSelect = forwardRef(function WsSelect(props, ref) {
|
|
19
|
-
const { classRoot = 'select', clearable = X_RUNTIME_DEFAULT.clearable, placeholder, range, format, tipBlock = X_RUNTIME_DEFAULT.tipBlock, where = X_RUNTIME_DEFAULT.where, enumName, primaryField, viewId, dataSourceName, events = emptyObject, ignoreCase = X_RUNTIME_DEFAULT.ignoreCase, staticSearchable = X_RUNTIME_DEFAULT.staticSearchable, } = props;
|
|
21
|
+
const { classRoot = 'select', clearable = X_RUNTIME_DEFAULT.clearable, placeholder, range, format, tipBlock = X_RUNTIME_DEFAULT.tipBlock, where = X_RUNTIME_DEFAULT.where, enumName, primaryField, viewId, dataSourceName, events = emptyObject, ignoreCase = X_RUNTIME_DEFAULT.ignoreCase, staticSearchable = X_RUNTIME_DEFAULT.staticSearchable, enableRelationalSetting = X_RUNTIME_DEFAULT.enableRelationalSetting, enableRelationalRefresh = X_RUNTIME_DEFAULT.enableRelationalRefresh, addRelationButtonText = X_RUNTIME_DEFAULT.addRelationButtonText, enableAddRelationButton = X_RUNTIME_DEFAULT.enableAddRelationButton, popupContainer, } = props;
|
|
22
|
+
const childRef = useRef(null);
|
|
20
23
|
const [options, setOptions] = useState([]);
|
|
21
24
|
const [innerHandle, setInnerHandle] = useState({});
|
|
22
25
|
const traitProps = { ...props, inputRef: ref, setInnerHandle };
|
|
23
26
|
const trait = useFormInputTrait(traitProps);
|
|
24
|
-
const { value, onChange, disabled, readOnly, visible } = trait;
|
|
27
|
+
const { value, onChange, disabled, readOnly, visible, layout } = trait;
|
|
25
28
|
const [suffixType, suffixIcon] = useFixedIcon({
|
|
26
29
|
type: props.suffixType,
|
|
27
30
|
icon: props.suffixIcon,
|
|
@@ -44,7 +47,20 @@ export const WdSelect = forwardRef(function WsSelect(props, ref) {
|
|
|
44
47
|
disabled,
|
|
45
48
|
value,
|
|
46
49
|
});
|
|
47
|
-
const
|
|
50
|
+
const isRelation = isFormatWithRelation(format);
|
|
51
|
+
const LabelAdornment = isRelation && (_jsx(RelationalSetting, { size: props.size, refresh: () => {
|
|
52
|
+
var _a;
|
|
53
|
+
if (childRef.current) {
|
|
54
|
+
(_a = childRef.current) === null || _a === void 0 ? void 0 : _a.refresh();
|
|
55
|
+
}
|
|
56
|
+
}, setting: events === null || events === void 0 ? void 0 : events.onSettingButtonClick, enableRelationalSetting: !readOnly && !disabled && enableRelationalSetting, enableRelationalRefresh: !readOnly && !disabled && enableRelationalRefresh }));
|
|
57
|
+
const formItemProps = {
|
|
58
|
+
...props,
|
|
59
|
+
...trait,
|
|
60
|
+
classRoot,
|
|
61
|
+
readOnly: false,
|
|
62
|
+
LabelAdornment: layout === 'vertical' && LabelAdornment,
|
|
63
|
+
};
|
|
48
64
|
const inputGroupProps = { ...props, classRoot, readOnly };
|
|
49
65
|
const inputWrapProps = {
|
|
50
66
|
...props,
|
|
@@ -79,5 +95,8 @@ export const WdSelect = forwardRef(function WsSelect(props, ref) {
|
|
|
79
95
|
}, [debouncedTriggerSearchEvent]);
|
|
80
96
|
if (!visible)
|
|
81
97
|
return null;
|
|
82
|
-
return (_jsx(WdFormItem, { ...formItemProps, children: _jsx(WdInputGroup, { ...inputGroupProps, children: _jsx(WdInputWrap, { ...inputWrapProps, children: _jsx(RecycleProvider, { readOnly: readOnly, recycleBack: setOptions,
|
|
98
|
+
return (_jsx(WdFormItem, { ...formItemProps, children: _jsxs(_Fragment, { children: [_jsx(WdInputGroup, { ...inputGroupProps, children: _jsx(WdInputWrap, { ...inputWrapProps, children: _jsx(RecycleProvider, { readOnly: readOnly, recycleBack: setOptions, format: format, portalContainer: popupContainer, onRelationTagClick: (item) => {
|
|
99
|
+
var _a;
|
|
100
|
+
(_a = delayEvents === null || delayEvents === void 0 ? void 0 : delayEvents.onRelationTagClick) === null || _a === void 0 ? void 0 : _a.call(delayEvents, item);
|
|
101
|
+
}, children: _jsx(Select, { addRelationButtonText: addRelationButtonText, enableAddRelationButton: enableAddRelationButton, childRef: childRef, events: delayEvents, labelVisible: false, defaultValue: value, enumName: enumName, format: format, placeholder: placeholder, primaryField: primaryField, range: range, size: "full", tipBlock: tipBlock, viewId: viewId, where: where, dataSourceName: dataSourceName, readOnly: readOnly, disabled: disabled, mode: "selector", decorator: null, ignoreCase: ignoreCase, staticSearchable: staticSearchable, onChange: onChange, onSearchValueInput: onSearchValueInput, popupContainer: popupContainer }) }) }) }), layout === 'horizontal' && LabelAdornment] }) }));
|
|
83
102
|
});
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { CommonPropsType } from '../../types';
|
|
3
3
|
import type { DataType } from '../../../configs/components/wd-select-multiple';
|
|
4
4
|
import './style';
|
|
5
|
+
import { AttachContainer } from 'tea-component/lib/_util/get-overlay-root';
|
|
5
6
|
/**
|
|
6
7
|
* 下拉多选-标准化
|
|
7
8
|
*/
|
|
@@ -12,4 +13,9 @@ export interface WdSelectMultipleProps extends CommonPropsType, DataType {
|
|
|
12
13
|
primaryField?: string;
|
|
13
14
|
viewId?: string;
|
|
14
15
|
dataSourceName?: string;
|
|
16
|
+
enableRelationalSetting?: boolean;
|
|
17
|
+
enableRelationalRefresh?: boolean;
|
|
18
|
+
enableAddRelationButton?: boolean;
|
|
19
|
+
addRelationButtonText?: string;
|
|
20
|
+
popupContainer?: AttachContainer;
|
|
15
21
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import React, { forwardRef, useState, useCallback } from 'react';
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { forwardRef, useState, useCallback, useRef } from 'react';
|
|
3
3
|
import { WdFormItem, WdInputGroup, WdInputWrap } from '../wd-form-item';
|
|
4
4
|
import SelectMultiple from '../form/selectMultiple';
|
|
5
5
|
import { useHandleClear, useFixedIcon, SELECT_ICON_H5, SELECT_ICON_PC, } from '../../utils/hooks/useFormLegacy';
|
|
@@ -12,16 +12,19 @@ import { useDelayEvents } from '../../utils/hooks/use-delay-events';
|
|
|
12
12
|
import { X_RUNTIME_DEFAULT } from '../../../configs/type-utils/x-runtime-default';
|
|
13
13
|
import './style';
|
|
14
14
|
import { useDebouncedCallback, useSyncedRef } from '@react-hookz/web';
|
|
15
|
+
import { isFormatWithRelation } from '../form/select/formats-util';
|
|
16
|
+
import { RelationalSetting } from '../wd-select/relationalSetting';
|
|
15
17
|
/**
|
|
16
18
|
* 下拉多选-标准化
|
|
17
19
|
*/
|
|
18
20
|
export const WdSelectMultiple = forwardRef(function WdSelectMultiple(props, ref) {
|
|
19
|
-
const { classRoot = 'select-multiple', clearable = X_RUNTIME_DEFAULT.clearable, placeholder, range, enumName, format, primaryField, tipBlock = X_RUNTIME_DEFAULT.tipBlock, viewId, dataSourceName, events = emptyObject, ignoreCase = X_RUNTIME_DEFAULT.ignoreCase, staticSearchable = X_RUNTIME_DEFAULT.staticSearchable, where = X_RUNTIME_DEFAULT.where, } = props;
|
|
21
|
+
const { classRoot = 'select-multiple', clearable = X_RUNTIME_DEFAULT.clearable, placeholder, range, enumName, format, primaryField, tipBlock = X_RUNTIME_DEFAULT.tipBlock, viewId, dataSourceName, events = emptyObject, ignoreCase = X_RUNTIME_DEFAULT.ignoreCase, staticSearchable = X_RUNTIME_DEFAULT.staticSearchable, where = X_RUNTIME_DEFAULT.where, enableRelationalSetting = X_RUNTIME_DEFAULT.enableRelationalSetting, enableRelationalRefresh = X_RUNTIME_DEFAULT.enableRelationalRefresh, addRelationButtonText = X_RUNTIME_DEFAULT.addRelationButtonText, enableAddRelationButton = X_RUNTIME_DEFAULT.enableAddRelationButton, popupContainer, } = props;
|
|
22
|
+
const childRef = useRef(null);
|
|
20
23
|
const [options, setOptions] = useState([]);
|
|
21
24
|
const [innerHandle, setInnerHandle] = useState({});
|
|
22
25
|
const traitProps = { ...props, inputRef: ref, setInnerHandle };
|
|
23
26
|
const trait = useFormInputTrait(traitProps);
|
|
24
|
-
const { value, onChange, disabled, readOnly, visible } = trait;
|
|
27
|
+
const { value, onChange, disabled, readOnly, visible, layout } = trait;
|
|
25
28
|
const [suffixType, suffixIcon] = useFixedIcon({
|
|
26
29
|
type: props.suffixType,
|
|
27
30
|
icon: props.suffixIcon,
|
|
@@ -45,7 +48,20 @@ export const WdSelectMultiple = forwardRef(function WdSelectMultiple(props, ref)
|
|
|
45
48
|
disabled,
|
|
46
49
|
value,
|
|
47
50
|
});
|
|
48
|
-
const
|
|
51
|
+
const isRelation = isFormatWithRelation(format);
|
|
52
|
+
const LabelAdornment = isRelation && (_jsx(RelationalSetting, { size: props.size, refresh: () => {
|
|
53
|
+
var _a;
|
|
54
|
+
if (childRef.current) {
|
|
55
|
+
(_a = childRef.current) === null || _a === void 0 ? void 0 : _a.refresh();
|
|
56
|
+
}
|
|
57
|
+
}, setting: events === null || events === void 0 ? void 0 : events.onSettingButtonClick, enableRelationalSetting: !readOnly && !disabled && enableRelationalSetting, enableRelationalRefresh: !readOnly && !disabled && enableRelationalRefresh }));
|
|
58
|
+
const formItemProps = {
|
|
59
|
+
...props,
|
|
60
|
+
...trait,
|
|
61
|
+
classRoot,
|
|
62
|
+
readOnly: false,
|
|
63
|
+
LabelAdornment: layout === 'vertical' && LabelAdornment,
|
|
64
|
+
};
|
|
49
65
|
const inputGroupProps = { ...props, classRoot, readOnly };
|
|
50
66
|
const inputWrapProps = {
|
|
51
67
|
...props,
|
|
@@ -74,5 +90,8 @@ export const WdSelectMultiple = forwardRef(function WdSelectMultiple(props, ref)
|
|
|
74
90
|
}, [debouncedTriggerSearchEvent]);
|
|
75
91
|
if (!visible)
|
|
76
92
|
return null;
|
|
77
|
-
return (_jsx(WdFormItem, { ...formItemProps, children: _jsx(WdInputGroup, { ...inputGroupProps, children: _jsx(WdInputWrap, { ...inputWrapProps, children: _jsx(RecycleProvider, { readOnly: readOnly, recycleBack: setOptions,
|
|
93
|
+
return (_jsx(WdFormItem, { ...formItemProps, children: _jsxs(_Fragment, { children: [_jsx(WdInputGroup, { ...inputGroupProps, children: _jsx(WdInputWrap, { ...inputWrapProps, children: _jsx(RecycleProvider, { readOnly: readOnly, recycleBack: setOptions, format: format, portalContainer: popupContainer, onRelationTagClick: (item) => {
|
|
94
|
+
var _a;
|
|
95
|
+
(_a = delayEvents === null || delayEvents === void 0 ? void 0 : delayEvents.onRelationTagClick) === null || _a === void 0 ? void 0 : _a.call(delayEvents, item);
|
|
96
|
+
}, children: _jsx(SelectMultiple, { addRelationButtonText: addRelationButtonText, enableAddRelationButton: enableAddRelationButton, childRef: childRef, events: delayEvents, labelVisible: false, defaultValue: value, enumName: enumName, format: format, placeholder: placeholder, primaryField: primaryField, range: range, size: "full", tipBlock: tipBlock, viewId: viewId, dataSourceName: dataSourceName, readOnly: readOnly, disabled: disabled, mode: "selector", decorator: null, ignoreCase: ignoreCase, staticSearchable: staticSearchable, where: where, onChange: onChange, onSearchValueInput: onSearchValueInput, popupContainer: popupContainer }) }) }) }), layout === 'horizontal' && LabelAdornment] }) }));
|
|
78
97
|
});
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Select, Icon } from 'tea-component';
|
|
3
3
|
import { useEnumContext } from '../../../../../utils/hooks/context';
|
|
4
|
+
import { errorHandler } from '../../../../../utils/error';
|
|
5
|
+
import { WdTag } from '../../../../wd-tag';
|
|
4
6
|
// 枚举输入组件
|
|
5
7
|
export const EnumSelect = (props) => {
|
|
6
8
|
const { field, onChange } = props;
|
|
@@ -35,15 +37,27 @@ export const formatEnum = (value, field, enumOptions) => {
|
|
|
35
37
|
const optionName = field['x-option-name'];
|
|
36
38
|
const isMulti = field['x-multi-select'];
|
|
37
39
|
const options = (enumOptions === null || enumOptions === void 0 ? void 0 : enumOptions[optionName]) || [];
|
|
40
|
+
let val = '-';
|
|
38
41
|
const getTextByValue = (value) => { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.find((item) => (item === null || item === void 0 ? void 0 : item.value) === value)) === null || _a === void 0 ? void 0 : _a.text) || value; };
|
|
39
42
|
if (isMulti) {
|
|
40
|
-
|
|
43
|
+
val = (_a = []
|
|
41
44
|
.concat(value)
|
|
42
|
-
.map((v) => getTextByValue(v))) === null || _a === void 0 ? void 0 : _a.join();
|
|
45
|
+
.map((v) => getTextByValue(v))) === null || _a === void 0 ? void 0 : _a.join(',');
|
|
43
46
|
}
|
|
44
|
-
|
|
47
|
+
else {
|
|
48
|
+
val = getTextByValue(value);
|
|
49
|
+
}
|
|
50
|
+
return (_jsx(WdTag, { range: val === null || val === void 0 ? void 0 : val.split(',').map((i) => ({
|
|
51
|
+
label: i,
|
|
52
|
+
value: i,
|
|
53
|
+
})), tagStyleType: 'light', tagStyleWidthCols: 4 }));
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
errorHandler({
|
|
57
|
+
code: 'FormatEnumError',
|
|
58
|
+
error,
|
|
59
|
+
});
|
|
45
60
|
}
|
|
46
|
-
catch (e) { }
|
|
47
61
|
return value;
|
|
48
62
|
};
|
|
49
63
|
// 枚举值展示组件
|
|
@@ -6,6 +6,7 @@ import { Modal, Table, Form, ConfigProvider } from 'tea-component';
|
|
|
6
6
|
import { formatTimeByType } from '../../../../utils/date';
|
|
7
7
|
import { safeJsonParse, isValueEmpty, isObj } from '../../../../utils/tool';
|
|
8
8
|
import Location, { locationProperties } from './Form/Location';
|
|
9
|
+
import { WdTag } from '../../../wd-tag';
|
|
9
10
|
import { EnumView, formatEnum } from './Form/Enum';
|
|
10
11
|
import { ErrorBoundary } from 'react-error-boundary';
|
|
11
12
|
import RichTextView from '../../../richTextView';
|
|
@@ -16,6 +17,7 @@ import { TABLE_SLOT_PREFIX } from '../../../../utils/constant';
|
|
|
16
17
|
import { getPrimaryField } from '../../../../utils/datasource';
|
|
17
18
|
import { useConfig } from '../../../../utils/config-context';
|
|
18
19
|
import { EnumHoc } from '../../../../utils/hooks/EnumHoc';
|
|
20
|
+
import { errorHandler } from '../../../../utils/error';
|
|
19
21
|
import { ImagePreview } from './ImagePreview';
|
|
20
22
|
import { VideoPreview } from './VideoPreview';
|
|
21
23
|
import { ModalTable } from '../ModalTable';
|
|
@@ -134,9 +136,20 @@ export function getFieldRender(field = {}, extra = {}) {
|
|
|
134
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']) || '';
|
|
135
137
|
const relatedField = (_c = extra === null || extra === void 0 ? void 0 : extra.columnSet) === null || _c === void 0 ? void 0 : _c.relatedField;
|
|
136
138
|
if (typeof fieldValue === 'string') {
|
|
137
|
-
return _jsx(
|
|
139
|
+
return (_jsx(WdTag, { range: fieldValue === null || fieldValue === void 0 ? void 0 : fieldValue.split(',').map((i) => ({
|
|
140
|
+
label: i,
|
|
141
|
+
value: i,
|
|
142
|
+
prefixType: 'inner',
|
|
143
|
+
prefixIcon: 'td:link-1',
|
|
144
|
+
})), tagStyleType: 'light', tagStyleWidthCols: 4 }));
|
|
138
145
|
}
|
|
139
|
-
|
|
146
|
+
const val = fieldValue[relatedField] || fieldValue[primaryField];
|
|
147
|
+
return val ? (_jsx(WdTag, { range: val === null || val === void 0 ? void 0 : val.split(',').map((i) => ({
|
|
148
|
+
label: i,
|
|
149
|
+
value: i,
|
|
150
|
+
prefixType: 'inner',
|
|
151
|
+
prefixIcon: 'td:link-1',
|
|
152
|
+
})), tagStyleType: 'light', tagStyleWidthCols: 4 })) : ('-');
|
|
140
153
|
}
|
|
141
154
|
else if (format === 'x-video' || format === 'x-music') {
|
|
142
155
|
// 视频/音频
|
|
@@ -180,7 +193,13 @@ export function getFieldRender(field = {}, extra = {}) {
|
|
|
180
193
|
format === 'one-one-r') {
|
|
181
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']) || '';
|
|
182
195
|
const relatedField = (_f = extra === null || extra === void 0 ? void 0 : extra.columnSet) === null || _f === void 0 ? void 0 : _f.relatedField;
|
|
183
|
-
|
|
196
|
+
const _readValue = fieldValue[relatedField] || fieldValue[primaryField];
|
|
197
|
+
return (_jsx(WdTag, { range: _readValue === null || _readValue === void 0 ? void 0 : _readValue.split(',').map((i) => ({
|
|
198
|
+
label: i,
|
|
199
|
+
value: i,
|
|
200
|
+
prefixType: 'inner',
|
|
201
|
+
prefixIcon: 'td:link-1',
|
|
202
|
+
})), tagStyleType: 'light', tagStyleWidthCols: 4 }));
|
|
184
203
|
}
|
|
185
204
|
else {
|
|
186
205
|
return (_jsx(QuoteModal, { className: "e-object-view-modal", caption: title, size: MODAL_SIZE, text: detailText, children: objectRender({
|
|
@@ -336,7 +355,12 @@ export const formatNumber = (value, field) => {
|
|
|
336
355
|
newValue = formatNumberFix(value, field, true);
|
|
337
356
|
}
|
|
338
357
|
}
|
|
339
|
-
catch (
|
|
358
|
+
catch (error) {
|
|
359
|
+
errorHandler({
|
|
360
|
+
code: 'FormatNumberError',
|
|
361
|
+
error,
|
|
362
|
+
});
|
|
363
|
+
}
|
|
340
364
|
return newValue;
|
|
341
365
|
};
|
|
342
366
|
/**
|
|
@@ -821,7 +845,12 @@ const getCustomField = (_field, columnSet) => {
|
|
|
821
845
|
}
|
|
822
846
|
return { ..._field, ...customField };
|
|
823
847
|
}
|
|
824
|
-
catch (
|
|
848
|
+
catch (error) {
|
|
849
|
+
errorHandler({
|
|
850
|
+
code: 'GetCustomFieldError',
|
|
851
|
+
error,
|
|
852
|
+
});
|
|
853
|
+
}
|
|
825
854
|
return _field;
|
|
826
855
|
};
|
|
827
856
|
/**
|
|
@@ -2,6 +2,7 @@ import { getDataSourceFieldsWithAuth } from '../../../utils/datasource';
|
|
|
2
2
|
import { TABLE_SLOT_PREFIX, GLOBAL_BUTTON, REL_DICT, } from '../../../utils/constant';
|
|
3
3
|
import { callWedaApi, appCloudGetWedaUserId, getIsExitApi, } from '../../../utils/tcb';
|
|
4
4
|
import { isObj, deepClone } from '../../../utils/tool';
|
|
5
|
+
import { errorHandler } from '../../../utils/error';
|
|
5
6
|
// 新接口没有返回关联表的主列字段,从旧接口中查询出来
|
|
6
7
|
const getPrimaryColumn = (fields, dataViewPropertiesList, selectedView) => {
|
|
7
8
|
var _a, _b;
|
|
@@ -81,7 +82,10 @@ export const whereList = (whereProxy) => {
|
|
|
81
82
|
return [];
|
|
82
83
|
}
|
|
83
84
|
catch (error) {
|
|
84
|
-
|
|
85
|
+
errorHandler({
|
|
86
|
+
code: 'GetWhereListError',
|
|
87
|
+
error,
|
|
88
|
+
});
|
|
85
89
|
return [];
|
|
86
90
|
}
|
|
87
91
|
};
|
|
@@ -396,8 +400,11 @@ export const getViews = async (dbName, selectedView) => {
|
|
|
396
400
|
};
|
|
397
401
|
}
|
|
398
402
|
}
|
|
399
|
-
catch (
|
|
400
|
-
|
|
403
|
+
catch (error) {
|
|
404
|
+
errorHandler({
|
|
405
|
+
code: 'GetViewsError',
|
|
406
|
+
error,
|
|
407
|
+
});
|
|
401
408
|
}
|
|
402
409
|
};
|
|
403
410
|
// 获取选中的筛选字段
|
|
@@ -441,6 +448,10 @@ export const getFilterFields = (filterFields, authFields) => {
|
|
|
441
448
|
}
|
|
442
449
|
}
|
|
443
450
|
catch (error) {
|
|
451
|
+
errorHandler({
|
|
452
|
+
code: 'GetFilterFieldsError',
|
|
453
|
+
error,
|
|
454
|
+
});
|
|
444
455
|
result = [];
|
|
445
456
|
}
|
|
446
457
|
result = result.filter((i) => !!i);
|
|
@@ -496,7 +507,10 @@ export const mapTableDataWithView = (viewFieldsData, records) => {
|
|
|
496
507
|
return records;
|
|
497
508
|
}
|
|
498
509
|
catch (error) {
|
|
499
|
-
|
|
510
|
+
errorHandler({
|
|
511
|
+
code: 'MapTableDataWithViewError',
|
|
512
|
+
error,
|
|
513
|
+
});
|
|
500
514
|
return records;
|
|
501
515
|
}
|
|
502
516
|
};
|
|
@@ -4,6 +4,7 @@ import { useConfig } from '../../utils/config-context';
|
|
|
4
4
|
import { usePlatform } from '../../utils/platform';
|
|
5
5
|
import WdIcon from '../wd-icon';
|
|
6
6
|
import { useSyncedRef } from '@react-hookz/web';
|
|
7
|
+
import { renderSlot } from './util';
|
|
7
8
|
export const WdTabsH5 = ({ isMultipleSlot, tabsDatas, selectedIndex, ...restProps }) => {
|
|
8
9
|
const { classPrefix } = useConfig();
|
|
9
10
|
const $node = useSyncedRef(restProps.$node);
|
|
@@ -96,7 +97,5 @@ export const WdTabsH5 = ({ isMultipleSlot, tabsDatas, selectedIndex, ...restProp
|
|
|
96
97
|
var _a;
|
|
97
98
|
//滚动条高度
|
|
98
99
|
setItemOffset((_a = event === null || event === void 0 ? void 0 : event.currentTarget) === null || _a === void 0 ? void 0 : _a.scrollLeft);
|
|
99
|
-
}, children: tabsDatas === null || tabsDatas === void 0 ? void 0 : tabsDatas.map((item, index) => RenderTabItem(index, item)) }), showMask && restProps.direction !== 'vertical' && (_jsx("div", { className: `${classPrefix}-tabs__header-item-mask` }))] }) }), _jsx("div", { className: `${classPrefix}-tabs__body`, children: _jsx("div", { className: `${classPrefix}-tabs__body-content`, children: isMultipleSlot
|
|
100
|
-
? restProps[`panel${selectedTab + Number('1')}`]
|
|
101
|
-
: restProps[`panel1`] }) })] }));
|
|
100
|
+
}, children: tabsDatas === null || tabsDatas === void 0 ? void 0 : tabsDatas.map((item, index) => RenderTabItem(index, item)) }), showMask && restProps.direction !== 'vertical' && (_jsx("div", { className: `${classPrefix}-tabs__header-item-mask` }))] }) }), _jsx("div", { className: `${classPrefix}-tabs__body`, children: _jsx("div", { className: `${classPrefix}-tabs__body-content`, children: renderSlot({ ...restProps, selectedTab, tabsDatas, isMultipleSlot }) }) })] }));
|
|
102
101
|
};
|
|
@@ -4,6 +4,7 @@ import { useConfig } from '../../utils/config-context';
|
|
|
4
4
|
import { usePlatform } from '../../utils/platform';
|
|
5
5
|
import WdIcon from '../wd-icon';
|
|
6
6
|
import { useSyncedRef } from '@react-hookz/web';
|
|
7
|
+
import { renderSlot } from './util';
|
|
7
8
|
export const WdTabsPc = ({ isMultipleSlot, tabsDatas, selectedIndex, ...restProps }) => {
|
|
8
9
|
const { classPrefix } = useConfig();
|
|
9
10
|
const $node = useSyncedRef(restProps.$node);
|
|
@@ -115,7 +116,5 @@ export const WdTabsPc = ({ isMultipleSlot, tabsDatas, selectedIndex, ...restProp
|
|
|
115
116
|
index: position.index + Number('1'),
|
|
116
117
|
offset: result,
|
|
117
118
|
});
|
|
118
|
-
} }))] }), _jsx("div", { className: `${classPrefix}-tabs__body`, children: _jsx("div", { className: `${classPrefix}-tabs__body-content`, children: isMultipleSlot
|
|
119
|
-
? restProps[`panel${selectedTab + Number('1')}`]
|
|
120
|
-
: restProps[`panel1`] }) })] }));
|
|
119
|
+
} }))] }), _jsx("div", { className: `${classPrefix}-tabs__body`, children: _jsx("div", { className: `${classPrefix}-tabs__body-content`, children: renderSlot({ ...restProps, selectedTab, tabsDatas, isMultipleSlot }) }) })] }));
|
|
121
120
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const renderSlot: (props: any) => any;
|