jupiter-dynamic-forms 1.18.8 → 1.19.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.
- package/dist/core/add-column-dialog.d.ts.map +1 -1
- package/dist/core/dynamic-form.d.ts.map +1 -1
- package/dist/core/form-field.d.ts.map +1 -1
- package/dist/index.js +72 -29
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +113 -63
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3242,7 +3242,7 @@ let JupiterFormField = class extends LitElement {
|
|
|
3242
3242
|
}
|
|
3243
3243
|
if (this._isPercentItemType() && this.value !== null && this.value !== void 0) {
|
|
3244
3244
|
const numVal = Number(this.value);
|
|
3245
|
-
if (!isNaN(numVal) && Math.abs(numVal)
|
|
3245
|
+
if (!isNaN(numVal) && Math.abs(numVal) > 1) {
|
|
3246
3246
|
this.value = numVal / 100;
|
|
3247
3247
|
const oldValue = numVal;
|
|
3248
3248
|
this.dispatchEvent(new CustomEvent("field-change", {
|
|
@@ -3892,6 +3892,7 @@ let JupiterFormField = class extends LitElement {
|
|
|
3892
3892
|
<path fill="currentColor" d="M19 4h-1V2h-2v2H8V2H6v2H5
|
|
3893
3893
|
a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14
|
|
3894
3894
|
a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 16H5V9h14z"/>
|
|
3895
|
+
</svg>
|
|
3895
3896
|
</div>
|
|
3896
3897
|
</div>
|
|
3897
3898
|
`;
|
|
@@ -3899,17 +3900,18 @@ let JupiterFormField = class extends LitElement {
|
|
|
3899
3900
|
return html`
|
|
3900
3901
|
<div class="period-controls">
|
|
3901
3902
|
<label>From:</label>
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3903
|
+
<div class="date-wrapper">
|
|
3904
|
+
<input
|
|
3905
|
+
type="date"
|
|
3906
|
+
.value="${this.periodStartDate || this.field.periodStartDate || ""}"
|
|
3907
|
+
@change="${(e2) => this._handlePeriodChange(e2, "start")}"
|
|
3908
|
+
?disabled="${this.disabled}"
|
|
3909
|
+
/>
|
|
3910
|
+
<svg class="calendar-icon-svg" viewBox="0 0 24 24">
|
|
3910
3911
|
<path fill="currentColor" d="M19 4h-1V2h-2v2H8V2H6v2H5
|
|
3911
3912
|
a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14
|
|
3912
3913
|
a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 16H5V9h14z"/>
|
|
3914
|
+
</svg>
|
|
3913
3915
|
</div>
|
|
3914
3916
|
<label>To:</label>
|
|
3915
3917
|
<div class="date-wrapper">
|
|
@@ -3923,6 +3925,7 @@ let JupiterFormField = class extends LitElement {
|
|
|
3923
3925
|
<path fill="currentColor" d="M19 4h-1V2h-2v2H8V2H6v2H5
|
|
3924
3926
|
a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14
|
|
3925
3927
|
a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 16H5V9h14z"/>
|
|
3928
|
+
</svg>
|
|
3926
3929
|
</div>
|
|
3927
3930
|
</div>
|
|
3928
3931
|
`;
|
|
@@ -3955,6 +3958,7 @@ let JupiterFormField = class extends LitElement {
|
|
|
3955
3958
|
<path fill="currentColor" d="M19 4h-1V2h-2v2H8V2H6v2H5
|
|
3956
3959
|
a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14
|
|
3957
3960
|
a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 16H5V9h14z"/>
|
|
3961
|
+
</svg>
|
|
3958
3962
|
</div>
|
|
3959
3963
|
</div>
|
|
3960
3964
|
` : html`
|
|
@@ -3967,12 +3971,13 @@ let JupiterFormField = class extends LitElement {
|
|
|
3967
3971
|
@change="${(e2) => this._handlePeriodChange(e2, "start")}"
|
|
3968
3972
|
?disabled="${this.disabled}"
|
|
3969
3973
|
/>
|
|
3970
|
-
|
|
3974
|
+
<svg class="calendar-icon-svg" viewBox="0 0 24 24">
|
|
3971
3975
|
<path
|
|
3972
3976
|
fill="currentColor"
|
|
3973
3977
|
d="M19 4h-1V2h-2v2H8V2H6v2H5
|
|
3974
3978
|
a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14
|
|
3975
3979
|
a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 16H5V9h14z"/>
|
|
3980
|
+
</svg>
|
|
3976
3981
|
</div>
|
|
3977
3982
|
</div>
|
|
3978
3983
|
<div class="period-controls">
|
|
@@ -3988,6 +3993,7 @@ let JupiterFormField = class extends LitElement {
|
|
|
3988
3993
|
<path fill="currentColor" d="M19 4h-1V2h-2v2H8V2H6v2H5
|
|
3989
3994
|
a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14
|
|
3990
3995
|
a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 16H5V9h14z"/>
|
|
3996
|
+
</svg>
|
|
3991
3997
|
</div>
|
|
3992
3998
|
</div>
|
|
3993
3999
|
`}
|
|
@@ -4011,7 +4017,7 @@ let JupiterFormField = class extends LitElement {
|
|
|
4011
4017
|
</div>
|
|
4012
4018
|
` : ""}
|
|
4013
4019
|
|
|
4014
|
-
${this._isMonetaryType()
|
|
4020
|
+
${this._isMonetaryType() ? html`
|
|
4015
4021
|
<div class="period-controls">
|
|
4016
4022
|
<label>${I18n.t("field.scale")}:</label>
|
|
4017
4023
|
<input
|
|
@@ -4019,7 +4025,7 @@ let JupiterFormField = class extends LitElement {
|
|
|
4019
4025
|
min="0"
|
|
4020
4026
|
class="typed-member-input"
|
|
4021
4027
|
placeholder="Leave blank for INF"
|
|
4022
|
-
.value="${this.decimals !== void 0 && this.decimals !== null && this.decimals !== "" ? this.decimals : this.
|
|
4028
|
+
.value="${this.decimals !== void 0 && this.decimals !== null && this.decimals !== "" ? this.decimals : this.globalDecimals !== "INF" ? this.globalDecimals : ""}"
|
|
4023
4029
|
@input="${this._handleDecimalsChange}"
|
|
4024
4030
|
?disabled="${this.disabled}"
|
|
4025
4031
|
/>
|
|
@@ -4298,20 +4304,26 @@ JupiterFormField.styles = css`
|
|
|
4298
4304
|
width: min-content;
|
|
4299
4305
|
}
|
|
4300
4306
|
|
|
4301
|
-
|
|
4307
|
+
.date-wrapper input[type="date"] {
|
|
4308
|
+
appearance: none;
|
|
4309
|
+
-webkit-appearance: none;
|
|
4310
|
+
padding-right: 34px;
|
|
4311
|
+
}
|
|
4312
|
+
|
|
4313
|
+
/* Chrome/Edge/Safari: hide the native calendar picker indicator and use custom SVG */
|
|
4302
4314
|
input[type="date"]::-webkit-calendar-picker-indicator {
|
|
4303
4315
|
opacity: 0;
|
|
4304
4316
|
position: absolute;
|
|
4305
|
-
right:
|
|
4306
|
-
width:
|
|
4307
|
-
height:
|
|
4317
|
+
right: 0;
|
|
4318
|
+
width: 34px;
|
|
4319
|
+
height: 100%;
|
|
4308
4320
|
cursor: pointer;
|
|
4309
4321
|
}
|
|
4310
4322
|
|
|
4311
|
-
|
|
4323
|
+
.calendar-icon-svg {
|
|
4312
4324
|
position: absolute;
|
|
4313
|
-
|
|
4314
|
-
|
|
4325
|
+
right: 8px;
|
|
4326
|
+
top: 50%;
|
|
4315
4327
|
transform: translateY(-50%);
|
|
4316
4328
|
width: 20px;
|
|
4317
4329
|
height: 20px;
|
|
@@ -4319,6 +4331,17 @@ JupiterFormField.styles = css`
|
|
|
4319
4331
|
pointer-events: none;
|
|
4320
4332
|
}
|
|
4321
4333
|
|
|
4334
|
+
/* Firefox: cannot hide native calendar icon via pseudo-element;
|
|
4335
|
+
hide our custom SVG so only the native icon shows (no duplication) */
|
|
4336
|
+
@supports (-moz-appearance: none) {
|
|
4337
|
+
.calendar-icon-svg {
|
|
4338
|
+
display: none;
|
|
4339
|
+
}
|
|
4340
|
+
.date-wrapper input[type="date"] {
|
|
4341
|
+
padding-right: 10px;
|
|
4342
|
+
}
|
|
4343
|
+
}
|
|
4344
|
+
|
|
4322
4345
|
.period-popup-content .period-controls input[type="date"] {
|
|
4323
4346
|
padding: 8px 10px;
|
|
4324
4347
|
font-size: 14px;
|
|
@@ -5434,6 +5457,7 @@ let JupiterAddColumnDialog = class extends LitElement {
|
|
|
5434
5457
|
<path fill="currentColor" d="M19 4h-1V2h-2v2H8V2H6v2H5
|
|
5435
5458
|
a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14
|
|
5436
5459
|
a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 16H5V9h14z"/>
|
|
5460
|
+
</svg>
|
|
5437
5461
|
</div>
|
|
5438
5462
|
</div>
|
|
5439
5463
|
` : html`
|
|
@@ -5452,6 +5476,7 @@ let JupiterAddColumnDialog = class extends LitElement {
|
|
|
5452
5476
|
<path fill="currentColor" d="M19 4h-1V2h-2v2H8V2H6v2H5
|
|
5453
5477
|
a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14
|
|
5454
5478
|
a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 16H5V9h14z"/>
|
|
5479
|
+
</svg>
|
|
5455
5480
|
</div>
|
|
5456
5481
|
</div>
|
|
5457
5482
|
<div class="date-field">
|
|
@@ -5468,6 +5493,7 @@ let JupiterAddColumnDialog = class extends LitElement {
|
|
|
5468
5493
|
<path fill="currentColor" d="M19 4h-1V2h-2v2H8V2H6v2H5
|
|
5469
5494
|
a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14
|
|
5470
5495
|
a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 16H5V9h14z"/>
|
|
5496
|
+
</svg>
|
|
5471
5497
|
</div>
|
|
5472
5498
|
</div>
|
|
5473
5499
|
</div>
|
|
@@ -5633,20 +5659,26 @@ JupiterAddColumnDialog.styles = css`
|
|
|
5633
5659
|
width: min-content;
|
|
5634
5660
|
}
|
|
5635
5661
|
|
|
5636
|
-
|
|
5662
|
+
.date-wrapper input[type="date"] {
|
|
5663
|
+
appearance: none;
|
|
5664
|
+
-webkit-appearance: none;
|
|
5665
|
+
padding-right: 34px;
|
|
5666
|
+
}
|
|
5667
|
+
|
|
5668
|
+
/* Chrome/Edge/Safari: hide the native calendar picker indicator and use custom SVG */
|
|
5637
5669
|
input[type="date"]::-webkit-calendar-picker-indicator {
|
|
5638
5670
|
opacity: 0;
|
|
5639
5671
|
position: absolute;
|
|
5640
|
-
right:
|
|
5641
|
-
width:
|
|
5642
|
-
height:
|
|
5672
|
+
right: 0;
|
|
5673
|
+
width: 34px;
|
|
5674
|
+
height: 100%;
|
|
5643
5675
|
cursor: pointer;
|
|
5644
5676
|
}
|
|
5645
|
-
|
|
5646
|
-
|
|
5677
|
+
|
|
5678
|
+
.calendar-icon-svg {
|
|
5647
5679
|
position: absolute;
|
|
5648
|
-
|
|
5649
|
-
|
|
5680
|
+
right: 8px;
|
|
5681
|
+
top: 50%;
|
|
5650
5682
|
transform: translateY(-50%);
|
|
5651
5683
|
width: 20px;
|
|
5652
5684
|
height: 20px;
|
|
@@ -5654,6 +5686,17 @@ JupiterAddColumnDialog.styles = css`
|
|
|
5654
5686
|
pointer-events: none;
|
|
5655
5687
|
}
|
|
5656
5688
|
|
|
5689
|
+
/* Firefox: cannot hide native calendar icon via pseudo-element;
|
|
5690
|
+
hide our custom SVG so only the native icon shows (no duplication) */
|
|
5691
|
+
@supports (-moz-appearance: none) {
|
|
5692
|
+
.calendar-icon-svg {
|
|
5693
|
+
display: none;
|
|
5694
|
+
}
|
|
5695
|
+
.date-wrapper input[type="date"] {
|
|
5696
|
+
padding-right: 10px;
|
|
5697
|
+
}
|
|
5698
|
+
}
|
|
5699
|
+
|
|
5657
5700
|
.form-group {
|
|
5658
5701
|
margin-bottom: 16px;
|
|
5659
5702
|
}
|
|
@@ -11306,7 +11349,7 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
11306
11349
|
return null;
|
|
11307
11350
|
}
|
|
11308
11351
|
_addConceptDataToSubmission(concept, columnId, value, submissionData, section2) {
|
|
11309
|
-
var _a, _b, _c, _d, _e
|
|
11352
|
+
var _a, _b, _c, _d, _e;
|
|
11310
11353
|
const field2 = concept.fields.find((f2) => f2.columnId === columnId);
|
|
11311
11354
|
if (!field2)
|
|
11312
11355
|
return;
|
|
@@ -11318,12 +11361,6 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
11318
11361
|
const periodStartDate = (fieldPeriodData == null ? void 0 : fieldPeriodData.startDate) || (column2 == null ? void 0 : column2.periodStartDate) || field2.periodStartDate || this.periodStartDate;
|
|
11319
11362
|
const periodEndDate = (fieldPeriodData == null ? void 0 : fieldPeriodData.endDate) || (column2 == null ? void 0 : column2.periodEndDate) || field2.periodEndDate || this.periodEndDate;
|
|
11320
11363
|
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
|
-
}
|
|
11327
11364
|
const entry = {
|
|
11328
11365
|
conceptId: concept.originalConceptId || concept.id,
|
|
11329
11366
|
columnId,
|
|
@@ -11340,16 +11377,14 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
11340
11377
|
entry.unit = fieldUnit;
|
|
11341
11378
|
console.log(`✅ [Submission] Adding unit to entry: ${fieldUnit} for ${concept.id}/${columnId}`);
|
|
11342
11379
|
}
|
|
11343
|
-
const isMonetary = (
|
|
11344
|
-
const
|
|
11345
|
-
const
|
|
11346
|
-
|
|
11347
|
-
const decimalsValue = fieldDecimals || globalFallback;
|
|
11348
|
-
if ((isMonetary || isPercent) && decimalsValue) {
|
|
11380
|
+
const isMonetary = (_c = concept.type) == null ? void 0 : _c.toLowerCase().includes("monetary");
|
|
11381
|
+
const fieldDecimals = (_d = this._decimalsData[concept.id]) == null ? void 0 : _d[columnId];
|
|
11382
|
+
const decimalsValue = fieldDecimals || (this.decimals !== "INF" ? this.decimals : void 0);
|
|
11383
|
+
if (isMonetary && decimalsValue) {
|
|
11349
11384
|
const parsed = parseFloat(decimalsValue);
|
|
11350
11385
|
entry.decimals = isNaN(parsed) ? decimalsValue : String(-Math.abs(parsed));
|
|
11351
11386
|
}
|
|
11352
|
-
if ((
|
|
11387
|
+
if ((_e = column2 == null ? void 0 : column2.dimensionData) == null ? void 0 : _e.memberLabel) {
|
|
11353
11388
|
entry.dimension = column2.dimensionData.memberLabel;
|
|
11354
11389
|
}
|
|
11355
11390
|
console.log(`📤 [Submission Entry] Created entry:`, JSON.stringify(entry, null, 2));
|
|
@@ -11487,7 +11522,7 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
11487
11522
|
}
|
|
11488
11523
|
if (concept.fields && concept.fields.length > 0) {
|
|
11489
11524
|
concept.fields.forEach((field2) => {
|
|
11490
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
11525
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
11491
11526
|
const conceptData = this._formData[concept.id];
|
|
11492
11527
|
let fieldValue = conceptData == null ? void 0 : conceptData[field2.columnId];
|
|
11493
11528
|
const baseConceptId = field2.conceptId || concept.id.split("__").slice(0, -1).join("__") || concept.id;
|
|
@@ -11505,14 +11540,8 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
11505
11540
|
}
|
|
11506
11541
|
}
|
|
11507
11542
|
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
|
-
}
|
|
11514
11543
|
const column2 = this._findColumnByIdInSection(field2.columnId, section2);
|
|
11515
|
-
const fieldPeriodData = (
|
|
11544
|
+
const fieldPeriodData = (_b = this._periodData[concept.id]) == null ? void 0 : _b[field2.columnId];
|
|
11516
11545
|
const submissionEntry = {
|
|
11517
11546
|
conceptId: concept.id,
|
|
11518
11547
|
draftInstanceId: concept.id,
|
|
@@ -11534,23 +11563,21 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
11534
11563
|
submissionEntry.period.endDate = endDate;
|
|
11535
11564
|
}
|
|
11536
11565
|
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}`}`);
|
|
11537
|
-
const fieldUnit = (
|
|
11566
|
+
const fieldUnit = (_c = this._unitData[concept.id]) == null ? void 0 : _c[field2.columnId];
|
|
11538
11567
|
if (fieldUnit) {
|
|
11539
11568
|
submissionEntry.unit = fieldUnit;
|
|
11540
11569
|
console.log(`✅ [Submission] Adding unit to entry: ${fieldUnit} for ${concept.id}/${field2.columnId}`);
|
|
11541
11570
|
} else {
|
|
11542
11571
|
console.log(`⚠️ [Submission] No unit found in _unitData for ${concept.id}/${field2.columnId}. _unitData state:`, JSON.stringify(this._unitData, null, 2));
|
|
11543
11572
|
}
|
|
11544
|
-
const isMonetary = (
|
|
11545
|
-
const
|
|
11546
|
-
const
|
|
11547
|
-
|
|
11548
|
-
const decimalsValue = fieldDecimals || globalFallback;
|
|
11549
|
-
if ((isMonetary || isPercent) && decimalsValue) {
|
|
11573
|
+
const isMonetary = (_d = concept.type) == null ? void 0 : _d.toLowerCase().includes("monetary");
|
|
11574
|
+
const fieldDecimals = (_e = this._decimalsData[concept.id]) == null ? void 0 : _e[field2.columnId];
|
|
11575
|
+
const decimalsValue = fieldDecimals || (this.decimals !== "INF" ? this.decimals : void 0);
|
|
11576
|
+
if (isMonetary && decimalsValue) {
|
|
11550
11577
|
const parsed = parseFloat(decimalsValue);
|
|
11551
11578
|
submissionEntry.decimals = isNaN(parsed) ? decimalsValue : String(-Math.abs(parsed));
|
|
11552
11579
|
}
|
|
11553
|
-
if ((column2 == null ? void 0 : column2.type) === "dimension" && ((
|
|
11580
|
+
if ((column2 == null ? void 0 : column2.type) === "dimension" && ((_f = column2.dimensionData) == null ? void 0 : _f.dimensionIdKey)) {
|
|
11554
11581
|
submissionEntry.dimension = column2.dimensionData.dimensionIdKey;
|
|
11555
11582
|
console.log(`🔍 [DynamicForm] Using dimension key from field's column (${field2.columnId}):`, column2.dimensionData.dimensionIdKey);
|
|
11556
11583
|
} else {
|
|
@@ -11586,12 +11613,12 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
11586
11613
|
console.log(`🔍 [DynamicForm] Column details:`, {
|
|
11587
11614
|
id: column2.id,
|
|
11588
11615
|
type: column2.type,
|
|
11589
|
-
hasTypedMembers: (
|
|
11616
|
+
hasTypedMembers: (_g = column2.dimensionData) == null ? void 0 : _g.hasTypedMembers,
|
|
11590
11617
|
dimensionData: column2.dimensionData
|
|
11591
11618
|
});
|
|
11592
11619
|
}
|
|
11593
11620
|
}
|
|
11594
|
-
if (!submissionEntry.typedMembers && ((
|
|
11621
|
+
if (!submissionEntry.typedMembers && ((_h = field2.crossRoleTypedMembers) == null ? void 0 : _h.length)) {
|
|
11595
11622
|
const crossRoleKey = `${concept.id}__${field2.columnId}`;
|
|
11596
11623
|
const crossRoleValues = this._typedMemberData[crossRoleKey];
|
|
11597
11624
|
if (crossRoleValues) {
|
|
@@ -12758,6 +12785,29 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
12758
12785
|
const conceptIdBase = conceptId.includes("__") ? conceptId.split("__")[0] : conceptId;
|
|
12759
12786
|
console.log(`[scrollToConcept] conceptId="${conceptId}" conceptIdBase="${conceptIdBase}"`);
|
|
12760
12787
|
const sameBaseConcept = (fieldConceptId) => fieldConceptId === conceptId || fieldConceptId.includes("__") && fieldConceptId.split("__")[0] === conceptIdBase;
|
|
12788
|
+
const getFieldScaleFactor = (fieldEl) => {
|
|
12789
|
+
const effectiveDecimals = fieldEl.decimals || (fieldEl.globalDecimals !== void 0 && fieldEl.globalDecimals !== "INF" ? fieldEl.globalDecimals : null);
|
|
12790
|
+
if (!effectiveDecimals)
|
|
12791
|
+
return 1;
|
|
12792
|
+
const scale = parseFloat(String(effectiveDecimals));
|
|
12793
|
+
if (isNaN(scale) || scale <= 0)
|
|
12794
|
+
return 1;
|
|
12795
|
+
return Math.pow(10, scale);
|
|
12796
|
+
};
|
|
12797
|
+
const valueMatchesTarget = (fieldEl, targetVal) => {
|
|
12798
|
+
if (String(fieldEl.value ?? "") === targetVal)
|
|
12799
|
+
return true;
|
|
12800
|
+
const targetNum = Number(targetVal);
|
|
12801
|
+
const fieldNum = Number(fieldEl.value);
|
|
12802
|
+
if (!isNaN(targetNum) && !isNaN(fieldNum) && fieldNum !== 0) {
|
|
12803
|
+
const scaleFactor = getFieldScaleFactor(fieldEl);
|
|
12804
|
+
if (scaleFactor !== 1) {
|
|
12805
|
+
if (Math.abs(fieldNum * scaleFactor - targetNum) < 1e-4)
|
|
12806
|
+
return true;
|
|
12807
|
+
}
|
|
12808
|
+
}
|
|
12809
|
+
return false;
|
|
12810
|
+
};
|
|
12761
12811
|
let phase1FieldCount = 0;
|
|
12762
12812
|
conceptTrees == null ? void 0 : conceptTrees.forEach((ct) => {
|
|
12763
12813
|
var _a2;
|
|
@@ -12768,10 +12818,10 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
12768
12818
|
if (targetFieldEl)
|
|
12769
12819
|
return;
|
|
12770
12820
|
const columnMatch = targetColumnId ? fieldEl.conceptId === conceptId && fieldEl.columnId === targetColumnId : fieldEl.conceptId === conceptId;
|
|
12771
|
-
const valueMatch = !hasValueMatch ||
|
|
12821
|
+
const valueMatch = !hasValueMatch || valueMatchesTarget(fieldEl, targetValue);
|
|
12772
12822
|
if (columnMatch) {
|
|
12773
12823
|
phase1FieldCount++;
|
|
12774
|
-
console.log(`[scrollToConcept] Phase1 candidate: conceptId=${fieldEl.conceptId} columnId=${fieldEl.columnId} value=${fieldEl.value} valueMatch=${valueMatch}`);
|
|
12824
|
+
console.log(`[scrollToConcept] Phase1 candidate: conceptId=${fieldEl.conceptId} columnId=${fieldEl.columnId} value=${fieldEl.value} scale=${getFieldScaleFactor(fieldEl)} valueMatch=${valueMatch}`);
|
|
12775
12825
|
}
|
|
12776
12826
|
if (columnMatch && valueMatch)
|
|
12777
12827
|
targetFieldEl = fieldEl;
|
|
@@ -12793,9 +12843,9 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
12793
12843
|
if (targetFieldEl)
|
|
12794
12844
|
return;
|
|
12795
12845
|
const baseMatch = sameBaseConcept(fieldEl.conceptId);
|
|
12796
|
-
const valMatch =
|
|
12846
|
+
const valMatch = valueMatchesTarget(fieldEl, targetValue);
|
|
12797
12847
|
if (baseMatch) {
|
|
12798
|
-
console.log(`[scrollToConcept] Phase2 candidate: conceptId=${fieldEl.conceptId} value=${fieldEl.value} valMatch=${valMatch}`);
|
|
12848
|
+
console.log(`[scrollToConcept] Phase2 candidate: conceptId=${fieldEl.conceptId} value=${fieldEl.value} scale=${getFieldScaleFactor(fieldEl)} valMatch=${valMatch}`);
|
|
12799
12849
|
}
|
|
12800
12850
|
if (baseMatch && valMatch) {
|
|
12801
12851
|
console.log(`[scrollToConcept] Phase2 ✅ MATCH: conceptId=${fieldEl.conceptId} columnId=${fieldEl.columnId} value=${fieldEl.value}`);
|