@acorex/cdk 22.1.0-next.9 → 22.1.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.
@@ -2114,9 +2114,17 @@ class MXSelectionValueComponent extends MXValueComponent {
2114
2114
  const valueKey = isComplexObject ? get(itemRecord, this.valueField) : item;
2115
2115
  const key = valueKey != null ? String(valueKey) : String(item);
2116
2116
  const cacheKey = this.createCacheKey(key);
2117
- // Return cached item if available and has text
2118
2117
  const cachedItem = this.dataService.cacheList[cacheKey];
2119
2118
  if (cachedItem && get(cachedItem, this.textField) != null) {
2119
+ if (isComplexObject) {
2120
+ const incomingText = get(itemRecord, this.textField);
2121
+ if (incomingText != null &&
2122
+ incomingText !== get(cachedItem, this.textField) &&
2123
+ incomingText !== '@acorex:common.status.loading') {
2124
+ Object.assign(cachedItem, itemRecord);
2125
+ delete cachedItem['_lastDisplayTextResult'];
2126
+ }
2127
+ }
2120
2128
  return cachedItem;
2121
2129
  }
2122
2130
  const hasTextProperty = !isComplexObject || get(itemRecord, this.textField) != null;
@@ -2314,6 +2322,20 @@ class MXSelectionValueComponent extends MXValueComponent {
2314
2322
  if (item && typeof item === 'object' && item['_displayTextLoading']) {
2315
2323
  return '@acorex:common.status.loading';
2316
2324
  }
2325
+ if (item && typeof item === 'object') {
2326
+ const incomingText = get(item, this.textField);
2327
+ if (incomingText != null && incomingText !== '' && incomingText !== '@acorex:common.status.loading') {
2328
+ const itemKey = get(item, this.valueField);
2329
+ if (itemKey != null) {
2330
+ const cachedItem = this.dataService.cacheList[this.createCacheKey(String(itemKey))];
2331
+ if (cachedItem && cachedItem[this.textField] !== incomingText) {
2332
+ cachedItem[this.textField] = incomingText;
2333
+ delete cachedItem['_lastDisplayTextResult'];
2334
+ }
2335
+ }
2336
+ return String(incomingText);
2337
+ }
2338
+ }
2317
2339
  // Add timestamp-based debouncing to prevent excessive calls for ALL item types
2318
2340
  const now = Date.now();
2319
2341
  const itemKey = typeof item === 'string' ? item : get(item, this.valueField);