lu-lowcode-package-form 0.11.93 → 0.11.95

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lu-lowcode-package-form",
3
- "version": "0.11.93",
3
+ "version": "0.11.95",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^4.8.1",
6
6
  "@dnd-kit/core": "^6.1.0",
@@ -20,6 +20,12 @@ const SearchSelect = forwardRef(({ addWrapper = true, form, fieldName, fieldsVal
20
20
  const callbackQueue = useRef([]);
21
21
  const debounceFetchOptionsRef = useRef(null);
22
22
 
23
+ const getOptions = () => {
24
+ return nOptions
25
+ }
26
+ const setOptions = (options) => {
27
+ setNOptions(options)
28
+ }
23
29
 
24
30
  useEffect(() => {
25
31
  // console.log("SearchSelect useEffect props", props)
@@ -264,7 +270,7 @@ const SearchSelect = forwardRef(({ addWrapper = true, form, fieldName, fieldsVal
264
270
 
265
271
  </OriginalSelect>
266
272
  {!props?.disabled && rightIcon}
267
- {!props?.disabled && typeof rightIconRender === 'function' && rightIconRender({ value, onChange, form, fieldName, recordFieldsChange, getAllWithIds, removeLastFieldsValues })}
273
+ {!props?.disabled && typeof rightIconRender === 'function' && rightIconRender({ value, onChange, form, fieldName, recordFieldsChange, getAllWithIds, removeLastFieldsValues,getOptions,setOptions })}
268
274
  </BaseWrapper>
269
275
  ) : (<>
270
276
  <OriginalSelect
@@ -283,7 +289,7 @@ const SearchSelect = forwardRef(({ addWrapper = true, form, fieldName, fieldsVal
283
289
 
284
290
  </OriginalSelect>
285
291
  {!props?.disabled && rightIcon}
286
- {!props?.disabled && typeof rightIconRender === 'function' && rightIconRender({ value, onChange, form, fieldName, recordFieldsChange, getAllWithIds, removeLastFieldsValues })}
292
+ {!props?.disabled && typeof rightIconRender === 'function' && rightIconRender({ value, onChange, form, fieldName, recordFieldsChange, getAllWithIds, removeLastFieldsValues,getOptions,setOptions })}
287
293
  </>
288
294
  )
289
295
 
@@ -283,23 +283,23 @@ const FormContainer = forwardRef(({ cols = 1, children, mode = "view" }, ref) =>
283
283
  const dependentChildren = dependent.children;
284
284
 
285
285
 
286
- if (!init && dependent?.fillRules && Array.isArray(dependent?.fillRules) && dependent?.fillRules.length > 0 && (!(typeof targetRowIndex === 'number' && targetRowIndex >= 0))) {
286
+ if (!init && dependent?.fillRules && Array.isArray(dependent?.fillRules) && dependent?.fillRules.length > 0 ) {
287
287
  handleFillRules(identifier, parentIdentifier, fieldValues, dependent?.fillRules)
288
288
  }
289
289
  for (let index = 0; index < dependentChildren.length; index++) {
290
290
  const child = dependentChildren[index];
291
- if (!(typeof targetRowIndex === 'number' && targetRowIndex >= 0)) {
292
- if (child.component.props.withVisibleFunc && typeof child.component.props.withVisibleFunc === 'function') {
293
- let needRefresh_ = handleFieldsVisibleFunc(fieldValues, child, parentIdentifier)
294
- needRefresh = needRefresh || needRefresh_
295
- }
296
291
 
297
- if (child.component.props.withVisible) {
298
- let needRefresh_ = await handleFieldsVisible(fieldValues, child, parentIdentifier, dependent?.componentName)
299
- needRefresh = needRefresh || needRefresh_
300
- }
292
+ if (child.component.props.withVisibleFunc && typeof child.component.props.withVisibleFunc === 'function') {
293
+ let needRefresh_ = handleFieldsVisibleFunc(fieldValues, child, parentIdentifier)
294
+ needRefresh = needRefresh || needRefresh_
295
+ }
296
+
297
+ if (child.component.props.withVisible) {
298
+ let needRefresh_ = await handleFieldsVisible(fieldValues, child, parentIdentifier, dependent?.componentName)
299
+ needRefresh = needRefresh || needRefresh_
301
300
  }
302
301
 
302
+
303
303
  if (!init && child.component.props.withFill)
304
304
  await handleFieldsWithFill(fieldValues, child, parentIdentifier, dependent?.componentName, currentFieldId, targetRowIndex)
305
305
 
@@ -445,10 +445,10 @@ const FormContainer = forwardRef(({ cols = 1, children, mode = "view" }, ref) =>
445
445
  setTimeout(() => {
446
446
  recordFieldsChange(changedFields, true)
447
447
  // console.log("idGroups", idGroups)
448
- if (idGroups.length > 0) idGroups.forEach(ids => {
449
- if (Array.isArray(ids) && ids.length > 0)
450
- handleTableAddRow(ids)
451
- })
448
+ if (idGroups.length > 0) idGroups.forEach(ids => {
449
+ if (Array.isArray(ids) && ids.length > 0)
450
+ handleTableAddRow(ids)
451
+ })
452
452
  }, 0)
453
453
  }
454
454
  // 处理级联显示隐藏 @return {boolean} 是否需要重新渲染表单的字段
@@ -881,13 +881,13 @@ const FormContainer = forwardRef(({ cols = 1, children, mode = "view" }, ref) =>
881
881
  })
882
882
  return withAllIds
883
883
  }
884
- const handleTableAddRow = (ids,targetRowIndex = -1) => {
884
+ const handleTableAddRow = (ids, targetRowIndex = -1) => {
885
885
  let withAllIds = getTableWithIds(ids)
886
886
  const fieldValues = form.getFieldsValue();
887
887
  setTimeout(async () => {
888
888
  for (let index = 0; index < withAllIds.length; index++) {
889
889
  const withid = withAllIds[index];
890
- await handleFieldsWith(withid, fieldValues,false,null,targetRowIndex);
890
+ await handleFieldsWith(withid, fieldValues, false, null, targetRowIndex);
891
891
  }
892
892
  }, 0);
893
893
  }