@lingxiteam/ebe-utils 0.2.22 → 0.2.23

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 (144) hide show
  1. package/lib/h5public/yarn.lock +7 -8
  2. package/lib/pcpublic/src/components/pcfactory/src/Button/index.tsx +11 -10
  3. package/lib/pcpublic/src/components/pcfactory/src/Card/CardTitle/index.tsx +31 -24
  4. package/lib/pcpublic/src/components/pcfactory/src/Card/index.tsx +32 -14
  5. package/lib/pcpublic/src/components/pcfactory/src/Card/useExtendBtn.tsx +85 -48
  6. package/lib/pcpublic/src/components/pcfactory/src/ChartLine/ChartLine.tsx +24 -6
  7. package/lib/pcpublic/src/components/pcfactory/src/ChartLine/PropsType.ts +31 -5
  8. package/lib/pcpublic/src/components/pcfactory/src/ChartLine/index.tsx +3 -2
  9. package/lib/pcpublic/src/components/pcfactory/src/ChartLine/loader.tsx +1 -1
  10. package/lib/pcpublic/src/components/pcfactory/src/Form/Form.tsx +153 -129
  11. package/lib/pcpublic/src/components/pcfactory/src/Form/index.tsx +2 -5
  12. package/lib/pcpublic/src/components/pcfactory/src/Form/useFormStatus.ts +8 -4
  13. package/lib/pcpublic/src/components/pcfactory/src/LXPieChart/LXPieChart.tsx +15 -3
  14. package/lib/pcpublic/src/components/pcfactory/src/LXPieChart/PropsType.ts +4 -3
  15. package/lib/pcpublic/src/components/pcfactory/src/LXPieChart/index.tsx +1 -1
  16. package/lib/pcpublic/src/components/pcfactory/src/LXPieChart/loader.tsx +1 -1
  17. package/lib/pcpublic/src/components/pcfactory/src/LXRadarChart/LXRadarChat.tsx +18 -4
  18. package/lib/pcpublic/src/components/pcfactory/src/LXRadarChart/PropsType.ts +2 -1
  19. package/lib/pcpublic/src/components/pcfactory/src/LXRadarChart/index.tsx +1 -1
  20. package/lib/pcpublic/src/components/pcfactory/src/LXRadarChart/loader.tsx +1 -1
  21. package/lib/pcpublic/src/components/pcfactory/src/ModalSelect/BaseModalSelect.tsx +7 -2
  22. package/lib/pcpublic/src/components/pcfactory/src/ModalSelect/index.tsx +60 -26
  23. package/lib/pcpublic/src/components/pcfactory/src/RichTextEditor/LcdpUeditorMain.tsx +62 -55
  24. package/lib/pcpublic/src/components/pcfactory/src/RichTextEditor/RichTextEditor.tsx +2 -6
  25. package/lib/pcpublic/src/components/pcfactory/src/RichTextEditor/RichTextEditorMain.tsx +5 -5
  26. package/lib/pcpublic/src/components/pcfactory/src/RichTextEditor/index.tsx +9 -2
  27. package/lib/pcpublic/src/components/pcfactory/src/RichTextEditor/loader.ts +1 -1
  28. package/lib/pcpublic/src/components/pcfactory/src/Select/index.tsx +145 -66
  29. package/lib/pcpublic/src/components/pcfactory/src/Select/selectUtils.ts +13 -9
  30. package/lib/pcpublic/src/components/pcfactory/src/Table/BodyCell/index.tsx +36 -26
  31. package/lib/pcpublic/src/components/pcfactory/src/Table/EditComponent/index.tsx +69 -94
  32. package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/GhostTag/index.tsx +12 -5
  33. package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/Hyperlink/index.tsx +9 -5
  34. package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/PointTag/index.tsx +11 -5
  35. package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/PureColourFill/index.tsx +11 -5
  36. package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/PureFadeColourTag/index.tsx +14 -7
  37. package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/Thumbnail/index.tsx +30 -31
  38. package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/index.tsx +89 -41
  39. package/lib/pcpublic/src/components/pcfactory/src/Table/HeaderCell/HeaderCellTitle/index.tsx +25 -12
  40. package/lib/pcpublic/src/components/pcfactory/src/Table/HeaderCell/index.tsx +12 -5
  41. package/lib/pcpublic/src/components/pcfactory/src/Table/OperationCell/PopoverWrapper.tsx +220 -0
  42. package/lib/pcpublic/src/components/pcfactory/src/Table/OperationCell/SingleBtn.tsx +39 -32
  43. package/lib/pcpublic/src/components/pcfactory/src/Table/OperationCell/index.tsx +178 -148
  44. package/lib/pcpublic/src/components/pcfactory/src/Table/Table.tsx +439 -0
  45. package/lib/pcpublic/src/components/pcfactory/src/Table/TableHead/index.tsx +159 -72
  46. package/lib/pcpublic/src/components/pcfactory/src/Table/TableSummaryRow/index.tsx +12 -20
  47. package/lib/pcpublic/src/components/pcfactory/src/Table/constant.ts +3 -0
  48. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/index.ts +4 -4
  49. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useCMDActions.ts +32 -28
  50. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useCheckStrict.ts +44 -57
  51. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useColumns.tsx +306 -276
  52. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useCommon.ts +9 -6
  53. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useDataSource.ts +30 -21
  54. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useExpandable.tsx +33 -27
  55. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useFilter.tsx +84 -77
  56. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useFormatCell.tsx +33 -16
  57. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/usePagination.ts +15 -5
  58. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useRowEdit.ts +33 -33
  59. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useRowMerge.ts +13 -5
  60. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useScroll.ts +94 -28
  61. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useSelection.ts +108 -99
  62. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useSort.ts +8 -5
  63. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useSummaryCol.ts +27 -43
  64. package/lib/pcpublic/src/components/pcfactory/src/Table/index.tsx +73 -394
  65. package/lib/pcpublic/src/components/pcfactory/src/Table/loader.tsx +15 -0
  66. package/lib/pcpublic/src/components/pcfactory/src/Table/types/OperationCell.d.ts +2 -2
  67. package/lib/pcpublic/src/components/pcfactory/src/Table/types/event.d.ts +12 -8
  68. package/lib/pcpublic/src/components/pcfactory/src/Table/types/headerCell.d.ts +2 -1
  69. package/lib/pcpublic/src/components/pcfactory/src/Table/types/prop.d.ts +24 -11
  70. package/lib/pcpublic/src/components/pcfactory/src/Table/utils/SequenceId.ts +2 -1
  71. package/lib/pcpublic/src/components/pcfactory/src/Table/utils/index.ts +90 -82
  72. package/lib/pcpublic/src/components/pcfactory/src/Table/utils/indexedDBHelper.ts +9 -22
  73. package/lib/pcpublic/src/components/pcfactory/src/Table/utils/translate.ts +59 -0
  74. package/lib/pcpublic/src/components/pcfactory/src/Transfer/Transfer.tsx +644 -0
  75. package/lib/pcpublic/src/components/pcfactory/src/Transfer/index.tsx +49 -637
  76. package/lib/pcpublic/src/components/pcfactory/src/Transfer/loader.tsx +11 -0
  77. package/lib/pcpublic/src/components/pcfactory/src/Tree/TreeEllipsisIcon.tsx +38 -0
  78. package/lib/pcpublic/src/components/pcfactory/src/Tree/TreeNodeMenu/index.tsx +34 -35
  79. package/lib/pcpublic/src/components/pcfactory/src/Tree/index.tsx +213 -149
  80. package/lib/pcpublic/src/components/pcfactory/src/TreeSelect/index.tsx +47 -43
  81. package/lib/pcpublic/src/components/pcfactory/src/TreeTable/TreeTable.tsx +264 -0
  82. package/lib/pcpublic/src/components/pcfactory/src/TreeTable/hooks/index.ts +4 -1
  83. package/lib/pcpublic/src/components/pcfactory/src/TreeTable/hooks/useCMDAction.ts +9 -3
  84. package/lib/pcpublic/src/components/pcfactory/src/TreeTable/hooks/useExpandable.tsx +9 -3
  85. package/lib/pcpublic/src/components/pcfactory/src/TreeTable/index.tsx +52 -191
  86. package/lib/pcpublic/src/components/pcfactory/src/TreeTable/loader.tsx +16 -0
  87. package/lib/pcpublic/src/components/pcfactory/src/assets/index.tsx +34 -0
  88. package/lib/pcpublic/src/components/pcfactory/src/assets/svg/quadrate.tsx +20 -0
  89. package/lib/pcpublic/src/components/pcfactory/src/assets/svg/roundness.tsx +14 -0
  90. package/lib/pcpublic/src/components/pcfactory/src/assets/svg/semicircle.tsx +15 -0
  91. package/lib/pcpublic/src/components/pcfactory/src/assets/svg/verticalLine.tsx +12 -0
  92. package/lib/pcpublic/src/components/pcfactory/src/styles/common.less +17 -0
  93. package/lib/pcpublic/src/components/pcfactory/src/styles/components/Card.less +57 -11
  94. package/lib/pcpublic/src/components/pcfactory/src/styles/components/Form.less +101 -12
  95. package/lib/pcpublic/src/components/pcfactory/src/styles/components/ModalSelect.less +6 -0
  96. package/lib/pcpublic/src/components/pcfactory/src/styles/components/Select.less +70 -6
  97. package/lib/pcpublic/src/components/pcfactory/src/utils/ChannelContainer.tsx +20 -14
  98. package/lib/pcpublic/src/components/pcfactory/src/utils/ChildRender.ts +6 -8
  99. package/lib/pcpublic/src/components/pcfactory/src/utils/CustomModule.tsx +4 -6
  100. package/lib/pcpublic/src/components/pcfactory/src/utils/DummyFormContext.ts +9 -13
  101. package/lib/pcpublic/src/components/pcfactory/src/utils/Empty/empty.tsx +5 -17
  102. package/lib/pcpublic/src/components/pcfactory/src/utils/Empty/index.tsx +3 -3
  103. package/lib/pcpublic/src/components/pcfactory/src/utils/Holidays.ts +11 -39
  104. package/lib/pcpublic/src/components/pcfactory/src/utils/HolidaysFormat.ts +83 -0
  105. package/lib/pcpublic/src/components/pcfactory/src/utils/IdleContainer/index.tsx +47 -0
  106. package/lib/pcpublic/src/components/pcfactory/src/utils/IdleContainer/scheduler.ts +74 -0
  107. package/lib/pcpublic/src/components/pcfactory/src/utils/LoaderHelper.tsx +4 -1
  108. package/lib/pcpublic/src/components/pcfactory/src/utils/Spin/index.tsx +8 -7
  109. package/lib/pcpublic/src/components/pcfactory/src/utils/WithSyncValue.ts +25 -23
  110. package/lib/pcpublic/src/components/pcfactory/src/utils/ahooks/index.ts +10 -7
  111. package/lib/pcpublic/src/components/pcfactory/src/utils/ahooks/useMap.ts +9 -6
  112. package/lib/pcpublic/src/components/pcfactory/src/utils/ahooks/useMemoizedFn.ts +4 -1
  113. package/lib/pcpublic/src/components/pcfactory/src/utils/ahooks/usePersistFn.ts +17 -0
  114. package/lib/pcpublic/src/components/pcfactory/src/utils/ahooks/useSafeState.ts +2 -2
  115. package/lib/pcpublic/src/components/pcfactory/src/utils/ahooks/useSetState.ts +7 -5
  116. package/lib/pcpublic/src/components/pcfactory/src/utils/common.ts +23 -50
  117. package/lib/pcpublic/src/components/pcfactory/src/utils/constant.ts +53 -57
  118. package/lib/pcpublic/src/components/pcfactory/src/utils/dynamicUtils/DynamicContext.tsx +12 -17
  119. package/lib/pcpublic/src/components/pcfactory/src/utils/formUtils/FormContext.tsx +22 -12
  120. package/lib/pcpublic/src/components/pcfactory/src/utils/formUtils/FormFields.tsx +50 -19
  121. package/lib/pcpublic/src/components/pcfactory/src/utils/formUtils/WrapperContainer.tsx +58 -37
  122. package/lib/pcpublic/src/components/pcfactory/src/utils/formUtils/cmdHelper.ts +33 -30
  123. package/lib/pcpublic/src/components/pcfactory/src/utils/formUtils/common.ts +2 -0
  124. package/lib/pcpublic/src/components/pcfactory/src/utils/generatorDisabledCallback.ts +121 -113
  125. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useCommonImperativeHandle.ts +16 -14
  126. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useCompState.tsx +1 -1
  127. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useDataMask.ts +7 -2
  128. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useDoubleClick.ts +3 -1
  129. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useFuncExpExecute.ts +16 -14
  130. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useGetStaticAttrData.ts +9 -3
  131. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useHiddenStyle.ts +4 -5
  132. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useInit.ts +11 -0
  133. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useInitReactQuill.ts +3 -1
  134. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useListenState.ts +1 -0
  135. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useLocale.ts +5 -3
  136. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/usePrintMode.tsx +2 -2
  137. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useRules.ts +1 -1
  138. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useTestHelper.ts +2 -0
  139. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useToggleBoolean.ts +8 -4
  140. package/lib/pcpublic/src/components/pcfactory/src/utils/index.ts +10 -10
  141. package/lib/pcpublic/src/components/pcfactory/src/utils/polyfill.js +29 -31
  142. package/lib/pcpublic/src/components/pcfactory/src/utils/renderReadOnly.tsx +29 -26
  143. package/lib/public/public/iconfont.js +1 -0
  144. package/package.json +2 -2
@@ -1,14 +1,29 @@
1
+ import React, {
2
+ useImperativeHandle,
3
+ Children,
4
+ cloneElement,
5
+ useRef,
6
+ useEffect,
7
+ useMemo,
8
+ useState,
9
+ } from 'react';
10
+ import { Form as AntdForm, Row, Col } from 'antd';
1
11
  import { LingxiForwardRef } from '@lingxiteam/types';
2
- import { Col, Form as AntdForm, Row } from 'antd';
12
+ import {
13
+ FormProvider,
14
+ FormContextProps,
15
+ getFormItemClassName,
16
+ usePrintMode,
17
+ PrintContainer,
18
+ useDynamicData,
19
+ } from '../utils';
3
20
  import type { FormLayout } from 'antd/lib/form/Form';
4
- import classNames from 'classnames';
5
- import { isEqual } from 'lodash';
6
- import React, { Children, cloneElement, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
7
- import { FormContextProps, FormProvider, getFormItemClassName, PrintContainer, useDynamicData, usePrintMode } from '../utils';
8
- import { useCreation } from '../utils/ahooks';
21
+ import WrapperForm from './WrapperForm';
9
22
  import useBackgroundStyle from '../View/useBackgroundStyle';
10
23
  import { useFormStatus } from './useFormStatus';
11
- import WrapperForm from './WrapperForm';
24
+ import { isEqual } from 'lodash';
25
+ import { useCreation } from '../utils/ahooks';
26
+ import classNames from 'classnames';
12
27
 
13
28
  const EMPTY_COL = { span: 'none' }; // 避免每次都创建对象造成无用渲染
14
29
  const FULL_COL = { span: 24 };
@@ -37,29 +52,42 @@ export interface FormProps {
37
52
  * 是否一直展示标题(零代码使用,表单内包裹view然后再包裹表单控件,需要展示标题)
38
53
  */
39
54
  isShowTitle?: boolean;
55
+
56
+ /**
57
+ * label是否换行
58
+ */
59
+ labelWrap?: boolean;
40
60
  }
41
61
 
42
62
  const useInit = (cb: () => () => void) => {
43
63
  const initialRef = useRef(true);
44
- const unmountRef = useRef(() => {});
64
+ const unmountRef = useRef(() => { });
45
65
 
46
66
  if (initialRef.current) {
47
67
  initialRef.current = false;
48
68
  unmountRef.current = cb();
49
69
  }
50
70
 
51
- useEffect(
52
- () => () => {
53
- if (typeof unmountRef.current === 'function') {
54
- unmountRef.current();
55
- }
56
- },
57
- [unmountRef.current]
58
- );
71
+ useEffect(() => () => {
72
+ if (typeof unmountRef.current === 'function') {
73
+ unmountRef.current();
74
+ }
75
+ }, [unmountRef.current]);
59
76
  };
60
77
 
61
78
  export const ViewFormItem = (props: any) => {
62
- const { schemaProps, selfSpan, colSpan, getVisible, style, stateListener, isBlank, i, uid, child } = props;
79
+ const {
80
+ schemaProps,
81
+ selfSpan,
82
+ colSpan,
83
+ getVisible,
84
+ style,
85
+ stateListener,
86
+ isBlank,
87
+ i,
88
+ uid,
89
+ child,
90
+ } = props;
63
91
 
64
92
  const [, setUpdate] = useState(0);
65
93
 
@@ -106,7 +134,7 @@ type FormChildrenType = Pick<FormProps, 'colSpan' | 'rowSpace' | 'layout' | 'col
106
134
  children?: React.ReactNode;
107
135
  formRef?: any;
108
136
  engineApis?: any;
109
- };
137
+ }
110
138
  export const FormChildren = (props: FormChildrenType) => {
111
139
  const { children, colSpan, formRef, rowSpace, layout, colSpace, engineApis } = props;
112
140
 
@@ -138,54 +166,53 @@ export const FormChildren = (props: FormChildrenType) => {
138
166
  return 0;
139
167
  }
140
168
  const item = comps[curIndex - 1];
141
- return item.props?.schema?.props?.formItemIndex || curIndex;
169
+ return item.props?.schema?.props?.formItemIndex ?? curIndex;
142
170
  };
143
171
  Children.forEach(comps, (child, index) => {
144
172
  if (!React.isValidElement<any>(child)) {
145
173
  components.push(child);
146
174
  return;
147
175
  }
148
-
176
+
149
177
  const { schema } = child.props;
150
178
  const { compType, props: schemaProps } = schema || {};
151
-
179
+
152
180
  if (compType !== undefined && compType !== 2) {
153
181
  const { formItemIndex, hidden, style: childStyle, selfSpan } = schemaProps;
154
182
  const { display: customDisplay, visibility: customVisibility } = childStyle || {};
155
-
183
+
156
184
  const changeColStyle = () => {
157
185
  const colStyle: React.CSSProperties = {};
158
-
186
+
159
187
  if (hidden || (customDisplay && customDisplay === 'none')) {
160
188
  colStyle.display = 'none';
161
189
  }
162
-
190
+
163
191
  if (customVisibility) {
164
192
  colStyle.visibility = customVisibility;
165
193
  }
166
-
194
+
167
195
  return colStyle;
168
196
  };
169
197
  const lastFormIndex = getLastFormIndex(index);
170
198
  // 中间间隔组件的个数
171
- const gap = formItemIndex - lastFormIndex - 1 || 0;
172
- gap > 0 &&
173
- new Array(gap).fill(0).forEach((_, i) => {
174
- components.push(
175
- <ViewFormItem
176
- i={i}
177
- key={`blank-${i}`}
178
- style={changeColStyle()}
179
- colSpan={colSpan}
180
- getVisible={getVisible}
181
- stateListener={stateListener}
182
- isBlank
183
- // child.props.$$componentItem.uid 兼容高代码模式下
184
- uid={child.props.uid || child.props.$$componentItem.uid}
185
- />
186
- );
187
- });
188
-
199
+ const gap = index === 0 ? formItemIndex : (formItemIndex - lastFormIndex - 1) || 0;
200
+ gap > 0 && new Array(gap).fill(0).forEach((_, i) => {
201
+ components.push(
202
+ <ViewFormItem
203
+ i={i}
204
+ key={`blank-${i}`}
205
+ style={changeColStyle()}
206
+ colSpan={colSpan}
207
+ getVisible={getVisible}
208
+ stateListener={stateListener}
209
+ isBlank
210
+ // child.props.$$componentItem.uid 兼容高代码模式下
211
+ uid={child.props.uid || child.props.$$componentItem.uid}
212
+ />,
213
+ );
214
+ });
215
+
189
216
  components.push(
190
217
  <ViewFormItem
191
218
  style={changeColStyle()}
@@ -198,14 +225,14 @@ export const FormChildren = (props: FormChildrenType) => {
198
225
  uid={child.props.uid || child.props.$$componentItem.uid}
199
226
  child={child}
200
227
  key={child.key}
201
- />
228
+ />,
202
229
  );
203
230
  return;
204
231
  }
205
-
232
+
206
233
  components.push(cloneElement(child, { extendProps: { isFormRootChild: true } } as any));
207
234
  });
208
-
235
+
209
236
  return components;
210
237
  };
211
238
 
@@ -255,17 +282,14 @@ const Form = LingxiForwardRef<any, FormProps>((props, ref) => {
255
282
  // 保存值变化回调,
256
283
  const valueChangeFnRef = useRef<(changedValues: any, values: any) => void>();
257
284
 
258
- const { backgroundStyle } = useBackgroundStyle({
259
- engineApis,
260
- backgroundType,
261
- mode: 'engine',
262
- });
285
+ const { backgroundStyle } = useBackgroundStyle({ engineApis, backgroundType, mode: 'engine' });
263
286
 
264
287
  const { run, addListener, removeListener, status } = useFormStatus({
265
288
  disabled: props.disabled,
266
289
  readonly: props.readOnly,
267
290
  });
268
291
 
292
+
269
293
  // 由于需要考虑loop等组件,可能存在多个相同的字段名,自行研发
270
294
  const scrollToError = (errorInfo: any) => {
271
295
  try {
@@ -303,90 +327,87 @@ const Form = LingxiForwardRef<any, FormProps>((props, ref) => {
303
327
  * 需要上传给动态数据容器的表单方法
304
328
  */
305
329
 
306
- const formRefHandler = useCreation(
307
- () => ({
330
+ const formRefHandler = useCreation(() => ({
308
331
 
309
- /**
310
- * 校验并滚动到某字段
311
- */
312
- validateFormAndScroll: (errScroll: boolean = true) => {
313
- return form.validateFields().catch(errorInfo => {
314
- if (errScroll) {
315
- scrollToError(errorInfo);
316
- }
317
- throw errorInfo;
318
- });
319
- },
332
+ /**
333
+ * 校验并滚动到某字段
334
+ */
335
+ validateFormAndScroll: (errScroll: boolean = true) => {
336
+ return form.validateFields().catch(errorInfo => {
337
+ if (errScroll) {
338
+ scrollToError(errorInfo);
339
+ }
340
+ throw errorInfo;
341
+ });
342
+ },
320
343
 
321
- /**
322
- * 滚动到错误的位置
323
- */
324
- scrollToErrorField: (errorInfo: any) => {
325
- scrollToError(errorInfo);
326
- },
344
+ /**
345
+ * 滚动到错误的位置
346
+ */
347
+ scrollToErrorField: (errorInfo: any) => {
348
+ scrollToError(errorInfo);
349
+ },
327
350
 
328
- /**
329
- * 获取表单值
330
- */
331
- getFieldsValue: () => {
332
- return form.getFieldsValue();
333
- },
351
+ /**
352
+ * 获取表单值
353
+ */
354
+ getFieldsValue: () => {
355
+ return form.getFieldsValue();
356
+ },
334
357
 
335
- /**
336
- * 设置表单值
337
- * @param values
338
- * @param refs 低代码平台引擎内所有的refs,其他平台不要使用
339
- */
340
- setFieldsValue(values: any, refs: Record<string, any>) {
341
- const target: any = {};
342
- const relation: any = formChildRelation.current;
343
- if (values) {
344
- Object.keys(values).forEach(key => {
345
- target[key] = values[key];
346
- if (typeof patchSetFormsValueFn[key] === 'function') {
347
- target[key] = patchSetFormsValueFn[key](target[key]);
348
- }
349
- if (refs && relation) {
350
- const relation = formChildRelation.current;
351
- // @ts-ignore
352
- const comId = relation?.[key];
353
- if (comId) {
354
- refs?.[comId]?.onlySyncValue(target[key]);
355
- }
358
+ /**
359
+ * 设置表单值
360
+ * @param values
361
+ * @param refs 低代码平台引擎内所有的refs,其他平台不要使用
362
+ */
363
+ setFieldsValue(values: any, refs: Record<string, any>) {
364
+ const target: any = {};
365
+ const relation: any = formChildRelation.current;
366
+ if (values) {
367
+ Object.keys(values).forEach(key => {
368
+ target[key] = values[key];
369
+ if (typeof patchSetFormsValueFn[key] === 'function') {
370
+ target[key] = patchSetFormsValueFn[key](target[key]);
371
+ }
372
+ if (refs && relation) {
373
+ const relation = formChildRelation.current;
374
+ // @ts-ignore
375
+ const comId = relation?.[key];
376
+ if (comId) {
377
+ refs?.[comId]?.onlySyncValue(target[key]);
356
378
  }
357
- if (!isEqual(form.getFieldValue(key), target[key]) && typeof onValuesChange === 'function') {
358
- if (engineApis?.compatConfig?.cmd?.setFieldsValueToOnValuesChange === true) {
359
- onValuesChange(key, target[key]);
360
- }
379
+ }
380
+ if (!isEqual(form.getFieldValue(key), target[key]) && typeof onValuesChange === 'function') {
381
+ if (engineApis?.compatConfig?.cmd?.setFieldsValueToOnValuesChange === true) {
382
+ onValuesChange(key, target[key]);
361
383
  }
362
- });
363
- }
364
-
365
- form.setFieldsValue(target);
366
- },
384
+ }
385
+ });
386
+ }
387
+
388
+ form.setFieldsValue(target);
389
+ },
367
390
 
368
- /**
369
- * 重置表单值
370
- */
371
- resetFields() {
372
- form.resetFields();
373
- },
391
+ /**
392
+ * 重置表单值
393
+ */
394
+ resetFields() {
395
+ form.resetFields();
396
+ },
374
397
 
375
- // 设置禁用状态
376
- setDisabled: (v: boolean | 'toggle') => {
377
- run('disabled', v === 'toggle' ? !status.disabled : v);
378
- },
379
- // 设置只读状态
380
- setReadOnly: (v: boolean | 'toggle') => {
381
- run('readonly', v === 'toggle' ? !status.readonly : v);
382
- },
383
- scrollToError,
384
- // 作为ref标志,表示form已经被渲染了
385
- has: true,
386
- form,
387
- }),
388
- [status]
389
- );
398
+ // 设置禁用状态
399
+ setDisabled: (v: boolean | 'toggle') => {
400
+ run('disabled', v === 'toggle' ? !status.disabled : v);
401
+ },
402
+ // 设置只读状态
403
+ setReadOnly: (v: boolean | 'toggle') => {
404
+ run('readonly', v === 'toggle' ? !status.readonly : v);
405
+ },
406
+ scrollToError,
407
+ // 作为ref标志,表示form已经被渲染了
408
+ has: true,
409
+ form,
410
+ }), [status]);
390
411
 
391
412
  /**
392
413
  * 动态数据容器ref上报
@@ -415,7 +436,7 @@ const Form = LingxiForwardRef<any, FormProps>((props, ref) => {
415
436
  * @returns
416
437
  */
417
438
  getChildRelation: () => formChildRelation.current,
418
-
439
+
419
440
  /**
420
441
  * 打印模式钩子
421
442
  */
@@ -453,8 +474,9 @@ const Form = LingxiForwardRef<any, FormProps>((props, ref) => {
453
474
  colSpace,
454
475
  isShowTitle,
455
476
  formCode: formCode || $$componentItem?.id,
477
+ labelWrap: props.labelWrap,
456
478
  }),
457
- [form, layout, colSpan, labelCol, wrapperCol, colon, labelAlign, addListener, removeListener]
479
+ [form, layout, colSpan, labelCol, wrapperCol, colon, labelAlign, addListener, removeListener],
458
480
  );
459
481
 
460
482
  const formStyle: React.CSSProperties = {
@@ -476,6 +498,7 @@ const Form = LingxiForwardRef<any, FormProps>((props, ref) => {
476
498
  layout={layout}
477
499
  labelCol={layout === 'horizontal' ? labelCol : EMPTY_COL}
478
500
  wrapperCol={layout === 'horizontal' ? wrapperCol : EMPTY_COL}
501
+ labelWrap={props.labelWrap}
479
502
  style={formStyle}
480
503
  onValuesChange={(changedValues, values) => {
481
504
  const keys = Object.keys(changedValues || {});
@@ -530,6 +553,7 @@ const Form = LingxiForwardRef<any, FormProps>((props, ref) => {
530
553
  layout={layout}
531
554
  labelCol={layout === 'horizontal' ? labelCol : EMPTY_COL}
532
555
  wrapperCol={layout === 'horizontal' ? wrapperCol : EMPTY_COL}
556
+ labelWrap={props.labelWrap}
533
557
  style={formStyle}
534
558
  {...extendProps}
535
559
  >
@@ -1,5 +1,5 @@
1
- import { FormFields as Item, useForm } from '../utils';
2
1
  import Form from './Form';
2
+ import { FormFields as Item, useForm } from '../utils';
3
3
 
4
4
  type FormType = typeof Form;
5
5
 
@@ -7,9 +7,6 @@ type FormType = typeof Form;
7
7
 
8
8
  (Form as any).useForm = useForm;
9
9
 
10
- const formInstance = Form as FormType & {
11
- Item: typeof Item;
12
- useForm: typeof useForm;
13
- };
10
+ const formInstance = Form as FormType & { Item: typeof Item, useForm: typeof useForm };
14
11
 
15
12
  export default formInstance;
@@ -1,14 +1,18 @@
1
- import { isUndefined } from 'lodash';
2
1
  import { useRef } from 'react';
3
- import { useUpdateEffect } from '../utils/ahooks';
4
- import { StatusType } from '../utils/formUtils/FormContext';
5
2
  import useMonitor from './useMonitor';
3
+ import { StatusType } from '../utils/formUtils/FormContext';
4
+ import { isUndefined } from 'lodash';
5
+ import { useUpdateEffect } from '../utils/ahooks';
6
6
 
7
7
  export type FormStatusType = {
8
8
  [key in StatusType]?: unknown;
9
9
  };
10
10
 
11
- const useSubscriptionStatus = (options: { run: (type: StatusType, v: unknown) => void; type: StatusType; listened: unknown }) => {
11
+ const useSubscriptionStatus = (options: {
12
+ run: (type: StatusType, v: unknown) => void;
13
+ type: StatusType;
14
+ listened: unknown;
15
+ }) => {
12
16
  const { run, type, listened } = options;
13
17
  useUpdateEffect(() => {
14
18
  if (!isUndefined(listened)) {
@@ -1,14 +1,26 @@
1
+ import React from 'react';
2
+ import LXPieChartPorps from './PropsType';
1
3
  import { LXChart } from '@lingxiteam/charts-common';
2
4
  import { LingXiFC } from '@lingxiteam/types';
5
+ import useBackgroundStyle from '../View/useBackgroundStyle';
3
6
  import { useHiddenStyle } from '../utils';
4
7
  import './index.less';
5
- import LXPieChartPorps from './PropsType';
6
8
 
7
9
  const LXPieChart: LingXiFC<LXPieChartPorps> = (props, ref) => {
8
- const { style, visible = true, className } = props;
10
+ const { style, visible = true, className, backgroundType, getEngineApis, $$componentItem } = props;
9
11
  const finalStyle = useHiddenStyle(visible, style);
12
+ const { backgroundStyle } = useBackgroundStyle({ backgroundType, engineApis: getEngineApis?.(), appId: $$componentItem?.appId, mode: 'engine' });
10
13
 
11
- return <LXChart style={finalStyle} className={className} configProps={props} isEditMode={false} isMobile={false} chartType="Pie" />;
14
+ return (
15
+ <LXChart
16
+ style={{ ...backgroundStyle, ...(finalStyle || {}) }}
17
+ className={className}
18
+ configProps={props}
19
+ isEditMode={false}
20
+ isMobile={false}
21
+ chartType="Pie"
22
+ />
23
+ );
12
24
  };
13
25
 
14
26
  export default LXPieChart;
@@ -1,11 +1,12 @@
1
1
  /* eslint-disable semi */
2
- import { PieChartPorps } from '@lingxiteam/charts-common';
3
2
  import type { EngineApisType } from '@lingxiteam/types';
3
+ import { PieChartPorps } from '@lingxiteam/charts-common';
4
4
 
5
5
  export default interface LXPieChartPorps extends PieChartPorps {
6
6
  visible?: boolean;
7
7
  className?: string;
8
8
  style?: React.CSSProperties; // 样式
9
9
  getEngineApis?: () => EngineApisType;
10
- // eslint-disable-next-line no-extra-semi
11
- }
10
+ backgroundType?: any;
11
+ // eslint-disable-next-line no-extra-semi
12
+ };
@@ -1,5 +1,5 @@
1
+ import React, { useImperativeHandle } from 'react';
1
2
  import { LingxiForwardRef } from '@lingxiteam/types';
2
- import { useImperativeHandle } from 'react';
3
3
  import LXPieChartLoader from './loader';
4
4
  import LXPieChartProps from './PropsType';
5
5
 
@@ -2,7 +2,7 @@ import Loadable from 'react-loadable';
2
2
  import { LoadingComponennt } from '../utils/LoaderHelper';
3
3
 
4
4
  const LoadableLXRadarChart = Loadable({
5
- loader: async () => (await import(/* webpackChunkName: 'pcFactory-LXPieChart' */ './LXPieChart')) as unknown as React.ComponentType<any>,
5
+ loader: async () => (await import/* webpackChunkName: 'pcFactory-LXPieChart' */('./LXPieChart')) as unknown as React.ComponentType<any>,
6
6
  loading: LoadingComponennt,
7
7
  });
8
8
 
@@ -1,16 +1,30 @@
1
+ import React from 'react';
2
+ import LXRadarChartPorps from './PropsType';
3
+ import { useHiddenStyle } from '../utils';
1
4
  import { LXChart } from '@lingxiteam/charts-common';
2
5
  import { LingXiFC } from '@lingxiteam/types';
3
- import { useHiddenStyle } from '../utils';
4
6
  import './index.less';
5
- import LXRadarChartPorps from './PropsType';
7
+ import useBackgroundStyle from '../View/useBackgroundStyle';
8
+ import classNames from 'classnames';
9
+
6
10
 
7
11
  // const prefixCls = 'lXRadarChart';
8
12
 
9
13
  const LXRadarChart: LingXiFC<LXRadarChartPorps> = (props, ref) => {
10
- const { style, visible = true, className } = props;
14
+ const { style, visible = true, className, backgroundType, getEngineApis, $$componentItem } = props;
11
15
  const finalStyle = useHiddenStyle(visible, style);
16
+ const { backgroundStyle } = useBackgroundStyle({ backgroundType, engineApis: getEngineApis?.(), appId: $$componentItem?.appId, mode: 'engine' });
12
17
 
13
- return <LXChart style={finalStyle} className={className} configProps={props} isEditMode={false} isMobile={false} chartType="Radar" />;
18
+ return (
19
+ <LXChart
20
+ style={{ ...backgroundStyle, ...finalStyle }}
21
+ className={classNames(className, 'ued-radarChart')}
22
+ configProps={props}
23
+ isEditMode={false}
24
+ isMobile={false}
25
+ chartType="Radar"
26
+ />
27
+ );
14
28
  };
15
29
 
16
30
  export default LXRadarChart;
@@ -6,4 +6,5 @@ export default interface LXRadarChartPorps extends RadarChartPorps {
6
6
  visible?: boolean;
7
7
  className?: string;
8
8
  style?: React.CSSProperties; // 样式
9
- }
9
+ backgroundType?: any;
10
+ };
@@ -1,5 +1,5 @@
1
+ import React, { useImperativeHandle } from 'react';
1
2
  import { LingxiForwardRef } from '@lingxiteam/types';
2
- import { useImperativeHandle } from 'react';
3
3
  import LXRadarChartLoader from './loader';
4
4
  import LXRadarChartProps from './PropsType';
5
5
 
@@ -2,7 +2,7 @@ import Loadable from 'react-loadable';
2
2
  import { LoadingComponennt } from '../utils/LoaderHelper';
3
3
 
4
4
  const LoadableLXRadarChart = Loadable({
5
- loader: async () => (await import(/* webpackChunkName: 'pcFactory-LXRadarChart' */ './LXRadarChat')) as unknown as React.ComponentType<any>,
5
+ loader: async () => (await import/* webpackChunkName: 'pcFactory-LXRadarChart' */('./LXRadarChat')) as unknown as React.ComponentType<any>,
6
6
  loading: LoadingComponennt,
7
7
  });
8
8
 
@@ -1,5 +1,6 @@
1
- import { Select } from 'antd';
1
+ import React from 'react';
2
2
  import classnames from 'classnames';
3
+ import { Select } from 'antd';
3
4
 
4
5
  const BaseModalSelect = (props: any) => {
5
6
  const {
@@ -26,8 +27,12 @@ const BaseModalSelect = (props: any) => {
26
27
  <span
27
28
  className={classnames(className, {
28
29
  'pcfactory-input-group-wrapper': true,
29
- [`pcfactory-input-affix-wrapper-${restProps?.size === 'large' ? 'lg' : 'sm'}`]: ['large', 'small'].includes(restProps?.size),
30
+ [`pcfactory-input-affix-wrapper-${restProps?.size === 'large' ? 'lg' : 'sm'}`]: [
31
+ 'large',
32
+ 'small',
33
+ ].includes(restProps?.size),
30
34
  [`${postfixStyleClsName}`]: postfixStyleClsName,
35
+ 'pcfactory-input-after-border-right-width': !!postfixStyleClsName,
31
36
  })}
32
37
  style={restProps?.style}
33
38
  onChange={val => {