@dxos/lit-grid 0.6.11 → 0.6.12-main.15a606f

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/dx-grid.ts", "../../../src/types.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { LitElement, html } from 'lit';\nimport { customElement, state, property, eventOptions } from 'lit/decorators.js';\nimport { ref, createRef, type Ref } from 'lit/directives/ref.js';\n\nimport { DxAxisResize, type DxAxisResizeProps, type DxGridAxis } from './types';\n\n/**\n * The size in pixels of the gap between cells\n */\nconst gap = 1;\n\n/**\n * This should be about the width of the `1` numeral so resize is triggered as the row header column’s intrinsic size\n * changes when scrolling vertically.\n */\nconst resizeTolerance = 8;\n\n//\n// `overscan` is the number of columns or rows to render outside of the viewport\n//\nconst overscanCol = 1;\nconst overscanRow = 1;\n\n//\n// `size`, when suffixed with ‘row’ or ‘col’, are limits on size applied when resizing\n//\nconst sizeColMin = 32;\nconst sizeColMax = 1024;\nconst sizeRowMin = 16;\nconst sizeRowMax = 1024;\n\n/**\n * Separator for serializing cell position vectors\n */\nconst separator = ',';\n\n//\n// A1 notation is the fallback for numbering columns and rows.\n//\n\nconst colToA1Notation = (col: number): string => {\n return (\n (col >= 26 ? String.fromCharCode('A'.charCodeAt(0) + Math.floor(col / 26) - 1) : '') +\n String.fromCharCode('A'.charCodeAt(0) + (col % 26))\n );\n};\n\nconst rowToA1Notation = (row: number): string => {\n return `${row + 1}`;\n};\n\nexport type CellValue = {\n /**\n * The content value\n */\n value: string;\n /**\n * If this is a merged cell, the bottomright-most of the range in numeric notation, otherwise undefined.\n */\n end?: string;\n /**\n * CSS inline styles to apply to the gridcell element\n */\n style?: string;\n};\n\ntype AxisMeta = {\n size: number;\n description?: string;\n resizeable?: boolean;\n};\n\nexport type DxGridProps = Partial<Pick<DxGrid, 'cells' | 'rows' | 'columns' | 'rowDefault' | 'columnDefault'>>;\n\nconst localChId = (c0: number) => `ch--${c0}`;\nconst localRhId = (r0: number) => `rh--${r0}`;\n\nconst getPage = (axis: string, event: PointerEvent) => (axis === 'col' ? event.pageX : event.pageY);\n\n@customElement('dx-grid')\nexport class DxGrid extends LitElement {\n @property({ type: Object })\n rowDefault: AxisMeta = { size: 32 };\n\n @property({ type: Object })\n columnDefault: AxisMeta = { size: 180 };\n\n @property({ type: Object })\n rows: Record<string, AxisMeta> = {};\n\n @property({ type: Object })\n columns: Record<string, AxisMeta> = {};\n\n @property({ type: Object })\n cells: Record<string, CellValue> = {};\n\n //\n // `pos`, short for ‘position’, is the position in pixels of the viewport from the origin.\n //\n\n @state()\n posInline = 0;\n\n @state()\n posBlock = 0;\n\n //\n // `size` (when not suffixed with ‘row’ or ‘col’, see above) is the size in pixels of the viewport.\n //\n\n @state()\n sizeInline = 0;\n\n @state()\n sizeBlock = 0;\n\n //\n // `overscan` is the amount in pixels to offset the grid content due to the number of overscanned columns or rows.\n //\n\n @state()\n overscanInline = 0;\n\n @state()\n overscanBlock = 0;\n\n //\n // `bin`, not short for anything, is the range in pixels within which virtualization does not need to reassess.\n //\n\n @state()\n binInlineMin = 0;\n\n @state()\n binInlineMax = this.colSize(0);\n\n @state()\n binBlockMin = 0;\n\n @state()\n binBlockMax = this.rowSize(0);\n\n //\n // `vis`, short for ‘visible’, is the range in numeric index of the columns or rows which should be rendered within\n // the viewport. These start with naïve values that are updated before first contentful render.\n //\n\n @state()\n visColMin = 0;\n\n @state()\n visColMax = 1;\n\n @state()\n visRowMin = 0;\n\n @state()\n visRowMax = 1;\n\n //\n // `template` is the rendered value of `grid-{axis}-template`.\n //\n @state()\n templateColumns = `${this.colSize(0)}px`;\n\n @state()\n templateRows = `${this.rowSize(0)}px`;\n\n //\n // Resize state and handlers\n //\n\n @state()\n colSizes: Record<string, number> = {};\n\n @state()\n rowSizes: Record<string, number> = {};\n\n @state()\n resizing: null | (DxAxisResizeProps & { page: number }) = null;\n\n handlePointerDown = (event: PointerEvent) => {\n const actionEl = (event.target as HTMLElement)?.closest('[data-dx-grid-action]');\n const action = actionEl?.getAttribute('data-dx-grid-action');\n if (action) {\n if (action.startsWith('resize')) {\n const [resize, index] = action.split(',');\n const [_, axis] = resize.split('-');\n this.resizing = {\n axis: axis as DxGridAxis,\n size: axis === 'col' ? this.colSize(index) : this.rowSize(index),\n page: getPage(axis, event),\n index,\n };\n }\n }\n };\n\n handlePointerUp = (_event: PointerEvent) => {\n if (this.resizing) {\n const resizeEvent = new DxAxisResize({\n axis: this.resizing.axis,\n index: this.resizing.index,\n size: this[this.resizing.axis === 'col' ? 'colSize' : 'rowSize'](this.resizing.index),\n });\n this.dispatchEvent(resizeEvent);\n this.resizing = null;\n }\n };\n\n handlePointerMove = (event: PointerEvent) => {\n if (this.resizing) {\n const delta = getPage(this.resizing.axis, event) - this.resizing.page;\n if (this.resizing.axis === 'col') {\n const nextSize = Math.max(sizeColMin, Math.min(sizeColMax, this.resizing.size + delta));\n this.colSizes = { ...this.colSizes, [this.resizing.index]: nextSize };\n this.updateVisInline();\n } else {\n const nextSize = Math.max(sizeRowMin, Math.min(sizeRowMax, this.resizing.size + delta));\n this.rowSizes = { ...this.rowSizes, [this.resizing.index]: nextSize };\n this.updateVisBlock();\n }\n }\n };\n\n //\n // Accessors\n //\n\n private colSize(c: number | string) {\n return this.colSizes?.[c] ?? this.columnDefault.size;\n }\n\n private rowSize(r: number | string) {\n return this.rowSizes?.[r] ?? this.rowDefault.size;\n }\n\n private getCell(c: number | string, r: number | string) {\n return this.cells[`${c}${separator}${r}`];\n }\n\n //\n // Resize & reposition handlers, observer, ref\n //\n\n @state()\n observer = new ResizeObserver((entries) => {\n const { inlineSize, blockSize } = entries?.[0]?.contentBoxSize?.[0] ?? {\n inlineSize: 0,\n blockSize: 0,\n };\n if (\n Math.abs(inlineSize - this.sizeInline) > resizeTolerance ||\n Math.abs(blockSize - this.sizeBlock) > resizeTolerance\n ) {\n // console.info('[updating bounds]', 'resize', [inlineSize - this.sizeInline, blockSize - this.sizeBlock]);\n this.sizeInline = inlineSize;\n this.sizeBlock = blockSize;\n this.updateVis();\n }\n });\n\n viewportRef: Ref<HTMLDivElement> = createRef();\n\n handleWheel = ({ deltaX, deltaY }: WheelEvent) => {\n this.posInline = Math.max(0, this.posInline + deltaX);\n this.posBlock = Math.max(0, this.posBlock + deltaY);\n if (\n this.posInline >= this.binInlineMin &&\n this.posInline < this.binInlineMax &&\n this.posBlock >= this.binBlockMin &&\n this.posBlock < this.binBlockMax\n ) {\n // do nothing\n } else {\n // console.info(\n // '[updating bounds]',\n // 'wheel',\n // [this.binInlineMin, this.posInline, this.binInlineMax],\n // [this.binBlockMin, this.posBlock, this.binBlockMax],\n // );\n this.updateVis();\n }\n };\n\n private updateVisInline() {\n // todo: avoid starting from zero\n let colIndex = 0;\n let pxInline = this.colSize(colIndex);\n\n while (pxInline < this.posInline) {\n colIndex += 1;\n pxInline += this.colSize(colIndex) + gap;\n }\n\n this.visColMin = colIndex - overscanCol;\n\n this.binInlineMin = pxInline - this.colSize(colIndex) - gap;\n this.binInlineMax = pxInline + gap;\n\n this.overscanInline =\n [...Array(overscanCol)].reduce((acc, _, c0) => {\n acc += this.colSize(this.visColMin + c0);\n return acc;\n }, 0) +\n gap * (overscanCol - 1);\n\n while (pxInline < this.binInlineMax + this.sizeInline + gap) {\n colIndex += 1;\n pxInline += this.colSize(colIndex) + gap;\n }\n\n this.visColMax = colIndex + overscanCol;\n\n this.templateColumns = [...Array(this.visColMax - this.visColMin)]\n .map((_, c0) => `${this.colSize(this.visColMin + c0)}px`)\n .join(' ');\n }\n\n private updateVisBlock() {\n // todo: avoid starting from zero\n let rowIndex = 0;\n let pxBlock = this.rowSize(rowIndex);\n\n while (pxBlock < this.posBlock) {\n rowIndex += 1;\n pxBlock += this.rowSize(rowIndex) + gap;\n }\n\n this.visRowMin = rowIndex - overscanRow;\n\n this.binBlockMin = pxBlock - this.rowSize(rowIndex) - gap;\n this.binBlockMax = pxBlock + gap;\n\n this.overscanBlock =\n [...Array(overscanRow)].reduce((acc, _, r0) => {\n acc += this.rowSize(this.visRowMin + r0);\n return acc;\n }, 0) +\n gap * (overscanRow - 1);\n\n while (pxBlock < this.binBlockMax + this.sizeBlock) {\n rowIndex += 1;\n pxBlock += this.rowSize(rowIndex) + gap;\n }\n\n this.visRowMax = rowIndex + overscanRow;\n\n this.templateRows = [...Array(this.visRowMax - this.visRowMin)]\n .map((_, r0) => `${this.rowSize(this.visRowMin + r0)}px`)\n .join(' ');\n }\n\n private updateVis() {\n this.updateVisInline();\n this.updateVisBlock();\n }\n\n // Focus handlers\n\n @state()\n focusedCell: Record<DxGridAxis, number> = { col: 0, row: 0 };\n\n @state()\n focusActive: boolean = false;\n\n @eventOptions({ capture: true })\n handleFocus(event: FocusEvent) {\n const target = event.target as HTMLElement;\n const action = target.getAttribute('data-dx-grid-action');\n if (action === 'cell') {\n const c = parseInt(target.getAttribute('aria-colindex') ?? 'never');\n const r = parseInt(target.getAttribute('aria-rowindex') ?? 'never');\n this.focusedCell = { col: c, row: r };\n this.focusActive = true;\n }\n }\n\n @eventOptions({ capture: true })\n handleBlur(event: FocusEvent) {\n // Only unset `focusActive` if focus is not moving to an element within the grid.\n if (\n !event.relatedTarget ||\n (event.relatedTarget as HTMLElement).closest('.dx-grid__viewport') !== this.viewportRef.value\n ) {\n this.focusActive = false;\n }\n }\n\n /**\n * Moves focus to the cell with actual focus, otherwise moves focus to the viewport.\n */\n refocus() {\n (this.focusedCell.row < this.visRowMin ||\n this.focusedCell.row > this.visRowMax ||\n this.focusedCell.col < this.visColMin ||\n this.focusedCell.col > this.visColMax\n ? this.viewportRef.value\n : (this.viewportRef.value?.querySelector(\n `[aria-colindex=\"${this.focusedCell.col}\"][aria-rowindex=\"${this.focusedCell.row}\"]`,\n ) as HTMLElement | null)\n )?.focus({ preventScroll: true });\n }\n\n /**\n * Updates `pos` so that a cell in focus is fully within the viewport\n */\n snapPosToFocusedCell() {\n if (\n this.focusedCell.col < this.visColMin ||\n this.focusedCell.col > this.visColMax ||\n this.focusedCell.row < this.visRowMin ||\n this.focusedCell.row > this.visRowMax\n ) {\n // console.warn('Snapping position to a focused cell that is not already mounted is unsupported.');\n } else if (\n this.focusedCell.col > this.visColMin + overscanCol &&\n this.focusedCell.col < this.visColMax - overscanCol - 1 &&\n this.focusedCell.row > this.visRowMin + overscanRow &&\n this.focusedCell.row < this.visRowMax - overscanRow - 1\n ) {\n // console.log(\n // '[within bounds]',\n // this.focusedCell,\n // [this.visColMin, this.visColMax, overscanCol],\n // [this.visRowMin, this.visRowMax, overscanRow],\n // );\n } else {\n if (this.focusedCell.col <= this.visColMin + overscanCol) {\n this.posInline = this.binInlineMin;\n this.updateVisInline();\n } else if (this.focusedCell.col >= this.visColMax - overscanCol - 1) {\n const sizeSumCol = [...Array(this.focusedCell.col - this.visColMin)].reduce((acc, _, c0) => {\n acc += this.colSize(this.visColMin + overscanCol + c0) + gap;\n return acc;\n }, 0);\n this.posInline = this.binInlineMin + sizeSumCol + gap * 2 - this.sizeInline;\n this.updateVisInline();\n }\n\n if (this.focusedCell.row <= this.visRowMin + overscanRow) {\n this.posBlock = this.binBlockMin;\n this.updateVisBlock();\n } else if (this.focusedCell.row >= this.visRowMax - overscanRow - 1) {\n const sizeSumRow = [...Array(this.focusedCell.row - this.visRowMin)].reduce((acc, _, r0) => {\n acc += this.rowSize(this.visRowMin + overscanRow + r0) + gap;\n return acc;\n }, 0);\n this.posBlock = this.binBlockMin + sizeSumRow + gap * 2 - this.sizeBlock;\n this.updateVisBlock();\n }\n }\n }\n\n // Keyboard interactions\n handleKeydown(event: KeyboardEvent) {\n if (this.focusActive) {\n // Adjust state\n switch (event.key) {\n case 'ArrowDown':\n this.focusedCell = { ...this.focusedCell, row: this.focusedCell.row + 1 };\n break;\n case 'ArrowUp':\n this.focusedCell = { ...this.focusedCell, row: Math.max(0, this.focusedCell.row - 1) };\n break;\n case 'ArrowRight':\n this.focusedCell = { ...this.focusedCell, col: this.focusedCell.col + 1 };\n break;\n case 'ArrowLeft':\n this.focusedCell = { ...this.focusedCell, col: Math.max(0, this.focusedCell.col - 1) };\n break;\n }\n // Handle virtualization & focus consequences\n switch (event.key) {\n case 'ArrowDown':\n case 'ArrowUp':\n case 'ArrowRight':\n case 'ArrowLeft':\n event.preventDefault();\n this.snapPosToFocusedCell();\n break;\n }\n }\n }\n\n //\n // Render and other lifecycle methods\n //\n\n override render() {\n const visibleCols = this.visColMax - this.visColMin;\n const visibleRows = this.visRowMax - this.visRowMin;\n const offsetInline = gap + this.binInlineMin - this.posInline - this.overscanInline;\n const offsetBlock = gap + this.binBlockMin - this.posBlock - this.overscanBlock;\n\n return html`<div\n role=\"none\"\n class=\"dx-grid\"\n @pointerdown=${this.handlePointerDown}\n @pointerup=${this.handlePointerUp}\n @pointermove=${this.handlePointerMove}\n @focus=${this.handleFocus}\n @blur=${this.handleBlur}\n @keydown=${this.handleKeydown}\n >\n <div role=\"none\" class=\"dx-grid__corner\"></div>\n <div role=\"none\" class=\"dx-grid__columnheader\">\n <div\n role=\"none\"\n class=\"dx-grid__columnheader__content\"\n style=\"transform:translate3d(${offsetInline}px,0,0);grid-template-columns:${this.templateColumns};\"\n >\n ${[...Array(visibleCols)].map((_, c0) => {\n const c = this.visColMin + c0;\n return html`<div\n role=\"columnheader\"\n ?inert=${c < 0}\n style=\"block-size:${this.rowDefault.size}px;grid-column:${c0 + 1}/${c0 + 2};\"\n >\n <span id=${localChId(c0)}>${colToA1Notation(c)}</span>\n ${(this.columns[c]?.resizeable ?? this.columnDefault.resizeable) &&\n html`<button class=\"dx-grid__resize-handle\" data-dx-grid-action=${`resize-col,${c}`}>\n <span class=\"sr-only\">Resize</span>\n </button>`}\n </div>`;\n })}\n </div>\n </div>\n <div role=\"none\" class=\"dx-grid__corner\"></div>\n <div role=\"none\" class=\"dx-grid__rowheader\">\n <div\n role=\"none\"\n class=\"dx-grid__rowheader__content\"\n style=\"transform:translate3d(0,${offsetBlock}px,0);grid-template-rows:${this.templateRows};\"\n >\n ${[...Array(visibleRows)].map((_, r0) => {\n const r = this.visRowMin + r0;\n return html`<div role=\"rowheader\" ?inert=${r < 0} style=\"grid-row:${r0 + 1}/${r0 + 2}\">\n <span id=${localRhId(r0)}>${rowToA1Notation(r)}</span>\n ${(this.rows[r]?.resizeable ?? this.rowDefault.resizeable) &&\n html`<button class=\"dx-grid__resize-handle\" data-dx-grid-action=${`resize-row,${r}`}>\n <span class=\"sr-only\">Resize</span>\n </button>`}\n </div>`;\n })}\n </div>\n </div>\n <div role=\"grid\" class=\"dx-grid__viewport\" tabindex=\"0\" @wheel=${this.handleWheel} ${ref(this.viewportRef)}>\n <div\n role=\"none\"\n class=\"dx-grid__content\"\n style=\"transform:translate3d(${offsetInline}px,${offsetBlock}px,0);grid-template-columns:${this\n .templateColumns};grid-template-rows:${this.templateRows};\"\n >\n ${[...Array(visibleCols)].map((_, c0) => {\n return [...Array(visibleRows)].map((_, r0) => {\n const c = c0 + this.visColMin;\n const r = r0 + this.visRowMin;\n const cell = this.getCell(c, r);\n return html`<div\n role=\"gridcell\"\n tabindex=\"0\"\n ?inert=${c < 0 || r < 0}\n aria-rowindex=${r}\n aria-colindex=${c}\n data-dx-grid-action=\"cell\"\n style=\"grid-column:${c0 + 1};grid-row:${r0 + 1}\"\n >\n ${cell?.value}\n </div>`;\n });\n })}\n </div>\n </div>\n <div role=\"none\" class=\"dx-grid__scrollbar\" aria-orientation=\"vertical\">\n <div role=\"none\" class=\"dx-grid__scrollbar__thumb\"></div>\n </div>\n <div role=\"none\" class=\"dx-grid__corner\"></div>\n <div role=\"none\" class=\"dx-grid__scrollbar\" aria-orientation=\"horizontal\">\n <div role=\"none\" class=\"dx-grid__scrollbar__thumb\"></div>\n </div>\n <div role=\"none\" class=\"dx-grid__corner\"></div>\n </div>`;\n }\n\n override firstUpdated() {\n this.observer.observe(this.viewportRef.value!);\n this.colSizes = Object.entries(this.columns).reduce((acc: Record<string, number>, [colId, colMeta]) => {\n if (colMeta?.size) {\n acc[colId] = colMeta.size;\n }\n return acc;\n }, {});\n this.rowSizes = Object.entries(this.rows).reduce((acc: Record<string, number>, [rowId, rowMeta]) => {\n if (rowMeta?.size) {\n acc[rowId] = rowMeta.size;\n }\n return acc;\n }, {});\n }\n\n override updated(changedProperties: Map<string, any>) {\n // Update the focused element if there is a change in bounds (otherwise Lit keeps focus on the relative element).\n if (\n this.focusActive &&\n (changedProperties.has('visRowMin') || changedProperties.has('visColMin') || changedProperties.has('focusedCell'))\n ) {\n this.refocus();\n }\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n // console.log('[disconnected]', this.viewportRef.value);\n // TODO(thure): Will this even work?\n if (this.viewportRef.value) {\n this.observer.unobserve(this.viewportRef.value);\n }\n }\n\n override createRenderRoot() {\n return this;\n }\n}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nexport type DxGridAxis = 'row' | 'col';\n\nexport type DxAxisResizeProps = Pick<DxAxisResize, 'axis' | 'index' | 'size'>;\n\nexport class DxAxisResize extends Event {\n public readonly axis: DxGridAxis;\n public readonly index: string;\n public readonly size: number;\n constructor(props: DxAxisResizeProps) {\n super('dx-axis-resize');\n this.axis = props.axis;\n this.index = props.index;\n this.size = props.size;\n }\n}\n"],
5
- "mappings": ";AAIA,SAASA,YAAYC,YAAY;AACjC,SAASC,eAAeC,OAAOC,UAAUC,oBAAoB;AAC7D,SAASC,KAAKC,iBAA2B;;;ACElC,IAAMC,eAAN,cAA2BC,MAAAA;EAIhCC,YAAYC,OAA0B;AACpC,UAAM,gBAAA;AACN,SAAKC,OAAOD,MAAMC;AAClB,SAAKC,QAAQF,MAAME;AACnB,SAAKC,OAAOH,MAAMG;EACpB;AACF;;;;;;;;;ADLA,IAAMC,MAAM;AAMZ,IAAMC,kBAAkB;AAKxB,IAAMC,cAAc;AACpB,IAAMC,cAAc;AAKpB,IAAMC,aAAa;AACnB,IAAMC,aAAa;AACnB,IAAMC,aAAa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FVuH,MAAAA;GA/FUvH,OAAAA,WAAAA,YAAAA,MAAAA;;EAkGVuH,MAAAA;GAlGUvH,OAAAA,WAAAA,YAAAA,MAAAA;;EAqKVuH,MAAAA;GArKUvH,OAAAA,WAAAA,YAAAA,MAAAA;;EAwRVuH,MAAAA;GAxRUvH,OAAAA,WAAAA,eAAAA,MAAAA;;EA2RVuH,MAAAA;GA3RUvH,OAAAA,WAAAA,eAAAA,MAAAA;;EA8RVwH,aAAa;IAAEC,SAAS;EAAK,CAAA;GA9RnBzH,OAAAA,WAAAA,eAAAA,IAAAA;;EA0SVwH,aAAa;IAAEC,SAAS;EAAK,CAAA;GA1SnBzH,OAAAA,WAAAA,cAAAA,IAAAA;AAAAA,SAAAA,aAAAA;EADZ0H,cAAc,SAAA;GACF1H,MAAAA;",
6
- "names": ["LitElement", "html", "customElement", "state", "property", "eventOptions", "ref", "createRef", "DxAxisResize", "Event", "constructor", "props", "axis", "index", "size", "gap", "resizeTolerance", "overscanCol", "overscanRow", "sizeColMin", "sizeColMax", "sizeRowMin", "sizeRowMax", "separator", "colToA1Notation", "col", "String", "fromCharCode", "charCodeAt", "Math", "floor", "rowToA1Notation", "row", "localChId", "c0", "localRhId", "r0", "getPage", "axis", "event", "pageX", "pageY", "DxGrid", "LitElement", "rowDefault", "size", "columnDefault", "rows", "columns", "cells", "posInline", "posBlock", "sizeInline", "sizeBlock", "overscanInline", "overscanBlock", "binInlineMin", "binInlineMax", "colSize", "binBlockMin", "binBlockMax", "rowSize", "visColMin", "visColMax", "visRowMin", "visRowMax", "templateColumns", "templateRows", "colSizes", "rowSizes", "resizing", "handlePointerDown", "actionEl", "target", "closest", "action", "getAttribute", "startsWith", "resize", "index", "split", "_", "page", "handlePointerUp", "_event", "resizeEvent", "DxAxisResize", "dispatchEvent", "handlePointerMove", "delta", "nextSize", "max", "min", "updateVisInline", "updateVisBlock", "observer", "ResizeObserver", "entries", "inlineSize", "blockSize", "contentBoxSize", "abs", "updateVis", "viewportRef", "createRef", "handleWheel", "deltaX", "deltaY", "focusedCell", "focusActive", "c", "r", "getCell", "colIndex", "pxInline", "Array", "reduce", "acc", "map", "join", "rowIndex", "pxBlock", "handleFocus", "parseInt", "handleBlur", "relatedTarget", "value", "refocus", "querySelector", "focus", "preventScroll", "snapPosToFocusedCell", "sizeSumCol", "sizeSumRow", "handleKeydown", "key", "preventDefault", "render", "visibleCols", "visibleRows", "offsetInline", "offsetBlock", "html", "resizeable", "ref", "cell", "firstUpdated", "observe", "Object", "colId", "colMeta", "rowId", "rowMeta", "updated", "changedProperties", "has", "disconnectedCallback", "unobserve", "createRenderRoot", "property", "type", "state", "eventOptions", "capture", "customElement"]
3
+ "sources": ["../../../src/dx-grid.ts", "../../../src/util.ts", "../../../src/types.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { LitElement, html, nothing } from 'lit';\nimport { customElement, state, property, eventOptions } from 'lit/decorators.js';\nimport { ref, createRef, type Ref } from 'lit/directives/ref.js';\n\nimport {\n type AxisMeta,\n type CellIndex,\n type CellValue,\n DxAxisResize,\n DxEditRequest,\n type DxGridAxis,\n DxGridCellsSelect,\n type DxGridMode,\n type DxGridPointer,\n type DxGridPosition,\n type DxGridPositionNullable,\n} from './types';\nimport { separator, toCellIndex } from './util';\n\n/**\n * The size in pixels of the gap between cells\n */\nconst gap = 1;\n\n/**\n * This should be about the width of the `1` numeral so resize is triggered as the row header column’s intrinsic size\n * changes when scrolling vertically.\n */\nconst resizeTolerance = 8;\n\n//\n// `overscan` is the number of columns or rows to render outside of the viewport\n//\nconst overscanCol = 1;\nconst overscanRow = 1;\n\n//\n// `size`, when suffixed with ‘row’ or ‘col’, are limits on size applied when resizing\n//\nconst sizeColMin = 32;\nconst sizeColMax = 1024;\nconst sizeRowMin = 16;\nconst sizeRowMax = 1024;\n\n//\n// A1 notation is the fallback for numbering columns and rows.\n//\n\nconst colToA1Notation = (col: number): string => {\n return (\n (col >= 26 ? String.fromCharCode('A'.charCodeAt(0) + Math.floor(col / 26) - 1) : '') +\n String.fromCharCode('A'.charCodeAt(0) + (col % 26))\n );\n};\n\nconst rowToA1Notation = (row: number): string => {\n return `${row + 1}`;\n};\n\nconst closestAction = (target: EventTarget | null): { action: string | null; actionEl: HTMLElement | null } => {\n const actionEl: HTMLElement | null = (target as HTMLElement | null)?.closest('[data-dx-grid-action]') ?? null;\n return { actionEl, action: actionEl?.getAttribute('data-dx-grid-action') ?? null };\n};\n\nconst closestCell = (target: EventTarget | null, actionEl?: HTMLElement | null): DxGridPositionNullable => {\n let cellElement = actionEl;\n if (!cellElement) {\n const { action, actionEl } = closestAction(target);\n if (action === 'cell') {\n cellElement = actionEl as HTMLElement;\n }\n }\n if (cellElement) {\n const col = parseInt(cellElement.getAttribute('aria-colindex') ?? 'never');\n const row = parseInt(cellElement.getAttribute('aria-rowindex') ?? 'never');\n return { col, row };\n } else {\n return null;\n }\n};\n\nconst isSameCell = (a: DxGridPositionNullable, b: DxGridPositionNullable) =>\n a && b && Number.isFinite(a.col) && Number.isFinite(a.row) && a.col === b.col && a.row === b.row;\n\nconst localChId = (c0: number) => `ch--${c0}`;\nconst localRhId = (r0: number) => `rh--${r0}`;\n\nconst getPage = (axis: string, event: PointerEvent) => (axis === 'col' ? event.pageX : event.pageY);\n\n@customElement('dx-grid')\nexport class DxGrid extends LitElement {\n @property({ type: String })\n gridId: string = 'default-grid-id';\n\n @property({ type: Object })\n rowDefault: AxisMeta = { size: 32 };\n\n @property({ type: Object })\n columnDefault: AxisMeta = { size: 180 };\n\n @property({ type: Object })\n rows: Record<string, AxisMeta> = {};\n\n @property({ type: Object })\n columns: Record<string, AxisMeta> = {};\n\n @property({ type: Object })\n cells: Record<CellIndex, CellValue> = {};\n\n @property({ type: String })\n mode: DxGridMode = 'browse';\n\n //\n // `pos`, short for ‘position’, is the position in pixels of the viewport from the origin.\n //\n\n @state()\n private posInline = 0;\n\n @state()\n private posBlock = 0;\n\n //\n // `size` (when not suffixed with ‘row’ or ‘col’, see above) is the size in pixels of the viewport.\n //\n\n @state()\n private sizeInline = 0;\n\n @state()\n private sizeBlock = 0;\n\n //\n // `overscan` is the amount in pixels to offset the grid content due to the number of overscanned columns or rows.\n //\n\n @state()\n private overscanInline = 0;\n\n @state()\n private overscanBlock = 0;\n\n //\n // `bin`, not short for anything, is the range in pixels within which virtualization does not need to reassess.\n //\n\n @state()\n private binInlineMin = 0;\n\n @state()\n private binInlineMax = this.colSize(0);\n\n @state()\n private binBlockMin = 0;\n\n @state()\n private binBlockMax = this.rowSize(0);\n\n //\n // `vis`, short for ‘visible’, is the range in numeric index of the columns or rows which should be rendered within\n // the viewport. These start with naïve values that are updated before first contentful render.\n //\n\n @state()\n private visColMin = 0;\n\n @state()\n private visColMax = 1;\n\n @state()\n private visRowMin = 0;\n\n @state()\n private visRowMax = 1;\n\n //\n // `template` is the rendered value of `grid-{axis}-template`.\n //\n @state()\n private templateColumns = `${this.colSize(0)}px`;\n\n @state()\n private templateRows = `${this.rowSize(0)}px`;\n\n //\n // Focus, selection, and resize states\n //\n\n @state()\n private pointer: DxGridPointer = null;\n\n @state()\n private colSizes: Record<string, number> = {};\n\n @state()\n private rowSizes: Record<string, number> = {};\n\n @state()\n private focusActive: boolean = false;\n\n @state()\n private focusedCell: DxGridPosition = { col: 0, row: 0 };\n\n @state()\n private selectionStart: DxGridPosition = { col: 0, row: 0 };\n\n @state()\n private selectionEnd: DxGridPosition = { col: 0, row: 0 };\n\n //\n // Primary pointer and keyboard handlers\n //\n\n private dispatchEditRequest(initialContent?: string) {\n this.snapPosToFocusedCell();\n // Without deferring, the event dispatches before `focusedCellBox` can get updated bounds of the cell, hence:\n queueMicrotask(() =>\n this.dispatchEvent(\n new DxEditRequest({\n cellIndex: toCellIndex(this.focusedCell),\n cellBox: this.focusedCellBox(),\n initialContent,\n }),\n ),\n );\n }\n\n private handlePointerDown = (event: PointerEvent) => {\n if (event.isPrimary) {\n const { action, actionEl } = closestAction(event.target);\n if (action) {\n if (action.startsWith('resize') && this.mode === 'browse') {\n const [resize, index] = action.split(',');\n const [_, axis] = resize.split('-');\n this.pointer = {\n state: 'resizing',\n axis: axis as DxGridAxis,\n size: axis === 'col' ? this.colSize(index) : this.rowSize(index),\n page: getPage(axis, event),\n index,\n };\n } else if (action === 'cell') {\n const cellCoords = closestCell(event.target, actionEl);\n if (cellCoords) {\n this.pointer = { state: 'selecting' };\n this.selectionStart = cellCoords;\n }\n if (this.mode === 'edit') {\n event.preventDefault();\n } else {\n if (this.focusActive && isSameCell(this.focusedCell, cellCoords)) {\n this.dispatchEditRequest();\n }\n }\n }\n }\n }\n };\n\n private handlePointerUp = (event: PointerEvent) => {\n if (this.pointer?.state === 'resizing') {\n const resizeEvent = new DxAxisResize({\n axis: this.pointer.axis,\n index: this.pointer.index,\n size: this[this.pointer.axis === 'col' ? 'colSize' : 'rowSize'](this.pointer.index),\n });\n this.dispatchEvent(resizeEvent);\n } else {\n const cell = closestCell(event.target);\n if (cell) {\n this.selectionEnd = cell;\n this.dispatchEvent(\n new DxGridCellsSelect({\n start: this.selectionStart,\n end: this.selectionEnd,\n }),\n );\n }\n }\n this.pointer = null;\n };\n\n private handlePointerMove = (event: PointerEvent) => {\n if (this.pointer?.state === 'resizing') {\n const delta = getPage(this.pointer.axis, event) - this.pointer.page;\n if (this.pointer.axis === 'col') {\n const nextSize = Math.max(sizeColMin, Math.min(sizeColMax, this.pointer.size + delta));\n this.colSizes = { ...this.colSizes, [this.pointer.index]: nextSize };\n this.updateVisInline();\n } else {\n const nextSize = Math.max(sizeRowMin, Math.min(sizeRowMax, this.pointer.size + delta));\n this.rowSizes = { ...this.rowSizes, [this.pointer.index]: nextSize };\n this.updateVisBlock();\n }\n } else if (this.pointer?.state === 'selecting') {\n const cell = closestCell(event.target);\n if (cell && (cell.col !== this.selectionEnd.col || cell.row !== this.selectionEnd.row)) {\n this.selectionEnd = cell;\n }\n }\n };\n\n private handleKeydown(event: KeyboardEvent) {\n if (this.focusActive && this.mode === 'browse') {\n // Adjust state\n switch (event.key) {\n case 'ArrowDown':\n this.focusedCell = { ...this.focusedCell, row: this.focusedCell.row + 1 };\n break;\n case 'ArrowUp':\n this.focusedCell = { ...this.focusedCell, row: Math.max(0, this.focusedCell.row - 1) };\n break;\n case 'ArrowRight':\n this.focusedCell = { ...this.focusedCell, col: this.focusedCell.col + 1 };\n break;\n case 'ArrowLeft':\n this.focusedCell = { ...this.focusedCell, col: Math.max(0, this.focusedCell.col - 1) };\n break;\n }\n // Emit edit request if relevant\n switch (event.key) {\n case 'Enter':\n this.dispatchEditRequest();\n break;\n default:\n if (event.key.length === 1 && event.key.match(/\\P{Cc}/u)) {\n this.dispatchEditRequest(event.key);\n }\n break;\n }\n // Handle virtualization & focus consequences\n switch (event.key) {\n case 'ArrowDown':\n case 'ArrowUp':\n case 'ArrowRight':\n case 'ArrowLeft':\n event.preventDefault();\n this.snapPosToFocusedCell();\n break;\n }\n }\n }\n\n //\n // Accessors\n //\n\n private colSize(c: number | string) {\n return this.colSizes?.[c] ?? this.columnDefault.size;\n }\n\n private rowSize(r: number | string) {\n return this.rowSizes?.[r] ?? this.rowDefault.size;\n }\n\n private cell(c: number | string, r: number | string) {\n return this.cells[`${c}${separator}${r}`];\n }\n\n private focusedCellBox(): DxEditRequest['cellBox'] {\n const cellElement = this.focusedCellElement();\n const cellSize = { inlineSize: this.colSize(this.focusedCell.col), blockSize: this.rowSize(this.focusedCell.row) };\n if (!cellElement) {\n return { insetInlineStart: NaN, insetBlockStart: NaN, ...cellSize };\n }\n const contentElement = cellElement.offsetParent as HTMLElement;\n // Note that storing `offset` in state causes performance issues, so instead the transform is parsed here.\n const [_translate3d, inlineStr, blockStr] = contentElement.style.transform.split(/[()]|px,?\\s?/);\n const contentOffsetInline = parseFloat(inlineStr);\n const contentOffsetBlock = parseFloat(blockStr);\n const offsetParent = contentElement.offsetParent as HTMLElement;\n return {\n insetInlineStart: cellElement.offsetLeft + contentOffsetInline + offsetParent.offsetLeft,\n insetBlockStart: cellElement.offsetTop + contentOffsetBlock + offsetParent.offsetTop,\n ...cellSize,\n };\n }\n\n //\n // Resize & reposition handlers, observer, ref\n //\n\n @state()\n private observer = new ResizeObserver((entries) => {\n const { inlineSize, blockSize } = entries?.[0]?.contentBoxSize?.[0] ?? {\n inlineSize: 0,\n blockSize: 0,\n };\n if (\n Math.abs(inlineSize - this.sizeInline) > resizeTolerance ||\n Math.abs(blockSize - this.sizeBlock) > resizeTolerance\n ) {\n // console.info('[updating bounds]', 'resize', [inlineSize - this.sizeInline, blockSize - this.sizeBlock]);\n this.sizeInline = inlineSize;\n this.sizeBlock = blockSize;\n this.updateVis();\n }\n });\n\n private viewportRef: Ref<HTMLDivElement> = createRef();\n\n private handleWheel = ({ deltaX, deltaY }: WheelEvent) => {\n if (this.mode === 'browse') {\n this.posInline = Math.max(0, this.posInline + deltaX);\n this.posBlock = Math.max(0, this.posBlock + deltaY);\n if (\n this.posInline >= this.binInlineMin &&\n this.posInline < this.binInlineMax &&\n this.posBlock >= this.binBlockMin &&\n this.posBlock < this.binBlockMax\n ) {\n // do nothing\n } else {\n // console.info(\n // '[updating bounds]',\n // 'wheel',\n // [this.binInlineMin, this.posInline, this.binInlineMax],\n // [this.binBlockMin, this.posBlock, this.binBlockMax],\n // );\n this.updateVis();\n }\n }\n };\n\n private updateVisInline() {\n // todo: avoid starting from zero\n let colIndex = 0;\n let pxInline = this.colSize(colIndex);\n\n while (pxInline < this.posInline) {\n colIndex += 1;\n pxInline += this.colSize(colIndex) + gap;\n }\n\n this.visColMin = colIndex - overscanCol;\n\n this.binInlineMin = pxInline - this.colSize(colIndex) - gap;\n this.binInlineMax = pxInline + gap;\n\n this.overscanInline =\n [...Array(overscanCol)].reduce((acc, _, c0) => {\n acc += this.colSize(this.visColMin + c0);\n return acc;\n }, 0) +\n gap * (overscanCol - 1);\n\n while (pxInline < this.binInlineMax + this.sizeInline + gap) {\n colIndex += 1;\n pxInline += this.colSize(colIndex) + gap;\n }\n\n this.visColMax = colIndex + overscanCol;\n\n this.templateColumns = [...Array(this.visColMax - this.visColMin)]\n .map((_, c0) => `${this.colSize(this.visColMin + c0)}px`)\n .join(' ');\n }\n\n private updateVisBlock() {\n // todo: avoid starting from zero\n let rowIndex = 0;\n let pxBlock = this.rowSize(rowIndex);\n\n while (pxBlock < this.posBlock) {\n rowIndex += 1;\n pxBlock += this.rowSize(rowIndex) + gap;\n }\n\n this.visRowMin = rowIndex - overscanRow;\n\n this.binBlockMin = pxBlock - this.rowSize(rowIndex) - gap;\n this.binBlockMax = pxBlock + gap;\n\n this.overscanBlock =\n [...Array(overscanRow)].reduce((acc, _, r0) => {\n acc += this.rowSize(this.visRowMin + r0);\n return acc;\n }, 0) +\n gap * (overscanRow - 1);\n\n while (pxBlock < this.binBlockMax + this.sizeBlock) {\n rowIndex += 1;\n pxBlock += this.rowSize(rowIndex) + gap;\n }\n\n this.visRowMax = rowIndex + overscanRow;\n\n this.templateRows = [...Array(this.visRowMax - this.visRowMin)]\n .map((_, r0) => `${this.rowSize(this.visRowMin + r0)}px`)\n .join(' ');\n }\n\n private updateVis() {\n this.updateVisInline();\n this.updateVisBlock();\n }\n\n // Focus handlers\n\n @eventOptions({ capture: true })\n private handleFocus(event: FocusEvent) {\n const cellCoords = closestCell(event.target);\n if (cellCoords) {\n this.focusedCell = cellCoords;\n this.focusActive = true;\n }\n }\n\n @eventOptions({ capture: true })\n private handleBlur(event: FocusEvent) {\n // Only unset `focusActive` if focus is not moving to an element within the grid.\n if (!event.relatedTarget || !(event.relatedTarget as HTMLElement).closest(`[data-grid=\"${this.gridId}\"]`)) {\n this.focusActive = false;\n }\n }\n\n private focusedCellElement() {\n return this.viewportRef.value?.querySelector(\n `[aria-colindex=\"${this.focusedCell.col}\"][aria-rowindex=\"${this.focusedCell.row}\"]`,\n ) as HTMLElement | null;\n }\n\n /**\n * Moves focus to the cell with actual focus, otherwise moves focus to the viewport.\n */\n refocus(increment?: 'col' | 'row', delta: 1 | -1 = 1) {\n switch (increment) {\n case 'row':\n this.focusedCell = { ...this.focusedCell, row: this.focusedCell.row + delta };\n break;\n case 'col':\n this.focusedCell = { ...this.focusedCell, col: this.focusedCell.col + delta };\n }\n (this.focusedCell.row < this.visRowMin ||\n this.focusedCell.row > this.visRowMax ||\n this.focusedCell.col < this.visColMin ||\n this.focusedCell.col > this.visColMax\n ? this.viewportRef.value\n : this.focusedCellElement()\n )?.focus({ preventScroll: true });\n if (increment) {\n this.snapPosToFocusedCell();\n }\n }\n\n /**\n * Updates `pos` so that a cell in focus is fully within the viewport\n */\n snapPosToFocusedCell() {\n if (\n this.focusedCell.col < this.visColMin ||\n this.focusedCell.col > this.visColMax ||\n this.focusedCell.row < this.visRowMin ||\n this.focusedCell.row > this.visRowMax\n ) {\n // console.warn('Snapping position to a focused cell that is not already mounted is unsupported.');\n } else if (\n this.focusedCell.col > this.visColMin + overscanCol &&\n this.focusedCell.col < this.visColMax - overscanCol - 1 &&\n this.focusedCell.row > this.visRowMin + overscanRow &&\n this.focusedCell.row < this.visRowMax - overscanRow - 1\n ) {\n // console.log(\n // '[within bounds]',\n // this.focusedCell,\n // [this.visColMin, this.visColMax, overscanCol],\n // [this.visRowMin, this.visRowMax, overscanRow],\n // );\n } else {\n if (this.focusedCell.col <= this.visColMin + overscanCol) {\n this.posInline = this.binInlineMin;\n this.updateVisInline();\n } else if (this.focusedCell.col >= this.visColMax - overscanCol - 1) {\n const sizeSumCol = [...Array(this.focusedCell.col - this.visColMin)].reduce((acc, _, c0) => {\n acc += this.colSize(this.visColMin + overscanCol + c0) + gap;\n return acc;\n }, 0);\n this.posInline = Math.max(0, this.binInlineMin + sizeSumCol + gap * 2 - this.sizeInline);\n this.updateVisInline();\n }\n\n if (this.focusedCell.row <= this.visRowMin + overscanRow) {\n this.posBlock = this.binBlockMin;\n this.updateVisBlock();\n } else if (this.focusedCell.row >= this.visRowMax - overscanRow - 1) {\n const sizeSumRow = [...Array(this.focusedCell.row - this.visRowMin)].reduce((acc, _, r0) => {\n acc += this.rowSize(this.visRowMin + overscanRow + r0) + gap;\n return acc;\n }, 0);\n this.posBlock = Math.max(0, this.binBlockMin + sizeSumRow + gap * 2 - this.sizeBlock);\n this.updateVisBlock();\n }\n }\n }\n\n //\n // Render and other lifecycle methods\n //\n\n override render() {\n const visibleCols = this.visColMax - this.visColMin;\n const visibleRows = this.visRowMax - this.visRowMin;\n const offsetInline = this.binInlineMin - this.posInline - this.overscanInline;\n const offsetBlock = this.binBlockMin - this.posBlock - this.overscanBlock;\n\n const selectColMin = Math.min(this.selectionStart.col, this.selectionEnd.col);\n const selectColMax = Math.max(this.selectionStart.col, this.selectionEnd.col);\n const selectRowMin = Math.min(this.selectionStart.row, this.selectionEnd.row);\n const selectRowMax = Math.max(this.selectionStart.row, this.selectionEnd.row);\n const selectVisible = selectColMin !== selectColMax || selectRowMin !== selectRowMax;\n\n return html`<div\n role=\"none\"\n class=\"dx-grid\"\n data-grid=${this.gridId}\n data-grid-mode=${this.mode}\n ?data-grid-select=${selectVisible}\n @pointerdown=${this.handlePointerDown}\n @pointerup=${this.handlePointerUp}\n @pointermove=${this.handlePointerMove}\n @pointerleave=${this.handlePointerUp}\n @focus=${this.handleFocus}\n @blur=${this.handleBlur}\n @keydown=${this.handleKeydown}\n >\n <div role=\"none\" class=\"dx-grid__corner\"></div>\n <div role=\"none\" class=\"dx-grid__columnheader\">\n <div\n role=\"none\"\n class=\"dx-grid__columnheader__content\"\n style=\"transform:translate3d(${offsetInline}px,0,0);grid-template-columns:${this.templateColumns};\"\n >\n ${[...Array(visibleCols)].map((_, c0) => {\n const c = this.visColMin + c0;\n return html`<div\n role=\"columnheader\"\n ?inert=${c < 0}\n style=\"block-size:${this.rowDefault.size}px;grid-column:${c0 + 1}/${c0 + 2};\"\n >\n <span id=${localChId(c0)}>${colToA1Notation(c)}</span>\n ${(this.columns[c]?.resizeable ?? this.columnDefault.resizeable) &&\n html`<button class=\"dx-grid__resize-handle\" data-dx-grid-action=${`resize-col,${c}`}>\n <span class=\"sr-only\">Resize</span>\n </button>`}\n </div>`;\n })}\n </div>\n </div>\n <div role=\"none\" class=\"dx-grid__corner\"></div>\n <div role=\"none\" class=\"dx-grid__rowheader\">\n <div\n role=\"none\"\n class=\"dx-grid__rowheader__content\"\n style=\"transform:translate3d(0,${offsetBlock}px,0);grid-template-rows:${this.templateRows};\"\n >\n ${[...Array(visibleRows)].map((_, r0) => {\n const r = this.visRowMin + r0;\n return html`<div role=\"rowheader\" ?inert=${r < 0} style=\"grid-row:${r0 + 1}/${r0 + 2}\">\n <span id=${localRhId(r0)}>${rowToA1Notation(r)}</span>\n ${(this.rows[r]?.resizeable ?? this.rowDefault.resizeable) &&\n html`<button class=\"dx-grid__resize-handle\" data-dx-grid-action=${`resize-row,${r}`}>\n <span class=\"sr-only\">Resize</span>\n </button>`}\n </div>`;\n })}\n </div>\n </div>\n <div role=\"grid\" class=\"dx-grid__viewport\" tabindex=\"0\" @wheel=${this.handleWheel} ${ref(this.viewportRef)}>\n <div\n role=\"none\"\n class=\"dx-grid__content\"\n style=\"transform:translate3d(${offsetInline}px,${offsetBlock}px,0);grid-template-columns:${this\n .templateColumns};grid-template-rows:${this.templateRows};\"\n >\n ${[...Array(visibleCols)].map((_, c0) => {\n return [...Array(visibleRows)].map((_, r0) => {\n const c = c0 + this.visColMin;\n const r = r0 + this.visRowMin;\n const cell = this.cell(c, r);\n const active = this.focusActive && this.focusedCell.col === c && this.focusedCell.row === r;\n const selected = c >= selectColMin && c <= selectColMax && r >= selectRowMin && r <= selectRowMax;\n return html`<div\n role=\"gridcell\"\n tabindex=\"0\"\n ?inert=${c < 0 || r < 0}\n ?aria-selected=${selected}\n class=${cell || active\n ? (cell?.className ? cell.className + ' ' : '') + (active ? 'dx-grid__cell--active' : '')\n : nothing}\n aria-rowindex=${r}\n aria-colindex=${c}\n data-dx-grid-action=\"cell\"\n style=\"grid-column:${c0 + 1};grid-row:${r0 + 1}\"\n >\n ${cell?.value}\n </div>`;\n });\n })}\n </div>\n </div>\n <div role=\"none\" class=\"dx-grid__scrollbar\" aria-orientation=\"vertical\">\n <div role=\"none\" class=\"dx-grid__scrollbar__thumb\"></div>\n </div>\n <div role=\"none\" class=\"dx-grid__corner\"></div>\n <div role=\"none\" class=\"dx-grid__scrollbar\" aria-orientation=\"horizontal\">\n <div role=\"none\" class=\"dx-grid__scrollbar__thumb\"></div>\n </div>\n <div role=\"none\" class=\"dx-grid__corner\"></div>\n </div>`;\n }\n\n override firstUpdated() {\n this.observer.observe(this.viewportRef.value!);\n this.colSizes = Object.entries(this.columns).reduce((acc: Record<string, number>, [colId, colMeta]) => {\n if (colMeta?.size) {\n acc[colId] = colMeta.size;\n }\n return acc;\n }, {});\n this.rowSizes = Object.entries(this.rows).reduce((acc: Record<string, number>, [rowId, rowMeta]) => {\n if (rowMeta?.size) {\n acc[rowId] = rowMeta.size;\n }\n return acc;\n }, {});\n }\n\n override updated(changedProperties: Map<string, any>) {\n // Update the focused element if there is a change in bounds (otherwise Lit keeps focus on the relative element).\n if (\n this.focusActive &&\n (changedProperties.has('visRowMin') || changedProperties.has('visColMin') || changedProperties.has('focusedCell'))\n ) {\n this.refocus();\n }\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n // console.log('[disconnected]', this.viewportRef.value);\n // TODO(thure): Will this even work?\n if (this.viewportRef.value) {\n this.observer.unobserve(this.viewportRef.value);\n }\n }\n\n override createRenderRoot() {\n return this;\n }\n}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { type CellIndex, type DxGridPosition } from './types';\n\n/**\n * Separator for serializing cell position vectors\n */\nexport const separator = ',';\n\nexport const toCellIndex = (cellCoords: DxGridPosition): CellIndex => `${cellCoords.col}${separator}${cellCoords.row}`;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { type DxGrid } from './dx-grid';\nimport { toCellIndex } from './util';\n\nexport type CellIndex = `${string},${string}`;\n\nexport type DxGridAxis = 'row' | 'col';\n\nexport type DxGridPosition = Record<DxGridAxis, number>;\nexport type DxGridPositionNullable = DxGridPosition | null;\n\nexport type DxGridPointer = null | ({ state: 'resizing'; page: number } & DxAxisResizeProps) | { state: 'selecting' };\n\nexport type DxAxisResizeProps = Pick<DxAxisResize, 'axis' | 'index' | 'size'>;\n\nexport type DxGridMode = 'browse' | 'edit';\n\nexport type CellValue = {\n /**\n * The content value\n */\n value: string;\n /**\n * If this is a merged cell, the bottomright-most of the range in numeric notation, otherwise undefined.\n */\n end?: string;\n /**\n * `class` attribute value to apply to the gridcell element\n */\n className?: string;\n};\n\nexport type AxisMeta = {\n size: number;\n description?: string;\n resizeable?: boolean;\n};\n\nexport type DxGridProps = Partial<Pick<DxGrid, 'cells' | 'rows' | 'columns' | 'rowDefault' | 'columnDefault'>>;\n\nexport class DxAxisResize extends Event {\n public readonly axis: DxGridAxis;\n public readonly index: string;\n public readonly size: number;\n constructor(props: DxAxisResizeProps) {\n super('dx-axis-resize');\n this.axis = props.axis;\n this.index = props.index;\n this.size = props.size;\n }\n}\n\nexport type DxEditRequestProps = Pick<DxEditRequest, 'cellIndex' | 'cellBox' | 'initialContent'>;\n\nexport class DxEditRequest extends Event {\n public readonly cellIndex: CellIndex;\n public readonly cellBox: Record<'insetInlineStart' | 'insetBlockStart' | 'inlineSize' | 'blockSize', number>;\n public readonly initialContent?: string;\n constructor(props: DxEditRequestProps) {\n super('dx-edit-request');\n this.cellIndex = props.cellIndex;\n this.cellBox = props.cellBox;\n this.initialContent = props.initialContent;\n }\n}\n\nexport type DxSelectProps = { start: DxGridPosition; end: DxGridPosition };\n\nexport class DxGridCellsSelect extends Event {\n public readonly start: string;\n public readonly end: string;\n public readonly minCol: number;\n public readonly maxCol: number;\n public readonly minRow: number;\n public readonly maxRow: number;\n constructor({ start, end }: DxSelectProps) {\n super('dx-grid-cells-select');\n this.start = toCellIndex(start);\n this.end = toCellIndex(end);\n this.minCol = Math.min(start.col, end.col);\n this.maxCol = Math.max(start.col, end.col);\n this.minRow = Math.min(start.row, end.row);\n this.maxRow = Math.max(start.row, end.row);\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;GAlFU1C,OAAAA,WAAAA,aAAAA,MAAAA;;EAwFV0C,MAAAA;GAxFU1C,OAAAA,WAAAA,mBAAAA,MAAAA;;EA2FV0C,MAAAA;GA3FU1C,OAAAA,WAAAA,gBAAAA,MAAAA;;EAkGV0C,MAAAA;GAlGU1C,OAAAA,WAAAA,WAAAA,MAAAA;;EAqGV0C,MAAAA;GArGU1C,OAAAA,WAAAA,YAAAA,MAAAA;;EAwGV0C,MAAAA;GAxGU1C,OAAAA,WAAAA,YAAAA,MAAAA;;EA2GV0C,MAAAA;GA3GU1C,OAAAA,WAAAA,eAAAA,MAAAA;;EA8GV0C,MAAAA;GA9GU1C,OAAAA,WAAAA,eAAAA,MAAAA;;EAiHV0C,MAAAA;GAjHU1C,OAAAA,WAAAA,kBAAAA,MAAAA;;EAoHV0C,MAAAA;GApHU1C,OAAAA,WAAAA,gBAAAA,MAAAA;;EAoSV0C,MAAAA;GApSU1C,OAAAA,WAAAA,YAAAA,MAAAA;;EAyZV+J,aAAa;IAAEC,SAAS;EAAK,CAAA;GAzZnBhK,OAAAA,WAAAA,eAAAA,IAAAA;;EAkaV+J,aAAa;IAAEC,SAAS;EAAK,CAAA;GAlanBhK,OAAAA,WAAAA,cAAAA,IAAAA;AAAAA,SAAAA,aAAAA;EADZiK,cAAc,SAAA;GACFjK,MAAAA;",
6
+ "names": ["LitElement", "html", "nothing", "customElement", "state", "property", "eventOptions", "ref", "createRef", "separator", "toCellIndex", "cellCoords", "col", "row", "DxAxisResize", "Event", "constructor", "props", "axis", "index", "size", "DxEditRequest", "cellIndex", "cellBox", "initialContent", "DxGridCellsSelect", "start", "end", "toCellIndex", "minCol", "Math", "min", "col", "maxCol", "max", "minRow", "row", "maxRow", "gap", "resizeTolerance", "overscanCol", "overscanRow", "sizeColMin", "sizeColMax", "sizeRowMin", "sizeRowMax", "colToA1Notation", "col", "String", "fromCharCode", "charCodeAt", "Math", "floor", "rowToA1Notation", "row", "closestAction", "target", "actionEl", "closest", "action", "getAttribute", "closestCell", "cellElement", "parseInt", "isSameCell", "a", "b", "Number", "isFinite", "localChId", "c0", "localRhId", "r0", "getPage", "axis", "event", "pageX", "pageY", "DxGrid", "LitElement", "gridId", "rowDefault", "size", "columnDefault", "rows", "columns", "cells", "mode", "posInline", "posBlock", "sizeInline", "sizeBlock", "overscanInline", "overscanBlock", "binInlineMin", "binInlineMax", "colSize", "binBlockMin", "binBlockMax", "rowSize", "visColMin", "visColMax", "visRowMin", "visRowMax", "templateColumns", "templateRows", "pointer", "colSizes", "rowSizes", "focusActive", "focusedCell", "selectionStart", "selectionEnd", "handlePointerDown", "isPrimary", "startsWith", "resize", "index", "split", "_", "state", "page", "cellCoords", "preventDefault", "dispatchEditRequest", "handlePointerUp", "resizeEvent", "DxAxisResize", "dispatchEvent", "cell", "DxGridCellsSelect", "start", "end", "handlePointerMove", "delta", "nextSize", "max", "min", "updateVisInline", "updateVisBlock", "observer", "ResizeObserver", "entries", "inlineSize", "blockSize", "contentBoxSize", "abs", "updateVis", "viewportRef", "createRef", "handleWheel", "deltaX", "deltaY", "initialContent", "snapPosToFocusedCell", "queueMicrotask", "DxEditRequest", "cellIndex", "toCellIndex", "cellBox", "focusedCellBox", "handleKeydown", "key", "length", "match", "c", "r", "separator", "focusedCellElement", "cellSize", "insetInlineStart", "NaN", "insetBlockStart", "contentElement", "offsetParent", "_translate3d", "inlineStr", "blockStr", "style", "transform", "contentOffsetInline", "parseFloat", "contentOffsetBlock", "offsetLeft", "offsetTop", "colIndex", "pxInline", "Array", "reduce", "acc", "map", "join", "rowIndex", "pxBlock", "handleFocus", "handleBlur", "relatedTarget", "value", "querySelector", "refocus", "increment", "focus", "preventScroll", "sizeSumCol", "sizeSumRow", "render", "visibleCols", "visibleRows", "offsetInline", "offsetBlock", "selectColMin", "selectColMax", "selectRowMin", "selectRowMax", "selectVisible", "html", "resizeable", "ref", "active", "selected", "className", "nothing", "firstUpdated", "observe", "Object", "colId", "colMeta", "rowId", "rowMeta", "updated", "changedProperties", "has", "disconnectedCallback", "unobserve", "createRenderRoot", "property", "type", "eventOptions", "capture", "customElement"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"packages/ui/lit-grid/src/types.ts":{"bytes":1636,"imports":[],"format":"esm"},"packages/ui/lit-grid/src/dx-grid.ts":{"bytes":69997,"imports":[{"path":"lit","kind":"import-statement","external":true},{"path":"lit/decorators.js","kind":"import-statement","external":true},{"path":"lit/directives/ref.js","kind":"import-statement","external":true},{"path":"packages/ui/lit-grid/src/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/ui/lit-grid/src/index.ts":{"bytes":572,"imports":[{"path":"packages/ui/lit-grid/src/dx-grid.ts","kind":"import-statement","original":"./dx-grid"},{"path":"packages/ui/lit-grid/src/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"}},"outputs":{"packages/ui/lit-grid/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":33648},"packages/ui/lit-grid/dist/lib/browser/index.mjs":{"imports":[{"path":"lit","kind":"import-statement","external":true},{"path":"lit/decorators.js","kind":"import-statement","external":true},{"path":"lit/directives/ref.js","kind":"import-statement","external":true}],"exports":["DxAxisResize","DxGrid"],"entryPoint":"packages/ui/lit-grid/src/index.ts","inputs":{"packages/ui/lit-grid/src/dx-grid.ts":{"bytesInOutput":18568},"packages/ui/lit-grid/src/types.ts":{"bytesInOutput":186},"packages/ui/lit-grid/src/index.ts":{"bytesInOutput":0}},"bytes":18943}}}
1
+ {"inputs":{"packages/ui/lit-grid/src/util.ts":{"bytes":1219,"imports":[],"format":"esm"},"packages/ui/lit-grid/src/types.ts":{"bytes":6696,"imports":[{"path":"packages/ui/lit-grid/src/util.ts","kind":"import-statement","original":"./util"}],"format":"esm"},"packages/ui/lit-grid/src/dx-grid.ts":{"bytes":90202,"imports":[{"path":"lit","kind":"import-statement","external":true},{"path":"lit/decorators.js","kind":"import-statement","external":true},{"path":"lit/directives/ref.js","kind":"import-statement","external":true},{"path":"packages/ui/lit-grid/src/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/ui/lit-grid/src/util.ts","kind":"import-statement","original":"./util"}],"format":"esm"},"packages/ui/lit-grid/src/index.ts":{"bytes":572,"imports":[{"path":"packages/ui/lit-grid/src/dx-grid.ts","kind":"import-statement","original":"./dx-grid"},{"path":"packages/ui/lit-grid/src/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"}},"outputs":{"packages/ui/lit-grid/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":46689},"packages/ui/lit-grid/dist/lib/browser/index.mjs":{"imports":[{"path":"lit","kind":"import-statement","external":true},{"path":"lit/decorators.js","kind":"import-statement","external":true},{"path":"lit/directives/ref.js","kind":"import-statement","external":true}],"exports":["DxAxisResize","DxEditRequest","DxGrid","DxGridCellsSelect"],"entryPoint":"packages/ui/lit-grid/src/index.ts","inputs":{"packages/ui/lit-grid/src/dx-grid.ts":{"bytesInOutput":23733},"packages/ui/lit-grid/src/util.ts":{"bytesInOutput":105},"packages/ui/lit-grid/src/types.ts":{"bytesInOutput":790},"packages/ui/lit-grid/src/index.ts":{"bytesInOutput":0}},"bytes":24892}}}
@@ -1,83 +1,66 @@
1
1
  import { LitElement } from 'lit';
2
- import { type Ref } from 'lit/directives/ref.js';
3
- import { type DxAxisResizeProps, type DxGridAxis } from './types';
4
- export type CellValue = {
5
- /**
6
- * The content value
7
- */
8
- value: string;
9
- /**
10
- * If this is a merged cell, the bottomright-most of the range in numeric notation, otherwise undefined.
11
- */
12
- end?: string;
13
- /**
14
- * CSS inline styles to apply to the gridcell element
15
- */
16
- style?: string;
17
- };
18
- type AxisMeta = {
19
- size: number;
20
- description?: string;
21
- resizeable?: boolean;
22
- };
23
- export type DxGridProps = Partial<Pick<DxGrid, 'cells' | 'rows' | 'columns' | 'rowDefault' | 'columnDefault'>>;
2
+ import { type AxisMeta, type CellIndex, type CellValue, type DxGridMode } from './types';
24
3
  export declare class DxGrid extends LitElement {
4
+ gridId: string;
25
5
  rowDefault: AxisMeta;
26
6
  columnDefault: AxisMeta;
27
7
  rows: Record<string, AxisMeta>;
28
8
  columns: Record<string, AxisMeta>;
29
- cells: Record<string, CellValue>;
30
- posInline: number;
31
- posBlock: number;
32
- sizeInline: number;
33
- sizeBlock: number;
34
- overscanInline: number;
35
- overscanBlock: number;
36
- binInlineMin: number;
37
- binInlineMax: number;
38
- binBlockMin: number;
39
- binBlockMax: number;
40
- visColMin: number;
41
- visColMax: number;
42
- visRowMin: number;
43
- visRowMax: number;
44
- templateColumns: string;
45
- templateRows: string;
46
- colSizes: Record<string, number>;
47
- rowSizes: Record<string, number>;
48
- resizing: null | (DxAxisResizeProps & {
49
- page: number;
50
- });
51
- handlePointerDown: (event: PointerEvent) => void;
52
- handlePointerUp: (_event: PointerEvent) => void;
53
- handlePointerMove: (event: PointerEvent) => void;
9
+ cells: Record<CellIndex, CellValue>;
10
+ mode: DxGridMode;
11
+ private posInline;
12
+ private posBlock;
13
+ private sizeInline;
14
+ private sizeBlock;
15
+ private overscanInline;
16
+ private overscanBlock;
17
+ private binInlineMin;
18
+ private binInlineMax;
19
+ private binBlockMin;
20
+ private binBlockMax;
21
+ private visColMin;
22
+ private visColMax;
23
+ private visRowMin;
24
+ private visRowMax;
25
+ private templateColumns;
26
+ private templateRows;
27
+ private pointer;
28
+ private colSizes;
29
+ private rowSizes;
30
+ private focusActive;
31
+ private focusedCell;
32
+ private selectionStart;
33
+ private selectionEnd;
34
+ private dispatchEditRequest;
35
+ private handlePointerDown;
36
+ private handlePointerUp;
37
+ private handlePointerMove;
38
+ private handleKeydown;
54
39
  private colSize;
55
40
  private rowSize;
56
- private getCell;
57
- observer: ResizeObserver;
58
- viewportRef: Ref<HTMLDivElement>;
59
- handleWheel: ({ deltaX, deltaY }: WheelEvent) => void;
41
+ private cell;
42
+ private focusedCellBox;
43
+ private observer;
44
+ private viewportRef;
45
+ private handleWheel;
60
46
  private updateVisInline;
61
47
  private updateVisBlock;
62
48
  private updateVis;
63
- focusedCell: Record<DxGridAxis, number>;
64
- focusActive: boolean;
65
- handleFocus(event: FocusEvent): void;
66
- handleBlur(event: FocusEvent): void;
49
+ private handleFocus;
50
+ private handleBlur;
51
+ private focusedCellElement;
67
52
  /**
68
53
  * Moves focus to the cell with actual focus, otherwise moves focus to the viewport.
69
54
  */
70
- refocus(): void;
55
+ refocus(increment?: 'col' | 'row', delta?: 1 | -1): void;
71
56
  /**
72
57
  * Updates `pos` so that a cell in focus is fully within the viewport
73
58
  */
74
59
  snapPosToFocusedCell(): void;
75
- handleKeydown(event: KeyboardEvent): void;
76
60
  render(): import("lit").TemplateResult<1>;
77
61
  firstUpdated(): void;
78
62
  updated(changedProperties: Map<string, any>): void;
79
63
  disconnectedCallback(): void;
80
64
  createRenderRoot(): this;
81
65
  }
82
- export {};
83
66
  //# sourceMappingURL=dx-grid.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dx-grid.d.ts","sourceRoot":"","sources":["../../../src/dx-grid.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAEvC,OAAO,EAAkB,KAAK,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,EAAgB,KAAK,iBAAiB,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AA+ChF,MAAM,MAAM,SAAS,GAAG;IACtB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,Y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;CAG1B"}
@@ -1,8 +1,11 @@
1
1
  import './dx-grid.ts';
2
2
  import './dx-grid.pcss';
3
- import { type DxGridProps } from './dx-grid';
3
+ import { type DxGridProps } from './types';
4
4
  declare const _default: {
5
5
  title: string;
6
+ parameters: {
7
+ layout: string;
8
+ };
6
9
  };
7
10
  export default _default;
8
11
  export declare const Basic: {
@@ -1 +1 @@
1
- {"version":3,"file":"dx-grid.lit-stories.d.ts","sourceRoot":"","sources":["../../../src/dx-grid.lit-stories.ts"],"names":[],"mappings":"AAIA,OAAO,cAAc,CAAC;AACtB,OAAO,gBAAgB,CAAC;AAIxB,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;;;;AAE7C,wBAEE;AAEF,eAAO,MAAM,KAAK;YAAW,WAAW;;;;;;;CAOvC,CAAC"}
1
+ {"version":3,"file":"dx-grid.lit-stories.d.ts","sourceRoot":"","sources":["../../../src/dx-grid.lit-stories.ts"],"names":[],"mappings":"AAIA,OAAO,cAAc,CAAC;AACtB,OAAO,gBAAgB,CAAC;AAIxB,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;;;;;;;AAE3C,wBAGE;AAEF,eAAO,MAAM,KAAK;YAAW,WAAW;;;;;;;CASvC,CAAC"}
@@ -1,9 +1,60 @@
1
+ import { type DxGrid } from './dx-grid';
2
+ export type CellIndex = `${string},${string}`;
1
3
  export type DxGridAxis = 'row' | 'col';
4
+ export type DxGridPosition = Record<DxGridAxis, number>;
5
+ export type DxGridPositionNullable = DxGridPosition | null;
6
+ export type DxGridPointer = null | ({
7
+ state: 'resizing';
8
+ page: number;
9
+ } & DxAxisResizeProps) | {
10
+ state: 'selecting';
11
+ };
2
12
  export type DxAxisResizeProps = Pick<DxAxisResize, 'axis' | 'index' | 'size'>;
13
+ export type DxGridMode = 'browse' | 'edit';
14
+ export type CellValue = {
15
+ /**
16
+ * The content value
17
+ */
18
+ value: string;
19
+ /**
20
+ * If this is a merged cell, the bottomright-most of the range in numeric notation, otherwise undefined.
21
+ */
22
+ end?: string;
23
+ /**
24
+ * `class` attribute value to apply to the gridcell element
25
+ */
26
+ className?: string;
27
+ };
28
+ export type AxisMeta = {
29
+ size: number;
30
+ description?: string;
31
+ resizeable?: boolean;
32
+ };
33
+ export type DxGridProps = Partial<Pick<DxGrid, 'cells' | 'rows' | 'columns' | 'rowDefault' | 'columnDefault'>>;
3
34
  export declare class DxAxisResize extends Event {
4
35
  readonly axis: DxGridAxis;
5
36
  readonly index: string;
6
37
  readonly size: number;
7
38
  constructor(props: DxAxisResizeProps);
8
39
  }
40
+ export type DxEditRequestProps = Pick<DxEditRequest, 'cellIndex' | 'cellBox' | 'initialContent'>;
41
+ export declare class DxEditRequest extends Event {
42
+ readonly cellIndex: CellIndex;
43
+ readonly cellBox: Record<'insetInlineStart' | 'insetBlockStart' | 'inlineSize' | 'blockSize', number>;
44
+ readonly initialContent?: string;
45
+ constructor(props: DxEditRequestProps);
46
+ }
47
+ export type DxSelectProps = {
48
+ start: DxGridPosition;
49
+ end: DxGridPosition;
50
+ };
51
+ export declare class DxGridCellsSelect extends Event {
52
+ readonly start: string;
53
+ readonly end: string;
54
+ readonly minCol: number;
55
+ readonly maxCol: number;
56
+ readonly minRow: number;
57
+ readonly maxRow: number;
58
+ constructor({ start, end }: DxSelectProps);
59
+ }
9
60
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,KAAK,CAAC;AAEvC,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC,CAAC;AAE9E,qBAAa,YAAa,SAAQ,KAAK;IACrC,SAAgB,IAAI,EAAE,UAAU,CAAC;IACjC,SAAgB,KAAK,EAAE,MAAM,CAAC;IAC9B,SAAgB,IAAI,EAAE,MAAM,CAAC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Aa,SAAQ,KAAK;IACrC,SAAgB,IAAI,EAAE,UAAU,CAAC;IACjC,SAAgB,KAAK,EAAE,MAAM,CAAC;IAC9B,SAAgB,IAAI,EAAE,MAAM,CAAC;gBACjB,KAAK,EAAE,iBAAiB;CAMrC;AAED,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,aAAa,EAAE,WAAW,GAAG,SAAS,GAAG,gBAAgB,CAAC,CAAC;AAEjG,qBAAa,aAAc,SAAQ,KAAK;IACtC,SAAgB,SAAS,EAAE,SAAS,CAAC;IACrC,SAAgB,OAAO,EAAE,MAAM,CAAC,kBAAkB,GAAG,iBAAiB,GAAG,YAAY,GAAG,WAAW,EAAE,MAAM,CAAC,CAAC;IAC7G,SAAgB,cAAc,CAAC,EAAE,MAAM,CAAC;gBAC5B,KAAK,EAAE,kBAAkB;CAMtC;AAED,MAAM,MAAM,aAAa,GAAG;IAAE,KAAK,EAAE,cAAc,CAAC;IAAC,GAAG,EAAE,cAAc,CAAA;CAAE,CAAC;AAE3E,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,SAAgB,KAAK,EAAE,MAAM,CAAC;IAC9B,SAAgB,GAAG,EAAE,MAAM,CAAC;IAC5B,SAAgB,MAAM,EAAE,MAAM,CAAC;IAC/B,SAAgB,MAAM,EAAE,MAAM,CAAC;IAC/B,SAAgB,MAAM,EAAE,MAAM,CAAC;IAC/B,SAAgB,MAAM,EAAE,MAAM,CAAC;gBACnB,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,aAAa;CAS1C"}
@@ -0,0 +1,7 @@
1
+ import { type CellIndex, type DxGridPosition } from './types';
2
+ /**
3
+ * Separator for serializing cell position vectors
4
+ */
5
+ export declare const separator = ",";
6
+ export declare const toCellIndex: (cellCoords: DxGridPosition) => CellIndex;
7
+ //# sourceMappingURL=util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/util.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,SAAS,MAAM,CAAC;AAE7B,eAAO,MAAM,WAAW,eAAgB,cAAc,KAAG,SAA6D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/lit-grid",
3
- "version": "0.6.11",
3
+ "version": "0.6.12-main.15a606f",
4
4
  "description": "A grid Web Component using Lit",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -7,19 +7,22 @@ import './dx-grid.pcss';
7
7
 
8
8
  import { html, nothing } from 'lit';
9
9
 
10
- import { type DxGridProps } from './dx-grid';
10
+ import { type DxGridProps } from './types';
11
11
 
12
12
  export default {
13
13
  title: 'dx-grid',
14
+ parameters: { layout: 'fullscreen' },
14
15
  };
15
16
 
16
17
  export const Basic = (props: DxGridProps) => {
17
- return html`<dx-grid
18
- cells=${props.cells ?? nothing}
19
- columnDefault=${props.columnDefault ?? nothing}
20
- rowDefault=${props.rowDefault ?? nothing}
21
- columns=${props.columns ?? nothing}
22
- ></dx-grid>`;
18
+ return html`<div style="position:fixed;inset:0;">
19
+ <dx-grid
20
+ cells=${props.cells ?? nothing}
21
+ columnDefault=${props.columnDefault ?? nothing}
22
+ rowDefault=${props.rowDefault ?? nothing}
23
+ columns=${props.columns ?? nothing}
24
+ ></dx-grid>
25
+ </div>`;
23
26
  };
24
27
 
25
28
  Basic.args = {
package/src/dx-grid.pcss CHANGED
@@ -15,13 +15,20 @@ dx-grid {
15
15
  }
16
16
 
17
17
  .dx-grid {
18
- position: fixed;
19
- inset: 0;
20
18
  display: grid;
21
19
  grid-template-columns: min-content 1fr min-content;
22
20
  grid-template-rows: min-content 1fr min-content;
23
21
  font-variant-numeric: tabular-nums;
24
22
  --dx-grid-gap: 1px;
23
+
24
+ min-inline-size: 4rem;
25
+ min-block-size: 4rem;
26
+ inline-size: 100%;
27
+ block-size: 100%;
28
+ max-inline-size: 100dvw;
29
+ max-block-size: 100dvh;
30
+
31
+ user-select: none;
25
32
  }
26
33
 
27
34
  .dx-grid__scrollbar__thumb {
@@ -79,10 +86,13 @@ dx-grid {
79
86
  box-sizing: border-box;
80
87
  cursor: pointer;
81
88
  border: 1px solid transparent;
89
+ overflow: hidden;
90
+ text-overflow: ellipsis;
91
+ white-space: nowrap;
82
92
  &[inert] {
83
93
  visibility: hidden;
84
94
  }
85
- &:focus, &:focus-visible {
95
+ &:focus, &:focus-visible, &.dx-grid__cell--active {
86
96
  cursor: text;
87
97
  position: relative;
88
98
  z-index: 2;
@@ -90,6 +100,20 @@ dx-grid {
90
100
  outline: none;
91
101
  }
92
102
  }
103
+ &[data-grid-mode="edit"] {
104
+ [role='gridcell'], [role='columnheader'], [role='rowheader'] {
105
+ &.dx-grid__cell--active {
106
+ color: transparent !important;
107
+ }
108
+ }
109
+ }
110
+ &[data-grid-select] {
111
+ [role='gridcell'], [role='columnheader'], [role='rowheader'] {
112
+ &[aria-selected] {
113
+ background: var(--dx-gridSelectionOverlay);
114
+ }
115
+ }
116
+ }
93
117
  }
94
118
 
95
119
  .dx-grid__columnheader__content,