jupiter-dynamic-forms 1.20.8 → 1.20.9

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
@@ -1850,6 +1850,14 @@ const formulaValidation$1 = {
1850
1850
  severityError: "Error",
1851
1851
  close: "Close"
1852
1852
  };
1853
+ const scrollToConcept$1 = {
1854
+ revealRole: {
1855
+ title: "Role not in your filtered list",
1856
+ message: 'This field is in the role "{{role}}", which is not in your filtered list of roles. Do you want to make this role visible?',
1857
+ confirm: "Yes, show role",
1858
+ cancel: "No"
1859
+ }
1860
+ };
1853
1861
  const enTranslations = {
1854
1862
  conceptInfo: conceptInfo$1,
1855
1863
  form: form$1,
@@ -1862,7 +1870,8 @@ const enTranslations = {
1862
1870
  xbrlValidation: xbrlValidation$1,
1863
1871
  error: error$1,
1864
1872
  calculationWarning: calculationWarning$1,
1865
- formulaValidation: formulaValidation$1
1873
+ formulaValidation: formulaValidation$1,
1874
+ scrollToConcept: scrollToConcept$1
1866
1875
  };
1867
1876
  const conceptInfo = {
1868
1877
  title: "Conceptinformatie",
@@ -2057,6 +2066,14 @@ const formulaValidation = {
2057
2066
  severityError: "Fout",
2058
2067
  close: "Sluiten"
2059
2068
  };
2069
+ const scrollToConcept = {
2070
+ revealRole: {
2071
+ title: "Rol niet in uw gefilterde lijst",
2072
+ message: 'Dit veld staat in de rol "{{role}}", die niet in uw gefilterde lijst met rollen staat. Wilt u deze rol zichtbaar maken?',
2073
+ confirm: "Ja, rol tonen",
2074
+ cancel: "Nee"
2075
+ }
2076
+ };
2060
2077
  const nlTranslations = {
2061
2078
  conceptInfo,
2062
2079
  form,
@@ -2069,7 +2086,8 @@ const nlTranslations = {
2069
2086
  xbrlValidation,
2070
2087
  error,
2071
2088
  calculationWarning,
2072
- formulaValidation
2089
+ formulaValidation,
2090
+ scrollToConcept
2073
2091
  };
2074
2092
  const translations = {
2075
2093
  en: enTranslations,
@@ -2360,7 +2378,7 @@ class FormulaExpressionError extends Error {
2360
2378
  }
2361
2379
  }
2362
2380
  const TOKEN_PATTERN = /\s*(?:(\$[A-Za-z_][\w-]*)|(-?\d+(?:\.\d+)?)|([A-Za-z][\w:-]*)|('[^']*')|(\()|(\))|(\+)|(-)|(=))/y;
2363
- function tokenize(test) {
2381
+ function tokenize$1(test) {
2364
2382
  const tokens = [];
2365
2383
  TOKEN_PATTERN.lastIndex = 0;
2366
2384
  let index = 0;
@@ -2638,7 +2656,7 @@ function evalBool(node, bindings, test, fallbackUsage) {
2638
2656
  }
2639
2657
  }
2640
2658
  function evaluateFormulaTest(test, bindings, fallbackUsage = /* @__PURE__ */ new Map()) {
2641
- const tokens = tokenize(test);
2659
+ const tokens = tokenize$1(test);
2642
2660
  const ast = new Parser(tokens, test).parseBoolExpr();
2643
2661
  return evalBool(ast, bindings, test, fallbackUsage);
2644
2662
  }
@@ -3887,6 +3905,70 @@ class FactMatcher {
3887
3905
  console.log(" Match Result:", match ? match.value : "No match");
3888
3906
  }
3889
3907
  }
3908
+ const ROLE_MATCH_TIER = {
3909
+ /** Full `id`/`roleURI` equals the query. */
3910
+ EXACT_ID: 1,
3911
+ /** Local name (segment after the last `:`, `/` or `#`) of `id`/`roleURI` equals the query's. */
3912
+ EXACT_LOCAL_NAME: 2,
3913
+ /** `title`/`description`/`metadata.originalRole` equals the query. */
3914
+ EXACT_LABEL: 3,
3915
+ /** Contiguous substring match, in either direction, against a local name or label. */
3916
+ SUBSTRING: 4,
3917
+ /** Every word of the query appears in a local name or label, in any order. */
3918
+ TOKEN_SUBSET: 5
3919
+ };
3920
+ const normalize = (value) => typeof value === "string" ? value.trim().toLowerCase() : "";
3921
+ const tokenize = (value) => value.split(/[^\p{L}\p{N}]+/u).filter(Boolean);
3922
+ function roleLocalName(value) {
3923
+ const trimmed = value.replace(/[/#:]+$/, "");
3924
+ const cut = Math.max(trimmed.lastIndexOf(":"), trimmed.lastIndexOf("/"), trimmed.lastIndexOf("#"));
3925
+ return cut >= 0 ? trimmed.slice(cut + 1) : trimmed;
3926
+ }
3927
+ function scoreSection(query, section2) {
3928
+ var _a, _b;
3929
+ const identifiers = [section2.id, (_a = section2.metadata) == null ? void 0 : _a.roleURI].map(normalize).filter(Boolean);
3930
+ const labels = [section2.title, section2.description, (_b = section2.metadata) == null ? void 0 : _b.originalRole].map(normalize).filter(Boolean);
3931
+ const localNames = identifiers.map(roleLocalName);
3932
+ const queryLocal = /\s/.test(query) ? null : roleLocalName(query);
3933
+ if (identifiers.includes(query))
3934
+ return { tier: ROLE_MATCH_TIER.EXACT_ID, looseness: 0 };
3935
+ if (queryLocal && localNames.includes(queryLocal))
3936
+ return { tier: ROLE_MATCH_TIER.EXACT_LOCAL_NAME, looseness: 0 };
3937
+ if (labels.includes(query))
3938
+ return { tier: ROLE_MATCH_TIER.EXACT_LABEL, looseness: 0 };
3939
+ const needle = queryLocal ?? query;
3940
+ const fields = [...localNames, ...labels];
3941
+ let best = null;
3942
+ for (const field2 of fields) {
3943
+ if (field2.includes(needle) || needle.includes(field2)) {
3944
+ const looseness = Math.abs(field2.length - needle.length);
3945
+ if (best === null || looseness < best)
3946
+ best = looseness;
3947
+ }
3948
+ }
3949
+ if (best !== null)
3950
+ return { tier: ROLE_MATCH_TIER.SUBSTRING, looseness: best };
3951
+ const queryTokens = new Set(tokenize(needle));
3952
+ if (!queryTokens.size)
3953
+ return null;
3954
+ for (const field2 of fields) {
3955
+ const fieldTokens = new Set(tokenize(field2));
3956
+ if ([...queryTokens].every((t2) => fieldTokens.has(t2))) {
3957
+ const looseness = fieldTokens.size - queryTokens.size;
3958
+ if (best === null || looseness < best)
3959
+ best = looseness;
3960
+ }
3961
+ }
3962
+ if (best !== null)
3963
+ return { tier: ROLE_MATCH_TIER.TOKEN_SUBSET, looseness: best };
3964
+ return null;
3965
+ }
3966
+ function rankMatchingSections(roleQuery, sections) {
3967
+ const query = normalize(roleQuery);
3968
+ if (!query)
3969
+ return [];
3970
+ return sections.map((section2, index) => ({ section: section2, index, score: scoreSection(query, section2) })).filter((entry) => entry.score !== null).sort((a2, b2) => a2.score.tier - b2.score.tier || a2.score.looseness - b2.score.looseness || a2.index - b2.index).map(({ section: section2, score }) => ({ section: section2, tier: score.tier }));
3971
+ }
3890
3972
  const TYPE_INPUT_MAP = {
3891
3973
  // ==========================================
3892
3974
  // Dutch XBRL Types (nl-types namespace)
@@ -4536,15 +4618,15 @@ class XBRLValidator {
4536
4618
  return rules;
4537
4619
  }
4538
4620
  }
4539
- var __defProp$7 = Object.defineProperty;
4540
- var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
4541
- var __decorateClass$7 = (decorators, target, key, kind) => {
4542
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
4621
+ var __defProp$8 = Object.defineProperty;
4622
+ var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
4623
+ var __decorateClass$8 = (decorators, target, key, kind) => {
4624
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
4543
4625
  for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
4544
4626
  if (decorator = decorators[i2])
4545
4627
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
4546
4628
  if (kind && result)
4547
- __defProp$7(target, key, result);
4629
+ __defProp$8(target, key, result);
4548
4630
  return result;
4549
4631
  };
4550
4632
  let JupiterFormField = class extends LitElement {
@@ -6111,99 +6193,99 @@ JupiterFormField.styles = css`
6111
6193
  animation: concept-highlight-pulse 10s ease-out forwards;
6112
6194
  }
6113
6195
  `;
6114
- __decorateClass$7([
6196
+ __decorateClass$8([
6115
6197
  n2({ type: Object })
6116
6198
  ], JupiterFormField.prototype, "field", 2);
6117
- __decorateClass$7([
6199
+ __decorateClass$8([
6118
6200
  n2({ type: String })
6119
6201
  ], JupiterFormField.prototype, "conceptId", 2);
6120
- __decorateClass$7([
6202
+ __decorateClass$8([
6121
6203
  n2({ type: String })
6122
6204
  ], JupiterFormField.prototype, "conceptType", 2);
6123
- __decorateClass$7([
6205
+ __decorateClass$8([
6124
6206
  n2({ type: Array })
6125
6207
  ], JupiterFormField.prototype, "datatypes", 2);
6126
- __decorateClass$7([
6208
+ __decorateClass$8([
6127
6209
  n2({ type: Array })
6128
6210
  ], JupiterFormField.prototype, "defaultUnits", 2);
6129
- __decorateClass$7([
6211
+ __decorateClass$8([
6130
6212
  n2({ type: String })
6131
6213
  ], JupiterFormField.prototype, "columnId", 2);
6132
- __decorateClass$7([
6214
+ __decorateClass$8([
6133
6215
  n2()
6134
6216
  ], JupiterFormField.prototype, "value", 2);
6135
- __decorateClass$7([
6217
+ __decorateClass$8([
6136
6218
  n2({ type: Boolean })
6137
6219
  ], JupiterFormField.prototype, "disabled", 2);
6138
- __decorateClass$7([
6220
+ __decorateClass$8([
6139
6221
  n2({ type: String })
6140
6222
  ], JupiterFormField.prototype, "locale", 2);
6141
- __decorateClass$7([
6223
+ __decorateClass$8([
6142
6224
  n2({ type: Boolean })
6143
6225
  ], JupiterFormField.prototype, "hideLabel", 2);
6144
- __decorateClass$7([
6226
+ __decorateClass$8([
6145
6227
  n2({ type: String })
6146
6228
  ], JupiterFormField.prototype, "mode", 2);
6147
- __decorateClass$7([
6229
+ __decorateClass$8([
6148
6230
  n2({ type: Object })
6149
6231
  ], JupiterFormField.prototype, "masterData", 2);
6150
- __decorateClass$7([
6232
+ __decorateClass$8([
6151
6233
  n2({ type: Array })
6152
6234
  ], JupiterFormField.prototype, "facts", 2);
6153
- __decorateClass$7([
6235
+ __decorateClass$8([
6154
6236
  n2({ type: Object })
6155
6237
  ], JupiterFormField.prototype, "column", 2);
6156
- __decorateClass$7([
6238
+ __decorateClass$8([
6157
6239
  n2({ type: String })
6158
6240
  ], JupiterFormField.prototype, "periodStartDate", 2);
6159
- __decorateClass$7([
6241
+ __decorateClass$8([
6160
6242
  n2({ type: String })
6161
6243
  ], JupiterFormField.prototype, "periodEndDate", 2);
6162
- __decorateClass$7([
6244
+ __decorateClass$8([
6163
6245
  n2({ type: String })
6164
6246
  ], JupiterFormField.prototype, "periodInstantDate", 2);
6165
- __decorateClass$7([
6247
+ __decorateClass$8([
6166
6248
  n2({ type: String })
6167
6249
  ], JupiterFormField.prototype, "unit", 2);
6168
- __decorateClass$7([
6250
+ __decorateClass$8([
6169
6251
  n2({ type: String })
6170
6252
  ], JupiterFormField.prototype, "decimals", 2);
6171
- __decorateClass$7([
6253
+ __decorateClass$8([
6172
6254
  n2({ type: String })
6173
6255
  ], JupiterFormField.prototype, "globalDecimals", 2);
6174
- __decorateClass$7([
6256
+ __decorateClass$8([
6175
6257
  n2({ type: Object })
6176
6258
  ], JupiterFormField.prototype, "typedMemberValues", 2);
6177
- __decorateClass$7([
6259
+ __decorateClass$8([
6178
6260
  r()
6179
6261
  ], JupiterFormField.prototype, "_errors", 2);
6180
- __decorateClass$7([
6262
+ __decorateClass$8([
6181
6263
  r()
6182
6264
  ], JupiterFormField.prototype, "_xbrlErrors", 2);
6183
- __decorateClass$7([
6265
+ __decorateClass$8([
6184
6266
  r()
6185
6267
  ], JupiterFormField.prototype, "_touched", 2);
6186
- __decorateClass$7([
6268
+ __decorateClass$8([
6187
6269
  r()
6188
6270
  ], JupiterFormField.prototype, "_showPeriodPopup", 2);
6189
- __decorateClass$7([
6271
+ __decorateClass$8([
6190
6272
  r()
6191
6273
  ], JupiterFormField.prototype, "_availableUnits", 2);
6192
- __decorateClass$7([
6274
+ __decorateClass$8([
6193
6275
  r()
6194
6276
  ], JupiterFormField.prototype, "_numericDraftValue", 2);
6195
- JupiterFormField = __decorateClass$7([
6277
+ JupiterFormField = __decorateClass$8([
6196
6278
  t$1("jupiter-form-field")
6197
6279
  ], JupiterFormField);
6198
- var __defProp$6 = Object.defineProperty;
6199
- var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
6200
- var __decorateClass$6 = (decorators, target, key, kind) => {
6201
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
6280
+ var __defProp$7 = Object.defineProperty;
6281
+ var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
6282
+ var __decorateClass$7 = (decorators, target, key, kind) => {
6283
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
6202
6284
  for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
6203
6285
  if (decorator = decorators[i2])
6204
6286
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6205
6287
  if (kind && result)
6206
- __defProp$6(target, key, result);
6288
+ __defProp$7(target, key, result);
6207
6289
  return result;
6208
6290
  };
6209
6291
  let JupiterConceptTree = class extends LitElement {
@@ -6860,90 +6942,90 @@ JupiterConceptTree.styles = css`
6860
6942
  }
6861
6943
 
6862
6944
  `;
6863
- __decorateClass$6([
6945
+ __decorateClass$7([
6864
6946
  n2({ type: Object })
6865
6947
  ], JupiterConceptTree.prototype, "concept", 2);
6866
- __decorateClass$6([
6948
+ __decorateClass$7([
6867
6949
  n2({ type: Array })
6868
6950
  ], JupiterConceptTree.prototype, "columns", 2);
6869
- __decorateClass$6([
6951
+ __decorateClass$7([
6870
6952
  n2({ type: Object })
6871
6953
  ], JupiterConceptTree.prototype, "formData", 2);
6872
- __decorateClass$6([
6954
+ __decorateClass$7([
6873
6955
  n2({ type: Object })
6874
6956
  ], JupiterConceptTree.prototype, "periodData", 2);
6875
- __decorateClass$6([
6957
+ __decorateClass$7([
6876
6958
  n2({ type: Object })
6877
6959
  ], JupiterConceptTree.prototype, "unitData", 2);
6878
- __decorateClass$6([
6960
+ __decorateClass$7([
6879
6961
  n2({ type: Object })
6880
6962
  ], JupiterConceptTree.prototype, "decimalsData", 2);
6881
- __decorateClass$6([
6963
+ __decorateClass$7([
6882
6964
  n2({ type: String })
6883
6965
  ], JupiterConceptTree.prototype, "globalDecimals", 2);
6884
- __decorateClass$6([
6966
+ __decorateClass$7([
6885
6967
  n2({ type: Array })
6886
6968
  ], JupiterConceptTree.prototype, "defaultUnits", 2);
6887
- __decorateClass$6([
6969
+ __decorateClass$7([
6888
6970
  n2({ type: Boolean })
6889
6971
  ], JupiterConceptTree.prototype, "disabled", 2);
6890
- __decorateClass$6([
6972
+ __decorateClass$7([
6891
6973
  n2({ type: String })
6892
6974
  ], JupiterConceptTree.prototype, "locale", 2);
6893
- __decorateClass$6([
6975
+ __decorateClass$7([
6894
6976
  n2({ type: Set })
6895
6977
  ], JupiterConceptTree.prototype, "expandedConcepts", 2);
6896
- __decorateClass$6([
6978
+ __decorateClass$7([
6897
6979
  n2({ type: Array })
6898
6980
  ], JupiterConceptTree.prototype, "datatypes", 2);
6899
- __decorateClass$6([
6981
+ __decorateClass$7([
6900
6982
  n2({ type: String })
6901
6983
  ], JupiterConceptTree.prototype, "mode", 2);
6902
- __decorateClass$6([
6984
+ __decorateClass$7([
6903
6985
  n2({ type: Object })
6904
6986
  ], JupiterConceptTree.prototype, "masterData", 2);
6905
- __decorateClass$6([
6987
+ __decorateClass$7([
6906
6988
  n2({ type: Array })
6907
6989
  ], JupiterConceptTree.prototype, "facts", 2);
6908
- __decorateClass$6([
6990
+ __decorateClass$7([
6909
6991
  n2({ type: Object })
6910
6992
  ], JupiterConceptTree.prototype, "typedMemberData", 2);
6911
- __decorateClass$6([
6993
+ __decorateClass$7([
6912
6994
  n2({ type: Boolean })
6913
6995
  ], JupiterConceptTree.prototype, "showAddButton", 2);
6914
- __decorateClass$6([
6996
+ __decorateClass$7([
6915
6997
  n2({ type: Boolean })
6916
6998
  ], JupiterConceptTree.prototype, "showRemoveButton", 2);
6917
- __decorateClass$6([
6999
+ __decorateClass$7([
6918
7000
  n2({ type: String })
6919
7001
  ], JupiterConceptTree.prototype, "highlightType", 2);
6920
- __decorateClass$6([
7002
+ __decorateClass$7([
6921
7003
  n2({ type: String })
6922
7004
  ], JupiterConceptTree.prototype, "highlightColumnId", 2);
6923
- __decorateClass$6([
7005
+ __decorateClass$7([
6924
7006
  n2({ type: Object })
6925
7007
  ], JupiterConceptTree.prototype, "calculationMismatches", 2);
6926
- __decorateClass$6([
7008
+ __decorateClass$7([
6927
7009
  n2({ type: String })
6928
7010
  ], JupiterConceptTree.prototype, "language", 2);
6929
- __decorateClass$6([
7011
+ __decorateClass$7([
6930
7012
  n2({ type: Boolean })
6931
7013
  ], JupiterConceptTree.prototype, "rowFocused", 2);
6932
- __decorateClass$6([
7014
+ __decorateClass$7([
6933
7015
  r()
6934
7016
  ], JupiterConceptTree.prototype, "_expanded", 2);
6935
- JupiterConceptTree = __decorateClass$6([
7017
+ JupiterConceptTree = __decorateClass$7([
6936
7018
  t$1("jupiter-concept-tree")
6937
7019
  ], JupiterConceptTree);
6938
- var __defProp$5 = Object.defineProperty;
6939
- var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
6940
- var __decorateClass$5 = (decorators, target, key, kind) => {
6941
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
7020
+ var __defProp$6 = Object.defineProperty;
7021
+ var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
7022
+ var __decorateClass$6 = (decorators, target, key, kind) => {
7023
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
6942
7024
  for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
6943
7025
  if (decorator = decorators[i2])
6944
7026
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6945
7027
  if (kind && result)
6946
- __defProp$5(target, key, result);
7028
+ __defProp$6(target, key, result);
6947
7029
  return result;
6948
7030
  };
6949
7031
  let JupiterAddColumnDialog = class extends LitElement {
@@ -7680,54 +7762,54 @@ JupiterAddColumnDialog.styles = css`
7680
7762
  line-height: 1.4;
7681
7763
  }
7682
7764
  `;
7683
- __decorateClass$5([
7765
+ __decorateClass$6([
7684
7766
  n2({ type: String })
7685
7767
  ], JupiterAddColumnDialog.prototype, "periodType", 2);
7686
- __decorateClass$5([
7768
+ __decorateClass$6([
7687
7769
  n2({ type: Boolean })
7688
7770
  ], JupiterAddColumnDialog.prototype, "open", 2);
7689
- __decorateClass$5([
7771
+ __decorateClass$6([
7690
7772
  n2({ type: Array })
7691
7773
  ], JupiterAddColumnDialog.prototype, "availableDimensions", 2);
7692
- __decorateClass$5([
7774
+ __decorateClass$6([
7693
7775
  n2({ type: String })
7694
7776
  ], JupiterAddColumnDialog.prototype, "periodStartDate", 2);
7695
- __decorateClass$5([
7777
+ __decorateClass$6([
7696
7778
  n2({ type: String })
7697
7779
  ], JupiterAddColumnDialog.prototype, "periodEndDate", 2);
7698
- __decorateClass$5([
7780
+ __decorateClass$6([
7699
7781
  n2({ type: Array })
7700
7782
  ], JupiterAddColumnDialog.prototype, "datatypes", 2);
7701
- __decorateClass$5([
7783
+ __decorateClass$6([
7702
7784
  r()
7703
7785
  ], JupiterAddColumnDialog.prototype, "_startDate", 2);
7704
- __decorateClass$5([
7786
+ __decorateClass$6([
7705
7787
  r()
7706
7788
  ], JupiterAddColumnDialog.prototype, "_endDate", 2);
7707
- __decorateClass$5([
7789
+ __decorateClass$6([
7708
7790
  r()
7709
7791
  ], JupiterAddColumnDialog.prototype, "_instantDate", 2);
7710
- __decorateClass$5([
7792
+ __decorateClass$6([
7711
7793
  r()
7712
7794
  ], JupiterAddColumnDialog.prototype, "_selectedType", 2);
7713
- __decorateClass$5([
7795
+ __decorateClass$6([
7714
7796
  r()
7715
7797
  ], JupiterAddColumnDialog.prototype, "_selectedDimensions", 2);
7716
- __decorateClass$5([
7798
+ __decorateClass$6([
7717
7799
  r()
7718
7800
  ], JupiterAddColumnDialog.prototype, "_typedValueErrors", 2);
7719
- JupiterAddColumnDialog = __decorateClass$5([
7801
+ JupiterAddColumnDialog = __decorateClass$6([
7720
7802
  t$1("jupiter-add-column-dialog")
7721
7803
  ], JupiterAddColumnDialog);
7722
- var __defProp$4 = Object.defineProperty;
7723
- var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
7724
- var __decorateClass$4 = (decorators, target, key, kind) => {
7725
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
7804
+ var __defProp$5 = Object.defineProperty;
7805
+ var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
7806
+ var __decorateClass$5 = (decorators, target, key, kind) => {
7807
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
7726
7808
  for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
7727
7809
  if (decorator = decorators[i2])
7728
7810
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7729
7811
  if (kind && result)
7730
- __defProp$4(target, key, result);
7812
+ __defProp$5(target, key, result);
7731
7813
  return result;
7732
7814
  };
7733
7815
  let JupiterFormSection = class extends LitElement {
@@ -7865,6 +7947,47 @@ let JupiterFormSection = class extends LitElement {
7865
7947
  bubbles: true
7866
7948
  }));
7867
7949
  }
7950
+ /**
7951
+ * Makes `conceptId`'s row render: opens this section (as clicking its header would) and expands
7952
+ * every ancestor of the row in the tree. A row only renders while all its ancestors are expanded,
7953
+ * and only the first section expands its tree on its own, so dynamic-form's scrollToConcept calls
7954
+ * this before looking the row up. Resolves false if the concept isn't in this section.
7955
+ */
7956
+ async revealConcept(conceptId) {
7957
+ var _a;
7958
+ const ancestors = this._findAncestorIds(((_a = this.section) == null ? void 0 : _a.concepts) ?? [], conceptId);
7959
+ if (!ancestors)
7960
+ return false;
7961
+ if (!this._expanded) {
7962
+ this._expanded = true;
7963
+ this._expandAllTrees();
7964
+ this.dispatchEvent(new CustomEvent("section-expand", {
7965
+ detail: { sectionId: this.section.id, expanded: true },
7966
+ bubbles: true
7967
+ }));
7968
+ }
7969
+ const next = /* @__PURE__ */ new Set([...this._expandedConcepts, ...ancestors]);
7970
+ if (next.size !== this._expandedConcepts.size) {
7971
+ this._expandedConcepts = next;
7972
+ const allConceptIds = this._getAllConceptIds(this.section.concepts || []);
7973
+ this._allTreeExpanded = allConceptIds.length > 0 && allConceptIds.every((id) => next.has(id));
7974
+ }
7975
+ await this.updateComplete;
7976
+ return true;
7977
+ }
7978
+ _findAncestorIds(concepts, conceptId, trail = []) {
7979
+ var _a;
7980
+ for (const concept of concepts) {
7981
+ if (concept.id === conceptId)
7982
+ return trail;
7983
+ if ((_a = concept.children) == null ? void 0 : _a.length) {
7984
+ const found = this._findAncestorIds(concept.children, conceptId, [...trail, concept.id]);
7985
+ if (found)
7986
+ return found;
7987
+ }
7988
+ }
7989
+ return null;
7990
+ }
7868
7991
  _handleRemoveColumn(columnId) {
7869
7992
  this._openMenuColumnId = null;
7870
7993
  this.dispatchEvent(new CustomEvent("column-remove", {
@@ -9071,129 +9194,129 @@ JupiterFormSection.styles = css`
9071
9194
  font-style: italic;
9072
9195
  }
9073
9196
  `;
9074
- __decorateClass$4([
9197
+ __decorateClass$5([
9075
9198
  n2({ type: Object })
9076
9199
  ], JupiterFormSection.prototype, "section", 2);
9077
- __decorateClass$4([
9200
+ __decorateClass$5([
9078
9201
  n2({ type: Array })
9079
9202
  ], JupiterFormSection.prototype, "columns", 2);
9080
- __decorateClass$4([
9203
+ __decorateClass$5([
9081
9204
  n2({ type: Array })
9082
9205
  ], JupiterFormSection.prototype, "datatypes", 2);
9083
- __decorateClass$4([
9206
+ __decorateClass$5([
9084
9207
  n2({ type: Object })
9085
9208
  ], JupiterFormSection.prototype, "formData", 2);
9086
- __decorateClass$4([
9209
+ __decorateClass$5([
9087
9210
  n2({ type: Object })
9088
9211
  ], JupiterFormSection.prototype, "periodData", 2);
9089
- __decorateClass$4([
9212
+ __decorateClass$5([
9090
9213
  n2({ type: Object })
9091
9214
  ], JupiterFormSection.prototype, "unitData", 2);
9092
- __decorateClass$4([
9215
+ __decorateClass$5([
9093
9216
  n2({ type: Object })
9094
9217
  ], JupiterFormSection.prototype, "decimalsData", 2);
9095
- __decorateClass$4([
9218
+ __decorateClass$5([
9096
9219
  n2({ type: String })
9097
9220
  ], JupiterFormSection.prototype, "globalDecimals", 2);
9098
- __decorateClass$4([
9221
+ __decorateClass$5([
9099
9222
  n2({ type: Object })
9100
9223
  ], JupiterFormSection.prototype, "typedMemberData", 2);
9101
- __decorateClass$4([
9224
+ __decorateClass$5([
9102
9225
  n2({ type: Object })
9103
9226
  ], JupiterFormSection.prototype, "repeatCounts", 2);
9104
- __decorateClass$4([
9227
+ __decorateClass$5([
9105
9228
  n2({ type: Array })
9106
9229
  ], JupiterFormSection.prototype, "defaultUnits", 2);
9107
- __decorateClass$4([
9230
+ __decorateClass$5([
9108
9231
  n2({ type: Boolean })
9109
9232
  ], JupiterFormSection.prototype, "disabled", 2);
9110
- __decorateClass$4([
9233
+ __decorateClass$5([
9111
9234
  n2({ type: Boolean })
9112
9235
  ], JupiterFormSection.prototype, "collapsible", 2);
9113
- __decorateClass$4([
9236
+ __decorateClass$5([
9114
9237
  n2({ type: String })
9115
9238
  ], JupiterFormSection.prototype, "locale", 2);
9116
- __decorateClass$4([
9239
+ __decorateClass$5([
9117
9240
  n2({ type: Boolean })
9118
9241
  ], JupiterFormSection.prototype, "isFirstSection", 2);
9119
- __decorateClass$4([
9242
+ __decorateClass$5([
9120
9243
  n2({ type: Array })
9121
9244
  ], JupiterFormSection.prototype, "availableDimensions", 2);
9122
- __decorateClass$4([
9245
+ __decorateClass$5([
9123
9246
  n2({ type: Boolean })
9124
9247
  ], JupiterFormSection.prototype, "hideHeader", 2);
9125
- __decorateClass$4([
9248
+ __decorateClass$5([
9126
9249
  n2({ type: String })
9127
9250
  ], JupiterFormSection.prototype, "mode", 2);
9128
- __decorateClass$4([
9251
+ __decorateClass$5([
9129
9252
  n2({ type: Boolean })
9130
9253
  ], JupiterFormSection.prototype, "showFactsOnly", 2);
9131
- __decorateClass$4([
9254
+ __decorateClass$5([
9132
9255
  n2({ type: Object })
9133
9256
  ], JupiterFormSection.prototype, "conceptMatchIds", 2);
9134
- __decorateClass$4([
9257
+ __decorateClass$5([
9135
9258
  n2({ type: Object })
9136
9259
  ], JupiterFormSection.prototype, "masterData", 2);
9137
- __decorateClass$4([
9260
+ __decorateClass$5([
9138
9261
  n2({ type: String })
9139
9262
  ], JupiterFormSection.prototype, "periodStartDate", 2);
9140
- __decorateClass$4([
9263
+ __decorateClass$5([
9141
9264
  n2({ type: String })
9142
9265
  ], JupiterFormSection.prototype, "periodEndDate", 2);
9143
- __decorateClass$4([
9266
+ __decorateClass$5([
9144
9267
  n2({ type: String })
9145
9268
  ], JupiterFormSection.prototype, "language", 2);
9146
- __decorateClass$4([
9269
+ __decorateClass$5([
9147
9270
  n2({ type: Boolean })
9148
9271
  ], JupiterFormSection.prototype, "calculationEnabled", 2);
9149
- __decorateClass$4([
9272
+ __decorateClass$5([
9150
9273
  n2({ type: Object })
9151
9274
  ], JupiterFormSection.prototype, "totalManuallyEditedData", 2);
9152
- __decorateClass$4([
9275
+ __decorateClass$5([
9153
9276
  r()
9154
9277
  ], JupiterFormSection.prototype, "_expanded", 2);
9155
- __decorateClass$4([
9278
+ __decorateClass$5([
9156
9279
  r()
9157
9280
  ], JupiterFormSection.prototype, "_showAddColumnDialog", 2);
9158
- __decorateClass$4([
9281
+ __decorateClass$5([
9159
9282
  r()
9160
9283
  ], JupiterFormSection.prototype, "_sectionPeriodType", 2);
9161
- __decorateClass$4([
9284
+ __decorateClass$5([
9162
9285
  r()
9163
9286
  ], JupiterFormSection.prototype, "_openMenuColumnId", 2);
9164
- __decorateClass$4([
9287
+ __decorateClass$5([
9165
9288
  r()
9166
9289
  ], JupiterFormSection.prototype, "_insertAfterColumnId", 2);
9167
- __decorateClass$4([
9290
+ __decorateClass$5([
9168
9291
  r()
9169
9292
  ], JupiterFormSection.prototype, "_typedMemberErrors", 2);
9170
- __decorateClass$4([
9293
+ __decorateClass$5([
9171
9294
  r()
9172
9295
  ], JupiterFormSection.prototype, "_expandedConcepts", 2);
9173
- __decorateClass$4([
9296
+ __decorateClass$5([
9174
9297
  r()
9175
9298
  ], JupiterFormSection.prototype, "_allTreeExpanded", 2);
9176
- __decorateClass$4([
9299
+ __decorateClass$5([
9177
9300
  r()
9178
9301
  ], JupiterFormSection.prototype, "_highlightMap", 2);
9179
- __decorateClass$4([
9302
+ __decorateClass$5([
9180
9303
  r()
9181
9304
  ], JupiterFormSection.prototype, "_focusedConceptId", 2);
9182
- __decorateClass$4([
9305
+ __decorateClass$5([
9183
9306
  r()
9184
9307
  ], JupiterFormSection.prototype, "_calculationMismatches", 2);
9185
- JupiterFormSection = __decorateClass$4([
9308
+ JupiterFormSection = __decorateClass$5([
9186
9309
  t$1("jupiter-form-section")
9187
9310
  ], JupiterFormSection);
9188
- var __defProp$3 = Object.defineProperty;
9189
- var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
9190
- var __decorateClass$3 = (decorators, target, key, kind) => {
9191
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
9311
+ var __defProp$4 = Object.defineProperty;
9312
+ var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
9313
+ var __decorateClass$4 = (decorators, target, key, kind) => {
9314
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
9192
9315
  for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
9193
9316
  if (decorator = decorators[i2])
9194
9317
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9195
9318
  if (kind && result)
9196
- __defProp$3(target, key, result);
9319
+ __defProp$4(target, key, result);
9197
9320
  return result;
9198
9321
  };
9199
9322
  let JupiterAdvancedFilter = class extends LitElement {
@@ -9382,27 +9505,27 @@ JupiterAdvancedFilter.styles = css`
9382
9505
  color: var(--primaryTextColor, var(--jupiter-text-primary, #333));
9383
9506
  }
9384
9507
  `;
9385
- __decorateClass$3([
9508
+ __decorateClass$4([
9386
9509
  n2({ type: Boolean })
9387
9510
  ], JupiterAdvancedFilter.prototype, "showFactsOnly", 2);
9388
- __decorateClass$3([
9511
+ __decorateClass$4([
9389
9512
  n2({ type: String })
9390
9513
  ], JupiterAdvancedFilter.prototype, "conceptSearchText", 2);
9391
- __decorateClass$3([
9514
+ __decorateClass$4([
9392
9515
  r()
9393
9516
  ], JupiterAdvancedFilter.prototype, "_localConceptSearchText", 2);
9394
- JupiterAdvancedFilter = __decorateClass$3([
9517
+ JupiterAdvancedFilter = __decorateClass$4([
9395
9518
  t$1("jupiter-advanced-filter")
9396
9519
  ], JupiterAdvancedFilter);
9397
- var __defProp$2 = Object.defineProperty;
9398
- var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
9399
- var __decorateClass$2 = (decorators, target, key, kind) => {
9400
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target;
9520
+ var __defProp$3 = Object.defineProperty;
9521
+ var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
9522
+ var __decorateClass$3 = (decorators, target, key, kind) => {
9523
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
9401
9524
  for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
9402
9525
  if (decorator = decorators[i2])
9403
9526
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9404
9527
  if (kind && result)
9405
- __defProp$2(target, key, result);
9528
+ __defProp$3(target, key, result);
9406
9529
  return result;
9407
9530
  };
9408
9531
  let _lastViewWasAdvancedFilter = false;
@@ -11106,84 +11229,84 @@ JupiterFilterRolesDialog.styles = css`
11106
11229
  background: var(--menuBgColorLighter, var(--jupiter-hover-background, #f5f5f5));
11107
11230
  }
11108
11231
  `;
11109
- __decorateClass$2([
11232
+ __decorateClass$3([
11110
11233
  n2({ type: Boolean, reflect: true })
11111
11234
  ], JupiterFilterRolesDialog.prototype, "open", 2);
11112
- __decorateClass$2([
11235
+ __decorateClass$3([
11113
11236
  n2({ type: Array })
11114
11237
  ], JupiterFilterRolesDialog.prototype, "availableRoles", 2);
11115
- __decorateClass$2([
11238
+ __decorateClass$3([
11116
11239
  n2({ type: Array })
11117
11240
  ], JupiterFilterRolesDialog.prototype, "selectedRoleIds", 2);
11118
- __decorateClass$2([
11241
+ __decorateClass$3([
11119
11242
  n2({ type: Object })
11120
11243
  ], JupiterFilterRolesDialog.prototype, "periodPreferences", 2);
11121
- __decorateClass$2([
11244
+ __decorateClass$3([
11122
11245
  n2({ type: String })
11123
11246
  ], JupiterFilterRolesDialog.prototype, "mode", 2);
11124
- __decorateClass$2([
11247
+ __decorateClass$3([
11125
11248
  n2({ type: Object })
11126
11249
  ], JupiterFilterRolesDialog.prototype, "hypercubeData", 2);
11127
- __decorateClass$2([
11250
+ __decorateClass$3([
11128
11251
  n2({ type: Boolean })
11129
11252
  ], JupiterFilterRolesDialog.prototype, "showFactsOnly", 2);
11130
- __decorateClass$2([
11253
+ __decorateClass$3([
11131
11254
  n2({ type: String })
11132
11255
  ], JupiterFilterRolesDialog.prototype, "conceptSearchText", 2);
11133
- __decorateClass$2([
11256
+ __decorateClass$3([
11134
11257
  r()
11135
11258
  ], JupiterFilterRolesDialog.prototype, "_tempSelectedRoles", 2);
11136
- __decorateClass$2([
11259
+ __decorateClass$3([
11137
11260
  r()
11138
11261
  ], JupiterFilterRolesDialog.prototype, "_searchQuery", 2);
11139
- __decorateClass$2([
11262
+ __decorateClass$3([
11140
11263
  r()
11141
11264
  ], JupiterFilterRolesDialog.prototype, "_filteredRoles", 2);
11142
- __decorateClass$2([
11265
+ __decorateClass$3([
11143
11266
  r()
11144
11267
  ], JupiterFilterRolesDialog.prototype, "_tempPeriodPreferences", 2);
11145
- __decorateClass$2([
11268
+ __decorateClass$3([
11146
11269
  r()
11147
11270
  ], JupiterFilterRolesDialog.prototype, "_selectedAvailableRole", 2);
11148
- __decorateClass$2([
11271
+ __decorateClass$3([
11149
11272
  r()
11150
11273
  ], JupiterFilterRolesDialog.prototype, "_selectedChosenRole", 2);
11151
- __decorateClass$2([
11274
+ __decorateClass$3([
11152
11275
  r()
11153
11276
  ], JupiterFilterRolesDialog.prototype, "_chosenSearchQuery", 2);
11154
- __decorateClass$2([
11277
+ __decorateClass$3([
11155
11278
  r()
11156
11279
  ], JupiterFilterRolesDialog.prototype, "_draggedRoleId", 2);
11157
- __decorateClass$2([
11280
+ __decorateClass$3([
11158
11281
  r()
11159
11282
  ], JupiterFilterRolesDialog.prototype, "_dragOverRoleId", 2);
11160
- __decorateClass$2([
11283
+ __decorateClass$3([
11161
11284
  r()
11162
11285
  ], JupiterFilterRolesDialog.prototype, "_chosenRoleOrder", 2);
11163
- __decorateClass$2([
11286
+ __decorateClass$3([
11164
11287
  r()
11165
11288
  ], JupiterFilterRolesDialog.prototype, "_showAdvancedFilter", 2);
11166
- __decorateClass$2([
11289
+ __decorateClass$3([
11167
11290
  r()
11168
11291
  ], JupiterFilterRolesDialog.prototype, "_showFactsOnly", 2);
11169
- __decorateClass$2([
11292
+ __decorateClass$3([
11170
11293
  r()
11171
11294
  ], JupiterFilterRolesDialog.prototype, "_conceptSearchText", 2);
11172
- __decorateClass$2([
11295
+ __decorateClass$3([
11173
11296
  r()
11174
11297
  ], JupiterFilterRolesDialog.prototype, "_collapsedRoles", 2);
11175
- JupiterFilterRolesDialog = __decorateClass$2([
11298
+ JupiterFilterRolesDialog = __decorateClass$3([
11176
11299
  t$1("jupiter-filter-roles-dialog")
11177
11300
  ], JupiterFilterRolesDialog);
11178
- var __defProp$1 = Object.defineProperty;
11179
- var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
11180
- var __decorateClass$1 = (decorators, target, key, kind) => {
11181
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
11301
+ var __defProp$2 = Object.defineProperty;
11302
+ var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
11303
+ var __decorateClass$2 = (decorators, target, key, kind) => {
11304
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target;
11182
11305
  for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
11183
11306
  if (decorator = decorators[i2])
11184
11307
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
11185
11308
  if (kind && result)
11186
- __defProp$1(target, key, result);
11309
+ __defProp$2(target, key, result);
11187
11310
  return result;
11188
11311
  };
11189
11312
  let JupiterFormulaValidationDialog = class extends LitElement {
@@ -11537,21 +11660,194 @@ JupiterFormulaValidationDialog.styles = css`
11537
11660
  opacity: 0.9;
11538
11661
  }
11539
11662
  `;
11540
- __decorateClass$1([
11663
+ __decorateClass$2([
11541
11664
  n2({ type: Array })
11542
11665
  ], JupiterFormulaValidationDialog.prototype, "results", 2);
11543
- __decorateClass$1([
11666
+ __decorateClass$2([
11544
11667
  n2({ type: Object })
11545
11668
  ], JupiterFormulaValidationDialog.prototype, "summary", 2);
11546
- __decorateClass$1([
11669
+ __decorateClass$2([
11547
11670
  n2({ type: Boolean, reflect: true })
11548
11671
  ], JupiterFormulaValidationDialog.prototype, "open", 2);
11549
- __decorateClass$1([
11672
+ __decorateClass$2([
11550
11673
  r()
11551
11674
  ], JupiterFormulaValidationDialog.prototype, "_collapsedGroups", 2);
11552
- JupiterFormulaValidationDialog = __decorateClass$1([
11675
+ JupiterFormulaValidationDialog = __decorateClass$2([
11553
11676
  t$1("jupiter-formula-validation-dialog")
11554
11677
  ], JupiterFormulaValidationDialog);
11678
+ var __defProp$1 = Object.defineProperty;
11679
+ var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
11680
+ var __decorateClass$1 = (decorators, target, key, kind) => {
11681
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
11682
+ for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
11683
+ if (decorator = decorators[i2])
11684
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
11685
+ if (kind && result)
11686
+ __defProp$1(target, key, result);
11687
+ return result;
11688
+ };
11689
+ let JupiterConfirmDialog = class extends LitElement {
11690
+ constructor() {
11691
+ super(...arguments);
11692
+ this.open = false;
11693
+ this.heading = "";
11694
+ this.message = "";
11695
+ this.confirmLabel = "OK";
11696
+ this.cancelLabel = "Cancel";
11697
+ this._boundHandleKeydown = this._handleKeydown.bind(this);
11698
+ }
11699
+ connectedCallback() {
11700
+ super.connectedCallback();
11701
+ window.addEventListener("keydown", this._boundHandleKeydown);
11702
+ }
11703
+ disconnectedCallback() {
11704
+ window.removeEventListener("keydown", this._boundHandleKeydown);
11705
+ super.disconnectedCallback();
11706
+ }
11707
+ updated(changed) {
11708
+ var _a, _b;
11709
+ if (changed.has("open") && this.open) {
11710
+ (_b = (_a = this.shadowRoot) == null ? void 0 : _a.querySelector(".btn-primary")) == null ? void 0 : _b.focus();
11711
+ }
11712
+ }
11713
+ _handleKeydown(event) {
11714
+ if (this.open && event.key === "Escape") {
11715
+ this._handleCancel();
11716
+ }
11717
+ }
11718
+ _handleConfirm() {
11719
+ this.open = false;
11720
+ this.dispatchEvent(new CustomEvent("dialog-confirm", { bubbles: true }));
11721
+ }
11722
+ _handleCancel() {
11723
+ this.open = false;
11724
+ this.dispatchEvent(new CustomEvent("dialog-cancel", { bubbles: true }));
11725
+ }
11726
+ render() {
11727
+ if (!this.open)
11728
+ return html``;
11729
+ return html`
11730
+ <div class="dialog" role="alertdialog" aria-modal="true" aria-labelledby="title" aria-describedby="message"
11731
+ @click="${(e2) => e2.stopPropagation()}">
11732
+ <h2 class="dialog-title" id="title">${this.heading}</h2>
11733
+ <p class="dialog-message" id="message">${this.message}</p>
11734
+ <div class="dialog-actions">
11735
+ <button type="button" class="btn btn-secondary" @click="${this._handleCancel}">${this.cancelLabel}</button>
11736
+ <button type="button" class="btn btn-primary" @click="${this._handleConfirm}">${this.confirmLabel}</button>
11737
+ </div>
11738
+ </div>
11739
+ `;
11740
+ }
11741
+ };
11742
+ JupiterConfirmDialog.styles = css`
11743
+ :host {
11744
+ position: fixed;
11745
+ top: 0;
11746
+ left: 0;
11747
+ width: 100%;
11748
+ height: 100%;
11749
+ background: rgba(0, 0, 0, 0.5);
11750
+ z-index: 1100;
11751
+ display: flex;
11752
+ align-items: center;
11753
+ justify-content: center;
11754
+ opacity: 0;
11755
+ visibility: hidden;
11756
+ transition: opacity 0.3s ease, visibility 0.3s ease;
11757
+ }
11758
+
11759
+ :host([open]) {
11760
+ opacity: 1;
11761
+ visibility: visible;
11762
+ }
11763
+
11764
+ .dialog {
11765
+ background: var(--bg-color-2, var(--jupiter-card-background, #fff));
11766
+ border-radius: 8px;
11767
+ padding: 24px;
11768
+ min-width: 360px;
11769
+ max-width: 520px;
11770
+ width: 90vw;
11771
+ box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
11772
+ transform: scale(0.9);
11773
+ transition: transform 0.3s ease;
11774
+ }
11775
+
11776
+ :host([open]) .dialog {
11777
+ transform: scale(1);
11778
+ }
11779
+
11780
+ .dialog-title {
11781
+ font-size: 20px;
11782
+ font-weight: 600;
11783
+ color: var(--primaryTextColor, var(--jupiter-text-primary, #333));
11784
+ margin: 0 0 12px 0;
11785
+ }
11786
+
11787
+ .dialog-message {
11788
+ font-size: 14px;
11789
+ line-height: 1.5;
11790
+ color: var(--primaryTextColor, var(--jupiter-text-primary, #333));
11791
+ margin: 0;
11792
+ overflow-wrap: anywhere;
11793
+ }
11794
+
11795
+ .dialog-actions {
11796
+ display: flex;
11797
+ gap: 12px;
11798
+ justify-content: flex-end;
11799
+ border-top: 1px solid var(--jupiter-border-color, #ddd);
11800
+ padding-top: 16px;
11801
+ margin-top: 20px;
11802
+ }
11803
+
11804
+ .btn {
11805
+ padding: 10px 20px;
11806
+ border-radius: 4px;
11807
+ font-size: 14px;
11808
+ font-weight: 500;
11809
+ cursor: pointer;
11810
+ transition: background-color 0.2s ease;
11811
+ }
11812
+
11813
+ .btn-primary {
11814
+ border: none;
11815
+ background: var(--buttonBgColor, var(--jupiter-primary-color, #1976d2));
11816
+ color: var(--buttonTextColor, white);
11817
+ }
11818
+
11819
+ .btn-primary:hover {
11820
+ opacity: 0.9;
11821
+ }
11822
+
11823
+ .btn-secondary {
11824
+ border: 1px solid var(--jupiter-border-color, #ddd);
11825
+ background: transparent;
11826
+ color: var(--primaryTextColor, var(--jupiter-text-primary, #333));
11827
+ }
11828
+
11829
+ .btn-secondary:hover {
11830
+ background: var(--jupiter-hover-background, #f5f5f5);
11831
+ }
11832
+ `;
11833
+ __decorateClass$1([
11834
+ n2({ type: Boolean, reflect: true })
11835
+ ], JupiterConfirmDialog.prototype, "open", 2);
11836
+ __decorateClass$1([
11837
+ n2({ type: String })
11838
+ ], JupiterConfirmDialog.prototype, "heading", 2);
11839
+ __decorateClass$1([
11840
+ n2({ type: String })
11841
+ ], JupiterConfirmDialog.prototype, "message", 2);
11842
+ __decorateClass$1([
11843
+ n2({ type: String })
11844
+ ], JupiterConfirmDialog.prototype, "confirmLabel", 2);
11845
+ __decorateClass$1([
11846
+ n2({ type: String })
11847
+ ], JupiterConfirmDialog.prototype, "cancelLabel", 2);
11848
+ JupiterConfirmDialog = __decorateClass$1([
11849
+ t$1("jupiter-confirm-dialog")
11850
+ ], JupiterConfirmDialog);
11555
11851
  var __defProp = Object.defineProperty;
11556
11852
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
11557
11853
  var __decorateClass = (decorators, target, key, kind) => {
@@ -11612,6 +11908,7 @@ let JupiterDynamicForm = class extends LitElement {
11612
11908
  this._allSections = [];
11613
11909
  this._selectedRoleIds = [];
11614
11910
  this._showFilterDialog = false;
11911
+ this._revealRolePrompt = null;
11615
11912
  this._showFactsOnly = false;
11616
11913
  this._conceptSearchText = "";
11617
11914
  this._periodPreferences = {};
@@ -11709,6 +12006,7 @@ let JupiterDynamicForm = class extends LitElement {
11709
12006
  clearInterval(this._autoSaveTimer);
11710
12007
  this._autoSaveTimer = null;
11711
12008
  }
12009
+ this._settleRevealRolePrompt(false);
11712
12010
  }
11713
12011
  /**
11714
12012
  * Capture the current _formData as the auto-save baseline.
@@ -12405,8 +12703,14 @@ let JupiterDynamicForm = class extends LitElement {
12405
12703
  this.scrollToConcept(event.detail.conceptQName, void 0, void 0, event.detail.columnId, event.detail.conceptId);
12406
12704
  }
12407
12705
  _handleRoleFilterApply(event) {
12408
- var _a, _b;
12409
12706
  const { selectedRoleIds, periodPreferences } = event.detail;
12707
+ this._applyRoleSelection(selectedRoleIds, periodPreferences, "filterDialog");
12708
+ }
12709
+ // Applies a new role selection: preserves entered data through a draft, rebuilds the form, and
12710
+ // restores the data. Shared by the Filter Roles dialog and scrollToConcept's reveal (JDF-086).
12711
+ // Resolves once the draft has been restored into the rebuilt form.
12712
+ _applyRoleSelection(selectedRoleIds, periodPreferences, source) {
12713
+ var _a, _b;
12410
12714
  console.log("🎯 Filter apply triggered");
12411
12715
  console.log("📊 Old _selectedRoleIds:", this._selectedRoleIds);
12412
12716
  console.log("📊 New selectedRoleIds from dialog:", selectedRoleIds);
@@ -12447,7 +12751,7 @@ let JupiterDynamicForm = class extends LitElement {
12447
12751
  console.log("📊 After _initializeForm, _currentSchema.sections.length:", (_a = this._currentSchema) == null ? void 0 : _a.sections.length);
12448
12752
  console.log("📊 Section IDs:", (_b = this._currentSchema) == null ? void 0 : _b.sections.map((s2) => s2.id));
12449
12753
  console.log("📥 Restoring form data from draft after reinitialization...");
12450
- this._loadDraftIfExists().then(() => {
12754
+ const restored = this._loadDraftIfExists().then(() => {
12451
12755
  this._seedAutoSaveBaseline();
12452
12756
  console.log("✅ Form data restored successfully after reinitialization");
12453
12757
  }).catch((error2) => {
@@ -12463,10 +12767,43 @@ let JupiterDynamicForm = class extends LitElement {
12463
12767
  // Enhanced structure with roleURI and order
12464
12768
  totalRoles: this._allSections.length,
12465
12769
  visibleRoles: roleCount,
12466
- periodPreferences
12770
+ periodPreferences,
12771
+ source
12467
12772
  },
12468
12773
  bubbles: true
12469
12774
  }));
12775
+ return restored;
12776
+ }
12777
+ // JDF-086: scrollToConcept found its target in a role the user has filtered out of the left
12778
+ // panel. Resolves true if the user agrees to show that role. A newer call replaces a prompt
12779
+ // that is still open; the older call then resolves false.
12780
+ _confirmRevealHiddenRole(section2) {
12781
+ var _a;
12782
+ (_a = this._revealRolePrompt) == null ? void 0 : _a.resolve(false);
12783
+ return new Promise((resolve) => {
12784
+ this._revealRolePrompt = { section: section2, resolve };
12785
+ });
12786
+ }
12787
+ _settleRevealRolePrompt(confirmed) {
12788
+ const prompt = this._revealRolePrompt;
12789
+ this._revealRolePrompt = null;
12790
+ prompt == null ? void 0 : prompt.resolve(confirmed);
12791
+ }
12792
+ // JDF-086: add one role to the current filter, exactly as if it had been ticked in the Filter
12793
+ // Roles dialog. The user's custom order is kept and the role is appended, as the dialog does
12794
+ // for newly ticked roles.
12795
+ _revealRole(section2) {
12796
+ var _a;
12797
+ const current = this._selectedRoleIds;
12798
+ let selected;
12799
+ if (current.length > 0 && typeof current[0] === "object") {
12800
+ const enhanced = current;
12801
+ const nextOrder = Math.max(-1, ...enhanced.map((r2) => r2.order)) + 1;
12802
+ selected = [...enhanced, { roleId: section2.id, roleURI: ((_a = section2.metadata) == null ? void 0 : _a.roleURI) || "", order: nextOrder }];
12803
+ } else {
12804
+ selected = [...current, section2.id];
12805
+ }
12806
+ return this._applyRoleSelection(selected, this._periodPreferences, "scrollToConcept");
12470
12807
  }
12471
12808
  /**
12472
12809
  * Check if dimension selections have changed for any role
@@ -12916,11 +13253,21 @@ let JupiterDynamicForm = class extends LitElement {
12916
13253
  return this._xbrlFormErrors.some((error2) => error2.sectionId === roleId);
12917
13254
  }
12918
13255
  async _handleErrorFieldClick(conceptId, columnId, sectionId) {
12919
- var _a, _b, _c, _d;
13256
+ var _a, _b, _c, _d, _e, _f, _g;
12920
13257
  console.log(`🎯 [Error Click] Attempting to focus field: ${conceptId}__${columnId} in section: ${sectionId}`);
12921
13258
  this._showErrorPopup = false;
12922
13259
  this.requestUpdate();
12923
13260
  await this.updateComplete;
13261
+ if (!((_a = this._currentSchema) == null ? void 0 : _a.sections.some((s2) => s2.id === sectionId))) {
13262
+ const section2 = this._allSections.find((s2) => s2.id === sectionId);
13263
+ if (!section2 || !await this._confirmRevealHiddenRole(section2))
13264
+ return;
13265
+ await this._revealRole(section2);
13266
+ }
13267
+ if ((_b = this._hiddenColumnIds.get(sectionId)) == null ? void 0 : _b.has(columnId)) {
13268
+ this._showColumn(sectionId, columnId);
13269
+ await this.updateComplete;
13270
+ }
12924
13271
  if (this.display === "sidePanel" && this._activeSidePanelRoleId !== sectionId) {
12925
13272
  console.log(`🔀 Switching to section: ${sectionId} (currently on: ${this._activeSidePanelRoleId})`);
12926
13273
  this._activeSidePanelRoleId = sectionId;
@@ -12928,7 +13275,7 @@ let JupiterDynamicForm = class extends LitElement {
12928
13275
  await this.updateComplete;
12929
13276
  await new Promise((resolve) => setTimeout(resolve, 500));
12930
13277
  }
12931
- const sectionElements = (_a = this.shadowRoot) == null ? void 0 : _a.querySelectorAll("jupiter-form-section");
13278
+ const sectionElements = (_c = this.shadowRoot) == null ? void 0 : _c.querySelectorAll("jupiter-form-section");
12932
13279
  let targetSection = null;
12933
13280
  sectionElements == null ? void 0 : sectionElements.forEach((sectionEl) => {
12934
13281
  var _a2;
@@ -12941,19 +13288,14 @@ let JupiterDynamicForm = class extends LitElement {
12941
13288
  return;
12942
13289
  }
12943
13290
  console.log(`✅ Found section element:`, targetSection);
12944
- if ((_b = targetSection.section) == null ? void 0 : _b.collapsed) {
12945
- console.log(`📂 Expanding collapsed section`);
12946
- targetSection.section.collapsed = false;
12947
- targetSection.requestUpdate();
12948
- await targetSection.updateComplete;
12949
- await new Promise((resolve) => setTimeout(resolve, 500));
12950
- } else {
12951
- await targetSection.updateComplete;
12952
- await new Promise((resolve) => setTimeout(resolve, 100));
13291
+ await targetSection.updateComplete;
13292
+ if (await ((_d = targetSection.revealConcept) == null ? void 0 : _d.call(targetSection, conceptId))) {
13293
+ await Promise.all(Array.from(((_e = targetSection.shadowRoot) == null ? void 0 : _e.querySelectorAll("jupiter-concept-tree")) ?? []).map((ct) => ct.updateComplete));
12953
13294
  }
13295
+ await new Promise((resolve) => setTimeout(resolve, 100));
12954
13296
  console.log(`🔍 Section shadow DOM exists: ${!!targetSection.shadowRoot}`);
12955
13297
  if (targetSection.shadowRoot) {
12956
- console.log(`🔍 Shadow DOM innerHTML length: ${((_c = targetSection.shadowRoot.innerHTML) == null ? void 0 : _c.length) || 0}`);
13298
+ console.log(`🔍 Shadow DOM innerHTML length: ${((_f = targetSection.shadowRoot.innerHTML) == null ? void 0 : _f.length) || 0}`);
12957
13299
  const allElements = targetSection.shadowRoot.querySelectorAll("*");
12958
13300
  console.log(`🔍 Total elements in shadow DOM: ${allElements.length}`);
12959
13301
  const customElements2 = Array.from(allElements).filter((el) => {
@@ -12965,7 +13307,7 @@ let JupiterDynamicForm = class extends LitElement {
12965
13307
  const fieldId = `${conceptId}_${columnId}_field`;
12966
13308
  console.log(`🔍 Looking for input with fieldId: ${fieldId}`);
12967
13309
  console.log(`🔍 Looking for field with conceptId: ${conceptId} AND columnId: ${columnId}`);
12968
- const conceptTrees = (_d = targetSection.shadowRoot) == null ? void 0 : _d.querySelectorAll("jupiter-concept-tree");
13310
+ const conceptTrees = (_g = targetSection.shadowRoot) == null ? void 0 : _g.querySelectorAll("jupiter-concept-tree");
12969
13311
  let targetInput = null;
12970
13312
  console.log(`🔍 Found ${(conceptTrees == null ? void 0 : conceptTrees.length) || 0} concept-tree elements`);
12971
13313
  if (conceptTrees) {
@@ -13064,10 +13406,15 @@ let JupiterDynamicForm = class extends LitElement {
13064
13406
  }));
13065
13407
  }
13066
13408
  _handleColumnShow(event) {
13067
- var _a;
13068
13409
  const { columnId, sectionId } = event.detail;
13069
13410
  if (!sectionId || !columnId)
13070
13411
  return;
13412
+ this._showColumn(sectionId, columnId);
13413
+ }
13414
+ // Un-hides a column the user collapsed. Shared by the collapsed header's double-click and by
13415
+ // navigation to a field in that column (scrollToConcept, the error popup — JDF-088).
13416
+ _showColumn(sectionId, columnId) {
13417
+ var _a;
13071
13418
  (_a = this._hiddenColumnIds.get(sectionId)) == null ? void 0 : _a.delete(columnId);
13072
13419
  this._dirty = true;
13073
13420
  this.hasUnsavedChanges = true;
@@ -15854,11 +16201,11 @@ let JupiterDynamicForm = class extends LitElement {
15854
16201
  return dims.length === 1 && this._normalizeAxisId(col.dimensionData.axisId ?? "") === this._normalizeAxisId(dims[0].axis) && this._normalizeMemberId(col.dimensionData.memberId ?? "") === this._normalizeMemberId(dims[0].member);
15855
16202
  })) == null ? void 0 : _a.id;
15856
16203
  }
15857
- async scrollToConcept(conceptName, dimensions, match, columnId, exactConceptId) {
15858
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
15859
- console.log(`[scrollToConcept] START conceptName=${conceptName} value=${match == null ? void 0 : match.value} dims=${JSON.stringify(dimensions)} columnId=${columnId} exactConceptId=${exactConceptId}`);
15860
- let targetSection = null;
15861
- let targetConcept = null;
16204
+ // Step 1 of scrollToConcept: pick the section + concept row to navigate to. Precedence:
16205
+ // exactConceptId (caller resolved the row) role (JDF-087: caller named the role) → the
16206
+ // original whole-form search (visible sections first, then the rest).
16207
+ _resolveScrollTarget(conceptName, dimensions, columnId, exactConceptId, role, targetValue) {
16208
+ var _a;
15862
16209
  const sectionsToSearch = [
15863
16210
  ...((_a = this._currentSchema) == null ? void 0 : _a.sections) ?? [],
15864
16211
  ...this._allSections.filter((s2) => {
@@ -15867,101 +16214,154 @@ let JupiterDynamicForm = class extends LitElement {
15867
16214
  })
15868
16215
  ];
15869
16216
  console.log(`[scrollToConcept] Searching ${sectionsToSearch.length} sections`);
15870
- const hasValueMatch = (match == null ? void 0 : match.value) !== void 0 && (match == null ? void 0 : match.value) !== null;
15871
- const targetValue = hasValueMatch ? String(match.value) : null;
15872
16217
  if (exactConceptId) {
15873
16218
  for (const section2 of sectionsToSearch) {
15874
16219
  const found = this._findConceptById(section2.concepts, exactConceptId);
15875
16220
  if (found) {
15876
16221
  console.log(`[scrollToConcept] Section "${section2.id}" matched exactConceptId="${exactConceptId}"`);
15877
- targetSection = section2;
15878
- targetConcept = found;
15879
- break;
16222
+ return { section: section2, concept: found, viaRole: false };
15880
16223
  }
15881
16224
  }
15882
16225
  }
15883
- if (!targetSection || !targetConcept) {
15884
- for (const section2 of sectionsToSearch) {
15885
- const candidates = this._findAllConceptsByName(section2.concepts, conceptName);
15886
- if (!candidates.length)
16226
+ if (role) {
16227
+ const matches = rankMatchingSections(role, sectionsToSearch);
16228
+ console.log(`[scrollToConcept] role="${role}" matched ${matches.length} section(s): ${matches.slice(0, 5).map((m) => `${m.section.id} (tier ${m.tier})`).join(", ")}`);
16229
+ for (const { section: section2, tier } of matches) {
16230
+ const hit = this._resolveConceptInSection(section2, conceptName, dimensions, columnId, targetValue);
16231
+ if (!hit)
15887
16232
  continue;
15888
- const cols = section2.columns ?? this._columns;
15889
- const resolvedColumnId = columnId ?? ((dimensions == null ? void 0 : dimensions.length) ? this._findColumnByDimensions(cols, dimensions) : void 0);
15890
- let picked;
15891
- if (candidates.length > 1) {
15892
- picked = candidates.find((c2) => {
15893
- const rowData = this._formData[c2.id];
15894
- if (!rowData)
15895
- return false;
15896
- if (resolvedColumnId) {
15897
- const cellValue = rowData[resolvedColumnId];
15898
- if (cellValue === void 0 || cellValue === null || cellValue === "")
15899
- return false;
15900
- return !hasValueMatch || this._valueLooselyMatches(cellValue, targetValue);
15901
- }
15902
- if (hasValueMatch) {
15903
- return Object.values(rowData).some(
15904
- (v) => v !== void 0 && v !== null && v !== "" && this._valueLooselyMatches(v, targetValue)
15905
- );
15906
- }
16233
+ if (tier >= ROLE_MATCH_TIER.SUBSTRING) {
16234
+ console.warn(`[scrollToConcept] role="${role}" only fuzzily matched "${section2.id}" (tier ${tier}) pass the role's id or local name for an exact match`);
16235
+ }
16236
+ return { section: section2, concept: hit.concept, viaRole: true };
16237
+ }
16238
+ console.warn(`[scrollToConcept] "${conceptName}" not found in any section matching role="${role}" — falling back to whole-form search`);
16239
+ }
16240
+ let tentative = null;
16241
+ for (const section2 of sectionsToSearch) {
16242
+ const hit = this._resolveConceptInSection(section2, conceptName, dimensions, columnId, targetValue);
16243
+ if (!hit)
16244
+ continue;
16245
+ if (hit.strong)
16246
+ return { section: section2, concept: hit.concept, viaRole: false };
16247
+ tentative ?? (tentative = { section: section2, concept: hit.concept });
16248
+ }
16249
+ return tentative ? { ...tentative, viaRole: false } : null;
16250
+ }
16251
+ // Finds conceptName's row in one section. `strong` is false when the concept is there but the
16252
+ // requested column (columnId, or one matching `dimensions`) isn't — the whole-form search keeps
16253
+ // such a hit only as a fallback while it looks for a section where the column is present.
16254
+ _resolveConceptInSection(section2, conceptName, dimensions, columnId, targetValue) {
16255
+ const candidates = this._findAllConceptsByName(section2.concepts, conceptName);
16256
+ if (!candidates.length)
16257
+ return null;
16258
+ const hasValueMatch = targetValue !== null;
16259
+ const cols = section2.columns ?? this._columns;
16260
+ const resolvedColumnId = columnId ?? ((dimensions == null ? void 0 : dimensions.length) ? this._findColumnByDimensions(cols, dimensions) : void 0);
16261
+ let picked;
16262
+ if (candidates.length > 1) {
16263
+ picked = candidates.find((c2) => {
16264
+ const rowData = this._formData[c2.id];
16265
+ if (!rowData)
16266
+ return false;
16267
+ if (resolvedColumnId) {
16268
+ const cellValue = rowData[resolvedColumnId];
16269
+ if (cellValue === void 0 || cellValue === null || cellValue === "")
15907
16270
  return false;
15908
- });
15909
- console.log(`[scrollToConcept] Section "${section2.id}" has ${candidates.length} rows named "${conceptName}" | disambiguated=${(picked == null ? void 0 : picked.id) ?? "none (using first)"}`);
16271
+ return !hasValueMatch || this._valueLooselyMatches(cellValue, targetValue);
15910
16272
  }
15911
- const found = picked ?? candidates[0];
15912
- if (columnId) {
15913
- const hasColumn = cols.some((c2) => c2.id === columnId);
15914
- console.log(`[scrollToConcept] Section "${section2.id}" has concept "${found.id}" | columnId="${columnId}" present=${hasColumn}`);
15915
- if (hasColumn) {
15916
- targetSection = section2;
15917
- targetConcept = found;
15918
- break;
15919
- } else if (!targetSection) {
15920
- targetSection = section2;
15921
- targetConcept = found;
15922
- }
15923
- } else if (dimensions == null ? void 0 : dimensions.length) {
15924
- console.log(`[scrollToConcept] Section "${section2.id}" has concept "${found.id}" | colMatch=${resolvedColumnId ?? "null"} | cols=${cols.map((c2) => c2.id).join(",")}`);
15925
- if (resolvedColumnId) {
15926
- targetSection = section2;
15927
- targetConcept = found;
15928
- break;
15929
- } else if (!targetSection) {
15930
- targetSection = section2;
15931
- targetConcept = found;
15932
- }
15933
- } else {
15934
- console.log(`[scrollToConcept] Section "${section2.id}" has concept "${found.id}" (no dims, taking first)`);
15935
- targetSection = section2;
15936
- targetConcept = found;
15937
- break;
16273
+ if (hasValueMatch) {
16274
+ return Object.values(rowData).some(
16275
+ (v) => v !== void 0 && v !== null && v !== "" && this._valueLooselyMatches(v, targetValue)
16276
+ );
15938
16277
  }
15939
- }
16278
+ return false;
16279
+ });
16280
+ console.log(`[scrollToConcept] Section "${section2.id}" has ${candidates.length} rows named "${conceptName}" | disambiguated=${(picked == null ? void 0 : picked.id) ?? "none (using first)"}`);
15940
16281
  }
15941
- if (!targetSection || !targetConcept) {
16282
+ const found = picked ?? candidates[0];
16283
+ if (columnId) {
16284
+ const hasColumn = cols.some((c2) => c2.id === columnId);
16285
+ console.log(`[scrollToConcept] Section "${section2.id}" has concept "${found.id}" | columnId="${columnId}" present=${hasColumn}`);
16286
+ return { concept: found, strong: hasColumn };
16287
+ }
16288
+ if (dimensions == null ? void 0 : dimensions.length) {
16289
+ console.log(`[scrollToConcept] Section "${section2.id}" has concept "${found.id}" | colMatch=${resolvedColumnId ?? "null"} | cols=${cols.map((c2) => c2.id).join(",")}`);
16290
+ return { concept: found, strong: !!resolvedColumnId };
16291
+ }
16292
+ console.log(`[scrollToConcept] Section "${section2.id}" has concept "${found.id}" (no dims, taking first)`);
16293
+ return { concept: found, strong: true };
16294
+ }
16295
+ async scrollToConcept(conceptName, dimensions, match, columnId, exactConceptId, role) {
16296
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
16297
+ console.log(`[scrollToConcept] ▶ START conceptName=${conceptName} value=${match == null ? void 0 : match.value} dims=${JSON.stringify(dimensions)} columnId=${columnId} exactConceptId=${exactConceptId} role=${role}`);
16298
+ const hasValueMatch = (match == null ? void 0 : match.value) !== void 0 && (match == null ? void 0 : match.value) !== null;
16299
+ const targetValue = hasValueMatch ? String(match.value) : null;
16300
+ const resolved = this._resolveScrollTarget(conceptName, dimensions, columnId, exactConceptId, role, targetValue);
16301
+ if (!resolved) {
15942
16302
  console.warn(`[scrollToConcept] Concept not found: ${conceptName}`);
15943
16303
  return;
15944
16304
  }
15945
- console.log(`[scrollToConcept] targetSection="${targetSection.id}" targetConceptId="${targetConcept.id}"`);
16305
+ let { section: targetSection, concept: targetConcept } = resolved;
16306
+ const { viaRole } = resolved;
16307
+ console.log(`[scrollToConcept] → targetSection="${targetSection.id}" targetConceptId="${targetConcept.id}" viaRole=${viaRole}`);
16308
+ if (!((_a = this._currentSchema) == null ? void 0 : _a.sections.some((s2) => s2.id === targetSection.id))) {
16309
+ console.log(`[scrollToConcept] Role "${targetSection.id}" is filtered out — asking to show it`);
16310
+ if (!await this._confirmRevealHiddenRole(targetSection)) {
16311
+ console.log("[scrollToConcept] Reveal declined — not navigating");
16312
+ return;
16313
+ }
16314
+ await this._revealRole(targetSection);
16315
+ const revealedSection = (_b = this._currentSchema) == null ? void 0 : _b.sections.find((s2) => s2.id === targetSection.id);
16316
+ const revealedConcept = revealedSection && this._findConceptById(revealedSection.concepts, targetConcept.id);
16317
+ if (!revealedSection || !revealedConcept) {
16318
+ console.warn(`[scrollToConcept] Revealed role "${targetSection.id}" but could not find row "${targetConcept.id}" in it`);
16319
+ return;
16320
+ }
16321
+ targetSection = revealedSection;
16322
+ targetConcept = revealedConcept;
16323
+ }
15946
16324
  targetSection.expanded = true;
15947
16325
  if (this.display === "sidePanel" && this._activeSidePanelRoleId !== targetSection.id) {
15948
16326
  this._activeSidePanelRoleId = targetSection.id;
15949
16327
  }
15950
16328
  const columns = targetSection.columns ?? this._columns;
16329
+ const hiddenColumnIds = this._hiddenColumnIds.get(targetSection.id);
15951
16330
  let targetColumnId = null;
15952
16331
  if (columnId) {
15953
16332
  targetColumnId = columnId;
15954
16333
  } else if (dimensions == null ? void 0 : dimensions.length) {
15955
16334
  targetColumnId = this._findColumnByDimensions(columns, dimensions) ?? null;
15956
16335
  } else if (!hasValueMatch) {
15957
- targetColumnId = ((_b = columns[0]) == null ? void 0 : _b.id) ?? null;
16336
+ targetColumnId = ((_c = columns.find((c2) => !(hiddenColumnIds == null ? void 0 : hiddenColumnIds.has(c2.id))) ?? columns[0]) == null ? void 0 : _c.id) ?? null;
16337
+ }
16338
+ if (hiddenColumnIds == null ? void 0 : hiddenColumnIds.size) {
16339
+ let columnToShow;
16340
+ if (targetColumnId) {
16341
+ if (hiddenColumnIds.has(targetColumnId))
16342
+ columnToShow = targetColumnId;
16343
+ } else if (hasValueMatch) {
16344
+ const rowData = this._formData[targetConcept.id] ?? {};
16345
+ const holders = columns.filter((c2) => {
16346
+ const v = rowData[c2.id];
16347
+ return v !== void 0 && v !== null && v !== "" && this._valueLooselyMatches(v, targetValue);
16348
+ });
16349
+ if (holders.length && holders.every((c2) => hiddenColumnIds.has(c2.id))) {
16350
+ columnToShow = holders[0].id;
16351
+ targetColumnId = columnToShow;
16352
+ }
16353
+ }
16354
+ if (columnToShow) {
16355
+ console.log(`[scrollToConcept] Column "${columnToShow}" is hidden in "${targetSection.id}" — showing it`);
16356
+ this._showColumn(targetSection.id, columnToShow);
16357
+ }
15958
16358
  }
15959
16359
  console.log(`[scrollToConcept] targetColumnId=${targetColumnId} hasValueMatch=${hasValueMatch} targetValue=${targetValue}`);
15960
16360
  this._conceptSearchText = conceptName.includes(":") ? conceptName.split(":").pop() : conceptName;
15961
16361
  this.requestUpdate();
15962
16362
  await this.updateComplete;
15963
16363
  await new Promise((resolve) => setTimeout(resolve, 300));
15964
- const sectionElements = (_c = this.shadowRoot) == null ? void 0 : _c.querySelectorAll("jupiter-form-section");
16364
+ const sectionElements = (_d = this.shadowRoot) == null ? void 0 : _d.querySelectorAll("jupiter-form-section");
15965
16365
  console.log(`[scrollToConcept] DOM: found ${(sectionElements == null ? void 0 : sectionElements.length) ?? 0} jupiter-form-section elements`);
15966
16366
  let targetSectionEl = null;
15967
16367
  sectionElements == null ? void 0 : sectionElements.forEach((el) => {
@@ -15974,7 +16374,10 @@ let JupiterDynamicForm = class extends LitElement {
15974
16374
  return;
15975
16375
  }
15976
16376
  await targetSectionEl.updateComplete;
15977
- const conceptTrees = (_d = targetSectionEl.shadowRoot) == null ? void 0 : _d.querySelectorAll("jupiter-concept-tree");
16377
+ if (await ((_e = targetSectionEl.revealConcept) == null ? void 0 : _e.call(targetSectionEl, targetConcept.id))) {
16378
+ await Promise.all(Array.from(((_f = targetSectionEl.shadowRoot) == null ? void 0 : _f.querySelectorAll("jupiter-concept-tree")) ?? []).map((ct) => ct.updateComplete));
16379
+ }
16380
+ const conceptTrees = (_g = targetSectionEl.shadowRoot) == null ? void 0 : _g.querySelectorAll("jupiter-concept-tree");
15978
16381
  console.log(`[scrollToConcept] conceptTrees in targetSection: ${(conceptTrees == null ? void 0 : conceptTrees.length) ?? 0}`);
15979
16382
  let targetFieldEl = null;
15980
16383
  const conceptId = targetConcept.id;
@@ -16024,17 +16427,32 @@ let JupiterDynamicForm = class extends LitElement {
16024
16427
  });
16025
16428
  });
16026
16429
  console.log(`[scrollToConcept] Phase1: scanned ${phase1FieldCount} candidates, found=${!!targetFieldEl}`);
16430
+ if (!targetFieldEl && viaRole) {
16431
+ const rowFields = [];
16432
+ conceptTrees == null ? void 0 : conceptTrees.forEach((ct) => {
16433
+ var _a2;
16434
+ (_a2 = ct.shadowRoot) == null ? void 0 : _a2.querySelectorAll("jupiter-form-field").forEach((fieldEl) => {
16435
+ if (fieldEl.conceptId === conceptId)
16436
+ rowFields.push(fieldEl);
16437
+ });
16438
+ });
16439
+ targetFieldEl = targetColumnId && rowFields.find((f2) => f2.columnId === targetColumnId) || rowFields[0] || null;
16440
+ if (targetFieldEl && targetColumnId && targetFieldEl.columnId !== targetColumnId) {
16441
+ console.warn(`[scrollToConcept] Phase1b: column "${targetColumnId}" not rendered in row "${conceptId}" — using column "${targetFieldEl.columnId}"`);
16442
+ }
16443
+ console.log(`[scrollToConcept] Phase1b (role-scoped): ${rowFields.length} fields in row "${conceptId}", found=${!!targetFieldEl}`);
16444
+ }
16027
16445
  if (!targetFieldEl && hasValueMatch) {
16028
16446
  console.log(`[scrollToConcept] Phase2: searching ALL sections by base concept name + value`);
16029
- const allSectionEls = ((_e = this.shadowRoot) == null ? void 0 : _e.querySelectorAll("jupiter-form-section")) ?? [];
16447
+ const allSectionEls = ((_h = this.shadowRoot) == null ? void 0 : _h.querySelectorAll("jupiter-form-section")) ?? [];
16030
16448
  for (const secEl of Array.from(allSectionEls)) {
16031
16449
  if (targetFieldEl)
16032
16450
  break;
16033
- const cts = ((_f = secEl.shadowRoot) == null ? void 0 : _f.querySelectorAll("jupiter-concept-tree")) ?? [];
16451
+ const cts = ((_i = secEl.shadowRoot) == null ? void 0 : _i.querySelectorAll("jupiter-concept-tree")) ?? [];
16034
16452
  for (const ct of Array.from(cts)) {
16035
16453
  if (targetFieldEl)
16036
16454
  break;
16037
- const fields = ((_g = ct.shadowRoot) == null ? void 0 : _g.querySelectorAll("jupiter-form-field")) ?? [];
16455
+ const fields = ((_j = ct.shadowRoot) == null ? void 0 : _j.querySelectorAll("jupiter-form-field")) ?? [];
16038
16456
  fields.forEach((fieldEl) => {
16039
16457
  if (targetFieldEl)
16040
16458
  return;
@@ -16052,15 +16470,15 @@ let JupiterDynamicForm = class extends LitElement {
16052
16470
  }
16053
16471
  }
16054
16472
  if (!targetFieldEl) {
16055
- const allSectionEls = ((_h = this.shadowRoot) == null ? void 0 : _h.querySelectorAll("jupiter-form-section")) ?? [];
16473
+ const allSectionEls = ((_k = this.shadowRoot) == null ? void 0 : _k.querySelectorAll("jupiter-form-section")) ?? [];
16056
16474
  for (const secEl of Array.from(allSectionEls)) {
16057
16475
  if (targetFieldEl)
16058
16476
  break;
16059
- const cts = ((_i = secEl.shadowRoot) == null ? void 0 : _i.querySelectorAll("jupiter-concept-tree")) ?? [];
16477
+ const cts = ((_l = secEl.shadowRoot) == null ? void 0 : _l.querySelectorAll("jupiter-concept-tree")) ?? [];
16060
16478
  for (const ct of Array.from(cts)) {
16061
16479
  if (targetFieldEl)
16062
16480
  break;
16063
- const fields = ((_j = ct.shadowRoot) == null ? void 0 : _j.querySelectorAll("jupiter-form-field")) ?? [];
16481
+ const fields = ((_m = ct.shadowRoot) == null ? void 0 : _m.querySelectorAll("jupiter-form-field")) ?? [];
16064
16482
  fields.forEach((fieldEl) => {
16065
16483
  if (targetFieldEl)
16066
16484
  return;
@@ -16092,7 +16510,7 @@ let JupiterDynamicForm = class extends LitElement {
16092
16510
  } else {
16093
16511
  targetFieldEl.scrollIntoView({ behavior: "smooth", block: "center" });
16094
16512
  }
16095
- const tableContainer = (_k = targetSectionEl == null ? void 0 : targetSectionEl.shadowRoot) == null ? void 0 : _k.querySelector(".table-container");
16513
+ const tableContainer = (_n = targetSectionEl == null ? void 0 : targetSectionEl.shadowRoot) == null ? void 0 : _n.querySelector(".table-container");
16096
16514
  if (tableContainer && tableContainer.scrollWidth > tableContainer.clientWidth) {
16097
16515
  const tableRect = tableContainer.getBoundingClientRect();
16098
16516
  const targetScrollLeft = Math.max(
@@ -16105,7 +16523,7 @@ let JupiterDynamicForm = class extends LitElement {
16105
16523
  const rowHost = rootNode instanceof ShadowRoot ? rootNode.host : null;
16106
16524
  const highlightEl = rowHost ?? targetFieldEl;
16107
16525
  highlightEl.classList.add("concept-highlight");
16108
- const focusTarget = (_l = targetFieldEl.shadowRoot) == null ? void 0 : _l.querySelector(
16526
+ const focusTarget = (_o = targetFieldEl.shadowRoot) == null ? void 0 : _o.querySelector(
16109
16527
  'input:not([type="hidden"]), select, textarea, button, [tabindex]:not([tabindex="-1"])'
16110
16528
  );
16111
16529
  if (focusTarget) {
@@ -16248,6 +16666,20 @@ let JupiterDynamicForm = class extends LitElement {
16248
16666
  ></jupiter-formula-validation-dialog>
16249
16667
  ` : ""}
16250
16668
 
16669
+ <!-- Show filtered-out role? (JDF-086, from scrollToConcept) -->
16670
+ ${this._revealRolePrompt ? html`
16671
+ <jupiter-confirm-dialog
16672
+ open
16673
+ .heading="${I18n.t("scrollToConcept.revealRole.title")}"
16674
+ .message="${I18n.t("scrollToConcept.revealRole.message", { role: this._revealRolePrompt.section.title })}"
16675
+ .confirmLabel="${I18n.t("scrollToConcept.revealRole.confirm")}"
16676
+ .cancelLabel="${I18n.t("scrollToConcept.revealRole.cancel")}"
16677
+ @dialog-confirm="${() => this._settleRevealRolePrompt(true)}"
16678
+ @dialog-cancel="${() => this._settleRevealRolePrompt(false)}"
16679
+ @click="${() => this._settleRevealRolePrompt(false)}"
16680
+ ></jupiter-confirm-dialog>
16681
+ ` : ""}
16682
+
16251
16683
  <!-- Validation Error Popup -->
16252
16684
  ${this._showErrorPopup ? html`
16253
16685
  <div class="error-popup-overlay" @click="${() => {
@@ -17305,6 +17737,9 @@ __decorateClass([
17305
17737
  __decorateClass([
17306
17738
  r()
17307
17739
  ], JupiterDynamicForm.prototype, "_showFilterDialog", 2);
17740
+ __decorateClass([
17741
+ r()
17742
+ ], JupiterDynamicForm.prototype, "_revealRolePrompt", 2);
17308
17743
  __decorateClass([
17309
17744
  r()
17310
17745
  ], JupiterDynamicForm.prototype, "_showFactsOnly", 2);
@@ -17366,6 +17801,7 @@ export {
17366
17801
  JupiterAddColumnDialog,
17367
17802
  JupiterAdvancedFilter,
17368
17803
  JupiterConceptTree,
17804
+ JupiterConfirmDialog,
17369
17805
  JupiterDynamicForm,
17370
17806
  JupiterFilterRolesDialog,
17371
17807
  JupiterFormField,