@cqa-lib/cqa-ui 1.1.320 → 1.1.321
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/step-builder-loop/step-builder-loop.component.mjs +33 -15
- package/fesm2015/cqa-lib-cqa-ui.mjs +32 -14
- package/fesm2015/cqa-lib-cqa-ui.mjs.map +1 -1
- package/fesm2020/cqa-lib-cqa-ui.mjs +32 -14
- package/fesm2020/cqa-lib-cqa-ui.mjs.map +1 -1
- package/lib/step-builder/step-builder-loop/step-builder-loop.component.d.ts +10 -0
- package/package.json +1 -1
|
@@ -32372,24 +32372,42 @@ class StepBuilderLoopComponent {
|
|
|
32372
32372
|
}
|
|
32373
32373
|
this.updateLoopIndexOptions();
|
|
32374
32374
|
}
|
|
32375
|
+
/**
|
|
32376
|
+
* Get display name for a 1-based row index from the selected profile's data array (data[index-1].name).
|
|
32377
|
+
* Returns null if no name. Matches loop-step edit mode behavior.
|
|
32378
|
+
*/
|
|
32379
|
+
getDataRowNameForOneBasedIndex(oneBasedIndex) {
|
|
32380
|
+
const profile = this.selectedDataProfile;
|
|
32381
|
+
if (!profile?.data || !Array.isArray(profile.data))
|
|
32382
|
+
return null;
|
|
32383
|
+
const idx = oneBasedIndex - 1;
|
|
32384
|
+
if (idx < 0 || idx >= profile.data.length)
|
|
32385
|
+
return null;
|
|
32386
|
+
const row = profile.data[idx];
|
|
32387
|
+
return row && (row.name != null ? String(row.name) : null);
|
|
32388
|
+
}
|
|
32389
|
+
/**
|
|
32390
|
+
* Build label for a loop index option: "setName (n)" when row has name, else "Step (n)".
|
|
32391
|
+
* Matches loop-step edit mode dropdown display.
|
|
32392
|
+
*/
|
|
32393
|
+
getLoopIndexOptionLabel(idx) {
|
|
32394
|
+
const rowName = this.getDataRowNameForOneBasedIndex(idx);
|
|
32395
|
+
return rowName ? `${rowName} (${idx})` : `Step (${idx})`;
|
|
32396
|
+
}
|
|
32375
32397
|
/**
|
|
32376
32398
|
* Update loop start and end config options
|
|
32377
32399
|
*/
|
|
32378
32400
|
updateLoopIndexOptions() {
|
|
32379
|
-
// Convert startArray to SelectOptions
|
|
32380
|
-
const startOptions = this.startArray.map(idx =>
|
|
32381
|
-
|
|
32382
|
-
value: idx,
|
|
32383
|
-
|
|
32384
|
-
|
|
32385
|
-
|
|
32386
|
-
|
|
32387
|
-
|
|
32388
|
-
|
|
32389
|
-
value: idx,
|
|
32390
|
-
name: String(idx),
|
|
32391
|
-
label: String(idx)
|
|
32392
|
-
}));
|
|
32401
|
+
// Convert startArray to SelectOptions with "Step (n)" or "setName (n)" labels
|
|
32402
|
+
const startOptions = this.startArray.map(idx => {
|
|
32403
|
+
const label = this.getLoopIndexOptionLabel(idx);
|
|
32404
|
+
return { id: idx, value: idx, name: label, label };
|
|
32405
|
+
});
|
|
32406
|
+
// Convert endArray to SelectOptions with same label format
|
|
32407
|
+
const endOptions = this.endArray.map(idx => {
|
|
32408
|
+
const label = this.getLoopIndexOptionLabel(idx);
|
|
32409
|
+
return { id: idx, value: idx, name: label, label };
|
|
32410
|
+
});
|
|
32393
32411
|
this.loopStartConfig = {
|
|
32394
32412
|
...this.loopStartConfig,
|
|
32395
32413
|
options: [{ id: -1, value: -1, name: 'Start', label: 'Start' }, ...startOptions],
|