jupiter-dynamic-forms 1.16.5 → 1.16.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
@@ -715,14 +715,17 @@ class XBRLFormBuilder {
715
715
  // Collapse nested levels by default
716
716
  abstract: concept.elementAbstract,
717
717
  periodType: concept.periodType,
718
- balance: concept.balance
718
+ balance: concept.balance,
719
719
  // Pass through balance attribute from XBRL data
720
+ preferredLabel: concept.preferredLabel
721
+ // Pass through for period date calculation in manual columns
720
722
  };
721
723
  }
722
724
  /**
723
725
  * Create form field from XBRL concept
724
726
  */
725
727
  static createFieldFromConcept(concept, periodStartDate, periodEndDate, forcedColumnId) {
728
+ var _a;
726
729
  const fieldType = this.mapXBRLTypeToFieldType(concept.type);
727
730
  const label = this.getPreferredLabel(concept.labels);
728
731
  let columnId;
@@ -747,7 +750,7 @@ class XBRLFormBuilder {
747
750
  // Validate and set the period type
748
751
  periodStartDate: periodStartDate || "2025-01-01",
749
752
  periodEndDate: periodEndDate || "2025-12-31",
750
- periodInstantDate: concept.periodType === "instant" ? periodEndDate || periodStartDate || "2025-01-01" : void 0
753
+ periodInstantDate: concept.periodType === "instant" ? ((_a = concept.preferredLabel) == null ? void 0 : _a.includes("periodStartLabel")) ? this.subtractOneDay(periodStartDate || "2025-01-01") : periodEndDate || periodStartDate || "2025-01-01" : void 0
751
754
  };
752
755
  if (concept.id === "nl-cd_DescriptionLocationNL__a64trl") {
753
756
  console.log(`🏗️ [Field Creation] Concept: ${concept.id}, periodType from concept: ${concept.periodType}, Field periodType: ${field2.periodType}, ColumnId: ${columnId}`);
@@ -1052,6 +1055,16 @@ class XBRLFormBuilder {
1052
1055
  return dateString;
1053
1056
  }
1054
1057
  }
1058
+ static subtractOneDay(dateString) {
1059
+ try {
1060
+ const date = new Date(dateString);
1061
+ date.setDate(date.getDate() - 1);
1062
+ return date.toISOString().split("T")[0];
1063
+ } catch (error2) {
1064
+ console.error(`Error subtracting one day from date ${dateString}:`, error2);
1065
+ return dateString;
1066
+ }
1067
+ }
1055
1068
  /**
1056
1069
  * Generate previous year columns based on current year columns
1057
1070
  */
@@ -7036,10 +7049,10 @@ JupiterFilterRolesDialog.styles = css`
7036
7049
  transition: all 0.2s ease;
7037
7050
  }
7038
7051
 
7039
- .selection-control:hover {
7040
- background: var(--menuBgColorLighter, var(--jupiter-primary-color, #1976d2));
7041
- color: white;
7042
- }
7052
+ // .selection-control:hover {
7053
+ // background: var(--menuBgColorLighter, var(--jupiter-primary-color, #1976d2));
7054
+ // color: white;
7055
+ // }
7043
7056
 
7044
7057
  .roles-list {
7045
7058
  display: flex;
@@ -8728,6 +8741,19 @@ let JupiterDynamicForm = class extends LitElement {
8728
8741
  }
8729
8742
  return `${startDate} / ${endDate}`;
8730
8743
  }
8744
+ _resolveInstantDate(preferredLabel, instantDate, startDate, endDate) {
8745
+ if (preferredLabel == null ? void 0 : preferredLabel.includes("periodStartLabel")) {
8746
+ const base = startDate || "2025-01-01";
8747
+ try {
8748
+ const d2 = new Date(base);
8749
+ d2.setDate(d2.getDate() - 1);
8750
+ return d2.toISOString().split("T")[0];
8751
+ } catch {
8752
+ return base;
8753
+ }
8754
+ }
8755
+ return instantDate || endDate || startDate || "2025-01-01";
8756
+ }
8731
8757
  _addColumnFromRequest(request, sectionId, insertAfterColumnId) {
8732
8758
  var _a, _b, _c, _d, _e;
8733
8759
  const timestamp = Date.now();
@@ -8926,6 +8952,9 @@ let JupiterDynamicForm = class extends LitElement {
8926
8952
  if (this._shouldCreateFieldForConcept(concept, request)) {
8927
8953
  const existingField = (_a = concept.fields) == null ? void 0 : _a[0];
8928
8954
  let field2;
8955
+ const colStartDate = request.periodType === "instant" ? request.instantDate : request.startDate;
8956
+ const colEndDate = request.periodType === "instant" ? request.instantDate : request.endDate;
8957
+ const instantDate = this._resolveInstantDate(concept.preferredLabel, request.instantDate, colStartDate, colEndDate);
8929
8958
  if (existingField) {
8930
8959
  field2 = {
8931
8960
  id: `${concept.id}_${columnId}`,
@@ -8939,13 +8968,10 @@ let JupiterDynamicForm = class extends LitElement {
8939
8968
  validation: existingField.validation,
8940
8969
  defaultValue: existingField.defaultValue,
8941
8970
  periodType: concept.periodType,
8942
- // Add periodType from concept
8943
8971
  conceptType: concept.type,
8944
- // CRITICAL: Include conceptType for XBRL validation
8945
- // Set period dates from the add column request
8946
- periodStartDate: request.periodType === "instant" ? request.instantDate : request.startDate,
8947
- periodEndDate: request.periodType === "instant" ? request.instantDate : request.endDate,
8948
- periodInstantDate: concept.periodType === "instant" ? request.instantDate || request.startDate : void 0
8972
+ periodStartDate: colStartDate,
8973
+ periodEndDate: colEndDate,
8974
+ periodInstantDate: concept.periodType === "instant" ? instantDate : void 0
8949
8975
  };
8950
8976
  } else {
8951
8977
  field2 = {
@@ -8960,13 +8986,10 @@ let JupiterDynamicForm = class extends LitElement {
8960
8986
  validation: [],
8961
8987
  defaultValue: "",
8962
8988
  periodType: concept.periodType,
8963
- // Add periodType from concept
8964
8989
  conceptType: concept.type,
8965
- // CRITICAL: Include conceptType for XBRL validation
8966
- // Set period dates from the add column request
8967
- periodStartDate: request.periodType === "instant" ? request.instantDate : request.startDate,
8968
- periodEndDate: request.periodType === "instant" ? request.instantDate : request.endDate,
8969
- periodInstantDate: concept.periodType === "instant" ? request.instantDate || request.startDate : void 0
8990
+ periodStartDate: colStartDate,
8991
+ periodEndDate: colEndDate,
8992
+ periodInstantDate: concept.periodType === "instant" ? instantDate : void 0
8970
8993
  };
8971
8994
  }
8972
8995
  if (!concept.fields) {
@@ -11011,7 +11034,7 @@ let JupiterDynamicForm = class extends LitElement {
11011
11034
 
11012
11035
  ${this._validationStatus === "complete" || this.showLastValidationResultBtn ? html`
11013
11036
  <button
11014
- class="btn-last-results"
11037
+ class="btn-secondary btn-last-results"
11015
11038
  @click="${() => this.dispatchEvent(new CustomEvent("show-validation-results", { bubbles: true, composed: true }))}"
11016
11039
  ?disabled="${this.disabled || this.readonly}"
11017
11040
  >
@@ -11267,14 +11290,6 @@ JupiterDynamicForm.styles = css`
11267
11290
  background: var(--jupiter-primary-color-dark, #1565c0);
11268
11291
  }
11269
11292
 
11270
- .btn-last-results {
11271
- background: var(--jupiter-primary-color, #1976d2);
11272
- color: white;
11273
- }
11274
- .btn-last-results:hover:not(:disabled) {
11275
- background: var(--jupiter-primary-color, #1976d2);
11276
- color: white;
11277
- }
11278
11293
 
11279
11294
  .validation-spinner {
11280
11295
  display: inline-block;
@@ -11344,15 +11359,15 @@ JupiterDynamicForm.styles = css`
11344
11359
  .no-roles-message {
11345
11360
  padding: 40px;
11346
11361
  text-align: center;
11347
- color: var(--jupiter-text-secondary, #666);
11348
- background: var(--jupiter-background-light, #f8f9fa);
11362
+ color: var(--primaryTextColor, var(--jupiter-text-secondary, #666));
11363
+ background: var(--bg-color-2, var(--jupiter-background-light, #f8f9fa));
11349
11364
  border-radius: 8px;
11350
11365
  margin: 20px 0;
11351
11366
  }
11352
11367
 
11353
11368
  .no-roles-message h3 {
11354
11369
  margin: 0 0 16px 0;
11355
- color: var(--jupiter-text-primary, #333);
11370
+ color: var(--primaryTextColor, var(--jupiter-text-primary, #333));
11356
11371
  }
11357
11372
 
11358
11373
  .no-roles-message p {
@@ -11487,11 +11502,12 @@ JupiterDynamicForm.styles = css`
11487
11502
 
11488
11503
  .side-panel-search-results-info {
11489
11504
  font-size: 12px;
11490
- color: var(--jupiter-text-secondary, #666);
11491
11505
  padding: 8px 16px;
11492
11506
  text-align: center;
11493
11507
  border-bottom: 1px solid var(--jupiter-border-color, #e0e0e0);
11494
- background: var(--jupiter-background-light, #f8f9fa);
11508
+
11509
+ color: var(--primaryTextColor, var(--jupiter-text-secondary, #666));
11510
+ background: var(--bg-color-2, var(--jupiter-background-light, #f8f9fa));
11495
11511
  }
11496
11512
 
11497
11513
  .side-panel-no-results {
@@ -11550,6 +11566,7 @@ JupiterDynamicForm.styles = css`
11550
11566
  flex: 1;
11551
11567
  overflow-y: auto;
11552
11568
  padding: 0;
11569
+ background: var(--bg-color-2, var(--jupiter-background, #fff));
11553
11570
  }
11554
11571
 
11555
11572
  .side-panel-content .form-sections {