jupiter-dynamic-forms 1.8.0 → 1.8.2

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/index.mjs CHANGED
@@ -564,7 +564,10 @@ class XBRLFormBuilder {
564
564
  const presentationData = xbrlInput.presentation[0];
565
565
  const hypercubeData = (_a = xbrlInput.hypercubes) == null ? void 0 : _a[0];
566
566
  const sections = [];
567
- presentationData.roles.forEach((role) => {
567
+ const sortedRoles = [...presentationData.roles].sort((a2, b2) => {
568
+ return a2.role.localeCompare(b2.role);
569
+ });
570
+ sortedRoles.forEach((role) => {
568
571
  const section = this.buildSectionFromRole(role, periodStartDate, periodEndDate, hypercubeData);
569
572
  this.assignFieldColumnIds(section);
570
573
  sections.push(section);
@@ -588,20 +591,8 @@ class XBRLFormBuilder {
588
591
  nonAbstractConcepts.filter((concept) => concept.periodType).map((concept) => concept.periodType)
589
592
  );
590
593
  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
594
  const columns = this.generateDefaultColumnsForRole(role, periodStartDate || "2025-01-01", periodEndDate || "2025-12-31", hypercubeRole, nonAbstractConcepts, periodTypes);
597
595
  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
596
  const roleInfo = { periodTypes, availableColumnIds };
606
597
  const conceptTrees = [];
607
598
  if ((_a = role.presentationLinkbase) == null ? void 0 : _a.concepts) {
@@ -836,14 +827,12 @@ class XBRLFormBuilder {
836
827
  * Generate default columns based on period types of non-abstract concepts in a role
837
828
  */
838
829
  static generateDefaultColumnsForRole(role, periodStartDate, periodEndDate, hypercubeRole, nonAbstractConcepts, rolePeriodTypes) {
839
- var _a, _b, _c;
830
+ var _a, _b;
840
831
  const concepts = nonAbstractConcepts || this.getAllNonAbstractConcepts(role);
841
832
  const periodTypes = rolePeriodTypes || new Set(
842
833
  concepts.filter((concept) => concept.periodType).map((concept) => concept.periodType)
843
834
  );
844
- console.log(`📊 Analyzing role "${role.role}" with ${concepts.length} non-abstract concepts`);
845
835
  if (concepts.length === 0) {
846
- console.log("📊 No non-abstract concepts found, using default column");
847
836
  return [{
848
837
  id: "default",
849
838
  title: "Value",
@@ -856,26 +845,18 @@ class XBRLFormBuilder {
856
845
  let dimensionColumns = [];
857
846
  if (((_a = hypercubeRole == null ? void 0 : hypercubeRole.items) == null ? void 0 : _a.length) === 1) {
858
847
  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
848
  if (item.dimensions.length === 1) {
865
849
  dimensionColumns = this.generateSingleDimensionColumns(item.dimensions[0], periodStartDate, periodEndDate, periodTypes);
866
850
  } else if (item.dimensions.length > 1) {
867
851
  dimensionColumns = this.generateMultiDimensionColumns(item.dimensions, periodStartDate, periodEndDate, periodTypes);
868
852
  }
869
- } else if (((_c = hypercubeRole == null ? void 0 : hypercubeRole.items) == null ? void 0 : _c.length) && hypercubeRole.items.length > 1) {
870
- console.log(`⚠️ Multiple items found (${hypercubeRole.items.length}), skipping for now`);
871
- }
872
- console.log(`📅 Found period types: ${Array.from(periodTypes).join(", ")}`);
853
+ } else if (((_b = hypercubeRole == null ? void 0 : hypercubeRole.items) == null ? void 0 : _b.length) && hypercubeRole.items.length > 1)
854
+ ;
873
855
  const columns = [];
874
856
  if (dimensionColumns.length > 0) {
875
857
  columns.push(...dimensionColumns);
876
858
  } else {
877
859
  if (periodTypes.size === 0) {
878
- console.log("📅 No period types found, using default column");
879
860
  columns.push({
880
861
  id: "default",
881
862
  title: "Value",
@@ -885,7 +866,6 @@ class XBRLFormBuilder {
885
866
  removable: false
886
867
  });
887
868
  } else if (periodTypes.size === 1 && periodTypes.has("instant")) {
888
- console.log("📅 All concepts are instant type, creating single column");
889
869
  columns.push({
890
870
  id: "instant",
891
871
  title: `Current`,
@@ -895,7 +875,6 @@ class XBRLFormBuilder {
895
875
  removable: false
896
876
  });
897
877
  } else if (periodTypes.size === 1 && periodTypes.has("duration")) {
898
- console.log("📅 All concepts are duration type, creating single column with period range");
899
878
  columns.push({
900
879
  id: "duration",
901
880
  title: `Current Period`,
@@ -905,7 +884,6 @@ class XBRLFormBuilder {
905
884
  removable: false
906
885
  });
907
886
  } else {
908
- console.log("📅 Mixed period types found, creating both duration and instant columns");
909
887
  columns.push({
910
888
  id: "duration",
911
889
  title: `Current Period`,
@@ -924,25 +902,15 @@ class XBRLFormBuilder {
924
902
  });
925
903
  }
926
904
  }
927
- console.log(`📊 Generated ${columns.length} columns for role "${role.role}":`, columns.map((c2) => c2.title));
928
905
  return columns;
929
906
  }
930
907
  /**
931
908
  * Generate columns for single dimension scenarios
932
909
  */
933
910
  static generateSingleDimensionColumns(dimension, periodStartDate, periodEndDate, periodTypes) {
934
- var _a, _b, _c, _d, _e;
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
- });
911
+ var _a, _b, _c;
943
912
  if (dimension.typedMember && (!dimension.members || dimension.members.length === 0)) {
944
- console.log(`🔤 Processing typed dimension: ${dimension.id} with typed member: ${dimension.typedMember.id}`);
945
- const axisLabel2 = ((_c = dimension.labels.find((l2) => l2.role === "http://www.xbrl.org/2003/role/label")) == null ? void 0 : _c.label) || dimension.conceptName;
913
+ const axisLabel2 = ((_a = dimension.labels.find((l2) => l2.role === "http://www.xbrl.org/2003/role/label")) == null ? void 0 : _a.label) || dimension.conceptName;
946
914
  const dimensionInfo2 = {
947
915
  axisId: dimension.id,
948
916
  axisLabel: axisLabel2,
@@ -950,7 +918,6 @@ class XBRLFormBuilder {
950
918
  dimensionKey: `${axisLabel2} | [Typed Input]`,
951
919
  dimensionIdKey: `${dimension.id}|[typed]`
952
920
  };
953
- console.log(`🔤 Generated typed dimension info:`, dimensionInfo2);
954
921
  const columns2 = [];
955
922
  if (periodTypes.size === 0) {
956
923
  columns2.push({
@@ -1092,24 +1059,17 @@ class XBRLFormBuilder {
1092
1059
  removable: false
1093
1060
  });
1094
1061
  }
1095
- console.log(`🔤 Generated ${columns2.length} typed dimension columns`);
1096
1062
  return columns2;
1097
1063
  }
1098
1064
  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
1065
  return [];
1101
1066
  }
1102
- console.log(`📊 Found single dimension:`, {
1103
- id: dimension.id,
1104
- conceptName: dimension.conceptName,
1105
- membersCount: dimension.members.length
1106
- });
1107
1067
  if (dimension.members.length === 0) {
1108
1068
  return [];
1109
1069
  }
1110
- const axisLabel = ((_d = dimension.labels.find((l2) => l2.role === "http://www.xbrl.org/2003/role/label")) == null ? void 0 : _d.label) || dimension.conceptName;
1070
+ const axisLabel = ((_b = dimension.labels.find((l2) => l2.role === "http://www.xbrl.org/2003/role/label")) == null ? void 0 : _b.label) || dimension.conceptName;
1111
1071
  const firstMember = dimension.members[0];
1112
- const memberLabel = ((_e = firstMember.labels.find((l2) => l2.role === "http://www.xbrl.org/2003/role/label")) == null ? void 0 : _e.label) || firstMember.conceptName;
1072
+ const memberLabel = ((_c = firstMember.labels.find((l2) => l2.role === "http://www.xbrl.org/2003/role/label")) == null ? void 0 : _c.label) || firstMember.conceptName;
1113
1073
  const dimensionInfo = {
1114
1074
  axisId: dimension.id,
1115
1075
  axisLabel,
@@ -1118,7 +1078,6 @@ class XBRLFormBuilder {
1118
1078
  dimensionKey: `${axisLabel} | ${memberLabel}`,
1119
1079
  dimensionIdKey: `${dimension.id} | ${firstMember.id}`
1120
1080
  };
1121
- console.log(`📊 Generated dimension info:`, dimensionInfo);
1122
1081
  const columns = [];
1123
1082
  if (periodTypes.size === 0) {
1124
1083
  columns.push({
@@ -1226,34 +1185,17 @@ class XBRLFormBuilder {
1226
1185
  * Generate columns for multi-dimension scenarios - creates combinations of all dimension members
1227
1186
  */
1228
1187
  static generateMultiDimensionColumns(dimensions, periodStartDate, periodEndDate, periodTypes) {
1229
- console.log(`📊 Processing ${dimensions.length} dimensions for multi-dimensional columns`);
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
- }
1188
+ dimensions.some((dimension) => dimension.typedMember);
1243
1189
  const validDimensions = dimensions.filter((dimension) => {
1244
1190
  if (dimension.typedMember) {
1245
- console.log(`🔤 Keeping typed dimension: ${dimension.id} with typed member: ${dimension.typedMember.id}`);
1246
1191
  return true;
1247
1192
  }
1248
1193
  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
1194
  return true;
1251
1195
  }
1252
- console.log(`⚠️ Skipping dimension ${dimension.id} - no members or typed member defined`);
1253
1196
  return false;
1254
1197
  });
1255
1198
  if (validDimensions.length === 0) {
1256
- console.log(`⚠️ No valid dimensions with members found, skipping multi-dimensional column generation`);
1257
1199
  return [];
1258
1200
  }
1259
1201
  const dimensionInfos = validDimensions.map((dimension) => {
@@ -1286,27 +1228,11 @@ class XBRLFormBuilder {
1286
1228
  };
1287
1229
  });
1288
1230
  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
1231
  const columns = [];
1296
1232
  combinations.forEach((combination, index) => {
1297
- var _a, _b;
1298
1233
  const columnTitle = combination.map((c2) => c2.memberLabel).join(" | ");
1299
1234
  const typedMembers = combination.filter((c2) => c2.isTyped);
1300
1235
  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
1236
  const dimensionData = {
1311
1237
  dimensionId: `multi_${index}`,
1312
1238
  memberValue: columnTitle,
@@ -1333,13 +1259,6 @@ class XBRLFormBuilder {
1333
1259
  ...typedMembers.map((c2) => `${c2.axisId}|[typed]`)
1334
1260
  ].join("::")
1335
1261
  };
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
1262
  if (periodTypes.size === 0 || periodTypes.size === 1 && periodTypes.has("duration")) {
1344
1263
  columns.push({
1345
1264
  id: `duration_${index}`,
@@ -1393,7 +1312,6 @@ class XBRLFormBuilder {
1393
1312
  });
1394
1313
  }
1395
1314
  });
1396
- console.log(`📊 Generated ${columns.length} multi-dimensional columns`);
1397
1315
  return columns;
1398
1316
  }
1399
1317
  /**
@@ -2110,9 +2028,8 @@ let JupiterAddColumnDialog = class extends LitElement {
2110
2028
  if (changedProperties.has("open") && this.open) {
2111
2029
  this._resetForm();
2112
2030
  }
2113
- if (changedProperties.has("availableDimensions")) {
2114
- console.log(`🎯 Add Column Dialog received ${this.availableDimensions.length} dimensions:`, this.availableDimensions.map((d2) => d2.axisLabel));
2115
- }
2031
+ if (changedProperties.has("availableDimensions"))
2032
+ ;
2116
2033
  }
2117
2034
  connectedCallback() {
2118
2035
  super.connectedCallback();
@@ -2230,7 +2147,6 @@ let JupiterAddColumnDialog = class extends LitElement {
2230
2147
  isTyped: false
2231
2148
  };
2232
2149
  this._selectedDimensions.set(dimension.id, selection);
2233
- console.log(`🎯 Auto-selected single member: ${dimension.axisLabel} -> ${member.label}`);
2234
2150
  } else if (dimension.typedMember && (!dimension.members || dimension.members.length === 0)) {
2235
2151
  const selection = {
2236
2152
  axisId: dimension.id,
@@ -2239,7 +2155,6 @@ let JupiterAddColumnDialog = class extends LitElement {
2239
2155
  // Note: typedValue will be entered in column header, not here
2240
2156
  };
2241
2157
  this._selectedDimensions.set(dimension.id, selection);
2242
- console.log(`🎯 Auto-selected typed dimension: ${dimension.axisLabel} (value will be entered in column header)`);
2243
2158
  }
2244
2159
  });
2245
2160
  }
@@ -2701,6 +2616,7 @@ let JupiterFormSection = class extends LitElement {
2701
2616
  this.disabled = false;
2702
2617
  this.collapsible = true;
2703
2618
  this.locale = "en-US";
2619
+ this.isFirstSection = false;
2704
2620
  this.availableDimensions = [];
2705
2621
  this._expanded = true;
2706
2622
  this._showAddColumnDialog = false;
@@ -2712,15 +2628,25 @@ let JupiterFormSection = class extends LitElement {
2712
2628
  super.connectedCallback();
2713
2629
  this._expanded = this.section.expanded !== false;
2714
2630
  this._determinePeriodType();
2631
+ this._checkAndExpandFirstSection();
2632
+ }
2633
+ updated(changedProperties) {
2634
+ super.updated(changedProperties);
2635
+ if (changedProperties.has("isFirstSection") || changedProperties.has("section")) {
2636
+ this._checkAndExpandFirstSection();
2637
+ }
2638
+ }
2639
+ _checkAndExpandFirstSection() {
2640
+ if (this.isFirstSection && this.section && this.section.concepts) {
2641
+ this._expanded = true;
2642
+ setTimeout(() => {
2643
+ this._expandAllTrees();
2644
+ console.log("🎯 First section detected - expanded section and tree by default");
2645
+ }, 0);
2646
+ }
2715
2647
  }
2716
2648
  _determinePeriodType() {
2717
2649
  const nonAbstractConcepts = this._getAllNonAbstractConcepts(this.section.concepts);
2718
- console.log(`🔍 Section ${this.section.id} (${this.section.title}): Found ${nonAbstractConcepts.length} non-abstract concepts`);
2719
- console.log(`📝 All concepts in section:`, this.section.concepts.map((c2) => ({
2720
- name: c2.name,
2721
- abstract: c2.abstract,
2722
- periodType: c2.periodType
2723
- })));
2724
2650
  if (nonAbstractConcepts.length === 0) {
2725
2651
  this._sectionPeriodType = "duration";
2726
2652
  console.log(`📊 Section ${this.section.id}: No concepts, defaulting to duration`);
@@ -3339,6 +3265,9 @@ __decorateClass$2([
3339
3265
  __decorateClass$2([
3340
3266
  n2({ type: String })
3341
3267
  ], JupiterFormSection.prototype, "locale", 2);
3268
+ __decorateClass$2([
3269
+ n2({ type: Boolean })
3270
+ ], JupiterFormSection.prototype, "isFirstSection", 2);
3342
3271
  __decorateClass$2([
3343
3272
  n2({ type: Array })
3344
3273
  ], JupiterFormSection.prototype, "availableDimensions", 2);
@@ -3395,11 +3324,13 @@ let JupiterFilterRolesDialog = class extends LitElement {
3395
3324
  }
3396
3325
  _updateFilteredRoles() {
3397
3326
  if (!this._searchQuery.trim()) {
3398
- this._filteredRoles = [...this.availableRoles];
3327
+ this._filteredRoles = [...this.availableRoles].sort((a2, b2) => {
3328
+ return a2.title.localeCompare(b2.title);
3329
+ });
3399
3330
  return;
3400
3331
  }
3401
3332
  const query = this._searchQuery.toLowerCase().trim();
3402
- this._filteredRoles = this.availableRoles.filter((role) => {
3333
+ const filtered = this.availableRoles.filter((role) => {
3403
3334
  var _a;
3404
3335
  const titleMatch = role.title.toLowerCase().includes(query);
3405
3336
  const idMatch = role.id.toLowerCase().includes(query);
@@ -3407,6 +3338,9 @@ let JupiterFilterRolesDialog = class extends LitElement {
3407
3338
  const uriMatch = this._searchInRoleURI(role, query);
3408
3339
  return titleMatch || idMatch || descriptionMatch || uriMatch;
3409
3340
  });
3341
+ this._filteredRoles = filtered.sort((a2, b2) => {
3342
+ return a2.title.localeCompare(b2.title);
3343
+ });
3410
3344
  }
3411
3345
  _searchInRoleURI(role, query) {
3412
3346
  var _a;
@@ -3611,12 +3545,6 @@ let JupiterFilterRolesDialog = class extends LitElement {
3611
3545
  />
3612
3546
  <div class="role-info">
3613
3547
  <h4 class="role-title">${role.title}</h4>
3614
- ${role.description ? html`
3615
- <p class="role-description">${role.description}</p>
3616
- ` : ""}
3617
- ${role.id !== role.title ? html`
3618
- <p class="role-description">ID: ${role.id}</p>
3619
- ` : ""}
3620
3548
  ${((_a = role.metadata) == null ? void 0 : _a.roleURI) ? html`
3621
3549
  <p class="role-description">URI: ${role.metadata.roleURI}</p>
3622
3550
  ` : ""}
@@ -4017,10 +3945,13 @@ let JupiterDynamicForm = class extends LitElement {
4017
3945
  );
4018
3946
  console.log("✅ Generated schema with sections:", this._currentSchema.sections.length);
4019
3947
  this._allSections = [...this._currentSchema.sections];
4020
- if (this._allSections.length > 10 && this._selectedRoleIds.length === 0) {
4021
- this._selectedRoleIds = this._allSections.slice(0, 10).map((section) => section.id);
4022
- } else if (this._selectedRoleIds.length === 0) {
4023
- this._selectedRoleIds = this._allSections.map((section) => section.id);
3948
+ if (this._selectedRoleIds.length === 0) {
3949
+ this._selectedRoleIds = [];
3950
+ this._showFilterDialog = true;
3951
+ this._currentSchema = {
3952
+ ...this._currentSchema,
3953
+ sections: []
3954
+ };
4024
3955
  }
4025
3956
  this._applyRoleFilter();
4026
3957
  this._columns = [
@@ -4081,6 +4012,15 @@ let JupiterDynamicForm = class extends LitElement {
4081
4012
  _applyRoleFilter() {
4082
4013
  if (!this._currentSchema || !this._allSections.length)
4083
4014
  return;
4015
+ console.log(`🔍 Applying role filter: ${this._selectedRoleIds.length} selected out of ${this._allSections.length} total`);
4016
+ if (this._selectedRoleIds.length === 0) {
4017
+ console.log(`📝 No roles selected - showing empty form`);
4018
+ this._currentSchema = {
4019
+ ...this._currentSchema,
4020
+ sections: []
4021
+ };
4022
+ return;
4023
+ }
4084
4024
  this._preserveDataForHiddenSections();
4085
4025
  const filteredSections = this._allSections.filter(
4086
4026
  (section) => this._selectedRoleIds.includes(section.id)
@@ -4156,19 +4096,21 @@ let JupiterDynamicForm = class extends LitElement {
4156
4096
  }
4157
4097
  }
4158
4098
  _shouldShowFilterButton() {
4159
- return this._allSections.length > 10;
4099
+ return true;
4160
4100
  }
4161
4101
  _handleFilterRolesClick() {
4162
4102
  this._showFilterDialog = true;
4163
4103
  }
4164
4104
  _handleFilterDialogCancel() {
4165
4105
  this._showFilterDialog = false;
4106
+ console.log(`🚫 Filter dialog cancelled. Current selection: ${this._selectedRoleIds.length}/${this._allSections.length}`);
4166
4107
  }
4167
4108
  _handleRoleFilterApply(event) {
4168
4109
  const { selectedRoleIds } = event.detail;
4169
4110
  this._selectedRoleIds = selectedRoleIds;
4170
4111
  this._applyRoleFilter();
4171
4112
  this._showFilterDialog = false;
4113
+ console.log(`🎯 Applied role filter: ${selectedRoleIds.length}/${this._allSections.length} roles selected`);
4172
4114
  this.dispatchEvent(new CustomEvent("roles-filter-changed", {
4173
4115
  detail: {
4174
4116
  selectedRoleIds,
@@ -4299,7 +4241,6 @@ let JupiterDynamicForm = class extends LitElement {
4299
4241
  console.log("❌ No hypercubes data available");
4300
4242
  return [];
4301
4243
  }
4302
- console.log(`📊 Available hypercube roles:`, this.xbrlInput.hypercubes[0].roles.map((r2) => r2.roleId));
4303
4244
  const hypercubeRole = this.xbrlInput.hypercubes[0].roles.find((hr) => hr.roleId === sectionId);
4304
4245
  if (!((_c = hypercubeRole == null ? void 0 : hypercubeRole.items) == null ? void 0 : _c.length)) {
4305
4246
  console.log(`❌ No hypercube items found for role: ${sectionId}`);
@@ -4596,23 +4537,7 @@ let JupiterDynamicForm = class extends LitElement {
4596
4537
  this._submitted = true;
4597
4538
  this._validateForm();
4598
4539
  const submissionData = this._generateSubmissionData();
4599
- console.log("📊 Generated submission data:", {
4600
- formData: this._formData,
4601
- submissionData,
4602
- submissionDataCount: submissionData.length,
4603
- valid: this._valid,
4604
- errors: this._errors
4605
- });
4606
- submissionData.forEach((entry, index) => {
4607
- console.log(`📋 Submission Entry ${index + 1}:`, {
4608
- conceptId: entry.conceptId,
4609
- value: entry.value,
4610
- period: entry.period,
4611
- dimension: entry.dimension,
4612
- typedMembers: entry.typedMembers,
4613
- hasTypedMembers: !!(entry.typedMembers && Object.keys(entry.typedMembers).length > 0)
4614
- });
4615
- });
4540
+ console.log("📊 Form Submission Data:", JSON.stringify(submissionData, null, 2));
4616
4541
  this.dispatchEvent(new CustomEvent("form-submit", {
4617
4542
  detail: {
4618
4543
  data: this._formData,
@@ -5007,8 +4932,14 @@ let JupiterDynamicForm = class extends LitElement {
5007
4932
  </div>
5008
4933
  ` : ""}
5009
4934
 
5010
- <!-- Form Sections -->
5011
- ${schema.sections.map((section) => html`
4935
+ <!-- Form Sections or No Selection Message -->
4936
+ ${schema.sections.length === 0 ? html`
4937
+ <div class="no-roles-message">
4938
+ <h3>No Roles Selected</h3>
4939
+ <p>Please use the "Filter Roles" button below to select which sections you want to work with.</p>
4940
+ <p>Available roles: ${this._allSections.length}</p>
4941
+ </div>
4942
+ ` : schema.sections.map((section, index) => html`
5012
4943
  <jupiter-form-section
5013
4944
  .section="${section}"
5014
4945
  .columns="${section.columns || this._columns}"
@@ -5017,6 +4948,7 @@ let JupiterDynamicForm = class extends LitElement {
5017
4948
  .disabled="${this.disabled || this.readonly}"
5018
4949
  .collapsible="${config.collapsibleSections !== false}"
5019
4950
  .locale="${config.locale || "en-US"}"
4951
+ .isFirstSection="${index === 0}"
5020
4952
  .availableDimensions="${this._getAvailableDimensionsForSection(section.id)}"
5021
4953
  @field-change="${this._handleFieldChange}"
5022
4954
  @typed-member-change="${this._handleTypedMemberChange}"
@@ -5040,7 +4972,7 @@ let JupiterDynamicForm = class extends LitElement {
5040
4972
  <svg class="filter-icon" viewBox="0 0 24 24">
5041
4973
  <path d="M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"/>
5042
4974
  </svg>
5043
- Filter Roles
4975
+ ${this._selectedRoleIds.length === 0 ? "Select Roles" : "Filter Roles"}
5044
4976
  <span class="roles-count">${this._selectedRoleIds.length}/${this._allSections.length}</span>
5045
4977
  </button>
5046
4978
  ` : ""}
@@ -5254,6 +5186,25 @@ JupiterDynamicForm.styles = css`
5254
5186
  min-width: 18px;
5255
5187
  justify-content: center;
5256
5188
  }
5189
+
5190
+ .no-roles-message {
5191
+ padding: 40px;
5192
+ text-align: center;
5193
+ color: var(--jupiter-text-secondary, #666);
5194
+ background: var(--jupiter-background-light, #f8f9fa);
5195
+ border-radius: 8px;
5196
+ margin: 20px 0;
5197
+ }
5198
+
5199
+ .no-roles-message h3 {
5200
+ margin: 0 0 16px 0;
5201
+ color: var(--jupiter-text-primary, #333);
5202
+ }
5203
+
5204
+ .no-roles-message p {
5205
+ margin: 8px 0;
5206
+ line-height: 1.5;
5207
+ }
5257
5208
  `;
5258
5209
  __decorateClass([
5259
5210
  n2({ type: Object })