@omnigrid/react 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/OmniGrid.js +5 -3
  2. package/package.json +1 -1
package/dist/OmniGrid.js CHANGED
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
3
3
  import { DomPool } from "@omnigrid/core";
4
4
  import { contentToReactNode } from "./content";
@@ -484,7 +484,7 @@ export function OmniGrid({ className, style, slotComponents, ...options }) {
484
484
  const deepestDepth = hasGroups ? (viewportData.columnGroupDepth.get(item.index) ?? -1) : -1;
485
485
  const gapRows = headerRowCount - 1 - deepestDepth;
486
486
  const fullHeight = gapRows > 0;
487
- return (_jsx("div", { role: "columnheader", className: `omnigrid-header-cell${fullHeight ? " omnigrid-header-cell-full-height" : ""}`, "data-sort": item.column.sortState, "data-sortable": item.column.sortable === true ? "true" : undefined, "aria-sort": item.column.sortState === "asc" ? "ascending" : item.column.sortState === "desc" ? "descending" : "none", onClick: (event) => item.column.stopHeaderClick
487
+ return (_jsx("div", { role: "columnheader", className: `omnigrid-header-cell${fullHeight ? " omnigrid-header-cell-full-height" : ""}`, "data-sort": item.column.sortState, "data-sort-index": item.column.sortIndex, "data-sortable": item.column.sortable === true ? "true" : undefined, "aria-sort": item.column.sortState === "asc" ? "ascending" : item.column.sortState === "desc" ? "descending" : "none", onClick: (event) => item.column.stopHeaderClick
488
488
  ? event.stopPropagation()
489
489
  : grid.headerClick(item.column.id, event.shiftKey || event.ctrlKey || event.metaKey), onKeyDown: (event) => {
490
490
  if (event.key === "Enter" || event.key === " ")
@@ -504,7 +504,9 @@ export function OmniGrid({ className, style, slotComponents, ...options }) {
504
504
  }, children: item.column.headerRenderer ? (contentToReactNode(item.column.headerRenderer(item.column), {
505
505
  registry: slotComponentsRef.current,
506
506
  context: buildRenderContext,
507
- })) : (_jsxs(_Fragment, { children: [_jsx("span", { className: "omnigrid-header-label", children: item.column.header ?? item.column.id }), _jsx("span", { className: "omnigrid-header-tools", children: item.column.sortState && (_jsx("span", { className: "omnigrid-sort-indicator", "aria-hidden": "true", children: item.column.sortState === "asc" ? "▲" : "▼" })) })] })) }, item.column.id));
507
+ })) : (_jsxs(_Fragment, { children: [_jsx("span", { className: "omnigrid-header-label", children: item.column.header ?? item.column.id }), _jsx("span", { className: "omnigrid-header-tools", children: item.column.sortState && (_jsxs("span", { className: "omnigrid-sort-indicator", "aria-hidden": "true", children: [contentToReactNode(item.column.sortState === "asc"
508
+ ? grid.icons.get("arrow-up")
509
+ : grid.icons.get("arrow-down"), { registry: slotComponentsRef.current, context: buildRenderContext }), item.column.sortIndex !== undefined && (_jsx("span", { className: "omnigrid-sort-priority", children: item.column.sortIndex }))] })) })] })) }, item.column.id));
508
510
  });
509
511
  const renderGroupCells = (depth, columns, originX) => computeGroupSegments(viewportData.columnGroups, columns, depth, originX).map((segment, index) => (_jsx("div", { role: "columnheader", className: "omnigrid-header-cell omnigrid-header-group-cell", "aria-colspan": segment.columnCount, title: segment.group.header ?? segment.group.id, style: {
510
512
  alignItems: "center",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omnigrid/react",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "React adapter and renderer for OmniGrid",
5
5
  "keywords": [
6
6
  "omnigrid",