apex-grid 3.5.0 → 3.6.0

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.
Files changed (197) hide show
  1. package/CHANGELOG.md +338 -0
  2. package/LICENSE.md +125 -0
  3. package/README.md +64 -10
  4. package/components/cell.d.ts +30 -4
  5. package/components/cell.js +199 -53
  6. package/components/cell.js.map +1 -1
  7. package/components/filter-row.d.ts +2 -0
  8. package/components/filter-row.js +82 -28
  9. package/components/filter-row.js.map +1 -1
  10. package/components/grid.d.ts +146 -36
  11. package/components/grid.js +442 -103
  12. package/components/grid.js.map +1 -1
  13. package/components/group-header-row.js +28 -25
  14. package/components/group-header-row.js.map +1 -1
  15. package/components/header-row.d.ts +7 -5
  16. package/components/header-row.js +11 -9
  17. package/components/header-row.js.map +1 -1
  18. package/components/header.js +32 -20
  19. package/components/header.js.map +1 -1
  20. package/components/row.d.ts +19 -3
  21. package/components/row.js +69 -23
  22. package/components/row.js.map +1 -1
  23. package/components/toolbar.js +2 -1
  24. package/components/toolbar.js.map +1 -1
  25. package/components/virtualizer.d.ts +40 -0
  26. package/components/virtualizer.js +116 -5
  27. package/components/virtualizer.js.map +1 -1
  28. package/controllers/dom.d.ts +4 -4
  29. package/controllers/dom.js +40 -22
  30. package/controllers/dom.js.map +1 -1
  31. package/controllers/editing.d.ts +104 -37
  32. package/controllers/editing.js +230 -78
  33. package/controllers/editing.js.map +1 -1
  34. package/controllers/expansion.d.ts +14 -5
  35. package/controllers/expansion.js +24 -1
  36. package/controllers/expansion.js.map +1 -1
  37. package/controllers/filter.d.ts +10 -2
  38. package/controllers/filter.js +62 -17
  39. package/controllers/filter.js.map +1 -1
  40. package/controllers/history.d.ts +45 -8
  41. package/controllers/history.js +58 -20
  42. package/controllers/history.js.map +1 -1
  43. package/controllers/navigation.d.ts +67 -13
  44. package/controllers/navigation.js +191 -51
  45. package/controllers/navigation.js.map +1 -1
  46. package/controllers/pagination.d.ts +6 -0
  47. package/controllers/pagination.js +10 -2
  48. package/controllers/pagination.js.map +1 -1
  49. package/controllers/reorder.js +38 -22
  50. package/controllers/reorder.js.map +1 -1
  51. package/controllers/resize.d.ts +17 -2
  52. package/controllers/resize.js +16 -6
  53. package/controllers/resize.js.map +1 -1
  54. package/controllers/row-pin.d.ts +20 -2
  55. package/controllers/row-pin.js +16 -9
  56. package/controllers/row-pin.js.map +1 -1
  57. package/controllers/row-reorder.d.ts +31 -11
  58. package/controllers/row-reorder.js +117 -37
  59. package/controllers/row-reorder.js.map +1 -1
  60. package/controllers/selection.d.ts +11 -4
  61. package/controllers/selection.js +26 -11
  62. package/controllers/selection.js.map +1 -1
  63. package/controllers/sort.d.ts +22 -2
  64. package/controllers/sort.js +29 -23
  65. package/controllers/sort.js.map +1 -1
  66. package/controllers/state.d.ts +56 -7
  67. package/controllers/state.js +76 -6
  68. package/controllers/state.js.map +1 -1
  69. package/controllers/tree.d.ts +15 -10
  70. package/controllers/tree.js +0 -0
  71. package/controllers/tree.js.map +1 -1
  72. package/custom-elements.json +3156 -277
  73. package/docs/assets/hierarchy.js +1 -1
  74. package/docs/assets/highlight.css +15 -8
  75. package/docs/assets/navigation.js +1 -1
  76. package/docs/assets/search.js +1 -1
  77. package/docs/classes/ApexGrid.html +155 -81
  78. package/docs/classes/ApexGridPaginator.html +1 -1
  79. package/docs/classes/ApexGridToolbar.html +3 -3
  80. package/docs/functions/localize.html +2 -2
  81. package/docs/hierarchy.html +1 -1
  82. package/docs/index.html +74 -11
  83. package/docs/interfaces/ApexCellValidationFailedEvent.html +3 -2
  84. package/docs/interfaces/ApexCellValueChangedEvent.html +4 -2
  85. package/docs/interfaces/ApexCellValueChangingEvent.html +3 -2
  86. package/docs/interfaces/ApexGridEventMap.html +5 -2
  87. package/docs/interfaces/ApexRowEditEndedEvent.html +2 -1
  88. package/docs/interfaces/ApexRowEditStartedEvent.html +2 -1
  89. package/docs/interfaces/ApexRowMovingEvent.html +9 -3
  90. package/docs/interfaces/ApexRowPinningEvent.html +1 -1
  91. package/docs/interfaces/ApexTreeRowExpandedEvent.html +4 -1
  92. package/docs/interfaces/ApexTreeRowExpandingEvent.html +4 -1
  93. package/docs/interfaces/BaseApexCellContext.html +1 -1
  94. package/docs/interfaces/BaseApexEditorContext.html +1 -1
  95. package/docs/interfaces/BaseFilterExpression.html +2 -2
  96. package/docs/interfaces/CSVExportOptions.html +12 -4
  97. package/docs/interfaces/DataPipelineConfiguration.html +1 -1
  98. package/docs/interfaces/ExportOptions.html +5 -3
  99. package/docs/interfaces/GridExpansionConfiguration.html +6 -2
  100. package/docs/interfaces/GridRowReorderingConfiguration.html +1 -1
  101. package/docs/interfaces/PaginationState.html +1 -1
  102. package/docs/interfaces/SetStateResult.html +3 -2
  103. package/docs/interfaces/ValidatorContext.html +7 -2
  104. package/docs/media/_token-values.scss +118 -0
  105. package/docs/media/package.json +3 -2
  106. package/docs/modules.html +1 -1
  107. package/docs/types/ExportSource.html +6 -4
  108. package/docs/types/OperandKeys.html +9 -0
  109. package/docs/variables/EN_LOCALE.html +2 -2
  110. package/i18n/en.d.ts +5 -0
  111. package/i18n/en.js +5 -0
  112. package/i18n/en.js.map +1 -1
  113. package/i18n/es.js +5 -0
  114. package/i18n/es.js.map +1 -1
  115. package/internal/column-types.d.ts +27 -1
  116. package/internal/column-types.js +75 -49
  117. package/internal/column-types.js.map +1 -1
  118. package/internal/constants.d.ts +1 -2
  119. package/internal/constants.js +0 -4
  120. package/internal/constants.js.map +1 -1
  121. package/internal/document-styles.d.ts +30 -0
  122. package/internal/document-styles.js +48 -0
  123. package/internal/document-styles.js.map +1 -0
  124. package/internal/export.d.ts +39 -7
  125. package/internal/export.js +35 -34
  126. package/internal/export.js.map +1 -1
  127. package/internal/feature-module.d.ts +60 -3
  128. package/internal/feature-module.js +6 -0
  129. package/internal/feature-module.js.map +1 -1
  130. package/internal/index.d.ts +6 -4
  131. package/internal/index.js +5 -3
  132. package/internal/index.js.map +1 -1
  133. package/internal/normalize-case.d.ts +8 -1
  134. package/internal/normalize-case.js +3 -2
  135. package/internal/normalize-case.js.map +1 -1
  136. package/internal/state-snapshot.d.ts +60 -8
  137. package/internal/state-snapshot.js +87 -19
  138. package/internal/state-snapshot.js.map +1 -1
  139. package/internal/types.d.ts +17 -2
  140. package/internal/types.js.map +1 -1
  141. package/internal/utils.d.ts +34 -6
  142. package/internal/utils.js +30 -21
  143. package/internal/utils.js.map +1 -1
  144. package/internal/validators.js +1 -0
  145. package/internal/validators.js.map +1 -1
  146. package/operations/filter/operands/number.js +9 -6
  147. package/operations/filter/operands/number.js.map +1 -1
  148. package/operations/filter/operands/string.js +2 -3
  149. package/operations/filter/operands/string.js.map +1 -1
  150. package/operations/filter/types.d.ts +13 -1
  151. package/operations/filter/types.js.map +1 -1
  152. package/operations/filter.d.ts +6 -0
  153. package/operations/filter.js +23 -7
  154. package/operations/filter.js.map +1 -1
  155. package/operations/quick-filter.js +2 -5
  156. package/operations/quick-filter.js.map +1 -1
  157. package/operations/sort.d.ts +21 -2
  158. package/operations/sort.js +41 -14
  159. package/operations/sort.js.map +1 -1
  160. package/package.json +8 -3
  161. package/setup.d.ts +11 -0
  162. package/setup.js +9 -19
  163. package/setup.js.map +1 -1
  164. package/styles/_token-values.css.d.ts +1 -0
  165. package/styles/_token-values.css.js +3 -0
  166. package/styles/_token-values.css.js.map +1 -0
  167. package/styles/_tokens.css.js +1 -1
  168. package/styles/_tokens.css.js.map +1 -1
  169. package/styles/body-cell/body-cell.css.js +1 -1
  170. package/styles/body-cell/body-cell.css.js.map +1 -1
  171. package/styles/body-cell/cell-renderers.css.js +1 -1
  172. package/styles/body-cell/cell-renderers.css.js.map +1 -1
  173. package/styles/body-row/body-row.css.js +1 -1
  174. package/styles/body-row/body-row.css.js.map +1 -1
  175. package/styles/document-tokens.css.d.ts +1 -0
  176. package/styles/document-tokens.css.js +3 -0
  177. package/styles/document-tokens.css.js.map +1 -0
  178. package/styles/filter-row/filter-row.css.js +1 -1
  179. package/styles/filter-row/filter-row.css.js.map +1 -1
  180. package/styles/grid/_grid.base.css.js +1 -1
  181. package/styles/grid/_grid.base.css.js.map +1 -1
  182. package/styles/grid/grid.css.js +1 -1
  183. package/styles/grid/grid.css.js.map +1 -1
  184. package/styles/group-header-row/group-header-row.css.js +1 -1
  185. package/styles/group-header-row/group-header-row.css.js.map +1 -1
  186. package/styles/header-cell/header-cell.css.js +1 -1
  187. package/styles/header-cell/header-cell.css.js.map +1 -1
  188. package/styles/header-row/header-row.base.css.js +1 -1
  189. package/styles/header-row/header-row.base.css.js.map +1 -1
  190. package/styles/paginator/paginator.css.js +1 -1
  191. package/styles/paginator/paginator.css.js.map +1 -1
  192. package/styles/toolbar/toolbar.css.js +1 -1
  193. package/styles/toolbar/toolbar.css.js.map +1 -1
  194. package/tokens.css +78 -0
  195. package/LICENSE +0 -80
  196. package/docs/media/LICENSE +0 -80
  197. package/docs/media/_tokens.scss +0 -214
@@ -1 +1 @@
1
- {"version":3,"file":"header.js","sourceRoot":"","sources":["../../src/components/header.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAwB,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,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C;IACd,CAAC;IAEkB,MAAM;QACvB,OAAO,IAAI,CAAA;;eAEA,WAAW,CAAC;YACjB,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI,CAAC,UAAU;YACzB,QAAQ,EAAE,IAAI,CAAC,gBAAgB,CAAC,eAAe;SAChD,CAAC;;UAEA,IAAI,CAAC,iBAAiB,EAAE;;YAEtB,IAAI,CAAC,cAAc,EAAE;YACrB,IAAI,CAAC,kBAAkB,EAAE;YACzB,IAAI,CAAC,gBAAgB,EAAE;;;QAG3B,IAAI,CAAC,gBAAgB,EAAE;QACvB,IAAI,CAAC,gBAAgB,EAAE;KAC1B,CAAC;IACJ,CAAC;;AA/dM;IAFN,OAAO,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IACvD,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;6CACG;AAG3B;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;8CACQ;AAIhC;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDACzB;AAOb;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;wDACF;AAGnB;IADT,KAAK,EAAE;gDACmB","sourcesContent":["import { consume } from '@lit/context';\nimport { html, LitElement, nothing } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { gridStateContext, type StateController } from '../controllers/state.js';\nimport { MIN_COL_RESIZE_WIDTH } from '../internal/constants.js';\nimport { renderIcon, renderSortArrows } from '../internal/icons.js';\nimport { partNameMap } from '../internal/part-map.js';\nimport { registerComponent } from '../internal/register.js';\nimport { GRID_HEADER_TAG } from '../internal/tags.js';\nimport type { ApexHeaderContext, ColumnConfiguration } from '../internal/types.js';\nimport { isRTL } from '../internal/utils.js';\nimport { styles } from '../styles/header-cell/header-cell.css.js';\n\n/** Pixels of pointer travel before a hold turns into a drag — avoids\n * accidental drags on click. */\nconst DRAG_THRESHOLD_PX = 4;\n\nexport default class ApexGridHeader<T extends object> extends LitElement {\n public static get tagName() {\n return GRID_HEADER_TAG;\n }\n\n public static override styles = styles;\n\n public static register(): void {\n registerComponent(ApexGridHeader);\n }\n\n protected get context(): ApexHeaderContext<T> {\n return {\n parent: this,\n column: this.column,\n };\n }\n\n protected get isSortable() {\n // Sort affordances are hidden while a manual row order is active (F5):\n // sorting and manual order are mutually exclusive.\n return Boolean(this.column.sort) && !this.state?.rowReorder?.hasManualOrder;\n }\n\n protected get isFilterable() {\n return Boolean(this.column.filter);\n }\n\n protected get hasActiveFilter() {\n return Boolean(this.state?.filtering?.state.has(this.column.key));\n }\n\n protected get resizeController() {\n return this.state.resizing;\n }\n\n protected get reorderController() {\n return this.state.reordering;\n }\n\n protected get isDraggable() {\n return Boolean(this.state?.reordering?.isDraggable(this.column));\n }\n\n @consume({ context: gridStateContext, subscribe: true })\n @property({ attribute: false })\n public state!: StateController<T>;\n\n @property({ attribute: false })\n public column!: ColumnConfiguration<T>;\n\n /** 1-based column index passed in by the parent header row for `aria-colindex`. */\n @property({ attribute: false, type: Number })\n public colindex = 0;\n\n /**\n * Spreadsheet column letter (A, B, C, ...) shown as a prefix while formula\n * coordinate hints are active. Empty string hides it.\n */\n @property({ attribute: false })\n public coordinateLetter = '';\n\n @state()\n protected menuOpen = false;\n\n #addResizeEventHandlers() {\n const config: AddEventListenerOptions = { once: true };\n\n this.addEventListener(\n 'gotpointercapture',\n () => {\n this.resizeController.indicatorActive = true;\n },\n config\n );\n this.addEventListener('lostpointercapture', this.#handlePointerLost, config);\n this.addEventListener('pointerup', (e) => this.releasePointerCapture(e.pointerId), config);\n this.addEventListener('pointermove', this.#handleResize);\n }\n\n #handleClick(e: MouseEvent) {\n e.stopPropagation();\n // Ctrl/Cmd+click appends to a multi-column sort; a plain click sorts by\n // this column alone. Keyboard activation (Enter/Space) fires a click whose\n // modifier flags mirror the keys held, so Ctrl/Cmd+Enter is additive too.\n this.state.sorting.sortFromHeaderClick(this.column, e.ctrlKey || e.metaKey);\n }\n\n #handleResize = ({ clientX }: PointerEvent) => {\n const rect = this.getBoundingClientRect();\n // The inline-start edge stays put and the inline-end edge follows the\n // pointer. Under `dir=\"rtl\"` inline-end is the *physical left* side, so the\n // column grows as the pointer moves left and the width is measured from the\n // fixed right edge instead.\n const rtl = isRTL(this);\n const width = Math.max(rtl ? rect.right - clientX : clientX - rect.left, MIN_COL_RESIZE_WIDTH);\n // The indicator is drawn with `translateX`, which is physical either way, so\n // it needs the physical x of the edge being dragged.\n const x = rtl ? this.offsetLeft + this.offsetWidth - width : this.offsetLeft + width;\n\n this.resizeController.resize(this.column, width, x);\n };\n\n #handleResizeStart(ev: PointerEvent) {\n const { target, pointerId } = ev;\n\n ev.preventDefault();\n // Resize takes priority over reorder — stop the event so the header's\n // pointerdown listener doesn't also start arming a drag.\n ev.stopPropagation();\n\n this.#addResizeEventHandlers();\n this.resizeController.start(this);\n\n (target as HTMLElement).setPointerCapture(pointerId);\n }\n\n #handlePointerLost = () => {\n this.resizeController.indicatorActive = false;\n this.removeEventListener('pointermove', this.#handleResize);\n this.resizeController.stop();\n };\n\n #handleAutosize = () => this.resizeController.autosize(this.column, this);\n\n // --- Reorder (pointer-driven) ------------------------------------------\n\n #dragStartX = 0;\n #dragStartY = 0;\n #dragPointerId = -1;\n #isDragging = false;\n\n #handleReorderPointerDown = (event: PointerEvent) => {\n if (!this.isDraggable) return;\n if (event.button !== 0) return;\n // Skip if the user grabbed an interactive sub-part of the header — the\n // resize handle, sort/action icons, filter button, menu button, or the\n // column menu dropdown. Those have their own handlers and should not arm\n // a drag.\n const path = event.composedPath();\n const target = path[0];\n if (\n target instanceof Element &&\n target.closest?.('[part~=\"resizable\"], [part~=\"action\"], [part~=\"col-menu\"]')\n ) {\n return;\n }\n this.#dragStartX = event.clientX;\n this.#dragStartY = event.clientY;\n this.#dragPointerId = event.pointerId;\n this.addEventListener('pointermove', this.#handleReorderPointerMove);\n this.addEventListener('pointerup', this.#handleReorderPointerUp);\n this.addEventListener('pointercancel', this.#handleReorderPointerUp);\n };\n\n #handleReorderPointerMove = (event: PointerEvent) => {\n if (event.pointerId !== this.#dragPointerId) return;\n if (!this.#isDragging) {\n const dx = event.clientX - this.#dragStartX;\n const dy = event.clientY - this.#dragStartY;\n if (Math.hypot(dx, dy) < DRAG_THRESHOLD_PX) return;\n // Threshold crossed — start the drag in earnest.\n this.#isDragging = true;\n this.setPointerCapture(event.pointerId);\n this.setAttribute('data-dragging', '');\n const rect = this.getBoundingClientRect();\n const label = this.column.headerText ?? String(this.column.key);\n this.reorderController.start(\n this.column.key,\n rect,\n this.#dragStartX,\n this.#dragStartY,\n label\n );\n }\n this.reorderController.move(event.clientX, event.clientY);\n };\n\n #handleReorderPointerUp = (event: PointerEvent) => {\n if (event.pointerId !== this.#dragPointerId) return;\n this.removeEventListener('pointermove', this.#handleReorderPointerMove);\n this.removeEventListener('pointerup', this.#handleReorderPointerUp);\n this.removeEventListener('pointercancel', this.#handleReorderPointerUp);\n try {\n if (this.hasPointerCapture(event.pointerId)) {\n this.releasePointerCapture(event.pointerId);\n }\n } catch {\n /* capture was already released */\n }\n if (this.#isDragging) {\n this.#isDragging = false;\n this.removeAttribute('data-dragging');\n this.reorderController.end();\n }\n this.#dragPointerId = -1;\n };\n\n // --- Filter button --------------------------------------------------\n\n #handleFilterClick = (e: MouseEvent) => {\n e.stopPropagation();\n const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();\n this.state.filtering.setActiveColumn(this.column, rect);\n };\n\n // --- Column menu button ---------------------------------------------\n\n #handleMenuClick = (e: MouseEvent) => {\n e.stopPropagation();\n // Offer the column menu to a feature module first: the enterprise context\n // menu opens its richer, shared menu (sort / pin / hide / group / chart)\n // anchored at this button and calls preventDefault(). When nothing handles\n // it (the community grid), fall back to the built-in inline menu below.\n // Event name is a stable string contract (mirrored in the enterprise\n // context-menu controller), like the native 'contextmenu'.\n const request = new CustomEvent('apex-grid-column-menu', {\n detail: { column: this.column, anchor: e.currentTarget as HTMLElement },\n bubbles: true,\n composed: true,\n cancelable: true,\n });\n this.dispatchEvent(request);\n if (request.defaultPrevented) return;\n this.menuOpen = !this.menuOpen;\n };\n\n #handleMenuOutside = (e: PointerEvent) => {\n if (!this.menuOpen) return;\n if (e.composedPath().includes(this)) return;\n this.menuOpen = false;\n };\n\n /** ArrowDown on the kebab opens the menu and moves focus to its first item. */\n #handleMenuTriggerKeydown = (e: KeyboardEvent) => {\n if (e.key !== 'ArrowDown' && e.key !== 'Down') return;\n e.preventDefault();\n e.stopPropagation();\n if (!this.menuOpen) {\n // Route through the same module-first contract as a click.\n this.#handleMenuClick(e as unknown as MouseEvent);\n }\n this.#focusMenuItem(0);\n };\n\n #menuItems(): HTMLElement[] {\n return Array.from(this.renderRoot.querySelectorAll<HTMLElement>('[role=\"menuitem\"]'));\n }\n\n #focusMenuItem(index: number) {\n requestAnimationFrame(() => {\n const items = this.#menuItems();\n if (!items.length) return;\n items[(index + items.length) % items.length]?.focus();\n });\n }\n\n #closeMenu(returnFocus = false) {\n this.menuOpen = false;\n if (returnFocus) {\n requestAnimationFrame(() =>\n this.renderRoot.querySelector<HTMLElement>('[part~=\"menu-btn\"]')?.focus()\n );\n }\n }\n\n /** Menu keyboard pattern: arrows/Home/End rove, Escape closes and restores focus. */\n #handleColMenuKeydown = (e: KeyboardEvent) => {\n const items = this.#menuItems();\n const current = items.findIndex((item) => item.matches(':focus'));\n switch (e.key) {\n case 'ArrowDown':\n case 'Down':\n e.preventDefault();\n e.stopPropagation();\n items[(current + 1) % items.length]?.focus();\n return;\n case 'ArrowUp':\n case 'Up':\n e.preventDefault();\n e.stopPropagation();\n items[(current - 1 + items.length) % items.length]?.focus();\n return;\n case 'Home':\n e.preventDefault();\n e.stopPropagation();\n items[0]?.focus();\n return;\n case 'End':\n e.preventDefault();\n e.stopPropagation();\n items[items.length - 1]?.focus();\n return;\n case 'Escape':\n e.preventDefault();\n e.stopPropagation();\n this.#closeMenu(true);\n return;\n case 'Tab':\n this.#closeMenu();\n return;\n default:\n return;\n }\n };\n\n protected override updated() {\n // Mirror the column's data type onto the host so the header label can match\n // the body cell alignment by default (numeric/currency cells right-align,\n // so their headers should too). Kept in sync on every update because the\n // column config can change at runtime (reorder, reconfigure).\n this.setAttribute('data-cell-type', this.column.type ?? 'string');\n // Reflect reorderability as an attribute so SCSS can show the grab\n // cursor only on columns that can actually be dragged. Tracks both the\n // grid-level `columnReordering` flag (arriving via context) and the\n // per-column `reorderable: false` opt-out at runtime.\n if (this.isDraggable) {\n this.setAttribute('data-reorderable', '');\n } else {\n this.removeAttribute('data-reorderable');\n }\n // aria-colindex stays in sync with the parent header row's numbering.\n if (this.colindex > 0) {\n this.setAttribute('aria-colindex', String(this.colindex));\n }\n // aria-sort communicates current sort direction for this column to AT.\n if (this.isSortable) {\n const sort = this.state?.sorting.state.get(this.column.key);\n const dir = sort?.direction;\n this.setAttribute(\n 'aria-sort',\n dir === 'ascending' ? 'ascending' : dir === 'descending' ? 'descending' : 'none'\n );\n } else {\n this.removeAttribute('aria-sort');\n }\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n this.setAttribute('role', 'columnheader');\n this.addEventListener('pointerdown', this.#handleReorderPointerDown);\n document.addEventListener('pointerdown', this.#handleMenuOutside, true);\n }\n\n public override disconnectedCallback(): void {\n this.removeEventListener('pointerdown', this.#handleReorderPointerDown);\n document.removeEventListener('pointerdown', this.#handleMenuOutside, true);\n super.disconnectedCallback();\n }\n\n protected renderSortPart() {\n const state = this.state.sorting.state.get(this.column.key);\n const idx = Array.from(this.state.sorting.state.values()).indexOf(state!);\n const attr = this.state.host.sortConfiguration.multiple\n ? idx > -1\n ? idx + 1\n : nothing\n : nothing;\n const direction = state?.direction ?? 'none';\n\n const label =\n state?.direction === 'ascending'\n ? this.state.localize('header.sortedAscending')\n : state?.direction === 'descending'\n ? this.state.localize('header.sortedDescending')\n : this.state.localize('header.notSorted');\n\n return state || this.isSortable\n ? this.isSortable\n ? html`<button\n type=\"button\"\n part=${partNameMap({ action: true, sorted: !!state?.direction })}\n data-sort-active=${direction}\n data-sort-index=${attr === nothing ? '' : (attr as number)}\n aria-label=${label}\n @click=${this.#handleClick}\n >\n ${renderSortArrows()}\n </button>`\n : html`<span\n part=${partNameMap({ action: true, sorted: !!state?.direction })}\n data-sort-active=${direction}\n data-sort-index=${attr === nothing ? '' : (attr as number)}\n aria-hidden=\"true\"\n >\n ${renderSortArrows()}\n </span>`\n : nothing;\n }\n\n protected renderFilterButton() {\n if (!this.isFilterable) return nothing;\n const count = this.state?.filtering?.state.get(this.column.key)?.length ?? 0;\n return html`<button\n type=\"button\"\n part=${partNameMap({ action: true, 'filter-btn': true, 'filter-active': this.hasActiveFilter })}\n aria-label=${this.state.localize('header.filterColumn')}\n @click=${this.#handleFilterClick}\n >\n ${renderIcon('filter')}\n ${count > 1 ? html`<span part=\"filter-count\">${count}</span>` : nothing}\n </button>`;\n }\n\n protected renderMenuButton() {\n // Suppress the kebab entirely when the grid opts out.\n if (this.state?.host?.columnMenu === false) return nothing;\n // Show the kebab when this column has built-in menu items (sort / autosize)\n // or when a feature module provides a richer column menu (the enterprise\n // context menu: pin / hide / group / chart), so the affordance appears even\n // on columns that are neither sortable nor resizable.\n const hasMenuItems =\n this.isSortable || this.column.resizable || Boolean(this.state?.hasColumnMenu);\n if (!hasMenuItems) return nothing;\n return html`<button\n type=\"button\"\n part=${partNameMap({ action: true, 'menu-btn': true })}\n aria-label=${this.state.localize('header.columnMenu')}\n aria-expanded=${this.menuOpen ? 'true' : 'false'}\n aria-haspopup=\"menu\"\n @click=${this.#handleMenuClick}\n @keydown=${this.#handleMenuTriggerKeydown}\n >\n ${renderIcon('more-vert')}\n </button>`;\n }\n\n protected renderColumnMenu() {\n if (!this.menuOpen) return nothing;\n return html`<div part=\"col-menu\" role=\"menu\" @keydown=${this.#handleColMenuKeydown}>\n ${\n this.isSortable\n ? html`\n <button\n type=\"button\"\n part=\"col-menu-item\"\n role=\"menuitem\"\n tabindex=\"-1\"\n @click=${() => {\n this.state.sorting.sort({ key: this.column.key, direction: 'ascending' } as any);\n this.menuOpen = false;\n }}\n >\n ${renderIcon('sort-asc')} ${this.state.localize('contextMenu.sortAsc')}\n </button>\n <button\n type=\"button\"\n part=\"col-menu-item\"\n role=\"menuitem\"\n tabindex=\"-1\"\n @click=${() => {\n this.state.sorting.sort({ key: this.column.key, direction: 'descending' } as any);\n this.menuOpen = false;\n }}\n >\n ${renderIcon('sort-desc')} ${this.state.localize('contextMenu.sortDesc')}\n </button>\n `\n : nothing\n }\n ${\n this.column.resizable\n ? html`<button\n type=\"button\"\n part=\"col-menu-item\"\n role=\"menuitem\"\n tabindex=\"-1\"\n @click=${() => {\n this.state.resizing.autosize(this.column, this);\n this.menuOpen = false;\n }}\n >\n ${renderIcon('arrow-upward')} ${this.state.localize('header.autosizeColumn')}\n </button>`\n : nothing\n }\n </div>`;\n }\n\n protected renderContentPart() {\n const defaultContent = this.column.headerText ?? this.column.key;\n const template = this.column.headerTemplate;\n\n return html`\n <span part=\"title\">\n ${\n this.coordinateLetter\n ? html`<span part=\"coord-letter\" aria-hidden=\"true\">${this.coordinateLetter}</span>`\n : nothing\n }\n <span>${template ? template(this.context) : html`${defaultContent}`}</span>\n </span>\n `;\n }\n\n protected renderResizePart() {\n return this.column.resizable\n ? html`<span\n part=\"resizable\"\n @dblclick=${this.#handleAutosize}\n @pointerdown=${this.#handleResizeStart}\n ></span>`\n : nothing;\n }\n\n protected override render() {\n return html`\n <div\n part=${partNameMap({\n content: true,\n sortable: this.isSortable,\n resizing: this.resizeController.indicatorActive,\n })}\n >\n ${this.renderContentPart()}\n <div part=\"actions\">\n ${this.renderSortPart()}\n ${this.renderFilterButton()}\n ${this.renderMenuButton()}\n </div>\n </div>\n ${this.renderResizePart()}\n ${this.renderColumnMenu()}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [ApexGridHeader.tagName]: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;;YAEtB,IAAI,CAAC,cAAc,EAAE;YACrB,IAAI,CAAC,kBAAkB,EAAE;YACzB,IAAI,CAAC,gBAAgB,EAAE;;;QAG3B,IAAI,CAAC,gBAAgB,EAAE;QACvB,IAAI,CAAC,gBAAgB,EAAE;KAC1B,CAAC;IACJ,CAAC;;AA1fM;IAFN,OAAO,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IACvD,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;6CACG;AAG3B;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;8CACQ;AAIhC;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDACzB;AAOb;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;wDACF;AAGnB;IADT,KAAK,EAAE;gDACmB","sourcesContent":["import { consume } from '@lit/context';\nimport { html, LitElement, nothing } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { gridStateContext, type StateController } from '../controllers/state.js';\nimport { MIN_COL_RESIZE_WIDTH } from '../internal/constants.js';\nimport { renderIcon, renderSortArrows } from '../internal/icons.js';\nimport { partNameMap } from '../internal/part-map.js';\nimport { registerComponent } from '../internal/register.js';\nimport { GRID_HEADER_TAG } from '../internal/tags.js';\nimport type { ApexHeaderContext, ColumnConfiguration } from '../internal/types.js';\nimport { isRTL } from '../internal/utils.js';\nimport { styles } from '../styles/header-cell/header-cell.css.js';\n\n/** Pixels of pointer travel before a hold turns into a drag — avoids\n * accidental drags on click. */\nconst DRAG_THRESHOLD_PX = 4;\n\nexport default class ApexGridHeader<T extends object> extends LitElement {\n public static get tagName() {\n return GRID_HEADER_TAG;\n }\n\n public static override styles = styles;\n\n public static register(): void {\n registerComponent(ApexGridHeader);\n }\n\n protected get context(): ApexHeaderContext<T> {\n return {\n parent: this,\n column: this.column,\n };\n }\n\n protected get isSortable() {\n // One rule with the enterprise context menu, kept in the sort controller.\n return Boolean(this.state?.sorting?.isSortable(this.column));\n }\n\n protected get isFilterable() {\n return Boolean(this.column.filter);\n }\n\n protected get hasActiveFilter() {\n return Boolean(this.state?.filtering?.state.has(this.column.key));\n }\n\n protected get resizeController() {\n return this.state.resizing;\n }\n\n protected get reorderController() {\n return this.state.reordering;\n }\n\n protected get isDraggable() {\n return Boolean(this.state?.reordering?.isDraggable(this.column));\n }\n\n @consume({ context: gridStateContext, subscribe: true })\n @property({ attribute: false })\n public state!: StateController<T>;\n\n @property({ attribute: false })\n public column!: ColumnConfiguration<T>;\n\n /** 1-based column index passed in by the parent header row for `aria-colindex`. */\n @property({ attribute: false, type: Number })\n public colindex = 0;\n\n /**\n * Spreadsheet column letter (A, B, C, ...) shown as a prefix while formula\n * coordinate hints are active. Empty string hides it.\n */\n @property({ attribute: false })\n public coordinateLetter = '';\n\n @state()\n protected menuOpen = false;\n\n #addResizeEventHandlers() {\n const config: AddEventListenerOptions = { once: true };\n\n this.addEventListener(\n 'gotpointercapture',\n () => {\n this.resizeController.indicatorActive = true;\n },\n config\n );\n this.addEventListener('lostpointercapture', this.#handlePointerLost, config);\n this.addEventListener('pointerup', (e) => this.releasePointerCapture(e.pointerId), config);\n this.addEventListener('pointermove', this.#handleResize);\n }\n\n #handleClick(e: MouseEvent) {\n e.stopPropagation();\n // Ctrl/Cmd+click appends to a multi-column sort; a plain click sorts by\n // this column alone. Keyboard activation (Enter/Space) fires a click whose\n // modifier flags mirror the keys held, so Ctrl/Cmd+Enter is additive too.\n this.state.sorting.sortFromHeaderClick(this.column, e.ctrlKey || e.metaKey);\n }\n\n #handleResize = ({ clientX }: PointerEvent) => {\n const rect = this.getBoundingClientRect();\n // The inline-start edge stays put and the inline-end edge follows the\n // pointer. Under `dir=\"rtl\"` inline-end is the *physical left* side, so the\n // column grows as the pointer moves left and the width is measured from the\n // fixed right edge instead.\n const rtl = isRTL(this);\n const width = Math.max(rtl ? rect.right - clientX : clientX - rect.left, MIN_COL_RESIZE_WIDTH);\n\n this.resizeController.resize(this.column, width, this.resizeController.edge(this, width, rtl));\n };\n\n #handleResizeStart(ev: PointerEvent) {\n const { target, pointerId } = ev;\n\n ev.preventDefault();\n // Resize takes priority over reorder — stop the event so the header's\n // pointerdown listener doesn't also start arming a drag.\n ev.stopPropagation();\n\n this.#addResizeEventHandlers();\n this.resizeController.start(this);\n\n (target as HTMLElement).setPointerCapture(pointerId);\n }\n\n #handlePointerLost = () => {\n this.resizeController.indicatorActive = false;\n this.removeEventListener('pointermove', this.#handleResize);\n this.resizeController.stop();\n };\n\n #handleAutosize = () => this.resizeController.autosize(this.column, this);\n\n // --- Reorder (pointer-driven) ------------------------------------------\n\n #dragStartX = 0;\n #dragStartY = 0;\n #dragPointerId = -1;\n #isDragging = false;\n\n #handleReorderPointerDown = (event: PointerEvent) => {\n if (!this.isDraggable) return;\n if (event.button !== 0) return;\n // Skip if the user grabbed an interactive part of the header (the resize\n // handle, sort/action icons, filter button, menu button, or the column\n // menu dropdown) or interactive content from a `headerTemplate` (an input,\n // a button). Those have their own behaviour, and selecting text in a\n // header input or clicking a custom button must not start a drag.\n const target = event.composedPath()[0];\n if (\n target instanceof Element &&\n target.closest(\n '[part~=\"resizable\"],[part~=\"action\"],[part~=\"col-menu\"],input,textarea,select,button,a[href],[contenteditable]:not([contenteditable=\"false\"])'\n )\n ) {\n return;\n }\n this.#dragStartX = event.clientX;\n this.#dragStartY = event.clientY;\n this.#dragPointerId = event.pointerId;\n this.#listenReorder(true);\n };\n\n /**\n * Tracks the armed or dragging pointer on the document, not on this header.\n * A live swap re-inserts this element into the header row, which releases\n * its pointer capture, so after the first swap later moves and the release\n * land on other elements. Listening on the document (capture phase) sees\n * them wherever they land, and also sees a release outside the header that\n * would otherwise leave the drag armed.\n */\n #listenReorder(on: boolean) {\n const doc = this.ownerDocument;\n const toggle = on ? doc.addEventListener.bind(doc) : doc.removeEventListener.bind(doc);\n toggle('pointermove', this.#handleReorderPointerMove, true);\n toggle('pointerup', this.#handleReorderPointerUp, true);\n toggle('pointercancel', this.#handleReorderPointerUp, true);\n }\n\n #handleReorderPointerMove = (event: PointerEvent) => {\n if (event.pointerId !== this.#dragPointerId) return;\n // A mouse move with the primary button up means the release was lost\n // (window blur, a dialog while held), so disarm instead of dragging.\n if (event.pointerType === 'mouse' && !(event.buttons & 1)) return this.#endReorder();\n if (!this.#isDragging) {\n const dx = event.clientX - this.#dragStartX;\n const dy = event.clientY - this.#dragStartY;\n if (Math.hypot(dx, dy) < DRAG_THRESHOLD_PX) return;\n // Threshold crossed — start the drag in earnest.\n this.#isDragging = true;\n this.setPointerCapture(event.pointerId);\n this.setAttribute('data-dragging', '');\n const rect = this.getBoundingClientRect();\n const label = this.column.headerText ?? String(this.column.key);\n this.reorderController.start(\n this.column.key,\n rect,\n this.#dragStartX,\n this.#dragStartY,\n label\n );\n }\n this.reorderController.move(event.clientX, event.clientY);\n };\n\n #handleReorderPointerUp = (event: PointerEvent) => {\n if (event.pointerId !== this.#dragPointerId) return;\n try {\n if (this.hasPointerCapture(event.pointerId)) {\n this.releasePointerCapture(event.pointerId);\n }\n } catch {\n /* capture was already released */\n }\n this.#endReorder();\n };\n\n /** Disarms the reorder and ends a drag in progress. */\n #endReorder() {\n this.#listenReorder(false);\n if (this.#isDragging) {\n this.#isDragging = false;\n this.removeAttribute('data-dragging');\n this.reorderController.end();\n }\n this.#dragPointerId = -1;\n }\n\n // --- Filter button --------------------------------------------------\n\n #handleFilterClick = (e: MouseEvent) => {\n e.stopPropagation();\n const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();\n this.state.filtering.setActiveColumn(this.column, rect);\n };\n\n // --- Column menu button ---------------------------------------------\n\n #handleMenuClick = (e: MouseEvent) => {\n e.stopPropagation();\n // Offer the column menu to a feature module first: the enterprise context\n // menu opens its richer, shared menu (sort / pin / hide / group / chart)\n // anchored at this button and calls preventDefault(). When nothing handles\n // it (the community grid), fall back to the built-in inline menu below.\n // Event name is a stable string contract (mirrored in the enterprise\n // context-menu controller), like the native 'contextmenu'.\n const request = new CustomEvent('apex-grid-column-menu', {\n detail: { column: this.column, anchor: e.currentTarget as HTMLElement },\n bubbles: true,\n composed: true,\n cancelable: true,\n });\n this.dispatchEvent(request);\n if (request.defaultPrevented) return;\n this.menuOpen = !this.menuOpen;\n };\n\n #handleMenuOutside = (e: PointerEvent) => {\n if (!this.menuOpen) return;\n if (e.composedPath().includes(this)) return;\n this.menuOpen = false;\n };\n\n /** ArrowDown on the kebab opens the menu and moves focus to its first item. */\n #handleMenuTriggerKeydown = (e: KeyboardEvent) => {\n if (e.key !== 'ArrowDown' && e.key !== 'Down') return;\n e.preventDefault();\n e.stopPropagation();\n if (!this.menuOpen) {\n // Route through the same module-first contract as a click.\n this.#handleMenuClick(e as unknown as MouseEvent);\n }\n this.#focusMenuItem(0);\n };\n\n #menuItems(): HTMLElement[] {\n return Array.from(this.renderRoot.querySelectorAll<HTMLElement>('[role=\"menuitem\"]'));\n }\n\n #focusMenuItem(index: number) {\n requestAnimationFrame(() => {\n const items = this.#menuItems();\n if (!items.length) return;\n items[(index + items.length) % items.length]?.focus();\n });\n }\n\n #closeMenu(returnFocus = false) {\n this.menuOpen = false;\n if (returnFocus) {\n requestAnimationFrame(() =>\n this.renderRoot.querySelector<HTMLElement>('[part~=\"menu-btn\"]')?.focus()\n );\n }\n }\n\n /** Menu keyboard pattern: arrows/Home/End rove, Escape closes and restores focus. */\n #handleColMenuKeydown = (e: KeyboardEvent) => {\n const items = this.#menuItems();\n const current = items.findIndex((item) => item.matches(':focus'));\n switch (e.key) {\n case 'ArrowDown':\n case 'Down':\n e.preventDefault();\n e.stopPropagation();\n items[(current + 1) % items.length]?.focus();\n return;\n case 'ArrowUp':\n case 'Up':\n e.preventDefault();\n e.stopPropagation();\n items[(current - 1 + items.length) % items.length]?.focus();\n return;\n case 'Home':\n e.preventDefault();\n e.stopPropagation();\n items[0]?.focus();\n return;\n case 'End':\n e.preventDefault();\n e.stopPropagation();\n items[items.length - 1]?.focus();\n return;\n case 'Escape':\n e.preventDefault();\n e.stopPropagation();\n this.#closeMenu(true);\n return;\n case 'Tab':\n this.#closeMenu();\n return;\n default:\n return;\n }\n };\n\n protected override updated() {\n // Mirror the column's data type onto the host so the header label can match\n // the body cell alignment by default (numeric/currency cells right-align,\n // so their headers should too). Kept in sync on every update because the\n // column config can change at runtime (reorder, reconfigure).\n this.setAttribute('data-cell-type', this.column.type ?? 'string');\n // Reflect reorderability as an attribute so SCSS can show the grab\n // cursor only on columns that can actually be dragged. Tracks both the\n // grid-level `columnReordering` flag (arriving via context) and the\n // per-column `reorderable: false` opt-out at runtime.\n if (this.isDraggable) {\n this.setAttribute('data-reorderable', '');\n } else {\n this.removeAttribute('data-reorderable');\n }\n // aria-colindex stays in sync with the parent header row's numbering.\n if (this.colindex > 0) {\n this.setAttribute('aria-colindex', String(this.colindex));\n }\n // aria-sort communicates current sort direction for this column to AT.\n if (this.isSortable) {\n const sort = this.state?.sorting.state.get(this.column.key);\n const dir = sort?.direction;\n this.setAttribute(\n 'aria-sort',\n dir === 'ascending' ? 'ascending' : dir === 'descending' ? 'descending' : 'none'\n );\n } else {\n this.removeAttribute('aria-sort');\n }\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n this.setAttribute('role', 'columnheader');\n this.addEventListener('pointerdown', this.#handleReorderPointerDown);\n document.addEventListener('pointerdown', this.#handleMenuOutside, true);\n }\n\n public override disconnectedCallback(): void {\n this.removeEventListener('pointerdown', this.#handleReorderPointerDown);\n document.removeEventListener('pointerdown', this.#handleMenuOutside, true);\n // A live swap moves this header, which disconnects and reconnects it in\n // the same task, so only a header still detached a microtask later (its\n // column hidden mid-drag, or the grid removed) ends the drag.\n if (this.#dragPointerId !== -1) {\n queueMicrotask(() => {\n if (!this.isConnected) this.#endReorder();\n });\n }\n super.disconnectedCallback();\n }\n\n protected renderSortPart() {\n const state = this.state.sorting.state.get(this.column.key);\n const idx = Array.from(this.state.sorting.state.values()).indexOf(state!);\n const attr = this.state.host.sortConfiguration.multiple\n ? idx > -1\n ? idx + 1\n : nothing\n : nothing;\n const direction = state?.direction ?? 'none';\n\n const label =\n state?.direction === 'ascending'\n ? this.state.localize('header.sortedAscending')\n : state?.direction === 'descending'\n ? this.state.localize('header.sortedDescending')\n : this.state.localize('header.notSorted');\n\n return state || this.isSortable\n ? this.isSortable\n ? html`<button\n type=\"button\"\n part=${partNameMap({ action: true, sorted: !!state?.direction })}\n data-sort-active=${direction}\n data-sort-index=${attr === nothing ? '' : (attr as number)}\n aria-label=${label}\n @click=${this.#handleClick}\n >\n ${renderSortArrows()}\n </button>`\n : html`<span\n part=${partNameMap({ action: true, sorted: !!state?.direction })}\n data-sort-active=${direction}\n data-sort-index=${attr === nothing ? '' : (attr as number)}\n aria-hidden=\"true\"\n >\n ${renderSortArrows()}\n </span>`\n : nothing;\n }\n\n protected renderFilterButton() {\n if (!this.isFilterable) return nothing;\n const count = this.state?.filtering?.state.get(this.column.key)?.length ?? 0;\n return html`<button\n type=\"button\"\n part=${partNameMap({ action: true, 'filter-btn': true, 'filter-active': this.hasActiveFilter })}\n aria-label=${this.state.localize('header.filterColumn')}\n @click=${this.#handleFilterClick}\n >\n ${renderIcon('filter')}\n ${count > 1 ? html`<span part=\"filter-count\">${count}</span>` : nothing}\n </button>`;\n }\n\n protected renderMenuButton() {\n // Suppress the kebab entirely when the grid opts out.\n if (this.state?.host?.columnMenu === false) return nothing;\n // Show the kebab when this column has built-in menu items (sort / autosize)\n // or when a feature module provides a richer column menu (the enterprise\n // context menu: pin / hide / group / chart), so the affordance appears even\n // on columns that are neither sortable nor resizable.\n const hasMenuItems =\n this.isSortable || this.column.resizable || Boolean(this.state?.hasColumnMenu);\n if (!hasMenuItems) return nothing;\n return html`<button\n type=\"button\"\n part=${partNameMap({ action: true, 'menu-btn': true })}\n aria-label=${this.state.localize('header.columnMenu')}\n aria-expanded=${this.menuOpen ? 'true' : 'false'}\n aria-haspopup=\"menu\"\n @click=${this.#handleMenuClick}\n @keydown=${this.#handleMenuTriggerKeydown}\n >\n ${renderIcon('more-vert')}\n </button>`;\n }\n\n protected renderColumnMenu() {\n if (!this.menuOpen) return nothing;\n return html`<div part=\"col-menu\" role=\"menu\" @keydown=${this.#handleColMenuKeydown}>\n ${\n this.isSortable\n ? html`\n <button\n type=\"button\"\n part=\"col-menu-item\"\n role=\"menuitem\"\n tabindex=\"-1\"\n @click=${() => {\n this.state.sorting.sortFromUI(this.column, { direction: 'ascending' });\n this.menuOpen = false;\n }}\n >\n ${renderIcon('sort-asc')} ${this.state.localize('contextMenu.sortAsc')}\n </button>\n <button\n type=\"button\"\n part=\"col-menu-item\"\n role=\"menuitem\"\n tabindex=\"-1\"\n @click=${() => {\n this.state.sorting.sortFromUI(this.column, { direction: 'descending' });\n this.menuOpen = false;\n }}\n >\n ${renderIcon('sort-desc')} ${this.state.localize('contextMenu.sortDesc')}\n </button>\n `\n : nothing\n }\n ${\n this.column.resizable\n ? html`<button\n type=\"button\"\n part=\"col-menu-item\"\n role=\"menuitem\"\n tabindex=\"-1\"\n @click=${() => {\n this.state.resizing.autosize(this.column, this);\n this.menuOpen = false;\n }}\n >\n ${renderIcon('arrow-upward')} ${this.state.localize('header.autosizeColumn')}\n </button>`\n : nothing\n }\n </div>`;\n }\n\n protected renderContentPart() {\n const defaultContent = this.column.headerText ?? this.column.key;\n const template = this.column.headerTemplate;\n\n return html`\n <span part=\"title\">\n ${\n this.coordinateLetter\n ? html`<span part=\"coord-letter\" aria-hidden=\"true\">${this.coordinateLetter}</span>`\n : nothing\n }\n <span>${template ? template(this.context) : html`${defaultContent}`}</span>\n </span>\n `;\n }\n\n protected renderResizePart() {\n return this.column.resizable\n ? html`<span\n part=\"resizable\"\n @dblclick=${this.#handleAutosize}\n @pointerdown=${this.#handleResizeStart}\n ></span>`\n : nothing;\n }\n\n protected override render() {\n return html`\n <div\n part=${partNameMap({\n content: true,\n sortable: this.isSortable,\n resizing: this.resizeController.indicatorActive,\n })}\n >\n ${this.renderContentPart()}\n <div part=\"actions\">\n ${this.renderSortPart()}\n ${this.renderFilterButton()}\n ${this.renderMenuButton()}\n </div>\n </div>\n ${this.renderResizePart()}\n ${this.renderColumnMenu()}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [ApexGridHeader.tagName]: ApexGridHeader<object>;\n }\n}\n"]}
@@ -16,6 +16,13 @@ export default class ApexGridRow<T extends object> extends LitElement {
16
16
  /** Cumulative pin offsets (px) keyed by column key. */
17
17
  pinOffsets: Map<unknown, number>;
18
18
  get cells(): ApexGridCell<T>[];
19
+ /**
20
+ * The single focus target of a row a feature module renders full width (a
21
+ * group header, a total row), or `null` for a normal cell-rendered row.
22
+ * Keyboard navigation lands here, whatever the active column, so the body
23
+ * keeps a tab stop on rows that render no cells.
24
+ */
25
+ get presentedCell(): HTMLElement | null;
19
26
  state: StateController<T>;
20
27
  activeNode: ActiveNode<T>;
21
28
  index: number;
@@ -37,6 +44,12 @@ export default class ApexGridRow<T extends object> extends LitElement {
37
44
  * for the community grid.
38
45
  */
39
46
  decorationVersion: number;
47
+ /**
48
+ * Reactive token from {@link StateController.dataVersion}, forwarded to each
49
+ * cell so a pipeline run (edit, data change, tree toggle) refreshes the row's
50
+ * ARIA and the cells that read their row. Stays `0` for pinned rows.
51
+ */
52
+ dataVersion: number;
40
53
  /**
41
54
  * Reactive token from {@link EditingController.validationVersion}, forwarded to
42
55
  * each cell so a validation-only change re-renders the row's cells (toggling
@@ -54,9 +67,12 @@ export default class ApexGridRow<T extends object> extends LitElement {
54
67
  protected willUpdate(): void;
55
68
  /**
56
69
  * Leading row-number gutter cell (transient spreadsheet coordinate hint). Shown
57
- * only while `coordinateHints` is on; pinned rows render an empty spacer (their
58
- * band-local index is not a meaningful A1 row number) so the track stays
59
- * aligned. Presentational: the accessible row index is `aria-rowindex`.
70
+ * only while `coordinateHints` is on. A feature module that addresses the data
71
+ * (the enterprise formula engine) supplies the label, so it matches what a
72
+ * reference reads; otherwise it is the view position, and pinned rows render
73
+ * an empty spacer (their band-local index is not a meaningful row number) so
74
+ * the track stays aligned. Presentational: the accessible row index is
75
+ * `aria-rowindex`.
60
76
  */
61
77
  protected renderRowNumber(): import("lit-html").TemplateResult<1> | typeof nothing;
62
78
  /**
package/components/row.js CHANGED
@@ -28,6 +28,7 @@ const GRIP_ICON = html `<svg
28
28
  <circle cx="6" cy="12.5" r="1.25" />
29
29
  <circle cx="10" cy="12.5" r="1.25" />
30
30
  </svg>`;
31
+ const ROW_PARTS = 'cell,row-number-cell,row-number,reorder-handle-cell,reorder-handle,reorder-grip,selection-cell,selection-checkbox,expansion-cell,expansion-toggle,expansion-chevron,detail-panel,group-row';
31
32
  export default class ApexGridRow extends LitElement {
32
33
  constructor() {
33
34
  super(...arguments);
@@ -41,6 +42,7 @@ export default class ApexGridRow extends LitElement {
41
42
  this.coordinateHints = false;
42
43
  this.editingKey = null;
43
44
  this.decorationVersion = 0;
45
+ this.dataVersion = 0;
44
46
  this.validationVersion = 0;
45
47
  this.#presented = null;
46
48
  this.#dragStartX = 0;
@@ -82,6 +84,11 @@ export default class ApexGridRow extends LitElement {
82
84
  get cells() {
83
85
  return Array.from(this._cells);
84
86
  }
87
+ get presentedCell() {
88
+ return this.#presented
89
+ ? this.renderRoot.querySelector('[data-presented-cell]')
90
+ : null;
91
+ }
85
92
  #presented;
86
93
  #dragStartX;
87
94
  #dragStartY;
@@ -100,7 +107,6 @@ export default class ApexGridRow extends LitElement {
100
107
  }
101
108
  connectedCallback() {
102
109
  super.connectedCallback();
103
- this.setAttribute('exportparts', 'cell');
104
110
  this.setAttribute('role', 'row');
105
111
  this.addEventListener('pointerdown', this.#handleReorderPointerDown);
106
112
  }
@@ -113,6 +119,7 @@ export default class ApexGridRow extends LitElement {
113
119
  this.#presented = this.state
114
120
  ? this.state.presentRow(this.data, { columns: this.columns, rowIndex: this.index })
115
121
  : null;
122
+ this.#syncExportParts();
116
123
  if (this.#presented) {
117
124
  this.selected = false;
118
125
  this.removeAttribute('aria-selected');
@@ -179,12 +186,28 @@ export default class ApexGridRow extends LitElement {
179
186
  }
180
187
  }
181
188
  }
189
+ #syncExportParts() {
190
+ const presented = this.#presented;
191
+ const own = presented?.part?.split(' ').join(',');
192
+ const list = presented ? presented.exportParts : this.state?.host.expansion?.exportParts;
193
+ let value = ROW_PARTS;
194
+ if (own)
195
+ value += `,${own}`;
196
+ if (list?.length)
197
+ value += `,${list.join(',')}`;
198
+ if (this.getAttribute('exportparts') !== value) {
199
+ this.setAttribute('exportparts', value);
200
+ }
201
+ }
182
202
  renderRowNumber() {
183
203
  if (!this.coordinateHints)
184
204
  return nothing;
185
- const pinned = Boolean(this.state?.rowPin?.isPinned(this.data));
205
+ let label = this.state?.rowCoordinate(this.data);
206
+ if (label === undefined) {
207
+ label = this.state?.rowPin?.isPinned(this.data) ? null : this.index + 1;
208
+ }
186
209
  return html `<div part="row-number-cell" data-pinned="start" aria-hidden="true">
187
- ${pinned ? nothing : html `<span part="row-number">${this.index + 1}</span>`}
210
+ ${label === null ? nothing : html `<span part="row-number">${label}</span>`}
188
211
  </div>`;
189
212
  }
190
213
  renderReorderHandle() {
@@ -256,33 +279,40 @@ export default class ApexGridRow extends LitElement {
256
279
  return html `<div part="detail-panel" role="region" aria-label=${this.state.localize('row.detail')}>${content}</div>`;
257
280
  }
258
281
  renderSelectionCell(colindex) {
259
- if (!this.state?.selection.showCheckboxColumn)
282
+ const selection = this.state?.selection;
283
+ if (!selection?.showCheckboxColumn)
260
284
  return nothing;
261
- const selected = this.selected;
285
+ const modifierToggle = (event) => {
286
+ if (selection.mode !== 'multiple')
287
+ return false;
288
+ if (event.shiftKey) {
289
+ void selection.rangeToggle(this.data);
290
+ }
291
+ else if (event.ctrlKey || event.metaKey) {
292
+ void selection.additiveToggle(this.data);
293
+ }
294
+ else {
295
+ return false;
296
+ }
297
+ return true;
298
+ };
262
299
  const handleChange = (event) => {
263
- const mouseEvent = event;
264
- void mouseEvent;
265
- this.state.selection.toggleRow(this.data);
300
+ const input = event.target;
301
+ void selection.toggleRow(this.data).then(() => {
302
+ input.checked = selection.isSelected(this.data);
303
+ });
266
304
  };
267
305
  const handleClick = (event) => {
268
306
  event.stopPropagation();
269
- if (event.shiftKey && this.state.selection.mode === 'multiple') {
307
+ if (modifierToggle(event))
270
308
  event.preventDefault();
271
- void this.state.selection.rangeToggle(this.data);
272
- return;
273
- }
274
- if ((event.ctrlKey || event.metaKey) && this.state.selection.mode === 'multiple') {
275
- event.preventDefault();
276
- void this.state.selection.additiveToggle(this.data);
277
- return;
278
- }
279
309
  };
280
310
  const forwardToCheckbox = (event) => {
281
- const target = event.target;
282
- if (target instanceof HTMLInputElement)
311
+ if (event.target instanceof HTMLInputElement || modifierToggle(event))
283
312
  return;
284
- event.currentTarget instanceof HTMLElement &&
285
- event.currentTarget.querySelector('input[type="checkbox"]')?.click();
313
+ event.currentTarget
314
+ .querySelector('input[type="checkbox"]')
315
+ ?.click();
286
316
  };
287
317
  return html `<div
288
318
  part="selection-cell"
@@ -295,7 +325,7 @@ export default class ApexGridRow extends LitElement {
295
325
  type="checkbox"
296
326
  part="selection-checkbox"
297
327
  aria-label=${this.state.localize('row.select')}
298
- .checked=${selected}
328
+ .checked=${this.selected}
299
329
  @click=${handleClick}
300
330
  @change=${handleChange}
301
331
  />
@@ -303,7 +333,18 @@ export default class ApexGridRow extends LitElement {
303
333
  }
304
334
  render() {
305
335
  if (this.#presented) {
306
- return html `<div part=${this.#presented.part ?? 'group-row'} style="grid-column: 1 / -1">
336
+ const colspan = this.columns.filter((column) => !column.hidden).length +
337
+ (this.state?.selection.showCheckboxColumn ? 1 : 0) +
338
+ (this.state?.expansion.showToggleColumn ? 1 : 0);
339
+ return html `<div
340
+ part=${this.#presented.part ?? 'group-row'}
341
+ role="gridcell"
342
+ aria-colindex="1"
343
+ aria-colspan=${Math.max(1, colspan)}
344
+ tabindex=${this.activeNode?.row === this.index ? 0 : -1}
345
+ data-presented-cell
346
+ style="grid-column: 1 / -1"
347
+ >
307
348
  ${this.#presented.content}
308
349
  </div>`;
309
350
  }
@@ -338,7 +379,9 @@ export default class ApexGridRow extends LitElement {
338
379
  .row=${this}
339
380
  .value=${this.data[column.key]}
340
381
  .colindex=${ariaColindex}
382
+ .rowIndex=${this.index}
341
383
  .decorationVersion=${this.decorationVersion}
384
+ .dataVersion=${this.dataVersion}
342
385
  .validationVersion=${this.validationVersion}
343
386
  ></apex-grid-cell>`;
344
387
  })}
@@ -389,6 +432,9 @@ __decorate([
389
432
  __decorate([
390
433
  property({ attribute: false, type: Number })
391
434
  ], ApexGridRow.prototype, "decorationVersion", void 0);
435
+ __decorate([
436
+ property({ attribute: false })
437
+ ], ApexGridRow.prototype, "dataVersion", void 0);
392
438
  __decorate([
393
439
  property({ attribute: false, type: Number })
394
440
  ], ApexGridRow.prototype, "validationVersion", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"row.js","sourceRoot":"","sources":["../../src/components/row.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAwB,MAAM,yBAAyB,CAAC;AAEjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,YAAY,MAAM,WAAW,CAAC;AAGrC,MAAM,SAAS,GAAG,IAAI,CAAA;;;;;;;;;;;;;OAaf,CAA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["import { consume } from '@lit/context';\nimport { html, LitElement, nothing } from 'lit';\nimport { property, queryAll } from 'lit/decorators.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport type { RowGhostInit } from '../controllers/row-reorder.js';\nimport { gridStateContext, type StateController } from '../controllers/state.js';\nimport type { PresentedRow } from '../internal/feature-module.js';\nimport { registerComponent } from '../internal/register.js';\nimport { GRID_ROW_TAG } from '../internal/tags.js';\nimport type { ActiveNode, ColumnConfiguration, Keys } from '../internal/types.js';\nimport { getPinEdge } from '../internal/utils.js';\nimport { styles } from '../styles/body-row/body-row.css.js';\nimport ApexGridCell from './cell.js';\n\n/** The six-dot grip drawn inside the row-reorder drag handle. */\nconst GRIP_ICON = html`<svg\n part=\"reorder-grip\"\n viewBox=\"0 0 16 16\"\n width=\"16\"\n height=\"16\"\n aria-hidden=\"true\"\n>\n <circle cx=\"6\" cy=\"3.5\" r=\"1.25\" />\n <circle cx=\"10\" cy=\"3.5\" r=\"1.25\" />\n <circle cx=\"6\" cy=\"8\" r=\"1.25\" />\n <circle cx=\"10\" cy=\"8\" r=\"1.25\" />\n <circle cx=\"6\" cy=\"12.5\" r=\"1.25\" />\n <circle cx=\"10\" cy=\"12.5\" r=\"1.25\" />\n</svg>`;\n\n/**\n * Component representing the DOM row in the Apex grid.\n */\nexport default class ApexGridRow<T extends object> extends LitElement {\n public static get tagName() {\n return GRID_ROW_TAG;\n }\n public static override styles = styles;\n\n public static register(): void {\n registerComponent(ApexGridRow, ApexGridCell);\n }\n\n @queryAll(ApexGridCell.tagName)\n protected _cells!: NodeListOf<ApexGridCell<T>>;\n\n @property({ attribute: false })\n public data!: T;\n\n @property({ attribute: false })\n public columns: Array<ColumnConfiguration<T>> = [];\n\n /** Cumulative pin offsets (px) keyed by column key. */\n @property({ attribute: false })\n public pinOffsets: Map<unknown, number> = new Map();\n\n public get cells() {\n return Array.from(this._cells);\n }\n\n @consume({ context: gridStateContext, subscribe: true })\n @property({ attribute: false })\n public state!: StateController<T>;\n\n @property({ attribute: false })\n public activeNode!: ActiveNode<T>;\n\n @property({ attribute: false, type: Number })\n public index = -1;\n\n /** Reflects current selection state so SCSS can highlight the row. */\n @property({ type: Boolean, reflect: true })\n public selected = false;\n\n /** Reflects current expansion state so SCSS can rotate the chevron. */\n @property({ type: Boolean, reflect: true })\n public expanded = false;\n\n /** Reflects pointer-drag state (row reorder) so SCSS can dim the source. */\n @property({ type: Boolean, reflect: true })\n public dragging = false;\n\n /** Reflects keyboard-grab state (row reorder) so SCSS can outline the row. */\n @property({ type: Boolean, reflect: true })\n public grabbed = false;\n\n /** Reveal the spreadsheet row-number gutter cell (transient formula coordinate hint). */\n @property({ type: Boolean })\n public coordinateHints = false;\n\n /** The column key currently being edited in this row, or `null`. */\n @property({ attribute: false })\n public editingKey: Keys<T> | null = null;\n\n /**\n * Reactive token from {@link StateController.decorationVersion}, forwarded to\n * each cell so a decoration-only change re-renders the row's cells. Stays `0`\n * for the community grid.\n */\n @property({ attribute: false, type: Number })\n public decorationVersion = 0;\n\n /**\n * Reactive token from {@link EditingController.validationVersion}, forwarded to\n * each cell so a validation-only change re-renders the row's cells (toggling\n * `aria-invalid` and the inline error node). Stays `0` until the first\n * validation failure.\n */\n @property({ attribute: false, type: Number })\n public validationVersion = 0;\n\n /**\n * Result of the feature-module row presenter for the current update, or\n * `null` when no module renders this row full-width (the normal case).\n * Computed in {@link willUpdate} and consumed in {@link render}.\n */\n #presented: PresentedRow | null = null;\n\n #dragStartX = 0;\n #dragStartY = 0;\n\n /**\n * Arms a row drag. In handle mode only the grip starts one; in whole-row mode\n * a press anywhere except an interactive sub-part does. The move / up plumbing\n * lives on the grid host (see {@link RowReorderController.armPointerDrag}), so\n * a live-swap that recycles this row's DOM can't break the gesture.\n */\n #handleReorderPointerDown = (event: PointerEvent) => {\n const reorder = this.state?.rowReorder;\n if (!reorder?.enabled || event.button !== 0 || !this.data) return;\n // Pinned rows are not reorder sources (F4 scope).\n if (this.state.rowPin.isPinned(this.data)) return;\n\n const path = event.composedPath();\n const onHandle = path.some(\n (node) =>\n node instanceof Element && (node.getAttribute?.('part') ?? '').includes('reorder-handle')\n );\n\n if (reorder.handleMode) {\n // Handle mode: only the grip starts a drag. The rest of the row stays free\n // for selection / editing / text selection.\n if (!onHandle) return;\n // Own the gesture: keep the grid's body handler from treating the press as\n // a cell interaction, and suppress native text/element drag-selection.\n event.preventDefault();\n event.stopPropagation();\n } else {\n // Whole-row mode: a drag begins anywhere except an interactive sub-part\n // (editor, checkbox, button).\n const target = path[0];\n if (\n target instanceof Element &&\n target.closest?.('input, button, a, select, textarea, [data-apex-editor]')\n ) {\n return;\n }\n }\n\n this.#dragStartX = event.clientX;\n this.#dragStartY = event.clientY;\n // The controller snapshots the ghost the instant the drag engages (the row\n // is still in place then), seeded from the original press point.\n reorder.armPointerDrag(\n this.data,\n () => this.#captureGhost(this.#dragStartX, this.#dragStartY),\n event\n );\n };\n\n /**\n * Snapshots the row's visible cells (text, width, alignment) and bounding rect\n * so the controller can paint a faithful floating ghost. Invoked once, at the\n * moment the drag engages.\n */\n #captureGhost(clientX: number, clientY: number): RowGhostInit {\n const rect = this.getBoundingClientRect();\n const cells = this.cells.map((cell) => {\n const el = cell as unknown as HTMLElement;\n return {\n text: (el.textContent ?? '').replace(/\\s+/g, ' ').trim(),\n width: el.getBoundingClientRect().width,\n align: getComputedStyle(el).textAlign,\n };\n });\n return { rect, clientX, clientY, cells };\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n this.setAttribute('exportparts', 'cell');\n this.setAttribute('role', 'row');\n this.addEventListener('pointerdown', this.#handleReorderPointerDown);\n }\n\n public override disconnectedCallback(): void {\n this.removeEventListener('pointerdown', this.#handleReorderPointerDown);\n super.disconnectedCallback();\n }\n\n /**\n * The number of \"chrome\" rows (header + filter) above the body. Used to\n * derive `aria-rowindex` from {@link index}. Set by the parent grid.\n */\n @property({ attribute: false, type: Number })\n public ariaRowOffset = 1;\n\n protected override willUpdate() {\n this.setAttribute('aria-rowindex', String(this.index + this.ariaRowOffset + 1));\n\n // Ask feature modules whether this row is rendered full-width (e.g. an\n // enterprise group header). When one owns it, the row is not a selectable\n // data row — it carries its own level/expanded semantics and skips the\n // selection/tree aria below.\n this.#presented = this.state\n ? this.state.presentRow(this.data, { columns: this.columns, rowIndex: this.index })\n : null;\n if (this.#presented) {\n this.selected = false;\n this.removeAttribute('aria-selected');\n if (typeof this.#presented.level === 'number') {\n this.setAttribute('aria-level', String(this.#presented.level));\n } else {\n this.removeAttribute('aria-level');\n }\n if (typeof this.#presented.expanded === 'boolean') {\n this.setAttribute('aria-expanded', this.#presented.expanded ? 'true' : 'false');\n } else {\n this.removeAttribute('aria-expanded');\n }\n return;\n }\n\n this.selected = Boolean(this.state?.selection.isSelected(this.data));\n this.expanded = Boolean(this.state?.expansion.isExpanded(this.data));\n if (this.state?.selection.enabled) {\n this.setAttribute('aria-selected', this.selected ? 'true' : 'false');\n } else {\n this.removeAttribute('aria-selected');\n }\n\n // Tree mode reports aria-level (1-based depth) and aria-expanded for\n // parent rows; expansion mode shares the same attribute on detail-panel\n // rows. Tree wins when both are enabled since it's the more structural\n // semantic (the row represents a tree node).\n const tree = this.state?.tree;\n const treeMeta = tree?.enabled ? tree.getMeta(this.data) : undefined;\n if (treeMeta) {\n this.setAttribute('aria-level', String(treeMeta.depth + 1));\n if (treeMeta.hasChildren) {\n this.setAttribute('aria-expanded', tree!.isExpanded(this.data) ? 'true' : 'false');\n } else {\n this.removeAttribute('aria-expanded');\n }\n } else {\n // A module may attach tree/expansion ARIA to a normal cell-rendered row\n // (e.g. pivoting's expandable parent rows, which keep their value cells).\n const aria = this.state?.describeRow(this.data, {\n columns: this.columns,\n rowIndex: this.index,\n });\n if (aria) {\n if (typeof aria.level === 'number') {\n this.setAttribute('aria-level', String(aria.level));\n } else {\n this.removeAttribute('aria-level');\n }\n if (typeof aria.expanded === 'boolean') {\n this.setAttribute('aria-expanded', aria.expanded ? 'true' : 'false');\n } else {\n this.removeAttribute('aria-expanded');\n }\n } else {\n this.removeAttribute('aria-level');\n if (this.state?.expansion.enabled) {\n this.setAttribute('aria-expanded', this.expanded ? 'true' : 'false');\n } else {\n this.removeAttribute('aria-expanded');\n }\n }\n }\n }\n\n /**\n * Leading row-number gutter cell (transient spreadsheet coordinate hint). Shown\n * only while `coordinateHints` is on; pinned rows render an empty spacer (their\n * band-local index is not a meaningful A1 row number) so the track stays\n * aligned. Presentational: the accessible row index is `aria-rowindex`.\n */\n protected renderRowNumber() {\n if (!this.coordinateHints) return nothing;\n const pinned = Boolean(this.state?.rowPin?.isPinned(this.data));\n return html`<div part=\"row-number-cell\" data-pinned=\"start\" aria-hidden=\"true\">\n ${pinned ? nothing : html`<span part=\"row-number\">${this.index + 1}</span>`}\n </div>`;\n }\n\n /**\n * Leading drag-handle (grip) cell. Rendered only in handle mode; pinned rows\n * get an empty spacer so the grid track stays aligned. The cell is\n * presentational (`aria-hidden`) — the accessible reorder path is the keyboard\n * grab flow, not this pointer affordance.\n */\n protected renderReorderHandle() {\n const reorder = this.state?.rowReorder;\n if (!reorder?.showHandleColumn) return nothing;\n const draggable = !this.state?.rowPin?.isPinned(this.data);\n return html`<div part=\"reorder-handle-cell\" data-pinned=\"start\" aria-hidden=\"true\">\n ${draggable ? html`<span part=\"reorder-handle\">${GRIP_ICON}</span>` : nothing}\n </div>`;\n }\n\n protected renderExpansionToggle(colindex: number) {\n const expansion = this.state?.expansion;\n if (!expansion?.showToggleColumn) return nothing;\n const canExpand = expansion.canExpand(this.data) || expansion.isExpanded(this.data);\n const expanded = this.expanded;\n const handleClick = (event: MouseEvent) => {\n event.stopPropagation();\n if (!canExpand) return;\n void expansion.toggleRow(this.data);\n };\n return html`<div\n part=\"expansion-cell\"\n role=\"gridcell\"\n aria-colindex=${colindex}\n data-pinned=\"start\"\n >\n <button\n type=\"button\"\n part=\"expansion-toggle\"\n aria-label=${\n expanded ? this.state.localize('row.collapse') : this.state.localize('row.expand')\n }\n aria-expanded=${expanded ? 'true' : 'false'}\n ?disabled=${!canExpand}\n @click=${handleClick}\n >\n <svg\n part=\"expansion-chevron\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n width=\"14\"\n height=\"14\"\n >\n <path\n d=\"M9 6l6 6-6 6\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n </div>`;\n }\n\n protected renderDetailPanel() {\n const expansion = this.state?.expansion;\n if (!expansion?.isExpanded(this.data)) return nothing;\n const template = this.state.host.expansion?.detailTemplate;\n if (typeof template !== 'function') return nothing;\n const content = template({\n data: this.data,\n rowIndex: this.index,\n parent: this.state.host,\n });\n return html`<div part=\"detail-panel\" role=\"region\" aria-label=${this.state.localize('row.detail')}>${content}</div>`;\n }\n\n protected renderSelectionCell(colindex: number) {\n if (!this.state?.selection.showCheckboxColumn) return nothing;\n const selected = this.selected;\n const handleChange = (event: Event) => {\n const mouseEvent = event as Event & {\n shiftKey?: boolean;\n ctrlKey?: boolean;\n metaKey?: boolean;\n };\n // The native `change` event on a checkbox doesn't expose modifier keys\n // — they're carried on the preceding `click`. We handle Shift/Ctrl in\n // the click listener below; the change handler covers keyboard toggles\n // (Space on a focused checkbox) which always behave as plain toggles.\n void mouseEvent;\n this.state.selection.toggleRow(this.data);\n };\n const handleClick = (event: MouseEvent) => {\n // Prevent the click from bubbling to the grid's body click handler\n // (which would otherwise re-target the active cell to a non-existent\n // selection column).\n event.stopPropagation();\n if (event.shiftKey && this.state.selection.mode === 'multiple') {\n event.preventDefault();\n void this.state.selection.rangeToggle(this.data);\n return;\n }\n if ((event.ctrlKey || event.metaKey) && this.state.selection.mode === 'multiple') {\n event.preventDefault();\n void this.state.selection.additiveToggle(this.data);\n return;\n }\n // Plain click: let the default checkbox toggle proceed; `change` will\n // commit the new state via `toggleRow`.\n };\n // The checkbox itself is 14x14, well under the 24x24 WCAG 2.2 AA minimum\n // (2.5.8), and growing it would make a chunky box out of a deliberately\n // small mark. Instead the whole cell is the target: a click anywhere in it\n // forwards to the checkbox, which is both compliant and what people expect\n // of a selection column. Clicks that land on the checkbox are left alone,\n // or the forward would toggle twice and cancel out.\n const forwardToCheckbox = (event: MouseEvent) => {\n const target = event.target as HTMLElement;\n if (target instanceof HTMLInputElement) return;\n event.currentTarget instanceof HTMLElement &&\n event.currentTarget.querySelector<HTMLInputElement>('input[type=\"checkbox\"]')?.click();\n };\n return html`<div\n part=\"selection-cell\"\n role=\"gridcell\"\n aria-colindex=${colindex}\n data-pinned=\"start\"\n @click=${forwardToCheckbox}\n >\n <input\n type=\"checkbox\"\n part=\"selection-checkbox\"\n aria-label=${this.state.localize('row.select')}\n .checked=${selected}\n @click=${handleClick}\n @change=${handleChange}\n />\n </div>`;\n }\n\n protected override render() {\n // Full-width module-rendered row (e.g. a group header): render the module's\n // content spanning all columns, like the master-detail panel, and skip the\n // normal selection/expansion/cell grid.\n if (this.#presented) {\n return html`<div part=${this.#presented.part ?? 'group-row'} style=\"grid-column: 1 / -1\">\n ${this.#presented.content}\n </div>`;\n }\n\n // A row index can transiently fall beyond the current data — e.g. while a\n // server-side / infinite row model resizes `data` on a filter or sort\n // change, the virtualizer may render a stale index for a frame. Render\n // nothing until the real item arrives, rather than dereferencing undefined.\n if (this.data == null) return nothing;\n\n const { column: key, row: index } = this.activeNode;\n\n // Track aria-colindex (1-based) across the auto chrome columns and the\n // data columns. Selection comes first, then expansion, then data.\n let colCursor = 0;\n const selectionCol = this.state?.selection.showCheckboxColumn ? ++colCursor : 0;\n const expansionCol = this.state?.expansion.showToggleColumn ? ++colCursor : 0;\n\n // Keyed by column.key so the same `<apex-grid-cell>` follows its\n // column through a reorder swap — required for the column-reorder FLIP\n // animation in ReorderController to track motion per cell.\n return html`\n ${this.renderRowNumber()}\n ${this.renderReorderHandle()}\n ${this.renderSelectionCell(selectionCol)}\n ${this.renderExpansionToggle(expansionCol)}\n ${repeat(\n this.columns,\n (column) => String(column.key),\n (column, colIndex) => {\n if (column.hidden) return nothing;\n const offset = this.pinOffsets.get(column.key);\n const pinStyle =\n column.pinned && typeof offset === 'number' ? `--apex-pin-offset:${offset}px` : '';\n const edge = getPinEdge(this.columns, colIndex);\n const editing = this.editingKey === column.key;\n const ariaColindex = ++colCursor;\n return html`<apex-grid-cell\n part=\"cell\"\n data-pinned=${column.pinned ?? 'none'}\n data-pin-edge=${edge ?? 'none'}\n data-cell-type=${column.type ?? 'string'}\n style=${pinStyle}\n .active=${key === column.key && index === this.index}\n .editing=${editing}\n .column=${column}\n .row=${this as ApexGridRow<T>}\n .value=${this.data[column.key]}\n .colindex=${ariaColindex}\n .decorationVersion=${this.decorationVersion}\n .validationVersion=${this.validationVersion}\n ></apex-grid-cell>`;\n }\n )}\n ${this.renderDetailPanel()}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [ApexGridRow.tagName]: ApexGridRow<object>;\n }\n}\n"]}
1
+ {"version":3,"file":"row.js","sourceRoot":"","sources":["../../src/components/row.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAwB,MAAM,yBAAyB,CAAC;AAEjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,YAAY,MAAM,WAAW,CAAC;AAGrC,MAAM,SAAS,GAAG,IAAI,CAAA;;;;;;;;;;;;;OA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CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CACpB;AAIhB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDACG;AAIxB;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;+CACU;AAQlC;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDAChB;AAQtB;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;gDACR;AAShB;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDAChB;AA+FtB;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDACpB","sourcesContent":["import { consume } from '@lit/context';\nimport { html, LitElement, nothing } from 'lit';\nimport { property, queryAll } from 'lit/decorators.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport type { RowGhostInit } from '../controllers/row-reorder.js';\nimport { gridStateContext, type StateController } from '../controllers/state.js';\nimport type { PresentedRow } from '../internal/feature-module.js';\nimport { registerComponent } from '../internal/register.js';\nimport { GRID_ROW_TAG } from '../internal/tags.js';\nimport type { ActiveNode, ColumnConfiguration, Keys } from '../internal/types.js';\nimport { getPinEdge } from '../internal/utils.js';\nimport { styles } from '../styles/body-row/body-row.css.js';\nimport ApexGridCell from './cell.js';\n\n/** The six-dot grip drawn inside the row-reorder drag handle. */\nconst GRIP_ICON = html`<svg\n part=\"reorder-grip\"\n viewBox=\"0 0 16 16\"\n width=\"16\"\n height=\"16\"\n aria-hidden=\"true\"\n>\n <circle cx=\"6\" cy=\"3.5\" r=\"1.25\" />\n <circle cx=\"10\" cy=\"3.5\" r=\"1.25\" />\n <circle cx=\"6\" cy=\"8\" r=\"1.25\" />\n <circle cx=\"10\" cy=\"8\" r=\"1.25\" />\n <circle cx=\"6\" cy=\"12.5\" r=\"1.25\" />\n <circle cx=\"10\" cy=\"12.5\" r=\"1.25\" />\n</svg>`;\n\n/**\n * Every part a row renders in its own shadow root. Rows live in the grid's\n * shadow root, so the row's `exportparts` is the whole surface that\n * `apex-grid::part(...)` can reach; a part missing here cannot be styled.\n * `group-row` is the default container part of a module-rendered row.\n */\nconst ROW_PARTS =\n 'cell,row-number-cell,row-number,reorder-handle-cell,reorder-handle,reorder-grip,selection-cell,selection-checkbox,expansion-cell,expansion-toggle,expansion-chevron,detail-panel,group-row';\n\n/**\n * Component representing the DOM row in the Apex grid.\n */\nexport default class ApexGridRow<T extends object> extends LitElement {\n public static get tagName() {\n return GRID_ROW_TAG;\n }\n public static override styles = styles;\n\n public static register(): void {\n registerComponent(ApexGridRow, ApexGridCell);\n }\n\n @queryAll(ApexGridCell.tagName)\n protected _cells!: NodeListOf<ApexGridCell<T>>;\n\n @property({ attribute: false })\n public data!: T;\n\n @property({ attribute: false })\n public columns: Array<ColumnConfiguration<T>> = [];\n\n /** Cumulative pin offsets (px) keyed by column key. */\n @property({ attribute: false })\n public pinOffsets: Map<unknown, number> = new Map();\n\n public get cells() {\n return Array.from(this._cells);\n }\n\n /**\n * The single focus target of a row a feature module renders full width (a\n * group header, a total row), or `null` for a normal cell-rendered row.\n * Keyboard navigation lands here, whatever the active column, so the body\n * keeps a tab stop on rows that render no cells.\n */\n public get presentedCell(): HTMLElement | null {\n return this.#presented\n ? this.renderRoot.querySelector<HTMLElement>('[data-presented-cell]')\n : null;\n }\n\n @consume({ context: gridStateContext, subscribe: true })\n @property({ attribute: false })\n public state!: StateController<T>;\n\n @property({ attribute: false })\n public activeNode!: ActiveNode<T>;\n\n @property({ attribute: false, type: Number })\n public index = -1;\n\n /** Reflects current selection state so SCSS can highlight the row. */\n @property({ type: Boolean, reflect: true })\n public selected = false;\n\n /** Reflects current expansion state so SCSS can rotate the chevron. */\n @property({ type: Boolean, reflect: true })\n public expanded = false;\n\n /** Reflects pointer-drag state (row reorder) so SCSS can dim the source. */\n @property({ type: Boolean, reflect: true })\n public dragging = false;\n\n /** Reflects keyboard-grab state (row reorder) so SCSS can outline the row. */\n @property({ type: Boolean, reflect: true })\n public grabbed = false;\n\n /** Reveal the spreadsheet row-number gutter cell (transient formula coordinate hint). */\n @property({ type: Boolean })\n public coordinateHints = false;\n\n /** The column key currently being edited in this row, or `null`. */\n @property({ attribute: false })\n public editingKey: Keys<T> | null = null;\n\n /**\n * Reactive token from {@link StateController.decorationVersion}, forwarded to\n * each cell so a decoration-only change re-renders the row's cells. Stays `0`\n * for the community grid.\n */\n @property({ attribute: false, type: Number })\n public decorationVersion = 0;\n\n /**\n * Reactive token from {@link StateController.dataVersion}, forwarded to each\n * cell so a pipeline run (edit, data change, tree toggle) refreshes the row's\n * ARIA and the cells that read their row. Stays `0` for pinned rows.\n */\n @property({ attribute: false })\n public dataVersion = 0;\n\n /**\n * Reactive token from {@link EditingController.validationVersion}, forwarded to\n * each cell so a validation-only change re-renders the row's cells (toggling\n * `aria-invalid` and the inline error node). Stays `0` until the first\n * validation failure.\n */\n @property({ attribute: false, type: Number })\n public validationVersion = 0;\n\n /**\n * Result of the feature-module row presenter for the current update, or\n * `null` when no module renders this row full-width (the normal case).\n * Computed in {@link willUpdate} and consumed in {@link render}.\n */\n #presented: PresentedRow | null = null;\n\n #dragStartX = 0;\n #dragStartY = 0;\n\n /**\n * Arms a row drag. In handle mode only the grip starts one; in whole-row mode\n * a press anywhere except an interactive sub-part does. The move / up plumbing\n * lives on the grid host (see {@link RowReorderController.armPointerDrag}), so\n * a live-swap that recycles this row's DOM can't break the gesture.\n */\n #handleReorderPointerDown = (event: PointerEvent) => {\n const reorder = this.state?.rowReorder;\n if (!reorder?.enabled || event.button !== 0 || !this.data) return;\n // Pinned rows are not reorder sources (F4 scope).\n if (this.state.rowPin.isPinned(this.data)) return;\n\n const path = event.composedPath();\n const onHandle = path.some(\n (node) =>\n node instanceof Element && (node.getAttribute?.('part') ?? '').includes('reorder-handle')\n );\n\n if (reorder.handleMode) {\n // Handle mode: only the grip starts a drag. The rest of the row stays free\n // for selection / editing / text selection.\n if (!onHandle) return;\n // Own the gesture: keep the grid's body handler from treating the press as\n // a cell interaction, and suppress native text/element drag-selection.\n event.preventDefault();\n event.stopPropagation();\n } else {\n // Whole-row mode: a drag begins anywhere except an interactive sub-part\n // (editor, checkbox, button).\n const target = path[0];\n if (\n target instanceof Element &&\n target.closest?.('input, button, a, select, textarea, [data-apex-editor]')\n ) {\n return;\n }\n }\n\n this.#dragStartX = event.clientX;\n this.#dragStartY = event.clientY;\n // The controller snapshots the ghost the instant the drag engages (the row\n // is still in place then), seeded from the original press point.\n reorder.armPointerDrag(\n this.data,\n () => this.#captureGhost(this.#dragStartX, this.#dragStartY),\n event\n );\n };\n\n /**\n * Snapshots the row's visible cells (text, width, alignment) and bounding rect\n * so the controller can paint a faithful floating ghost. Invoked once, at the\n * moment the drag engages.\n */\n #captureGhost(clientX: number, clientY: number): RowGhostInit {\n const rect = this.getBoundingClientRect();\n const cells = this.cells.map((cell) => {\n const el = cell as unknown as HTMLElement;\n return {\n text: (el.textContent ?? '').replace(/\\s+/g, ' ').trim(),\n width: el.getBoundingClientRect().width,\n align: getComputedStyle(el).textAlign,\n };\n });\n return { rect, clientX, clientY, cells };\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n this.setAttribute('role', 'row');\n this.addEventListener('pointerdown', this.#handleReorderPointerDown);\n }\n\n public override disconnectedCallback(): void {\n this.removeEventListener('pointerdown', this.#handleReorderPointerDown);\n super.disconnectedCallback();\n }\n\n /**\n * The number of \"chrome\" rows (header + filter) above the body. Used to\n * derive `aria-rowindex` from {@link index}. Set by the parent grid.\n */\n @property({ attribute: false, type: Number })\n public ariaRowOffset = 1;\n\n protected override willUpdate() {\n this.setAttribute('aria-rowindex', String(this.index + this.ariaRowOffset + 1));\n\n // Ask feature modules whether this row is rendered full-width (e.g. an\n // enterprise group header). When one owns it, the row is not a selectable\n // data row — it carries its own level/expanded semantics and skips the\n // selection/tree aria below.\n this.#presented = this.state\n ? this.state.presentRow(this.data, { columns: this.columns, rowIndex: this.index })\n : null;\n this.#syncExportParts();\n if (this.#presented) {\n this.selected = false;\n this.removeAttribute('aria-selected');\n if (typeof this.#presented.level === 'number') {\n this.setAttribute('aria-level', String(this.#presented.level));\n } else {\n this.removeAttribute('aria-level');\n }\n if (typeof this.#presented.expanded === 'boolean') {\n this.setAttribute('aria-expanded', this.#presented.expanded ? 'true' : 'false');\n } else {\n this.removeAttribute('aria-expanded');\n }\n return;\n }\n\n this.selected = Boolean(this.state?.selection.isSelected(this.data));\n this.expanded = Boolean(this.state?.expansion.isExpanded(this.data));\n if (this.state?.selection.enabled) {\n this.setAttribute('aria-selected', this.selected ? 'true' : 'false');\n } else {\n this.removeAttribute('aria-selected');\n }\n\n // Tree mode reports aria-level (1-based depth) and aria-expanded for\n // parent rows; expansion mode shares the same attribute on detail-panel\n // rows. Tree wins when both are enabled since it's the more structural\n // semantic (the row represents a tree node).\n const tree = this.state?.tree;\n const treeMeta = tree?.enabled ? tree.getMeta(this.data) : undefined;\n if (treeMeta) {\n this.setAttribute('aria-level', String(treeMeta.depth + 1));\n if (treeMeta.hasChildren) {\n this.setAttribute('aria-expanded', tree!.isExpanded(this.data) ? 'true' : 'false');\n } else {\n this.removeAttribute('aria-expanded');\n }\n } else {\n // A module may attach tree/expansion ARIA to a normal cell-rendered row\n // (e.g. pivoting's expandable parent rows, which keep their value cells).\n const aria = this.state?.describeRow(this.data, {\n columns: this.columns,\n rowIndex: this.index,\n });\n if (aria) {\n if (typeof aria.level === 'number') {\n this.setAttribute('aria-level', String(aria.level));\n } else {\n this.removeAttribute('aria-level');\n }\n if (typeof aria.expanded === 'boolean') {\n this.setAttribute('aria-expanded', aria.expanded ? 'true' : 'false');\n } else {\n this.removeAttribute('aria-expanded');\n }\n } else {\n this.removeAttribute('aria-level');\n if (this.state?.expansion.enabled) {\n this.setAttribute('aria-expanded', this.expanded ? 'true' : 'false');\n } else {\n this.removeAttribute('aria-expanded');\n }\n }\n }\n }\n\n /**\n * Re-exports the row's own parts plus the ones a module declares for the\n * content it renders here: a presented row's container part and\n * {@link PresentedRow.exportParts}, or the expansion config's\n * `exportParts` for the detail panel content. Re-run on every update, so a\n * row element the virtualizer reuses for another record drops the parts of\n * the one it showed before.\n */\n #syncExportParts() {\n // Runs on every row update, scroll recycling included, so the common\n // case (no extra parts) builds no arrays.\n const presented = this.#presented;\n const own = presented?.part?.split(' ').join(',');\n const list = presented ? presented.exportParts : this.state?.host.expansion?.exportParts;\n let value = ROW_PARTS;\n if (own) value += `,${own}`;\n if (list?.length) value += `,${list.join(',')}`;\n if (this.getAttribute('exportparts') !== value) {\n this.setAttribute('exportparts', value);\n }\n }\n\n /**\n * Leading row-number gutter cell (transient spreadsheet coordinate hint). Shown\n * only while `coordinateHints` is on. A feature module that addresses the data\n * (the enterprise formula engine) supplies the label, so it matches what a\n * reference reads; otherwise it is the view position, and pinned rows render\n * an empty spacer (their band-local index is not a meaningful row number) so\n * the track stays aligned. Presentational: the accessible row index is\n * `aria-rowindex`.\n */\n protected renderRowNumber() {\n if (!this.coordinateHints) return nothing;\n let label: string | number | null | undefined = this.state?.rowCoordinate(this.data);\n if (label === undefined) {\n label = this.state?.rowPin?.isPinned(this.data) ? null : this.index + 1;\n }\n return html`<div part=\"row-number-cell\" data-pinned=\"start\" aria-hidden=\"true\">\n ${label === null ? nothing : html`<span part=\"row-number\">${label}</span>`}\n </div>`;\n }\n\n /**\n * Leading drag-handle (grip) cell. Rendered only in handle mode; pinned rows\n * get an empty spacer so the grid track stays aligned. The cell is\n * presentational (`aria-hidden`) — the accessible reorder path is the keyboard\n * grab flow, not this pointer affordance.\n */\n protected renderReorderHandle() {\n const reorder = this.state?.rowReorder;\n if (!reorder?.showHandleColumn) return nothing;\n const draggable = !this.state?.rowPin?.isPinned(this.data);\n return html`<div part=\"reorder-handle-cell\" data-pinned=\"start\" aria-hidden=\"true\">\n ${draggable ? html`<span part=\"reorder-handle\">${GRIP_ICON}</span>` : nothing}\n </div>`;\n }\n\n protected renderExpansionToggle(colindex: number) {\n const expansion = this.state?.expansion;\n if (!expansion?.showToggleColumn) return nothing;\n const canExpand = expansion.canExpand(this.data) || expansion.isExpanded(this.data);\n const expanded = this.expanded;\n const handleClick = (event: MouseEvent) => {\n event.stopPropagation();\n if (!canExpand) return;\n void expansion.toggleRow(this.data);\n };\n return html`<div\n part=\"expansion-cell\"\n role=\"gridcell\"\n aria-colindex=${colindex}\n data-pinned=\"start\"\n >\n <button\n type=\"button\"\n part=\"expansion-toggle\"\n aria-label=${\n expanded ? this.state.localize('row.collapse') : this.state.localize('row.expand')\n }\n aria-expanded=${expanded ? 'true' : 'false'}\n ?disabled=${!canExpand}\n @click=${handleClick}\n >\n <svg\n part=\"expansion-chevron\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n width=\"14\"\n height=\"14\"\n >\n <path\n d=\"M9 6l6 6-6 6\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n </div>`;\n }\n\n protected renderDetailPanel() {\n const expansion = this.state?.expansion;\n if (!expansion?.isExpanded(this.data)) return nothing;\n const template = this.state.host.expansion?.detailTemplate;\n if (typeof template !== 'function') return nothing;\n const content = template({\n data: this.data,\n rowIndex: this.index,\n parent: this.state.host,\n });\n return html`<div part=\"detail-panel\" role=\"region\" aria-label=${this.state.localize('row.detail')}>${content}</div>`;\n }\n\n protected renderSelectionCell(colindex: number) {\n const selection = this.state?.selection;\n if (!selection?.showCheckboxColumn) return nothing;\n // Shift extends a range from the anchor and Ctrl or Cmd toggles one row\n // without moving it (multiple mode only). Shared by the checkbox and the\n // cell around it, so both give the same result for the same gesture.\n // Returns false for a plain click, which the checkbox toggles itself.\n const modifierToggle = (event: MouseEvent): boolean => {\n if (selection.mode !== 'multiple') return false;\n if (event.shiftKey) {\n void selection.rangeToggle(this.data);\n } else if (event.ctrlKey || event.metaKey) {\n void selection.additiveToggle(this.data);\n } else {\n return false;\n }\n return true;\n };\n // The native `change` carries no modifier keys (they ride on the click\n // above), so it covers plain clicks and Space on a focused checkbox. The\n // click has already flipped `checked`; a `rowSelecting` listener that\n // cancels leaves the row as it was without a re-render, so write the\n // real state back once the selection has decided.\n const handleChange = (event: Event) => {\n const input = event.target as HTMLInputElement;\n void selection.toggleRow(this.data).then(() => {\n input.checked = selection.isSelected(this.data);\n });\n };\n const handleClick = (event: MouseEvent) => {\n // Keeps checkbox clicks from bubbling to the cell's forwarder below and\n // to app click listeners on the grid (the grid's own body handler runs\n // in the capture phase and ignores this target).\n event.stopPropagation();\n // A modifier click is handled here, so cancel the native toggle.\n if (modifierToggle(event)) event.preventDefault();\n };\n // The checkbox itself is 14x14, well under the 24x24 WCAG 2.2 AA minimum\n // (2.5.8), and growing it would make a chunky box out of a deliberately\n // small mark. Instead the whole cell is the target: a click anywhere in it\n // acts like a click on the checkbox, modifiers included, which is both\n // compliant and what people expect of a selection column. Clicks that land\n // on the checkbox are left alone, or the forward would toggle twice and\n // cancel out.\n const forwardToCheckbox = (event: MouseEvent) => {\n if (event.target instanceof HTMLInputElement || modifierToggle(event)) return;\n (event.currentTarget as HTMLElement)\n .querySelector<HTMLInputElement>('input[type=\"checkbox\"]')\n ?.click();\n };\n return html`<div\n part=\"selection-cell\"\n role=\"gridcell\"\n aria-colindex=${colindex}\n data-pinned=\"start\"\n @click=${forwardToCheckbox}\n >\n <input\n type=\"checkbox\"\n part=\"selection-checkbox\"\n aria-label=${this.state.localize('row.select')}\n .checked=${this.selected}\n @click=${handleClick}\n @change=${handleChange}\n />\n </div>`;\n }\n\n protected override render() {\n // Full-width module-rendered row (e.g. a group header): render the module's\n // content spanning all columns, like the master-detail panel, and skip the\n // normal selection/expansion/cell grid.\n if (this.#presented) {\n const colspan =\n this.columns.filter((column) => !column.hidden).length +\n (this.state?.selection.showCheckboxColumn ? 1 : 0) +\n (this.state?.expansion.showToggleColumn ? 1 : 0);\n return html`<div\n part=${this.#presented.part ?? 'group-row'}\n role=\"gridcell\"\n aria-colindex=\"1\"\n aria-colspan=${Math.max(1, colspan)}\n tabindex=${this.activeNode?.row === this.index ? 0 : -1}\n data-presented-cell\n style=\"grid-column: 1 / -1\"\n >\n ${this.#presented.content}\n </div>`;\n }\n\n // A row index can transiently fall beyond the current data — e.g. while a\n // server-side / infinite row model resizes `data` on a filter or sort\n // change, the virtualizer may render a stale index for a frame. Render\n // nothing until the real item arrives, rather than dereferencing undefined.\n if (this.data == null) return nothing;\n\n const { column: key, row: index } = this.activeNode;\n\n // Track aria-colindex (1-based) across the auto chrome columns and the\n // data columns. Selection comes first, then expansion, then data.\n let colCursor = 0;\n const selectionCol = this.state?.selection.showCheckboxColumn ? ++colCursor : 0;\n const expansionCol = this.state?.expansion.showToggleColumn ? ++colCursor : 0;\n\n // Keyed by column.key so the same `<apex-grid-cell>` follows its\n // column through a reorder swap — required for the column-reorder FLIP\n // animation in ReorderController to track motion per cell.\n return html`\n ${this.renderRowNumber()}\n ${this.renderReorderHandle()}\n ${this.renderSelectionCell(selectionCol)}\n ${this.renderExpansionToggle(expansionCol)}\n ${repeat(\n this.columns,\n (column) => String(column.key),\n (column, colIndex) => {\n if (column.hidden) return nothing;\n const offset = this.pinOffsets.get(column.key);\n const pinStyle =\n column.pinned && typeof offset === 'number' ? `--apex-pin-offset:${offset}px` : '';\n const edge = getPinEdge(this.columns, colIndex);\n const editing = this.editingKey === column.key;\n const ariaColindex = ++colCursor;\n return html`<apex-grid-cell\n part=\"cell\"\n data-pinned=${column.pinned ?? 'none'}\n data-pin-edge=${edge ?? 'none'}\n data-cell-type=${column.type ?? 'string'}\n style=${pinStyle}\n .active=${key === column.key && index === this.index}\n .editing=${editing}\n .column=${column}\n .row=${this as ApexGridRow<T>}\n .value=${this.data[column.key]}\n .colindex=${ariaColindex}\n .rowIndex=${this.index}\n .decorationVersion=${this.decorationVersion}\n .dataVersion=${this.dataVersion}\n .validationVersion=${this.validationVersion}\n ></apex-grid-cell>`;\n }\n )}\n ${this.renderDetailPanel()}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [ApexGridRow.tagName]: ApexGridRow<object>;\n }\n}\n"]}
@@ -89,7 +89,8 @@ export default class ApexGridToolbar extends LitElement {
89
89
  };
90
90
  this.#handleMenuKeydown = (event) => {
91
91
  const items = Array.from(this.exportMenuEl?.querySelectorAll('[role="menuitem"]') ?? []);
92
- const current = items.indexOf(document.activeElement);
92
+ const root = this.exportMenuEl?.getRootNode();
93
+ const current = items.indexOf(root?.activeElement);
93
94
  if (event.key === 'ArrowDown' || event.key === 'Down') {
94
95
  event.preventDefault();
95
96
  items[(current + 1) % items.length]?.focus();