openpanel/packages/antd/CHANGELOG.md
Stefan Pejcic 09f9f9502d packages
2024-11-07 19:03:37 +01:00

178 KiB
Raw Blame History

@refinedev/antd

5.44.0

Minor Changes

  • #6445 4ff4335274d5689ec62127312695b76d692a125a Thanks @alicanerdurmaz! - feat: added new prop called mutationVariables to <AuthPage />. #6431 From now on, you can pass additional parameters to the authProvider methods using the mutationVariables prop of the <AuthPage /> component.

    import { AuthPage } from "@refinedev/antd"; // or "@refinedev/chakra-ui", "@refinedev/mantine", "@refinedev/mui"
    
    const MyLoginPage = () => {
      return (
        <AuthPage
          type="login" // all other types are also supported.
          // highlight-start
          mutationVariables={{
            foo: "bar",
            xyz: "abc",
          }}
          // highlight-end
        />
      );
    };
    
    // all mutation methods are supported.
    const authProvider = {
      login: async ({ foo, xyz, ...otherProps }) => {
        console.log(foo); // bar
        console.log(xyz); // abc
        // ...
      },
      register: async ({ foo, xyz, ...otherProps }) => {
        console.log(foo); // bar
        console.log(xyz); // abc
        // ...
      },
      // ...
    };
    

    Resolves #6431

  • #6445 4ff4335274d5689ec62127312695b76d692a125a Thanks @alicanerdurmaz! - chore: update @ant-design/icons and @ant-design/pro-layout versions

    Updated previously pinned versions of @ant-design/icons from 5.0.1 and @ant-design/pro-layout from 7.17.12 to latest versions. This minor update resolves the previous issues with React@18 types and conflicting type ranges with @ant-design/pro-layout package.

    After @ant-design/icons version 5.4.0 build issues and type issues are resolved. Following this release @ant-design/pro-layout also updated its dependency range to match the latest @ant-design/icons version.

    Previously @ant-design/icons were pinned to 5.0.1 and recommended to pin in projects as well. After this update, you may also need to update the @ant-design/icons version in your project to match the latest version. (A range above ^5.5.1 is required to match @refinedev/antd).

    Resolves #6363 Resolves #5931 - previously resolved by #5934 Accompanies #6354 - @ant-design/pro-layout also depends on express dependency and updated its version in the latest release

5.43.1

Patch Changes

  • #6245 7ba4ea1ffdd2e2ed2f0ed2b1ee386dab5015dd2d Thanks @youssefsiam38! - fix(antd): rtl support for mobile sider trigger and drawer placement

    <ThemedLayoutV2 /> has RTL support but it lacks the mobile sider trigger and drawer placement. This change places the drawer depending on the preferred direction. It also adds RTL support for the styling of the mobile sider trigger.

    Fixes #6263

5.43.0

Minor Changes

  • #6180 292cebc5a70f19400793292b79d1400fec114591 Thanks @alicanerdurmaz! - feat: useSelect's queryResult and defaultValueQueryResult is deprecated, use query and defaultValueQuery instead. #6179

    import { useSelect } from '@refinedev/antd';
    
    - const { queryResult, defaultValueQueryResult } = useSelect();
    + const { query, defaultValueQuery } = useSelect();
    

    feat: useCheckboxGroup's queryResult is deprecated, use query instead.

    import { useCheckboxGroup } from '@refinedev/antd';
    
    - const { queryResult } = useCheckboxGroup();
    + const { query } = useCheckboxGroup();
    

    feat: useRadioGroup's queryResult is deprecated, use query instead.

    import { useRadioGroup } from '@refinedev/antd';
    
    - const { queryResult } = useRadioGroup();
    + const { query } = useRadioGroup();
    

    You can use @refinedev/codemod to automatically migrate your codebase. Simply run the following command in your project's root directory:

    npx @refinedev/codemod@latest rename-query-and-mutation-result
    
  • #6172 4967a51944c139d102fcfc04ada5a42c725ed7c2 Thanks @alicanerdurmaz! - feat: useTable's tableQueryResult is deprecated, use tableQuery instead. #6169

    import { useTable } from '@refinedev/core';
    
    - const { tableQueryResult } = useTable();
    + const { tableQuery } = useTable();
    

    feat: useSimpleList's queryResult is deprecated, use query instead. #6169

    import { useSimpleList } from '@refinedev/antd';
    
    - const { queryResult } = useSimpleList();
    + const { query } = useSimpleList();
    

    You can use @refinedev/codemod to automatically migrate your codebase. Simply run the following command in your project's root directory:

    npx @refinedev/codemod@latest rename-query-and-mutation-result
    

Patch Changes

  • #6199 5a8e94aa4afe0faf3ea1de93a4b00e0b44dd1ece Thanks @aliemir! - fix(auth-page): fix wrong translation keys in type="register" and type="forgotPassword"

    In type="forgotPassword":

    • "pages.register.buttons.haveAccount" is replaced with "pages.forgotPassword.buttons.haveAccount"
    • "pages.login.signin" is replaced with "pages.forgotPassword.signin"

    In type="register":

    • "pages.login.divider" is replaced with "pages.register.divider"
    • "pages.login.buttons.haveAccount" is replaced with "pages.register.buttons.haveAccount"
    • "pages.login.signin" is replaced with "pages.register.signin"

    Wrong keys are kept as fallbacks in case the new keys are not found in the translation file. If you are using those keys in your project, make sure to update them accordingly. Fallback keys will be removed in future releases.

    Resolves #5816

  • #6217 aefd093cfd85096fdac36cd25073d14dfb12094f Thanks @webscriptmaster! - fix(date-field): falsy values should render empty string

    Previously, <DateField value={undefined} /> was rendering the current date. After this change, it will render empty string if a falsy value is provided.

    Resolves #6216

5.42.0

Minor Changes

  • #6074 311dcdc454ee6914218a59198b5d423a4f8e5456 Thanks @alicanerdurmaz! - fix: useDrawerForm's submit and form props are not working (#6082).

  • #6071 853bef97ed7baf59e74c98fc54c0ed11624fb491 Thanks @Dominic-Preap! - feat: add selectedOptionsOrder in useSelect

    Now with selectedOptionsOrder, you can sort selectedOptions at the top of list when use useSelect with defaultValue.

    Resolves #6061

  • #6074 311dcdc454ee6914218a59198b5d423a4f8e5456 Thanks @alicanerdurmaz! - fix: useForm's defaultFormValues prop is not working (#5727).

    From now on, useForm, useDrawerForm, and useModalForm hooks accept the defaultFormValues prop to pre-populate the form with data that needs to be displayed.

    useForm({
      defaultFormValues: {
        title: "Hello World",
      },
    });
    

    Also, it can be provided as an async function to fetch the default values. The loading state can be tracked using the defaultFormValuesLoading state returned from the hook.

    🚨 When action is "edit" or "clone" a race condition with async defaultFormValues may occur. In this case, the form values will be the result of the last completed operation.

    const { defaultFormValuesLoading } = useForm({
      defaultFormValues: async () => {
        const response = await fetch("https://my-api.com/posts/1");
        const data = await response.json();
        return data;
      },
    });
    

Patch Changes

  • #6021 55cd0662b1e3ff8f8410eba812e80130afe75d14 Thanks @JayBhensdadia! - fix: ensure Sider component handles various resource name formats correctly

    Updated Sider component to correctly handle lowercase and camelcased resource names, enhancing usability and functionality.

    Fixes #6004

  • #5984 658891c413b1fc83b75905919eabc94f08482e61 Thanks @ApsMJ23! - fix(antd): use appropriate icons for RTL direction layouts

    Previously CRUD components and <ThemedSiderV2 /> component used hardcoded icons which doesn't fit well for RTL layouts. This PR uses Ant Design's ConfigProvider context to use direction to determine the appropriate icons for RTL layouts.

    Example

    import { ConfigProvider } from 'antd';
    import { Refine } from '@refinedev/antd';
    
    const App = () => (
      <ConfigProvider direction="rtl">
        <Refine
            {/* ... */}
        />
      </ConfigProvider>
    );
    

    When any CRUD component or <ThemedSiderV2 /> component is rendered, the icons will be rendered with respect to the direction prop of ConfigProvider.

  • #6064 b516c18b828ba8823561d0fefc4afe02b45ce332 Thanks @aliemir! - fix(auto-save-indicator): replace reserved key prop with translationKey in components

    <AutoSaveIndicator /> components from UI libraries have been using a <Message /> component internally that uses a key prop. Since key is a reserved prop in React, it was causing a warning in the console. This change replaces the key prop with translationKey to avoid the warning.

    Resolves #6067

5.40.0

Minor Changes

  • 6bd14228760d3e1e205ea9248e427f9afa2ec046 Thanks @BatuhanW! - feat: use global values by default for app title and app icon

    Now <Refine /> component accepts options.title prop that can be used to set app icon and app name globally. For <ThemedLayoutV2 /> and <AuthPage /> components, these values will be used by default. While users can use options.title to pass global values for app icon and app name, option to override through <ThemedTitleV2 /> component is still available for users to override these values in specific use cases.

    import { Refine } from "@refinedev/core";
    
    const MyIcon = () => <svg>{/* ... */}</svg>;
    
    const App = () => {
      return (
        <Refine
          options={{
            title: {
              icon: <MyIcon />,
              text: "Refine App",
            },
          }}
        >
          {/* ... */}
        </Refine>
      );
    };
    

    Then, <ThemedLayoutV2 /> and <AuthPage /> components will display <MyIcon /> and "Refine App" as app icon and app name respectively.

Patch Changes

  • 6bd14228760d3e1e205ea9248e427f9afa2ec046 Thanks @BatuhanW! - lock the ant-design/icons version to 5.0.1

  • 6bd14228760d3e1e205ea9248e427f9afa2ec046 Thanks @BatuhanW! - chore: unpin antd version that was causing build issues

    With antd's 5.17.0 version, Next.js apps were stuck in the build process. To prevent this from breaking all Refine apps with Next.js, we've pinned the version to 5.16.5 as a workaround. Since then, the issue has been resolved by updating an internal dependency of antd, we no longer need to pin the version.

  • 6bd14228760d3e1e205ea9248e427f9afa2ec046 Thanks @BatuhanW! - feat(antd): search form in useTable should work with syncWithLocation

    Even though the form is managed by useTable hook from @refinedev/antd. It wasn't respecting the syncWithLocation prop to set values accordingly at initial render when registered fields are matching with the query params. Now it will look for matching fields and set values accordingly from synced filters.

  • 6bd14228760d3e1e205ea9248e427f9afa2ec046 Thanks @BatuhanW! - fix: Filtering <Table /> with <FilterDropdown /> and <DatePicker /> doesn't work with syncWithLocation. #5933

    feat: Added rangePickerFilterMapper utility function to convert selectedKeys to satisfy both the Refine and <DatePicker.RangePicker />.

    Usage example:

    import { getDefaultFilter } from "@refinedev/core";
    import {
      DateField,
      FilterDropdown,
      rangePickerFilterMapper,
      useTable,
    } from "@refinedev/antd";
    import { Table, DatePicker } from "antd";
    
    export const Posts = () => {
      const { tableProps, filters } = useTable({
        filters: {
          initial: [
            {
              field: "created_at",
              value: ["2022-01-01", "2022-01-31"],
              operator: "between",
            },
          ],
        },
      });
    
      return (
        <Table {...tableProps} rowKey="id">
          <Table.Column dataIndex="id" title="ID" />
          <Table.Column dataIndex="title" title="Title" />
          <Table.Column
            dataIndex="createdAt"
            title="Created At"
            filterDropdown={(props) => (
              <FilterDropdown
                {...props}
                mapValue={(selectedKeys, event) => {
                  return rangePickerFilterMapper(selectedKeys, event);
                }}
              >
                <DatePicker.RangePicker />
              </FilterDropdown>
            )}
            defaultFilteredValue={getDefaultFilter(
              "created_at",
              filters,
              "between",
            )}
          />
        </Table>
      );
    };
    
  • 6bd14228760d3e1e205ea9248e427f9afa2ec046 Thanks @BatuhanW! - chore: added type qualifier to imports used as type only.

    - import { A } from "./example.ts";
    + import type { A } from "./example.ts";
    
  • Updated dependencies [6bd14228760d3e1e205ea9248e427f9afa2ec046, 6bd14228760d3e1e205ea9248e427f9afa2ec046]:

    • @refinedev/ui-types@1.22.9

5.39.0

Minor Changes

  • #5945 903ea231538b00ce02ddc9394c72848ec1e90772 Thanks @aliemir! - feat: use global values by default for app title and app icon

    Now <Refine /> component accepts options.title prop that can be used to set app icon and app name globally. For <ThemedLayoutV2 /> and <AuthPage /> components, these values will be used by default. While users can use options.title to pass global values for app icon and app name, option to override through <ThemedTitleV2 /> component is still available for users to override these values in specific use cases.

    import { Refine } from "@refinedev/core";
    
    const MyIcon = () => <svg>{/* ... */}</svg>;
    
    const App = () => {
      return (
        <Refine
          options={{
            title: {
              icon: <MyIcon />,
              text: "Refine App",
            },
          }}
        >
          {/* ... */}
        </Refine>
      );
    };
    

    Then, <ThemedLayoutV2 /> and <AuthPage /> components will display <MyIcon /> and "Refine App" as app icon and app name respectively.

Patch Changes

  • #5945 cff950ba8b66143f5c08c3ef9f4cd112a9dc7448 Thanks @aliemir! - lock the ant-design/icons version to 5.0.1

  • #5945 fa31883601d3d0abd690dac62eed94487091022b Thanks @aliemir! - chore: unpin antd version that was causing build issues

    With antd's 5.17.0 version, Next.js apps were stuck in the build process. To prevent this from breaking all Refine apps with Next.js, we've pinned the version to 5.16.5 as a workaround. Since then, the issue has been resolved by updating an internal dependency of antd, we no longer need to pin the version.

  • #5945 fc1f7d91b1aa987c29a700b5227e744b27aeddda Thanks @aliemir! - feat(antd): search form in useTable should work with syncWithLocation

    Even though the form is managed by useTable hook from @refinedev/antd. It wasn't respecting the syncWithLocation prop to set values accordingly at initial render when registered fields are matching with the query params. Now it will look for matching fields and set values accordingly from synced filters.

  • #5945 f91bbb4a5c81cb8d22756ef05f6def9bd1a4ca12 Thanks @aliemir! - fix: Filtering <Table /> with <FilterDropdown /> and <DatePicker /> doesn't work with syncWithLocation. #5933

    feat: Added rangePickerFilterMapper utility function to convert selectedKeys to satisfy both the Refine and <DatePicker.RangePicker />.

    Usage example:

    import { getDefaultFilter } from "@refinedev/core";
    import {
      DateField,
      FilterDropdown,
      rangePickerFilterMapper,
      useTable,
    } from "@refinedev/antd";
    import { Table, DatePicker } from "antd";
    
    export const Posts = () => {
      const { tableProps, filters } = useTable({
        filters: {
          initial: [
            {
              field: "created_at",
              value: ["2022-01-01", "2022-01-31"],
              operator: "between",
            },
          ],
        },
      });
    
      return (
        <Table {...tableProps} rowKey="id">
          <Table.Column dataIndex="id" title="ID" />
          <Table.Column dataIndex="title" title="Title" />
          <Table.Column
            dataIndex="createdAt"
            title="Created At"
            filterDropdown={(props) => (
              <FilterDropdown
                {...props}
                mapValue={(selectedKeys, event) => {
                  return rangePickerFilterMapper(selectedKeys, event);
                }}
              >
                <DatePicker.RangePicker />
              </FilterDropdown>
            )}
            defaultFilteredValue={getDefaultFilter(
              "created_at",
              filters,
              "between",
            )}
          />
        </Table>
      );
    };
    
  • #5945 90930b381d8d369c63bc59beedf69c391875166d Thanks @aliemir! - chore: added type qualifier to imports used as type only.

    - import { A } from "./example.ts";
    + import type { A } from "./example.ts";
    
  • Updated dependencies [903ea231538b00ce02ddc9394c72848ec1e90772, 90930b381d8d369c63bc59beedf69c391875166d]:

    • @refinedev/ui-types@1.22.8

5.38.1

Patch Changes

  • #5928 db9756e7908 Thanks @aliemir! - fix: type errors on typescript <5

    Due to the changes in #5881, typescript users below version 5 are facing type errors. This PR fixes the type errors by updating the file extensions required by the d.mts declaration files to provide a compatible declarations for both typescript 4 and 5 users.

  • Updated dependencies [db9756e7908]:

    • @refinedev/ui-types@1.22.7

5.38.0

Minor Changes

  • #5868 a82ef6afc15 Thanks @Ac-Srikanth! - feat: add message prop for required auth input fields for the above packages.

    Now you can provide custom required messages with translate feature for all auth input fields(Login, register, forget password,update password).

    Resolves #5855

Patch Changes

  • #5887 113c1337bf0 Thanks @aliemir! - chore: remove version lock from @ant-design/icons 5.0.1 to ^5.0.1

  • #5920 df0dad6ca46 Thanks @aliemir! - fix: lock antd version to 5.16.5 due to broken builds in 5.17.0

    In the latest release of antd package, Next.js apps are failing to build or taking extremely long time to build. Until this issue is fixed in the antd package, we are locking the version to 5.16.5 to prevent any build issues.

    Related issue antd/#48758

  • #5881 ba719f6ea26 Thanks @aliemir! - fix: declaration files in node10, node16 and nodenext module resolutions

  • Updated dependencies [ba719f6ea26]:

    • @refinedev/ui-types@1.22.6

5.37.6

Patch Changes

  • #5737 4e8188a6652 Thanks @aliemir! - chore: updated content of README.md to include installation, usage and scaffolding instructions.

  • #5765 0c197d82393 Thanks @aliemir! - refactor: package bundles and package.json configuration for exports

    Previously, Refine packages had exported ESM and CJS bundles with same .js extension and same types for both with .d.ts extensions. This was causing issues with bundlers and compilers to pick up the wrong files for the wrong environment. Now we're outputting ESM bundles with .mjs extension and CJS bundles with .cjs extension. Also types are now exported with both .d.mts and .d.cts extensions.

    In older versions ESM and CJS outputs of some packages were using wrong imports/requires to dependencies causing errors in some environments. This will be fixed since now we're also enforcing the module type with extensions.

    Above mentioned changes also supported with changes in package.json files of the packages to support the new extensions and types. All Refine packages now include exports fields in their configuration to make sure the correct bundle is picked up by the bundlers and compilers.

  • #5765 0c197d82393 Thanks @aliemir! - fix: dayjs imports in ESM bundles

    dayjs imports in ESM bundles were not being correctly resolved, this has been fixed by adding an esbuild plugin to replace the imports with the correct path for ESM bundles.

  • #5765 0c197d82393 Thanks @aliemir! - fix: broken eslint plugin for removing test ids from components

    Eslint plugin to remove test ids from components was broken and might miss some test ids to be included in the bundles.

  • #5808 10ba9c34490 Thanks @aliemir! - refactor: moved internal logic of buttons to respective hooks from @refinedev/core

    We've moved the internal logic of buttons to their respective hooks in the @refinedev/core package to ensure consistency and reduce duplication. This change will make it easier to manage and maintain the buttons across different UI integrations of Refine. This will also benefit the users who want to customize the buttons via swizzle option or create their own buttons withouth having to duplicate the logic.

  • #5714 38f129f40ee Thanks @aliemir! - Due to the bug fix made in the @refinedev/core, onFinishAutoSave's returned promise can now reject and should be handled accordingly. Updated useForm's auto save handler to catch the rejection without breaking the application.

  • #5755 404b2ef5e1b Thanks @BatuhanW! - fix: incorrect type imports

  • Updated dependencies [0c197d82393, 56ed144a0f5]:

    • @refinedev/ui-types@1.22.5

5.37.5

Patch Changes

5.37.4

Patch Changes

5.37.3

Patch Changes

5.37.2

Patch Changes

5.37.1

Patch Changes

5.37.0

Minor Changes

  • #5307 f8e407f850 Thanks @jackprogramsjp! - feat: added hideForm props for LoginPage and RegisterPage for AuthPage feature.

    Now with the hideForm props feature, you can be able to hide the forms (like email/password) to only show the OAuth providers. This avoids having to make your own entire AuthPage.

Patch Changes

5.36.19

Patch Changes

  • #5259 eac3df87ffb Thanks @aliemir! - Updated <AutoSaveIndicator /> component to extend the <AutoSaveIndicator /> from @refinedev/core with custom elements and render appropriate element based on the state.

5.36.18

Patch Changes

  • #5199 2b8d658a17a Thanks @aliemir! - Now useSelect, useRadioGroup and useCheckboxGroup hooks accept 4th generic type TOption which allows you to change the type of options. By default TOption will be equal to BaseOption type which is { label: any; value: any; }. If you want to change the type of options, you can do it like this:

    import { useSelect } from "@refinedev/antd";
    import { HttpError } from "@refinedev/core";
    
    type MyData = {
      id: number;
      title: string;
      description: string;
      category: { id: string };
    };
    
    type Option = { label: MyData["title"]; value: MyData["id"] }; // equals to { label: string; value: number; }
    
    useSelect<MyData, HttpError, MyData, Option>({
      resource: "posts",
    });
    
  • #5199 2b8d658a17a Thanks @aliemir! - Updated return types of useSelect, useRadioGroup and useCheckboxGroup hooks to only include properties that actually being returned from the hook. Previously, the return types included all properties of the respective components, which was not correct.

  • #5201 760cfbaaa2a Thanks @aliemir! - Handle nested server side validation errors properly in useForm

5.36.17

Patch Changes

  • #5199 2b8d658a17a Thanks @aliemir! - Now useSelect, useRadioGroup and useCheckboxGroup hooks accept 4th generic type TOption which allows you to change the type of options. By default TOption will be equal to BaseOption type which is { label: any; value: any; }. If you want to change the type of options, you can do it like this:

    import { useSelect } from "@refinedev/antd";
    import { HttpError } from "@refinedev/core";
    
    type MyData = {
      id: number;
      title: string;
      description: string;
      category: { id: string };
    };
    
    type Option = { label: MyData["title"]; value: MyData["id"] }; // equals to { label: string; value: number; }
    
    useSelect<MyData, HttpError, MyData, Option>({
      resource: "posts",
    });
    
  • #5199 2b8d658a17a Thanks @aliemir! - Updated return types of useSelect, useRadioGroup and useCheckboxGroup hooks to only include properties that actually being returned from the hook. Previously, the return types included all properties of the respective components, which was not correct.

  • #5201 760cfbaaa2a Thanks @aliemir! - Handle nested server side validation errors properly in useForm

5.36.16

Patch Changes

5.36.15

Patch Changes

5.36.14

Patch Changes

5.36.13

Patch Changes

5.36.12

Patch Changes

5.36.11

Patch Changes

5.36.10

Patch Changes

  • #5098 672f7916af7 Thanks @alicanerdurmaz! - fix: undoableNotification does not work when using useNotificationProvider due to a different notification instance.

5.36.9

Patch Changes

  • #5098 672f7916af7 Thanks @alicanerdurmaz! - fix: undoableNotification does not work when using useNotificationProvider due to a different notification instance.

5.36.8

Patch Changes

  • #4945 b838412f0d0 Thanks @MahirMahdi! - fix: antd notificationProvider issue

    Antd notification component could not access theme context, now it's fixed.

    This release provides an alternative to exported notificationProvider value from type NotificationProvider to () => NotificationProvider. If you previously had customizations applied to the notificationProvider object, you may need to update your code like the following:

    - import { useNotificationProvider } from "@refinedev/antd";
    + import { useNotificationProvider } from "@refinedev/antd";
    + import { App as AntdApp } from "antd";
    
    - const myNotificationProvider = {
    -    ...useNotificationProvider,
    -    open: (...args) => {
    -        // do some operation here
    -        notificationProvider.open(...args);
    -    },
    - }
    + const myNotificationProvider = () => {
    +     const notificationProvider = useNotificationProvider();
    +     return {
    +          ...useNotificationProvider,
    +          open: (...args) => {
    +             // do some operation here
    +             notificationProvider.open(...args);
    +          },
    +     }
    + }
    }
    
    const App = () => {
        return (
    +        <AntdApp>
                <Refine
                    /* ... */
    +                notificationProvider={myNotificationProvider}
                >
                    /* ... */
                </Refine>
    +        </AntdApp>
        );
    }
    

5.36.7

Patch Changes

  • #4945 b838412f0d0 Thanks @MahirMahdi! - fix: antd notificationProvider issue

    Antd notification component could not access theme context, now it's fixed.

    This release provides an alternative to exported notificationProvider value from type NotificationProvider to () => NotificationProvider. If you previously had customizations applied to the notificationProvider object, you may need to update your code like the following:

    - import { useNotificationProvider } from "@refinedev/antd";
    + import { useNotificationProvider } from "@refinedev/antd";
    + import { App as AntdApp } from "antd";
    
    - const myNotificationProvider = {
    -    ...useNotificationProvider,
    -    open: (...args) => {
    -        // do some operation here
    -        notificationProvider.open(...args);
    -    },
    - }
    + const myNotificationProvider = () => {
    +     const notificationProvider = useNotificationProvider();
    +     return {
    +          ...useNotificationProvider,
    +          open: (...args) => {
    +             // do some operation here
    +             notificationProvider.open(...args);
    +          },
    +     }
    + }
    }
    
    const App = () => {
        return (
    +        <AntdApp>
                <Refine
                    /* ... */
    +                notificationProvider={myNotificationProvider}
                >
                    /* ... */
                </Refine>
    +        </AntdApp>
        );
    }
    

5.36.6

Patch Changes

  • #5026 a605e4cd318 Thanks @alicanerdurmaz! - feat: deprecated <ThemedLayout /> and <Layout /> components removed from swizzle. From now on, users can swizzle <ThemedLayoutV2 /> component instead.

    feat: swizzled <ThemedLayoutV2 /> component destination changed to src/components/layout/ from src/components/themedLayout.

5.36.5

Patch Changes

  • #5026 a605e4cd318 Thanks @alicanerdurmaz! - feat: deprecated <ThemedLayout /> and <Layout /> components removed from swizzle. From now on, users can swizzle <ThemedLayoutV2 /> component instead.

    feat: swizzled <ThemedLayoutV2 /> component destination changed to src/components/layout/ from src/components/themedLayout.

5.36.4

Patch Changes

  • #5022 80513a4e42f Thanks @BatuhanW! - chore: update README.md

    • fix grammar errors.
    • make all README.md files consistent.
    • add code example code snippets.

5.36.3

Patch Changes

  • #5022 80513a4e42f Thanks @BatuhanW! - chore: update README.md

    • fix grammar errors.
    • make all README.md files consistent.
    • add code example code snippets.

5.36.2

Patch Changes

5.36.1

Patch Changes

5.36.0

Minor Changes

  • #4914 91a4d0da9f1 Thanks @yildirayunlu! - feat: optimisticUpdateMap prop added to useForm hook. This prop allows you to update the data in the cache.

    useForm({
      mutationMode: "optimistic",
      optimisticUpdateMap: {
        list: true,
        many: true,
        detail: (previous, values, id) => {
          if (!previous) {
            return null;
          }
    
          const data = {
            id,
            ...previous.data,
            ...values,
            foo: "bar",
          };
    
          return {
            ...previous,
            data,
          };
        },
      },
    });
    

Patch Changes

  • #4903 e327cadc011 Thanks @yildirayunlu! - fix: when using useForm, autoSave parameters not passed to @refinedev/core/useForm hook. From now on, you can use autoSave parameters in useForm hook.

    feat: add invalidateOnUnmount prop to useForm hook. feat: add invalidateOnUnmount and invalidateOnClose prop to useModalForm and useDrawerForm hooks. From now on, you can use the use this props to invalidate queries upon unmount or close.

5.35.0

Minor Changes

  • #4914 91a4d0da9f1 Thanks @yildirayunlu! - feat: optimisticUpdateMap prop added to useForm hook. This prop allows you to update the data in the cache.

    useForm({
      mutationMode: "optimistic",
      optimisticUpdateMap: {
        list: true,
        many: true,
        detail: (previous, values, id) => {
          if (!previous) {
            return null;
          }
    
          const data = {
            id,
            ...previous.data,
            ...values,
            foo: "bar",
          };
    
          return {
            ...previous,
            data,
          };
        },
      },
    });
    

Patch Changes

  • #4903 e327cadc011 Thanks @yildirayunlu! - fix: when using useForm, autoSave parameters not passed to @refinedev/core/useForm hook. From now on, you can use autoSave parameters in useForm hook.

    feat: add invalidateOnUnmount prop to useForm hook. feat: add invalidateOnUnmount and invalidateOnClose prop to useModalForm and useDrawerForm hooks. From now on, you can use the use this props to invalidate queries upon unmount or close.

5.34.2

Patch Changes

5.34.1

Patch Changes

5.34.0

Minor Changes

  • #4775 3052fb22449 Thanks @alicanerdurmaz! - fixed: <RefreshButton /> does not refresh content #4618. From now, <RefreshButton /> uses useInvalidate hook to refresh data instead of useOne.

Patch Changes

5.33.0

Minor Changes

  • #4775 3052fb22449 Thanks @alicanerdurmaz! - fixed: <RefreshButton /> does not refresh content #4618. From now, <RefreshButton /> uses useInvalidate hook to refresh data instead of useOne.

Patch Changes

5.32.0

Minor Changes

Patch Changes

  • #4741 026ccf34356 Thanks @aliemir! - Updated DateField to set dayjs extension in component instead of a global side effect.

5.31.0

Minor Changes

Patch Changes

  • #4741 026ccf34356 Thanks @aliemir! - Updated DateField to set dayjs extension in component instead of a global side effect.

5.30.0

Minor Changes

  • #4591 f8891ead2bd Thanks @yildirayunlu! - feat: autoSave feature for Edit. useForm, useDrawerForm, useModalForm, useStepsForm hooks now accept autoSave object. enabled is a boolean value and debounce is a number value in milliseconds. debounce is optional and default value is 1000.

    const { autoSaveProps } = useForm({
        autoSave: {
            enabled: true,
            debounce: 2000, // not required, default is 1000
        },
    });
    
    return (
        <Edit
            saveButtonProps={saveButtonProps}
            // pass autoSaveProps to Edit component
            autoSaveProps={autoSaveProps}
        >
            // form fields
        </Edit>
    );
    

    feat: Add <AutoSaveIndicator> component. It comes automatically when autoSaveProps is given to the Edit page. However, this component can be used to position it in a different place.

    import { AutoSaveIndicator } from "@refinedev/antd";
    const { autoSaveProps } = useForm({
        autoSave: {
            enabled: true,
            debounce: 2000, // not required, default is 1000
        },
    });
    
    return (
        <div>
            <AutoSaveIndicator {...autoSaveProps}>
        </div>
    );
    
  • #4652 96af6d25b7a Thanks @alicanerdurmaz! - feat: when the dataProvider returns rejected promise with errors field, useForm will automatically update the error state with the rejected errors field.

    Refer to the server-side form validation documentation for more information. →

Patch Changes

  • Updated dependencies [f8891ead2bd]:
    • @refinedev/ui-types@1.20.0

5.29.0

Minor Changes

  • #4591 f8891ead2bd Thanks @yildirayunlu! - feat: autoSave feature for Edit. useForm, useDrawerForm, useModalForm, useStepsForm hooks now accept autoSave object. enabled is a boolean value and debounce is a number value in milliseconds. debounce is optional and default value is 1000.

    const { autoSaveProps } = useForm({
        autoSave: {
            enabled: true,
            debounce: 2000, // not required, default is 1000
        },
    });
    
    return (
        <Edit
            saveButtonProps={saveButtonProps}
            // pass autoSaveProps to Edit component
            autoSaveProps={autoSaveProps}
        >
            // form fields
        </Edit>
    );
    

    feat: Add <AutoSaveIndicator> component. It comes automatically when autoSaveProps is given to the Edit page. However, this component can be used to position it in a different place.

    import { AutoSaveIndicator } from "@refinedev/antd";
    const { autoSaveProps } = useForm({
        autoSave: {
            enabled: true,
            debounce: 2000, // not required, default is 1000
        },
    });
    
    return (
        <div>
            <AutoSaveIndicator {...autoSaveProps}>
        </div>
    );
    
  • #4652 96af6d25b7a Thanks @alicanerdurmaz! - feat: when the dataProvider returns rejected promise with errors field, useForm will automatically update the error state with the rejected errors field.

    Refer to the server-side form validation documentation for more information. →

Patch Changes

  • Updated dependencies [f8891ead2bd]:
    • @refinedev/ui-types@1.19.0

5.28.0

Minor Changes

  • #4502 c7872ca621f Thanks @Mr0nline! - feat: ability to tweak active sider items navigation

    Visiting active sider items triggers page reloads due to them being links. We can now provide activeItemDisabled prop to disable such reloads.

Patch Changes

5.27.0

Minor Changes

  • #4502 c7872ca621f Thanks @Mr0nline! - feat: ability to tweak active sider items navigation

    Visiting active sider items triggers page reloads due to them being links. We can now provide activeItemDisabled prop to disable such reloads.

Patch Changes

5.26.0

Minor Changes

Patch Changes

  • #4527 ceadcd29fc9 Thanks @salihozdemir! - fix: prioritization of forgotten identifier

    If identifier is provided, it will be used instead of name.

    import { DeleteButton } from "@refinedev/antd";
    
    <DeleteButton resource="identifier-value" recordItemId="123" />;
    

    fix: use translate keys with identifier

    Previously, the translate keys were generated using resource name. This caused issues when you had multiple resource usage with the same name. Now the translate keys are generated using identifier if it's present.

5.25.0

Minor Changes

Patch Changes

  • #4527 ceadcd29fc9 Thanks @salihozdemir! - fix: prioritization of forgotten identifier

    If identifier is provided, it will be used instead of name.

    import { DeleteButton } from "@refinedev/antd";
    
    <DeleteButton resource="identifier-value" recordItemId="123" />;
    

    fix: use translate keys with identifier

    Previously, the translate keys were generated using resource name. This caused issues when you had multiple resource usage with the same name. Now the translate keys are generated using identifier if it's present.

5.24.0

Minor Changes

  • #4449 cc84d61bc5c Thanks @BatuhanW! - feat: updated Create, List, Show, Edit, Delete, Clone buttons to respect new global accessControlProvider configuration.

    fix: Delete button's text wasn't rendered as reason field of accessControlProvider.

    Given the following can method:

    const accessControlProvider: IAccessControlContext = {
      can: async (): Promise<CanReturnType> => {
        return { can: false, reason: "Access Denied!" };
      },
    };
    

    If user is unauthorized, Delete button's text should be Access Denied! instead of default Delete.

    This is the default behaviour for Create, List, Show, Edit, Delete, Clone buttons already.

5.23.0

Minor Changes

  • #4449 cc84d61bc5c Thanks @BatuhanW! - feat: updated Create, List, Show, Edit, Delete, Clone buttons to respect new global accessControlProvider configuration.

    fix: Delete button's text wasn't rendered as reason field of accessControlProvider.

    Given the following can method:

    const accessControlProvider: IAccessControlContext = {
      can: async (): Promise<CanReturnType> => {
        return { can: false, reason: "Access Denied!" };
      },
    };
    

    If user is unauthorized, Delete button's text should be Access Denied! instead of default Delete.

    This is the default behaviour for Create, List, Show, Edit, Delete, Clone buttons already.

5.22.0

Minor Changes

  • #4430 cf07d59587f Thanks @aliemir! - Updated the useForm, useModalForm, useDrawerForm and useStepsForm to accept queryMeta and mutationMeta properties of the useForm hook of @refinedev/core. These properties are used to pass specific meta values to the query or mutation. This is useful when you have overlapping values in your data provider's getOne and update methods. For example, you may want to change the method of the mutation to PATCH but if you pass it in the meta property, you'll end up changing the method of the getOne request as well.

    queryMeta and mutationMeta has precedence over meta. This means that if you have the same property in queryMeta and meta, the value in queryMeta will be used.

    Usage

    import { useForm } from "@refinedev/core";
    
    export const MyEditPage = () => {
      const form = useForm({
        // this is passed both to the mutation and the query requests
        meta: {
          myValue: "myValue",
        },
        // this is only passed to the query request
        queryMeta: {
          propertyOnlyWorksForQuery: "propertyOnlyWorksForQuery",
        },
        // this is only passed to the mutation request
        mutationMeta: {
          propertyOnlyWorksForMutation: "propertyOnlyWorksForMutation",
        },
      });
    };
    

Patch Changes

  • #4429 63daabcb703 Thanks @aliemir! - Fixed the issue of formLoading property in return values of useStepsForm hook which was not being toggled correctly when the form was submitted or the form data was being fetched.

  • #4431 c29a3618cf6 Thanks @aliemir! - Updated the TSDoc comments to fix the broken links in the documentation.

5.21.0

Minor Changes

  • #4430 cf07d59587f Thanks @aliemir! - Updated the useForm, useModalForm, useDrawerForm and useStepsForm to accept queryMeta and mutationMeta properties of the useForm hook of @refinedev/core. These properties are used to pass specific meta values to the query or mutation. This is useful when you have overlapping values in your data provider's getOne and update methods. For example, you may want to change the method of the mutation to PATCH but if you pass it in the meta property, you'll end up changing the method of the getOne request as well.

    queryMeta and mutationMeta has precedence over meta. This means that if you have the same property in queryMeta and meta, the value in queryMeta will be used.

    Usage

    import { useForm } from "@refinedev/core";
    
    export const MyEditPage = () => {
      const form = useForm({
        // this is passed both to the mutation and the query requests
        meta: {
          myValue: "myValue",
        },
        // this is only passed to the query request
        queryMeta: {
          propertyOnlyWorksForQuery: "propertyOnlyWorksForQuery",
        },
        // this is only passed to the mutation request
        mutationMeta: {
          propertyOnlyWorksForMutation: "propertyOnlyWorksForMutation",
        },
      });
    };
    

Patch Changes

  • #4429 63daabcb703 Thanks @aliemir! - Fixed the issue of formLoading property in return values of useStepsForm hook which was not being toggled correctly when the form was submitted or the form data was being fetched.

  • #4431 c29a3618cf6 Thanks @aliemir! - Updated the TSDoc comments to fix the broken links in the documentation.

5.20.0

Minor Changes

  • #4404 f67967e8c87 Thanks @salihozdemir! - refactor: fix name and state inconsistency in <ThemedLayoutV2>

    useSiderVisible is deprecated, instead we created a new hook useThemedLayoutContext for it. useThemedLayoutContext similar to useSiderVisible but it returns more meaningful state names. However, useSiderVisible is still available for backward compatibility.

    Updated Sider and HamburgerMenu components using useThemedLayoutContext.

    import { useThemedLayoutContext } from "@refinedev/antd";
    
    const {
      siderCollapsed,
      setSiderCollapsed,
      mobileSiderOpen,
      setMobileSiderOpen,
    } = useThemedLayoutContext();
    

5.19.0

Minor Changes

  • #4404 f67967e8c87 Thanks @salihozdemir! - refactor: fix name and state inconsistency in <ThemedLayoutV2>

    useSiderVisible is deprecated, instead we created a new hook useThemedLayoutContext for it. useThemedLayoutContext similar to useSiderVisible but it returns more meaningful state names. However, useSiderVisible is still available for backward compatibility.

    Updated Sider and HamburgerMenu components using useThemedLayoutContext.

    import { useThemedLayoutContext } from "@refinedev/antd";
    
    const {
      siderCollapsed,
      setSiderCollapsed,
      mobileSiderOpen,
      setMobileSiderOpen,
    } = useThemedLayoutContext();
    

5.18.2

Patch Changes

5.18.1

Patch Changes

5.18.0

Minor Changes

  • #4303 0c569f42b4e Thanks @alicanerdurmaz! - feat: added default button props into the renderer functions headerButtons and footerButtons in CRUD components. Now, customization of the header and footer buttons can be achieved without losing the default functionality.

    import {
      DeleteButton,
      EditButton,
      ListButton,
      RefreshButton,
      Show,
    } from "@refinedev/antd";
    
    const PostShow = () => {
      return (
        <Show
          headerButtons={({
            deleteButtonProps,
            editButtonProps,
            listButtonProps,
            refreshButtonProps,
          }) => {
            return (
              <>
                {/* custom components */}
                {listButtonProps && (
                  <ListButton {...listButtonProps} meta={{ foo: "bar" }} />
                )}
                {editButtonProps && (
                  <EditButton {...editButtonProps} meta={{ foo: "bar" }} />
                )}
                {deleteButtonProps && (
                  <DeleteButton {...deleteButtonProps} meta={{ foo: "bar" }} />
                )}
                <RefreshButton {...refreshButtonProps} meta={{ foo: "bar" }} />
              </>
            );
          }}
        >
          {/* ... */}
        </Show>
      );
    };
    
  • #4306 e6eb4dea627 Thanks @yildirayunlu! - feat: syncWithLocation.syncId default to true for useDrawerForm and useModalForm.

Patch Changes

5.17.0

Minor Changes

  • #4303 0c569f42b4e Thanks @alicanerdurmaz! - feat: added default button props into the renderer functions headerButtons and footerButtons in CRUD components. Now, customization of the header and footer buttons can be achieved without losing the default functionality.

    import {
      DeleteButton,
      EditButton,
      ListButton,
      RefreshButton,
      Show,
    } from "@refinedev/antd";
    
    const PostShow = () => {
      return (
        <Show
          headerButtons={({
            deleteButtonProps,
            editButtonProps,
            listButtonProps,
            refreshButtonProps,
          }) => {
            return (
              <>
                {/* custom components */}
                {listButtonProps && (
                  <ListButton {...listButtonProps} meta={{ foo: "bar" }} />
                )}
                {editButtonProps && (
                  <EditButton {...editButtonProps} meta={{ foo: "bar" }} />
                )}
                {deleteButtonProps && (
                  <DeleteButton {...deleteButtonProps} meta={{ foo: "bar" }} />
                )}
                <RefreshButton {...refreshButtonProps} meta={{ foo: "bar" }} />
              </>
            );
          }}
        >
          {/* ... */}
        </Show>
      );
    };
    
  • #4306 e6eb4dea627 Thanks @yildirayunlu! - feat: syncWithLocation.syncId default to true for useDrawerForm and useModalForm.

Patch Changes

5.16.2

Patch Changes

5.16.1

Patch Changes

5.16.0

Minor Changes

  • #4272 420d2442741 Thanks @salihozdemir! - feat: added the fixed prop to the <ThemedSiderV2/> to allow the sider to be fixed

    The prop is optional and defaults to false. You can see the usage as follows:

    import { Refine } from "@refinedev/core";
    import { ThemedLayoutV2, ThemedSiderV2 } from "@refinedev/antd";
    
    const App: React.FC = () => {
        return (
            <Refine
             ...
            >
                <ThemedLayoutV2 Sider={() => <ThemedSiderV2 fixed />}>
                    {/* ... */}
                </ThemedLayoutV2>
            </Refine>
        );
    };
    
  • #4278 b14f2ad8a70 Thanks @alicanerdurmaz! - feat: added autoSubmitClose prop to useEditableTable. Now you can choose whether to close the table's row after submitting the form or not.

    const editableTable = useEditableTable({
      autoSubmitClose: false,
    });
    

Patch Changes

  • #4267 5e128c76c16 Thanks @yildirayunlu! - fix: onFinish prop override on useDrawerForm and useModalForm hook

    When override onFinish prop using the useDrawerForm and useModalForm hooks, the modal not close after submit the form.

  • #4277 7172c1b42d2 Thanks @salihozdemir! - fix: renamed the <ThemedHeaderV2/> prop isSticky to sticky

    To provide backwards compatibility, the old prop name is still supported, but it is deprecated and will be removed in the next major version.

    Example:

    import { Refine } from "@refinedev/core";
    import { ThemedLayoutV2, ThemedHeaderV2 } from "@refinedev/antd"; // or @refinedev/chakra-ui, @refinedev/mui, @refinedev/mantine
    
    const App: React.FC = () => {
        return (
            <Refine
                ...
            >
                <ThemedLayoutV2
                    Header={() => <ThemedHeaderV2 sticky />}
                >
                    {/* ... */}
                </ThemedLayoutV2>
            </Refine>
        );
    };
    

5.15.0

Minor Changes

  • #4272 420d2442741 Thanks @salihozdemir! - feat: added the fixed prop to the <ThemedSiderV2/> to allow the sider to be fixed

    The prop is optional and defaults to false. You can see the usage as follows:

    import { Refine } from "@refinedev/core";
    import { ThemedLayoutV2, ThemedSiderV2 } from "@refinedev/antd";
    
    const App: React.FC = () => {
        return (
            <Refine
             ...
            >
                <ThemedLayoutV2 Sider={() => <ThemedSiderV2 fixed />}>
                    {/* ... */}
                </ThemedLayoutV2>
            </Refine>
        );
    };
    
  • #4278 b14f2ad8a70 Thanks @alicanerdurmaz! - feat: added autoSubmitClose prop to useEditableTable. Now you can choose whether to close the table's row after submitting the form or not.

    const editableTable = useEditableTable({
      autoSubmitClose: false,
    });
    

Patch Changes

  • #4267 5e128c76c16 Thanks @yildirayunlu! - fix: onFinish prop override on useDrawerForm and useModalForm hook

    When override onFinish prop using the useDrawerForm and useModalForm hooks, the modal not close after submit the form.

  • #4277 7172c1b42d2 Thanks @salihozdemir! - fix: renamed the <ThemedHeaderV2/> prop isSticky to sticky

    To provide backwards compatibility, the old prop name is still supported, but it is deprecated and will be removed in the next major version.

    Example:

    import { Refine } from "@refinedev/core";
    import { ThemedLayoutV2, ThemedHeaderV2 } from "@refinedev/antd"; // or @refinedev/chakra-ui, @refinedev/mui, @refinedev/mantine
    
    const App: React.FC = () => {
        return (
            <Refine
                ...
            >
                <ThemedLayoutV2
                    Header={() => <ThemedHeaderV2 sticky />}
                >
                    {/* ... */}
                </ThemedLayoutV2>
            </Refine>
        );
    };
    

5.14.0

Minor Changes

  • #4272 420d2442741 Thanks @salihozdemir! - feat: added the fixed prop to the <ThemedSiderV2/> to allow the sider to be fixed

    The prop is optional and defaults to false. You can see the usage as follows:

    import { Refine } from "@refinedev/core";
    import { ThemedLayoutV2, ThemedSiderV2 } from "@refinedev/antd";
    
    const App: React.FC = () => {
        return (
            <Refine
             ...
            >
                <ThemedLayoutV2 Sider={() => <ThemedSiderV2 fixed />}>
                    {/* ... */}
                </ThemedLayoutV2>
            </Refine>
        );
    };
    
  • #4278 b14f2ad8a70 Thanks @alicanerdurmaz! - feat: added autoSubmitClose prop to useEditableTable. Now you can choose whether to close the table's row after submitting the form or not.

    const editableTable = useEditableTable({
      autoSubmitClose: false,
    });
    

Patch Changes

  • #4267 5e128c76c16 Thanks @yildirayunlu! - fix: onFinish prop override on useDrawerForm and useModalForm hook

    When override onFinish prop using the useDrawerForm and useModalForm hooks, the modal not close after submit the form.

  • #4277 7172c1b42d2 Thanks @salihozdemir! - fix: renamed the <ThemedHeaderV2/> prop isSticky to sticky

    To provide backwards compatibility, the old prop name is still supported, but it is deprecated and will be removed in the next major version.

    Example:

    import { Refine } from "@refinedev/core";
    import { ThemedLayoutV2, ThemedHeaderV2 } from "@refinedev/antd"; // or @refinedev/chakra-ui, @refinedev/mui, @refinedev/mantine
    
    const App: React.FC = () => {
        return (
            <Refine
                ...
            >
                <ThemedLayoutV2
                    Header={() => <ThemedHeaderV2 sticky />}
                >
                    {/* ... */}
                </ThemedLayoutV2>
            </Refine>
        );
    };
    

5.13.2

Patch Changes

  • #4241 fbe109b5a8b Thanks @salihozdemir! - Added new generic types to the useForm hooks. Now you can pass the query types and the mutation types to the hook.

5.13.1

Patch Changes

  • #4241 fbe109b5a8b Thanks @salihozdemir! - Added new generic types to the useForm hooks. Now you can pass the query types and the mutation types to the hook.

5.13.0

Minor Changes

  • #4209 3f4b5fef76f Thanks @yildirayunlu! - feat: add isSticky prop to ThemedHeaderV2 component

    import { ThemedHeaderV2, ThemedLayoutV2 } from "@refinedev/antd";
    
    const CustomHeader = () => <ThemedHeaderV2 isSticky={true} />;
    
    const App = () => (
      <Refine>
        // ...
        <ThemedLayoutV2 Header={CustomHeader}>
          <Outlet />
        </ThemedLayoutV2>
        // ...
      </Refine>
    );
    
  • #4232 c99bc0ad7f7 Thanks @alicanerdurmaz! - feat: initialSiderCollapsed added to RefineThemedLayoutV2Props to control initial state of <ThemedSiderV2>. From now on, you can control the initial collapsed state of <ThemedSiderV2> by passing the initialSiderCollapsed prop to <ThemedLayoutV2>.

    <ThemedLayoutV2
      initialSiderCollapsed={true} // This will make the sider collapsed by default
    >
      {/* .. */}
    </ThemedLayoutV2>
    

Patch Changes

5.12.0

Minor Changes

  • #4209 3f4b5fef76f Thanks @yildirayunlu! - feat: add isSticky prop to ThemedHeaderV2 component

    import { ThemedHeaderV2, ThemedLayoutV2 } from "@refinedev/antd";
    
    const CustomHeader = () => <ThemedHeaderV2 isSticky={true} />;
    
    const App = () => (
      <Refine>
        // ...
        <ThemedLayoutV2 Header={CustomHeader}>
          <Outlet />
        </ThemedLayoutV2>
        // ...
      </Refine>
    );
    
  • #4232 c99bc0ad7f7 Thanks @alicanerdurmaz! - feat: initialSiderCollapsed added to RefineThemedLayoutV2Props to control initial state of <ThemedSiderV2>. From now on, you can control the initial collapsed state of <ThemedSiderV2> by passing the initialSiderCollapsed prop to <ThemedLayoutV2>.

    <ThemedLayoutV2
      initialSiderCollapsed={true} // This will make the sider collapsed by default
    >
      {/* .. */}
    </ThemedLayoutV2>
    

Patch Changes

5.11.0

Minor Changes

  • #4194 8df15fe0e4e Thanks @alicanerdurmaz! - feat: sorters.mode prop added to useTable and useDataGrid hooks. This prop handles the sorting mode of the table. It can be either server or off.

    • "off": sorters are not sent to the server. You can use the sorters value to sort the records on the client side.
    • "server": Sorting is done on the server side. Records will be fetched by using the sorters value.

    feat:filters.mode prop added to useTable and useDataGrid hooks. This prop handles the filtering mode of the table. It can be either server or off.

    • "off": filters are not sent to the server. You can use the filters value to filter the records on the client side.
    • "server": Filtering is done on the server side. Records will be fetched by using the filters value.

5.10.0

Minor Changes

  • #4194 8df15fe0e4e Thanks @alicanerdurmaz! - feat: sorters.mode prop added to useTable and useDataGrid hooks. This prop handles the sorting mode of the table. It can be either server or off.

    • "off": sorters are not sent to the server. You can use the sorters value to sort the records on the client side.
    • "server": Sorting is done on the server side. Records will be fetched by using the sorters value.

    feat:filters.mode prop added to useTable and useDataGrid hooks. This prop handles the filtering mode of the table. It can be either server or off.

    • "off": filters are not sent to the server. You can use the filters value to filter the records on the client side.
    • "server": Filtering is done on the server side. Records will be fetched by using the filters value.

5.9.0

Minor Changes

  • #4193 3d28fccc1ca Thanks @yildirayunlu! - feat: add ThemedLayoutV2 component and useSiderVisible hook

    ThemeLayout is deprecated. Added ThemedLayoutV2 instead. This update fixed some UI problems in the layout. Also, with the new useSiderVisible hook, it's easier to collapse/uncollapse the Sider.

    See here for detailed migration guideline.

Patch Changes

  • Updated dependencies [deec38a034a]:
    • @refinedev/ui-types@1.10.0

5.8.0

Minor Changes

  • #4193 3d28fccc1ca Thanks @yildirayunlu! - feat: add ThemedLayoutV2 component and useSiderVisible hook

    ThemeLayout is deprecated. Added ThemedLayoutV2 instead. This update fixed some UI problems in the layout. Also, with the new useSiderVisible hook, it's easier to collapse/uncollapse the Sider.

    See here for detailed migration guideline.

Patch Changes

  • Updated dependencies [deec38a034a]:
    • @refinedev/ui-types@1.9.0

5.7.0

Minor Changes

  • #4193 3d28fccc1ca Thanks @yildirayunlu! - feat: add ThemedLayoutV2 component and useSiderVisible hook

    ThemeLayout is deprecated. Added ThemedLayoutV2 instead. This update fixed some UI problems in the layout. Also, with the new useSiderVisible hook, it's easier to collapse/uncollapse the Sider.

    See here for detailed migration guideline.

Patch Changes

  • Updated dependencies [deec38a034a]:
    • @refinedev/ui-types@1.8.0

5.6.0

Minor Changes

  • #4113 1c13602e308 Thanks @salihozdemir! - Added missing third generic parameter to hooks which are using useQuery internally.

    For example:

    import { useOne, HttpError } from "@refinedev/core";
    
    const { data } = useOne<{ count: string }, HttpError, { count: number }>({
      resource: "product-count",
      queryOptions: {
        select: (rawData) => {
          return {
            data: {
              count: Number(rawData?.data?.count),
            },
          };
        },
      },
    });
    
    console.log(typeof data?.data.count); // number
    

Patch Changes

  • #4113 1c13602e308 Thanks @salihozdemir! - Updated the generic type name of hooks that use useQuery to synchronize generic type names with tanstack-query.

5.5.2

Patch Changes

5.5.1

Patch Changes

5.5.0

Minor Changes

Patch Changes

  • #4114 afdaed3dd83 Thanks @aliemir! - Updated useModalForm and useDrawerForm hook's show method to check if there's an id present or provided. If there is, it will continue to show the modal/drawer. If not, the modal/drawer will not show. (Resolves #4062)

5.4.0

Minor Changes

Patch Changes

  • #4114 afdaed3dd83 Thanks @aliemir! - Updated useModalForm and useDrawerForm hook's show method to check if there's an id present or provided. If there is, it will continue to show the modal/drawer. If not, the modal/drawer will not show. (Resolves #4062)

5.3.14

Patch Changes

  • #4035 e0c75450f97 Thanks @salihozdemir! - - Re-extending the SuccessErrorNotification and LiveProps types removed
    • useEditableTable's successNotification and errorNotification props now work according to the mutation result instead of the query result

5.3.13

Patch Changes

  • #4035 e0c75450f97 Thanks @salihozdemir! - - Re-extending the SuccessErrorNotification and LiveProps types removed
    • useEditableTable's successNotification and errorNotification props now work according to the mutation result instead of the query result

5.3.12

Patch Changes

  • #4024 dc6d2311eb7 Thanks @alicanerdurmaz! - - Added: wrapperStyles prop to <ThemedTitle> component to allow for custom styles to be passed in.

    • Added: textDecoration: none to <ThemedTitle> component.

5.3.11

Patch Changes

  • #4024 dc6d2311eb7 Thanks @alicanerdurmaz! - - Added: wrapperStyles prop to <ThemedTitle> component to allow for custom styles to be passed in.

    • Added: textDecoration: none to <ThemedTitle> component.

5.3.10

Patch Changes

  • #3997 f027d8a53b8 Thanks @alicanerdurmaz! - - Fixed the unsaved changes dialog is popping up unexpectedly when the user clicks the logs out.

    -   The `<ThemedSider>`'s `onClick` handler was changed to use the `window.confirm` API to manage the confirmation dialog.
    
  • #3974 4dcc20d6a60 Thanks @salihozdemir! - Deprecated the WelcomePage component. It'll be used from @refinedev/core instead.

5.3.9

Patch Changes

  • #3997 f027d8a53b8 Thanks @alicanerdurmaz! - - Fixed the unsaved changes dialog is popping up unexpectedly when the user clicks the logs out.

    -   The `<ThemedSider>`'s `onClick` handler was changed to use the `window.confirm` API to manage the confirmation dialog.
    
  • #3974 4dcc20d6a60 Thanks @salihozdemir! - Deprecated the WelcomePage component. It'll be used from @refinedev/core instead.

5.3.8

Patch Changes

  • #3975 b1e6e32f9a1 Thanks @alicanerdurmaz! - - Fixed the unsaved changes dialog is popping up unexpectedly when the user clicks the logs out.

    -   The `<ThemedSider>`'s `onClick` handler was changed to use the `window.confirm` API to manage the confirmation dialog.
    
    • <RefineThemes> colors updated to match the new theme colors.
  • Updated dependencies [2798f715361]:

    • @refinedev/ui-types@1.5.0

5.3.7

Patch Changes

  • #3975 b1e6e32f9a1 Thanks @alicanerdurmaz! - - Fixed the unsaved changes dialog is popping up unexpectedly when the user clicks the logs out.

    -   The `<ThemedSider>`'s `onClick` handler was changed to use the `window.confirm` API to manage the confirmation dialog.
    
    • <RefineThemes> colors updated to match the new theme colors.
  • Updated dependencies [2798f715361]:

    • @refinedev/ui-types@1.4.0

5.3.6

Patch Changes

5.3.5

Patch Changes

5.3.4

Patch Changes

5.3.3

Patch Changes

5.3.2

Patch Changes

  • #3931 d92c8e82868 Thanks @salihozdemir! - Added missing autoSubmitClose, autoResetForm, and defaultVisible props to useDrawerForm hook.

  • #3911 5f9c70ebf2f Thanks @salihozdemir! - Fixed autoSubmitClose and autoResetForm props of useModalForm hook to work properly.

  • #3931 d92c8e82868 Thanks @salihozdemir! - Added autoSubmitClose, autoResetForm, and defaultVisible props to useDrawerForm hook.

  • #3948 b4950503334 Thanks @salihozdemir! - Fixed the unsaved changes dialog is popping up unexpectedly when the user clicks the delete button or logs out, when the form is dirty.

    • The <DeleteButton> already has a confirmation dialog, so the alert was removed.
    • The <Sider>'s onClick handler was changed to use the window.confirm API to manage the confirmation dialog.

5.3.1

Patch Changes

  • #3931 d92c8e82868 Thanks @salihozdemir! - Added missing autoSubmitClose, autoResetForm, and defaultVisible props to useDrawerForm hook.

  • #3911 5f9c70ebf2f Thanks @salihozdemir! - Fixed autoSubmitClose and autoResetForm props of useModalForm hook to work properly.

  • #3931 d92c8e82868 Thanks @salihozdemir! - Added autoSubmitClose, autoResetForm, and defaultVisible props to useDrawerForm hook.

  • #3948 b4950503334 Thanks @salihozdemir! - Fixed the unsaved changes dialog is popping up unexpectedly when the user clicks the delete button or logs out, when the form is dirty.

    • The <DeleteButton> already has a confirmation dialog, so the alert was removed.
    • The <Sider>'s onClick handler was changed to use the window.confirm API to manage the confirmation dialog.

5.3.0

Minor Changes

  • #3912 0ffe70308b2 Thanks @alicanerdurmaz! - - RefineThemes added. It contains predefined colors for the antd components.

    import { RefineThemes } from "@refinedev/antd";
    import { Refine } from "@refinedev/core";
    import dataProvider from "@refinedev/simple-rest";
    
    const App = () => {
      // ---
    
      return (
        <ConfigProvider
          theme={{
            token: RefineThemes.Magenta.token,
          }}
        >
          <Refine dataProvider={dataProvider("YOUR_API_URL")}>
            {/** your app here */}
          </Refine>
        </ConfigProvider>
      );
    };
    
    • default title with icon added to AuthPage. It uses ThemedTitle component from @refinedev/antd. You can remove it by setting title prop to false.
    <AuthPage title={false} />
    
    • title prop added to AuthPage's renderContent prop to use in the custom content.
    <AuthPage
      renderContent={(content: React.ReactNode, title: React.ReactNode) => {
        return (
          <div
            style={{
              display: "flex",
              flexDirection: "column",
              justifyContent: "center",
              alignItems: "center",
            }}
          >
            {title}
            <h1 style={{ color: "white" }}>Extra Header</h1>
            {content}
            <h1 style={{ color: "white" }}>Extra Footer</h1>
          </div>
        );
      }}
    />
    
    • <ThemedLayout>, <ThemedSider>, <ThemedTitle>, <ThemedHeader> created to use theme colors.

    • <EditButton> in <Show> type changed to primary.

    • <CreateButton> type changed to primary.

    • <AuthPage> component uses colors from the theme.

    • <ThemedTitle> added to AuthPage

Patch Changes

  • Updated dependencies [0ffe70308b2]:
    • @refinedev/ui-types@1.3.0

5.2.0

Minor Changes

  • #3912 0ffe70308b2 Thanks @alicanerdurmaz! - - RefineThemes added. It contains predefined colors for the antd components.

    import { RefineThemes } from "@refinedev/antd";
    import { Refine } from "@refinedev/core";
    import dataProvider from "@refinedev/simple-rest";
    
    const App = () => {
      // ---
    
      return (
        <ConfigProvider
          theme={{
            token: RefineThemes.Magenta.token,
          }}
        >
          <Refine dataProvider={dataProvider("YOUR_API_URL")}>
            {/** your app here */}
          </Refine>
        </ConfigProvider>
      );
    };
    
    • default title with icon added to AuthPage. It uses ThemedTitle component from @refinedev/antd. You can remove it by setting title prop to false.
    <AuthPage title={false} />
    
    • title prop added to AuthPage's renderContent prop to use in the custom content.
    <AuthPage
      renderContent={(content: React.ReactNode, title: React.ReactNode) => {
        return (
          <div
            style={{
              display: "flex",
              flexDirection: "column",
              justifyContent: "center",
              alignItems: "center",
            }}
          >
            {title}
            <h1 style={{ color: "white" }}>Extra Header</h1>
            {content}
            <h1 style={{ color: "white" }}>Extra Footer</h1>
          </div>
        );
      }}
    />
    
    • <ThemedLayout>, <ThemedSider>, <ThemedTitle>, <ThemedHeader> created to use theme colors.

    • <EditButton> in <Show> type changed to primary.

    • <CreateButton> type changed to primary.

    • <AuthPage> component uses colors from the theme.

    • <ThemedTitle> added to AuthPage

Patch Changes

  • Updated dependencies [0ffe70308b2]:
    • @refinedev/ui-types@1.2.0

5.1.2

Patch Changes

5.1.1

Patch Changes

5.1.0

Minor Changes

  • Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk! Updated the components to match the changes in routing system of @refinedev/core.

    meta property in components

    This includes meta props in buttons and Sider component. meta property can be used to pass additional parameters to the navigation paths.

    For a posts resource definition like this:

    <Refine
        resources={[
            {
                name: "posts",
                list: "/posts",
                show: "/:authorId/posts/:id",
            }
        ]}
    >
    

    You can pass authorId to the ShowButton component like this:

    <ShowButton resource="posts" id="1" meta={{ authorId: 123 }}>
    

    This will navigate to /123/posts/1 path.

    syncWithLocation support in useDrawerForm and useModalForm hooks

    useDrawerForm and useModalForm hooks now support syncWithLocation prop. This prop can be used to sync the visibility state of them with the location via query params.

    You can pass a boolean or an object with key and syncId properties.

    • key is used to define the query param key. Default value is inferred from the resource and the action. For example posts-create for posts resource and create action.

    • syncId is used to include the id property in the query param key. Default value is false. This is useful for edit and clone actions.

    Removed props

    ignoreAccessControlProvider prop is removed from buttons.

  • Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk! Updated buttons with resource property. resourceNameOrRouteName is now deprecated but kept working until next major version.

  • Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk! All Ant Design components re-exported from @refinedev/antd have been removed. You should import them from antd package directly.

    If the package is not installed, you should install it with your package manager:

    npm install antd
    # or
    pnpm add antd
    # or
    yarn add antd
    

    After that, you can import components from antd package directly like below:

    -import { useTable, SaveButton, Button, Form, Input, Select } from "@refinedev/antd";
    
    +import { useTable, SaveButton } from "@refinedev/antd";
    +import { Button, Form, Input, Select } from "antd";
    

    Icons are also removed from @refinedev/antd. So, you should import icons from @ant-design/icons package directly.

    If the package is not installed, you should install it with your package manager:

    npm install @ant-design/icons
    # or
    pnpm add @ant-design/icons
    # or
    yarn add @ant-design/icons
    

    After that, you can import icons from @ant-design/icons package directly like below:

    -import { Icons } from "@refinedev/antd";
    -const { EditOutlined } = Icons;
    
    + import { EditOutlined } from "@ant-design/icons";
    
  • Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk! Upgrade @ant-design/icons to ^5.0.1 for consistency.

  • Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk!

    • useCheckboxGroup's sort prop is now deprecated. Use sorters prop instead.
    useCheckboxGroup({
    -    sort,
    +    sorters,
    })
    
    • useSelect's sort prop is now deprecated. Use sorters prop instead.
    useSelect({
    -    sort,
    +    sorters,
    })
    
    • useRadioGroup's sort prop is now deprecated. Use sorters prop instead.
    useRadioGroup({
    -    sort,
    +    sorters,
    })
    
    • useImport's resourceName prop is now deprecated. Use resource prop instead.
    useImport({
    -    resourceName,
    +    resource,
    })
    
  • Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk!

    • <ReadyPage> isnow deprecated.
    • Created a <WelcomePage> component to welcome users.
  • Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk! Added legacy auth provider and new auth provider support to all components and hooks.

  • Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk!

    🪄 Migrating your project automatically with refine-codemod

    @refinedev/codemod package handles the breaking changes for your project automatically, without any manual steps. It migrates your project from 3.x.x to 4.x.x.

    Just cd into root folder of your project (where package.json is contained) and run this command:

    npx @refinedev/codemod@latest refine3-to-refine4
    

    And it's done. Now your project uses refine@4.x.x.

    📝 Changelog

    Deprecated useMenu removed from @refinedev/antd package. Use useMenu from @refinedev/core package instead.

    - import { useMenu } from "@refinedev/antd";
    + import { useMenu } from "@refinedev/core";
    
  • Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk! Moving to the @refinedev scope 🎉🎉

    Moved to the @refinedev scope and updated our packages to use the new scope. From now on, all packages will be published under the @refinedev scope with their new names.

    Now, we're also removing the refine prefix from all packages. So, the @pankod/refine-core package is now @refinedev/core, @pankod/refine-antd is now @refinedev/antd, and so on.

  • Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk!

    useTable hook

    useTable return values and properties are updated.

    • initialCurrent and initialPageSize props are now deprecated. Use pagination prop instead.

    • To ensure backward compatibility, initialCurrent and initialPageSize props will work as before.

      useTable({
      -    initialCurrent,
      -    initialPageSize,
      +    pagination: {
      +        current,
      +        pageSize,
      +    },
      })
      
    • hasPagination prop is now deprecated. Use pagination.mode instead.

    • To ensure backward compatibility, hasPagination prop will work as before.

      useTable({
      -    hasPagination,
      +    pagination: {
      +        mode: "off" | "server" | "client",
      +    },
      })
      
    • initialSorter and permanentSorter props are now deprecated. Use sorters.initial and sorters.permanent instead.

    • To ensure backward compatibility, initialSorter and permanentSorter props will work as before.

      useTable({
      -    initialSorter,
      -    permanentSorter,
      +    sorters: {
      +        initial,
      +        permanent,
      +    },
      })
      
    • initialFilter, permanentFilter, and defaultSetFilterBehavior props are now deprecated. Use filters.initial, filters.permanent, and filters.defaultBehavior instead.

    • To ensure backward compatibility, initialFilter, permanentFilter, and defaultSetFilterBehavior props will work as before.

      useTable({
      -    initialFilter,
      -    permanentFilter,
      -    defaultSetFilterBehavior,
      +    filters: {
      +        initial,
      +        permanent,
      +        defaultBehavior,
      +    },
      })
      
    • sorter and setSorter return values are now deprecated. Use sorters and setSorters instead.

    • To ensure backward compatibility, sorter and setSorter return values will work as before.

      const {
      -   sorter,
      +   sorters,
      -   setSorter,
      +   setSorters,
      } = useTable();
      

    useSimpleList hook

    • Now useSimpleList hook will not accept all of <List> component properties So, you can give their props to <List> component directly.

      import { useSimpleList } from "@refinedev/antd";
      import { List } from "antd";
      
      const { listProps } = useSimpleList({
          resource: "orders",
          pagination: {
              pageSize: 6,
      -       simple: true,
          },
      });
      
      <List
          {...listProps}
      +   pagination={{
      +     ...listProps.pagination,
      +     simple: true,
      +   }}
          ... // other props
      />
      
    • initialCurrent and initialPageSize props are now deprecated. Use pagination prop instead.

    • To ensure backward compatibility, initialCurrent and initialPageSize props will work as before.

    • useSimpleList({
      -    initialCurrent,
      -    initialPageSize,
      +    pagination: {
      +        current,
      +        pageSize,
      +    },
      })
      

Patch Changes

4.9.0

Minor Changes

Patch Changes

  • Updated dependencies [0baa99ba787]:
    • @pankod/refine-ui-types@0.16.0

4.8.0

Minor Changes

Patch Changes

  • Updated dependencies [0baa99ba787]:
    • @pankod/refine-ui-types@0.15.0

4.7.3

Patch Changes

4.7.2

Patch Changes

4.7.1

Patch Changes

4.7.0

Minor Changes

  • #3324 9bfb34749bc Thanks @aliemir! - Added the ability to pass mutation options to useMutation hooks in mutation hooks:
    • useForm
    • useStepsForm
    • useModalForm
    • useDrawerForm

4.6.0

Minor Changes

  • #3324 9bfb34749bc Thanks @aliemir! - Added the ability to pass mutation options to useMutation hooks in mutation hooks:
    • useForm
    • useStepsForm
    • useModalForm
    • useDrawerForm

4.5.0

Minor Changes

  • #3294 3c9c8c07d21 Thanks @aliemir! - Remove getContainer: false from useModalForm and useDrawerForm and let it fallback to the default value. Users wanting to override the default value can still do so by passing getContainer prop to the Modal and Drawer components.

4.4.0

Minor Changes

  • #3294 3c9c8c07d21 Thanks @aliemir! - Remove getContainer: false from useModalForm and useDrawerForm and let it fallback to the default value. Users wanting to override the default value can still do so by passing getContainer prop to the Modal and Drawer components.

4.3.0

Minor Changes

4.2.0

Minor Changes

4.1.5

Patch Changes

4.1.4

Patch Changes

4.1.3

Patch Changes

4.1.2

Patch Changes

4.1.1

Patch Changes

4.1.0

Minor Changes

  • #3249 fd2e1882e06 Thanks @rajaomariajaona! - Add ability to pass pagination values in useTable hook. (Resolves #3246)

    • current
    • setCurrent
    • pageSize
    • setPageSize
    • pageCount
  • #3121 214ea79c81c Thanks @yildirayunlu! - We've released Ant Design v5 support 🎉

    Upgrade

    You can easily update refine packages with refine CLI update command.

    npm run refine update
    

    How to add refine CLI to an existing project?

    🪄 Migrating your project automatically with Codemod

    @pankod/refine-codemod package handles the breaking changes for your project automatically, without any manual steps. It migrates your @pankod/refine-antd version from 3.x.x to 4.x.x.

    Just cd into root folder of your project (where package.json is contained) and run this command:

    npx @pankod/refine-codemod antd4-to-antd5
    

    And it's done. Now your project uses @pankod/refine-antd@4.x.x.

    Changes

    • <PageHeader> component moved into @ant-design/pro-components. refine is using <PageHeader> in <List>, <Create>, <Edit>, <Show> components and added as a dependency. You don't need to install @ant-design/pro-components package manually.
    • <Comment> component moved into @ant-design/compatible.
    • moment.js is replaced with day.js.
    • less is removed from antd package.

    Please refer to Ant Design Migration Guide for detailed information.

    🚨 Next.js 13 Not Supported Now

    Currently ant-design/pro-components does not compatible with Next.js 13. refine is using ant-design/pro-components as a dependency for <PageHeader/> component.

    Refer to a related issue on ant-design/pro-components repository

4.0.0

Major Changes

  • #3121 214ea79c81c Thanks @yildirayunlu! - We've released Ant Design v5 support 🎉

    Upgrade

    You can easily update refine packages with refine CLI update command.

    npm run refine update
    

    How to add refine CLI to an existing project?

    🪄 Migrating your project automatically with Codemod

    @pankod/refine-codemod package handles the breaking changes for your project automatically, without any manual steps. It migrates your @pankod/refine-antd version from 3.x.x to 4.x.x.

    Just cd into root folder of your project (where package.json is contained) and run this command:

    npx @pankod/refine-codemod antd4-to-antd5
    

    And it's done. Now your project uses @pankod/refine-antd@4.x.x.

    Changes

    • <PageHeader> component moved into @ant-design/pro-components. refine is using <PageHeader> in <List>, <Create>, <Edit>, <Show> components and added as a dependency. You don't need to install @ant-design/pro-components package manually.
    • <Comment> component moved into @ant-design/compatible.
    • moment.js is replaced with day.js.
    • less is removed from antd package.

    Please refer to Ant Design Migration Guide for detailed information.

    🚨 Next.js 13 Not Supported Now

    Currently ant-design/pro-components does not compatible with Next.js 13. refine is using ant-design/pro-components as a dependency for <PageHeader/> component.

    Refer to a related issue on ant-design/pro-components repository

Minor Changes

  • #3249 fd2e1882e06 Thanks @rajaomariajaona! - Add ability to pass pagination values in useTable hook. (Resolves #3246)
    • current
    • setCurrent
    • pageSize
    • setPageSize
    • pageCount

3.70.4

Patch Changes

  • #3252 cf696235d0b Thanks @aliemir! - Updated esbuild configuration to handle antd/lib imports in esm builds. (Resolves #3187)

3.70.3

Patch Changes

  • #3252 cf696235d0b Thanks @aliemir! - Updated esbuild configuration to handle antd/lib imports in esm builds. (Resolves #3187)

3.70.2

Patch Changes

3.70.1

Patch Changes

3.70.0

Minor Changes

3.69.0

Minor Changes

3.68.0

Minor Changes

3.67.0

Minor Changes

3.66.0

Minor Changes

  • #3159 af2eefb32a4 Thanks @aliemir! - Updated LoginPage and ReadyPage to use refine logos from CDN rather than bundled svg files.

3.65.0

Minor Changes

  • #3159 af2eefb32a4 Thanks @aliemir! - Updated LoginPage and ReadyPage to use refine logos from CDN rather than bundled svg files.

3.64.4

Patch Changes

3.64.3

Patch Changes

3.64.2

Patch Changes

  • #3109 16549ed3012 Thanks @aliemir! - Updated swizzle items and their messages to include extra information and usage examples.

3.64.1

Patch Changes

  • #3109 16549ed3012 Thanks @aliemir! - Updated swizzle items and their messages to include extra information and usage examples.

3.64.0

Minor Changes

  • #3062 6c2ed708a9a Thanks @aliemir! - - Updated components and their type imports to make them compatible with swizzle feature.
    • Added refine.config.js to configure the swizzle feature.

3.63.0

Minor Changes

  • #3062 6c2ed708a9a Thanks @aliemir! - - Updated components and their type imports to make them compatible with swizzle feature.
    • Added refine.config.js to configure the swizzle feature.

3.62.0

Minor Changes

  • #2872 da3fc4a702 Thanks @TDP17! - Feat: Added ability to manage breadcrumb component globally via options

    The option set in individual CRUD components takes priority over the global option

3.61.0

Minor Changes

  • #2872 da3fc4a702 Thanks @TDP17! - Feat: Added ability to manage breadcrumb component globally via options

    The option set in individual CRUD components takes priority over the global option

3.60.0

Minor Changes

  • #2839 5388a338ab Thanks @aliemir! - Deprecation

    ignoreAccessControlProvider prop on buttons is deprecated. Use accessContro.enabled instead.

    Features

    accessControl.enabled prop is added to buttons to enable/disable access control for buttons. accessControl.hideIfUnauthorized prop is added to buttons to hide the button if access is denied.

  • #2836 e43e9a17ae Thanks @alicanerdurmaz! - added locales prop to date fields

Patch Changes

  • #2838 f7968fa16f Thanks @aliemir! - Fixed #2828 - Buttons were not respecting access control when navigating to a new page. Now, if button is disabled, it will not also block the navigation not just the onClick event.

  • Updated dependencies [476285e342, 5388a338ab, e43e9a17ae]:

    • @pankod/refine-ui-types@0.14.0

3.59.0

Minor Changes

Patch Changes

  • Updated dependencies [e43e9a17ae]:
    • @pankod/refine-ui-types@0.13.0

3.58.0

Minor Changes

  • #2839 5388a338ab Thanks @aliemir! - Deprecation

    ignoreAccessControlProvider prop on buttons is deprecated. Use accessContro.enabled instead.

    Features

    accessControl.enabled prop is added to buttons to enable/disable access control for buttons. accessControl.hideIfUnauthorized prop is added to buttons to hide the button if access is denied.

Patch Changes

  • #2838 f7968fa16f Thanks @aliemir! - Fixed #2828 - Buttons were not respecting access control when navigating to a new page. Now, if button is disabled, it will not also block the navigation not just the onClick event.

  • Updated dependencies [476285e342, 5388a338ab]:

    • @pankod/refine-ui-types@0.12.0

3.57.0

Minor Changes

  • Only or was supported as a conditional filter. Now and and or can be used together and nested. 🚀

    {
      operator: "or",
      value: [
        {
          operator: "and",
          value: [
            {
              field: "name",
              operator: "eq",
              value: "John Doe",
            },
            {
              field: "age",
              operator: "eq",
              value: 30,
            },
          ],
        },
        {
          operator: "and",
          value: [
            {
              field: "name",
              operator: "eq",
              value: "JR Doe",
            },
            {
              field: "age",
              operator: "eq",
              value: 1,
            },
          ],
        },
      ],
    }
    

Patch Changes

  • Updated dependencies []:
    • @pankod/refine-ui-types@0.11.6

3.56.0

Minor Changes

  • #2751 addff64c77 Thanks @yildirayunlu! - Only or was supported as a conditional filter. Now and and or can be used together and nested. 🚀

    {
      operator: "or",
      value: [
        {
          operator: "and",
          value: [
            {
              field: "name",
              operator: "eq",
              value: "John Doe",
            },
            {
              field: "age",
              operator: "eq",
              value: 30,
            },
          ],
        },
        {
          operator: "and",
          value: [
            {
              field: "name",
              operator: "eq",
              value: "JR Doe",
            },
            {
              field: "age",
              operator: "eq",
              value: 1,
            },
          ],
        },
      ],
    }
    

Patch Changes

  • Updated dependencies [19124711a7]:
    • @pankod/refine-ui-types@0.11.5

3.55.3

Patch Changes

  • Fixed providers property empty array state in <AuthPage /> component

3.55.2

Patch Changes

  • Fixed providers property empty array state in <AuthPage /> component

3.55.1

Patch Changes

3.55.0

Minor Changes

  • Added infinite loading example to antd useSelect() useSelect() fetchSize prop is deprecated. From now pagination should be used

Patch Changes

  • Add AuthProps type export

3.54.0

Minor Changes

Patch Changes

3.53.0

Minor Changes

    • Added new component core and mantine support.
    • Move Auth types @pankod/refine-ui-types to @pankod/refine-core

3.52.0

Minor Changes

  • #2627 c5fb45d61f Thanks @yildirayunlu! - - Added new component core and mantine support.
    • Move Auth types @pankod/refine-ui-types to @pankod/refine-core

3.51.0

Minor Changes

  • Deprecated LoginPage.

    Before

    import { LoginPage } from "@pankod/refine-antd";
    
    <Refine
      LoginPage={LoginPage}
      ...
    />
    

    After

    import { AuthPage } from "@pankod/refine-antd";
    
    <Refine
      LoginPage={AuthPage}
      ...
    />
    

3.50.0

Minor Changes

  • Deprecated LoginPage.

    Before

    import { LoginPage } from "@pankod/refine-antd";
    
    <Refine
      LoginPage={LoginPage}
      ...
    />
    

    After

    import { AuthPage } from "@pankod/refine-antd";
    
    <Refine
      LoginPage={AuthPage}
      ...
    />
    

3.49.0

Minor Changes

  • #2580 e1ab7da6b3 Thanks @yildirayunlu! - Deprecated LoginPage.

    Before

    import { LoginPage } from "@pankod/refine-antd";
    
    <Refine
      LoginPage={LoginPage}
      ...
    />
    

    After

    import { AuthPage } from "@pankod/refine-antd";
    
    <Refine
      LoginPage={AuthPage}
      ...
    />
    

3.48.10

Patch Changes

  • ReadyPage examples link fixed.

3.48.9

Patch Changes

3.48.8

Patch Changes

  • Updated disabled attribute of buttons in CRUD components according to isLoading prop.

  • Removed redundant type inheritance

  • Updated dependencies []:

    • @pankod/refine-ui-types@0.11.2

3.48.7

Patch Changes

3.48.6

Patch Changes

3.48.5

Patch Changes

  • Rename reset-password -> forgot-password on docs.

3.48.4

Patch Changes

  • Rename reset-password -> forgot-password on docs.

3.48.3

Patch Changes

3.48.2

Patch Changes

  • Fixed useModalForm & useStepsForm return type

3.48.1

Patch Changes

3.48.0

Minor Changes

  • Add providers support on AuthPage register page.

Patch Changes

  • Updated dependencies []:
    • @pankod/refine-ui-types@0.11.0

3.47.0

Minor Changes

Patch Changes

  • Updated dependencies [a65525de6f]:
    • @pankod/refine-ui-types@0.10.0

3.46.4

Patch Changes

    • Auth pages background color fixed.
    • Removed unused updatePasswordLink prop from auth pages.
    • Removed onSubmit prop from auth pages. use formProps instead.
  • Updated dependencies []:
    • @pankod/refine-ui-types@0.9.2

3.46.3

Patch Changes

  • #2524 27bf81bebb Thanks @biskuvit! - - Auth pages background color fixed.
    • Removed unused updatePasswordLink prop from auth pages.
    • Removed onSubmit prop from auth pages. use formProps instead.
  • Updated dependencies [27bf81bebb]:
    • @pankod/refine-ui-types@0.9.1

3.46.2

Patch Changes

  • Fixed the spacing between icon and breadcrumb label in Breadcrumb component.

3.46.1

Patch Changes

3.46.0

Minor Changes

  • Added formProps property support for AuthPage component

    Usage

    <AuthPage
      type="login"
      formProps={{
        initialValues: {
          email: "demo@refine.dev",
          password: "demo",
        },
      }}
    />
    

Patch Changes

  • Updated dependencies []:
    • @pankod/refine-ui-types@0.9.0

3.45.0

Minor Changes

  • #2516 ad99916d6d Thanks @omeraplak! - Added formProps property support for AuthPage component

    Usage

    <AuthPage
      type="login"
      formProps={{
        initialValues: {
          email: "demo@refine.dev",
          password: "demo",
        },
      }}
    />
    

Patch Changes

  • Updated dependencies [ad99916d6d]:
    • @pankod/refine-ui-types@0.8.0

3.44.0

Minor Changes

  • Added render prop to Sider component. You can get dashboard, logout and items from render props to customize the Sider component.

  • Added <AuthPage> for Ant Design. <AuthPage> is a component that provides a login, register, forgot password and update password pages.

Patch Changes

  • Fixed version of react-router to 6.3.0

  • Passed collapsed prop to render method in Sider component of @pankod/refine-antd.

  • Updated dependencies []:

    • @pankod/refine-ui-types@0.7.0

3.43.1

Patch Changes

3.43.0

Minor Changes

  • #2447 628a37a675 Thanks @biskuvit! - Added <AuthPage> for Ant Design. <AuthPage> is a component that provides a login, register, forgot password and update password pages.

Patch Changes

  • Updated dependencies [628a37a675]:
    • @pankod/refine-ui-types@0.6.2

3.42.1

Patch Changes

  • #2492 7d5bf3023d Thanks @ozkalai! - Passed collapsed prop to render method in Sider component of @pankod/refine-antd.

  • Updated dependencies [7d5bf3023d]:

    • @pankod/refine-ui-types@0.6.1

3.42.0

Minor Changes

  • #2454 72487a4126 Thanks @ozkalai! - Added render prop to Sider component. You can get dashboard, logout and items from render props to customize the Sider component.

Patch Changes

  • Updated dependencies [72487a4126]:
    • @pankod/refine-ui-types@0.6.0

3.41.0

Minor Changes

  • Added support nested sorting

3.40.0

Minor Changes

3.39.0

Minor Changes

  • Update type declaration generation with tsc instead of tsup for better navigation throughout projects source code.

Patch Changes

  • Updated dependencies []:
    • @pankod/refine-ui-types@0.5.0

3.38.0

Minor Changes

  • #2440 0150dcd070 Thanks @aliemir! - Update type declaration generation with tsc instead of tsup for better navigation throughout projects source code.

Patch Changes

3.37.11

Patch Changes

  • Fix: useStepsForm's submit function can be overridden

3.37.10

Patch Changes

  • Fix: useStepsForm's submit function can be overridden

3.37.9

Patch Changes

3.37.8

Patch Changes

  • Fix: Wrap with <CanAccess /> component to parent sider items

    <Refine
      accessControlProvider={{
        can: async ({ action, resource }) => {
          // console.log({ action, resource });
          // output: {action: "list", resource: "cms" }
    
          return { can: true };
        },
      }}
      resources={[
        {
          name: "CMS",
        },
        {
          name: "posts",
          parentName: "CMS",
          list: PostList,
        },
      ]}
    />
    

3.37.7

Patch Changes

  • #2411 c61470a2e0 Thanks @omeraplak! - Fix: Wrap with <CanAccess /> component to parent sider items

    <Refine
      accessControlProvider={{
        can: async ({ action, resource }) => {
          // console.log({ action, resource });
          // output: {action: "list", resource: "cms" }
    
          return { can: true };
        },
      }}
      resources={[
        {
          name: "CMS",
        },
        {
          name: "posts",
          parentName: "CMS",
          list: PostList,
        },
      ]}
    />
    

3.37.6

Patch Changes

  • Fix useModalForm hook reset issue after successful submit

3.37.5

Patch Changes

3.37.4

Patch Changes

  • Updated <Edit/> component's default footer buttons property wrapper with <Space/> component like `

3.37.3

Patch Changes

  • Updated <Edit/> component's default footer buttons property wrapper with <Space/> component like `

3.37.2

Patch Changes

  • Updated <Edit/> component's default footer buttons property wrapper with <Space/> component like `

3.37.1

Patch Changes

  • #2343 90b39d4f83 Thanks @aliemir! - Updated <Edit/> component's default footer buttons property wrapper with <Space/> component like `

3.37.0

Minor Changes

  • Separated styles.min.css file as antd.min.css and reset.min.css to make users able to turn off reset styles when needed.

3.36.0

Minor Changes

  • #2312 ba5646c65c Thanks @aliemir! - Separated styles.min.css file as antd.min.css and reset.min.css to make users able to turn off reset styles when needed.

3.35.4

Patch Changes

  • Upgraded react-query version to 4.

3.35.3

Patch Changes

3.35.2

Patch Changes

  • Remove data-testid props from buttons in crud components to make use of button test ids presented by @pankod/refine-ui-types package.
  • Updated @pankod/refine-antd and @pankod/refine-mui fields properties by using @pankod/refine-ui-types common fields types.

    Updated @pankod/refine-antd and @pankod/refine-mui fields tests by using @pankod/refine-ui-tests common fields tests.

    Updated @pankod/refine-ui-tests fields properties.

  • Added @pankod/refine-ui-tests and @pankod/refine-ui-types packages. Now, all of button prop types comes from @pankod/refine-ui-types package and all of button tests comes from @pankod/refine-ui-tests package.

    Thus, button types and tests are managed by @pankod/refine-ui-types package and @pankod/refine-ui-tests package.

  • Updated dependencies []:

    • @pankod/refine-ui-types@0.3.0

3.35.1

Patch Changes

  • #2216 201846c77d Thanks @aliemir! - Remove data-testid props from buttons in crud components to make use of button test ids presented by @pankod/refine-ui-types package.
  • #2216 201846c77d Thanks @aliemir! - Updated @pankod/refine-antd and @pankod/refine-mui fields properties by using @pankod/refine-ui-types common fields types.

    Updated @pankod/refine-antd and @pankod/refine-mui fields tests by using @pankod/refine-ui-tests common fields tests.

    Updated @pankod/refine-ui-tests fields properties.

  • #2216 201846c77d Thanks @aliemir! - Added @pankod/refine-ui-tests and @pankod/refine-ui-types packages. Now, all of button prop types comes from @pankod/refine-ui-types package and all of button tests comes from @pankod/refine-ui-tests package.

    Thus, button types and tests are managed by @pankod/refine-ui-types package and @pankod/refine-ui-tests package.

  • Updated dependencies [201846c77d]:

    • @pankod/refine-ui-types@0.2.0

3.35.0

Minor Changes

  • Add React@18 support 🚀

Patch Changes

  • Fixed isMobile control in Sider component detecting desktop dimensions as mobile on route changes

3.34.0

Minor Changes

Patch Changes

  • #2255 b56f43529f Thanks @omeraplak! - Fixed isMobile control in Sider component detecting desktop dimensions as mobile on route changes

3.33.2

Patch Changes

  • Updated console.warn's to trigger once.

3.33.1

Patch Changes

3.33.0

Minor Changes

  • All of the refine packages have dependencies on the @pankod/refine-core package. So far we have managed these dependencies with peerDependencies + dependencies but this causes issues like #2183. (having more than one @pankod/refine-core version in node_modules and creating different instances)

    Managing as peerDependencies + devDependencies seems like the best way for now to avoid such issues.

3.32.0

Minor Changes

  • #2217 b4aae00f77 Thanks @omeraplak! - All of the refine packages have dependencies on the @pankod/refine-core package. So far we have managed these dependencies with peerDependencies + dependencies but this causes issues like #2183. (having more than one @pankod/refine-core version in node_modules and creating different instances)

    Managing as peerDependencies + devDependencies seems like the best way for now to avoid such issues.

3.31.0

Minor Changes

  • BREAKING Updated useStepsForm prop isBackValidate with default false instead of true to achieve consistency between packages (@pankod/refine-react-hook-form).

Patch Changes

  • Fix useModal hook doesn't return modalProps

3.30.0

Minor Changes

  • #2206 874b05af37 Thanks @aliemir! - BREAKING Updated useStepsForm prop isBackValidate with default false instead of true to achieve consistency between packages (@pankod/refine-react-hook-form).

Patch Changes

3.29.0

Minor Changes

  • Added defaultSetFilterBehavior prop to useTable and useSimpleList hooks. Return setFilters and setSorter from useTable of @pankod/refine-core.

    This feature will let @pankod/refine-antd users to set filters manually and change filter setter logic (defaults to merge).

Patch Changes

  • Updated dependencies []:
    • @pankod/refine-core@3.44.0

3.28.0

Minor Changes

  • #2168 a9196ffe2d Thanks @aliemir! - Added defaultSetFilterBehavior prop to useTable and useSimpleList hooks. Return setFilters and setSorter from useTable of @pankod/refine-core.

    This feature will let @pankod/refine-antd users to set filters manually and change filter setter logic (defaults to merge).

Patch Changes

  • Updated dependencies [4d5f6b25e5]:
    • @pankod/refine-core@3.43.0

3.27.6

Patch Changes

  • Fixed the Unhandled Promise error on console for useForm with failed requests (Resolves #2156).

    This fix only catches the errors triggered by submitting the form, requests by invoking onFinish function should be handled by the user.

3.27.5

Patch Changes

  • #2161 8490f3c38f Thanks @aliemir! - Fixed the Unhandled Promise error on console for useForm with failed requests (Resolves #2156).

    This fix only catches the errors triggered by submitting the form, requests by invoking onFinish function should be handled by the user.

3.27.4

Patch Changes

  • Removed unused cases in useFileUploadState and fixed conflicting type in antd#UploadFileStatus interface.

  • Updated dependencies []:

    • @pankod/refine-core@3.40.0

3.27.3

Patch Changes

  • #2135 cf90324cb4 Thanks @aliemir! - Removed unused cases in useFileUploadState and fixed conflicting type in antd#UploadFileStatus interface.

  • Updated dependencies [868bb943ad]:

    • @pankod/refine-core@3.39.0

3.27.2

Patch Changes

  • Add dataProviderName property for <RefreshButton> and <DeleteButton> in <Edit> and <Show> CRUD components - #2096

  • Updated dependencies []:

    • @pankod/refine-core@3.38.0

3.27.1

Patch Changes

  • #2106 10a20d8714 Thanks @omeraplak! - Add dataProviderName property for <RefreshButton> and <DeleteButton> in <Edit> and <Show> CRUD components - #2096

  • Updated dependencies [9d77c63a92, 98966b586f]:

    • @pankod/refine-core@3.37.0

3.27.0

Minor Changes

  • Updated useTable hook with hasPagination to enable/disable pagination.

    Implementation

    Updated the useTable accordingly to the changes in the useTable of @pankod/refine-core. hasPagination property is being send directly to the useTable of @pankod/refine-core to disable pagination.

    Use Cases

    In some data providers, some of the resources might not support pagination which was not supported prior to these changes. To handle the pagination on the client-side or to disable completely, users can set hasPagination to false.

Patch Changes

  • Fixed <Link> usage in packages.

    - <Link href={route} to={route}>
    -    {label}
    - </Link>
    + <Link to={route}>{label}</Link>
    

    We used to have to pass href and to for Next.js and React applications, now we just need to pass to. refine router providers handle for us.

  • Updated dependencies []:

    • @pankod/refine-core@3.36.0

3.26.0

Minor Changes

  • #2050 635cfe9fdb Thanks @ozkalai! - Updated useTable hook with hasPagination to enable/disable pagination.

    Implementation

    Updated the useTable accordingly to the changes in the useTable of @pankod/refine-core. hasPagination property is being send directly to the useTable of @pankod/refine-core to disable pagination.

    Use Cases

    In some data providers, some of the resources might not support pagination which was not supported prior to these changes. To handle the pagination on the client-side or to disable completely, users can set hasPagination to false.

Patch Changes

  • #2061 0237725cf3 Thanks @salihozdemir! - Fixed <Link> usage in packages.

    - <Link href={route} to={route}>
    -    {label}
    - </Link>
    + <Link to={route}>{label}</Link>
    

    We used to have to pass href and to for Next.js and React applications, now we just need to pass to. refine router providers handle for us.

  • Updated dependencies [ecde34a9b3, 635cfe9fdb]:

    • @pankod/refine-core@3.35.0

3.25.10

Patch Changes

  • Updated the id type to BaseKey for isEditing and editButtonProps properties in useEditableTable hook.

  • Updated dependencies []:

    • @pankod/refine-core@3.34.2

3.25.9

Patch Changes

  • #2052 cbb09e5b22 Thanks @omeraplak! - Updated the id type to BaseKey for isEditing and editButtonProps properties in useEditableTable hook.

  • Updated dependencies [0338ce9d6b]:

    • @pankod/refine-core@3.34.1

3.25.8

Patch Changes

  • Fix missing behavior for dashboard item in deprecated useMenu

  • Updated dependencies []:

    • @pankod/refine-core@3.32.0

3.25.7

Patch Changes

3.25.6

Patch Changes

  • Update keys in <Sider/> component to use route
  • Deprecated useMenu from @pankod/refine-antd and replaced with the useMenu from @pankod/refine-core

  • Updated dependencies []:

    • @pankod/refine-core@3.30.0

3.25.6

Patch Changes

3.25.5

Patch Changes

3.25.4

Patch Changes

  • @pankod/refine-antd Pagination with Next.js Links breaks the app

  • Updated dependencies []:

    • @pankod/refine-core@3.29.0

3.25.3

Patch Changes

  • @pankod/refine-antd Pagination with Next.js Links breaks the app

  • Updated dependencies []:

    • @pankod/refine-core@3.28.0

3.25.2

Patch Changes

  • @pankod/refine-antd Pagination with Next.js Links breaks the app

  • Updated dependencies []:

    • @pankod/refine-core@3.27.0

3.25.1

Patch Changes

3.23.2

Patch Changes

  • #1873 2deb19babf Thanks @aliemir! - Removed dummy default values from internal contexts. Updated contexts:

    • Auth
    • Access Control
    • Notification
    • Translation (i18n)
    • unsavedWarn

    BREAKING: useGetLocale hook now can return undefined instead of a fallback value of en in cases of i18nProvider being undefined.

  • Updated dependencies [2deb19babf]:

    • @pankod/refine-core@3.23.2

3.23.1

Patch Changes

3.23.0

Minor Changes

Patch Changes

  • Updated dependencies [31850119e0]:
    • @pankod/refine-core@3.23.0