@dxos/react-ui-table 0.8.2-main.5ca3450 → 0.8.2-main.600d381

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.
@@ -2285,8 +2285,8 @@ var DynamicTable = ({ classNames, name = "example.com/dynamic-table", rows, prop
2285
2285
  import React8, { useCallback as useCallback6, useMemo as useMemo6 } from "react";
2286
2286
  import { live as live4 } from "@dxos/live-object";
2287
2287
  import { createGapSeparator, createMenuAction, MenuProvider, ToolbarMenu, useMenuActions } from "@dxos/react-ui-menu";
2288
- var createTableToolbarActions = (state) => {
2289
- const add = createMenuAction("add-row", {
2288
+ var createTableToolbarActions = (state, onAction) => {
2289
+ const add = createMenuAction("add-row", () => onAction(add), {
2290
2290
  type: "add-row",
2291
2291
  icon: "ph--plus--regular",
2292
2292
  label: [
@@ -2297,7 +2297,7 @@ var createTableToolbarActions = (state) => {
2297
2297
  ],
2298
2298
  testId: "table.toolbar.add-row"
2299
2299
  });
2300
- const save = createMenuAction("save-view", {
2300
+ const save = createMenuAction("save-view", () => onAction(save), {
2301
2301
  type: "save-view",
2302
2302
  icon: "ph--floppy-disk--regular",
2303
2303
  label: [
@@ -2311,7 +2311,7 @@ var createTableToolbarActions = (state) => {
2311
2311
  hidden: !state.viewDirty
2312
2312
  });
2313
2313
  const gap = createGapSeparator();
2314
- const comment = createMenuAction("comment", {
2314
+ const comment = createMenuAction("comment", () => onAction(comment), {
2315
2315
  type: "comment",
2316
2316
  icon: "ph--chat-text--regular",
2317
2317
  label: [
@@ -2340,14 +2340,14 @@ var TableToolbar = ({ classNames, viewDirty, attendableId, onAction }) => {
2340
2340
  const state = useMemo6(() => live4({
2341
2341
  viewDirty
2342
2342
  }), []);
2343
- const actionsCreator = useCallback6(() => createTableToolbarActions(state), [
2344
- state
2343
+ const actionsCreator = useCallback6(() => createTableToolbarActions(state, onAction), [
2344
+ state,
2345
+ onAction
2345
2346
  ]);
2346
2347
  const menu = useMenuActions(actionsCreator);
2347
2348
  return /* @__PURE__ */ React8.createElement(MenuProvider, {
2348
2349
  ...menu,
2349
- attendableId,
2350
- onAction
2350
+ attendableId
2351
2351
  }, /* @__PURE__ */ React8.createElement(ToolbarMenu, {
2352
2352
  classNames
2353
2353
  }));