jupiter-dynamic-forms 1.19.3 → 1.19.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
@@ -4641,7 +4641,7 @@ JupiterFormField.styles = css`
4641
4641
  100% { box-shadow: 0 0 0 0px transparent; background-color: transparent; }
4642
4642
  }
4643
4643
  :host(.concept-highlight) {
4644
- animation: concept-highlight-pulse 5s ease-out forwards;
4644
+ animation: concept-highlight-pulse 10s ease-out forwards;
4645
4645
  }
4646
4646
  `;
4647
4647
  __decorateClass$6([
@@ -4757,6 +4757,7 @@ let JupiterConceptTree = class extends LitElement {
4757
4757
  this.showAddButton = false;
4758
4758
  this.showRemoveButton = false;
4759
4759
  this.language = "en";
4760
+ this.rowFocused = false;
4760
4761
  this._expanded = true;
4761
4762
  }
4762
4763
  connectedCallback() {
@@ -4934,7 +4935,7 @@ let JupiterConceptTree = class extends LitElement {
4934
4935
  const isAbstract = this.concept.abstract || false;
4935
4936
  return html`
4936
4937
  <!-- Concept Name Cell (Left Column) -->
4937
- <td class="concept-name-cell ${isAbstract ? "abstract" : hasChildren ? "" : "leaf"}">
4938
+ <td class="concept-name-cell ${isAbstract ? "abstract" : hasChildren ? "" : "leaf"} ${this.rowFocused ? "row-focused" : ""}">
4938
4939
  <div class="concept-content" style="--level: ${level}">
4939
4940
  <div class="concept-indent"></div>
4940
4941
  <div class="concept-toggle ${hasChildren ? this._expanded ? "expanded" : "" : "no-children"}"
@@ -4970,7 +4971,7 @@ let JupiterConceptTree = class extends LitElement {
4970
4971
  const storedUnit = (_b = (_a = this.unitData) == null ? void 0 : _a[this.concept.id]) == null ? void 0 : _b[column2.id];
4971
4972
  const storedDecimals = (_d = (_c = this.decimalsData) == null ? void 0 : _c[this.concept.id]) == null ? void 0 : _d[column2.id];
4972
4973
  return html`
4973
- <td class="field-cell ${!shouldShowField ? "empty" : ""} ${isAbstract ? "abstract-row" : ""} ${this.highlightType && column2.id === this.highlightColumnId ? "highlight-" + this.highlightType : ""} ${((_e = this.calculationErrorKeys) == null ? void 0 : _e.has(`${this.concept.id}__${column2.id}`)) ? "calc-error" : ""}">
4974
+ <td class="field-cell ${!shouldShowField ? "empty" : ""} ${isAbstract ? "abstract-row" : ""} ${this.highlightType && column2.id === this.highlightColumnId ? "highlight-" + this.highlightType : ""} ${((_e = this.calculationErrorKeys) == null ? void 0 : _e.has(`${this.concept.id}__${column2.id}`)) ? "calc-error" : ""} ${this.rowFocused ? "row-focused" : ""}">
4974
4975
  ${shouldShowField ? html`
4975
4976
  <jupiter-form-field
4976
4977
  .field="${field2}"
@@ -5176,6 +5177,18 @@ JupiterConceptTree.styles = css`
5176
5177
  box-shadow: inset 0 0 0 2px var(--jupiter-error-color, #d32f2f);
5177
5178
  }
5178
5179
 
5180
+ /* Row-level highlight while a field in this row has focus. Applied to every
5181
+ cell so the row stays identifiable even after the user scrolls the table
5182
+ horizontally away from the focused input. */
5183
+ .concept-name-cell.row-focused,
5184
+ .field-cell.row-focused {
5185
+ background: var(--jupiter-row-focus-background, rgba(25, 118, 210, 0.14));
5186
+ }
5187
+
5188
+ .concept-name-cell.row-focused {
5189
+ box-shadow: inset 3px 0 0 0 var(--jupiter-primary-color, #1976d2);
5190
+ }
5191
+
5179
5192
  .concept-info-btn {
5180
5193
  flex-shrink: 0;
5181
5194
  width: 22px;
@@ -5219,6 +5232,16 @@ JupiterConceptTree.styles = css`
5219
5232
  opacity: 1;
5220
5233
  }
5221
5234
 
5235
+ @keyframes concept-row-highlight-pulse {
5236
+ 0% { background-color: #fef9c3; box-shadow: inset 0 3px 0 -1px #fbbf24, inset 0 -3px 0 -1px #fbbf24; }
5237
+ 60% { background-color: #fef9c3; box-shadow: inset 0 3px 0 -1px #fbbf24, inset 0 -3px 0 -1px #fbbf24; }
5238
+ 100% { background-color: transparent; box-shadow: none; }
5239
+ }
5240
+ :host(.concept-highlight) .concept-name-cell,
5241
+ :host(.concept-highlight) .field-cell {
5242
+ animation: concept-row-highlight-pulse 10s ease-out forwards;
5243
+ }
5244
+
5222
5245
  `;
5223
5246
  __decorateClass$5([
5224
5247
  n2({ type: Object })
@@ -5286,6 +5309,9 @@ __decorateClass$5([
5286
5309
  __decorateClass$5([
5287
5310
  n2({ type: String })
5288
5311
  ], JupiterConceptTree.prototype, "language", 2);
5312
+ __decorateClass$5([
5313
+ n2({ type: Boolean })
5314
+ ], JupiterConceptTree.prototype, "rowFocused", 2);
5289
5315
  __decorateClass$5([
5290
5316
  r()
5291
5317
  ], JupiterConceptTree.prototype, "_expanded", 2);
@@ -5983,10 +6009,12 @@ let JupiterFormSection = class extends LitElement {
5983
6009
  this._insertAfterColumnId = null;
5984
6010
  this._boundFieldBlur = (e2) => {
5985
6011
  this._clearHighlights();
6012
+ this._focusedConceptId = null;
5986
6013
  };
5987
6014
  this._expandedConcepts = /* @__PURE__ */ new Set();
5988
6015
  this._allTreeExpanded = false;
5989
6016
  this._highlightMap = /* @__PURE__ */ new Map();
6017
+ this._focusedConceptId = null;
5990
6018
  this._calculationErrorKeys = /* @__PURE__ */ new Set();
5991
6019
  this._totalChildrenMap = /* @__PURE__ */ new Map();
5992
6020
  this._memberParentMap = /* @__PURE__ */ new Map();
@@ -6326,6 +6354,7 @@ let JupiterFormSection = class extends LitElement {
6326
6354
  const columnId = (_b = event.detail) == null ? void 0 : _b.columnId;
6327
6355
  if (!conceptId || !columnId)
6328
6356
  return;
6357
+ this._focusedConceptId = conceptId;
6329
6358
  const newMap = /* @__PURE__ */ new Map();
6330
6359
  const isSelfTotal = this._totalChildrenMap.has(conceptId);
6331
6360
  if (isSelfTotal) {
@@ -6413,6 +6442,7 @@ let JupiterFormSection = class extends LitElement {
6413
6442
  .showRemoveButton="${opts.showRemove || false}"
6414
6443
  .highlightType="${(_a2 = this._highlightMap.get(instanceConcept.id)) == null ? void 0 : _a2.type}"
6415
6444
  .highlightColumnId="${(_b = this._highlightMap.get(instanceConcept.id)) == null ? void 0 : _b.columnId}"
6445
+ .rowFocused="${this._focusedConceptId === instanceConcept.id}"
6416
6446
  .calculationErrorKeys="${this._calculationErrorKeys}"
6417
6447
  @field-change="${this._handleFieldChange}"
6418
6448
  @field-focus="${this._handleFieldFocusForHighlight}"
@@ -6950,6 +6980,9 @@ __decorateClass$3([
6950
6980
  __decorateClass$3([
6951
6981
  r()
6952
6982
  ], JupiterFormSection.prototype, "_highlightMap", 2);
6983
+ __decorateClass$3([
6984
+ r()
6985
+ ], JupiterFormSection.prototype, "_focusedConceptId", 2);
6953
6986
  __decorateClass$3([
6954
6987
  r()
6955
6988
  ], JupiterFormSection.prototype, "_calculationErrorKeys", 2);
@@ -12840,6 +12873,7 @@ let JupiterDynamicForm = class extends LitElement {
12840
12873
  targetColumnId = ((_b = columns[0]) == null ? void 0 : _b.id) ?? null;
12841
12874
  }
12842
12875
  console.log(`[scrollToConcept] targetColumnId=${targetColumnId} hasValueMatch=${hasValueMatch} targetValue=${targetValue}`);
12876
+ this._conceptSearchText = conceptName.includes(":") ? conceptName.split(":").pop() : conceptName;
12843
12877
  this.requestUpdate();
12844
12878
  await this.updateComplete;
12845
12879
  await new Promise((resolve) => setTimeout(resolve, 300));
@@ -12983,14 +13017,17 @@ let JupiterDynamicForm = class extends LitElement {
12983
13017
  );
12984
13018
  tableContainer.scrollTo({ left: targetScrollLeft, behavior: "smooth" });
12985
13019
  }
12986
- targetFieldEl.classList.add("concept-highlight");
13020
+ const rootNode = targetFieldEl.getRootNode();
13021
+ const rowHost = rootNode instanceof ShadowRoot ? rootNode.host : null;
13022
+ const highlightEl = rowHost ?? targetFieldEl;
13023
+ highlightEl.classList.add("concept-highlight");
12987
13024
  const focusTarget = (_l = targetFieldEl.shadowRoot) == null ? void 0 : _l.querySelector(
12988
13025
  'input:not([type="hidden"]), select, textarea, button, [tabindex]:not([tabindex="-1"])'
12989
13026
  );
12990
13027
  if (focusTarget) {
12991
13028
  setTimeout(() => focusTarget.focus({ preventScroll: true }), 450);
12992
13029
  }
12993
- setTimeout(() => targetFieldEl.classList.remove("concept-highlight"), 5e3);
13030
+ setTimeout(() => highlightEl.classList.remove("concept-highlight"), 1e4);
12994
13031
  }
12995
13032
  render() {
12996
13033
  var _a;