jupiter-dynamic-forms 1.8.1 → 1.9.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/README.md +11 -0
- package/dist/core/DynamicFormRefactored.d.ts +1 -0
- package/dist/core/DynamicFormRefactored.d.ts.map +1 -1
- package/dist/core/dynamic-form.d.ts +1 -0
- package/dist/core/dynamic-form.d.ts.map +1 -1
- package/dist/core/filter-roles-dialog.d.ts.map +1 -1
- package/dist/core/form-section.d.ts.map +1 -1
- package/dist/index.js +11 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +58 -151
- package/dist/index.mjs.map +1 -1
- package/dist/utils/xbrl-form-builder.d.ts +8 -2
- package/dist/utils/xbrl-form-builder.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -555,8 +555,12 @@ class XBRLFormBuilder {
|
|
|
555
555
|
/**
|
|
556
556
|
* Build form schema from XBRL input data
|
|
557
557
|
* Creates accordion sections for each presentation role
|
|
558
|
+
* @param xbrlInput - XBRL taxonomy data
|
|
559
|
+
* @param periodStartDate - Start date for the reporting period
|
|
560
|
+
* @param periodEndDate - End date for the reporting period
|
|
561
|
+
* @param language - ISO language code for labels (e.g., 'en', 'nl', 'de')
|
|
558
562
|
*/
|
|
559
|
-
static buildFormSchema(xbrlInput, periodStartDate, periodEndDate) {
|
|
563
|
+
static buildFormSchema(xbrlInput, periodStartDate, periodEndDate, language = "en") {
|
|
560
564
|
var _a;
|
|
561
565
|
if (!xbrlInput.presentation || xbrlInput.presentation.length === 0) {
|
|
562
566
|
throw new Error("XBRL presentation data is required");
|
|
@@ -564,8 +568,11 @@ class XBRLFormBuilder {
|
|
|
564
568
|
const presentationData = xbrlInput.presentation[0];
|
|
565
569
|
const hypercubeData = (_a = xbrlInput.hypercubes) == null ? void 0 : _a[0];
|
|
566
570
|
const sections = [];
|
|
567
|
-
presentationData.roles.
|
|
568
|
-
|
|
571
|
+
const sortedRoles = [...presentationData.roles].sort((a2, b2) => {
|
|
572
|
+
return a2.role.localeCompare(b2.role);
|
|
573
|
+
});
|
|
574
|
+
sortedRoles.forEach((role) => {
|
|
575
|
+
const section = this.buildSectionFromRole(role, periodStartDate, periodEndDate, hypercubeData, language);
|
|
569
576
|
this.assignFieldColumnIds(section);
|
|
570
577
|
sections.push(section);
|
|
571
578
|
});
|
|
@@ -580,7 +587,7 @@ class XBRLFormBuilder {
|
|
|
580
587
|
/**
|
|
581
588
|
* Build a form section from a presentation role
|
|
582
589
|
*/
|
|
583
|
-
static buildSectionFromRole(role, periodStartDate, periodEndDate, hypercubeData) {
|
|
590
|
+
static buildSectionFromRole(role, periodStartDate, periodEndDate, hypercubeData, language = "en") {
|
|
584
591
|
var _a;
|
|
585
592
|
const title = this.extractRoleTitle(role.role);
|
|
586
593
|
const nonAbstractConcepts = this.getAllNonAbstractConcepts(role);
|
|
@@ -588,25 +595,13 @@ class XBRLFormBuilder {
|
|
|
588
595
|
nonAbstractConcepts.filter((concept) => concept.periodType).map((concept) => concept.periodType)
|
|
589
596
|
);
|
|
590
597
|
const hypercubeRole = hypercubeData == null ? void 0 : hypercubeData.roles.find((hr) => hr.roleId === role.id);
|
|
591
|
-
if (hypercubeRole) {
|
|
592
|
-
console.log(`🏷️ Found matching hypercube role "${role.id}"`);
|
|
593
|
-
} else {
|
|
594
|
-
console.log(`❌ No hypercube role found for "${role.id}"`);
|
|
595
|
-
}
|
|
596
598
|
const columns = this.generateDefaultColumnsForRole(role, periodStartDate || "2025-01-01", periodEndDate || "2025-12-31", hypercubeRole, nonAbstractConcepts, periodTypes);
|
|
597
599
|
const availableColumnIds = columns.map((col) => col.id);
|
|
598
|
-
console.log(`📋 Available column IDs for role "${role.id}":`, availableColumnIds);
|
|
599
|
-
if (availableColumnIds.some((id) => id.includes("multi_"))) {
|
|
600
|
-
console.log(`🔍 [DEBUG] Multi-dimensional role "${role.role}" - Total columns generated: ${columns.length}`);
|
|
601
|
-
columns.forEach((col, index) => {
|
|
602
|
-
console.log(` Column ${index}: id=${col.id}, title=${col.title}, type=${col.type}`);
|
|
603
|
-
});
|
|
604
|
-
}
|
|
605
600
|
const roleInfo = { periodTypes, availableColumnIds };
|
|
606
601
|
const conceptTrees = [];
|
|
607
602
|
if ((_a = role.presentationLinkbase) == null ? void 0 : _a.concepts) {
|
|
608
603
|
role.presentationLinkbase.concepts.forEach((concept) => {
|
|
609
|
-
const conceptTree = this.buildConceptTree(concept, 0, periodStartDate, periodEndDate, roleInfo, role.id);
|
|
604
|
+
const conceptTree = this.buildConceptTree(concept, 0, periodStartDate, periodEndDate, roleInfo, role.id, language);
|
|
610
605
|
if (conceptTree) {
|
|
611
606
|
conceptTrees.push(conceptTree);
|
|
612
607
|
}
|
|
@@ -628,8 +623,8 @@ class XBRLFormBuilder {
|
|
|
628
623
|
/**
|
|
629
624
|
* Build concept tree from XBRL presentation concept
|
|
630
625
|
*/
|
|
631
|
-
static buildConceptTree(concept, level, periodStartDate, periodEndDate, roleInfo, sectionId) {
|
|
632
|
-
const label = this.getPreferredLabel(concept.labels);
|
|
626
|
+
static buildConceptTree(concept, level, periodStartDate, periodEndDate, roleInfo, sectionId, language = "en") {
|
|
627
|
+
const label = this.getPreferredLabel(concept.labels, language);
|
|
633
628
|
const fields = [];
|
|
634
629
|
if (!concept.elementAbstract) {
|
|
635
630
|
let columnIds = [];
|
|
@@ -672,7 +667,7 @@ class XBRLFormBuilder {
|
|
|
672
667
|
const children = [];
|
|
673
668
|
if (concept.children && concept.children.length > 0) {
|
|
674
669
|
concept.children.forEach((child) => {
|
|
675
|
-
const childTree = this.buildConceptTree(child, level + 1, periodStartDate, periodEndDate, roleInfo, sectionId);
|
|
670
|
+
const childTree = this.buildConceptTree(child, level + 1, periodStartDate, periodEndDate, roleInfo, sectionId, language);
|
|
676
671
|
if (childTree) {
|
|
677
672
|
children.push(childTree);
|
|
678
673
|
}
|
|
@@ -753,21 +748,25 @@ class XBRLFormBuilder {
|
|
|
753
748
|
return typeMap[xbrlType] || "text";
|
|
754
749
|
}
|
|
755
750
|
/**
|
|
756
|
-
* Get preferred label from labels array
|
|
751
|
+
* Get preferred label from labels array with language support
|
|
752
|
+
* @param labels - Array of XBRL labels
|
|
753
|
+
* @param language - ISO language code (e.g., 'en', 'nl', 'de')
|
|
757
754
|
*/
|
|
758
|
-
static getPreferredLabel(labels) {
|
|
755
|
+
static getPreferredLabel(labels, language = "en") {
|
|
759
756
|
if (!labels || labels.length === 0)
|
|
760
757
|
return "Unnamed Concept";
|
|
761
|
-
const
|
|
758
|
+
const languageLabels = labels.filter((l2) => l2.lang === language);
|
|
759
|
+
const labelsToSearch = languageLabels.length > 0 ? languageLabels : labels;
|
|
760
|
+
const preferred = labelsToSearch.find((l2) => l2.preferredLabel);
|
|
762
761
|
if (preferred)
|
|
763
762
|
return preferred.label;
|
|
764
|
-
const standard =
|
|
763
|
+
const standard = labelsToSearch.find((l2) => l2.role === "http://www.xbrl.org/2003/role/label");
|
|
765
764
|
if (standard)
|
|
766
765
|
return standard.label;
|
|
767
|
-
const terse =
|
|
766
|
+
const terse = labelsToSearch.find((l2) => l2.role === "http://www.xbrl.org/2003/role/terseLabel");
|
|
768
767
|
if (terse)
|
|
769
768
|
return terse.label;
|
|
770
|
-
return labels[0].label;
|
|
769
|
+
return labelsToSearch.length > 0 ? labelsToSearch[0].label : labels[0].label;
|
|
771
770
|
}
|
|
772
771
|
/**
|
|
773
772
|
* Assign appropriate column IDs to fields based on section's generated columns
|
|
@@ -836,14 +835,12 @@ class XBRLFormBuilder {
|
|
|
836
835
|
* Generate default columns based on period types of non-abstract concepts in a role
|
|
837
836
|
*/
|
|
838
837
|
static generateDefaultColumnsForRole(role, periodStartDate, periodEndDate, hypercubeRole, nonAbstractConcepts, rolePeriodTypes) {
|
|
839
|
-
var _a, _b
|
|
838
|
+
var _a, _b;
|
|
840
839
|
const concepts = nonAbstractConcepts || this.getAllNonAbstractConcepts(role);
|
|
841
840
|
const periodTypes = rolePeriodTypes || new Set(
|
|
842
841
|
concepts.filter((concept) => concept.periodType).map((concept) => concept.periodType)
|
|
843
842
|
);
|
|
844
|
-
console.log(`📊 Analyzing role "${role.role}" with ${concepts.length} non-abstract concepts`);
|
|
845
843
|
if (concepts.length === 0) {
|
|
846
|
-
console.log("📊 No non-abstract concepts found, using default column");
|
|
847
844
|
return [{
|
|
848
845
|
id: "default",
|
|
849
846
|
title: "Value",
|
|
@@ -856,26 +853,18 @@ class XBRLFormBuilder {
|
|
|
856
853
|
let dimensionColumns = [];
|
|
857
854
|
if (((_a = hypercubeRole == null ? void 0 : hypercubeRole.items) == null ? void 0 : _a.length) === 1) {
|
|
858
855
|
const item = hypercubeRole.items[0];
|
|
859
|
-
console.log(`🔍 Processing hypercube item for role "${role.role}":`, {
|
|
860
|
-
itemId: item.id,
|
|
861
|
-
conceptIds: ((_b = item.conceptIds) == null ? void 0 : _b.length) || 0,
|
|
862
|
-
dimensions: item.dimensions.length
|
|
863
|
-
});
|
|
864
856
|
if (item.dimensions.length === 1) {
|
|
865
857
|
dimensionColumns = this.generateSingleDimensionColumns(item.dimensions[0], periodStartDate, periodEndDate, periodTypes);
|
|
866
858
|
} else if (item.dimensions.length > 1) {
|
|
867
859
|
dimensionColumns = this.generateMultiDimensionColumns(item.dimensions, periodStartDate, periodEndDate, periodTypes);
|
|
868
860
|
}
|
|
869
|
-
} else if (((
|
|
870
|
-
|
|
871
|
-
}
|
|
872
|
-
console.log(`📅 Found period types: ${Array.from(periodTypes).join(", ")}`);
|
|
861
|
+
} else if (((_b = hypercubeRole == null ? void 0 : hypercubeRole.items) == null ? void 0 : _b.length) && hypercubeRole.items.length > 1)
|
|
862
|
+
;
|
|
873
863
|
const columns = [];
|
|
874
864
|
if (dimensionColumns.length > 0) {
|
|
875
865
|
columns.push(...dimensionColumns);
|
|
876
866
|
} else {
|
|
877
867
|
if (periodTypes.size === 0) {
|
|
878
|
-
console.log("📅 No period types found, using default column");
|
|
879
868
|
columns.push({
|
|
880
869
|
id: "default",
|
|
881
870
|
title: "Value",
|
|
@@ -885,7 +874,6 @@ class XBRLFormBuilder {
|
|
|
885
874
|
removable: false
|
|
886
875
|
});
|
|
887
876
|
} else if (periodTypes.size === 1 && periodTypes.has("instant")) {
|
|
888
|
-
console.log("📅 All concepts are instant type, creating single column");
|
|
889
877
|
columns.push({
|
|
890
878
|
id: "instant",
|
|
891
879
|
title: `Current`,
|
|
@@ -895,7 +883,6 @@ class XBRLFormBuilder {
|
|
|
895
883
|
removable: false
|
|
896
884
|
});
|
|
897
885
|
} else if (periodTypes.size === 1 && periodTypes.has("duration")) {
|
|
898
|
-
console.log("📅 All concepts are duration type, creating single column with period range");
|
|
899
886
|
columns.push({
|
|
900
887
|
id: "duration",
|
|
901
888
|
title: `Current Period`,
|
|
@@ -905,7 +892,6 @@ class XBRLFormBuilder {
|
|
|
905
892
|
removable: false
|
|
906
893
|
});
|
|
907
894
|
} else {
|
|
908
|
-
console.log("📅 Mixed period types found, creating both duration and instant columns");
|
|
909
895
|
columns.push({
|
|
910
896
|
id: "duration",
|
|
911
897
|
title: `Current Period`,
|
|
@@ -924,25 +910,15 @@ class XBRLFormBuilder {
|
|
|
924
910
|
});
|
|
925
911
|
}
|
|
926
912
|
}
|
|
927
|
-
console.log(`📊 Generated ${columns.length} columns for role "${role.role}":`, columns.map((c2) => c2.title));
|
|
928
913
|
return columns;
|
|
929
914
|
}
|
|
930
915
|
/**
|
|
931
916
|
* Generate columns for single dimension scenarios
|
|
932
917
|
*/
|
|
933
918
|
static generateSingleDimensionColumns(dimension, periodStartDate, periodEndDate, periodTypes) {
|
|
934
|
-
var _a, _b, _c
|
|
935
|
-
console.log(`📊 Processing single dimension:`, {
|
|
936
|
-
id: dimension.id,
|
|
937
|
-
conceptName: dimension.conceptName,
|
|
938
|
-
hasMembers: !!(dimension.members && Array.isArray(dimension.members)),
|
|
939
|
-
membersCount: ((_a = dimension.members) == null ? void 0 : _a.length) || 0,
|
|
940
|
-
hasTypedMember: !!dimension.typedMember,
|
|
941
|
-
typedMemberId: (_b = dimension.typedMember) == null ? void 0 : _b.id
|
|
942
|
-
});
|
|
919
|
+
var _a, _b, _c;
|
|
943
920
|
if (dimension.typedMember && (!dimension.members || dimension.members.length === 0)) {
|
|
944
|
-
|
|
945
|
-
const axisLabel2 = ((_c = dimension.labels.find((l2) => l2.role === "http://www.xbrl.org/2003/role/label")) == null ? void 0 : _c.label) || dimension.conceptName;
|
|
921
|
+
const axisLabel2 = ((_a = dimension.labels.find((l2) => l2.role === "http://www.xbrl.org/2003/role/label")) == null ? void 0 : _a.label) || dimension.conceptName;
|
|
946
922
|
const dimensionInfo2 = {
|
|
947
923
|
axisId: dimension.id,
|
|
948
924
|
axisLabel: axisLabel2,
|
|
@@ -950,7 +926,6 @@ class XBRLFormBuilder {
|
|
|
950
926
|
dimensionKey: `${axisLabel2} | [Typed Input]`,
|
|
951
927
|
dimensionIdKey: `${dimension.id}|[typed]`
|
|
952
928
|
};
|
|
953
|
-
console.log(`🔤 Generated typed dimension info:`, dimensionInfo2);
|
|
954
929
|
const columns2 = [];
|
|
955
930
|
if (periodTypes.size === 0) {
|
|
956
931
|
columns2.push({
|
|
@@ -1092,24 +1067,17 @@ class XBRLFormBuilder {
|
|
|
1092
1067
|
removable: false
|
|
1093
1068
|
});
|
|
1094
1069
|
}
|
|
1095
|
-
console.log(`🔤 Generated ${columns2.length} typed dimension columns`);
|
|
1096
1070
|
return columns2;
|
|
1097
1071
|
}
|
|
1098
1072
|
if (!dimension.members || !Array.isArray(dimension.members)) {
|
|
1099
|
-
console.log(`⚠️ Dimension ${dimension.id} has no members defined and no typed member, skipping column generation`);
|
|
1100
1073
|
return [];
|
|
1101
1074
|
}
|
|
1102
|
-
console.log(`📊 Found single dimension:`, {
|
|
1103
|
-
id: dimension.id,
|
|
1104
|
-
conceptName: dimension.conceptName,
|
|
1105
|
-
membersCount: dimension.members.length
|
|
1106
|
-
});
|
|
1107
1075
|
if (dimension.members.length === 0) {
|
|
1108
1076
|
return [];
|
|
1109
1077
|
}
|
|
1110
|
-
const axisLabel = ((
|
|
1078
|
+
const axisLabel = ((_b = dimension.labels.find((l2) => l2.role === "http://www.xbrl.org/2003/role/label")) == null ? void 0 : _b.label) || dimension.conceptName;
|
|
1111
1079
|
const firstMember = dimension.members[0];
|
|
1112
|
-
const memberLabel = ((
|
|
1080
|
+
const memberLabel = ((_c = firstMember.labels.find((l2) => l2.role === "http://www.xbrl.org/2003/role/label")) == null ? void 0 : _c.label) || firstMember.conceptName;
|
|
1113
1081
|
const dimensionInfo = {
|
|
1114
1082
|
axisId: dimension.id,
|
|
1115
1083
|
axisLabel,
|
|
@@ -1118,7 +1086,6 @@ class XBRLFormBuilder {
|
|
|
1118
1086
|
dimensionKey: `${axisLabel} | ${memberLabel}`,
|
|
1119
1087
|
dimensionIdKey: `${dimension.id} | ${firstMember.id}`
|
|
1120
1088
|
};
|
|
1121
|
-
console.log(`📊 Generated dimension info:`, dimensionInfo);
|
|
1122
1089
|
const columns = [];
|
|
1123
1090
|
if (periodTypes.size === 0) {
|
|
1124
1091
|
columns.push({
|
|
@@ -1226,34 +1193,17 @@ class XBRLFormBuilder {
|
|
|
1226
1193
|
* Generate columns for multi-dimension scenarios - creates combinations of all dimension members
|
|
1227
1194
|
*/
|
|
1228
1195
|
static generateMultiDimensionColumns(dimensions, periodStartDate, periodEndDate, periodTypes) {
|
|
1229
|
-
|
|
1230
|
-
console.log(`🔍 [DEBUG] Input dimensions:`, dimensions.map((d2) => {
|
|
1231
|
-
var _a, _b, _c;
|
|
1232
|
-
return {
|
|
1233
|
-
id: d2.id,
|
|
1234
|
-
label: (_b = (_a = d2.labels) == null ? void 0 : _a.find((l2) => l2.role === "http://www.xbrl.org/2003/role/label")) == null ? void 0 : _b.label,
|
|
1235
|
-
membersCount: ((_c = d2.members) == null ? void 0 : _c.length) || 0,
|
|
1236
|
-
hasTypedMember: !!d2.typedMember
|
|
1237
|
-
};
|
|
1238
|
-
}));
|
|
1239
|
-
const hasTypedMembers = dimensions.some((dimension) => dimension.typedMember);
|
|
1240
|
-
if (hasTypedMembers) {
|
|
1241
|
-
console.log(`🔤 Found typed members in dimensions - will indicate in column headers`);
|
|
1242
|
-
}
|
|
1196
|
+
dimensions.some((dimension) => dimension.typedMember);
|
|
1243
1197
|
const validDimensions = dimensions.filter((dimension) => {
|
|
1244
1198
|
if (dimension.typedMember) {
|
|
1245
|
-
console.log(`🔤 Keeping typed dimension: ${dimension.id} with typed member: ${dimension.typedMember.id}`);
|
|
1246
1199
|
return true;
|
|
1247
1200
|
}
|
|
1248
1201
|
if (dimension.members && Array.isArray(dimension.members) && dimension.members.length > 0) {
|
|
1249
|
-
console.log(`📂 Keeping domain dimension: ${dimension.id} with ${dimension.members.length} members`);
|
|
1250
1202
|
return true;
|
|
1251
1203
|
}
|
|
1252
|
-
console.log(`⚠️ Skipping dimension ${dimension.id} - no members or typed member defined`);
|
|
1253
1204
|
return false;
|
|
1254
1205
|
});
|
|
1255
1206
|
if (validDimensions.length === 0) {
|
|
1256
|
-
console.log(`⚠️ No valid dimensions with members found, skipping multi-dimensional column generation`);
|
|
1257
1207
|
return [];
|
|
1258
1208
|
}
|
|
1259
1209
|
const dimensionInfos = validDimensions.map((dimension) => {
|
|
@@ -1286,27 +1236,11 @@ class XBRLFormBuilder {
|
|
|
1286
1236
|
};
|
|
1287
1237
|
});
|
|
1288
1238
|
const combinations = this.generateDimensionCombinations(dimensionInfos);
|
|
1289
|
-
console.log(`📊 Generated ${combinations.length} dimension combinations`);
|
|
1290
|
-
console.log(`🔍 [DEBUG] Generated combinations:`, combinations.map((combo) => ({
|
|
1291
|
-
memberLabels: combo.map((c2) => c2.memberLabel),
|
|
1292
|
-
axisIds: combo.map((c2) => c2.axisId),
|
|
1293
|
-
memberIds: combo.map((c2) => c2.memberId)
|
|
1294
|
-
})));
|
|
1295
1239
|
const columns = [];
|
|
1296
1240
|
combinations.forEach((combination, index) => {
|
|
1297
|
-
var _a, _b;
|
|
1298
1241
|
const columnTitle = combination.map((c2) => c2.memberLabel).join(" | ");
|
|
1299
1242
|
const typedMembers = combination.filter((c2) => c2.isTyped);
|
|
1300
1243
|
const domainMembers = combination.filter((c2) => !c2.isTyped);
|
|
1301
|
-
console.log(`🔍 [Column ${index}] Combination analysis:`, {
|
|
1302
|
-
totalMembers: combination.length,
|
|
1303
|
-
typedMembers: typedMembers.length,
|
|
1304
|
-
domainMembers: domainMembers.length,
|
|
1305
|
-
hasTypedMembers: typedMembers.length > 0,
|
|
1306
|
-
columnTitle,
|
|
1307
|
-
memberLabels: combination.map((c2) => c2.memberLabel),
|
|
1308
|
-
memberIds: combination.map((c2) => c2.memberId)
|
|
1309
|
-
});
|
|
1310
1244
|
const dimensionData = {
|
|
1311
1245
|
dimensionId: `multi_${index}`,
|
|
1312
1246
|
memberValue: columnTitle,
|
|
@@ -1333,13 +1267,6 @@ class XBRLFormBuilder {
|
|
|
1333
1267
|
...typedMembers.map((c2) => `${c2.axisId}|[typed]`)
|
|
1334
1268
|
].join("::")
|
|
1335
1269
|
};
|
|
1336
|
-
console.log(`🔍 [Column ${index}] Final dimension data:`, {
|
|
1337
|
-
dimensionId: dimensionData.dimensionId,
|
|
1338
|
-
memberLabel: dimensionData.memberLabel,
|
|
1339
|
-
dimensionIdKey: dimensionData.dimensionIdKey,
|
|
1340
|
-
combinationsCount: (_a = dimensionData.combinations) == null ? void 0 : _a.length,
|
|
1341
|
-
typedMembersCount: (_b = dimensionData.typedMembers) == null ? void 0 : _b.length
|
|
1342
|
-
});
|
|
1343
1270
|
if (periodTypes.size === 0 || periodTypes.size === 1 && periodTypes.has("duration")) {
|
|
1344
1271
|
columns.push({
|
|
1345
1272
|
id: `duration_${index}`,
|
|
@@ -1393,7 +1320,6 @@ class XBRLFormBuilder {
|
|
|
1393
1320
|
});
|
|
1394
1321
|
}
|
|
1395
1322
|
});
|
|
1396
|
-
console.log(`📊 Generated ${columns.length} multi-dimensional columns`);
|
|
1397
1323
|
return columns;
|
|
1398
1324
|
}
|
|
1399
1325
|
/**
|
|
@@ -2110,9 +2036,8 @@ let JupiterAddColumnDialog = class extends LitElement {
|
|
|
2110
2036
|
if (changedProperties.has("open") && this.open) {
|
|
2111
2037
|
this._resetForm();
|
|
2112
2038
|
}
|
|
2113
|
-
if (changedProperties.has("availableDimensions"))
|
|
2114
|
-
|
|
2115
|
-
}
|
|
2039
|
+
if (changedProperties.has("availableDimensions"))
|
|
2040
|
+
;
|
|
2116
2041
|
}
|
|
2117
2042
|
connectedCallback() {
|
|
2118
2043
|
super.connectedCallback();
|
|
@@ -2230,7 +2155,6 @@ let JupiterAddColumnDialog = class extends LitElement {
|
|
|
2230
2155
|
isTyped: false
|
|
2231
2156
|
};
|
|
2232
2157
|
this._selectedDimensions.set(dimension.id, selection);
|
|
2233
|
-
console.log(`🎯 Auto-selected single member: ${dimension.axisLabel} -> ${member.label}`);
|
|
2234
2158
|
} else if (dimension.typedMember && (!dimension.members || dimension.members.length === 0)) {
|
|
2235
2159
|
const selection = {
|
|
2236
2160
|
axisId: dimension.id,
|
|
@@ -2239,7 +2163,6 @@ let JupiterAddColumnDialog = class extends LitElement {
|
|
|
2239
2163
|
// Note: typedValue will be entered in column header, not here
|
|
2240
2164
|
};
|
|
2241
2165
|
this._selectedDimensions.set(dimension.id, selection);
|
|
2242
|
-
console.log(`🎯 Auto-selected typed dimension: ${dimension.axisLabel} (value will be entered in column header)`);
|
|
2243
2166
|
}
|
|
2244
2167
|
});
|
|
2245
2168
|
}
|
|
@@ -2732,12 +2655,6 @@ let JupiterFormSection = class extends LitElement {
|
|
|
2732
2655
|
}
|
|
2733
2656
|
_determinePeriodType() {
|
|
2734
2657
|
const nonAbstractConcepts = this._getAllNonAbstractConcepts(this.section.concepts);
|
|
2735
|
-
console.log(`🔍 Section ${this.section.id} (${this.section.title}): Found ${nonAbstractConcepts.length} non-abstract concepts`);
|
|
2736
|
-
console.log(`📝 All concepts in section:`, this.section.concepts.map((c2) => ({
|
|
2737
|
-
name: c2.name,
|
|
2738
|
-
abstract: c2.abstract,
|
|
2739
|
-
periodType: c2.periodType
|
|
2740
|
-
})));
|
|
2741
2658
|
if (nonAbstractConcepts.length === 0) {
|
|
2742
2659
|
this._sectionPeriodType = "duration";
|
|
2743
2660
|
console.log(`📊 Section ${this.section.id}: No concepts, defaulting to duration`);
|
|
@@ -3415,11 +3332,13 @@ let JupiterFilterRolesDialog = class extends LitElement {
|
|
|
3415
3332
|
}
|
|
3416
3333
|
_updateFilteredRoles() {
|
|
3417
3334
|
if (!this._searchQuery.trim()) {
|
|
3418
|
-
this._filteredRoles = [...this.availableRoles]
|
|
3335
|
+
this._filteredRoles = [...this.availableRoles].sort((a2, b2) => {
|
|
3336
|
+
return a2.title.localeCompare(b2.title);
|
|
3337
|
+
});
|
|
3419
3338
|
return;
|
|
3420
3339
|
}
|
|
3421
3340
|
const query = this._searchQuery.toLowerCase().trim();
|
|
3422
|
-
|
|
3341
|
+
const filtered = this.availableRoles.filter((role) => {
|
|
3423
3342
|
var _a;
|
|
3424
3343
|
const titleMatch = role.title.toLowerCase().includes(query);
|
|
3425
3344
|
const idMatch = role.id.toLowerCase().includes(query);
|
|
@@ -3427,6 +3346,9 @@ let JupiterFilterRolesDialog = class extends LitElement {
|
|
|
3427
3346
|
const uriMatch = this._searchInRoleURI(role, query);
|
|
3428
3347
|
return titleMatch || idMatch || descriptionMatch || uriMatch;
|
|
3429
3348
|
});
|
|
3349
|
+
this._filteredRoles = filtered.sort((a2, b2) => {
|
|
3350
|
+
return a2.title.localeCompare(b2.title);
|
|
3351
|
+
});
|
|
3430
3352
|
}
|
|
3431
3353
|
_searchInRoleURI(role, query) {
|
|
3432
3354
|
var _a;
|
|
@@ -3995,6 +3917,7 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
3995
3917
|
this.readonly = false;
|
|
3996
3918
|
this.periodStartDate = "2025-01-01";
|
|
3997
3919
|
this.periodEndDate = "2025-12-31";
|
|
3920
|
+
this.language = "en";
|
|
3998
3921
|
this._formData = {};
|
|
3999
3922
|
this._preservedFormData = {};
|
|
4000
3923
|
this._typedMemberData = {};
|
|
@@ -4024,24 +3947,22 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
4024
3947
|
try {
|
|
4025
3948
|
console.log("🔄 Initializing form from XBRL input:", this.xbrlInput);
|
|
4026
3949
|
console.log("📅 Using period dates:", this.periodStartDate, "to", this.periodEndDate);
|
|
3950
|
+
console.log("🌐 Using language:", this.language);
|
|
4027
3951
|
this._currentSchema = XBRLFormBuilder.buildFormSchema(
|
|
4028
3952
|
this.xbrlInput,
|
|
4029
3953
|
this.periodStartDate,
|
|
4030
|
-
this.periodEndDate
|
|
3954
|
+
this.periodEndDate,
|
|
3955
|
+
this.language
|
|
4031
3956
|
);
|
|
4032
3957
|
console.log("✅ Generated schema with sections:", this._currentSchema.sections.length);
|
|
4033
3958
|
this._allSections = [...this._currentSchema.sections];
|
|
4034
3959
|
if (this._selectedRoleIds.length === 0) {
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
this._currentSchema
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
};
|
|
4042
|
-
} else {
|
|
4043
|
-
this._selectedRoleIds = this._allSections.map((section) => section.id);
|
|
4044
|
-
}
|
|
3960
|
+
this._selectedRoleIds = [];
|
|
3961
|
+
this._showFilterDialog = true;
|
|
3962
|
+
this._currentSchema = {
|
|
3963
|
+
...this._currentSchema,
|
|
3964
|
+
sections: []
|
|
3965
|
+
};
|
|
4045
3966
|
}
|
|
4046
3967
|
this._applyRoleFilter();
|
|
4047
3968
|
this._columns = [
|
|
@@ -4186,7 +4107,7 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
4186
4107
|
}
|
|
4187
4108
|
}
|
|
4188
4109
|
_shouldShowFilterButton() {
|
|
4189
|
-
return
|
|
4110
|
+
return true;
|
|
4190
4111
|
}
|
|
4191
4112
|
_handleFilterRolesClick() {
|
|
4192
4113
|
this._showFilterDialog = true;
|
|
@@ -4331,7 +4252,6 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
4331
4252
|
console.log("❌ No hypercubes data available");
|
|
4332
4253
|
return [];
|
|
4333
4254
|
}
|
|
4334
|
-
console.log(`📊 Available hypercube roles:`, this.xbrlInput.hypercubes[0].roles.map((r2) => r2.roleId));
|
|
4335
4255
|
const hypercubeRole = this.xbrlInput.hypercubes[0].roles.find((hr) => hr.roleId === sectionId);
|
|
4336
4256
|
if (!((_c = hypercubeRole == null ? void 0 : hypercubeRole.items) == null ? void 0 : _c.length)) {
|
|
4337
4257
|
console.log(`❌ No hypercube items found for role: ${sectionId}`);
|
|
@@ -4628,23 +4548,7 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
4628
4548
|
this._submitted = true;
|
|
4629
4549
|
this._validateForm();
|
|
4630
4550
|
const submissionData = this._generateSubmissionData();
|
|
4631
|
-
console.log("📊
|
|
4632
|
-
formData: this._formData,
|
|
4633
|
-
submissionData,
|
|
4634
|
-
submissionDataCount: submissionData.length,
|
|
4635
|
-
valid: this._valid,
|
|
4636
|
-
errors: this._errors
|
|
4637
|
-
});
|
|
4638
|
-
submissionData.forEach((entry, index) => {
|
|
4639
|
-
console.log(`📋 Submission Entry ${index + 1}:`, {
|
|
4640
|
-
conceptId: entry.conceptId,
|
|
4641
|
-
value: entry.value,
|
|
4642
|
-
period: entry.period,
|
|
4643
|
-
dimension: entry.dimension,
|
|
4644
|
-
typedMembers: entry.typedMembers,
|
|
4645
|
-
hasTypedMembers: !!(entry.typedMembers && Object.keys(entry.typedMembers).length > 0)
|
|
4646
|
-
});
|
|
4647
|
-
});
|
|
4551
|
+
console.log("📊 Form Submission Data:", JSON.stringify(submissionData, null, 2));
|
|
4648
4552
|
this.dispatchEvent(new CustomEvent("form-submit", {
|
|
4649
4553
|
detail: {
|
|
4650
4554
|
data: this._formData,
|
|
@@ -5040,7 +4944,7 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
5040
4944
|
` : ""}
|
|
5041
4945
|
|
|
5042
4946
|
<!-- Form Sections or No Selection Message -->
|
|
5043
|
-
${schema.sections.length === 0
|
|
4947
|
+
${schema.sections.length === 0 ? html`
|
|
5044
4948
|
<div class="no-roles-message">
|
|
5045
4949
|
<h3>No Roles Selected</h3>
|
|
5046
4950
|
<p>Please use the "Filter Roles" button below to select which sections you want to work with.</p>
|
|
@@ -5337,6 +5241,9 @@ __decorateClass([
|
|
|
5337
5241
|
__decorateClass([
|
|
5338
5242
|
n2({ type: String })
|
|
5339
5243
|
], JupiterDynamicForm.prototype, "periodEndDate", 2);
|
|
5244
|
+
__decorateClass([
|
|
5245
|
+
n2({ type: String })
|
|
5246
|
+
], JupiterDynamicForm.prototype, "language", 2);
|
|
5340
5247
|
__decorateClass([
|
|
5341
5248
|
r()
|
|
5342
5249
|
], JupiterDynamicForm.prototype, "_formData", 2);
|