jupiter-dynamic-forms 1.19.5 → 1.19.7

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
@@ -1662,6 +1662,7 @@ const form$1 = {
1662
1662
  collapsePanel: "Collapse side panel",
1663
1663
  validate: "Validate",
1664
1664
  preview: "Preview",
1665
+ download: "Download",
1665
1666
  cancelValidation: "Cancel Validation",
1666
1667
  lastValidationResults: "Last Validation Results",
1667
1668
  validationInProgress: "Validation In Progress"
@@ -1732,6 +1733,8 @@ const column$1 = {
1732
1733
  noMembersAvailable: "No members available for this dimension",
1733
1734
  cancel: "Cancel",
1734
1735
  removeColumn: "Remove column",
1736
+ hideColumn: "Hide column",
1737
+ showColumn: "Double-click to show column",
1735
1738
  required: "required"
1736
1739
  };
1737
1740
  const section$1 = {
@@ -1844,6 +1847,7 @@ const form = {
1844
1847
  collapsePanel: "Zijpaneel inklappen",
1845
1848
  validate: "Valideren",
1846
1849
  preview: "Voorbeeld",
1850
+ download: "Downloaden",
1847
1851
  cancelValidation: "Validatie annuleren",
1848
1852
  lastValidationResults: "Laatste validatieresultaten",
1849
1853
  validationInProgress: "Validatie bezig"
@@ -1914,6 +1918,8 @@ const column = {
1914
1918
  noMembersAvailable: "Geen leden beschikbaar voor deze dimensie",
1915
1919
  cancel: "Annuleren",
1916
1920
  removeColumn: "Kolom verwijderen",
1921
+ hideColumn: "Kolom verbergen",
1922
+ showColumn: "Dubbelklik om kolom te tonen",
1917
1923
  required: "verplicht"
1918
1924
  };
1919
1925
  const section = {
@@ -2232,7 +2238,7 @@ class DraftStorageService {
2232
2238
  /**
2233
2239
  * Create metadata snapshot from current form state
2234
2240
  */
2235
- createMetadataSnapshot(periodStartDate, periodEndDate, language, selectedRoleIds, allSections, typedMemberData, periodPreferences, periodData, unitData, reportingLanguage = "en", repeatCounts, decimalsData, roleCompletedStates) {
2241
+ createMetadataSnapshot(periodStartDate, periodEndDate, language, selectedRoleIds, allSections, typedMemberData, periodPreferences, periodData, unitData, reportingLanguage = "en", repeatCounts, decimalsData, roleCompletedStates, hiddenColumns) {
2236
2242
  return {
2237
2243
  periodStartDate,
2238
2244
  periodEndDate,
@@ -2248,6 +2254,7 @@ class DraftStorageService {
2248
2254
  decimalsData,
2249
2255
  repeatCounts,
2250
2256
  roleCompletedStates,
2257
+ hiddenColumns,
2251
2258
  schemaVersion: this.STORAGE_VERSION
2252
2259
  };
2253
2260
  }
@@ -4966,6 +4973,9 @@ let JupiterConceptTree = class extends LitElement {
4966
4973
  <!-- Input Field Cells (Period Columns) - Only for non-abstract concepts -->
4967
4974
  ${this.columns.map((column2) => {
4968
4975
  var _a, _b, _c, _d, _e;
4976
+ if (column2.hidden) {
4977
+ return html`<td class="field-cell hidden-column"></td>`;
4978
+ }
4969
4979
  const field2 = this._getFieldForColumn(column2.id);
4970
4980
  const shouldShowField = !isAbstract && field2;
4971
4981
  const storedUnit = (_b = (_a = this.unitData) == null ? void 0 : _a[this.concept.id]) == null ? void 0 : _b[column2.id];
@@ -5123,6 +5133,15 @@ JupiterConceptTree.styles = css`
5123
5133
  background: var(--bg-color-2, var(--jupiter-empty-cell-background, #f8f9fa));
5124
5134
  }
5125
5135
 
5136
+ .field-cell.hidden-column {
5137
+ width: 10px;
5138
+ min-width: 10px;
5139
+ max-width: 10px;
5140
+ padding: 0;
5141
+ overflow: hidden;
5142
+ background: var(--jupiter-border-color, #ddd);
5143
+ }
5144
+
5126
5145
  .field-cell.abstract-row {
5127
5146
  background: var(--bg-color-2, var(--jupiter-abstract-cell-background, #f0f2f5));
5128
5147
  }
@@ -6107,6 +6126,25 @@ let JupiterFormSection = class extends LitElement {
6107
6126
  bubbles: true
6108
6127
  }));
6109
6128
  }
6129
+ _handleHideColumn(columnId) {
6130
+ this._openMenuColumnId = null;
6131
+ this.dispatchEvent(new CustomEvent("column-hide", {
6132
+ detail: {
6133
+ columnId,
6134
+ sectionId: this.section.id
6135
+ },
6136
+ bubbles: true
6137
+ }));
6138
+ }
6139
+ _handleShowColumn(columnId) {
6140
+ this.dispatchEvent(new CustomEvent("column-show", {
6141
+ detail: {
6142
+ columnId,
6143
+ sectionId: this.section.id
6144
+ },
6145
+ bubbles: true
6146
+ }));
6147
+ }
6110
6148
  _toggleColumnMenu(columnId, event) {
6111
6149
  event.stopPropagation();
6112
6150
  this._openMenuColumnId = this._openMenuColumnId === columnId ? null : columnId;
@@ -6521,14 +6559,20 @@ let JupiterFormSection = class extends LitElement {
6521
6559
  <th class="header-cell concept-column"></th>
6522
6560
  ${this.columns.map((column2) => {
6523
6561
  var _a, _b, _c;
6524
- return html`
6562
+ return column2.hidden ? html`
6563
+ <th
6564
+ class="header-cell hidden-column"
6565
+ title="${I18n.t("column.showColumn")}"
6566
+ @dblclick="${() => this._handleShowColumn(column2.id)}"
6567
+ ></th>
6568
+ ` : html`
6525
6569
  <th class="header-cell ${column2.removable ? "removable" : ""}">
6526
6570
  <div class="column-header-content">
6527
6571
  <div class="column-title">
6528
6572
  ${column2.title}
6529
6573
  ${column2.description ? html`<div style="font-weight: normal; font-size: 12px; color: var(--jupiter-text-secondary, #666);">${column2.description}</div>` : ""}
6530
6574
  </div>
6531
-
6575
+
6532
6576
  <!-- Typed member input fields in column header -->
6533
6577
  ${((_a = column2.dimensionData) == null ? void 0 : _a.hasTypedMembers) ? html`
6534
6578
  <div class="typed-members-header">
@@ -6552,7 +6596,7 @@ let JupiterFormSection = class extends LitElement {
6552
6596
  </div>
6553
6597
  ` : ""}
6554
6598
  </div>
6555
-
6599
+
6556
6600
  <!-- Column menu icon (hidden in readonly mode) -->
6557
6601
  ${this.mode !== "readonly" ? html`
6558
6602
  <div
@@ -6581,6 +6625,17 @@ let JupiterFormSection = class extends LitElement {
6581
6625
  ${I18n.t("column.removeColumn")}
6582
6626
  </button>
6583
6627
  ` : ""}
6628
+ ${!column2.removable && this.columns.filter((c2) => !c2.hidden).length > 1 ? html`
6629
+ <button
6630
+ class="column-context-menu-item remove"
6631
+ @click="${(e2) => {
6632
+ e2.stopPropagation();
6633
+ this._handleHideColumn(column2.id);
6634
+ }}"
6635
+ >
6636
+ ${I18n.t("column.hideColumn")}
6637
+ </button>
6638
+ ` : ""}
6584
6639
  </div>
6585
6640
  ` : ""}
6586
6641
  ` : ""}
@@ -6754,6 +6809,20 @@ JupiterFormSection.styles = css`
6754
6809
  position: relative;
6755
6810
  }
6756
6811
 
6812
+ .header-cell.hidden-column {
6813
+ width: 10px;
6814
+ min-width: 10px;
6815
+ max-width: 10px;
6816
+ padding: 0;
6817
+ overflow: hidden;
6818
+ cursor: pointer;
6819
+ background: var(--jupiter-border-color, #ddd);
6820
+ }
6821
+
6822
+ .header-cell.hidden-column:hover {
6823
+ background: var(--jupiter-text-secondary, #999);
6824
+ }
6825
+
6757
6826
  .column-menu-icon {
6758
6827
  position: absolute;
6759
6828
  top: 8px;
@@ -9020,6 +9089,7 @@ let JupiterDynamicForm = class extends LitElement {
9020
9089
  this._typedMemberData = {};
9021
9090
  this._preservedTypedMemberData = {};
9022
9091
  this._repeatCounts = {};
9092
+ this._hiddenColumnIds = /* @__PURE__ */ new Map();
9023
9093
  this._columns = [];
9024
9094
  this._errors = [];
9025
9095
  this._touched = /* @__PURE__ */ new Set();
@@ -9773,7 +9843,9 @@ let JupiterDynamicForm = class extends LitElement {
9773
9843
  this._unitData,
9774
9844
  this.reportingLanguage,
9775
9845
  this._repeatCounts,
9776
- this._decimalsData
9846
+ this._decimalsData,
9847
+ void 0,
9848
+ this._getHiddenColumnsForMetadata()
9777
9849
  );
9778
9850
  this._draftStorageService.saveDraft(currentFormData, currentMetadata);
9779
9851
  console.log("✅ Current form data saved to draft storage with NEW preferences");
@@ -10349,6 +10421,52 @@ let JupiterDynamicForm = class extends LitElement {
10349
10421
  bubbles: true
10350
10422
  }));
10351
10423
  }
10424
+ _handleColumnHide(event) {
10425
+ const { columnId, sectionId } = event.detail;
10426
+ if (!sectionId || !columnId)
10427
+ return;
10428
+ if (!this._hiddenColumnIds.has(sectionId)) {
10429
+ this._hiddenColumnIds.set(sectionId, /* @__PURE__ */ new Set());
10430
+ }
10431
+ this._hiddenColumnIds.get(sectionId).add(columnId);
10432
+ this._dirty = true;
10433
+ this.requestUpdate();
10434
+ this.dispatchEvent(new CustomEvent("column-hide", {
10435
+ detail: { columnId, sectionId },
10436
+ bubbles: true
10437
+ }));
10438
+ }
10439
+ _handleColumnShow(event) {
10440
+ var _a;
10441
+ const { columnId, sectionId } = event.detail;
10442
+ if (!sectionId || !columnId)
10443
+ return;
10444
+ (_a = this._hiddenColumnIds.get(sectionId)) == null ? void 0 : _a.delete(columnId);
10445
+ this._dirty = true;
10446
+ this.requestUpdate();
10447
+ this.dispatchEvent(new CustomEvent("column-show", {
10448
+ detail: { columnId, sectionId },
10449
+ bubbles: true
10450
+ }));
10451
+ }
10452
+ _getColumnsWithHiddenFlags(section2) {
10453
+ const columns = section2.columns || this._columns;
10454
+ const hiddenIds = this._hiddenColumnIds.get(section2.id);
10455
+ if (!hiddenIds || hiddenIds.size === 0)
10456
+ return columns;
10457
+ return columns.map((col) => hiddenIds.has(col.id) ? { ...col, hidden: true } : col);
10458
+ }
10459
+ _getHiddenColumnsForMetadata() {
10460
+ if (this._hiddenColumnIds.size === 0)
10461
+ return void 0;
10462
+ const result = {};
10463
+ this._hiddenColumnIds.forEach((ids, sectionId) => {
10464
+ if (ids.size > 0) {
10465
+ result[sectionId] = Array.from(ids);
10466
+ }
10467
+ });
10468
+ return Object.keys(result).length > 0 ? result : void 0;
10469
+ }
10352
10470
  _handleColumnAddRequest(event) {
10353
10471
  const { sectionId, columnRequest, insertAfterColumnId } = event.detail;
10354
10472
  this._addColumnFromRequest(columnRequest, sectionId, insertAfterColumnId);
@@ -10784,7 +10902,8 @@ let JupiterDynamicForm = class extends LitElement {
10784
10902
  this.reportingLanguage,
10785
10903
  this._repeatCounts,
10786
10904
  this._decimalsData,
10787
- roleCompletedStates
10905
+ roleCompletedStates,
10906
+ this._getHiddenColumnsForMetadata()
10788
10907
  );
10789
10908
  const draftPayloadSnapshot = JSON.stringify({
10790
10909
  draftData,
@@ -10918,6 +11037,14 @@ let JupiterDynamicForm = class extends LitElement {
10918
11037
  this._roleCompletedStates = new Map(Object.entries(metadata.roleCompletedStates));
10919
11038
  console.log("🔄 Restored role completed states:", Object.keys(metadata.roleCompletedStates).length, "roles");
10920
11039
  }
11040
+ if (metadata.hiddenColumns) {
11041
+ this._hiddenColumnIds = new Map(
11042
+ Object.entries(metadata.hiddenColumns).map(
11043
+ ([sectionId, columnIds]) => [sectionId, new Set(columnIds)]
11044
+ )
11045
+ );
11046
+ console.log("🔄 Restored hidden columns for", this._hiddenColumnIds.size, "sections");
11047
+ }
10921
11048
  if (metadata.periodPreferences) {
10922
11049
  if (this._skipPeriodPreferencesRestore) {
10923
11050
  console.log("⏭️ Skipping period preferences restoration - using new filter selections");
@@ -12555,7 +12682,7 @@ let JupiterDynamicForm = class extends LitElement {
12555
12682
  <jupiter-form-section
12556
12683
  section-id="${section2.id}"
12557
12684
  .section="${section2}"
12558
- .columns="${section2.columns || this._columns}"
12685
+ .columns="${this._getColumnsWithHiddenFlags(section2)}"
12559
12686
  .datatypes="${section2.datatypes || ((_a = this.xbrlInput) == null ? void 0 : _a.datatypes)}"
12560
12687
  .formData="${this._formData}"
12561
12688
  .periodData="${this._periodData}"
@@ -12585,6 +12712,8 @@ let JupiterDynamicForm = class extends LitElement {
12585
12712
  @section-expand="${this._handleSectionExpand}"
12586
12713
  @concept-expand="${this._handleConceptExpand}"
12587
12714
  @column-remove="${this._handleColumnRemove}"
12715
+ @column-hide="${this._handleColumnHide}"
12716
+ @column-show="${this._handleColumnShow}"
12588
12717
  @column-add-request="${this._handleColumnAddRequest}"
12589
12718
  ></jupiter-form-section>
12590
12719
  `;
@@ -12699,7 +12828,7 @@ let JupiterDynamicForm = class extends LitElement {
12699
12828
  <jupiter-form-section
12700
12829
  section-id="${activeSection.id}"
12701
12830
  .section="${activeSection}"
12702
- .columns="${activeSection.columns || this._columns}"
12831
+ .columns="${this._getColumnsWithHiddenFlags(activeSection)}"
12703
12832
  .datatypes="${activeSection.datatypes || ((_a = this.xbrlInput) == null ? void 0 : _a.datatypes)}"
12704
12833
  .formData="${this._formData}"
12705
12834
  .periodData="${this._periodData}"
@@ -12729,6 +12858,8 @@ let JupiterDynamicForm = class extends LitElement {
12729
12858
  @section-expand="${this._handleSectionExpand}"
12730
12859
  @concept-expand="${this._handleConceptExpand}"
12731
12860
  @column-remove="${this._handleColumnRemove}"
12861
+ @column-hide="${this._handleColumnHide}"
12862
+ @column-show="${this._handleColumnShow}"
12732
12863
  @column-add-request="${this._handleColumnAddRequest}"
12733
12864
  ></jupiter-form-section>
12734
12865
  <div class="role-completion-row">
@@ -13098,7 +13229,7 @@ let JupiterDynamicForm = class extends LitElement {
13098
13229
  @click="${() => this.dispatchEvent(new CustomEvent("showPreview", { bubbles: true, composed: true }))}"
13099
13230
  ?disabled="${this.disabled || this.readonly}"
13100
13231
  >
13101
- ${I18n.t("form.preview")}
13232
+ ${I18n.t("form.download")}
13102
13233
  </button>
13103
13234
  ` : ""}
13104
13235
 
@@ -14124,6 +14255,9 @@ __decorateClass([
14124
14255
  __decorateClass([
14125
14256
  r()
14126
14257
  ], JupiterDynamicForm.prototype, "_repeatCounts", 2);
14258
+ __decorateClass([
14259
+ r()
14260
+ ], JupiterDynamicForm.prototype, "_hiddenColumnIds", 2);
14127
14261
  __decorateClass([
14128
14262
  r()
14129
14263
  ], JupiterDynamicForm.prototype, "_columns", 2);