// src/lib/data-list-view.ts
var DATA_LIST_VIEW_TILES = [
  { value: "table", icon: "fa-table", label: "Table view" },
  { value: "list", icon: "fa-list", label: "List view" },
  { value: "board", icon: "fa-table-columns", label: "Board view" },
  { value: "dashboard", icon: "fa-chart-mixed", label: "Dashboard view" },
  { value: "calendar", icon: "fa-calendar-days", label: "Calendar view" },
  { value: "folder", icon: "fa-grid-2", label: "Folder view" },
  { value: "panel", icon: "fa-sidebar", label: "List & details" },
  { value: "tree-panel", icon: "fa-sitemap", label: "Tree & details" }
];
function dataListViewIcon(view) {
  return DATA_LIST_VIEW_TILES.find((t) => t.value === view)?.icon ?? "fa-table";
}

// src/lib/data-list-view-surface.ts
function getDataListViewRenderKind(view) {
  switch (view) {
    case "table":
      return "data-table";
    case "list":
      return "list-with-toolbar";
    case "board":
      return "board-with-toolbar";
    case "dashboard":
      return "dashboard-with-toolbar";
    case "calendar":
      return "calendar-with-toolbar";
    case "folder":
      return "folder-with-toolbar";
    case "panel":
      return "panel-with-toolbar";
    case "tree-panel":
      return "tree-panel-with-toolbar";
    default: {
      const _x = view;
      return _x;
    }
  }
}

// src/lib/data-list-view-registry.ts
var DEFINITIONS = DATA_LIST_VIEW_TILES.map((tile) => {
  const renderKind = getDataListViewRenderKind(tile.value);
  const hubMetricsStrip = renderKind !== "calendar-with-toolbar" && renderKind !== "dashboard-with-toolbar";
  return {
    value: tile.value,
    label: tile.label,
    icon: tile.icon,
    renderKind,
    hubMetricsStrip
  };
});
var BY_VALUE = new Map(
  DEFINITIONS.map((d) => [d.value, d])
);
var DATA_LIST_VIEW_REGISTRY = DEFINITIONS;
var ALL_DATA_LIST_VIEW_TYPES = DATA_LIST_VIEW_REGISTRY.map((d) => d.value);
var DATA_LIST_SURFACE_VIEW_TYPES = new Set(
  DATA_LIST_VIEW_REGISTRY.map((d) => d.value)
);
function isDataListSurfaceViewType(viewType) {
  return DATA_LIST_SURFACE_VIEW_TYPES.has(viewType);
}

// src/lib/list-page-table-properties.ts
function createListPageEditViewHandler(tableRef, options) {
  const delay = options?.switchDelayMs ?? 160;
  return (tab, { updateTab }) => {
    const mustSwitchToTableSurface = !isDataListSurfaceViewType(tab.viewType);
    if (mustSwitchToTableSurface) {
      updateTab({ viewType: "table", icon: dataListViewIcon("table") });
    }
    window.setTimeout(() => {
      tableRef.current?.openPropertiesDrawer();
    }, mustSwitchToTableSurface ? delay : 0);
  };
}
export {
  createListPageEditViewHandler,
  isDataListSurfaceViewType
};
//# sourceMappingURL=list-page-table-properties.js.map