jupiter-dynamic-forms 1.19.5 → 1.19.6

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