@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
|
@@ -32276,7 +32276,8 @@ class TemplateVariablesFormComponent {
|
|
|
32276
32276
|
getSelectConfig(variable, index) {
|
|
32277
32277
|
var _a, _b, _c;
|
|
32278
32278
|
// Use cache to avoid recalculating on every change detection
|
|
32279
|
-
// For element variables, include elementOptions
|
|
32279
|
+
// For element variables, include elementOptions + hasMoreElements in cache key.
|
|
32280
|
+
// Intentionally exclude isLoadingElements so search input instance stays stable while typing.
|
|
32280
32281
|
// For upload variables, include uploadOptions, hasMoreUploads, and isLoadingUploads in cache key
|
|
32281
32282
|
// Optimize cache key computation - use length instead of full array join for better performance
|
|
32282
32283
|
const isElementVariable = variable.dataKey === 'element' || variable.dataKey === 'label';
|
|
@@ -32288,7 +32289,7 @@ class TemplateVariablesFormComponent {
|
|
|
32288
32289
|
: `${((_a = variable.options) === null || _a === void 0 ? void 0 : _a.length) || 0}_${((_b = variable.options) === null || _b === void 0 ? void 0 : _b.join(',')) || ''}`;
|
|
32289
32290
|
// Include hasMore and isLoading in cache key for element and upload variables
|
|
32290
32291
|
const cacheKey = isElementVariable
|
|
32291
|
-
? `${variable.name}_${optionsKey}_${this.hasMoreElements}
|
|
32292
|
+
? `${variable.name}_${optionsKey}_${this.hasMoreElements}`
|
|
32292
32293
|
: isUploadVariable
|
|
32293
32294
|
? `${variable.name}_${optionsKey}_${this.hasMoreUploads}_${this.isLoadingUploads}`
|
|
32294
32295
|
: `${variable.name}_${optionsKey}`;
|
|
@@ -33695,8 +33696,9 @@ class TemplateVariablesFormComponent {
|
|
|
33695
33696
|
getElementSelectConfig(variable, index) {
|
|
33696
33697
|
// Get selected screen name ID
|
|
33697
33698
|
const selectedScreenNameId = variable.screenNameId;
|
|
33698
|
-
// Include elementOptions length
|
|
33699
|
-
|
|
33699
|
+
// Include elementOptions length in cache key to invalidate when elements change.
|
|
33700
|
+
// Exclude isLoadingElements so the dropdown/search input does not re-initialize every keystroke.
|
|
33701
|
+
const cacheKey = `${variable.name}_element_${selectedScreenNameId || ''}_${this.elementOptions.length}`;
|
|
33700
33702
|
// Early return from cache - this is the most common path and should be very fast
|
|
33701
33703
|
if (this.elementSelectConfigCache.has(cacheKey)) {
|
|
33702
33704
|
return this.elementSelectConfigCache.get(cacheKey);
|
|
@@ -33713,19 +33715,6 @@ class TemplateVariablesFormComponent {
|
|
|
33713
33715
|
this.elementSelectConfigCache.set(cacheKey, emptyConfig);
|
|
33714
33716
|
return emptyConfig;
|
|
33715
33717
|
}
|
|
33716
|
-
// If elements are still loading, return a loading config and cache it
|
|
33717
|
-
if (this.isLoadingElements) {
|
|
33718
|
-
const loadingConfig = {
|
|
33719
|
-
key: 'value',
|
|
33720
|
-
placeholder: 'Loading elements...',
|
|
33721
|
-
multiple: false,
|
|
33722
|
-
searchable: false,
|
|
33723
|
-
options: [],
|
|
33724
|
-
isLoading: true
|
|
33725
|
-
};
|
|
33726
|
-
this.elementSelectConfigCache.set(cacheKey, loadingConfig);
|
|
33727
|
-
return loadingConfig;
|
|
33728
|
-
}
|
|
33729
33718
|
// Filter elements by selected screen name
|
|
33730
33719
|
// Compare both as numbers to ensure type matching
|
|
33731
33720
|
const filteredElements = this.elementOptions.filter(el => {
|