jupiter-dynamic-forms 1.18.3 → 1.18.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/index.mjs CHANGED
@@ -4553,6 +4553,15 @@ JupiterFormField.styles = css`
4553
4553
  color: var(--jupiter-text-secondary, #999);
4554
4554
  font-style: italic;
4555
4555
  }
4556
+
4557
+ @keyframes concept-highlight-pulse {
4558
+ 0% { box-shadow: 0 0 0 3px #fbbf24; background-color: #fef9c3; }
4559
+ 60% { box-shadow: 0 0 0 3px #fbbf24; background-color: #fef9c3; }
4560
+ 100% { box-shadow: 0 0 0 0px transparent; background-color: transparent; }
4561
+ }
4562
+ :host(.concept-highlight) {
4563
+ animation: concept-highlight-pulse 1.5s ease-out forwards;
4564
+ }
4556
4565
  `;
4557
4566
  __decorateClass$6([
4558
4567
  n2({ type: Object })
@@ -12546,6 +12555,109 @@ let JupiterDynamicForm = class extends LitElement {
12546
12555
  getState() {
12547
12556
  return this._getFormState();
12548
12557
  }
12558
+ _findConceptByName(concepts, name) {
12559
+ var _a;
12560
+ for (const c2 of concepts) {
12561
+ if (c2.name === name)
12562
+ return c2;
12563
+ if ((_a = c2.children) == null ? void 0 : _a.length) {
12564
+ const hit = this._findConceptByName(c2.children, name);
12565
+ if (hit)
12566
+ return hit;
12567
+ }
12568
+ }
12569
+ return null;
12570
+ }
12571
+ _findColumnByDimensions(columns, dims) {
12572
+ var _a;
12573
+ return (_a = columns.find((col) => {
12574
+ if (col.type !== "dimension" || !col.dimensionData)
12575
+ return false;
12576
+ const combos = col.dimensionData.combinations;
12577
+ if (combos == null ? void 0 : combos.length) {
12578
+ return dims.every(
12579
+ (d2) => combos.some(
12580
+ (c2) => this._normalizeAxisId(c2.axisId) === this._normalizeAxisId(d2.axis) && this._normalizeMemberId(c2.memberId) === this._normalizeMemberId(d2.member)
12581
+ )
12582
+ );
12583
+ }
12584
+ 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
+ })) == null ? void 0 : _a.id;
12586
+ }
12587
+ async scrollToConcept(conceptName, dimensions) {
12588
+ var _a, _b, _c, _d;
12589
+ let targetSection = null;
12590
+ let targetConcept = null;
12591
+ const sectionsToSearch = [
12592
+ ...((_a = this._currentSchema) == null ? void 0 : _a.sections) ?? [],
12593
+ ...this._allSections.filter((s2) => {
12594
+ var _a2;
12595
+ return !((_a2 = this._currentSchema) == null ? void 0 : _a2.sections.find((cs) => cs.id === s2.id));
12596
+ })
12597
+ ];
12598
+ for (const section2 of sectionsToSearch) {
12599
+ const found = this._findConceptByName(section2.concepts, conceptName);
12600
+ if (found) {
12601
+ targetSection = section2;
12602
+ targetConcept = found;
12603
+ break;
12604
+ }
12605
+ }
12606
+ if (!targetSection || !targetConcept) {
12607
+ console.warn(`[scrollToConcept] Concept not found: ${conceptName}`);
12608
+ return;
12609
+ }
12610
+ targetSection.expanded = true;
12611
+ if (this.display === "sidePanel" && this._activeSidePanelRoleId !== targetSection.id) {
12612
+ this._activeSidePanelRoleId = targetSection.id;
12613
+ }
12614
+ const columns = targetSection.columns ?? this._columns;
12615
+ let targetColumnId = null;
12616
+ if (dimensions == null ? void 0 : dimensions.length) {
12617
+ targetColumnId = this._findColumnByDimensions(columns, dimensions) ?? null;
12618
+ }
12619
+ if (!targetColumnId) {
12620
+ targetColumnId = ((_b = columns[0]) == null ? void 0 : _b.id) ?? null;
12621
+ }
12622
+ this.requestUpdate();
12623
+ await this.updateComplete;
12624
+ await new Promise((resolve) => setTimeout(resolve, 300));
12625
+ const sectionElements = (_c = this.shadowRoot) == null ? void 0 : _c.querySelectorAll("jupiter-form-section");
12626
+ let targetSectionEl = null;
12627
+ sectionElements == null ? void 0 : sectionElements.forEach((el) => {
12628
+ var _a2;
12629
+ if (((_a2 = el.section) == null ? void 0 : _a2.id) === targetSection.id)
12630
+ targetSectionEl = el;
12631
+ });
12632
+ if (!targetSectionEl) {
12633
+ console.warn(`[scrollToConcept] Section element not found: ${targetSection.id}`);
12634
+ return;
12635
+ }
12636
+ await targetSectionEl.updateComplete;
12637
+ const conceptTrees = (_d = targetSectionEl.shadowRoot) == null ? void 0 : _d.querySelectorAll("jupiter-concept-tree");
12638
+ let targetFieldEl = null;
12639
+ const conceptId = targetConcept.id;
12640
+ conceptTrees == null ? void 0 : conceptTrees.forEach((ct) => {
12641
+ var _a2;
12642
+ if (targetFieldEl)
12643
+ return;
12644
+ const fields = (_a2 = ct.shadowRoot) == null ? void 0 : _a2.querySelectorAll("jupiter-form-field");
12645
+ fields == null ? void 0 : fields.forEach((fieldEl) => {
12646
+ if (targetFieldEl)
12647
+ return;
12648
+ const columnMatch = targetColumnId ? fieldEl.conceptId === conceptId && fieldEl.columnId === targetColumnId : fieldEl.conceptId === conceptId;
12649
+ if (columnMatch)
12650
+ targetFieldEl = fieldEl;
12651
+ });
12652
+ });
12653
+ if (!targetFieldEl) {
12654
+ console.warn(`[scrollToConcept] Field element not found for concept: ${conceptName}`);
12655
+ return;
12656
+ }
12657
+ targetFieldEl.scrollIntoView({ behavior: "smooth", block: "center" });
12658
+ targetFieldEl.classList.add("concept-highlight");
12659
+ setTimeout(() => targetFieldEl.classList.remove("concept-highlight"), 1500);
12660
+ }
12549
12661
  render() {
12550
12662
  var _a;
12551
12663
  const errorCount = this._errors.filter((e2) => e2.severity === "error").length;