@mcurros2/microm 1.1.419-0 → 1.1.421-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/index.js CHANGED
@@ -35651,10 +35651,10 @@ function $7453d94b4131a5b6$export$5d8bfd620f16e3fd(props) {
35651
35651
  const labelColor = theme.colorScheme === 'dark' ? theme.colors.dark[0] : theme.colors.gray[9];
35652
35652
  const descriptionColor = theme.colorScheme === 'dark' ? theme.colors.dark[2] : theme.colors.gray[6];
35653
35653
  (0, $b4te3$react.useEffect)(()=>{
35654
- column.valueDescription = lookupAPI.lookupResult?.description;
35654
+ column.valueDescription = lookupAPI.lookupResult?.description ?? '';
35655
35655
  }, [
35656
35656
  column,
35657
- lookupAPI.lookupResult?.description
35657
+ lookupAPI.lookupResult
35658
35658
  ]);
35659
35659
  (0, $b4te3$react.useEffect)(()=>{
35660
35660
  if (onLookupPerformed && lookupAPI.lookupResult) onLookupPerformed(lookupAPI.lookupResult);
@@ -35813,7 +35813,7 @@ const $d296e9f4d3930bfd$export$4db9dd7eda56bf7b = ({ entityForm: entityForm, ent
35813
35813
  const doLookup = async (lookupKey = keyValue)=>{
35814
35814
  const requestValues = prepareLookupValues(lookupKey);
35815
35815
  const cached = lastValidLookup.current;
35816
- if (cached && cached.entity === entity && cached.lookupDefName === lookupDefName && cached.lookupProc === currentLookupDef.proc && (0, $2cfmO.areValuesObjectsEqual)(cached.values, requestValues)) {
35816
+ if (cached && (0, $2cfmO.areValuesObjectsEqual)(cached.values, requestValues)) {
35817
35817
  const cachedStatus = {
35818
35818
  data: {
35819
35819
  key: lookupKey,
@@ -35840,9 +35840,6 @@ const $d296e9f4d3930bfd$export$4db9dd7eda56bf7b = ({ entityForm: entityForm, ent
35840
35840
  };
35841
35841
  setStatus(new_status);
35842
35842
  if (result) lastValidLookup.current = {
35843
- entity: entity,
35844
- lookupDefName: lookupDefName,
35845
- lookupProc: currentLookupDef.proc,
35846
35843
  values: (0, $2cfmO.copyValuesObject)(requestValues),
35847
35844
  description: result
35848
35845
  };
@@ -35959,9 +35956,7 @@ const $d296e9f4d3930bfd$export$4db9dd7eda56bf7b = ({ entityForm: entityForm, ent
35959
35956
  enableDelete,
35960
35957
  enableEdit,
35961
35958
  enableView,
35962
- entity,
35963
35959
  entityForm.form,
35964
- lookupDefName,
35965
35960
  lookupForm,
35966
35961
  parentKeys
35967
35962
  ]);
@@ -35990,6 +35985,19 @@ const $d296e9f4d3930bfd$export$4db9dd7eda56bf7b = ({ entityForm: entityForm, ent
35990
35985
  ]);
35991
35986
  const lookupInputProps = entityForm.form.getInputProps(column);
35992
35987
  const mantine_onblur = lookupInputProps.onBlur;
35988
+ const bindingValue = entityForm.form.values[column];
35989
+ let resolvedLookupResult = lookupResult;
35990
+ if (lookupResult && !(0, $2cfmO.areValuesObjectsEqual)({
35991
+ key: lookupResult.key
35992
+ }, {
35993
+ key: bindingValue
35994
+ })) {
35995
+ // The form can be changed outside this control (for example, when a hierarchy
35996
+ // parent clears its descendants). Do not expose a description for another key.
35997
+ setLookupResult(undefined);
35998
+ setPreviousLookupResult(undefined);
35999
+ resolvedLookupResult = undefined;
36000
+ }
35993
36001
  const onBlur = (0, $b4te3$react.useCallback)(async (bindingColumn, force = false, event = null, new_value)=>{
35994
36002
  if (isLooking.current === true) return;
35995
36003
  isLooking.current = true;
@@ -36077,7 +36085,7 @@ const $d296e9f4d3930bfd$export$4db9dd7eda56bf7b = ({ entityForm: entityForm, ent
36077
36085
  ]);
36078
36086
  return {
36079
36087
  status: status,
36080
- lookupResult: lookupResult,
36088
+ lookupResult: resolvedLookupResult,
36081
36089
  lookupInputProps: lookupInputProps,
36082
36090
  onBlur: onBlur
36083
36091
  };