jupiter-dynamic-forms 1.18.6 → 1.18.8
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/core/dynamic-form.d.ts.map +1 -1
- package/dist/core/form-field.d.ts +1 -0
- package/dist/core/form-field.d.ts.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +167 -36
- package/dist/index.mjs.map +1 -1
- package/dist/utils/type-input-mapping.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3056,6 +3056,16 @@ function determineInputTypeFromBaseChain(baseTypeChain, datatypes) {
|
|
|
3056
3056
|
placeholder: I18n.t("field.enterWholeNumber")
|
|
3057
3057
|
};
|
|
3058
3058
|
}
|
|
3059
|
+
if (chainLower.some((type) => type.includes("percent") || type.includes("pure"))) {
|
|
3060
|
+
return {
|
|
3061
|
+
fieldType: "percentage",
|
|
3062
|
+
htmlInputType: "text",
|
|
3063
|
+
inputMode: "decimal",
|
|
3064
|
+
allowDecimals: true,
|
|
3065
|
+
step: 0.01,
|
|
3066
|
+
placeholder: I18n.t("field.enterPercentage")
|
|
3067
|
+
};
|
|
3068
|
+
}
|
|
3059
3069
|
if (chainLower.some((type) => type.includes("decimal") || type === "decimal")) {
|
|
3060
3070
|
if (chainString.includes("monetary") || chainString.includes("currency")) {
|
|
3061
3071
|
if (chainString.includes("nodecimals") || chainString.includes("no-decimals") || chainString.includes("nodecimals20")) {
|
|
@@ -3230,6 +3240,17 @@ let JupiterFormField = class extends LitElement {
|
|
|
3230
3240
|
}
|
|
3231
3241
|
this._numericDraftValue = null;
|
|
3232
3242
|
}
|
|
3243
|
+
if (this._isPercentItemType() && this.value !== null && this.value !== void 0) {
|
|
3244
|
+
const numVal = Number(this.value);
|
|
3245
|
+
if (!isNaN(numVal) && Math.abs(numVal) >= 1) {
|
|
3246
|
+
this.value = numVal / 100;
|
|
3247
|
+
const oldValue = numVal;
|
|
3248
|
+
this.dispatchEvent(new CustomEvent("field-change", {
|
|
3249
|
+
detail: { fieldId: this.field.id, conceptId: this.conceptId, columnId: this.columnId, value: this.value, oldValue },
|
|
3250
|
+
bubbles: true
|
|
3251
|
+
}));
|
|
3252
|
+
}
|
|
3253
|
+
}
|
|
3233
3254
|
this._touched = true;
|
|
3234
3255
|
this._validateXBRLDatatype();
|
|
3235
3256
|
this._validateUnitSelection();
|
|
@@ -3264,6 +3285,16 @@ let JupiterFormField = class extends LitElement {
|
|
|
3264
3285
|
(type) => type.includes("monetary") || type.includes("Monetary")
|
|
3265
3286
|
);
|
|
3266
3287
|
}
|
|
3288
|
+
_isPercentItemType() {
|
|
3289
|
+
if (!this.conceptType)
|
|
3290
|
+
return false;
|
|
3291
|
+
if (this.conceptType.toLowerCase().includes("percent"))
|
|
3292
|
+
return true;
|
|
3293
|
+
if (!this.datatypes)
|
|
3294
|
+
return false;
|
|
3295
|
+
const baseTypeChain = resolveBaseTypeChain(this.conceptType, this.datatypes);
|
|
3296
|
+
return baseTypeChain.some((type) => type.toLowerCase().includes("percent"));
|
|
3297
|
+
}
|
|
3267
3298
|
/**
|
|
3268
3299
|
* Prevents non-numeric input in number fields for Firefox compatibility
|
|
3269
3300
|
* Firefox allows typing any character in type="number" inputs
|
|
@@ -3779,7 +3810,14 @@ let JupiterFormField = class extends LitElement {
|
|
|
3779
3810
|
const step = typeConfig.step !== void 0 ? typeConfig.step : isNumericType(effectiveFieldType) ? "any" : void 0;
|
|
3780
3811
|
const min = typeConfig.min;
|
|
3781
3812
|
const max = typeConfig.max;
|
|
3782
|
-
|
|
3813
|
+
let renderedInputValue;
|
|
3814
|
+
if (this._isNumericField() && this._numericDraftValue !== null) {
|
|
3815
|
+
renderedInputValue = this._numericDraftValue;
|
|
3816
|
+
} else if (effectiveFieldType === "percentage" && effectiveValue !== null && effectiveValue !== void 0 && effectiveValue !== "") {
|
|
3817
|
+
renderedInputValue = Number(effectiveValue).toFixed(4);
|
|
3818
|
+
} else {
|
|
3819
|
+
renderedInputValue = effectiveValue ?? "";
|
|
3820
|
+
}
|
|
3783
3821
|
return html`
|
|
3784
3822
|
<input
|
|
3785
3823
|
id="${fieldId}"
|
|
@@ -3973,7 +4011,7 @@ let JupiterFormField = class extends LitElement {
|
|
|
3973
4011
|
</div>
|
|
3974
4012
|
` : ""}
|
|
3975
4013
|
|
|
3976
|
-
${this._isMonetaryType() ? html`
|
|
4014
|
+
${this._isMonetaryType() || this._isPercentItemType() ? html`
|
|
3977
4015
|
<div class="period-controls">
|
|
3978
4016
|
<label>${I18n.t("field.scale")}:</label>
|
|
3979
4017
|
<input
|
|
@@ -3981,7 +4019,7 @@ let JupiterFormField = class extends LitElement {
|
|
|
3981
4019
|
min="0"
|
|
3982
4020
|
class="typed-member-input"
|
|
3983
4021
|
placeholder="Leave blank for INF"
|
|
3984
|
-
.value="${this.decimals !== void 0 && this.decimals !== null && this.decimals !== "" ? this.decimals : this.globalDecimals !== "INF" ? this.globalDecimals : ""}"
|
|
4022
|
+
.value="${this.decimals !== void 0 && this.decimals !== null && this.decimals !== "" ? this.decimals : this._isPercentItemType() ? "4" : this.globalDecimals !== "INF" ? this.globalDecimals : ""}"
|
|
3985
4023
|
@input="${this._handleDecimalsChange}"
|
|
3986
4024
|
?disabled="${this.disabled}"
|
|
3987
4025
|
/>
|
|
@@ -11268,7 +11306,7 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
11268
11306
|
return null;
|
|
11269
11307
|
}
|
|
11270
11308
|
_addConceptDataToSubmission(concept, columnId, value, submissionData, section2) {
|
|
11271
|
-
var _a, _b, _c, _d, _e;
|
|
11309
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
11272
11310
|
const field2 = concept.fields.find((f2) => f2.columnId === columnId);
|
|
11273
11311
|
if (!field2)
|
|
11274
11312
|
return;
|
|
@@ -11280,6 +11318,12 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
11280
11318
|
const periodStartDate = (fieldPeriodData == null ? void 0 : fieldPeriodData.startDate) || (column2 == null ? void 0 : column2.periodStartDate) || field2.periodStartDate || this.periodStartDate;
|
|
11281
11319
|
const periodEndDate = (fieldPeriodData == null ? void 0 : fieldPeriodData.endDate) || (column2 == null ? void 0 : column2.periodEndDate) || field2.periodEndDate || this.periodEndDate;
|
|
11282
11320
|
const periodInstantDate = (fieldPeriodData == null ? void 0 : fieldPeriodData.instantDate) || field2.periodInstantDate || periodEndDate || periodStartDate;
|
|
11321
|
+
if ((_c = concept.type) == null ? void 0 : _c.toLowerCase().includes("percentitemtype")) {
|
|
11322
|
+
const numericValue = Number(value);
|
|
11323
|
+
if (!isNaN(numericValue) && Math.abs(numericValue) >= 1) {
|
|
11324
|
+
value = numericValue / 100;
|
|
11325
|
+
}
|
|
11326
|
+
}
|
|
11283
11327
|
const entry = {
|
|
11284
11328
|
conceptId: concept.originalConceptId || concept.id,
|
|
11285
11329
|
columnId,
|
|
@@ -11296,14 +11340,16 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
11296
11340
|
entry.unit = fieldUnit;
|
|
11297
11341
|
console.log(`✅ [Submission] Adding unit to entry: ${fieldUnit} for ${concept.id}/${columnId}`);
|
|
11298
11342
|
}
|
|
11299
|
-
const isMonetary = (
|
|
11300
|
-
const
|
|
11301
|
-
const
|
|
11302
|
-
|
|
11343
|
+
const isMonetary = (_d = concept.type) == null ? void 0 : _d.toLowerCase().includes("monetary");
|
|
11344
|
+
const isPercent = (_e = concept.type) == null ? void 0 : _e.toLowerCase().includes("percentitemtype");
|
|
11345
|
+
const fieldDecimals = (_f = this._decimalsData[concept.id]) == null ? void 0 : _f[columnId];
|
|
11346
|
+
const globalFallback = isPercent ? "4" : this.decimals !== "INF" ? this.decimals : void 0;
|
|
11347
|
+
const decimalsValue = fieldDecimals || globalFallback;
|
|
11348
|
+
if ((isMonetary || isPercent) && decimalsValue) {
|
|
11303
11349
|
const parsed = parseFloat(decimalsValue);
|
|
11304
11350
|
entry.decimals = isNaN(parsed) ? decimalsValue : String(-Math.abs(parsed));
|
|
11305
11351
|
}
|
|
11306
|
-
if ((
|
|
11352
|
+
if ((_g = column2 == null ? void 0 : column2.dimensionData) == null ? void 0 : _g.memberLabel) {
|
|
11307
11353
|
entry.dimension = column2.dimensionData.memberLabel;
|
|
11308
11354
|
}
|
|
11309
11355
|
console.log(`📤 [Submission Entry] Created entry:`, JSON.stringify(entry, null, 2));
|
|
@@ -11441,7 +11487,7 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
11441
11487
|
}
|
|
11442
11488
|
if (concept.fields && concept.fields.length > 0) {
|
|
11443
11489
|
concept.fields.forEach((field2) => {
|
|
11444
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
11490
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
11445
11491
|
const conceptData = this._formData[concept.id];
|
|
11446
11492
|
let fieldValue = conceptData == null ? void 0 : conceptData[field2.columnId];
|
|
11447
11493
|
const baseConceptId = field2.conceptId || concept.id.split("__").slice(0, -1).join("__") || concept.id;
|
|
@@ -11459,8 +11505,14 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
11459
11505
|
}
|
|
11460
11506
|
}
|
|
11461
11507
|
if (fieldValue !== void 0 && fieldValue !== null && fieldValue !== "") {
|
|
11508
|
+
if ((_b = concept.type) == null ? void 0 : _b.toLowerCase().includes("percentitemtype")) {
|
|
11509
|
+
const numericFieldValue = Number(fieldValue);
|
|
11510
|
+
if (!isNaN(numericFieldValue) && Math.abs(numericFieldValue) >= 1) {
|
|
11511
|
+
fieldValue = numericFieldValue / 100;
|
|
11512
|
+
}
|
|
11513
|
+
}
|
|
11462
11514
|
const column2 = this._findColumnByIdInSection(field2.columnId, section2);
|
|
11463
|
-
const fieldPeriodData = (
|
|
11515
|
+
const fieldPeriodData = (_c = this._periodData[concept.id]) == null ? void 0 : _c[field2.columnId];
|
|
11464
11516
|
const submissionEntry = {
|
|
11465
11517
|
conceptId: concept.id,
|
|
11466
11518
|
draftInstanceId: concept.id,
|
|
@@ -11482,21 +11534,23 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
11482
11534
|
submissionEntry.period.endDate = endDate;
|
|
11483
11535
|
}
|
|
11484
11536
|
console.log(`🔍 [Submission] Concept: ${concept.id}, Column: ${field2.columnId}, Field Period: ${fieldPeriodData ? JSON.stringify(fieldPeriodData) : "none"}, Column Period: ${(column2 == null ? void 0 : column2.periodStartDate) || "none"} - ${(column2 == null ? void 0 : column2.periodEndDate) || "none"}, Used Period: ${submissionEntry.period.type === "instant" ? submissionEntry.period.date : `${submissionEntry.period.startDate} - ${submissionEntry.period.endDate}`}`);
|
|
11485
|
-
const fieldUnit = (
|
|
11537
|
+
const fieldUnit = (_d = this._unitData[concept.id]) == null ? void 0 : _d[field2.columnId];
|
|
11486
11538
|
if (fieldUnit) {
|
|
11487
11539
|
submissionEntry.unit = fieldUnit;
|
|
11488
11540
|
console.log(`✅ [Submission] Adding unit to entry: ${fieldUnit} for ${concept.id}/${field2.columnId}`);
|
|
11489
11541
|
} else {
|
|
11490
11542
|
console.log(`⚠️ [Submission] No unit found in _unitData for ${concept.id}/${field2.columnId}. _unitData state:`, JSON.stringify(this._unitData, null, 2));
|
|
11491
11543
|
}
|
|
11492
|
-
const isMonetary = (
|
|
11493
|
-
const
|
|
11494
|
-
const
|
|
11495
|
-
|
|
11544
|
+
const isMonetary = (_e = concept.type) == null ? void 0 : _e.toLowerCase().includes("monetary");
|
|
11545
|
+
const isPercent = (_f = concept.type) == null ? void 0 : _f.toLowerCase().includes("percentitemtype");
|
|
11546
|
+
const fieldDecimals = (_g = this._decimalsData[concept.id]) == null ? void 0 : _g[field2.columnId];
|
|
11547
|
+
const globalFallback = isPercent ? "4" : this.decimals !== "INF" ? this.decimals : void 0;
|
|
11548
|
+
const decimalsValue = fieldDecimals || globalFallback;
|
|
11549
|
+
if ((isMonetary || isPercent) && decimalsValue) {
|
|
11496
11550
|
const parsed = parseFloat(decimalsValue);
|
|
11497
11551
|
submissionEntry.decimals = isNaN(parsed) ? decimalsValue : String(-Math.abs(parsed));
|
|
11498
11552
|
}
|
|
11499
|
-
if ((column2 == null ? void 0 : column2.type) === "dimension" && ((
|
|
11553
|
+
if ((column2 == null ? void 0 : column2.type) === "dimension" && ((_h = column2.dimensionData) == null ? void 0 : _h.dimensionIdKey)) {
|
|
11500
11554
|
submissionEntry.dimension = column2.dimensionData.dimensionIdKey;
|
|
11501
11555
|
console.log(`🔍 [DynamicForm] Using dimension key from field's column (${field2.columnId}):`, column2.dimensionData.dimensionIdKey);
|
|
11502
11556
|
} else {
|
|
@@ -11532,12 +11586,12 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
11532
11586
|
console.log(`🔍 [DynamicForm] Column details:`, {
|
|
11533
11587
|
id: column2.id,
|
|
11534
11588
|
type: column2.type,
|
|
11535
|
-
hasTypedMembers: (
|
|
11589
|
+
hasTypedMembers: (_i = column2.dimensionData) == null ? void 0 : _i.hasTypedMembers,
|
|
11536
11590
|
dimensionData: column2.dimensionData
|
|
11537
11591
|
});
|
|
11538
11592
|
}
|
|
11539
11593
|
}
|
|
11540
|
-
if (!submissionEntry.typedMembers && ((
|
|
11594
|
+
if (!submissionEntry.typedMembers && ((_j = field2.crossRoleTypedMembers) == null ? void 0 : _j.length)) {
|
|
11541
11595
|
const crossRoleKey = `${concept.id}__${field2.columnId}`;
|
|
11542
11596
|
const crossRoleValues = this._typedMemberData[crossRoleKey];
|
|
11543
11597
|
if (crossRoleValues) {
|
|
@@ -11904,8 +11958,17 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
11904
11958
|
return result;
|
|
11905
11959
|
}
|
|
11906
11960
|
const query = searchText.toLowerCase().trim();
|
|
11961
|
+
const addAllDescendants = (concepts) => {
|
|
11962
|
+
var _a2;
|
|
11963
|
+
for (const concept of concepts) {
|
|
11964
|
+
result.add(concept.id);
|
|
11965
|
+
if ((_a2 = concept.children) == null ? void 0 : _a2.length) {
|
|
11966
|
+
addAllDescendants(concept.children);
|
|
11967
|
+
}
|
|
11968
|
+
}
|
|
11969
|
+
};
|
|
11907
11970
|
const walkConcepts = (concepts) => {
|
|
11908
|
-
var _a2, _b2, _c2;
|
|
11971
|
+
var _a2, _b2, _c2, _d;
|
|
11909
11972
|
for (const concept of concepts) {
|
|
11910
11973
|
let matches = ((_a2 = concept.conceptName) == null ? void 0 : _a2.toLowerCase().includes(query)) || ((_b2 = concept.id) == null ? void 0 : _b2.toLowerCase().includes(query));
|
|
11911
11974
|
if (!matches && Array.isArray(concept.labels)) {
|
|
@@ -11916,8 +11979,10 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
11916
11979
|
}
|
|
11917
11980
|
if (matches) {
|
|
11918
11981
|
result.add(concept.id);
|
|
11919
|
-
|
|
11920
|
-
|
|
11982
|
+
if ((_c2 = concept.children) == null ? void 0 : _c2.length) {
|
|
11983
|
+
addAllDescendants(concept.children);
|
|
11984
|
+
}
|
|
11985
|
+
} else if ((_d = concept.children) == null ? void 0 : _d.length) {
|
|
11921
11986
|
walkConcepts(concept.children);
|
|
11922
11987
|
}
|
|
11923
11988
|
}
|
|
@@ -12616,7 +12681,8 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
12616
12681
|
})) == null ? void 0 : _a.id;
|
|
12617
12682
|
}
|
|
12618
12683
|
async scrollToConcept(conceptName, dimensions, match) {
|
|
12619
|
-
var _a, _b, _c, _d, _e, _f;
|
|
12684
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
12685
|
+
console.log(`[scrollToConcept] ▶ START conceptName=${conceptName} value=${match == null ? void 0 : match.value} dims=${JSON.stringify(dimensions)}`);
|
|
12620
12686
|
let targetSection = null;
|
|
12621
12687
|
let targetConcept = null;
|
|
12622
12688
|
const sectionsToSearch = [
|
|
@@ -12626,18 +12692,35 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
12626
12692
|
return !((_a2 = this._currentSchema) == null ? void 0 : _a2.sections.find((cs) => cs.id === s2.id));
|
|
12627
12693
|
})
|
|
12628
12694
|
];
|
|
12695
|
+
console.log(`[scrollToConcept] Searching ${sectionsToSearch.length} sections`);
|
|
12629
12696
|
for (const section2 of sectionsToSearch) {
|
|
12630
12697
|
const found = this._findConceptByName(section2.concepts, conceptName);
|
|
12631
12698
|
if (found) {
|
|
12632
|
-
|
|
12633
|
-
|
|
12634
|
-
|
|
12699
|
+
if (dimensions == null ? void 0 : dimensions.length) {
|
|
12700
|
+
const cols = section2.columns ?? this._columns;
|
|
12701
|
+
const colId = this._findColumnByDimensions(cols, dimensions);
|
|
12702
|
+
console.log(`[scrollToConcept] Section "${section2.id}" has concept "${found.id}" | colMatch=${colId ?? "null"} | cols=${cols.map((c2) => c2.id).join(",")}`);
|
|
12703
|
+
if (colId) {
|
|
12704
|
+
targetSection = section2;
|
|
12705
|
+
targetConcept = found;
|
|
12706
|
+
break;
|
|
12707
|
+
} else if (!targetSection) {
|
|
12708
|
+
targetSection = section2;
|
|
12709
|
+
targetConcept = found;
|
|
12710
|
+
}
|
|
12711
|
+
} else {
|
|
12712
|
+
console.log(`[scrollToConcept] Section "${section2.id}" has concept "${found.id}" (no dims, taking first)`);
|
|
12713
|
+
targetSection = section2;
|
|
12714
|
+
targetConcept = found;
|
|
12715
|
+
break;
|
|
12716
|
+
}
|
|
12635
12717
|
}
|
|
12636
12718
|
}
|
|
12637
12719
|
if (!targetSection || !targetConcept) {
|
|
12638
12720
|
console.warn(`[scrollToConcept] Concept not found: ${conceptName}`);
|
|
12639
12721
|
return;
|
|
12640
12722
|
}
|
|
12723
|
+
console.log(`[scrollToConcept] → targetSection="${targetSection.id}" targetConceptId="${targetConcept.id}"`);
|
|
12641
12724
|
targetSection.expanded = true;
|
|
12642
12725
|
if (this.display === "sidePanel" && this._activeSidePanelRoleId !== targetSection.id) {
|
|
12643
12726
|
this._activeSidePanelRoleId = targetSection.id;
|
|
@@ -12651,10 +12734,12 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
12651
12734
|
} else if (!hasValueMatch) {
|
|
12652
12735
|
targetColumnId = ((_b = columns[0]) == null ? void 0 : _b.id) ?? null;
|
|
12653
12736
|
}
|
|
12737
|
+
console.log(`[scrollToConcept] targetColumnId=${targetColumnId} hasValueMatch=${hasValueMatch} targetValue=${targetValue}`);
|
|
12654
12738
|
this.requestUpdate();
|
|
12655
12739
|
await this.updateComplete;
|
|
12656
12740
|
await new Promise((resolve) => setTimeout(resolve, 300));
|
|
12657
12741
|
const sectionElements = (_c = this.shadowRoot) == null ? void 0 : _c.querySelectorAll("jupiter-form-section");
|
|
12742
|
+
console.log(`[scrollToConcept] DOM: found ${(sectionElements == null ? void 0 : sectionElements.length) ?? 0} jupiter-form-section elements`);
|
|
12658
12743
|
let targetSectionEl = null;
|
|
12659
12744
|
sectionElements == null ? void 0 : sectionElements.forEach((el) => {
|
|
12660
12745
|
var _a2;
|
|
@@ -12667,8 +12752,13 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
12667
12752
|
}
|
|
12668
12753
|
await targetSectionEl.updateComplete;
|
|
12669
12754
|
const conceptTrees = (_d = targetSectionEl.shadowRoot) == null ? void 0 : _d.querySelectorAll("jupiter-concept-tree");
|
|
12755
|
+
console.log(`[scrollToConcept] conceptTrees in targetSection: ${(conceptTrees == null ? void 0 : conceptTrees.length) ?? 0}`);
|
|
12670
12756
|
let targetFieldEl = null;
|
|
12671
12757
|
const conceptId = targetConcept.id;
|
|
12758
|
+
const conceptIdBase = conceptId.includes("__") ? conceptId.split("__")[0] : conceptId;
|
|
12759
|
+
console.log(`[scrollToConcept] conceptId="${conceptId}" conceptIdBase="${conceptIdBase}"`);
|
|
12760
|
+
const sameBaseConcept = (fieldConceptId) => fieldConceptId === conceptId || fieldConceptId.includes("__") && fieldConceptId.split("__")[0] === conceptIdBase;
|
|
12761
|
+
let phase1FieldCount = 0;
|
|
12672
12762
|
conceptTrees == null ? void 0 : conceptTrees.forEach((ct) => {
|
|
12673
12763
|
var _a2;
|
|
12674
12764
|
if (targetFieldEl)
|
|
@@ -12679,31 +12769,72 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
12679
12769
|
return;
|
|
12680
12770
|
const columnMatch = targetColumnId ? fieldEl.conceptId === conceptId && fieldEl.columnId === targetColumnId : fieldEl.conceptId === conceptId;
|
|
12681
12771
|
const valueMatch = !hasValueMatch || String(fieldEl.value ?? "") === targetValue;
|
|
12772
|
+
if (columnMatch) {
|
|
12773
|
+
phase1FieldCount++;
|
|
12774
|
+
console.log(`[scrollToConcept] Phase1 candidate: conceptId=${fieldEl.conceptId} columnId=${fieldEl.columnId} value=${fieldEl.value} valueMatch=${valueMatch}`);
|
|
12775
|
+
}
|
|
12682
12776
|
if (columnMatch && valueMatch)
|
|
12683
12777
|
targetFieldEl = fieldEl;
|
|
12684
12778
|
});
|
|
12685
12779
|
});
|
|
12686
|
-
|
|
12687
|
-
|
|
12780
|
+
console.log(`[scrollToConcept] Phase1: scanned ${phase1FieldCount} candidates, found=${!!targetFieldEl}`);
|
|
12781
|
+
if (!targetFieldEl && hasValueMatch) {
|
|
12782
|
+
console.log(`[scrollToConcept] Phase2: searching ALL sections by base concept name + value`);
|
|
12783
|
+
const allSectionEls = ((_e = this.shadowRoot) == null ? void 0 : _e.querySelectorAll("jupiter-form-section")) ?? [];
|
|
12784
|
+
for (const secEl of Array.from(allSectionEls)) {
|
|
12688
12785
|
if (targetFieldEl)
|
|
12689
12786
|
break;
|
|
12690
|
-
const
|
|
12691
|
-
|
|
12787
|
+
const cts = ((_f = secEl.shadowRoot) == null ? void 0 : _f.querySelectorAll("jupiter-concept-tree")) ?? [];
|
|
12788
|
+
for (const ct of Array.from(cts)) {
|
|
12692
12789
|
if (targetFieldEl)
|
|
12693
|
-
|
|
12694
|
-
const
|
|
12695
|
-
|
|
12696
|
-
targetFieldEl
|
|
12697
|
-
|
|
12790
|
+
break;
|
|
12791
|
+
const fields = ((_g = ct.shadowRoot) == null ? void 0 : _g.querySelectorAll("jupiter-form-field")) ?? [];
|
|
12792
|
+
fields.forEach((fieldEl) => {
|
|
12793
|
+
if (targetFieldEl)
|
|
12794
|
+
return;
|
|
12795
|
+
const baseMatch = sameBaseConcept(fieldEl.conceptId);
|
|
12796
|
+
const valMatch = String(fieldEl.value ?? "") === targetValue;
|
|
12797
|
+
if (baseMatch) {
|
|
12798
|
+
console.log(`[scrollToConcept] Phase2 candidate: conceptId=${fieldEl.conceptId} value=${fieldEl.value} valMatch=${valMatch}`);
|
|
12799
|
+
}
|
|
12800
|
+
if (baseMatch && valMatch) {
|
|
12801
|
+
console.log(`[scrollToConcept] Phase2 ✅ MATCH: conceptId=${fieldEl.conceptId} columnId=${fieldEl.columnId} value=${fieldEl.value}`);
|
|
12802
|
+
targetFieldEl = fieldEl;
|
|
12803
|
+
}
|
|
12804
|
+
});
|
|
12805
|
+
}
|
|
12806
|
+
}
|
|
12807
|
+
}
|
|
12808
|
+
if (!targetFieldEl) {
|
|
12809
|
+
const allSectionEls = ((_h = this.shadowRoot) == null ? void 0 : _h.querySelectorAll("jupiter-form-section")) ?? [];
|
|
12810
|
+
for (const secEl of Array.from(allSectionEls)) {
|
|
12811
|
+
if (targetFieldEl)
|
|
12812
|
+
break;
|
|
12813
|
+
const cts = ((_i = secEl.shadowRoot) == null ? void 0 : _i.querySelectorAll("jupiter-concept-tree")) ?? [];
|
|
12814
|
+
for (const ct of Array.from(cts)) {
|
|
12815
|
+
if (targetFieldEl)
|
|
12816
|
+
break;
|
|
12817
|
+
const fields = ((_j = ct.shadowRoot) == null ? void 0 : _j.querySelectorAll("jupiter-form-field")) ?? [];
|
|
12818
|
+
fields.forEach((fieldEl) => {
|
|
12819
|
+
if (targetFieldEl)
|
|
12820
|
+
return;
|
|
12821
|
+
const columnMatch = targetColumnId ? sameBaseConcept(fieldEl.conceptId) && fieldEl.columnId === targetColumnId : sameBaseConcept(fieldEl.conceptId);
|
|
12822
|
+
if (columnMatch) {
|
|
12823
|
+
console.log(`[scrollToConcept] Phase3 ✅ fallback: conceptId=${fieldEl.conceptId} columnId=${fieldEl.columnId} value=${fieldEl.value}`);
|
|
12824
|
+
targetFieldEl = fieldEl;
|
|
12825
|
+
}
|
|
12826
|
+
});
|
|
12827
|
+
}
|
|
12698
12828
|
}
|
|
12699
12829
|
}
|
|
12700
12830
|
if (!targetFieldEl) {
|
|
12701
12831
|
console.warn(`[scrollToConcept] Field element not found for concept: ${conceptName}`);
|
|
12702
12832
|
return;
|
|
12703
12833
|
}
|
|
12834
|
+
console.log(`[scrollToConcept] ✅ HIGHLIGHTING conceptId=${targetFieldEl.conceptId} columnId=${targetFieldEl.columnId} value=${targetFieldEl.value}`);
|
|
12704
12835
|
targetFieldEl.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
12705
12836
|
targetFieldEl.classList.add("concept-highlight");
|
|
12706
|
-
const focusTarget = (
|
|
12837
|
+
const focusTarget = (_k = targetFieldEl.shadowRoot) == null ? void 0 : _k.querySelector(
|
|
12707
12838
|
'input:not([type="hidden"]), select, textarea, button, [tabindex]:not([tabindex="-1"])'
|
|
12708
12839
|
);
|
|
12709
12840
|
focusTarget == null ? void 0 : focusTarget.focus({ preventScroll: true });
|