refactor: move data-table hooks/contexts/provider from features to web modules (#27833)
* refactor: move data-table hooks/contexts/provider from features to web modules Co-Authored-By: [email protected] <[email protected]> * fix: update broken useColumnResizing import path in DataTable.tsx Co-Authored-By: [email protected] <[email protected]> * fix: update remaining broken import paths for moved hooks Co-Authored-By: [email protected] <[email protected]> * docs: update GUIDE.md import paths and file references for moved modules Co-Authored-By: [email protected] <[email protected]> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
397bf3cc0c
commit
1368ffe55d
63 files changed
+123
-124
No files matched your search
@@ -21,8 +21,8 @@ import {
|
||||
TableRow,
|
||||
} from "@calcom/ui/components/table";
|
||||
|
||||
import { useColumnSizingVars } from "@calcom/features/data-table/hooks";
|
||||
import { useColumnResizing } from "@calcom/features/data-table/hooks/useColumnResizing";
|
||||
import { useColumnSizingVars } from "~/data-table/hooks/useColumnSizingVars";
|
||||
import { useColumnResizing } from "~/data-table/hooks/useColumnResizing";
|
||||
import type { SeparatorRow } from "@calcom/features/data-table/lib/separator";
|
||||
import { isSeparatorRow } from "@calcom/features/data-table/lib/separator";
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { type Table } from "@tanstack/react-table";
|
||||
|
||||
import { Pagination } from "@calcom/ui/components/pagination";
|
||||
|
||||
import { useDataTable } from "@calcom/features/data-table/hooks";
|
||||
import { useDataTable } from "~/data-table/hooks";
|
||||
|
||||
interface DataTablePaginationProps<TData> {
|
||||
table: Table<TData>;
|
||||
|
||||
@@ -10,7 +10,7 @@ import classNames from "@calcom/ui/classNames";
|
||||
import { Button, type ButtonProps } from "@calcom/ui/components/button";
|
||||
import { FilterSearchField } from "@calcom/ui/components/form";
|
||||
|
||||
import { useColumnFilters, useDataTable } from "@calcom/features/data-table/hooks";
|
||||
import { useColumnFilters, useDataTable } from "~/data-table/hooks";
|
||||
|
||||
interface DataTableToolbarProps extends ComponentPropsWithoutRef<"div"> {
|
||||
children: React.ReactNode;
|
||||
|
||||
@@ -4,9 +4,9 @@ import type { Row, VisibilityState } from "@tanstack/react-table";
|
||||
import { noop } from "lodash";
|
||||
import { useEffect, useRef } from "react";
|
||||
|
||||
import { useColumnFilters } from "@calcom/features/data-table/hooks/useColumnFilters";
|
||||
import { useDataTable } from "@calcom/features/data-table/hooks/useDataTable";
|
||||
import { useFetchMoreOnBottomReached } from "@calcom/features/data-table/hooks/useFetchMoreOnBottomReached";
|
||||
import { useColumnFilters } from "~/data-table/hooks/useColumnFilters";
|
||||
import { useDataTable } from "~/data-table/hooks/useDataTable";
|
||||
import { useFetchMoreOnBottomReached } from "~/data-table/hooks/useFetchMoreOnBottomReached";
|
||||
import type { DataTablePropsFromWrapper } from "./DataTable";
|
||||
import { DataTable } from "./DataTable";
|
||||
import { DataTablePagination } from "./DataTablePagination";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { type Table } from "@tanstack/react-table";
|
||||
|
||||
import { useDataTable, useFilterableColumns } from "@calcom/features/data-table/hooks";
|
||||
import { useDataTable, useFilterableColumns } from "~/data-table/hooks";
|
||||
import { ColumnFilterType } from "@calcom/features/data-table/lib/types";
|
||||
import { DateRangeFilter } from "./DateRangeFilter";
|
||||
import { FilterPopover } from "./FilterPopover";
|
||||
|
||||
@@ -11,7 +11,7 @@ import { EyeOffIcon, PlusIcon } from "@coss/ui/icons";
|
||||
import { Popover, PopoverTrigger, PopoverContent } from "@calcom/ui/components/popover";
|
||||
import { Tooltip } from "@calcom/ui/components/tooltip";
|
||||
|
||||
import { useDataTable, useFilterableColumns } from "@calcom/features/data-table/hooks";
|
||||
import { useDataTable, useFilterableColumns } from "~/data-table/hooks";
|
||||
|
||||
export interface AddFilterButtonProps<TData> {
|
||||
table: Table<TData>;
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
} from "@calcom/ui/components/command";
|
||||
import { CheckIcon } from "@coss/ui/icons";
|
||||
|
||||
import { useDataTable, useFilterValue } from "@calcom/features/data-table/hooks";
|
||||
import { useDataTable, useFilterValue } from "~/data-table/hooks";
|
||||
import type {
|
||||
FacetedValue,
|
||||
FilterableColumn as _FilterableColumn,
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { Button } from "@calcom/ui/components/button";
|
||||
import { Tooltip } from "@calcom/ui/components/tooltip";
|
||||
|
||||
import { useDataTable } from "@calcom/features/data-table/hooks/useDataTable";
|
||||
import { useDataTable } from "~/data-table/hooks/useDataTable";
|
||||
|
||||
export const ClearFiltersButton = ({ exclude }: { exclude?: string[] }) => {
|
||||
const { t } = useLocale();
|
||||
|
||||
@@ -19,7 +19,7 @@ import { DateRangePicker } from "@calcom/ui/components/form";
|
||||
import { Popover, PopoverContent, PopoverTrigger } from "@calcom/ui/components/popover";
|
||||
import { CheckIcon } from "@coss/ui/icons";
|
||||
|
||||
import { useDataTable, useFilterValue } from "@calcom/features/data-table/hooks";
|
||||
import { useDataTable, useFilterValue } from "~/data-table/hooks";
|
||||
import {
|
||||
CUSTOM_PRESET,
|
||||
CUSTOM_PRESET_VALUE,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { type Table } from "@tanstack/react-table";
|
||||
|
||||
import { useDisplayedFilterCount } from "@calcom/features/data-table/hooks";
|
||||
import { useDisplayedFilterCount } from "~/data-table/hooks";
|
||||
import { ActiveFilters } from "./ActiveFilters";
|
||||
import { AddFilterButton } from "./AddFilterButton";
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Button } from "@calcom/ui/components/button";
|
||||
import type { IconName } from "@calcom/ui/components/icon";
|
||||
import { Popover, PopoverContent, PopoverTrigger } from "@calcom/ui/components/popover";
|
||||
|
||||
import { useFilterValue } from "@calcom/features/data-table/hooks";
|
||||
import { useFilterValue } from "~/data-table/hooks";
|
||||
import {
|
||||
type FilterableColumn,
|
||||
type FilterValue,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { useDataTable } from "@calcom/features/data-table/hooks";
|
||||
import { useDataTable } from "~/data-table/hooks";
|
||||
import type { FilterableColumn } from "@calcom/features/data-table/lib/types";
|
||||
import { ZMultiSelectFilterValue, ColumnFilterType } from "@calcom/features/data-table/lib/types";
|
||||
import type { FilterType } from "@calcom/types/data-table";
|
||||
|
||||
@@ -6,7 +6,7 @@ import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { Button } from "@calcom/ui/components/button";
|
||||
import { Form, Select, NumberInput } from "@calcom/ui/components/form";
|
||||
|
||||
import { useFilterValue, useDataTable } from "@calcom/features/data-table/hooks";
|
||||
import { useFilterValue, useDataTable } from "~/data-table/hooks";
|
||||
import type { FilterableColumn } from "@calcom/features/data-table/lib/types";
|
||||
import { ZNumberFilterValue, ColumnFilterType } from "@calcom/features/data-table/lib/types";
|
||||
import type { FilterType } from "@calcom/types/data-table";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import type { FilterType } from "@calcom/types/data-table";
|
||||
|
||||
import { useDataTable } from "@calcom/features/data-table/hooks";
|
||||
import { useDataTable } from "~/data-table/hooks";
|
||||
import type { FilterableColumn } from "@calcom/features/data-table/lib/types";
|
||||
import { ZSingleSelectFilterValue, ColumnFilterType } from "@calcom/features/data-table/lib/types";
|
||||
import { BaseSelectFilterOptions } from "./BaseSelectFilterOptions";
|
||||
|
||||
@@ -6,7 +6,7 @@ import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { Button } from "@calcom/ui/components/button";
|
||||
import { Form, Select, Input } from "@calcom/ui/components/form";
|
||||
|
||||
import { useFilterValue, useDataTable } from "@calcom/features/data-table/hooks";
|
||||
import { useFilterValue, useDataTable } from "~/data-table/hooks";
|
||||
import type { FilterableColumn } from "@calcom/features/data-table/lib/types";
|
||||
import { ZTextFilterValue, ColumnFilterType } from "@calcom/features/data-table/lib/types";
|
||||
import type { FilterType } from "@calcom/types/data-table";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useState, useEffect, useCallback } from "react";
|
||||
|
||||
import { useDataTable } from "@calcom/features/data-table/hooks";
|
||||
import { useDataTable } from "~/data-table/hooks";
|
||||
|
||||
export function useFilterPopoverOpen(columnId: string) {
|
||||
const { filterToOpen } = useDataTable();
|
||||
|
||||
@@ -3,7 +3,7 @@ import { trpc } from "@calcom/trpc/react";
|
||||
import { Dialog, ConfirmationDialogContent } from "@calcom/ui/components/dialog";
|
||||
import { showToast } from "@calcom/ui/components/toast";
|
||||
|
||||
import { useDataTable } from "@calcom/features/data-table/hooks";
|
||||
import { useDataTable } from "~/data-table/hooks";
|
||||
import type { FilterSegmentOutput } from "@calcom/features/data-table/lib/types";
|
||||
|
||||
export function DeleteSegmentDialog({
|
||||
|
||||
@@ -9,7 +9,7 @@ import { Dialog, DialogContent, DialogFooter, DialogHeader } from "@calcom/ui/co
|
||||
import { Form, TextField } from "@calcom/ui/components/form";
|
||||
import { showToast } from "@calcom/ui/components/toast";
|
||||
|
||||
import { useDataTable } from "@calcom/features/data-table/hooks";
|
||||
import { useDataTable } from "~/data-table/hooks";
|
||||
import type { CombinedFilterSegment } from "@calcom/features/data-table/lib/types";
|
||||
|
||||
type FormValues = {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { checkAdminOrOwner } from "@calcom/features/auth/lib/checkAdminOrOwner";
|
||||
import { useDataTable } from "@calcom/features/data-table/hooks";
|
||||
import { useDataTable } from "~/data-table/hooks";
|
||||
import type {
|
||||
CombinedFilterSegment,
|
||||
FilterSegmentOutput,
|
||||
|
||||
@@ -19,7 +19,7 @@ import { Form, Input, Label, Select, Switch } from "@calcom/ui/components/form";
|
||||
import { RadioGroup, RadioField } from "@calcom/ui/components/radio";
|
||||
import { showToast } from "@calcom/ui/components/toast";
|
||||
|
||||
import { useDataTable } from "@calcom/features/data-table/hooks";
|
||||
import { useDataTable } from "~/data-table/hooks";
|
||||
|
||||
interface FormValues {
|
||||
name: string;
|
||||
|
||||
Reference in new issue
Block a user