jupiter-dynamic-forms 1.14.2 → 1.14.4
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/core/add-column-dialog.d.ts.map +1 -1
- package/dist/core/dynamic-form.d.ts +5 -0
- package/dist/core/dynamic-form.d.ts.map +1 -1
- package/dist/core/filter-roles-dialog.d.ts +35 -0
- package/dist/core/filter-roles-dialog.d.ts.map +1 -1
- package/dist/core/form-field.d.ts +9 -0
- package/dist/core/form-field.d.ts.map +1 -1
- package/dist/index.js +242 -103
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +616 -72
- package/dist/index.mjs.map +1 -1
- package/dist/utils/xbrl-form-builder.d.ts +8 -0
- package/dist/utils/xbrl-form-builder.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -619,8 +619,12 @@ class XBRLFormBuilder {
|
|
|
619
619
|
const periodTypes = new Set(
|
|
620
620
|
nonAbstractConcepts.filter((concept) => concept.periodType).map((concept) => concept.periodType)
|
|
621
621
|
);
|
|
622
|
-
|
|
622
|
+
let hypercubeRole = hypercubeData == null ? void 0 : hypercubeData.roles.find((hr) => hr.roleId === role.id);
|
|
623
623
|
const rolePreferences = periodPreferences == null ? void 0 : periodPreferences[role.id];
|
|
624
|
+
if (hypercubeRole && (rolePreferences == null ? void 0 : rolePreferences.dimensionSelections) && rolePreferences.dimensionSelections.length > 0) {
|
|
625
|
+
console.log(`🔍 Filtering dimensions for role ${role.id} based on user selections`);
|
|
626
|
+
hypercubeRole = this.filterHypercubeDimensionsBySelection(hypercubeRole, rolePreferences.dimensionSelections);
|
|
627
|
+
}
|
|
624
628
|
const columns = this.generateDefaultColumnsForRole(role, periodStartDate || "2025-01-01", periodEndDate || "2025-12-31", hypercubeRole, nonAbstractConcepts, periodTypes, rolePreferences);
|
|
625
629
|
const availableColumnIds = columns.map((col) => col.id);
|
|
626
630
|
const roleInfo = { periodTypes, availableColumnIds };
|
|
@@ -840,6 +844,53 @@ class XBRLFormBuilder {
|
|
|
840
844
|
});
|
|
841
845
|
}
|
|
842
846
|
}
|
|
847
|
+
/**
|
|
848
|
+
* Filter hypercube dimensions to only include selected members
|
|
849
|
+
*/
|
|
850
|
+
static filterHypercubeDimensionsBySelection(hypercubeRole, dimensionSelections) {
|
|
851
|
+
const filteredRole = JSON.parse(JSON.stringify(hypercubeRole));
|
|
852
|
+
if (!filteredRole.items || filteredRole.items.length === 0) {
|
|
853
|
+
return filteredRole;
|
|
854
|
+
}
|
|
855
|
+
filteredRole.items.forEach((item) => {
|
|
856
|
+
if (!item.dimensions)
|
|
857
|
+
return;
|
|
858
|
+
item.dimensions = item.dimensions.map((dimension) => {
|
|
859
|
+
var _a, _b;
|
|
860
|
+
const selection = dimensionSelections.find((s2) => s2.dimensionId === dimension.id);
|
|
861
|
+
if (!selection || !selection.selectedMemberIds || selection.selectedMemberIds.length === 0) {
|
|
862
|
+
return dimension;
|
|
863
|
+
}
|
|
864
|
+
const filteredDimension = { ...dimension };
|
|
865
|
+
filteredDimension.members = this.filterMembersBySelection(dimension.members, selection.selectedMemberIds);
|
|
866
|
+
console.log(` ✅ Filtered dimension ${dimension.id}: ${((_a = dimension.members) == null ? void 0 : _a.length) || 0} → ${((_b = filteredDimension.members) == null ? void 0 : _b.length) || 0} members`);
|
|
867
|
+
return filteredDimension;
|
|
868
|
+
});
|
|
869
|
+
});
|
|
870
|
+
return filteredRole;
|
|
871
|
+
}
|
|
872
|
+
/**
|
|
873
|
+
* Recursively filter dimension members to only include selected IDs
|
|
874
|
+
*/
|
|
875
|
+
static filterMembersBySelection(members, selectedIds) {
|
|
876
|
+
if (!members || !Array.isArray(members))
|
|
877
|
+
return [];
|
|
878
|
+
const filtered = [];
|
|
879
|
+
members.forEach((member) => {
|
|
880
|
+
if (selectedIds.includes(member.id)) {
|
|
881
|
+
filtered.push({
|
|
882
|
+
...member,
|
|
883
|
+
children: []
|
|
884
|
+
// Reset children as we're doing flat selection
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
|
+
if (member.children && member.children.length > 0) {
|
|
888
|
+
const filteredChildren = this.filterMembersBySelection(member.children, selectedIds);
|
|
889
|
+
filtered.push(...filteredChildren);
|
|
890
|
+
}
|
|
891
|
+
});
|
|
892
|
+
return filtered;
|
|
893
|
+
}
|
|
843
894
|
/**
|
|
844
895
|
* Generate default columns based on period types of non-abstract concepts in a role
|
|
845
896
|
*/
|
|
@@ -1483,7 +1534,18 @@ const filter$1 = {
|
|
|
1483
1534
|
showPreviousYear: "Show previous year",
|
|
1484
1535
|
duration: "Duration",
|
|
1485
1536
|
instant: "Instant",
|
|
1486
|
-
uri: "URI"
|
|
1537
|
+
uri: "URI",
|
|
1538
|
+
dimensionMemberSelection: "Dimension Member Selection",
|
|
1539
|
+
selectAllMembers: "Select All",
|
|
1540
|
+
clearMembers: "Clear",
|
|
1541
|
+
availableRoles: "Available Roles",
|
|
1542
|
+
chosenRoles: "Chosen Roles",
|
|
1543
|
+
roleCount: "role(s)",
|
|
1544
|
+
rolesSelected: "role(s) selected",
|
|
1545
|
+
addSelectedRole: "Add selected role",
|
|
1546
|
+
addAllRoles: "Add all roles",
|
|
1547
|
+
removeSelectedRole: "Remove selected role",
|
|
1548
|
+
removeAllRoles: "Remove all roles"
|
|
1487
1549
|
};
|
|
1488
1550
|
const column$1 = {
|
|
1489
1551
|
addColumn: "Add Column",
|
|
@@ -1596,7 +1658,18 @@ const filter = {
|
|
|
1596
1658
|
showPreviousYear: "Vorig jaar weergeven",
|
|
1597
1659
|
duration: "Duur",
|
|
1598
1660
|
instant: "Moment",
|
|
1599
|
-
uri: "URI"
|
|
1661
|
+
uri: "URI",
|
|
1662
|
+
dimensionMemberSelection: "Dimensieleden selectie",
|
|
1663
|
+
selectAllMembers: "Alles selecteren",
|
|
1664
|
+
clearMembers: "Wissen",
|
|
1665
|
+
availableRoles: "Beschikbare rollen",
|
|
1666
|
+
chosenRoles: "Gekozen rollen",
|
|
1667
|
+
roleCount: "rol(len)",
|
|
1668
|
+
rolesSelected: "rol(len) geselecteerd",
|
|
1669
|
+
addSelectedRole: "Geselecteerde rol toevoegen",
|
|
1670
|
+
addAllRoles: "Alle rollen toevoegen",
|
|
1671
|
+
removeSelectedRole: "Geselecteerde rol verwijderen",
|
|
1672
|
+
removeAllRoles: "Alle rollen verwijderen"
|
|
1600
1673
|
};
|
|
1601
1674
|
const column = {
|
|
1602
1675
|
addColumn: "Kolom toevoegen",
|
|
@@ -1879,6 +1952,8 @@ class DraftStorageService {
|
|
|
1879
1952
|
columnId: column2.id,
|
|
1880
1953
|
label: column2.title,
|
|
1881
1954
|
// FormColumn uses 'title' not 'label'
|
|
1955
|
+
description: column2.description,
|
|
1956
|
+
// Save description (period display)
|
|
1882
1957
|
periodType: this._inferPeriodTypeFromColumn(column2),
|
|
1883
1958
|
date: column2.periodStartDate,
|
|
1884
1959
|
// Use periodStartDate for instant
|
|
@@ -2637,6 +2712,60 @@ let JupiterFormField = class extends LitElement {
|
|
|
2637
2712
|
}));
|
|
2638
2713
|
console.log(`🟦 [FormField] Dispatched field-blur event with ${this._xbrlErrors.length} errors`);
|
|
2639
2714
|
}
|
|
2715
|
+
/**
|
|
2716
|
+
* Checks if the concept type or its baseType chain contains monetary type
|
|
2717
|
+
*/
|
|
2718
|
+
_isMonetaryType() {
|
|
2719
|
+
if (!this.conceptType || !this.datatypes) {
|
|
2720
|
+
return false;
|
|
2721
|
+
}
|
|
2722
|
+
if (this.conceptType.includes("monetary") || this.conceptType.includes("Monetary")) {
|
|
2723
|
+
return true;
|
|
2724
|
+
}
|
|
2725
|
+
const baseTypeChain = resolveBaseTypeChain(this.conceptType, this.datatypes);
|
|
2726
|
+
return baseTypeChain.some(
|
|
2727
|
+
(type) => type.includes("monetary") || type.includes("Monetary")
|
|
2728
|
+
);
|
|
2729
|
+
}
|
|
2730
|
+
/**
|
|
2731
|
+
* Prevents non-numeric input in number fields for Firefox compatibility
|
|
2732
|
+
* Firefox allows typing any character in type="number" inputs
|
|
2733
|
+
*/
|
|
2734
|
+
_handleKeyDown(event) {
|
|
2735
|
+
const target = event.target;
|
|
2736
|
+
if (target.type !== "number") {
|
|
2737
|
+
return;
|
|
2738
|
+
}
|
|
2739
|
+
const allowedKeys = [
|
|
2740
|
+
"Backspace",
|
|
2741
|
+
"Delete",
|
|
2742
|
+
"Tab",
|
|
2743
|
+
"Escape",
|
|
2744
|
+
"Enter",
|
|
2745
|
+
"ArrowLeft",
|
|
2746
|
+
"ArrowRight",
|
|
2747
|
+
"ArrowUp",
|
|
2748
|
+
"ArrowDown",
|
|
2749
|
+
"Home",
|
|
2750
|
+
"End"
|
|
2751
|
+
];
|
|
2752
|
+
if (allowedKeys.includes(event.key)) {
|
|
2753
|
+
return;
|
|
2754
|
+
}
|
|
2755
|
+
if (event.ctrlKey || event.metaKey) {
|
|
2756
|
+
return;
|
|
2757
|
+
}
|
|
2758
|
+
if (event.key === "-" && target.selectionStart === 0 && !target.value.includes("-")) {
|
|
2759
|
+
return;
|
|
2760
|
+
}
|
|
2761
|
+
if (event.key === "." && !target.value.includes(".")) {
|
|
2762
|
+
return;
|
|
2763
|
+
}
|
|
2764
|
+
if (event.key >= "0" && event.key <= "9") {
|
|
2765
|
+
return;
|
|
2766
|
+
}
|
|
2767
|
+
event.preventDefault();
|
|
2768
|
+
}
|
|
2640
2769
|
/**
|
|
2641
2770
|
* Validates the current value against XBRL datatype validation rules
|
|
2642
2771
|
* Called on blur event when user loses focus on the input field
|
|
@@ -2793,7 +2922,8 @@ let JupiterFormField = class extends LitElement {
|
|
|
2793
2922
|
_renderInput() {
|
|
2794
2923
|
const hasErrors = this._errors.some((e2) => e2.severity === "error");
|
|
2795
2924
|
const hasWarnings = this._errors.some((e2) => e2.severity === "warning");
|
|
2796
|
-
const
|
|
2925
|
+
const isMonetary = this._isMonetaryType();
|
|
2926
|
+
const cssClass = `field-input ${hasErrors ? "error" : hasWarnings ? "warning" : ""} ${isMonetary ? "monetary" : ""}`;
|
|
2797
2927
|
const fieldId = `${this.conceptId}__${this.columnId}`;
|
|
2798
2928
|
const fieldName = `data[${this.conceptId}][${this.columnId}]`;
|
|
2799
2929
|
const typeConfig = getInputTypeForConceptType(this.conceptType, this.datatypes);
|
|
@@ -2883,6 +3013,7 @@ let JupiterFormField = class extends LitElement {
|
|
|
2883
3013
|
@input="${this._handleInput}"
|
|
2884
3014
|
@focus="${this._handleFocus}"
|
|
2885
3015
|
@blur="${this._handleBlur}"
|
|
3016
|
+
@keydown="${this._handleKeyDown}"
|
|
2886
3017
|
/>
|
|
2887
3018
|
`;
|
|
2888
3019
|
}
|
|
@@ -3259,6 +3390,10 @@ JupiterFormField.styles = css`
|
|
|
3259
3390
|
border-color: var(--jupiter-warning-color, #ff9800);
|
|
3260
3391
|
}
|
|
3261
3392
|
|
|
3393
|
+
.field-input.monetary {
|
|
3394
|
+
text-align: right;
|
|
3395
|
+
}
|
|
3396
|
+
|
|
3262
3397
|
.field-errors {
|
|
3263
3398
|
margin-top: 4px;
|
|
3264
3399
|
}
|
|
@@ -3788,7 +3923,7 @@ let JupiterAddColumnDialog = class extends LitElement {
|
|
|
3788
3923
|
}
|
|
3789
3924
|
_autoSelectSingleMemberDimensions() {
|
|
3790
3925
|
this.availableDimensions.forEach((dimension) => {
|
|
3791
|
-
if (dimension.members && dimension.members.length
|
|
3926
|
+
if (dimension.members && dimension.members.length > 0) {
|
|
3792
3927
|
const member = dimension.members[0];
|
|
3793
3928
|
const selection = {
|
|
3794
3929
|
axisId: dimension.id,
|
|
@@ -3798,6 +3933,7 @@ let JupiterAddColumnDialog = class extends LitElement {
|
|
|
3798
3933
|
isTyped: false
|
|
3799
3934
|
};
|
|
3800
3935
|
this._selectedDimensions.set(dimension.id, selection);
|
|
3936
|
+
console.log(`🎯 Auto-selected default member: ${dimension.axisLabel} -> ${member.label}`);
|
|
3801
3937
|
} else if (dimension.typedMember && (!dimension.members || dimension.members.length === 0)) {
|
|
3802
3938
|
const selection = {
|
|
3803
3939
|
axisId: dimension.id,
|
|
@@ -3806,6 +3942,7 @@ let JupiterAddColumnDialog = class extends LitElement {
|
|
|
3806
3942
|
// Note: typedValue will be entered in column header, not here
|
|
3807
3943
|
};
|
|
3808
3944
|
this._selectedDimensions.set(dimension.id, selection);
|
|
3945
|
+
console.log(`🎯 Auto-selected typed dimension: ${dimension.axisLabel} (value will be entered in column header)`);
|
|
3809
3946
|
}
|
|
3810
3947
|
});
|
|
3811
3948
|
}
|
|
@@ -4985,6 +5122,7 @@ let JupiterFilterRolesDialog = class extends LitElement {
|
|
|
4985
5122
|
this.selectedRoleIds = [];
|
|
4986
5123
|
this.periodPreferences = {};
|
|
4987
5124
|
this.mode = "user";
|
|
5125
|
+
this.hypercubeData = null;
|
|
4988
5126
|
this._tempSelectedRoles = /* @__PURE__ */ new Set();
|
|
4989
5127
|
this._searchQuery = "";
|
|
4990
5128
|
this._filteredRoles = [];
|
|
@@ -5116,6 +5254,27 @@ let JupiterFilterRolesDialog = class extends LitElement {
|
|
|
5116
5254
|
// Read from role data in presentation.json
|
|
5117
5255
|
};
|
|
5118
5256
|
}
|
|
5257
|
+
const dimensions = this._getDimensionsForRole(role.id);
|
|
5258
|
+
if (dimensions.length > 0 && !(existingPrefs == null ? void 0 : existingPrefs.dimensionSelections)) {
|
|
5259
|
+
if (!preferences[role.id].dimensionSelections) {
|
|
5260
|
+
preferences[role.id].dimensionSelections = [];
|
|
5261
|
+
}
|
|
5262
|
+
dimensions.forEach((dimension) => {
|
|
5263
|
+
var _a, _b;
|
|
5264
|
+
const allMembers = this._getAllDimensionMembers(dimension.members);
|
|
5265
|
+
if (allMembers.length > 0) {
|
|
5266
|
+
const dimensionLabel = ((_b = (_a = dimension.labels) == null ? void 0 : _a.find((l2) => l2.role === "http://www.xbrl.org/2003/role/label")) == null ? void 0 : _b.label) || dimension.conceptName;
|
|
5267
|
+
const allMemberIds = allMembers.map((m) => m.id);
|
|
5268
|
+
const dimensionSelection = {
|
|
5269
|
+
dimensionId: dimension.id,
|
|
5270
|
+
dimensionLabel,
|
|
5271
|
+
selectedMemberIds: allMemberIds
|
|
5272
|
+
};
|
|
5273
|
+
preferences[role.id].dimensionSelections.push(dimensionSelection);
|
|
5274
|
+
console.log(`✅ Auto-selected all ${allMemberIds.length} members for dimension: ${dimensionLabel}`);
|
|
5275
|
+
}
|
|
5276
|
+
});
|
|
5277
|
+
}
|
|
5119
5278
|
});
|
|
5120
5279
|
this._tempPeriodPreferences = preferences;
|
|
5121
5280
|
}
|
|
@@ -5203,6 +5362,7 @@ let JupiterFilterRolesDialog = class extends LitElement {
|
|
|
5203
5362
|
});
|
|
5204
5363
|
console.log("✅ Apply Filter - Enhanced structure being emitted:", orderedRolesWithMetadata);
|
|
5205
5364
|
console.log("📋 Order array:", this._chosenRoleOrder);
|
|
5365
|
+
console.log("📊 Dimension preferences being emitted:", this._tempPeriodPreferences);
|
|
5206
5366
|
this.dispatchEvent(new CustomEvent("roles-filter-apply", {
|
|
5207
5367
|
detail: {
|
|
5208
5368
|
selectedRoleIds: orderedRolesWithMetadata,
|
|
@@ -5211,6 +5371,200 @@ let JupiterFilterRolesDialog = class extends LitElement {
|
|
|
5211
5371
|
bubbles: true
|
|
5212
5372
|
}));
|
|
5213
5373
|
}
|
|
5374
|
+
/**
|
|
5375
|
+
* Get dimensions for a specific role from hypercube data
|
|
5376
|
+
*/
|
|
5377
|
+
_getDimensionsForRole(roleId) {
|
|
5378
|
+
var _a, _b;
|
|
5379
|
+
console.log("🔍 [getDimensionsForRole] Called with roleId:", roleId);
|
|
5380
|
+
console.log("🔍 [getDimensionsForRole] hypercubeData exists:", !!this.hypercubeData);
|
|
5381
|
+
console.log("🔍 [getDimensionsForRole] hypercubeData type:", typeof this.hypercubeData);
|
|
5382
|
+
console.log("🔍 [getDimensionsForRole] hypercubeData value:", this.hypercubeData);
|
|
5383
|
+
if (!this.hypercubeData) {
|
|
5384
|
+
console.error("❌ [getDimensionsForRole] CRITICAL: hypercubeData is null/undefined/false");
|
|
5385
|
+
console.error("❌ Parent component must pass hypercubeData property to filter dialog!");
|
|
5386
|
+
console.error('❌ Example: <jupiter-filter-roles-dialog .hypercubeData="${hypercubeData}">');
|
|
5387
|
+
return [];
|
|
5388
|
+
}
|
|
5389
|
+
let hypercubeDataObj = this.hypercubeData;
|
|
5390
|
+
if (Array.isArray(this.hypercubeData) && this.hypercubeData.length > 0) {
|
|
5391
|
+
console.log("📦 [getDimensionsForRole] Detected array-wrapped format, unwrapping...");
|
|
5392
|
+
hypercubeDataObj = this.hypercubeData[0];
|
|
5393
|
+
}
|
|
5394
|
+
console.log("🔍 [getDimensionsForRole] hypercubeDataObj.roles exists:", !!(hypercubeDataObj == null ? void 0 : hypercubeDataObj.roles));
|
|
5395
|
+
if (!(hypercubeDataObj == null ? void 0 : hypercubeDataObj.roles)) {
|
|
5396
|
+
console.warn("⚠️ [getDimensionsForRole] No roles found in hypercube data structure");
|
|
5397
|
+
console.warn("⚠️ Expected structure: { roles: [...] } or [{ roles: [...] }]");
|
|
5398
|
+
return [];
|
|
5399
|
+
}
|
|
5400
|
+
console.log(
|
|
5401
|
+
"🔍 [getDimensionsForRole] Available hypercube roles:",
|
|
5402
|
+
hypercubeDataObj.roles.map((r2) => r2.roleId)
|
|
5403
|
+
);
|
|
5404
|
+
const hypercubeRole = hypercubeDataObj.roles.find((r2) => r2.roleId === roleId);
|
|
5405
|
+
console.log("🔍 [getDimensionsForRole] Found hypercube role:", !!hypercubeRole);
|
|
5406
|
+
if (!((_a = hypercubeRole == null ? void 0 : hypercubeRole.items) == null ? void 0 : _a.length)) {
|
|
5407
|
+
console.warn("⚠️ [getDimensionsForRole] No items found in hypercube role for:", roleId);
|
|
5408
|
+
return [];
|
|
5409
|
+
}
|
|
5410
|
+
console.log("🔍 [getDimensionsForRole] Items count:", hypercubeRole.items.length);
|
|
5411
|
+
const dimensions = ((_b = hypercubeRole.items[0]) == null ? void 0 : _b.dimensions) || [];
|
|
5412
|
+
console.log("🔍 [getDimensionsForRole] Total dimensions found:", dimensions.length);
|
|
5413
|
+
console.log("🔍 [getDimensionsForRole] Dimension details:", dimensions.map((d2) => {
|
|
5414
|
+
var _a2;
|
|
5415
|
+
return {
|
|
5416
|
+
id: d2.id,
|
|
5417
|
+
type: d2.dimensionType,
|
|
5418
|
+
hasMembers: !!(d2.members && d2.members.length > 0),
|
|
5419
|
+
membersCount: ((_a2 = d2.members) == null ? void 0 : _a2.length) || 0
|
|
5420
|
+
};
|
|
5421
|
+
}));
|
|
5422
|
+
const filtered = dimensions.filter(
|
|
5423
|
+
(dim) => dim.dimensionType === "explicit" && dim.members && Array.isArray(dim.members) && dim.members.length > 0
|
|
5424
|
+
);
|
|
5425
|
+
console.log("✅ [getDimensionsForRole] Filtered dimensions count:", filtered.length);
|
|
5426
|
+
console.log("✅ [getDimensionsForRole] Filtered dimension IDs:", filtered.map((d2) => d2.id));
|
|
5427
|
+
return filtered;
|
|
5428
|
+
}
|
|
5429
|
+
/**
|
|
5430
|
+
* Get all members for a dimension (including nested children)
|
|
5431
|
+
*/
|
|
5432
|
+
_getAllDimensionMembers(members) {
|
|
5433
|
+
if (!members || !Array.isArray(members)) {
|
|
5434
|
+
return [];
|
|
5435
|
+
}
|
|
5436
|
+
const allMembers = [];
|
|
5437
|
+
members.forEach((member) => {
|
|
5438
|
+
allMembers.push(member);
|
|
5439
|
+
if (member.children && member.children.length > 0) {
|
|
5440
|
+
allMembers.push(...this._getAllDimensionMembers(member.children));
|
|
5441
|
+
}
|
|
5442
|
+
});
|
|
5443
|
+
return allMembers;
|
|
5444
|
+
}
|
|
5445
|
+
/**
|
|
5446
|
+
* Check if dimension has only one member (should be auto-selected and disabled)
|
|
5447
|
+
*/
|
|
5448
|
+
_isSingleMemberDimension(dimension) {
|
|
5449
|
+
const allMembers = this._getAllDimensionMembers(dimension.members);
|
|
5450
|
+
return allMembers.length === 1;
|
|
5451
|
+
}
|
|
5452
|
+
/**
|
|
5453
|
+
* Handle dimension member selection change
|
|
5454
|
+
*/
|
|
5455
|
+
_handleDimensionMemberChange(event, roleId, dimensionId, memberId) {
|
|
5456
|
+
var _a, _b;
|
|
5457
|
+
event.stopPropagation();
|
|
5458
|
+
const checkbox = event.target;
|
|
5459
|
+
const newPreferences = { ...this._tempPeriodPreferences };
|
|
5460
|
+
if (!newPreferences[roleId]) {
|
|
5461
|
+
newPreferences[roleId] = {
|
|
5462
|
+
showDuration: true,
|
|
5463
|
+
showInstant: true,
|
|
5464
|
+
showPreviousYear: false,
|
|
5465
|
+
dimensionSelections: []
|
|
5466
|
+
};
|
|
5467
|
+
}
|
|
5468
|
+
if (!newPreferences[roleId].dimensionSelections) {
|
|
5469
|
+
newPreferences[roleId].dimensionSelections = [];
|
|
5470
|
+
}
|
|
5471
|
+
let dimensionSelection = newPreferences[roleId].dimensionSelections.find(
|
|
5472
|
+
(ds) => ds.dimensionId === dimensionId
|
|
5473
|
+
);
|
|
5474
|
+
if (!dimensionSelection) {
|
|
5475
|
+
const dimensions = this._getDimensionsForRole(roleId);
|
|
5476
|
+
const dimension = dimensions.find((d2) => d2.id === dimensionId);
|
|
5477
|
+
const dimensionLabel = ((_b = (_a = dimension == null ? void 0 : dimension.labels) == null ? void 0 : _a.find((l2) => l2.role === "http://www.xbrl.org/2003/role/label")) == null ? void 0 : _b.label) || dimensionId;
|
|
5478
|
+
dimensionSelection = {
|
|
5479
|
+
dimensionId,
|
|
5480
|
+
dimensionLabel,
|
|
5481
|
+
selectedMemberIds: []
|
|
5482
|
+
};
|
|
5483
|
+
newPreferences[roleId].dimensionSelections.push(dimensionSelection);
|
|
5484
|
+
}
|
|
5485
|
+
if (checkbox.checked) {
|
|
5486
|
+
if (!dimensionSelection.selectedMemberIds.includes(memberId)) {
|
|
5487
|
+
dimensionSelection.selectedMemberIds.push(memberId);
|
|
5488
|
+
}
|
|
5489
|
+
} else {
|
|
5490
|
+
dimensionSelection.selectedMemberIds = dimensionSelection.selectedMemberIds.filter(
|
|
5491
|
+
(id) => id !== memberId
|
|
5492
|
+
);
|
|
5493
|
+
}
|
|
5494
|
+
this._tempPeriodPreferences = newPreferences;
|
|
5495
|
+
console.log("📊 Updated dimension selections:", newPreferences[roleId].dimensionSelections);
|
|
5496
|
+
this.requestUpdate();
|
|
5497
|
+
}
|
|
5498
|
+
/**
|
|
5499
|
+
* Check if a dimension member is selected
|
|
5500
|
+
*/
|
|
5501
|
+
_isDimensionMemberSelected(roleId, dimensionId, memberId) {
|
|
5502
|
+
const preferences = this._tempPeriodPreferences[roleId];
|
|
5503
|
+
if (!(preferences == null ? void 0 : preferences.dimensionSelections)) {
|
|
5504
|
+
return false;
|
|
5505
|
+
}
|
|
5506
|
+
const dimensionSelection = preferences.dimensionSelections.find(
|
|
5507
|
+
(ds) => ds.dimensionId === dimensionId
|
|
5508
|
+
);
|
|
5509
|
+
return (dimensionSelection == null ? void 0 : dimensionSelection.selectedMemberIds.includes(memberId)) || false;
|
|
5510
|
+
}
|
|
5511
|
+
/**
|
|
5512
|
+
* Select all members for a dimension
|
|
5513
|
+
*/
|
|
5514
|
+
_selectAllDimensionMembers(roleId, dimensionId) {
|
|
5515
|
+
var _a, _b;
|
|
5516
|
+
const dimensions = this._getDimensionsForRole(roleId);
|
|
5517
|
+
const dimension = dimensions.find((d2) => d2.id === dimensionId);
|
|
5518
|
+
if (!dimension)
|
|
5519
|
+
return;
|
|
5520
|
+
const allMembers = this._getAllDimensionMembers(dimension.members);
|
|
5521
|
+
const allMemberIds = allMembers.map((m) => m.id);
|
|
5522
|
+
const newPreferences = { ...this._tempPeriodPreferences };
|
|
5523
|
+
if (!newPreferences[roleId]) {
|
|
5524
|
+
newPreferences[roleId] = {
|
|
5525
|
+
showDuration: true,
|
|
5526
|
+
showInstant: true,
|
|
5527
|
+
showPreviousYear: false,
|
|
5528
|
+
dimensionSelections: []
|
|
5529
|
+
};
|
|
5530
|
+
}
|
|
5531
|
+
if (!newPreferences[roleId].dimensionSelections) {
|
|
5532
|
+
newPreferences[roleId].dimensionSelections = [];
|
|
5533
|
+
}
|
|
5534
|
+
let dimensionSelection = newPreferences[roleId].dimensionSelections.find(
|
|
5535
|
+
(ds) => ds.dimensionId === dimensionId
|
|
5536
|
+
);
|
|
5537
|
+
if (!dimensionSelection) {
|
|
5538
|
+
const dimensionLabel = ((_b = (_a = dimension.labels) == null ? void 0 : _a.find((l2) => l2.role === "http://www.xbrl.org/2003/role/label")) == null ? void 0 : _b.label) || dimensionId;
|
|
5539
|
+
dimensionSelection = {
|
|
5540
|
+
dimensionId,
|
|
5541
|
+
dimensionLabel,
|
|
5542
|
+
selectedMemberIds: []
|
|
5543
|
+
};
|
|
5544
|
+
newPreferences[roleId].dimensionSelections.push(dimensionSelection);
|
|
5545
|
+
}
|
|
5546
|
+
dimensionSelection.selectedMemberIds = allMemberIds;
|
|
5547
|
+
this._tempPeriodPreferences = newPreferences;
|
|
5548
|
+
this.requestUpdate();
|
|
5549
|
+
}
|
|
5550
|
+
/**
|
|
5551
|
+
* Deselect all members for a dimension
|
|
5552
|
+
*/
|
|
5553
|
+
_deselectAllDimensionMembers(roleId, dimensionId) {
|
|
5554
|
+
var _a;
|
|
5555
|
+
const newPreferences = { ...this._tempPeriodPreferences };
|
|
5556
|
+
if (!((_a = newPreferences[roleId]) == null ? void 0 : _a.dimensionSelections)) {
|
|
5557
|
+
return;
|
|
5558
|
+
}
|
|
5559
|
+
const dimensionSelection = newPreferences[roleId].dimensionSelections.find(
|
|
5560
|
+
(ds) => ds.dimensionId === dimensionId
|
|
5561
|
+
);
|
|
5562
|
+
if (dimensionSelection) {
|
|
5563
|
+
dimensionSelection.selectedMemberIds = [];
|
|
5564
|
+
}
|
|
5565
|
+
this._tempPeriodPreferences = newPreferences;
|
|
5566
|
+
this.requestUpdate();
|
|
5567
|
+
}
|
|
5214
5568
|
_handleBackdropClick(event) {
|
|
5215
5569
|
if (event.target === this) {
|
|
5216
5570
|
this._handleCancel();
|
|
@@ -5362,7 +5716,7 @@ let JupiterFilterRolesDialog = class extends LitElement {
|
|
|
5362
5716
|
<!-- Available Roles Panel -->
|
|
5363
5717
|
<div class="picklist-panel">
|
|
5364
5718
|
<div class="picklist-header">
|
|
5365
|
-
|
|
5719
|
+
${I18n.t("filter.availableRoles")} (${this._getAvailableRoles().length})
|
|
5366
5720
|
</div>
|
|
5367
5721
|
<div class="picklist-search">
|
|
5368
5722
|
<div class="search-container">
|
|
@@ -5405,7 +5759,7 @@ let JupiterFilterRolesDialog = class extends LitElement {
|
|
|
5405
5759
|
})}
|
|
5406
5760
|
</div>
|
|
5407
5761
|
<div class="picklist-count">
|
|
5408
|
-
${this._getAvailableRoles().length}
|
|
5762
|
+
${this._getAvailableRoles().length} ${I18n.t("filter.roleCount")}
|
|
5409
5763
|
</div>
|
|
5410
5764
|
</div>
|
|
5411
5765
|
|
|
@@ -5415,7 +5769,7 @@ let JupiterFilterRolesDialog = class extends LitElement {
|
|
|
5415
5769
|
class="picklist-button"
|
|
5416
5770
|
@click="${this._moveToChosen}"
|
|
5417
5771
|
?disabled="${!this._selectedAvailableRole}"
|
|
5418
|
-
title="
|
|
5772
|
+
title="${I18n.t("filter.addSelectedRole")}"
|
|
5419
5773
|
>
|
|
5420
5774
|
›
|
|
5421
5775
|
</button>
|
|
@@ -5423,7 +5777,7 @@ let JupiterFilterRolesDialog = class extends LitElement {
|
|
|
5423
5777
|
class="picklist-button"
|
|
5424
5778
|
@click="${this._moveAllToChosen}"
|
|
5425
5779
|
?disabled="${this._getAvailableRoles().length === 0}"
|
|
5426
|
-
title="
|
|
5780
|
+
title="${I18n.t("filter.addAllRoles")}"
|
|
5427
5781
|
>
|
|
5428
5782
|
»
|
|
5429
5783
|
</button>
|
|
@@ -5431,7 +5785,7 @@ let JupiterFilterRolesDialog = class extends LitElement {
|
|
|
5431
5785
|
class="picklist-button"
|
|
5432
5786
|
@click="${this._moveToAvailable}"
|
|
5433
5787
|
?disabled="${!this._selectedChosenRole}"
|
|
5434
|
-
title="
|
|
5788
|
+
title="${I18n.t("filter.removeSelectedRole")}"
|
|
5435
5789
|
>
|
|
5436
5790
|
‹
|
|
5437
5791
|
</button>
|
|
@@ -5439,7 +5793,7 @@ let JupiterFilterRolesDialog = class extends LitElement {
|
|
|
5439
5793
|
class="picklist-button"
|
|
5440
5794
|
@click="${this._moveAllToAvailable}"
|
|
5441
5795
|
?disabled="${this._tempSelectedRoles.size === 0}"
|
|
5442
|
-
title="
|
|
5796
|
+
title="${I18n.t("filter.removeAllRoles")}"
|
|
5443
5797
|
>
|
|
5444
5798
|
«
|
|
5445
5799
|
</button>
|
|
@@ -5448,7 +5802,7 @@ let JupiterFilterRolesDialog = class extends LitElement {
|
|
|
5448
5802
|
<!-- Chosen Roles Panel -->
|
|
5449
5803
|
<div class="picklist-panel">
|
|
5450
5804
|
<div class="picklist-header">
|
|
5451
|
-
|
|
5805
|
+
${I18n.t("filter.chosenRoles")} (${this._tempSelectedRoles.size})
|
|
5452
5806
|
</div>
|
|
5453
5807
|
<div class="picklist-search">
|
|
5454
5808
|
<div class="search-container">
|
|
@@ -5497,7 +5851,7 @@ let JupiterFilterRolesDialog = class extends LitElement {
|
|
|
5497
5851
|
})}
|
|
5498
5852
|
</div>
|
|
5499
5853
|
<div class="picklist-count">
|
|
5500
|
-
${this._tempSelectedRoles.size}
|
|
5854
|
+
${this._tempSelectedRoles.size} ${I18n.t("filter.rolesSelected")}
|
|
5501
5855
|
</div>
|
|
5502
5856
|
</div>
|
|
5503
5857
|
</div>
|
|
@@ -5579,6 +5933,10 @@ let JupiterFilterRolesDialog = class extends LitElement {
|
|
|
5579
5933
|
const isSelected = this._tempSelectedRoles.has(role.id);
|
|
5580
5934
|
role.showPeriodControl === true;
|
|
5581
5935
|
const preferences = this._tempPeriodPreferences[role.id] || { showDuration: true, showInstant: true };
|
|
5936
|
+
console.log("🎨 [Render] Processing role:", role.title, "ID:", role.id);
|
|
5937
|
+
const dimensions = this._getDimensionsForRole(role.id);
|
|
5938
|
+
const hasDimensions = dimensions.length > 0;
|
|
5939
|
+
console.log("🎨 [Render] Role:", role.title, "- Has dimensions:", hasDimensions, "- Count:", dimensions.length);
|
|
5582
5940
|
return html`
|
|
5583
5941
|
<div class="role-item">
|
|
5584
5942
|
<input
|
|
@@ -5607,6 +5965,58 @@ let JupiterFilterRolesDialog = class extends LitElement {
|
|
|
5607
5965
|
</label>
|
|
5608
5966
|
</div>
|
|
5609
5967
|
</div>
|
|
5968
|
+
|
|
5969
|
+
${hasDimensions ? html`
|
|
5970
|
+
<div class="dimension-section">
|
|
5971
|
+
<div class="dimension-header">📊 ${I18n.t("filter.dimensionMemberSelection")}</div>
|
|
5972
|
+
${dimensions.map((dimension) => {
|
|
5973
|
+
var _a2, _b;
|
|
5974
|
+
const allMembers = this._getAllDimensionMembers(dimension.members);
|
|
5975
|
+
const dimensionLabel = ((_b = (_a2 = dimension.labels) == null ? void 0 : _a2.find((l2) => l2.role === "http://www.xbrl.org/2003/role/label")) == null ? void 0 : _b.label) || dimension.conceptName;
|
|
5976
|
+
const isSingleMember = this._isSingleMemberDimension(dimension);
|
|
5977
|
+
return html`
|
|
5978
|
+
<div class="dimension-group">
|
|
5979
|
+
<div class="dimension-label">${dimensionLabel}</div>
|
|
5980
|
+
<div class="dimension-members">
|
|
5981
|
+
${allMembers.map((member) => {
|
|
5982
|
+
var _a3, _b2;
|
|
5983
|
+
const memberLabel = ((_b2 = (_a3 = member.labels) == null ? void 0 : _a3.find((l2) => l2.role === "http://www.xbrl.org/2003/role/label")) == null ? void 0 : _b2.label) || member.conceptName;
|
|
5984
|
+
const isChecked = this._isDimensionMemberSelected(role.id, dimension.id, member.id);
|
|
5985
|
+
return html`
|
|
5986
|
+
<label class="member-checkbox-item">
|
|
5987
|
+
<input
|
|
5988
|
+
type="checkbox"
|
|
5989
|
+
class="member-checkbox"
|
|
5990
|
+
.checked="${isChecked}"
|
|
5991
|
+
?disabled="${isSingleMember}"
|
|
5992
|
+
@change="${(e2) => this._handleDimensionMemberChange(e2, role.id, dimension.id, member.id)}"
|
|
5993
|
+
/>
|
|
5994
|
+
<span class="member-checkbox-label">${memberLabel}</span>
|
|
5995
|
+
</label>
|
|
5996
|
+
`;
|
|
5997
|
+
})}
|
|
5998
|
+
</div>
|
|
5999
|
+
${!isSingleMember ? html`
|
|
6000
|
+
<div class="member-select-controls">
|
|
6001
|
+
<button
|
|
6002
|
+
class="member-select-btn"
|
|
6003
|
+
@click="${() => this._selectAllDimensionMembers(role.id, dimension.id)}"
|
|
6004
|
+
>
|
|
6005
|
+
${I18n.t("filter.selectAllMembers")}
|
|
6006
|
+
</button>
|
|
6007
|
+
<button
|
|
6008
|
+
class="member-select-btn"
|
|
6009
|
+
@click="${() => this._deselectAllDimensionMembers(role.id, dimension.id)}"
|
|
6010
|
+
>
|
|
6011
|
+
${I18n.t("filter.clearMembers")}
|
|
6012
|
+
</button>
|
|
6013
|
+
</div>
|
|
6014
|
+
` : ""}
|
|
6015
|
+
</div>
|
|
6016
|
+
`;
|
|
6017
|
+
})}
|
|
6018
|
+
</div>
|
|
6019
|
+
` : ""}
|
|
5610
6020
|
</div>
|
|
5611
6021
|
</div>
|
|
5612
6022
|
`;
|
|
@@ -5909,6 +6319,98 @@ JupiterFilterRolesDialog.styles = css`
|
|
|
5909
6319
|
user-select: none;
|
|
5910
6320
|
}
|
|
5911
6321
|
|
|
6322
|
+
.dimension-section {
|
|
6323
|
+
margin-top: 12px;
|
|
6324
|
+
padding: 8px;
|
|
6325
|
+
background: var(--jupiter-background, #fff);
|
|
6326
|
+
border-radius: 4px;
|
|
6327
|
+
border: 1px solid var(--jupiter-border-color, #e0e0e0);
|
|
6328
|
+
}
|
|
6329
|
+
|
|
6330
|
+
.dimension-header {
|
|
6331
|
+
font-size: 12px;
|
|
6332
|
+
font-weight: 600;
|
|
6333
|
+
color: var(--jupiter-primary-color, #1976d2);
|
|
6334
|
+
margin: 0 0 8px 0;
|
|
6335
|
+
padding-bottom: 4px;
|
|
6336
|
+
border-bottom: 1px solid var(--jupiter-border-color, #e0e0e0);
|
|
6337
|
+
}
|
|
6338
|
+
|
|
6339
|
+
.dimension-group {
|
|
6340
|
+
margin-bottom: 12px;
|
|
6341
|
+
}
|
|
6342
|
+
|
|
6343
|
+
.dimension-group:last-child {
|
|
6344
|
+
margin-bottom: 0;
|
|
6345
|
+
}
|
|
6346
|
+
|
|
6347
|
+
.dimension-label {
|
|
6348
|
+
font-size: 11px;
|
|
6349
|
+
font-weight: 600;
|
|
6350
|
+
color: var(--jupiter-text-secondary, #666);
|
|
6351
|
+
margin: 0 0 6px 0;
|
|
6352
|
+
text-transform: uppercase;
|
|
6353
|
+
letter-spacing: 0.5px;
|
|
6354
|
+
}
|
|
6355
|
+
|
|
6356
|
+
.dimension-members {
|
|
6357
|
+
display: flex;
|
|
6358
|
+
flex-direction: column;
|
|
6359
|
+
gap: 4px;
|
|
6360
|
+
padding-left: 8px;
|
|
6361
|
+
}
|
|
6362
|
+
|
|
6363
|
+
.member-checkbox-item {
|
|
6364
|
+
display: flex;
|
|
6365
|
+
align-items: center;
|
|
6366
|
+
gap: 6px;
|
|
6367
|
+
padding: 2px 0;
|
|
6368
|
+
}
|
|
6369
|
+
|
|
6370
|
+
.member-checkbox {
|
|
6371
|
+
cursor: pointer;
|
|
6372
|
+
flex-shrink: 0;
|
|
6373
|
+
}
|
|
6374
|
+
|
|
6375
|
+
.member-checkbox-label {
|
|
6376
|
+
font-size: 12px;
|
|
6377
|
+
color: var(--jupiter-text-primary, #333);
|
|
6378
|
+
cursor: pointer;
|
|
6379
|
+
user-select: none;
|
|
6380
|
+
line-height: 1.3;
|
|
6381
|
+
}
|
|
6382
|
+
|
|
6383
|
+
.member-select-controls {
|
|
6384
|
+
display: flex;
|
|
6385
|
+
gap: 8px;
|
|
6386
|
+
margin-top: 6px;
|
|
6387
|
+
padding-left: 8px;
|
|
6388
|
+
}
|
|
6389
|
+
|
|
6390
|
+
.member-select-btn {
|
|
6391
|
+
background: none;
|
|
6392
|
+
border: 1px solid var(--jupiter-border-color, #ddd);
|
|
6393
|
+
color: var(--jupiter-text-secondary, #666);
|
|
6394
|
+
padding: 2px 8px;
|
|
6395
|
+
border-radius: 3px;
|
|
6396
|
+
font-size: 10px;
|
|
6397
|
+
cursor: pointer;
|
|
6398
|
+
transition: all 0.2s ease;
|
|
6399
|
+
}
|
|
6400
|
+
|
|
6401
|
+
.member-select-btn:hover {
|
|
6402
|
+
background: var(--jupiter-hover-background, #f5f5f5);
|
|
6403
|
+
border-color: var(--jupiter-primary-color, #1976d2);
|
|
6404
|
+
color: var(--jupiter-primary-color, #1976d2);
|
|
6405
|
+
}
|
|
6406
|
+
|
|
6407
|
+
.no-dimensions-message {
|
|
6408
|
+
font-size: 11px;
|
|
6409
|
+
color: var(--jupiter-text-secondary, #999);
|
|
6410
|
+
font-style: italic;
|
|
6411
|
+
padding: 4px 8px;
|
|
6412
|
+
}
|
|
6413
|
+
|
|
5912
6414
|
.selected-count {
|
|
5913
6415
|
font-size: 13px;
|
|
5914
6416
|
color: var(--jupiter-text-secondary, #666);
|
|
@@ -6094,6 +6596,9 @@ __decorateClass$1([
|
|
|
6094
6596
|
__decorateClass$1([
|
|
6095
6597
|
n2({ type: String })
|
|
6096
6598
|
], JupiterFilterRolesDialog.prototype, "mode", 2);
|
|
6599
|
+
__decorateClass$1([
|
|
6600
|
+
n2({ type: Object })
|
|
6601
|
+
], JupiterFilterRolesDialog.prototype, "hypercubeData", 2);
|
|
6097
6602
|
__decorateClass$1([
|
|
6098
6603
|
r()
|
|
6099
6604
|
], JupiterFilterRolesDialog.prototype, "_tempSelectedRoles", 2);
|
|
@@ -6178,6 +6683,7 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
6178
6683
|
this._sidePanelCollapsed = false;
|
|
6179
6684
|
this._adminRoleConfigs = {};
|
|
6180
6685
|
this._skipDraftLoading = false;
|
|
6686
|
+
this._skipPeriodPreferencesRestore = false;
|
|
6181
6687
|
}
|
|
6182
6688
|
connectedCallback() {
|
|
6183
6689
|
super.connectedCallback();
|
|
@@ -6567,38 +7073,37 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
6567
7073
|
_handleRoleFilterApply(event) {
|
|
6568
7074
|
const { selectedRoleIds, periodPreferences } = event.detail;
|
|
6569
7075
|
this._selectedRoleIds = selectedRoleIds;
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
}
|
|
7076
|
+
this._periodPreferences = periodPreferences;
|
|
7077
|
+
console.log("🎯 Filter apply triggered - always reinitializing form");
|
|
7078
|
+
console.log("📊 New period preferences (including dimension selections):", this._periodPreferences);
|
|
7079
|
+
console.log("💾 Capturing current form data before reinitialization...");
|
|
7080
|
+
const currentFormData = this._generateSubmissionData();
|
|
7081
|
+
const currentMetadata = this._draftStorageService.createMetadataSnapshot(
|
|
7082
|
+
this.periodStartDate,
|
|
7083
|
+
this.periodEndDate,
|
|
7084
|
+
this.language,
|
|
7085
|
+
this._selectedRoleIds,
|
|
7086
|
+
// Enhanced structure with roleURI and order
|
|
7087
|
+
this._allSections,
|
|
7088
|
+
this._typedMemberData,
|
|
7089
|
+
this._periodPreferences,
|
|
7090
|
+
this._periodData,
|
|
7091
|
+
this._unitData
|
|
7092
|
+
);
|
|
7093
|
+
this._draftStorageService.saveDraft(currentFormData, currentMetadata);
|
|
7094
|
+
console.log("✅ Current form data saved to draft storage with NEW preferences");
|
|
7095
|
+
this._skipPeriodPreferencesRestore = true;
|
|
7096
|
+
this._skipDraftLoading = true;
|
|
7097
|
+
console.log("🔄 Reinitializing form with new filter settings...");
|
|
7098
|
+
this._initializeForm();
|
|
7099
|
+
this._skipDraftLoading = false;
|
|
7100
|
+
this._skipPeriodPreferencesRestore = false;
|
|
7101
|
+
console.log("📥 Restoring form data from draft after reinitialization...");
|
|
7102
|
+
this._loadDraftIfExists().then(() => {
|
|
7103
|
+
console.log("✅ Form data restored successfully after reinitialization");
|
|
7104
|
+
}).catch((error2) => {
|
|
7105
|
+
console.error("❌ Error restoring form data after reinitialization:", error2);
|
|
7106
|
+
});
|
|
6602
7107
|
this._showFilterDialog = false;
|
|
6603
7108
|
const roleCount = Array.isArray(this._selectedRoleIds) && this._selectedRoleIds.length > 0 ? typeof this._selectedRoleIds[0] === "string" ? this._selectedRoleIds.length : this._selectedRoleIds.length : 0;
|
|
6604
7109
|
console.log(`🎯 Applied role filter: ${roleCount}/${this._allSections.length} roles selected`);
|
|
@@ -6614,6 +7119,35 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
6614
7119
|
bubbles: true
|
|
6615
7120
|
}));
|
|
6616
7121
|
}
|
|
7122
|
+
/**
|
|
7123
|
+
* Check if dimension selections have changed for any role
|
|
7124
|
+
*/
|
|
7125
|
+
_haveDimensionSelectionsChanged(newPeriodPreferences) {
|
|
7126
|
+
var _a;
|
|
7127
|
+
const allRoleIds = /* @__PURE__ */ new Set([
|
|
7128
|
+
...Object.keys(this._periodPreferences || {}),
|
|
7129
|
+
...Object.keys(newPeriodPreferences || {})
|
|
7130
|
+
]);
|
|
7131
|
+
for (const roleId of allRoleIds) {
|
|
7132
|
+
const oldPrefs = (_a = this._periodPreferences) == null ? void 0 : _a[roleId];
|
|
7133
|
+
const newPrefs = newPeriodPreferences == null ? void 0 : newPeriodPreferences[roleId];
|
|
7134
|
+
const oldDimensions = (oldPrefs == null ? void 0 : oldPrefs.dimensionSelections) || [];
|
|
7135
|
+
const newDimensions = (newPrefs == null ? void 0 : newPrefs.dimensionSelections) || [];
|
|
7136
|
+
const oldDimensionsStr = JSON.stringify(
|
|
7137
|
+
oldDimensions.sort((a2, b2) => a2.dimensionId.localeCompare(b2.dimensionId))
|
|
7138
|
+
);
|
|
7139
|
+
const newDimensionsStr = JSON.stringify(
|
|
7140
|
+
newDimensions.sort((a2, b2) => a2.dimensionId.localeCompare(b2.dimensionId))
|
|
7141
|
+
);
|
|
7142
|
+
if (oldDimensionsStr !== newDimensionsStr) {
|
|
7143
|
+
console.log(`🔍 Dimension selection changed for role: ${roleId}`);
|
|
7144
|
+
console.log(" Old:", oldDimensions);
|
|
7145
|
+
console.log(" New:", newDimensions);
|
|
7146
|
+
return true;
|
|
7147
|
+
}
|
|
7148
|
+
}
|
|
7149
|
+
return false;
|
|
7150
|
+
}
|
|
6617
7151
|
_validateForm() {
|
|
6618
7152
|
var _a;
|
|
6619
7153
|
const errors = [];
|
|
@@ -7031,9 +7565,9 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
7031
7565
|
dimensionKeys.push(`${dimSelection.axisId}|${dimSelection.memberId}`);
|
|
7032
7566
|
}
|
|
7033
7567
|
}
|
|
7034
|
-
const periodPart = request.periodType === "instant" ? `(${request.instantDate})` : `(${this._formatPeriodDisplay(request.startDate, request.endDate)})`;
|
|
7035
7568
|
if (dimensionParts.length > 0) {
|
|
7036
|
-
title =
|
|
7569
|
+
title = dimensionParts.join(" | ");
|
|
7570
|
+
description = request.periodType === "instant" ? request.instantDate || "" : this._formatPeriodDisplay(request.startDate, request.endDate);
|
|
7037
7571
|
dimensionData = {
|
|
7038
7572
|
dimensionId: newColumnId,
|
|
7039
7573
|
memberValue: dimensionParts.join(" | "),
|
|
@@ -7055,8 +7589,8 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
7055
7589
|
const axisLabel = ((_d = dimension.labels.find((l2) => l2.role === "http://www.xbrl.org/2003/role/label")) == null ? void 0 : _d.label) || dimension.conceptName;
|
|
7056
7590
|
const firstMember = dimension.members[0];
|
|
7057
7591
|
const memberLabel = ((_e = firstMember.labels.find((l2) => l2.role === "http://www.xbrl.org/2003/role/label")) == null ? void 0 : _e.label) || firstMember.conceptName;
|
|
7058
|
-
|
|
7059
|
-
|
|
7592
|
+
title = memberLabel;
|
|
7593
|
+
description = request.periodType === "instant" ? request.instantDate || "" : this._formatPeriodDisplay(request.startDate, request.endDate);
|
|
7060
7594
|
dimensionData = {
|
|
7061
7595
|
dimensionId: newColumnId,
|
|
7062
7596
|
axisId: dimension.id,
|
|
@@ -7442,27 +7976,31 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
7442
7976
|
console.log("🔄 Restored custom field-level unit data:", Object.keys(this._unitData).length, "concepts");
|
|
7443
7977
|
}
|
|
7444
7978
|
if (metadata.periodPreferences) {
|
|
7445
|
-
this.
|
|
7446
|
-
|
|
7447
|
-
|
|
7448
|
-
|
|
7449
|
-
|
|
7450
|
-
|
|
7451
|
-
|
|
7452
|
-
this.
|
|
7453
|
-
|
|
7454
|
-
|
|
7455
|
-
|
|
7456
|
-
|
|
7457
|
-
|
|
7458
|
-
|
|
7459
|
-
|
|
7460
|
-
|
|
7461
|
-
|
|
7462
|
-
|
|
7463
|
-
|
|
7464
|
-
|
|
7465
|
-
|
|
7979
|
+
if (this._skipPeriodPreferencesRestore) {
|
|
7980
|
+
console.log("⏭️ Skipping period preferences restoration - using new filter selections");
|
|
7981
|
+
} else {
|
|
7982
|
+
this._periodPreferences = metadata.periodPreferences;
|
|
7983
|
+
console.log("🔄 Restored period preferences (including previous year settings):", this._periodPreferences);
|
|
7984
|
+
if (this.xbrlInput) {
|
|
7985
|
+
console.log("🔄 Rebuilding schema with restored period preferences...");
|
|
7986
|
+
this._currentSchema = XBRLFormBuilder.buildFormSchema(
|
|
7987
|
+
this.xbrlInput,
|
|
7988
|
+
this.periodStartDate,
|
|
7989
|
+
this.periodEndDate,
|
|
7990
|
+
this.language,
|
|
7991
|
+
this._periodPreferences
|
|
7992
|
+
);
|
|
7993
|
+
this._allSections = [...this._currentSchema.sections];
|
|
7994
|
+
if (this.financialStatementsTypeAxis && this.financialStatementsTypeAxis.length > 0) {
|
|
7995
|
+
this._allSections = this._filterRolesByFinancialStatementsType(this._allSections);
|
|
7996
|
+
}
|
|
7997
|
+
console.log("✅ Schema rebuilt with restored period preferences");
|
|
7998
|
+
console.log("🔄 Applying custom period data to schema fields...");
|
|
7999
|
+
this._applyCustomPeriodDataToFields();
|
|
8000
|
+
if (metadata.customColumns && metadata.customColumns.length > 0) {
|
|
8001
|
+
this._mergeAdditionalCustomColumns(metadata.customColumns);
|
|
8002
|
+
console.log(`🔄 Merged ${metadata.customColumns.length} additional custom columns`);
|
|
8003
|
+
}
|
|
7466
8004
|
}
|
|
7467
8005
|
}
|
|
7468
8006
|
} else {
|
|
@@ -7664,6 +8202,8 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
7664
8202
|
const column2 = {
|
|
7665
8203
|
id: col.columnId,
|
|
7666
8204
|
title: col.label,
|
|
8205
|
+
description: col.description,
|
|
8206
|
+
// Restore description (period display)
|
|
7667
8207
|
type: col.dimensionData ? "dimension" : "base",
|
|
7668
8208
|
periodStartDate: col.startDate || col.date,
|
|
7669
8209
|
periodEndDate: col.endDate || col.date,
|
|
@@ -7673,7 +8213,7 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
7673
8213
|
periodType: col.periodType
|
|
7674
8214
|
// CRITICAL: Preserve explicit period type
|
|
7675
8215
|
};
|
|
7676
|
-
console.log(`📅 [Draft Restore] Restoring column ${col.columnId}: startDate=${column2.periodStartDate}, endDate=${column2.periodEndDate}, periodType=${column2.periodType}`);
|
|
8216
|
+
console.log(`📅 [Draft Restore] Restoring column ${col.columnId}: title=${column2.title}, description=${column2.description}, startDate=${column2.periodStartDate}, endDate=${column2.periodEndDate}, periodType=${column2.periodType}`);
|
|
7677
8217
|
return column2;
|
|
7678
8218
|
});
|
|
7679
8219
|
if (((_a = this.xbrlInput) == null ? void 0 : _a.datatypes) && !section2.datatypes) {
|
|
@@ -7735,6 +8275,8 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
7735
8275
|
const newColumn = {
|
|
7736
8276
|
id: col.columnId,
|
|
7737
8277
|
title: col.label,
|
|
8278
|
+
description: col.description,
|
|
8279
|
+
// Restore description (period display)
|
|
7738
8280
|
type: col.dimensionData ? "dimension" : "base",
|
|
7739
8281
|
periodStartDate: col.startDate || col.date,
|
|
7740
8282
|
periodEndDate: col.endDate || col.date,
|
|
@@ -7744,7 +8286,7 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
7744
8286
|
periodType: col.periodType
|
|
7745
8287
|
// CRITICAL: Preserve explicit period type
|
|
7746
8288
|
};
|
|
7747
|
-
console.log(`📅 [New Column Created] Column ${newColumn.id}: periodStartDate=${newColumn.periodStartDate}, periodEndDate=${newColumn.periodEndDate}, periodType=${newColumn.periodType}`);
|
|
8289
|
+
console.log(`📅 [New Column Created] Column ${newColumn.id}: title=${newColumn.title}, description=${newColumn.description}, periodStartDate=${newColumn.periodStartDate}, periodEndDate=${newColumn.periodEndDate}, periodType=${newColumn.periodType}`);
|
|
7748
8290
|
section2.columns.push(newColumn);
|
|
7749
8291
|
console.log(` └─ Added custom column ${col.columnId} to section ${section2.id}`);
|
|
7750
8292
|
}
|
|
@@ -8587,6 +9129,7 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
8587
9129
|
return this._getFormState();
|
|
8588
9130
|
}
|
|
8589
9131
|
render() {
|
|
9132
|
+
var _a;
|
|
8590
9133
|
const errorCount = this._errors.filter((e2) => e2.severity === "error").length;
|
|
8591
9134
|
const config = this.config || {};
|
|
8592
9135
|
const showValidationSummary = config.showValidationSummary !== false && errorCount > 0 && this._submitted;
|
|
@@ -8654,6 +9197,7 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
8654
9197
|
.availableRoles="${this._allSections}"
|
|
8655
9198
|
.selectedRoleIds="${this._getRoleIdsArray()}"
|
|
8656
9199
|
.periodPreferences="${this._periodPreferences}"
|
|
9200
|
+
.hypercubeData="${(_a = this.xbrlInput) == null ? void 0 : _a.hypercubes}"
|
|
8657
9201
|
.mode="${this.mode}"
|
|
8658
9202
|
@dialog-cancel="${this._handleFilterDialogCancel}"
|
|
8659
9203
|
@roles-filter-apply="${this._handleRoleFilterApply}"
|