@melodicdev/components 1.6.8 → 1.6.10

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.
@@ -14304,6 +14304,11 @@ function renderCell(col, row, index) {
14304
14304
  const val = row[col.key];
14305
14305
  return val == null ? "" : val;
14306
14306
  }
14307
+ function pinStyle(c, col) {
14308
+ if (col.pinned === "left") return `left: ${c.getPinnedLeftOffset(col.key)}px`;
14309
+ if (col.pinned === "right") return `right: ${c.getPinnedRightOffset(col.key)}px`;
14310
+ return "";
14311
+ }
14307
14312
  function dataGridTemplate(c) {
14308
14313
  const gtc = c.gridTemplateColumns;
14309
14314
  const totalW = c.totalGridWidth;
@@ -14353,11 +14358,13 @@ function dataGridTemplate(c) {
14353
14358
  "ml-data-grid__th--sorted": c.sortKey === col.key,
14354
14359
  "ml-data-grid__th--pinned-left": col.pinned === "left",
14355
14360
  "ml-data-grid__th--pinned-right": col.pinned === "right",
14361
+ "ml-data-grid__th--pinned-left-edge": col.key === c.lastLeftPinnedKey,
14362
+ "ml-data-grid__th--pinned-right-edge": col.key === c.firstRightPinnedKey,
14356
14363
  "ml-data-grid__th--drag-over": c.dragOverKey === col.key,
14357
14364
  "ml-data-grid__th--dragging": c.draggingKey === col.key,
14358
14365
  "ml-data-grid__th--resizing": c.resizingKey === col.key
14359
14366
  })}
14360
- style=${col.pinned === "left" ? `left: ${c.getPinnedLeftOffset(col.key)}px` : ""}
14367
+ style=${pinStyle(c, col)}
14361
14368
  draggable=${col.reorderable !== false ? "true" : "false"}
14362
14369
  @dragstart=${(e) => c.handleDragStart(col.key, e)}
14363
14370
  @dragover=${(e) => c.handleDragOver(col.key, e)}
@@ -14396,9 +14403,10 @@ function dataGridTemplate(c) {
14396
14403
  <div
14397
14404
  class=${classMap({
14398
14405
  "ml-data-grid__filter-cell": true,
14399
- "ml-data-grid__filter-cell--pinned-left": col.pinned === "left"
14406
+ "ml-data-grid__filter-cell--pinned-left": col.pinned === "left",
14407
+ "ml-data-grid__filter-cell--pinned-right": col.pinned === "right"
14400
14408
  })}
14401
- style=${col.pinned === "left" ? `left: ${c.getPinnedLeftOffset(col.key)}px` : ""}
14409
+ style=${pinStyle(c, col)}
14402
14410
  >
14403
14411
  ${when(!!col.filterable, () => html`
14404
14412
  <input
@@ -14448,9 +14456,11 @@ function dataGridTemplate(c) {
14448
14456
  "ml-data-grid__td": true,
14449
14457
  [`ml-data-grid__td--${col.align ?? "left"}`]: true,
14450
14458
  "ml-data-grid__td--pinned-left": col.pinned === "left",
14451
- "ml-data-grid__td--pinned-right": col.pinned === "right"
14459
+ "ml-data-grid__td--pinned-right": col.pinned === "right",
14460
+ "ml-data-grid__td--pinned-left-edge": col.key === c.lastLeftPinnedKey,
14461
+ "ml-data-grid__td--pinned-right-edge": col.key === c.firstRightPinnedKey
14452
14462
  })}
14453
- style=${col.pinned === "left" ? `left: ${c.getPinnedLeftOffset(col.key)}px` : ""}
14463
+ style=${pinStyle(c, col)}
14454
14464
  >
14455
14465
  ${renderCell(col, row, c.startIndex + i)}
14456
14466
  </div>
@@ -14767,7 +14777,8 @@ const dataGridStyles = () => css`
14767
14777
  position: relative;
14768
14778
  }
14769
14779
 
14770
- .ml-data-grid__filter-cell--pinned-left {
14780
+ .ml-data-grid__filter-cell--pinned-left,
14781
+ .ml-data-grid__filter-cell--pinned-right {
14771
14782
  position: sticky;
14772
14783
  z-index: 3;
14773
14784
  background: var(--ml-data-grid-bg);
@@ -14902,9 +14913,9 @@ const dataGridStyles = () => css`
14902
14913
  background: var(--ml-data-grid-header-bg);
14903
14914
  }
14904
14915
 
14905
- /* Pinned left shadow */
14906
- .ml-data-grid__th--pinned-left::after,
14907
- .ml-data-grid__td--pinned-left::after {
14916
+ /* Pinned left shadow — renders only on the rightmost (boundary) left-pinned cell */
14917
+ .ml-data-grid__th--pinned-left-edge::after,
14918
+ .ml-data-grid__td--pinned-left-edge::after {
14908
14919
  content: '';
14909
14920
  position: absolute;
14910
14921
  top: 0;
@@ -14918,7 +14929,6 @@ const dataGridStyles = () => css`
14918
14929
  .ml-data-grid__th--pinned-right,
14919
14930
  .ml-data-grid__td--pinned-right {
14920
14931
  position: sticky;
14921
- right: 0;
14922
14932
  z-index: 1;
14923
14933
  background: var(--ml-data-grid-bg);
14924
14934
  }
@@ -14928,9 +14938,9 @@ const dataGridStyles = () => css`
14928
14938
  background: var(--ml-data-grid-header-bg);
14929
14939
  }
14930
14940
 
14931
- /* Pinned right shadow */
14932
- .ml-data-grid__th--pinned-right::before,
14933
- .ml-data-grid__td--pinned-right::before {
14941
+ /* Pinned right shadow — renders only on the leftmost (boundary) right-pinned cell */
14942
+ .ml-data-grid__th--pinned-right-edge::before,
14943
+ .ml-data-grid__td--pinned-right-edge::before {
14934
14944
  content: '';
14935
14945
  position: absolute;
14936
14946
  top: 0;
@@ -15331,6 +15341,24 @@ var DataGridComponent = class DataGridComponent$1 {
15331
15341
  }
15332
15342
  return 0;
15333
15343
  }
15344
+ getPinnedRightOffset(key) {
15345
+ let offset$1 = 0;
15346
+ for (let i = this.orderedColumns.length - 1; i >= 0; i--) {
15347
+ const col = this.orderedColumns[i];
15348
+ if (col.key === key) return offset$1;
15349
+ if (col.pinned === "right") offset$1 += this.columnWidths[col.key] ?? 150;
15350
+ }
15351
+ return 0;
15352
+ }
15353
+ get lastLeftPinnedKey() {
15354
+ let key = null;
15355
+ for (const col of this.orderedColumns) if (col.pinned === "left") key = col.key;
15356
+ return key;
15357
+ }
15358
+ get firstRightPinnedKey() {
15359
+ for (const col of this.orderedColumns) if (col.pinned === "right") return col.key;
15360
+ return null;
15361
+ }
15334
15362
  get topSpacerHeight() {
15335
15363
  return this.virtual ? this.startIndex * this.rowHeight : 0;
15336
15364
  }
@@ -22601,7 +22629,7 @@ const dialogStyles = () => css`
22601
22629
  /* Dialog base */
22602
22630
  dialog.ml-dialog {
22603
22631
  position: fixed;
22604
- display: flex;
22632
+ display: none;
22605
22633
  flex-direction: column;
22606
22634
  width: 100%;
22607
22635
  max-width: var(--ml-dialog-max-width);
@@ -22624,6 +22652,7 @@ const dialogStyles = () => css`
22624
22652
  }
22625
22653
 
22626
22654
  dialog.ml-dialog[open] {
22655
+ display: flex;
22627
22656
  transform: scale(1) translateY(0);
22628
22657
  opacity: 1;
22629
22658
  }