jupiter-dynamic-forms 1.18.4 → 1.18.5

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
@@ -4560,7 +4560,7 @@ JupiterFormField.styles = css`
4560
4560
  100% { box-shadow: 0 0 0 0px transparent; background-color: transparent; }
4561
4561
  }
4562
4562
  :host(.concept-highlight) {
4563
- animation: concept-highlight-pulse 1.5s ease-out forwards;
4563
+ animation: concept-highlight-pulse 5s ease-out forwards;
4564
4564
  }
4565
4565
  `;
4566
4566
  __decorateClass$6([
@@ -12557,9 +12557,13 @@ let JupiterDynamicForm = class extends LitElement {
12557
12557
  }
12558
12558
  _findConceptByName(concepts, name) {
12559
12559
  var _a;
12560
+ const localName = name.includes(":") ? name.split(":").pop() : name;
12560
12561
  for (const c2 of concepts) {
12561
12562
  if (c2.name === name)
12562
12563
  return c2;
12564
+ const cLocal = c2.name.includes(":") ? c2.name.split(":").pop() : c2.name;
12565
+ if (cLocal === localName)
12566
+ return c2;
12563
12567
  if ((_a = c2.children) == null ? void 0 : _a.length) {
12564
12568
  const hit = this._findConceptByName(c2.children, name);
12565
12569
  if (hit)
@@ -12584,8 +12588,8 @@ let JupiterDynamicForm = class extends LitElement {
12584
12588
  return dims.length === 1 && this._normalizeAxisId(col.dimensionData.axisId ?? "") === this._normalizeAxisId(dims[0].axis) && this._normalizeMemberId(col.dimensionData.memberId ?? "") === this._normalizeMemberId(dims[0].member);
12585
12589
  })) == null ? void 0 : _a.id;
12586
12590
  }
12587
- async scrollToConcept(conceptName, dimensions) {
12588
- var _a, _b, _c, _d;
12591
+ async scrollToConcept(conceptName, dimensions, match) {
12592
+ var _a, _b, _c, _d, _e, _f;
12589
12593
  let targetSection = null;
12590
12594
  let targetConcept = null;
12591
12595
  const sectionsToSearch = [
@@ -12613,10 +12617,11 @@ let JupiterDynamicForm = class extends LitElement {
12613
12617
  }
12614
12618
  const columns = targetSection.columns ?? this._columns;
12615
12619
  let targetColumnId = null;
12620
+ const hasValueMatch = (match == null ? void 0 : match.value) !== void 0 && (match == null ? void 0 : match.value) !== null;
12621
+ const targetValue = hasValueMatch ? String(match.value) : null;
12616
12622
  if (dimensions == null ? void 0 : dimensions.length) {
12617
12623
  targetColumnId = this._findColumnByDimensions(columns, dimensions) ?? null;
12618
- }
12619
- if (!targetColumnId) {
12624
+ } else if (!hasValueMatch) {
12620
12625
  targetColumnId = ((_b = columns[0]) == null ? void 0 : _b.id) ?? null;
12621
12626
  }
12622
12627
  this.requestUpdate();
@@ -12646,17 +12651,36 @@ let JupiterDynamicForm = class extends LitElement {
12646
12651
  if (targetFieldEl)
12647
12652
  return;
12648
12653
  const columnMatch = targetColumnId ? fieldEl.conceptId === conceptId && fieldEl.columnId === targetColumnId : fieldEl.conceptId === conceptId;
12649
- if (columnMatch)
12654
+ const valueMatch = !hasValueMatch || String(fieldEl.value ?? "") === targetValue;
12655
+ if (columnMatch && valueMatch)
12650
12656
  targetFieldEl = fieldEl;
12651
12657
  });
12652
12658
  });
12659
+ if (!targetFieldEl && hasValueMatch && !targetColumnId) {
12660
+ for (const ct of Array.from(conceptTrees ?? [])) {
12661
+ if (targetFieldEl)
12662
+ break;
12663
+ const fields = (_e = ct.shadowRoot) == null ? void 0 : _e.querySelectorAll("jupiter-form-field");
12664
+ fields == null ? void 0 : fields.forEach((fieldEl) => {
12665
+ if (targetFieldEl)
12666
+ return;
12667
+ const columnMatch = targetColumnId ? fieldEl.conceptId === conceptId && fieldEl.columnId === targetColumnId : fieldEl.conceptId === conceptId;
12668
+ if (columnMatch)
12669
+ targetFieldEl = fieldEl;
12670
+ });
12671
+ }
12672
+ }
12653
12673
  if (!targetFieldEl) {
12654
12674
  console.warn(`[scrollToConcept] Field element not found for concept: ${conceptName}`);
12655
12675
  return;
12656
12676
  }
12657
12677
  targetFieldEl.scrollIntoView({ behavior: "smooth", block: "center" });
12658
12678
  targetFieldEl.classList.add("concept-highlight");
12659
- setTimeout(() => targetFieldEl.classList.remove("concept-highlight"), 1500);
12679
+ const focusTarget = (_f = targetFieldEl.shadowRoot) == null ? void 0 : _f.querySelector(
12680
+ 'input:not([type="hidden"]), select, textarea, button, [tabindex]:not([tabindex="-1"])'
12681
+ );
12682
+ focusTarget == null ? void 0 : focusTarget.focus({ preventScroll: true });
12683
+ setTimeout(() => targetFieldEl.classList.remove("concept-highlight"), 5e3);
12660
12684
  }
12661
12685
  render() {
12662
12686
  var _a;