@cqa-lib/cqa-ui 1.1.412 → 1.1.413
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/esm2020/lib/step-builder/template-variables-form/template-variables-form.component.mjs +7 -18
- package/fesm2015/cqa-lib-cqa-ui.mjs +6 -17
- package/fesm2015/cqa-lib-cqa-ui.mjs.map +1 -1
- package/fesm2020/cqa-lib-cqa-ui.mjs +6 -17
- package/fesm2020/cqa-lib-cqa-ui.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -32228,7 +32228,8 @@ class TemplateVariablesFormComponent {
|
|
|
32228
32228
|
}
|
|
32229
32229
|
getSelectConfig(variable, index) {
|
|
32230
32230
|
// Use cache to avoid recalculating on every change detection
|
|
32231
|
-
// For element variables, include elementOptions
|
|
32231
|
+
// For element variables, include elementOptions + hasMoreElements in cache key.
|
|
32232
|
+
// Intentionally exclude isLoadingElements so search input instance stays stable while typing.
|
|
32232
32233
|
// For upload variables, include uploadOptions, hasMoreUploads, and isLoadingUploads in cache key
|
|
32233
32234
|
// Optimize cache key computation - use length instead of full array join for better performance
|
|
32234
32235
|
const isElementVariable = variable.dataKey === 'element' || variable.dataKey === 'label';
|
|
@@ -32240,7 +32241,7 @@ class TemplateVariablesFormComponent {
|
|
|
32240
32241
|
: `${variable.options?.length || 0}_${variable.options?.join(',') || ''}`;
|
|
32241
32242
|
// Include hasMore and isLoading in cache key for element and upload variables
|
|
32242
32243
|
const cacheKey = isElementVariable
|
|
32243
|
-
? `${variable.name}_${optionsKey}_${this.hasMoreElements}
|
|
32244
|
+
? `${variable.name}_${optionsKey}_${this.hasMoreElements}`
|
|
32244
32245
|
: isUploadVariable
|
|
32245
32246
|
? `${variable.name}_${optionsKey}_${this.hasMoreUploads}_${this.isLoadingUploads}`
|
|
32246
32247
|
: `${variable.name}_${optionsKey}`;
|
|
@@ -33623,8 +33624,9 @@ class TemplateVariablesFormComponent {
|
|
|
33623
33624
|
getElementSelectConfig(variable, index) {
|
|
33624
33625
|
// Get selected screen name ID
|
|
33625
33626
|
const selectedScreenNameId = variable.screenNameId;
|
|
33626
|
-
// Include elementOptions length
|
|
33627
|
-
|
|
33627
|
+
// Include elementOptions length in cache key to invalidate when elements change.
|
|
33628
|
+
// Exclude isLoadingElements so the dropdown/search input does not re-initialize every keystroke.
|
|
33629
|
+
const cacheKey = `${variable.name}_element_${selectedScreenNameId || ''}_${this.elementOptions.length}`;
|
|
33628
33630
|
// Early return from cache - this is the most common path and should be very fast
|
|
33629
33631
|
if (this.elementSelectConfigCache.has(cacheKey)) {
|
|
33630
33632
|
return this.elementSelectConfigCache.get(cacheKey);
|
|
@@ -33641,19 +33643,6 @@ class TemplateVariablesFormComponent {
|
|
|
33641
33643
|
this.elementSelectConfigCache.set(cacheKey, emptyConfig);
|
|
33642
33644
|
return emptyConfig;
|
|
33643
33645
|
}
|
|
33644
|
-
// If elements are still loading, return a loading config and cache it
|
|
33645
|
-
if (this.isLoadingElements) {
|
|
33646
|
-
const loadingConfig = {
|
|
33647
|
-
key: 'value',
|
|
33648
|
-
placeholder: 'Loading elements...',
|
|
33649
|
-
multiple: false,
|
|
33650
|
-
searchable: false,
|
|
33651
|
-
options: [],
|
|
33652
|
-
isLoading: true
|
|
33653
|
-
};
|
|
33654
|
-
this.elementSelectConfigCache.set(cacheKey, loadingConfig);
|
|
33655
|
-
return loadingConfig;
|
|
33656
|
-
}
|
|
33657
33646
|
// Filter elements by selected screen name
|
|
33658
33647
|
// Compare both as numbers to ensure type matching
|
|
33659
33648
|
const filteredElements = this.elementOptions.filter(el => {
|