@1771technologies/lytenyte-pro 1.0.0-beta.7 → 1.0.0-beta.9

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.
package/dist/+types.d.ts CHANGED
@@ -892,7 +892,8 @@ export interface HeaderGroupCellLayout {
892
892
  */
893
893
  readonly isCollapsible: boolean;
894
894
  /**
895
- * A unique identifier that can be used for rendering keys or tracking elements.
895
+ * The id for the header group. Note this is not unique across all header groups. In particular
896
+ * split header groups with the same path will share the same id. Prefer `idOccurrence` for unique keys.
896
897
  */
897
898
  readonly id: string;
898
899
  /**
@@ -1707,9 +1708,9 @@ export interface ClientRowDataSourceParams<T> {
1707
1708
  * Callback that transforms a column in-filter item before it's applied.
1708
1709
  */
1709
1710
  readonly transformInFilterItem?: (params: {
1710
- field: unknown;
1711
1711
  column: Column<T>;
1712
- }) => FilterInFilterItem;
1712
+ values: unknown[];
1713
+ }) => FilterInFilterItem[];
1713
1714
  }
1714
1715
  /**
1715
1716
  * Parameters for initializing a tree-structured data source in LyteNyte Grid.
@@ -1743,9 +1744,9 @@ export interface ClientTreeDataSourceParams<T> {
1743
1744
  * Callback that transforms a column in-filter item before it's applied.
1744
1745
  */
1745
1746
  readonly transformInFilterItem?: (params: {
1746
- field: unknown;
1747
1747
  column: Column<T>;
1748
- }) => FilterInFilterItem;
1748
+ values: unknown[];
1749
+ }) => FilterInFilterItem[];
1749
1750
  /**
1750
1751
  * Returns the hierarchical path to group a given data row in tree mode.
1751
1752
  */
@@ -2,7 +2,7 @@ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useEffect } from "react";
3
3
  import { useGridRoot } from "../context";
4
4
  import { useEdgeScroll } from "./use-edge-scroll";
5
- import { getClientX, getClientY, getRelativeXPosition, getRelativeYPosition, } from "@1771technologies/lytenyte-js-utils";
5
+ import { equal, getClientX, getClientY, getRelativeXPosition, getRelativeYPosition, } from "@1771technologies/lytenyte-js-utils";
6
6
  import { getNearestFocusable, getPositionFromFocusable } from "@1771technologies/lytenyte-shared";
7
7
  import { isHTMLElement } from "@1771technologies/lytenyte-dom-utils";
8
8
  import { updateAdditiveCellSelection } from "./update-additive-cell-selection";
@@ -238,8 +238,16 @@ export function CellSelectionDriver() {
238
238
  };
239
239
  }, [cancelX, cancelY, edgeScrollX, edgeScrollY, grid, mode, viewport]);
240
240
  useEffect(() => {
241
+ let prev = null;
241
242
  return grid.internal.focusActive.watch(() => {
242
243
  const focus = grid.internal.focusActive.get();
244
+ // If the focus is null, then we should just return. This keeps the existing selection
245
+ // in place - for things like copy and paste.
246
+ if (!focus)
247
+ return;
248
+ if (equal(prev, focus))
249
+ return;
250
+ prev = focus;
243
251
  if (focus?.kind !== "cell" && focus?.kind !== "full-width") {
244
252
  grid.state.cellSelections.set([]);
245
253
  grid.internal.cellSelectionPivot.set(null);
@@ -10,9 +10,10 @@ const CellImpl = forwardRef(function Cell({ cell, children, ...props }, forwarde
10
10
  const grid = useGridRoot().grid;
11
11
  const cx = grid.state;
12
12
  grid.internal.refreshKey.useValue();
13
+ const base = grid.state.columnBase.useValue();
13
14
  const row = cell.row.useValue();
14
15
  const renderers = cx.cellRenderers.useValue();
15
- const providedRenderer = children ?? cell.column.cellRenderer;
16
+ const providedRenderer = children ?? cell.column.cellRenderer ?? base.cellRenderer;
16
17
  const Renderer = providedRenderer
17
18
  ? typeof providedRenderer === "string"
18
19
  ? (renderers[providedRenderer] ?? CellDefault)
@@ -1 +1 @@
1
- export { AddIcon, AddSmallIcon, AggregateIcon, AggregationIcon, ArchiveIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightCurvedIcon, ArrowRightIcon, ArrowUpIcon, AutosizeIcon, BackIcon, BookmarkIcon, BooleanIcon, CalendarIcon, ChartIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, Close2Icon, CloseIcon, CollapseGroupIcon, Columns2Icon, ColumnsIcon, CopyIcon, CornerRadiusIcon, CustomizeThemeIcon, CutIcon, DeleteIcon, DocsIcon, DownloadIcon, Drag2Icon, DragDotsIcon, DragDotsSmallIcon, DragIcon, DuplicateIcon, EditIcon, EmailIcon, ExpandGroupIcon, ExpandIcon, Expression2Icon, ExpressionIcon, ExternalLinkIcon, File2Icon, FileIcon, FilterIcon, FolderIcon, GlobeIcon, GridViewIcon, GroupByColIcon, HamburgerIcon, HelpIcon, HiddenIcon, HistoryIcon, ImportIcon, LinkIcon, ListViewIcon, LoadingIcon, LocationIcon, ModalIcon, MoreIcon, MoreVerticalIcon, MultilineIcon, NumberIcon, PasteIcon, PieIcon, PinColumnIcon, RefreshIcon, SearchIcon, SettingsIcon, ShareIcon, SingleLineIcon, Sort2Icon, SortIcon, SpacingHIcon, SpacingIcon, StickColumnIcon, SwapIcon, TagIcon, TaskIcon, TextIcon, ThemesIcon, Tickmark2Icon, TickmarkIcon, TimeIcon, UploadIcon, UserIcon, ViewIcon, } from "@1771technologies/lytenyte-core/icons";
1
+ export { AddIcon, AddSmallIcon, AggregateIcon, AggregationIcon, ArchiveIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightCurvedIcon, ArrowRightIcon, ArrowUpIcon, AutosizeIcon, BackIcon, BookmarkIcon, BooleanIcon, CalendarIcon, ChartIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, Close2Icon, CloseIcon, CollapseGroupIcon, Columns2Icon, ColumnsIcon, CopyIcon, CornerRadiusIcon, CustomizeThemeIcon, CutIcon, CsvIcon, DeleteIcon, DocsIcon, DownloadIcon, Drag2Icon, DragDotsIcon, DragDotsSmallIcon, DragIcon, DuplicateIcon, EditIcon, EmailIcon, ExcelIcon, ExpandGroupIcon, ExpandIcon, Expression2Icon, ExpressionIcon, ExternalLinkIcon, File2Icon, FileIcon, FilterIcon, FolderIcon, GlobeIcon, GridViewIcon, GroupByColIcon, HamburgerIcon, HelpIcon, HiddenIcon, HistoryIcon, ImportIcon, LinkIcon, ListViewIcon, LoadingIcon, LocationIcon, ModalIcon, MoreIcon, MoreVerticalIcon, MultilineIcon, NumberIcon, PasteIcon, PieIcon, PinColumnIcon, RefreshIcon, SearchIcon, SettingsIcon, ShareIcon, SingleLineIcon, Sort2Icon, SortIcon, SpacingHIcon, SpacingIcon, StickColumnIcon, SwapIcon, TagIcon, TaskIcon, TextIcon, ThemesIcon, Tickmark2Icon, TickmarkIcon, TimeIcon, UploadIcon, UserIcon, ViewIcon, } from "@1771technologies/lytenyte-core/icons";
@@ -1 +1 @@
1
- export { AddIcon, AddSmallIcon, AggregateIcon, AggregationIcon, ArchiveIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightCurvedIcon, ArrowRightIcon, ArrowUpIcon, AutosizeIcon, BackIcon, BookmarkIcon, BooleanIcon, CalendarIcon, ChartIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, Close2Icon, CloseIcon, CollapseGroupIcon, Columns2Icon, ColumnsIcon, CopyIcon, CornerRadiusIcon, CustomizeThemeIcon, CutIcon, DeleteIcon, DocsIcon, DownloadIcon, Drag2Icon, DragDotsIcon, DragDotsSmallIcon, DragIcon, DuplicateIcon, EditIcon, EmailIcon, ExpandGroupIcon, ExpandIcon, Expression2Icon, ExpressionIcon, ExternalLinkIcon, File2Icon, FileIcon, FilterIcon, FolderIcon, GlobeIcon, GridViewIcon, GroupByColIcon, HamburgerIcon, HelpIcon, HiddenIcon, HistoryIcon, ImportIcon, LinkIcon, ListViewIcon, LoadingIcon, LocationIcon, ModalIcon, MoreIcon, MoreVerticalIcon, MultilineIcon, NumberIcon, PasteIcon, PieIcon, PinColumnIcon, RefreshIcon, SearchIcon, SettingsIcon, ShareIcon, SingleLineIcon, Sort2Icon, SortIcon, SpacingHIcon, SpacingIcon, StickColumnIcon, SwapIcon, TagIcon, TaskIcon, TextIcon, ThemesIcon, Tickmark2Icon, TickmarkIcon, TimeIcon, UploadIcon, UserIcon, ViewIcon, } from "@1771technologies/lytenyte-core/icons";
1
+ export { AddIcon, AddSmallIcon, AggregateIcon, AggregationIcon, ArchiveIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightCurvedIcon, ArrowRightIcon, ArrowUpIcon, AutosizeIcon, BackIcon, BookmarkIcon, BooleanIcon, CalendarIcon, ChartIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, Close2Icon, CloseIcon, CollapseGroupIcon, Columns2Icon, ColumnsIcon, CopyIcon, CornerRadiusIcon, CustomizeThemeIcon, CutIcon, CsvIcon, DeleteIcon, DocsIcon, DownloadIcon, Drag2Icon, DragDotsIcon, DragDotsSmallIcon, DragIcon, DuplicateIcon, EditIcon, EmailIcon, ExcelIcon, ExpandGroupIcon, ExpandIcon, Expression2Icon, ExpressionIcon, ExternalLinkIcon, File2Icon, FileIcon, FilterIcon, FolderIcon, GlobeIcon, GridViewIcon, GroupByColIcon, HamburgerIcon, HelpIcon, HiddenIcon, HistoryIcon, ImportIcon, LinkIcon, ListViewIcon, LoadingIcon, LocationIcon, ModalIcon, MoreIcon, MoreVerticalIcon, MultilineIcon, NumberIcon, PasteIcon, PieIcon, PinColumnIcon, RefreshIcon, SearchIcon, SettingsIcon, ShareIcon, SingleLineIcon, Sort2Icon, SortIcon, SpacingHIcon, SpacingIcon, StickColumnIcon, SwapIcon, TagIcon, TaskIcon, TextIcon, ThemesIcon, Tickmark2Icon, TickmarkIcon, TimeIcon, UploadIcon, UserIcon, ViewIcon, } from "@1771technologies/lytenyte-core/icons";
package/dist/index.d.ts CHANGED
@@ -4,3 +4,4 @@ export { FilterTree } from "./filter-tree/filter-tree.js";
4
4
  export { ColumnManager } from "./column-manager/column-manager.js";
5
5
  export { GridBox } from "./grid-box/grid-box.js";
6
6
  export { activateLicense } from "./license.js";
7
+ export { measureText } from "@1771technologies/lytenyte-shared";
package/dist/index.js CHANGED
@@ -4,3 +4,4 @@ export { FilterTree } from "./filter-tree/filter-tree.js";
4
4
  export { ColumnManager } from "./column-manager/column-manager.js";
5
5
  export { GridBox } from "./grid-box/grid-box.js";
6
6
  export { activateLicense } from "./license.js";
7
+ export { measureText } from "@1771technologies/lytenyte-shared";
@@ -375,11 +375,10 @@ export function makeClientDataSourcePaginated(p) {
375
375
  const field = grid.api.columnField(c, row);
376
376
  return field;
377
377
  }));
378
- return [...values].map((x) => {
379
- if (!p.transformInFilterItem)
380
- return { id: `${x}`, label: `${x}`, value: x };
381
- return p.transformInFilterItem({ field: x, column: c });
382
- });
378
+ if (p.transformInFilterItem) {
379
+ return p.transformInFilterItem({ column: c, values: [...values] });
380
+ }
381
+ return [...values].map((x) => ({ id: `${x}`, label: `${x}`, value: x }));
383
382
  },
384
383
  rowAreAllSelected: (rowId) => {
385
384
  const g = rdsStore.get(grid$);
@@ -500,11 +500,10 @@ export function makeClientDataSource(p) {
500
500
  const field = grid.api.columnField(c, row);
501
501
  return field;
502
502
  }));
503
- return [...values].map((x) => {
504
- if (!p.transformInFilterItem)
505
- return { id: `${x}`, label: `${x}`, value: x };
506
- return p.transformInFilterItem({ field: x, column: c });
507
- });
503
+ if (p.transformInFilterItem) {
504
+ return p.transformInFilterItem({ column: c, values: [...values] });
505
+ }
506
+ return [...values].map((x) => ({ id: `${x}`, label: `${x}`, value: x }));
508
507
  },
509
508
  rowAdd: (newRows, place = "end") => {
510
509
  rdsStore.set(data, (prev) => {
@@ -346,11 +346,10 @@ export function makeClientTreeDataSource(p) {
346
346
  const field = grid.api.columnField(c, row);
347
347
  return field;
348
348
  }));
349
- return [...values].map((x) => {
350
- if (!p.transformInFilterItem)
351
- return { id: `${x}`, label: `${x}`, value: x };
352
- return p.transformInFilterItem({ field: x, column: c });
353
- });
349
+ if (p.transformInFilterItem) {
350
+ return p.transformInFilterItem({ column: c, values: [...values] });
351
+ }
352
+ return [...values].map((x) => ({ id: `${x}`, label: `${x}`, value: x }));
354
353
  },
355
354
  rowAdd: (newRows, place = "end") => {
356
355
  rdsStore.set(data, (prev) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@1771technologies/lytenyte-pro",
3
3
  "description": "Blazingly fast headless React data grid with 100s of features.",
4
- "version": "1.0.0-beta.7",
4
+ "version": "1.0.0-beta.9",
5
5
  "type": "module",
6
6
  "license": "COMMERCIAL",
7
7
  "files": [
@@ -49,12 +49,12 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@1771technologies/atom": "^1.0.2",
52
- "@1771technologies/lytenyte-core": "1.0.0-beta.7",
53
- "@1771technologies/lytenyte-dragon": "1.0.0-beta.7",
54
- "@1771technologies/lytenyte-dom-utils": "1.0.0-beta.7",
55
- "@1771technologies/lytenyte-shared": "1.0.0-beta.7",
56
- "@1771technologies/lytenyte-js-utils": "1.0.0-beta.7",
57
- "@1771technologies/lytenyte-react-hooks": "1.0.0-beta.7"
52
+ "@1771technologies/lytenyte-core": "1.0.0-beta.9",
53
+ "@1771technologies/lytenyte-dom-utils": "1.0.0-beta.9",
54
+ "@1771technologies/lytenyte-shared": "1.0.0-beta.9",
55
+ "@1771technologies/lytenyte-js-utils": "1.0.0-beta.9",
56
+ "@1771technologies/lytenyte-react-hooks": "1.0.0-beta.9",
57
+ "@1771technologies/lytenyte-dragon": "1.0.0-beta.9"
58
58
  },
59
59
  "peerDependencies": {
60
60
  "react": "^18.0.0 || ^19.0.0",