@gridkitjs/react 0.0.0-dev-20261107195236 → 0.0.0-dev-20261107203826

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/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode, Ref, RefObject } from 'react';
3
3
  import { ExportWriter, GridExportOptions, PrintOptions, CellSelectEvent as CellSelectEvent$1, CellSelectionChangeEvent as CellSelectionChangeEvent$1, ColumnDefinition as ColumnDefinition$1, ColumnSelectEvent as ColumnSelectEvent$1, ColumnSelectionChangeEvent as ColumnSelectionChangeEvent$1, ColumnsSelectEvent as ColumnsSelectEvent$1, DataColumn as DataColumn$1, GridOptions, PaginationState, SelectionCallbacks as SelectionCallbacks$1, ResolvedRow, DisplayRow, ResolvedColumn as ResolvedColumn$1, ColumnSizingState, ColumnOrderState, ColumnVisibilityState, ColumnSortState, FilterState, GroupByState, GroupExpansionState, AggregateResults, SelectionState, CellSelectionState, GridState, SerializedGridState, GridContextMenuTarget, GridCommandTarget, SelectedCell as SelectedCell$1, SelectedColumn as SelectedColumn$1 } from '@gridkitjs/core';
4
- export { Borders, CellSelectionMode, CellSelectionState, CellTemplateContext, ColumnResizeEvent, ColumnSizeDefaults, ColumnSizingState, ColumnVisibilityEvent, ColumnVisibilityState, ContextMenuOpenChangeEvent, ExportFile, ExportOptions, ExportWriter, FilterChangeEvent, FilterEntry, FilterState, GridCommand, GridCommandEvent, GridCommandTarget, GridContextMenuOptions, GridContextMenuRequest, GridContextMenuTarget, GridExportOptions, GridMessages, GridOptions, GridState, GridToolbarOptions, GroupByBarVisibility, HoverableConfig, MenuEntry, PrintOptions, ResizeMode, ResolvedRow, RowPointerEvent, RowProps, RowSelectEvent, RowSelectionChangeEvent, RowsSelectEvent, SelectableConfig, SelectedCellRef, SelectionMode, SelectionState, SerializedGridState, ToolbarEntry, excelFilter, serializeGridState } from '@gridkitjs/core';
4
+ export { Borders, CellSelectionMode, CellSelectionState, CellTemplateContext, ColumnResizeEvent, ColumnSizeDefaults, ColumnSizingState, ColumnVisibilityEvent, ColumnVisibilityState, ContextMenuOpenChangeEvent, ExportFile, ExportOptions, ExportWriter, FilterChangeEvent, FilterEntry, FilterState, GridCommand, GridCommandEvent, GridCommandTarget, GridContextMenuOptions, GridContextMenuRequest, GridContextMenuTarget, GridExportOptions, GridMessages, GridOptions, GridState, GridToolbarOptions, GroupByBarVisibility, HoverableConfig, MenuEntry, PaginationUnit, PrintOptions, ResizeMode, ResolvedRow, RowPointerEvent, RowProps, RowSelectEvent, RowSelectionChangeEvent, RowsSelectEvent, SelectableConfig, SelectedCellRef, SelectionMode, SelectionState, SerializedGridState, ToolbarEntry, ToolbarItemAttributes, excelFilter, serializeGridState } from '@gridkitjs/core';
5
5
 
6
6
  /** What `DataGridApi` carries for exporting. */
7
7
  interface GridExportApi {
package/dist/index.js CHANGED
@@ -3571,6 +3571,7 @@ import { useLayoutEffect as useLayoutEffect11, useRef as useRef15, useState as u
3571
3571
  import { Fragment as Fragment8, jsx as jsx23, jsxs as jsxs17 } from "react/jsx-runtime";
3572
3572
  function ToolbarMenuButton({
3573
3573
  itemKey,
3574
+ attributes,
3574
3575
  label,
3575
3576
  icon,
3576
3577
  entries,
@@ -3599,6 +3600,7 @@ function ToolbarMenuButton({
3599
3600
  /* @__PURE__ */ jsxs17(
3600
3601
  "button",
3601
3602
  {
3603
+ ...attributes,
3602
3604
  type: "button",
3603
3605
  className: classNames("toolbar-button", more && "toolbar-more"),
3604
3606
  "data-gridkit-toolbar-item": itemKey,
@@ -3663,6 +3665,7 @@ import { jsx as jsx24 } from "react/jsx-runtime";
3663
3665
  var SEARCH_DELAY_MS = 250;
3664
3666
  function ToolbarSearch({
3665
3667
  itemKey,
3668
+ attributes,
3666
3669
  controller,
3667
3670
  messages,
3668
3671
  announce
@@ -3700,6 +3703,7 @@ function ToolbarSearch({
3700
3703
  return /* @__PURE__ */ jsx24(
3701
3704
  "input",
3702
3705
  {
3706
+ ...attributes,
3703
3707
  type: "search",
3704
3708
  className: "toolbar-search",
3705
3709
  "data-gridkit-toolbar-item": itemKey,
@@ -3817,12 +3821,21 @@ function GridToolbar(props) {
3817
3821
  if (entries.length === 0) {
3818
3822
  return null;
3819
3823
  }
3820
- const label = (typeof props.toolbar === "object" ? props.toolbar.label : void 0) ?? props.messages.toolbarLabel;
3821
- return /* @__PURE__ */ jsx25(Toolbar, { ...props, entries, label });
3824
+ const options = typeof props.toolbar === "object" ? props.toolbar : void 0;
3825
+ return /* @__PURE__ */ jsx25(
3826
+ Toolbar,
3827
+ {
3828
+ ...props,
3829
+ entries,
3830
+ label: options?.label ?? props.messages.toolbarLabel,
3831
+ itemAttributes: options?.itemAttributes
3832
+ }
3833
+ );
3822
3834
  }
3823
3835
  function Toolbar({
3824
3836
  entries,
3825
3837
  label,
3838
+ itemAttributes,
3826
3839
  renderItem,
3827
3840
  gridId,
3828
3841
  controller,
@@ -3834,7 +3847,8 @@ function Toolbar({
3834
3847
  const menuClosed = useRef18(false);
3835
3848
  const items = resolveToolbar(entries, {
3836
3849
  commands: commands.commands,
3837
- contextFor: commands.contextFor
3850
+ contextFor: commands.contextFor,
3851
+ itemAttributes
3838
3852
  }).map(
3839
3853
  (item) => reportingItem(item, (commandId, itemId) => {
3840
3854
  commands.report(commandId, { area: "toolbar", itemId }, "toolbar");
@@ -3865,6 +3879,7 @@ function Toolbar({
3865
3879
  return /* @__PURE__ */ jsxs18(
3866
3880
  "button",
3867
3881
  {
3882
+ ...item.attributes,
3868
3883
  type: "button",
3869
3884
  className: "toolbar-button",
3870
3885
  "data-gridkit-toolbar-item": item.key,
@@ -3894,6 +3909,7 @@ function Toolbar({
3894
3909
  ToolbarMenuButton,
3895
3910
  {
3896
3911
  itemKey: item.key,
3912
+ attributes: item.attributes,
3897
3913
  label: item.label,
3898
3914
  icon: item.icon,
3899
3915
  entries: item.items,
@@ -3906,6 +3922,7 @@ function Toolbar({
3906
3922
  ToolbarSearch,
3907
3923
  {
3908
3924
  itemKey: item.key,
3925
+ attributes: item.attributes,
3909
3926
  controller,
3910
3927
  messages,
3911
3928
  announce
@@ -3936,6 +3953,7 @@ function Toolbar({
3936
3953
  return /* @__PURE__ */ jsx25(
3937
3954
  "div",
3938
3955
  {
3956
+ ...item.attributes,
3939
3957
  className: "toolbar-custom",
3940
3958
  "data-gridkit-toolbar-item": item.key,
3941
3959
  children: renderItem?.(item.id)