@cloudbase/weda-ui 3.9.8 → 3.10.1

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.
Files changed (218) hide show
  1. package/dist/configs/components/dataView.d.ts +31 -0
  2. package/dist/configs/components/dataView.js +53 -16
  3. package/dist/configs/components/grid/col.d.ts +1 -1
  4. package/dist/configs/components/grid/col.js +1 -1
  5. package/dist/configs/components/grid/grid.d.ts +1 -1
  6. package/dist/configs/components/grid/grid.js +1 -1
  7. package/dist/configs/components/grid/row.d.ts +1 -1
  8. package/dist/configs/components/grid/row.js +1 -1
  9. package/dist/configs/components/listView.d.ts +148 -444
  10. package/dist/configs/components/listView.js +991 -703
  11. package/dist/configs/components/wd-bubble.d.ts +6 -6
  12. package/dist/configs/components/wd-cascader.d.ts +1 -1
  13. package/dist/configs/components/wd-checkbox.d.ts +1 -1
  14. package/dist/configs/components/wd-code-editor.d.ts +1 -1
  15. package/dist/configs/components/wd-date-range.d.ts +1 -1
  16. package/dist/configs/components/wd-date.d.ts +1 -1
  17. package/dist/configs/components/wd-department.d.ts +1 -1
  18. package/dist/configs/components/wd-form-arr.d.ts +1 -1
  19. package/dist/configs/components/wd-form-detail.d.ts +1 -1
  20. package/dist/configs/components/wd-form-obj.d.ts +1 -1
  21. package/dist/configs/components/wd-form.js +2 -1
  22. package/dist/configs/components/wd-input-email.d.ts +4 -3
  23. package/dist/configs/components/wd-input-number.d.ts +2 -2
  24. package/dist/configs/components/wd-input-phone.d.ts +4 -3
  25. package/dist/configs/components/wd-input-url.d.ts +4 -3
  26. package/dist/configs/components/wd-input.d.ts +3 -1
  27. package/dist/configs/components/wd-layout.d.ts +4 -0
  28. package/dist/configs/components/wd-layout.js +12 -0
  29. package/dist/configs/components/wd-location.d.ts +1 -1
  30. package/dist/configs/components/wd-member.d.ts +1 -1
  31. package/dist/configs/components/wd-menu-layout.d.ts +3 -0
  32. package/dist/configs/components/wd-menu-layout.js +6 -0
  33. package/dist/configs/components/wd-menu-list.d.ts +2 -0
  34. package/dist/configs/components/wd-menu-list.js +6 -0
  35. package/dist/configs/components/wd-modal.js +2 -0
  36. package/dist/configs/components/wd-progress.d.ts +2 -2
  37. package/dist/configs/components/wd-radio.d.ts +1 -1
  38. package/dist/configs/components/wd-rating.d.ts +2 -2
  39. package/dist/configs/components/wd-region.d.ts +1 -1
  40. package/dist/configs/components/wd-rich-text.d.ts +1 -1
  41. package/dist/configs/components/wd-select-multiple.d.ts +18 -1
  42. package/dist/configs/components/wd-select-multiple.js +17 -1
  43. package/dist/configs/components/wd-select.d.ts +18 -1
  44. package/dist/configs/components/wd-select.js +16 -0
  45. package/dist/configs/components/wd-side-tab.d.ts +12 -0
  46. package/dist/configs/components/wd-side-tab.js +47 -3
  47. package/dist/configs/components/wd-switch.d.ts +2 -2
  48. package/dist/configs/components/wd-table.d.ts +4 -4
  49. package/dist/configs/components/wd-table.js +2 -1
  50. package/dist/configs/components/wd-tag-select.d.ts +3 -3
  51. package/dist/configs/components/wd-tag.d.ts +21 -21
  52. package/dist/configs/components/wd-textarea.d.ts +8 -1
  53. package/dist/configs/components/wd-textarea.js +1 -0
  54. package/dist/configs/components/wd-time.d.ts +1 -1
  55. package/dist/configs/components/wd-top-tab.d.ts +12 -0
  56. package/dist/configs/components/wd-top-tab.js +47 -3
  57. package/dist/configs/components/wd-upload-file.d.ts +5 -1
  58. package/dist/configs/components/wd-upload-file.js +15 -0
  59. package/dist/configs/components/wd-upload-image.d.ts +1 -1
  60. package/dist/configs/index.d.ts +891 -1407
  61. package/dist/configs/type-utils/index.d.ts +1 -1
  62. package/dist/configs/type-utils/type-form.d.ts +29 -14
  63. package/dist/configs/type-utils/type-form.js +43 -10
  64. package/dist/configs/type-utils/x-runtime-default.d.ts +6 -0
  65. package/dist/configs/type-utils/x-runtime-default.js +6 -0
  66. package/dist/configs/utils/constants.d.ts +2 -0
  67. package/dist/configs/utils/constants.js +3 -0
  68. package/dist/configs/utils/get-combinations.d.ts +1 -0
  69. package/dist/configs/utils/get-combinations.js +13 -0
  70. package/dist/style/index.css +10478 -0
  71. package/dist/style/index.scss +1 -1
  72. package/dist/style/weda-ui.min.css +4 -0
  73. package/dist/web/actions/showMessage/index.js +5 -0
  74. package/dist/web/components/carousel/index.js +5 -0
  75. package/dist/web/components/chart/common/core/eChartBase.js +5 -0
  76. package/dist/web/components/chart/statisticsCard/index.js +6 -1
  77. package/dist/web/components/flow/process/constants.d.ts +10 -5
  78. package/dist/web/components/flow/process/constants.js +3 -2
  79. package/dist/web/components/flow/process/process.js +1 -1
  80. package/dist/web/components/form/form/index.js +9 -1
  81. package/dist/web/components/form/location/common/mapChoose.js +17 -3
  82. package/dist/web/components/form/location/common/mapView.js +18 -5
  83. package/dist/web/components/form/select/dropdown-select/h5.d.ts +3 -1
  84. package/dist/web/components/form/select/dropdown-select/h5.js +20 -20
  85. package/dist/web/components/form/select/dropdown-select/index.css +8 -0
  86. package/dist/web/components/form/select/dropdown-select/index.d.ts +6 -1
  87. package/dist/web/components/form/select/dropdown-select/index.js +64 -30
  88. package/dist/web/components/form/select/dropdown-select/pc.d.ts +2 -1
  89. package/dist/web/components/form/select/dropdown-select/pc.js +3 -3
  90. package/dist/web/components/form/select/dropdown-select/ui.d.ts +5 -0
  91. package/dist/web/components/form/select/dropdown-select/ui.js +8 -4
  92. package/dist/web/components/form/select/formats-util.d.ts +1 -0
  93. package/dist/web/components/form/select/formats-util.js +8 -0
  94. package/dist/web/components/form/select/h5.d.ts +1 -1
  95. package/dist/web/components/form/select/h5.js +6 -3
  96. package/dist/web/components/form/select/index.css +34 -3
  97. package/dist/web/components/form/select/index.d.ts +3 -0
  98. package/dist/web/components/form/select/index.js +6 -3
  99. package/dist/web/components/form/select/region/index.js +5 -1
  100. package/dist/web/components/form/select/request.js +2 -1
  101. package/dist/web/components/form/select/status/index.d.ts +2 -0
  102. package/dist/web/components/form/select/status/index.js +2 -0
  103. package/dist/web/components/form/selectMultiple/dropdown-select/h5.d.ts +3 -1
  104. package/dist/web/components/form/selectMultiple/dropdown-select/h5.js +31 -31
  105. package/dist/web/components/form/selectMultiple/dropdown-select/index.css +23 -0
  106. package/dist/web/components/form/selectMultiple/dropdown-select/index.d.ts +6 -1
  107. package/dist/web/components/form/selectMultiple/dropdown-select/index.js +58 -24
  108. package/dist/web/components/form/selectMultiple/dropdown-select/pc.d.ts +2 -1
  109. package/dist/web/components/form/selectMultiple/dropdown-select/pc.js +2 -2
  110. package/dist/web/components/form/selectMultiple/dropdown-select/ui.d.ts +5 -0
  111. package/dist/web/components/form/selectMultiple/dropdown-select/ui.js +7 -5
  112. package/dist/web/components/form/selectMultiple/h5.d.ts +1 -1
  113. package/dist/web/components/form/selectMultiple/h5.js +6 -3
  114. package/dist/web/components/form/selectMultiple/index.d.ts +5 -0
  115. package/dist/web/components/form/selectMultiple/index.js +7 -4
  116. package/dist/web/components/form/selectMultiple/request.js +2 -1
  117. package/dist/web/components/form/selectMultiple/status/index.d.ts +2 -0
  118. package/dist/web/components/form/selectMultiple/status/index.js +2 -0
  119. package/dist/web/components/form/uploader/index.css +26 -0
  120. package/dist/web/components/form/uploader/uploader.h5.d.ts +11 -3
  121. package/dist/web/components/form/uploader/uploader.h5.js +32 -96
  122. package/dist/web/components/form/uploader/uploader.pc.d.ts +9 -0
  123. package/dist/web/components/form/uploader/uploader.pc.js +38 -102
  124. package/dist/web/components/form/uploader/useUploadFile.d.ts +16 -0
  125. package/dist/web/components/form/uploader/useUploadFile.js +99 -0
  126. package/dist/web/components/form/uploader/util.d.ts +2 -0
  127. package/dist/web/components/form/uploader/util.js +87 -0
  128. package/dist/web/components/form/uploaderFile/uploadFile.h5.d.ts +2 -1
  129. package/dist/web/components/form/uploaderFile/uploadFile.h5.js +14 -4
  130. package/dist/web/components/form/uploaderFile/uploadFile.pc.d.ts +2 -1
  131. package/dist/web/components/form/uploaderFile/uploadFile.pc.js +21 -5
  132. package/dist/web/components/form/userOrgSelect/component/user-select-pc/user-model.js +5 -0
  133. package/dist/web/components/form/userOrgSelect/component/userOrgSelect.css +8 -0
  134. package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +6 -0
  135. package/dist/web/components/form-date/index.d.ts +9 -10
  136. package/dist/web/components/form-depart-tree-select/index.d.ts +8 -8
  137. package/dist/web/components/form-email/index.d.ts +12 -19
  138. package/dist/web/components/form-image-uploader/index.d.ts +10 -13
  139. package/dist/web/components/form-input/index.d.ts +4 -4
  140. package/dist/web/components/form-input-hooks/index.js +7 -1
  141. package/dist/web/components/form-location/index.d.ts +8 -7
  142. package/dist/web/components/form-multi-region/index.d.ts +9 -10
  143. package/dist/web/components/form-phone/index.d.ts +12 -19
  144. package/dist/web/components/form-radio/index.d.ts +7 -6
  145. package/dist/web/components/form-region/index.d.ts +9 -10
  146. package/dist/web/components/form-rich-text/index.d.ts +8 -9
  147. package/dist/web/components/form-select/index.d.ts +12 -16
  148. package/dist/web/components/form-select-multiple/index.d.ts +9 -10
  149. package/dist/web/components/form-switch/index.d.ts +8 -7
  150. package/dist/web/components/form-text-area/index.d.ts +12 -19
  151. package/dist/web/components/form-time/index.d.ts +9 -10
  152. package/dist/web/components/form-upload-file/index.d.ts +10 -13
  153. package/dist/web/components/form-url/index.d.ts +12 -19
  154. package/dist/web/components/form-user-tree-select/index.d.ts +8 -8
  155. package/dist/web/components/grid/col.d.ts +6 -9
  156. package/dist/web/components/grid/grid.d.ts +6 -14
  157. package/dist/web/components/grid/row.d.ts +6 -12
  158. package/dist/web/components/listView/index.d.ts +21 -2
  159. package/dist/web/components/listView/index.js +0 -3
  160. package/dist/web/components/listView/interface.d.ts +4 -4
  161. package/dist/web/components/lottery/index.d.ts +13 -15
  162. package/dist/web/components/navigationBar/index.css +2 -1
  163. package/dist/web/components/richText/index.js +6 -0
  164. package/dist/web/components/richTextView/useImgTransform.js +6 -1
  165. package/dist/web/components/table/ImportFileModalByApi/index.js +6 -1
  166. package/dist/web/components/table/ImportFileModalByApi/uploadCSVFile.js +6 -1
  167. package/dist/web/components/wd-audio/wd-audio.js +5 -0
  168. package/dist/web/components/wd-canvas/wd-canvas.js +6 -1
  169. package/dist/web/components/wd-code-editor/wd-code-editor.js +7 -2
  170. package/dist/web/components/wd-date/elements/WheelPicker.js +7 -1
  171. package/dist/web/components/wd-form/index.d.ts +26 -40
  172. package/dist/web/components/wd-form/index.js +9 -2
  173. package/dist/web/components/wd-form-item/wd-form-item-read-only.d.ts +2 -0
  174. package/dist/web/components/wd-form-item/wd-form-item-read-only.js +15 -2
  175. package/dist/web/components/wd-form-item/wd-form-item.js +4 -3
  176. package/dist/web/components/wd-input/wd-input.d.ts +20 -42
  177. package/dist/web/components/wd-input-email/wd-input-email.d.ts +19 -41
  178. package/dist/web/components/wd-input-phone/wd-input-phone.d.ts +20 -42
  179. package/dist/web/components/wd-input-url/wd-input-url.d.ts +19 -41
  180. package/dist/web/components/wd-layout/wd-layout.d.ts +1 -1
  181. package/dist/web/components/wd-layout/wd-layout.js +2 -2
  182. package/dist/web/components/wd-markdown/wd-markdown.js +1 -1
  183. package/dist/web/components/wd-menu-layout/components/PlantMenu.js +1 -1
  184. package/dist/web/components/wd-menu-list/CommonMenuList.js +7 -1
  185. package/dist/web/components/wd-menu-list/HorizontalMenuList.js +7 -1
  186. package/dist/web/components/wd-select/relationalSetting.d.ts +7 -0
  187. package/dist/web/components/wd-select/relationalSetting.js +15 -0
  188. package/dist/web/components/wd-select/wd-select.css +43 -0
  189. package/dist/web/components/wd-select/wd-select.d.ts +2 -0
  190. package/dist/web/components/wd-select/wd-select.js +25 -6
  191. package/dist/web/components/wd-select-multiple/wd-select-multiple.css +4 -0
  192. package/dist/web/components/wd-select-multiple/wd-select-multiple.d.ts +6 -0
  193. package/dist/web/components/wd-select-multiple/wd-select-multiple.js +25 -6
  194. package/dist/web/components/wd-table/components/FieldRender/Form/Enum.js +18 -4
  195. package/dist/web/components/wd-table/components/FieldRender/index.js +34 -5
  196. package/dist/web/components/wd-table/utils/index.js +18 -4
  197. package/dist/web/components/wd-tabs/tabs-h5.js +2 -3
  198. package/dist/web/components/wd-tabs/tabs-pc.js +2 -3
  199. package/dist/web/components/wd-tabs/util.d.ts +1 -0
  200. package/dist/web/components/wd-tabs/util.js +21 -0
  201. package/dist/web/components/wd-textarea/wd-textarea.js +11 -1
  202. package/dist/web/components/wd-unified-link/utils.js +1 -1
  203. package/dist/web/components/wd-upload-file/wd-upload-file.js +2 -2
  204. package/dist/web/components/web-view/web-view.d.ts +14 -20
  205. package/dist/web/utils/color.js +5 -0
  206. package/dist/web/utils/datasource.js +30 -20
  207. package/dist/web/utils/error.d.ts +3 -1
  208. package/dist/web/utils/error.js +9 -4
  209. package/dist/web/utils/file.js +4 -1
  210. package/dist/web/utils/getModelParams.js +27 -2
  211. package/dist/web/utils/hooks/EnumHoc.js +3 -1
  212. package/dist/web/utils/hooks/useRecycle.d.ts +4 -0
  213. package/dist/web/utils/loadIconCss.js +2 -1
  214. package/dist/web/utils/moment.js +2 -1
  215. package/dist/web/utils/platform.js +5 -2
  216. package/dist/web/utils/tcb.js +5 -3
  217. package/dist/web/weda-ui.css +8 -4
  218. 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 & import("type-fest").Simplify<import("../../../configs/type-utils").StaticEventsType<[{
8
- name: string;
9
- title: string;
10
- detail: import("@sinclair/typebox").TObject<{
11
- value: import("@sinclair/typebox").TString;
12
- }>;
13
- description: string;
14
- }, {
15
- name: string;
16
- title: string;
17
- detail: import("@sinclair/typebox").TObject<{
18
- value: import("@sinclair/typebox").TString;
19
- }>;
20
- }, {
21
- name: string;
22
- title: string;
23
- detail: import("@sinclair/typebox").TObject<{
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
- }> & React.RefAttributes<any>>;
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 & import("type-fest").Simplify<import("../../../configs/type-utils").StaticEventsType<[{
8
- name: string;
9
- title: string;
10
- detail: import("@sinclair/typebox").TObject<{
11
- value: import("@sinclair/typebox").TString;
12
- }>;
13
- description: string;
14
- }, {
15
- name: string;
16
- title: string;
17
- detail: import("@sinclair/typebox").TObject<{
18
- value: import("@sinclair/typebox").TString;
19
- }>;
20
- }, {
21
- name: string;
22
- title: string;
23
- detail: import("@sinclair/typebox").TObject<{
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 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
- }> & React.RefAttributes<any>>;
58
+ } & React.RefAttributes<any>>;
81
59
  export type WdInputUrlProps = CommonPropsType & EventsType & DataType;
@@ -3,4 +3,4 @@ import type { DataType } from '../../../configs/components/wd-layout';
3
3
  import './style';
4
4
  export interface WdLayoutProps extends CommonPropsType, DataType {
5
5
  }
6
- export declare const WdLayout: ({ headerLeftSlot, headerRightSlot, contentSlot, style, template, className, }: WdLayoutProps) => JSX.Element;
6
+ export declare const WdLayout: ({ headerLeftSlot, headerRightSlot, contentSlot, style, template, className, enableHeaderSlot, enableContentSlot, }: WdLayoutProps) => JSX.Element;
@@ -2,10 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useConfig } from '../../utils/config-context';
3
3
  import { usePlatform } from '../../utils/platform';
4
4
  import './style';
5
- export const WdLayout = ({ headerLeftSlot, headerRightSlot, contentSlot, style, template = 'white', className, }) => {
5
+ export const WdLayout = ({ headerLeftSlot, headerRightSlot, contentSlot, style, template = 'white', className, enableHeaderSlot = true, enableContentSlot = true, }) => {
6
6
  // 样式
7
7
  const { classPrefix } = useConfig();
8
8
  const platform = usePlatform();
9
9
  const isH5 = platform === 'h5';
10
- return (_jsxs("div", { className: `${isH5 ? `${classPrefix}-h5-layout-root` : `${classPrefix}-pc-layout-root`} ${classPrefix}-layout-root ${className} ${template}`, "data-testid": "wd-layout-test", style: style, children: [_jsxs("div", { className: `${classPrefix}-layout__header ${template}`, "data-testid": "wd-layout-header-test", children: [_jsx("div", { className: `${classPrefix}-layout__header-item ${classPrefix}-layout__header-item-left`, "data-testid": "wd-layout-header-left-test", children: headerLeftSlot }), _jsx("div", { className: `${classPrefix}-layout__header-item ${classPrefix}-layout__header-item-right`, "data-testid": "wd-layout-header-right-test", children: headerRightSlot })] }), _jsx("div", { className: `${classPrefix}-layout__body ${template}`, "data-testid": "wd-layout-body-test", children: contentSlot })] }));
10
+ return (_jsxs("div", { className: `${isH5 ? `${classPrefix}-h5-layout-root` : `${classPrefix}-pc-layout-root`} ${classPrefix}-layout-root ${className} ${template}`, "data-testid": "wd-layout-test", style: style, children: [enableHeaderSlot && (_jsxs("div", { className: `${classPrefix}-layout__header ${template}`, "data-testid": "wd-layout-header-test", children: [_jsx("div", { className: `${classPrefix}-layout__header-item ${classPrefix}-layout__header-item-left`, "data-testid": "wd-layout-header-left-test", children: headerLeftSlot }), _jsx("div", { className: `${classPrefix}-layout__header-item ${classPrefix}-layout__header-item-right`, "data-testid": "wd-layout-header-right-test", children: headerRightSlot })] })), enableContentSlot && (_jsx("div", { className: `${classPrefix}-layout__body ${template}`, "data-testid": "wd-layout-body-test", children: contentSlot }))] }));
11
11
  };
@@ -114,5 +114,5 @@ export const WdMarkdown = forwardRef(function WdMarkdown({ value = '', options,
114
114
  updateMarkdownInstance: ({ markdownInstance }) => setMdInstance(markdownInstance),
115
115
  };
116
116
  }, [value, mdInstance], ref);
117
- return (_jsx("div", { ref: markdownRef, className: cls, style: style, id: id, children: mdInstance && (_jsx("div", { dangerouslySetInnerHTML: { __html: displayValue } })) }));
117
+ return (_jsx("div", { ref: markdownRef, className: cls, style: style, id: id, children: displayValue && (_jsx("div", { dangerouslySetInnerHTML: { __html: displayValue } })) }));
118
118
  });
@@ -5,5 +5,5 @@ import { slotDiv } from '../utils';
5
5
  import { WdMenuList } from '../../index';
6
6
  export const PlantMenu = forwardRef(function PlantMenu(props, ref) {
7
7
  const { classPrefix } = useConfig();
8
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: `${classPrefix}-menulayout-header ${classPrefix}-menulayout-header--plant`, children: [_jsx("div", { className: `${classPrefix}-menulayout-header__logo-wrap is-not-content`, children: slotDiv(props.headSlot) }), _jsx("div", { className: `${classPrefix}-menulayout-header__right-wrap is-not-content`, children: slotDiv(props.headRightSlot, { justifyContent: 'flex-end' }) })] }), _jsxs("div", { className: `${classPrefix}-menulayout-body ${classPrefix}-menulayout-body--plant`, children: [_jsxs("div", { className: `${classPrefix}-menulayout-body__left`, children: [_jsx("div", { className: `${classPrefix}-menulayout-body__left-menu ${classPrefix}-menulayout__menu`, children: _jsx(WdMenuList, { ...props, className: "", id: "", style: {}, ref: ref }) }), _jsx("div", { className: `${classPrefix}-menulayout-body__left-slot is-not-content ${classPrefix}-menulayout-body__footer`, children: slotDiv(props.footerSlot) })] }), _jsx("div", { className: `${classPrefix}-menulayout-body__content ${classPrefix}-menulayout__body`, children: props.contentSlot })] })] }));
8
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: `${classPrefix}-menulayout-header ${classPrefix}-menulayout-header--plant`, children: [_jsx("div", { className: `${classPrefix}-menulayout-header__logo-wrap`, children: slotDiv(props.headSlot) }), _jsx("div", { className: `${classPrefix}-menulayout-header__right-wrap `, children: slotDiv(props.headRightSlot, { justifyContent: 'flex-end' }) })] }), _jsxs("div", { className: `${classPrefix}-menulayout-body ${classPrefix}-menulayout-body--plant`, children: [_jsxs("div", { className: `${classPrefix}-menulayout-body__left`, children: [_jsx("div", { className: `${classPrefix}-menulayout-body__left-menu ${classPrefix}-menulayout__menu`, children: _jsx(WdMenuList, { ...props, className: "", id: "", style: {}, ref: ref }) }), _jsx("div", { className: `${classPrefix}-menulayout-body__left-slot is-not-content ${classPrefix}-menulayout-body__footer`, children: slotDiv(props.footerSlot) })] }), _jsx("div", { className: `${classPrefix}-menulayout-body__content ${classPrefix}-menulayout__body`, children: props.contentSlot })] })] }));
9
9
  });
@@ -30,6 +30,8 @@ export const CommonMenuList = forwardRef(function CommonMenuList(props, ref) {
30
30
  if (key || !item) {
31
31
  selectItem = findSelectItem(menuData || [], key);
32
32
  }
33
+ if (!selectItem)
34
+ return;
33
35
  if ((selectItem === null || selectItem === void 0 ? void 0 : selectItem.key) && selected === (selectItem === null || selectItem === void 0 ? void 0 : selectItem.key))
34
36
  return;
35
37
  setSelected(selectItem === null || selectItem === void 0 ? void 0 : selectItem.key);
@@ -43,7 +45,11 @@ export const CommonMenuList = forwardRef(function CommonMenuList(props, ref) {
43
45
  }, [setSelectedInfo]);
44
46
  useEffect(() => {
45
47
  setSelectedInfo();
46
- }, [setSelectedInfo]);
48
+ // eslint-disable-next-line react-hooks/exhaustive-deps
49
+ }, [menuData]);
50
+ useEffect(() => {
51
+ props.selectedMenuKey && setSelected(props.selectedMenuKey);
52
+ }, [props.selectedMenuKey]);
47
53
  // 默认展开状态变化后删掉之前的状态缓存
48
54
  useEffect(() => {
49
55
  const status = JSON.parse(JSON.stringify(openStatus));
@@ -32,6 +32,8 @@ export const HorizontalMenuList = forwardRef(function HorizontalMenuList(props,
32
32
  if (key || !item) {
33
33
  selectItem = findSelectItem(menuData || [], key);
34
34
  }
35
+ if (!selectItem)
36
+ return;
35
37
  if ((selectItem === null || selectItem === void 0 ? void 0 : selectItem.key) && selected === (selectItem === null || selectItem === void 0 ? void 0 : selectItem.key))
36
38
  return;
37
39
  setSelected(selectItem === null || selectItem === void 0 ? void 0 : selectItem.key);
@@ -72,7 +74,11 @@ export const HorizontalMenuList = forwardRef(function HorizontalMenuList(props,
72
74
  }, [platform, navWrapRef, getMenuOffset]);
73
75
  useEffect(() => {
74
76
  setSelectedInfo();
75
- }, [setSelectedInfo]);
77
+ // eslint-disable-next-line react-hooks/exhaustive-deps
78
+ }, [menuData]);
79
+ useEffect(() => {
80
+ props.selectedMenuKey && setSelected(props.selectedMenuKey);
81
+ }, [props.selectedMenuKey]);
76
82
  const getIconShow = (item, selectedKey) => {
77
83
  var _a;
78
84
  if (!item.iconUrl && !item.selectedIconPath && !item.iconPath)
@@ -0,0 +1,7 @@
1
+ export declare const RelationalSetting: ({ refresh, setting, size: _size, enableRelationalSetting, enableRelationalRefresh, }: {
2
+ refresh: any;
3
+ setting: any;
4
+ size: any;
5
+ enableRelationalSetting: any;
6
+ enableRelationalRefresh: any;
7
+ }) => JSX.Element;
@@ -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 formItemProps = { ...props, ...trait, classRoot, readOnly: false };
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, children: _jsx(Select, { 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 }) }) }) }) }));
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
  });
@@ -76,6 +76,10 @@
76
76
  color: var(--wd-color-text-placeholder) !important;
77
77
  }
78
78
 
79
+ .wd-tag-root {
80
+ cursor: pointer;
81
+ }
82
+
79
83
  .wd-pc-select-multiple-root .wd-form-item-wrap__control {
80
84
  overflow: hidden;
81
85
  }
@@ -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 formItemProps = { ...props, ...trait, classRoot, readOnly: false };
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, children: _jsx(SelectMultiple, { 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 }) }) }) }) }));
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
- return (_a = []
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
- return getTextByValue(value);
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(TextWrap, { ...textProps, children: fieldValue });
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
- return (_jsx(TextWrap, { ...textProps, children: fieldValue[relatedField] || fieldValue[primaryField] || '-' }));
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
- return (_jsx(TextWrap, { ...textProps, children: fieldValue[relatedField] || fieldValue[primaryField] }));
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 (e) { }
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 (e) { }
848
+ catch (error) {
849
+ errorHandler({
850
+ code: 'GetCustomFieldError',
851
+ error,
852
+ });
853
+ }
825
854
  return _field;
826
855
  };
827
856
  /**