jupiter-dynamic-forms 1.18.9 → 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/dynamic-form.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -24
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -11349,7 +11349,7 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
11349
11349
|
return null;
|
|
11350
11350
|
}
|
|
11351
11351
|
_addConceptDataToSubmission(concept, columnId, value, submissionData, section2) {
|
|
11352
|
-
var _a, _b, _c, _d, _e
|
|
11352
|
+
var _a, _b, _c, _d, _e;
|
|
11353
11353
|
const field2 = concept.fields.find((f2) => f2.columnId === columnId);
|
|
11354
11354
|
if (!field2)
|
|
11355
11355
|
return;
|
|
@@ -11361,12 +11361,6 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
11361
11361
|
const periodStartDate = (fieldPeriodData == null ? void 0 : fieldPeriodData.startDate) || (column2 == null ? void 0 : column2.periodStartDate) || field2.periodStartDate || this.periodStartDate;
|
|
11362
11362
|
const periodEndDate = (fieldPeriodData == null ? void 0 : fieldPeriodData.endDate) || (column2 == null ? void 0 : column2.periodEndDate) || field2.periodEndDate || this.periodEndDate;
|
|
11363
11363
|
const periodInstantDate = (fieldPeriodData == null ? void 0 : fieldPeriodData.instantDate) || field2.periodInstantDate || periodEndDate || periodStartDate;
|
|
11364
|
-
if ((_c = concept.type) == null ? void 0 : _c.toLowerCase().includes("percentitemtype")) {
|
|
11365
|
-
const numericValue = Number(value);
|
|
11366
|
-
if (!isNaN(numericValue) && Math.abs(numericValue) >= 1) {
|
|
11367
|
-
value = numericValue / 100;
|
|
11368
|
-
}
|
|
11369
|
-
}
|
|
11370
11364
|
const entry = {
|
|
11371
11365
|
conceptId: concept.originalConceptId || concept.id,
|
|
11372
11366
|
columnId,
|
|
@@ -11383,14 +11377,14 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
11383
11377
|
entry.unit = fieldUnit;
|
|
11384
11378
|
console.log(`✅ [Submission] Adding unit to entry: ${fieldUnit} for ${concept.id}/${columnId}`);
|
|
11385
11379
|
}
|
|
11386
|
-
const isMonetary = (
|
|
11387
|
-
const fieldDecimals = (
|
|
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];
|
|
11388
11382
|
const decimalsValue = fieldDecimals || (this.decimals !== "INF" ? this.decimals : void 0);
|
|
11389
11383
|
if (isMonetary && decimalsValue) {
|
|
11390
11384
|
const parsed = parseFloat(decimalsValue);
|
|
11391
11385
|
entry.decimals = isNaN(parsed) ? decimalsValue : String(-Math.abs(parsed));
|
|
11392
11386
|
}
|
|
11393
|
-
if ((
|
|
11387
|
+
if ((_e = column2 == null ? void 0 : column2.dimensionData) == null ? void 0 : _e.memberLabel) {
|
|
11394
11388
|
entry.dimension = column2.dimensionData.memberLabel;
|
|
11395
11389
|
}
|
|
11396
11390
|
console.log(`📤 [Submission Entry] Created entry:`, JSON.stringify(entry, null, 2));
|
|
@@ -11528,7 +11522,7 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
11528
11522
|
}
|
|
11529
11523
|
if (concept.fields && concept.fields.length > 0) {
|
|
11530
11524
|
concept.fields.forEach((field2) => {
|
|
11531
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
11525
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
11532
11526
|
const conceptData = this._formData[concept.id];
|
|
11533
11527
|
let fieldValue = conceptData == null ? void 0 : conceptData[field2.columnId];
|
|
11534
11528
|
const baseConceptId = field2.conceptId || concept.id.split("__").slice(0, -1).join("__") || concept.id;
|
|
@@ -11546,14 +11540,8 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
11546
11540
|
}
|
|
11547
11541
|
}
|
|
11548
11542
|
if (fieldValue !== void 0 && fieldValue !== null && fieldValue !== "") {
|
|
11549
|
-
if ((_b = concept.type) == null ? void 0 : _b.toLowerCase().includes("percentitemtype")) {
|
|
11550
|
-
const numericFieldValue = Number(fieldValue);
|
|
11551
|
-
if (!isNaN(numericFieldValue) && Math.abs(numericFieldValue) >= 1) {
|
|
11552
|
-
fieldValue = numericFieldValue / 100;
|
|
11553
|
-
}
|
|
11554
|
-
}
|
|
11555
11543
|
const column2 = this._findColumnByIdInSection(field2.columnId, section2);
|
|
11556
|
-
const fieldPeriodData = (
|
|
11544
|
+
const fieldPeriodData = (_b = this._periodData[concept.id]) == null ? void 0 : _b[field2.columnId];
|
|
11557
11545
|
const submissionEntry = {
|
|
11558
11546
|
conceptId: concept.id,
|
|
11559
11547
|
draftInstanceId: concept.id,
|
|
@@ -11575,21 +11563,21 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
11575
11563
|
submissionEntry.period.endDate = endDate;
|
|
11576
11564
|
}
|
|
11577
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}`}`);
|
|
11578
|
-
const fieldUnit = (
|
|
11566
|
+
const fieldUnit = (_c = this._unitData[concept.id]) == null ? void 0 : _c[field2.columnId];
|
|
11579
11567
|
if (fieldUnit) {
|
|
11580
11568
|
submissionEntry.unit = fieldUnit;
|
|
11581
11569
|
console.log(`✅ [Submission] Adding unit to entry: ${fieldUnit} for ${concept.id}/${field2.columnId}`);
|
|
11582
11570
|
} else {
|
|
11583
11571
|
console.log(`⚠️ [Submission] No unit found in _unitData for ${concept.id}/${field2.columnId}. _unitData state:`, JSON.stringify(this._unitData, null, 2));
|
|
11584
11572
|
}
|
|
11585
|
-
const isMonetary = (
|
|
11586
|
-
const fieldDecimals = (
|
|
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];
|
|
11587
11575
|
const decimalsValue = fieldDecimals || (this.decimals !== "INF" ? this.decimals : void 0);
|
|
11588
11576
|
if (isMonetary && decimalsValue) {
|
|
11589
11577
|
const parsed = parseFloat(decimalsValue);
|
|
11590
11578
|
submissionEntry.decimals = isNaN(parsed) ? decimalsValue : String(-Math.abs(parsed));
|
|
11591
11579
|
}
|
|
11592
|
-
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)) {
|
|
11593
11581
|
submissionEntry.dimension = column2.dimensionData.dimensionIdKey;
|
|
11594
11582
|
console.log(`🔍 [DynamicForm] Using dimension key from field's column (${field2.columnId}):`, column2.dimensionData.dimensionIdKey);
|
|
11595
11583
|
} else {
|
|
@@ -11625,12 +11613,12 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
11625
11613
|
console.log(`🔍 [DynamicForm] Column details:`, {
|
|
11626
11614
|
id: column2.id,
|
|
11627
11615
|
type: column2.type,
|
|
11628
|
-
hasTypedMembers: (
|
|
11616
|
+
hasTypedMembers: (_g = column2.dimensionData) == null ? void 0 : _g.hasTypedMembers,
|
|
11629
11617
|
dimensionData: column2.dimensionData
|
|
11630
11618
|
});
|
|
11631
11619
|
}
|
|
11632
11620
|
}
|
|
11633
|
-
if (!submissionEntry.typedMembers && ((
|
|
11621
|
+
if (!submissionEntry.typedMembers && ((_h = field2.crossRoleTypedMembers) == null ? void 0 : _h.length)) {
|
|
11634
11622
|
const crossRoleKey = `${concept.id}__${field2.columnId}`;
|
|
11635
11623
|
const crossRoleValues = this._typedMemberData[crossRoleKey];
|
|
11636
11624
|
if (crossRoleValues) {
|