@omegagrid/grid 0.10.27 → 0.10.29

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.
@@ -435,7 +435,7 @@ export class GridRendering {
435
435
  }
436
436
  div.innerHTML = '';
437
437
  }
438
- column.width = maxWidth + 10;
438
+ column.width = maxWidth + 22;
439
439
  if (rerender)
440
440
  this.table.renderCells({ horizontal: true });
441
441
  }
@@ -1 +1 @@
1
- {"version":3,"file":"grid.rendering.js","sourceRoot":"","sources":["../../src/ui/grid.rendering.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,GAAG,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAoC,SAAS,EAAE,aAAa,IAAI,SAAS,EAAgB,MAAM,sBAAsB,CAAC;AAE7H,OAAO,EAAE,KAAK,EAAgC,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAQ1D,MAAM,OAAO,aAAa;IAazB,IAAI,UAAU,KAAK,OAAO,IAAI,CAAC,WAAW,CAAA,CAAC,CAAC;IAE5C,IAAI,UAAU,KAAK,OAAO,IAAI,CAAC,WAAW,CAAA,CAAC,CAAC;IAE5C,IAAI,KAAK,KAAK,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAA,CAAC,CAAC;IACtC,IAAI,SAAS,KAAK,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,CAAA,CAAC,CAAC;IAC9C,IAAI,KAAK,KAAK,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAA,CAAC,CAAC;IAEtC,YAAqB,IAAU;QAAV,SAAI,GAAJ,IAAI,CAAM;QAnB/B,0BAAqB,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AI,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,EAAE,CAAC;QAChC,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,EAAE,CAAC;QAChC,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC;QAClC,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAC;QACpC,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,IAAI,CAAC,aAAa,EAAE,CAAC;IACtB,CAAC;CAED","sourcesContent":["import { Direction, dom, getThemeManager, utils } from \"@omegagrid/core\";\nimport { debounce } from \"ts-debounce\";\nimport { CellModel, ColumnModel, RowModel, CellRange, gridConstants as constants, RangeAddress } from \"@omegagrid/grid-core\";\nimport { Grid } from \"./grid\";\nimport { Table, TableRenderOptions, TableRow } from \"./table\";\nimport { GridEvent } from \"./grid.events\";\nimport { getCellRenderer } from \"../renderers\";\nimport { RequestFilters } from \"../gridAdapter\";\nimport { createThemeVariablesCss } from \"@omegagrid/core\";\n\nexport type RefreshOptions = {\n\tvertical?: boolean,\n\thorizontal?: boolean\n\trerenderTable?: boolean\n};\n\nexport class GridRendering {\n\n\trequireVerticalUpdate = true;\n\trequireHorizontalUpdate = false;\n\ttouchStartX: Touch;\n\ttouchStartY: Touch;\n\tresizing = false;\n\tcurrentResizedColumn: ColumnModel;\n\tcurrentResizedColumnWidth: number;\n\tcurrentResizedRow: RowModel;\n\tcurrentResizedRowHeight: number;\n\n\tprivate _vScrolling = true;\n\tget vScrolling() { return this._vScrolling }\n\tprivate _hScrolling = true;\n\tget hScrolling() { return this._hScrolling }\n\n\tget model() { return this.grid.model }\n\tget selection() { return this.grid.selection }\n\tget table() { return this.grid.table }\n\n\tconstructor(readonly grid: Grid) { }\n\n\treadonly debounceRenderCells = debounce(this.renderCells, 50, {isImmediate: false, maxWait: 100});\n\treadonly debounceCalculateViewport = debounce(this.calculateViewport, 200);\n\n\tisLastRowInViewport() {\n\t\tconst viewportRows = this.grid.table.viewport.rows;\n\t\tconst visibleRows = this.model.visibleRows;\n\t\treturn viewportRows[viewportRows.length - 1] == visibleRows[visibleRows.length - 1];\n\t}\n\n\trenderCells(update?: TableRenderOptions) {\n\t\tupdate = update || {vertical: this.requireVerticalUpdate, horizontal: this.requireHorizontalUpdate};\n\t\tthis.grid.comment.deatach();\n\t\tthis.grid.table.renderCells(update);\n\t\tthis.requireHorizontalUpdate = false;\n\t\tthis.requireVerticalUpdate = false;\n\t\tthis.debounceCalculateViewport();\n\t\tthis.grid.objects.updatePostions();\n\t}\n\n\trenderAll(rerenderTable = false) {\n\t\tif (this.grid.group) this.grid.group.grids.forEach((g: Grid) => g.rendering.render(rerenderTable));\n\t\telse this.render(rerenderTable);\n\t}\n\n\tasync render(rerenderTable = false) {\n\t\tif (!this.grid.table || !this.model) return;\n\t\tthis.grid.table.clearHeaderCache();\n\t\tthis.grid.table.clearBodyCache();\n\t\tif (this.grid.table.isConnected) {\n\t\t\tif (rerenderTable) {\n\t\t\t\tthis.grid.table.requestUpdate();\n\t\t\t\tawait this.grid.table.updateComplete;\n\t\t\t}\n\t\t\tthis.grid.table.renderCells({horizontal: true, vertical: true});\n\t\t\tthis.calculateViewport();\n\t\t}\n\t}\n\n\tupdateRange(range: CellRange, recalculate = false) {\n\t\tfor (const cell of this.model.getRangeIterator(range)) {\n\t\t\tthis.updateCells([cell], recalculate);\n\t\t}\n\t}\n\n\tupdateCell(cell: CellModel, recalculate = false) {\n\t\tthis.updateCells([cell], recalculate);\n\t}\n\n\tupdateSpilledCells(cell: CellModel) {\n\t\tlet spillCells: Set<CellModel>;\n\t\tif (cell.prevSpillRange) {\n\t\t\tspillCells = new Set();\n\t\t\tthis.model.getRangeIterator(cell.prevSpillRange).forEach(cell => spillCells.add(cell));\n\t\t}\n\t\tif (cell.spillRange) {\n\t\t\tspillCells = spillCells || new Set();\n\t\t\tthis.model.getRangeIterator(cell.spillRange).forEach(cell => spillCells.add(cell));\n\t\t}\n\t\tif (spillCells?.size > 0) this.updateCells(spillCells);\n\t}\n\n\tupdateCells(cells: Iterable<CellModel>, recalculate = false) {\n\t\tif (recalculate) {\n\t\t\tfor (const cell of cells) {\n\t\t\t\tcell.invalidateStyle();\n\t\t\t\tcell.invalidateValue();\n\t\t\t\tthis.model.calculations.clearDependecies(cell).evaluate(cell);\n\t\t\t\tthis.updateSpilledCells(cell);\n\t\t\t}\n\t\t}\n\n\t\tconst table = this.grid.table;\n\t\tfor (const cell of cells) table.renderBodyCell(cell);\n\t\t\n\t\tif (recalculate) {\n\t\t\tthis.model.calculations.invalidateDependants(cells).forEach((sheet, cell) => {\n\t\t\t\tif (sheet) this.grid.group.getGrid(sheet)?.table.renderBodyCell(cell);\n\t\t\t\telse table.renderBodyCell(cell);\n\t\t\t\tthis.updateSpilledCells(cell);\n\t\t\t});\n\t\t\tthis.grid.dispatchGridEvent('calculate', { cells: Array.from(cells) });\n\t\t}\n\t}\n\n\tupdateHeaders() {\n\t\tthis.model.indexVisibleColumns();\n\t\tthis.table.clearHeaderCache();\n\t\tthis.table.createHeaderRows();\n\t\tthis.table.renderHeader();\n\t}\n\n\tcalculateViewport(recalculate = false) {\n\t\tthis.grid.logger.info('calculate viwport');\n\t\tthis.updateCells(this.model.calculateViewport(), recalculate);\n\t}\n\n\tupdateSliders() {\n\t\tconst ws = this.table.viewportSize;\n\t\tthis.grid.vSlider.maxValue = this.model.visibleRows.length;\n\t\tthis.grid.vSlider.pageSize = ws.h / this.model.options.rowHeight;\n\t\tthis.grid.vSlider.value = this.table.rowOffset;\n\t\tthis.grid.hSlider.maxValue = this.model.visibleColumns.length;\n\t\tthis.grid.hSlider.pageSize = ws.w / this.model.options.columnWidth;\n\t\tthis.grid.hSlider.value = this.table.colOffset;\n\t}\n\n\tisVerticalScrollingEnabled() {\n\t\treturn this.grid.options.scrolling.verticalOverscroll !== false \n\t\t\t|| this.table.viewport.rows.length < this.model.visibleRows.length;\n\t}\n\n\tisHorizontalScrollingEnabled() {\n\t\treturn this.grid.options.scrolling.horizontalOverscroll !== false \n\t\t\t|| this.table.viewport.columns.length < this.model.visibleColumns.length;\n\t}\n\n\tupdateSliderVisibility() {\n\t\tthis._vScrolling = this.isVerticalScrollingEnabled();\n\t\tif (this._vScrolling) {\n\t\t\tthis.grid.vSlider.show();\n\t\t\tdom.showElement(this.grid.vSlider);\n\t\t} else {\n\t\t\tthis.grid.vSlider.hide();\n\t\t\tdom.hideElement(this.grid.vSlider);\n\t\t}\n\t\t\n\t\tthis._hScrolling = this.isHorizontalScrollingEnabled();\n\t\tif (this._hScrolling) {\n\t\t\tthis.grid.hSlider.show();\n\t\t\tdom.showElement(this.grid.hSlider);\n\t\t} else {\n\t\t\tthis.grid.hSlider.hide();\n\t\t\tdom.hideElement(this.grid.hSlider);\n\t\t}\n\t}\n\n\thideSliders() {\n\t\tthis.grid.vSlider.hide();\n\t\tthis.grid.hSlider.hide();\n\t}\n\n\tscrollVerticalByPixels(pixels: number) {\n\t\tif (!this.vScrolling) return;\n\n\t\tlet topRow = this.table.rowOffset;\n\t\tlet top = 0, r = 0;\n\t\tlet row: RowModel;\n\n\t\tif (pixels > 0) {\n\t\t\twhile (top < pixels && topRow + r < this.model.visibleRows.length) {\n\t\t\t\ttop += this.model.visibleRows[topRow + (r++)].height + 2;\n\t\t\t}\n\t\t\ttopRow = topRow + r;\n\t\t} else if (pixels < 0) {\n\t\t\tpixels = Math.abs(pixels);\n\t\t\twhile (top < pixels && topRow + r >= 0) {\n\t\t\t\trow = this.model.visibleRows[Math.min(this.model.visibleRows.length - 1, topRow + (r--))];\n\t\t\t\ttop += (row ? row.height : 0) + 2;\n\t\t\t}\n\t\t\ttopRow = topRow + r;\n\t\t}\n\n\t\tif (topRow >= this.model.visibleRows.length) topRow = this.model.visibleRows.length - 1;\n\t\t\n\t\tthis.requireVerticalUpdate = true;\n\t\tthis.table.rowOffset = Math.max(0, topRow);\n\t\tthis.debounceRenderCells();\n\t\tthis.updateSliders();\n\t}\n\n\tscrollHorizontalByPixels(pixels: number) {\n\t\tif (!this.hScrolling) return;\n\t\t\n\t\tlet leftCol = this.table.colOffset;\n\t\tlet left = 0, c = 0;\n\t\tif (pixels > 0) {\n\t\t\twhile (left < pixels && leftCol + c < this.model.visibleColumns.length) {\n\t\t\t\tleft += this.model.visibleColumns[leftCol + (c++)].width + 2;\n\t\t\t}\n\t\t\tleftCol = leftCol + c;\n\t\t} else if (pixels < 0) {\n\t\t\tpixels = Math.abs(pixels);\n\t\t\twhile (left < pixels && leftCol + c >= 0) {\n\t\t\t\tleft += this.model.visibleColumns[Math.min(this.model.visibleColumns.length - 1, leftCol + (c--))].width + 2;\n\t\t\t}\n\t\t\tleftCol = leftCol + c;\n\t\t}\n\n\t\tif (leftCol >= this.model.visibleColumns.length) leftCol = this.model.visibleColumns.length - 1;\n\n\t\tthis.requireHorizontalUpdate = true;\n\t\tthis.table.colOffset = Math.max(0, leftCol);\n\t\tthis.debounceRenderCells();\n\t\tthis.updateSliders();\n\t}\n\n\tupdateCellSelectionRange() {\n\t\tconst table = this.table;\n\t\tfor (const cell of this.model.getRangeIterator(this.selection.range, false)) {\n\t\t\ttable.renderBodyCell(cell);\n\t\t}\n\t}\n\n\tgetAdapterRequestFilters(): RequestFilters {\n\t\treturn {\n\t\t\toffset: 0,\n\t\t\tfilter: this.grid.filtering?.filter ? Array.from(this.grid.filtering.filter.settings.values()) : null,\n\t\t\torder: this.grid.model?.sorting?.settings\n\t\t};\n\t}\n\n\tasync toggleRow(index: number, dispatchEvent = true) {\n\t\tconst row = this.model.rows[index];\n\t\tif (row.isLoaded || row.isPartialyLoaded) {\n\t\t\trow.toggleCollapse(false, this.model.options.unhideRowAfterExpand);\n\t\t\tthis.table.renderCells({vertical: true});\n\t\t} else if (this.grid.adapter) {\n\t\t\tconst tr = this.table.getRowByModelIndex(index) as TableRow;\n\t\t\tif (tr && tr.expander) tr.expander.state = 'waiting';\n\t\n\t\t\trow.collapsed = false;\n\n\t\t\tconst requestFilters = Object.assign(this.getAdapterRequestFilters(), {\n\t\t\t\tparent: {r: row.index, props: row.properties}\n\t\t\t})\n\n\t\t\tconst [newRowSources] = await Promise.all([this.grid.adapter.getRows(requestFilters)]);\n\t\t\tthis.model.insertRowData(row, 0, newRowSources);\n\t\t\t\n\t\t\trequestFilters.rows = newRowSources;\n\t\t\tconst [newCellSources] = await Promise.all([this.grid.adapter.getCells(requestFilters)]);\n\t\t\tnewCellSources?.map(cellSource => this.model.getCellByCoords(cellSource.r, cellSource.c)?.update(cellSource));\n\t\t\n\t\t\tthis.table.requestUpdate();\n\t\t}\n\n\t\tthis.updateSliders();\n\t\tif (dispatchEvent) this.grid.dispatchEvent(new GridEvent('row.toggle', {grid: this.grid, row}));\n\t}\n\t\n\ttoggleColumn(index: number, dispatchEvent = true) {\n\t\tconst column = this.model.columns[index];\n\t\tcolumn.toggleCollapse(false, this.model.options.unhideColumnAfterExpand);\n\t\tthis.table.renderCells({horizontal: true});\n\t\tthis.updateSliders();\n\t\tif (dispatchEvent) this.grid.dispatchEvent(new GridEvent('column.toggle', {grid: this.grid, column }));\n\t}\n\n\tsetRowExpandLevel(level: number) {\n\t\tthis.model.setRowExpandLevel(level);\n\t\tthis.table.rowOffset = 0;\n\t\tthis.table.renderCells({vertical: true});\n\t\tthis.updateSliders();\n\t\tthis.grid.dispatchEvent(new GridEvent('row.toggle', {grid: this.grid}));\n\t}\n\n\tsetColumnExpandLevel(level: number) {\n\t\tthis.model.setColumnExpandLevel(level);\n\t\tthis.table.colOffset = 0;\n\t\tthis.table.renderCells({horizontal: true});\n\t\tthis.updateSliders();\n\t\tthis.grid.dispatchEvent(new GridEvent('column.toggle', {grid: this.grid}));\n\t}\n\n\tasync exportHTML() {\n\t\tconst div = dom.createElement<HTMLDivElement>('div');\n\t\tdom.hideElement(div);\n\t\tdocument.body.appendChild(div);\n\t\tconst table = dom.createElement<Table>('og-table');\n\t\ttable.grid = this.grid;\n\t\ttable.model = this.model;\n\t\ttable.renderAll = true;\n\t\tdiv.appendChild(table);\n\t\tawait table.updateComplete;\n\n\t\tconst rowBreaks = this.model.options?.print?.rowBreaks;\n\t\tconst tableElm = table.table;\n\n\t\t// split table into multiple tables if page breaks are defined\n\t\tconst hasRowBreaks = rowBreaks && rowBreaks.length > 0;\n\t\tif (hasRowBreaks) {\n\t\t\tconst colgroup = tableElm.querySelector('colgroup');\n\t\t\tconst rows = [...tableElm.tBodies[0].rows];\n\n\t\t\tconst rowTitlesRange = this.model.options?.print?.rowTitles \n\t\t\t\t? CellRange.fromA1(this.model.options?.print?.rowTitles) : null;\n\n\t\t\tconst rowTitles = rowTitlesRange ? Array.from({\n\t\t\t\tlength: rowTitlesRange.r2 - rowTitlesRange.r1 + 1}, \n\t\t\t\t(_, i) => rows[table.rowMap.get(rowTitlesRange.r1 + i)]\n\t\t\t) : [];\n\n\t\t\tfor (let i = 0; i < rowBreaks.length; i++) {\n\t\t\t\tconst tableElm2 = dom.createElement<HTMLTableElement>('table');\n\t\t\t\ttableElm2.appendChild(colgroup.cloneNode(true));\n\t\t\t\tconst tbody = dom.createElement<HTMLTableSectionElement>('tbody');\n\t\t\t\ttableElm2.appendChild(tbody);\n\n\t\t\t\tconst rMin = table.rowMap.get(rowBreaks[i]);\n\t\t\t\tconst rMax = i < rowBreaks.length - 1 \n\t\t\t\t\t? table.rowMap.get(rowBreaks[i + 1]) \n\t\t\t\t\t: this.model.visibleRows.length - 1;\n\n\t\t\t\trowTitles.forEach(row => tbody.appendChild(row.cloneNode(true)));\n\n\t\t\t\tfor (let r = rMin; r <= rMax; r++) {\n\t\t\t\t\ttbody.appendChild(rows[r]);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttable.shadowRoot.appendChild(tableElm2);\n\t\t\t}\n\n\t\t\tcolgroup.cloneNode(true);\n\t\t}\n\n\t\tconst tableCss = `\n\t\t\t<style>\n\t\t\t\thtml {\n\t\t\t\t\t${createThemeVariablesCss(getThemeManager().themes.get('light')).cssText}\n\t\t\t\t}\n\t\t\t\t${hasRowBreaks ? 'table {break-after: page}' : ''}\n\t\t\t\t${Table.styles.map(style => style.cssText).join('\\n')}\n\t\t\t</style>\\n\n\t\t`;\n\n\t\tconst html = tableCss + table.shadowRoot.innerHTML.replace(/<!---->/g, '');\n\t\tdiv.remove();\n\t\treturn html;\n\t}\n\n\tautoscrollDirection: Direction;\n\tautoscrollTimer: number;\n\tautoscrollValue: number;\n\n\tstopAutoscroll() {\n\t\tif (this.autoscrollTimer) {\n\t\t\twindow.clearInterval(this.autoscrollTimer);\n\t\t}\n\t}\n\n\tstartAutoscroll() {\n\t\tthis.stopAutoscroll();\n\t\tthis.autoscrollTimer = window.setInterval(() => {\n\t\t\tif (this.autoscrollValue == 0) return this.stopAutoscroll();\n\t\t\tconst amount = Math.pow(this.autoscrollValue, constants.AUTOSCROLL_RATIO);\n\t\t\tswitch (this.autoscrollDirection) {\n\t\t\t\tcase 'down': this.scrollVerticalByPixels(amount); break;\n\t\t\t\tcase 'up': this.scrollVerticalByPixels(-amount); break;\n\t\t\t\tcase 'left': this.scrollHorizontalByPixels(-amount); break;\n\t\t\t\tcase 'right': this.scrollHorizontalByPixels(amount); break;\n\t\t\t}\n\t\t}, constants.AUTOSCROLL_INTERVAL);\n\t}\n\n\tautoscroll(moousePosition: {x: number, y: number}) {\n\t\tconst { x, y } = moousePosition;\n\t\tconst w = (this.table.clientWidth / this.table.zoom) - this.table.totalHeaderWidth;\n\t\tconst h = (this.table.clientHeight / this.table.zoom) - (this.table.totalHeaderHeight);\n\t\tlet direction: Direction;\n\t\tlet value = 0;\n\n\t\tif (x < constants.AUTOSCROLL_TRESHOLD && x < y && x < h - y) {\n\t\t\tdirection = 'left';\n\t\t\tvalue = constants.AUTOSCROLL_TRESHOLD - x;\n\t\t} else if (w - x < constants.AUTOSCROLL_TRESHOLD && w - x < y && w - x < h - y) {\n\t\t\tdirection = 'right';\n\t\t\tvalue = constants.AUTOSCROLL_TRESHOLD - w + x;\n\t\t} else if (y < constants.AUTOSCROLL_TRESHOLD) {\n\t\t\tdirection = 'up';\n\t\t\tvalue = constants.AUTOSCROLL_TRESHOLD - y;\n\t\t} else if (h - y < constants.AUTOSCROLL_TRESHOLD) {\n\t\t\tdirection = 'down';\n\t\t\tvalue = constants.AUTOSCROLL_TRESHOLD - h + y;\n\t\t}\n\n\t\tthis.autoscrollDirection = direction;\n\t\tthis.autoscrollValue = value;\n\t\tthis.stopAutoscroll();\n\t\tif (value > 0) {\n\t\t\tthis.startAutoscroll();\n\t\t}\n\t}\n\n\tasync load(requestFilters?: RequestFilters) {\n\t\trequestFilters = requestFilters || this.getAdapterRequestFilters();\n\t\tconst parentIndex = requestFilters.parent?.r ?? null;\n\t\tconst parentRow = parentIndex != null ? this.model.rows[parentIndex] : this.model.rowRoot;\n\t\t\n\t\tconst [newRowSources] = await Promise.all([this.grid.adapter.getRows(requestFilters)]);\n\t\tif (newRowSources.length > 0 && parentIndex === null) {\n\t\t\tthis.model.insertRowData(parentRow, requestFilters.offset, newRowSources);\n\t\t}\n\t\t\n\t\tconst [newCellSources] = await Promise.all([this.grid.adapter.getCells(requestFilters)]);\n\t\tnewCellSources?.map(cellSource => this.model.getCellByCoords(cellSource.r, cellSource.c)?.update(cellSource));\n\t\t\n\t\tthis.table.requestUpdate();\n\n\t\tif (newRowSources.length >= this.model.options.pageSize) parentRow.count = Infinity;\n\t\telse parentRow.count = parentRow.children.length;\n\n\t\tthis.grid.logger.info(`loaded ${newRowSources.length} rows`);\n\t\tthis.grid.loading = false;\n\t\tthis.grid.dispatchEvent(new GridEvent('afterLoad', {grid: this.grid}));\n\t}\n\n\tasync loadNextPage(parentIndex: number = null, forceLoad = false) {\n\t\tif (this.grid.loading) return;\n\t\tconst parentRow = parentIndex != null ? this.model.rows[parentIndex] : this.model.rowRoot;\n\t\tif (!forceLoad && parentRow.isLoaded) return;\n\n\t\tthis.grid.dispatchEvent(new GridEvent('beforeLoad', {grid: this.grid}));\n\t\tthis.grid.loading = true;\n\n\t\tconst offset = this.model.rows.length;\n\t\tthis.grid.logger.info(`loading rows offset = ${offset}`);\n\n\t\tawait this.load(Object.assign(this.getAdapterRequestFilters(), {\n\t\t\toffset: offset,\n\t\t\tparent: {r: parentIndex, props: null}\n\t\t}));\n\t}\n\n\tget totalSize() { return {\n\t\twidth: this.table.totalHeaderWidth + this.model.visibleColumns.reduce((acc, col) => acc + col.width, 0),\n\t\theight: this.table.thead.offsetHeight + this.model.visibleRows.reduce((acc, row) => acc + row.height, 0)\n\t} }\n\n\tprivate autofitDiv: HTMLDivElement;\n\n\tautofitColumn(c: number|ColumnModel, visibleValuesOnly = false, rerender = true) {\n\t\tconst column = typeof c === 'number' ? this.model.columns[c] : c;\n\t\tconst div = this.autofitDiv ?? (this.autofitDiv = dom.createElement<HTMLDivElement>('div'));\n\t\tdiv.style.position = 'absolute';\n\t\tdiv.style.zIndex = '100000';\n\t\tdom.setPosition(div, {l: -1000, t: -1000});\n\t\tthis.grid.shadowRoot.appendChild(div);\n\t\tlet maxWidth = 0;\n\t\tfor (const cell of this.model.getRangeIterator(CellRange.fromA1(column.address), !!visibleValuesOnly)) {\n\t\t\tconst cellDiv: HTMLDivElement = getCellRenderer(cell).call(this.table, div, cell) || div;\n\t\t\tcellDiv.style.width = 'auto';\n\t\t\tmaxWidth = Math.max(maxWidth, cellDiv.offsetWidth);\n\t\t}\n\t\tif (column.header) {\n\t\t\tfor (const h of column.header) {\n\t\t\t\tif (!h) continue;\n\t\t\t\tif (h.html) div.innerHTML = h.label ?? '';\n\t\t\t\telse div.innerText = h.label ?? '';\n\t\t\t\tmaxWidth = Math.max(maxWidth, div.offsetWidth);\n\t\t\t}\n\t\t\tdiv.innerHTML = '';\n\t\t}\n\t\tcolumn.width = maxWidth + 10;\n\t\tif (rerender) this.table.renderCells({horizontal: true});\n\t}\n\n\tautofitColumns(visibleValuesOnly = false) {\n\t\tthis.model.columns.forEach(col => this.autofitColumn(col, visibleValuesOnly, false));\n\t\tthis.table.renderCells({horizontal: true});\n\t}\n\n\tautofitRow(r: number|RowModel, visibleValuesOnly = false, rerender = true) {\n\t\tconst row = typeof r === 'number' ? this.model.rows[r] : r;\n\t\tconst div = this.autofitDiv ?? (this.autofitDiv = dom.createElement<HTMLDivElement>('div'));\n\t\tdiv.style.position = 'absolute';\n\t\tdiv.style.zIndex = '100000';\n\n\t\t// div.style.backgroundColor = 'red';\n\t\t// dom.setPosition(div, {l: 100, t: 100});\n\n\t\tdom.setPosition(div, {l: -1000, t: -1000});\n\t\tthis.grid.shadowRoot.appendChild(div);\n\t\tlet maxHeight = 0;\n\t\tfor (const cell of this.model.getRangeIterator(CellRange.fromA1(row.address), !!visibleValuesOnly)) {\n\t\t\tconst cellDiv: HTMLDivElement = getCellRenderer(cell).call(this.table, div, cell) || div;\n\t\t\tcellDiv.style.height = 'auto';\n\t\t\tmaxHeight = Math.max(maxHeight, cellDiv.offsetHeight);\n\t\t}\n\t\trow.height = maxHeight + 8;\n\t\tif (rerender) this.table.renderCells({vertical: true});\n\t}\n\n\tautofitRows(visibleValuesOnly = false) {\n\t\tthis.model.rows.forEach(row => this.autofitRow(row, visibleValuesOnly, false));\n\t\tthis.table.renderCells({vertical: true});\n\t}\n\n\tscrollTo(r: number|RangeAddress, c = 0) {\n\t\tlet range: CellRange;\n\t\tif (utils.isString(r)) range = CellRange.fromA1(r as RangeAddress);\n\t\telse range = new CellRange(c, r as number);\n\n\t\tthis.table.rowOffset = range.r1;\n\t\tthis.table.colOffset = range.c1;\n\t\tthis.requireVerticalUpdate = true;\n\t\tthis.requireHorizontalUpdate = true;\n\t\tthis.debounceRenderCells();\n\t\tthis.updateSliders();\n\t}\n\n}"]}
1
+ {"version":3,"file":"grid.rendering.js","sourceRoot":"","sources":["../../src/ui/grid.rendering.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,GAAG,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAoC,SAAS,EAAE,aAAa,IAAI,SA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AAG,SAAS,GAAG,CAAC,CAAC;QAC3B,IAAI,QAAQ;YAAE,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;IACxD,CAAC;IAED,WAAW,CAAC,iBAAiB,GAAG,KAAK;QACpC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,iBAAiB,EAAE,KAAK,CAAC,CAAC,CAAC;QAC/E,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;IAC1C,CAAC;IAED,QAAQ,CAAC,CAAsB,EAAE,CAAC,GAAG,CAAC;QACrC,IAAI,KAAgB,CAAC;QACrB,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;YAAE,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,CAAiB,CAAC,CAAC;;YAC9D,KAAK,GAAG,IAAI,SAAS,CAAC,CAAC,EAAE,CAAW,CAAC,CAAC;QAE3C,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,EAAE,CAAC;QAChC,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,EAAE,CAAC;QAChC,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC;QAClC,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAC;QACpC,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,IAAI,CAAC,aAAa,EAAE,CAAC;IACtB,CAAC;CAED","sourcesContent":["import { Direction, dom, getThemeManager, utils } from \"@omegagrid/core\";\nimport { debounce } from \"ts-debounce\";\nimport { CellModel, ColumnModel, RowModel, CellRange, gridConstants as constants, RangeAddress } from \"@omegagrid/grid-core\";\nimport { Grid } from \"./grid\";\nimport { Table, TableRenderOptions, TableRow } from \"./table\";\nimport { GridEvent } from \"./grid.events\";\nimport { getCellRenderer } from \"../renderers\";\nimport { RequestFilters } from \"../gridAdapter\";\nimport { createThemeVariablesCss } from \"@omegagrid/core\";\n\nexport type RefreshOptions = {\n\tvertical?: boolean,\n\thorizontal?: boolean\n\trerenderTable?: boolean\n};\n\nexport class GridRendering {\n\n\trequireVerticalUpdate = true;\n\trequireHorizontalUpdate = false;\n\ttouchStartX: Touch;\n\ttouchStartY: Touch;\n\tresizing = false;\n\tcurrentResizedColumn: ColumnModel;\n\tcurrentResizedColumnWidth: number;\n\tcurrentResizedRow: RowModel;\n\tcurrentResizedRowHeight: number;\n\n\tprivate _vScrolling = true;\n\tget vScrolling() { return this._vScrolling }\n\tprivate _hScrolling = true;\n\tget hScrolling() { return this._hScrolling }\n\n\tget model() { return this.grid.model }\n\tget selection() { return this.grid.selection }\n\tget table() { return this.grid.table }\n\n\tconstructor(readonly grid: Grid) { }\n\n\treadonly debounceRenderCells = debounce(this.renderCells, 50, {isImmediate: false, maxWait: 100});\n\treadonly debounceCalculateViewport = debounce(this.calculateViewport, 200);\n\n\tisLastRowInViewport() {\n\t\tconst viewportRows = this.grid.table.viewport.rows;\n\t\tconst visibleRows = this.model.visibleRows;\n\t\treturn viewportRows[viewportRows.length - 1] == visibleRows[visibleRows.length - 1];\n\t}\n\n\trenderCells(update?: TableRenderOptions) {\n\t\tupdate = update || {vertical: this.requireVerticalUpdate, horizontal: this.requireHorizontalUpdate};\n\t\tthis.grid.comment.deatach();\n\t\tthis.grid.table.renderCells(update);\n\t\tthis.requireHorizontalUpdate = false;\n\t\tthis.requireVerticalUpdate = false;\n\t\tthis.debounceCalculateViewport();\n\t\tthis.grid.objects.updatePostions();\n\t}\n\n\trenderAll(rerenderTable = false) {\n\t\tif (this.grid.group) this.grid.group.grids.forEach((g: Grid) => g.rendering.render(rerenderTable));\n\t\telse this.render(rerenderTable);\n\t}\n\n\tasync render(rerenderTable = false) {\n\t\tif (!this.grid.table || !this.model) return;\n\t\tthis.grid.table.clearHeaderCache();\n\t\tthis.grid.table.clearBodyCache();\n\t\tif (this.grid.table.isConnected) {\n\t\t\tif (rerenderTable) {\n\t\t\t\tthis.grid.table.requestUpdate();\n\t\t\t\tawait this.grid.table.updateComplete;\n\t\t\t}\n\t\t\tthis.grid.table.renderCells({horizontal: true, vertical: true});\n\t\t\tthis.calculateViewport();\n\t\t}\n\t}\n\n\tupdateRange(range: CellRange, recalculate = false) {\n\t\tfor (const cell of this.model.getRangeIterator(range)) {\n\t\t\tthis.updateCells([cell], recalculate);\n\t\t}\n\t}\n\n\tupdateCell(cell: CellModel, recalculate = false) {\n\t\tthis.updateCells([cell], recalculate);\n\t}\n\n\tupdateSpilledCells(cell: CellModel) {\n\t\tlet spillCells: Set<CellModel>;\n\t\tif (cell.prevSpillRange) {\n\t\t\tspillCells = new Set();\n\t\t\tthis.model.getRangeIterator(cell.prevSpillRange).forEach(cell => spillCells.add(cell));\n\t\t}\n\t\tif (cell.spillRange) {\n\t\t\tspillCells = spillCells || new Set();\n\t\t\tthis.model.getRangeIterator(cell.spillRange).forEach(cell => spillCells.add(cell));\n\t\t}\n\t\tif (spillCells?.size > 0) this.updateCells(spillCells);\n\t}\n\n\tupdateCells(cells: Iterable<CellModel>, recalculate = false) {\n\t\tif (recalculate) {\n\t\t\tfor (const cell of cells) {\n\t\t\t\tcell.invalidateStyle();\n\t\t\t\tcell.invalidateValue();\n\t\t\t\tthis.model.calculations.clearDependecies(cell).evaluate(cell);\n\t\t\t\tthis.updateSpilledCells(cell);\n\t\t\t}\n\t\t}\n\n\t\tconst table = this.grid.table;\n\t\tfor (const cell of cells) table.renderBodyCell(cell);\n\t\t\n\t\tif (recalculate) {\n\t\t\tthis.model.calculations.invalidateDependants(cells).forEach((sheet, cell) => {\n\t\t\t\tif (sheet) this.grid.group.getGrid(sheet)?.table.renderBodyCell(cell);\n\t\t\t\telse table.renderBodyCell(cell);\n\t\t\t\tthis.updateSpilledCells(cell);\n\t\t\t});\n\t\t\tthis.grid.dispatchGridEvent('calculate', { cells: Array.from(cells) });\n\t\t}\n\t}\n\n\tupdateHeaders() {\n\t\tthis.model.indexVisibleColumns();\n\t\tthis.table.clearHeaderCache();\n\t\tthis.table.createHeaderRows();\n\t\tthis.table.renderHeader();\n\t}\n\n\tcalculateViewport(recalculate = false) {\n\t\tthis.grid.logger.info('calculate viwport');\n\t\tthis.updateCells(this.model.calculateViewport(), recalculate);\n\t}\n\n\tupdateSliders() {\n\t\tconst ws = this.table.viewportSize;\n\t\tthis.grid.vSlider.maxValue = this.model.visibleRows.length;\n\t\tthis.grid.vSlider.pageSize = ws.h / this.model.options.rowHeight;\n\t\tthis.grid.vSlider.value = this.table.rowOffset;\n\t\tthis.grid.hSlider.maxValue = this.model.visibleColumns.length;\n\t\tthis.grid.hSlider.pageSize = ws.w / this.model.options.columnWidth;\n\t\tthis.grid.hSlider.value = this.table.colOffset;\n\t}\n\n\tisVerticalScrollingEnabled() {\n\t\treturn this.grid.options.scrolling.verticalOverscroll !== false \n\t\t\t|| this.table.viewport.rows.length < this.model.visibleRows.length;\n\t}\n\n\tisHorizontalScrollingEnabled() {\n\t\treturn this.grid.options.scrolling.horizontalOverscroll !== false \n\t\t\t|| this.table.viewport.columns.length < this.model.visibleColumns.length;\n\t}\n\n\tupdateSliderVisibility() {\n\t\tthis._vScrolling = this.isVerticalScrollingEnabled();\n\t\tif (this._vScrolling) {\n\t\t\tthis.grid.vSlider.show();\n\t\t\tdom.showElement(this.grid.vSlider);\n\t\t} else {\n\t\t\tthis.grid.vSlider.hide();\n\t\t\tdom.hideElement(this.grid.vSlider);\n\t\t}\n\t\t\n\t\tthis._hScrolling = this.isHorizontalScrollingEnabled();\n\t\tif (this._hScrolling) {\n\t\t\tthis.grid.hSlider.show();\n\t\t\tdom.showElement(this.grid.hSlider);\n\t\t} else {\n\t\t\tthis.grid.hSlider.hide();\n\t\t\tdom.hideElement(this.grid.hSlider);\n\t\t}\n\t}\n\n\thideSliders() {\n\t\tthis.grid.vSlider.hide();\n\t\tthis.grid.hSlider.hide();\n\t}\n\n\tscrollVerticalByPixels(pixels: number) {\n\t\tif (!this.vScrolling) return;\n\n\t\tlet topRow = this.table.rowOffset;\n\t\tlet top = 0, r = 0;\n\t\tlet row: RowModel;\n\n\t\tif (pixels > 0) {\n\t\t\twhile (top < pixels && topRow + r < this.model.visibleRows.length) {\n\t\t\t\ttop += this.model.visibleRows[topRow + (r++)].height + 2;\n\t\t\t}\n\t\t\ttopRow = topRow + r;\n\t\t} else if (pixels < 0) {\n\t\t\tpixels = Math.abs(pixels);\n\t\t\twhile (top < pixels && topRow + r >= 0) {\n\t\t\t\trow = this.model.visibleRows[Math.min(this.model.visibleRows.length - 1, topRow + (r--))];\n\t\t\t\ttop += (row ? row.height : 0) + 2;\n\t\t\t}\n\t\t\ttopRow = topRow + r;\n\t\t}\n\n\t\tif (topRow >= this.model.visibleRows.length) topRow = this.model.visibleRows.length - 1;\n\t\t\n\t\tthis.requireVerticalUpdate = true;\n\t\tthis.table.rowOffset = Math.max(0, topRow);\n\t\tthis.debounceRenderCells();\n\t\tthis.updateSliders();\n\t}\n\n\tscrollHorizontalByPixels(pixels: number) {\n\t\tif (!this.hScrolling) return;\n\t\t\n\t\tlet leftCol = this.table.colOffset;\n\t\tlet left = 0, c = 0;\n\t\tif (pixels > 0) {\n\t\t\twhile (left < pixels && leftCol + c < this.model.visibleColumns.length) {\n\t\t\t\tleft += this.model.visibleColumns[leftCol + (c++)].width + 2;\n\t\t\t}\n\t\t\tleftCol = leftCol + c;\n\t\t} else if (pixels < 0) {\n\t\t\tpixels = Math.abs(pixels);\n\t\t\twhile (left < pixels && leftCol + c >= 0) {\n\t\t\t\tleft += this.model.visibleColumns[Math.min(this.model.visibleColumns.length - 1, leftCol + (c--))].width + 2;\n\t\t\t}\n\t\t\tleftCol = leftCol + c;\n\t\t}\n\n\t\tif (leftCol >= this.model.visibleColumns.length) leftCol = this.model.visibleColumns.length - 1;\n\n\t\tthis.requireHorizontalUpdate = true;\n\t\tthis.table.colOffset = Math.max(0, leftCol);\n\t\tthis.debounceRenderCells();\n\t\tthis.updateSliders();\n\t}\n\n\tupdateCellSelectionRange() {\n\t\tconst table = this.table;\n\t\tfor (const cell of this.model.getRangeIterator(this.selection.range, false)) {\n\t\t\ttable.renderBodyCell(cell);\n\t\t}\n\t}\n\n\tgetAdapterRequestFilters(): RequestFilters {\n\t\treturn {\n\t\t\toffset: 0,\n\t\t\tfilter: this.grid.filtering?.filter ? Array.from(this.grid.filtering.filter.settings.values()) : null,\n\t\t\torder: this.grid.model?.sorting?.settings\n\t\t};\n\t}\n\n\tasync toggleRow(index: number, dispatchEvent = true) {\n\t\tconst row = this.model.rows[index];\n\t\tif (row.isLoaded || row.isPartialyLoaded) {\n\t\t\trow.toggleCollapse(false, this.model.options.unhideRowAfterExpand);\n\t\t\tthis.table.renderCells({vertical: true});\n\t\t} else if (this.grid.adapter) {\n\t\t\tconst tr = this.table.getRowByModelIndex(index) as TableRow;\n\t\t\tif (tr && tr.expander) tr.expander.state = 'waiting';\n\t\n\t\t\trow.collapsed = false;\n\n\t\t\tconst requestFilters = Object.assign(this.getAdapterRequestFilters(), {\n\t\t\t\tparent: {r: row.index, props: row.properties}\n\t\t\t})\n\n\t\t\tconst [newRowSources] = await Promise.all([this.grid.adapter.getRows(requestFilters)]);\n\t\t\tthis.model.insertRowData(row, 0, newRowSources);\n\t\t\t\n\t\t\trequestFilters.rows = newRowSources;\n\t\t\tconst [newCellSources] = await Promise.all([this.grid.adapter.getCells(requestFilters)]);\n\t\t\tnewCellSources?.map(cellSource => this.model.getCellByCoords(cellSource.r, cellSource.c)?.update(cellSource));\n\t\t\n\t\t\tthis.table.requestUpdate();\n\t\t}\n\n\t\tthis.updateSliders();\n\t\tif (dispatchEvent) this.grid.dispatchEvent(new GridEvent('row.toggle', {grid: this.grid, row}));\n\t}\n\t\n\ttoggleColumn(index: number, dispatchEvent = true) {\n\t\tconst column = this.model.columns[index];\n\t\tcolumn.toggleCollapse(false, this.model.options.unhideColumnAfterExpand);\n\t\tthis.table.renderCells({horizontal: true});\n\t\tthis.updateSliders();\n\t\tif (dispatchEvent) this.grid.dispatchEvent(new GridEvent('column.toggle', {grid: this.grid, column }));\n\t}\n\n\tsetRowExpandLevel(level: number) {\n\t\tthis.model.setRowExpandLevel(level);\n\t\tthis.table.rowOffset = 0;\n\t\tthis.table.renderCells({vertical: true});\n\t\tthis.updateSliders();\n\t\tthis.grid.dispatchEvent(new GridEvent('row.toggle', {grid: this.grid}));\n\t}\n\n\tsetColumnExpandLevel(level: number) {\n\t\tthis.model.setColumnExpandLevel(level);\n\t\tthis.table.colOffset = 0;\n\t\tthis.table.renderCells({horizontal: true});\n\t\tthis.updateSliders();\n\t\tthis.grid.dispatchEvent(new GridEvent('column.toggle', {grid: this.grid}));\n\t}\n\n\tasync exportHTML() {\n\t\tconst div = dom.createElement<HTMLDivElement>('div');\n\t\tdom.hideElement(div);\n\t\tdocument.body.appendChild(div);\n\t\tconst table = dom.createElement<Table>('og-table');\n\t\ttable.grid = this.grid;\n\t\ttable.model = this.model;\n\t\ttable.renderAll = true;\n\t\tdiv.appendChild(table);\n\t\tawait table.updateComplete;\n\n\t\tconst rowBreaks = this.model.options?.print?.rowBreaks;\n\t\tconst tableElm = table.table;\n\n\t\t// split table into multiple tables if page breaks are defined\n\t\tconst hasRowBreaks = rowBreaks && rowBreaks.length > 0;\n\t\tif (hasRowBreaks) {\n\t\t\tconst colgroup = tableElm.querySelector('colgroup');\n\t\t\tconst rows = [...tableElm.tBodies[0].rows];\n\n\t\t\tconst rowTitlesRange = this.model.options?.print?.rowTitles \n\t\t\t\t? CellRange.fromA1(this.model.options?.print?.rowTitles) : null;\n\n\t\t\tconst rowTitles = rowTitlesRange ? Array.from({\n\t\t\t\tlength: rowTitlesRange.r2 - rowTitlesRange.r1 + 1}, \n\t\t\t\t(_, i) => rows[table.rowMap.get(rowTitlesRange.r1 + i)]\n\t\t\t) : [];\n\n\t\t\tfor (let i = 0; i < rowBreaks.length; i++) {\n\t\t\t\tconst tableElm2 = dom.createElement<HTMLTableElement>('table');\n\t\t\t\ttableElm2.appendChild(colgroup.cloneNode(true));\n\t\t\t\tconst tbody = dom.createElement<HTMLTableSectionElement>('tbody');\n\t\t\t\ttableElm2.appendChild(tbody);\n\n\t\t\t\tconst rMin = table.rowMap.get(rowBreaks[i]);\n\t\t\t\tconst rMax = i < rowBreaks.length - 1 \n\t\t\t\t\t? table.rowMap.get(rowBreaks[i + 1]) \n\t\t\t\t\t: this.model.visibleRows.length - 1;\n\n\t\t\t\trowTitles.forEach(row => tbody.appendChild(row.cloneNode(true)));\n\n\t\t\t\tfor (let r = rMin; r <= rMax; r++) {\n\t\t\t\t\ttbody.appendChild(rows[r]);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttable.shadowRoot.appendChild(tableElm2);\n\t\t\t}\n\n\t\t\tcolgroup.cloneNode(true);\n\t\t}\n\n\t\tconst tableCss = `\n\t\t\t<style>\n\t\t\t\thtml {\n\t\t\t\t\t${createThemeVariablesCss(getThemeManager().themes.get('light')).cssText}\n\t\t\t\t}\n\t\t\t\t${hasRowBreaks ? 'table {break-after: page}' : ''}\n\t\t\t\t${Table.styles.map(style => style.cssText).join('\\n')}\n\t\t\t</style>\\n\n\t\t`;\n\n\t\tconst html = tableCss + table.shadowRoot.innerHTML.replace(/<!---->/g, '');\n\t\tdiv.remove();\n\t\treturn html;\n\t}\n\n\tautoscrollDirection: Direction;\n\tautoscrollTimer: number;\n\tautoscrollValue: number;\n\n\tstopAutoscroll() {\n\t\tif (this.autoscrollTimer) {\n\t\t\twindow.clearInterval(this.autoscrollTimer);\n\t\t}\n\t}\n\n\tstartAutoscroll() {\n\t\tthis.stopAutoscroll();\n\t\tthis.autoscrollTimer = window.setInterval(() => {\n\t\t\tif (this.autoscrollValue == 0) return this.stopAutoscroll();\n\t\t\tconst amount = Math.pow(this.autoscrollValue, constants.AUTOSCROLL_RATIO);\n\t\t\tswitch (this.autoscrollDirection) {\n\t\t\t\tcase 'down': this.scrollVerticalByPixels(amount); break;\n\t\t\t\tcase 'up': this.scrollVerticalByPixels(-amount); break;\n\t\t\t\tcase 'left': this.scrollHorizontalByPixels(-amount); break;\n\t\t\t\tcase 'right': this.scrollHorizontalByPixels(amount); break;\n\t\t\t}\n\t\t}, constants.AUTOSCROLL_INTERVAL);\n\t}\n\n\tautoscroll(moousePosition: {x: number, y: number}) {\n\t\tconst { x, y } = moousePosition;\n\t\tconst w = (this.table.clientWidth / this.table.zoom) - this.table.totalHeaderWidth;\n\t\tconst h = (this.table.clientHeight / this.table.zoom) - (this.table.totalHeaderHeight);\n\t\tlet direction: Direction;\n\t\tlet value = 0;\n\n\t\tif (x < constants.AUTOSCROLL_TRESHOLD && x < y && x < h - y) {\n\t\t\tdirection = 'left';\n\t\t\tvalue = constants.AUTOSCROLL_TRESHOLD - x;\n\t\t} else if (w - x < constants.AUTOSCROLL_TRESHOLD && w - x < y && w - x < h - y) {\n\t\t\tdirection = 'right';\n\t\t\tvalue = constants.AUTOSCROLL_TRESHOLD - w + x;\n\t\t} else if (y < constants.AUTOSCROLL_TRESHOLD) {\n\t\t\tdirection = 'up';\n\t\t\tvalue = constants.AUTOSCROLL_TRESHOLD - y;\n\t\t} else if (h - y < constants.AUTOSCROLL_TRESHOLD) {\n\t\t\tdirection = 'down';\n\t\t\tvalue = constants.AUTOSCROLL_TRESHOLD - h + y;\n\t\t}\n\n\t\tthis.autoscrollDirection = direction;\n\t\tthis.autoscrollValue = value;\n\t\tthis.stopAutoscroll();\n\t\tif (value > 0) {\n\t\t\tthis.startAutoscroll();\n\t\t}\n\t}\n\n\tasync load(requestFilters?: RequestFilters) {\n\t\trequestFilters = requestFilters || this.getAdapterRequestFilters();\n\t\tconst parentIndex = requestFilters.parent?.r ?? null;\n\t\tconst parentRow = parentIndex != null ? this.model.rows[parentIndex] : this.model.rowRoot;\n\t\t\n\t\tconst [newRowSources] = await Promise.all([this.grid.adapter.getRows(requestFilters)]);\n\t\tif (newRowSources.length > 0 && parentIndex === null) {\n\t\t\tthis.model.insertRowData(parentRow, requestFilters.offset, newRowSources);\n\t\t}\n\t\t\n\t\tconst [newCellSources] = await Promise.all([this.grid.adapter.getCells(requestFilters)]);\n\t\tnewCellSources?.map(cellSource => this.model.getCellByCoords(cellSource.r, cellSource.c)?.update(cellSource));\n\t\t\n\t\tthis.table.requestUpdate();\n\n\t\tif (newRowSources.length >= this.model.options.pageSize) parentRow.count = Infinity;\n\t\telse parentRow.count = parentRow.children.length;\n\n\t\tthis.grid.logger.info(`loaded ${newRowSources.length} rows`);\n\t\tthis.grid.loading = false;\n\t\tthis.grid.dispatchEvent(new GridEvent('afterLoad', {grid: this.grid}));\n\t}\n\n\tasync loadNextPage(parentIndex: number = null, forceLoad = false) {\n\t\tif (this.grid.loading) return;\n\t\tconst parentRow = parentIndex != null ? this.model.rows[parentIndex] : this.model.rowRoot;\n\t\tif (!forceLoad && parentRow.isLoaded) return;\n\n\t\tthis.grid.dispatchEvent(new GridEvent('beforeLoad', {grid: this.grid}));\n\t\tthis.grid.loading = true;\n\n\t\tconst offset = this.model.rows.length;\n\t\tthis.grid.logger.info(`loading rows offset = ${offset}`);\n\n\t\tawait this.load(Object.assign(this.getAdapterRequestFilters(), {\n\t\t\toffset: offset,\n\t\t\tparent: {r: parentIndex, props: null}\n\t\t}));\n\t}\n\n\tget totalSize() { return {\n\t\twidth: this.table.totalHeaderWidth + this.model.visibleColumns.reduce((acc, col) => acc + col.width, 0),\n\t\theight: this.table.thead.offsetHeight + this.model.visibleRows.reduce((acc, row) => acc + row.height, 0)\n\t} }\n\n\tprivate autofitDiv: HTMLDivElement;\n\n\tautofitColumn(c: number|ColumnModel, visibleValuesOnly = false, rerender = true) {\n\t\tconst column = typeof c === 'number' ? this.model.columns[c] : c;\n\t\tconst div = this.autofitDiv ?? (this.autofitDiv = dom.createElement<HTMLDivElement>('div'));\n\t\tdiv.style.position = 'absolute';\n\t\tdiv.style.zIndex = '100000';\n\t\tdom.setPosition(div, {l: -1000, t: -1000});\n\t\tthis.grid.shadowRoot.appendChild(div);\n\t\tlet maxWidth = 0;\n\t\tfor (const cell of this.model.getRangeIterator(CellRange.fromA1(column.address), !!visibleValuesOnly)) {\n\t\t\tconst cellDiv: HTMLDivElement = getCellRenderer(cell).call(this.table, div, cell) || div;\n\t\t\tcellDiv.style.width = 'auto';\n\t\t\tmaxWidth = Math.max(maxWidth, cellDiv.offsetWidth);\n\t\t}\n\t\tif (column.header) {\n\t\t\tfor (const h of column.header) {\n\t\t\t\tif (!h) continue;\n\t\t\t\tif (h.html) div.innerHTML = h.label ?? '';\n\t\t\t\telse div.innerText = h.label ?? '';\n\t\t\t\tmaxWidth = Math.max(maxWidth, div.offsetWidth);\n\t\t\t}\n\t\t\tdiv.innerHTML = '';\n\t\t}\n\t\tcolumn.width = maxWidth + 22;\n\t\tif (rerender) this.table.renderCells({horizontal: true});\n\t}\n\n\tautofitColumns(visibleValuesOnly = false) {\n\t\tthis.model.columns.forEach(col => this.autofitColumn(col, visibleValuesOnly, false));\n\t\tthis.table.renderCells({horizontal: true});\n\t}\n\n\tautofitRow(r: number|RowModel, visibleValuesOnly = false, rerender = true) {\n\t\tconst row = typeof r === 'number' ? this.model.rows[r] : r;\n\t\tconst div = this.autofitDiv ?? (this.autofitDiv = dom.createElement<HTMLDivElement>('div'));\n\t\tdiv.style.position = 'absolute';\n\t\tdiv.style.zIndex = '100000';\n\n\t\t// div.style.backgroundColor = 'red';\n\t\t// dom.setPosition(div, {l: 100, t: 100});\n\n\t\tdom.setPosition(div, {l: -1000, t: -1000});\n\t\tthis.grid.shadowRoot.appendChild(div);\n\t\tlet maxHeight = 0;\n\t\tfor (const cell of this.model.getRangeIterator(CellRange.fromA1(row.address), !!visibleValuesOnly)) {\n\t\t\tconst cellDiv: HTMLDivElement = getCellRenderer(cell).call(this.table, div, cell) || div;\n\t\t\tcellDiv.style.height = 'auto';\n\t\t\tmaxHeight = Math.max(maxHeight, cellDiv.offsetHeight);\n\t\t}\n\t\trow.height = maxHeight + 8;\n\t\tif (rerender) this.table.renderCells({vertical: true});\n\t}\n\n\tautofitRows(visibleValuesOnly = false) {\n\t\tthis.model.rows.forEach(row => this.autofitRow(row, visibleValuesOnly, false));\n\t\tthis.table.renderCells({vertical: true});\n\t}\n\n\tscrollTo(r: number|RangeAddress, c = 0) {\n\t\tlet range: CellRange;\n\t\tif (utils.isString(r)) range = CellRange.fromA1(r as RangeAddress);\n\t\telse range = new CellRange(c, r as number);\n\n\t\tthis.table.rowOffset = range.r1;\n\t\tthis.table.colOffset = range.c1;\n\t\tthis.requireVerticalUpdate = true;\n\t\tthis.requireHorizontalUpdate = true;\n\t\tthis.debounceRenderCells();\n\t\tthis.updateSliders();\n\t}\n\n}"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omegagrid/grid",
3
- "version": "0.10.27",
3
+ "version": "0.10.29",
4
4
  "license": "UNLICENSED",
5
5
  "description": "Universal datagrid component",
6
6
  "main": "./dist/index.js",
@@ -35,12 +35,12 @@
35
35
  "_prepublish": "yarn test && yarn lint"
36
36
  },
37
37
  "dependencies": {
38
- "@omegagrid/commands": "^0.10.27",
39
- "@omegagrid/core": "^0.10.27",
40
- "@omegagrid/grid-core": "^0.10.27",
41
- "@omegagrid/localize": "^0.10.27",
42
- "@omegagrid/tabs": "^0.10.27",
43
- "@omegagrid/tree": "^0.10.27",
38
+ "@omegagrid/commands": "^0.10.29",
39
+ "@omegagrid/core": "^0.10.29",
40
+ "@omegagrid/grid-core": "^0.10.29",
41
+ "@omegagrid/localize": "^0.10.29",
42
+ "@omegagrid/tabs": "^0.10.29",
43
+ "@omegagrid/tree": "^0.10.29",
44
44
  "@stdlib/stats": "^0.0.13",
45
45
  "date-fns": "^3.2.0",
46
46
  "lit": "^3.1.1",