@refinedev/antd 5.18.1 → 5.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/README.md +28 -62
- package/dist/components/themedLayoutV2/sider/index.d.ts.map +1 -1
- package/dist/contexts/themedLayoutContext/IThemedLayoutContext.d.ts +4 -4
- package/dist/contexts/themedLayoutContext/IThemedLayoutContext.d.ts.map +1 -1
- package/dist/contexts/themedLayoutContext/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useSiderVisible/index.d.ts +9 -2
- package/dist/hooks/useSiderVisible/index.d.ts.map +1 -1
- package/dist/hooks/useThemedLayoutContext/index.d.ts +4 -0
- package/dist/hooks/useThemedLayoutContext/index.d.ts.map +1 -0
- package/dist/iife/index.js +6 -6
- package/dist/iife/index.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/themedLayoutV2/sider/index.tsx +21 -24
- package/src/contexts/themedLayoutContext/IThemedLayoutContext.ts +4 -4
- package/src/contexts/themedLayoutContext/index.tsx +10 -8
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useSiderVisible/index.ts +17 -10
- package/src/hooks/useThemedLayoutContext/index.ts +22 -0
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,32 @@
|
|
1
1
|
# @pankod/refine-antd
|
2
2
|
|
3
|
+
## 5.19.0
|
4
|
+
|
5
|
+
### Minor Changes
|
6
|
+
|
7
|
+
- [#4404](https://github.com/refinedev/refine/pull/4404) [`f67967e8c87`](https://github.com/refinedev/refine/commit/f67967e8c871b2252b4c1b827de3656bf153d1ee) Thanks [@salihozdemir](https://github.com/salihozdemir)! - refactor: fix name and state inconsistency in `<ThemedLayoutV2>`
|
8
|
+
|
9
|
+
`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.
|
10
|
+
|
11
|
+
Updated `Sider` and `HamburgerMenu` components using `useThemedLayoutContext`.
|
12
|
+
|
13
|
+
```tsx
|
14
|
+
import { useThemedLayoutContext } from "@refinedev/antd";
|
15
|
+
|
16
|
+
const {
|
17
|
+
siderCollapsed,
|
18
|
+
setSiderCollapsed,
|
19
|
+
mobileSiderOpen,
|
20
|
+
setMobileSiderOpen,
|
21
|
+
} = useThemedLayoutContext();
|
22
|
+
```
|
23
|
+
|
24
|
+
## 5.18.2
|
25
|
+
|
26
|
+
### Patch Changes
|
27
|
+
|
28
|
+
- [#4316](https://github.com/refinedev/refine/pull/4316) [`4690c627e05`](https://github.com/refinedev/refine/commit/4690c627e053a7e35eb8bcb1bfca808308bfa89d) Thanks [@yildirayunlu](https://github.com/yildirayunlu)! - fix: fixed `className` for easier selection of all buttons and titles of CRUD components
|
29
|
+
|
3
30
|
## 5.18.1
|
4
31
|
|
5
32
|
### Patch Changes
|
package/README.md
CHANGED
@@ -12,8 +12,7 @@
|
|
12
12
|
<a href="https://discord.gg/refine">Discord</a> |
|
13
13
|
<a href="https://refine.dev/examples/">Examples</a> |
|
14
14
|
<a href="https://refine.dev/blog/">Blog</a> |
|
15
|
-
<a href="https://refine.dev/docs/">Documentation</a>
|
16
|
-
<a href="https://github.com/refinedev/refine/projects/1">Roadmap</a>
|
15
|
+
<a href="https://refine.dev/docs/">Documentation</a>
|
17
16
|
</div>
|
18
17
|
</div>
|
19
18
|
|
@@ -24,7 +23,6 @@
|
|
24
23
|
<br />
|
25
24
|
<br />
|
26
25
|
|
27
|
-
|
28
26
|
[](https://discord.gg/refine)
|
29
27
|
[](https://twitter.com/refine_dev)
|
30
28
|
|
@@ -32,12 +30,8 @@
|
|
32
30
|
|
33
31
|
</div>
|
34
32
|
|
35
|
-
|
36
33
|
<div align="center">
|
37
34
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
35
|
[](https://github.com/refinedev/awesome-refine)
|
42
36
|
[](https://codeclimate.com/github/pankod/refine/maintainability)
|
43
37
|
[](https://codeclimate.com/github/pankod/refine/test_coverage)
|
@@ -46,8 +40,6 @@
|
|
46
40
|
[](https://github.com/refinedev/refine/commits/next)
|
47
41
|
[](CODE_OF_CONDUCT.md)
|
48
42
|
|
49
|
-
|
50
|
-
|
51
43
|
</div>
|
52
44
|
|
53
45
|
<br/>
|
@@ -58,55 +50,44 @@
|
|
58
50
|
</picture>
|
59
51
|
</a>
|
60
52
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
53
|
## What is refine?
|
66
|
-
|
54
|
+
|
55
|
+
**refine** is a React-based framework for the rapid ✨ development of web applications.
|
67
56
|
It eliminates repetitive tasks demanded by **CRUD** operations and provides industry standard solutions for critical parts like **authentication**, **access control**, **routing**, **networking**, **state management**, and **i18n**.
|
68
57
|
|
69
|
-
**refine** is
|
58
|
+
**refine** is _headless by design_, thereby offering unlimited styling and customization options.
|
70
59
|
|
71
60
|
## What do you mean by "headless" ?
|
72
|
-
|
61
|
+
|
62
|
+
Instead of being a limited set of pre-styled components, **refine** is a collection of helper `hooks`, `components`, and `providers`. They are all decoupled from _UI components_ and _business logic_, so that they never keep you from customizing your _UI_ or coding your own flow.
|
73
63
|
|
74
64
|
**refine** seamlessly works with any **custom design** or **UI framework** that you favor. For convenience, it ships with ready-made integrations for [Ant Design System](https://ant.design/), [Material UI](https://mui.com/), [Mantine](https://mantine.dev/), and [Chakra UI](https://chakra-ui.com/).
|
75
65
|
|
76
66
|
## Use cases
|
77
|
-
**refine** shines on *data-intensive⚡* applications like **admin panels**, **dashboards** and **internal tools**. Thanks to the built-in **SSR support**, **refine** can also power *customer-facing* applications like **storefronts**.
|
78
|
-
|
79
|
-
You can take a look at some live examples that can be built using **refine** from scratch:
|
80
|
-
|
81
67
|
|
68
|
+
**refine** shines on _data-intensive⚡_ applications like **admin panels**, **dashboards** and **internal tools**. Thanks to the built-in **SSR support**, **refine** can also power _customer-facing_ applications like **storefronts**.
|
82
69
|
|
70
|
+
You can take a look at some live examples that can be built using **refine** from scratch:
|
83
71
|
|
84
72
|
<a href="https://s.refine.dev/readme-admin-panel" target="_blank">
|
85
73
|
<img src="https://user-images.githubusercontent.com/18739364/204285956-cc20fa11-b769-4bd5-b8f6-9c05a283ac85.gif" style="width:267px;" />
|
86
74
|
</a>
|
87
75
|
|
88
|
-
|
89
76
|
<a href="https://s.refine.dev/readme-medium-clone" target="_blank">
|
90
77
|
<img src="https://user-images.githubusercontent.com/18739364/204285047-8f24f1f4-65ea-4952-83ed-81e92cdd5b90.gif" style="width:200px;" />
|
91
78
|
</a>
|
92
79
|
|
93
|
-
|
94
80
|
<a href="https://s.refine.dev/readme-ssr-storefront" target="_blank">
|
95
81
|
<img src="https://user-images.githubusercontent.com/18739364/204285039-1ce0cb06-fbf8-4704-89c9-2e004620c9a8.gif" style="width:200px;" />
|
96
82
|
</a>
|
97
83
|
|
98
|
-
|
99
84
|
<br/>
|
100
85
|
<br/>
|
101
86
|
|
102
|
-
|
103
87
|
[👉 Refer to most popular real use case examples](https://refine.dev/examples/)
|
104
88
|
|
105
89
|
[👉 More **refine** powered different usage scenarios can be found here](https://refine.dev/docs/examples/)
|
106
90
|
|
107
|
-
|
108
|
-
|
109
|
-
|
110
91
|
## Key Features
|
111
92
|
|
112
93
|
⚙️ Zero-config, **one-minute setup** with a **single CLI command**
|
@@ -138,7 +119,7 @@ You can take a look at some live examples that can be built using **refine** fro
|
|
138
119
|
## Quick Start
|
139
120
|
|
140
121
|
The fastest way to get started with **refine** is by using the `create refine-app` project starter tool.
|
141
|
-
Run the following command to create a new **refine** project configured with
|
122
|
+
Run the following command to create a new **refine** project configured with [Ant Design System](https://ant.design/) as the default UI framework:
|
142
123
|
|
143
124
|
```
|
144
125
|
npm create refine-app@latest -- --preset refine-antd
|
@@ -154,50 +135,48 @@ npm run dev
|
|
154
135
|
|
155
136
|
Your **refine** application will be accessible at [http://localhost:3000](http://localhost:3000):
|
156
137
|
|
157
|
-
|
158
|
-
|
159
138
|
<a href="http://localhost:3000"></a>
|
160
139
|
|
161
140
|
<br/>
|
162
141
|
|
163
|
-
Let's consume a public `fake REST API` and add two resources (
|
142
|
+
Let's consume a public `fake REST API` and add two resources (_blog_posts_, _categories_) to our project. Replace the contents of `src/App.tsx` with the following code:
|
164
143
|
|
165
144
|
```tsx title="src/App.tsx"
|
166
|
-
import { Refine } from
|
145
|
+
import { Refine } from "@refinedev/core";
|
167
146
|
import {
|
168
147
|
notificationProvider,
|
169
148
|
ErrorComponent,
|
170
149
|
ThemedLayout,
|
171
|
-
} from
|
172
|
-
import routerProvider, { NavigateToResource } from
|
173
|
-
import dataProvider from
|
150
|
+
} from "@refinedev/antd";
|
151
|
+
import routerProvider, { NavigateToResource } from "@refinedev/react-router-v6";
|
152
|
+
import dataProvider from "@refinedev/simple-rest";
|
174
153
|
|
175
|
-
import { BrowserRouter, Routes, Route, Outlet } from
|
154
|
+
import { BrowserRouter, Routes, Route, Outlet } from "react-router-dom";
|
176
155
|
|
177
|
-
import { AntdInferencer } from
|
156
|
+
import { AntdInferencer } from "@refinedev/inferencer/antd";
|
178
157
|
|
179
|
-
import
|
158
|
+
import "@refinedev/antd/dist/reset.css";
|
180
159
|
|
181
160
|
const App: React.FC = () => {
|
182
161
|
return (
|
183
162
|
<BrowserRouter>
|
184
163
|
<Refine
|
185
164
|
routerProvider={routerProvider}
|
186
|
-
dataProvider={dataProvider(
|
165
|
+
dataProvider={dataProvider("https://api.fake-rest.refine.dev")}
|
187
166
|
notificationProvider={notificationProvider}
|
188
167
|
resources={[
|
189
168
|
{
|
190
|
-
name:
|
191
|
-
list:
|
192
|
-
show:
|
193
|
-
create:
|
194
|
-
edit:
|
169
|
+
name: "blog_posts",
|
170
|
+
list: "/blog-posts",
|
171
|
+
show: "/blog-posts/show/:id",
|
172
|
+
create: "/blog-posts/create",
|
173
|
+
edit: "/blog-posts/edit/:id",
|
195
174
|
meta: { canDelete: true },
|
196
175
|
},
|
197
176
|
{
|
198
|
-
name:
|
199
|
-
list:
|
200
|
-
show:
|
177
|
+
name: "categories",
|
178
|
+
list: "/categories",
|
179
|
+
show: "/categories/show/:id",
|
201
180
|
},
|
202
181
|
]}
|
203
182
|
>
|
@@ -242,12 +221,7 @@ export default App;
|
|
242
221
|
|
243
222
|
<br/>
|
244
223
|
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
🚀 Thanks to **refine Inferencer package**, it guesses the configuration to use for the `list`, `show`, `create`, and `edit` pages based on the data fetched from the API and generates the pages automatically.
|
249
|
-
|
250
|
-
|
224
|
+
🚀 Thanks to **refine Inferencer package**, it guesses the configuration to use for the `list`, `show`, `create`, and `edit` pages based on the data fetched from the API and generates the pages automatically.
|
251
225
|
|
252
226
|
Now, you should see the output as a table populated with `blog_post` & `category` data:
|
253
227
|
|
@@ -270,24 +244,16 @@ You can get the auto-generated pages codes by clicking the `Show Code` button on
|
|
270
244
|
|
271
245
|
👉 Play with interactive [Examples](https://refine.dev/docs/examples/)
|
272
246
|
|
273
|
-
## Roadmap
|
274
|
-
You can find refine's <a href="https://github.com/refinedev/refine/projects/1">Public Roadmap here!</a>
|
275
|
-
|
276
247
|
## Stargazers
|
277
248
|
|
278
249
|
[](https://github.com/refinedev/refine/stargazers)
|
279
250
|
|
280
251
|
## Contribution
|
281
252
|
|
282
|
-
|
283
|
-
|
284
|
-
[👉 Refer to contribution docs for more information](https://refine.dev/docs/contributing/#ways-to-contribute)
|
285
|
-
|
286
|
-
|
253
|
+
[👉 Refer to contribution docs for more information](https://refine.dev/docs/contributing/#ways-to-contribute)
|
287
254
|
|
288
255
|
If you have any doubts related to the project or want to discuss something, then join our [Discord Server](https://discord.gg/refine).
|
289
256
|
|
290
|
-
|
291
257
|
## Our ♥️ Contributors
|
292
258
|
|
293
259
|
<a href="https://github.com/refinedev/refine/graphs/contributors">
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/themedLayoutV2/sider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AA4B1B,OAAO,EAAE,8BAA8B,EAAE,MAAM,UAAU,CAAC;AAO1D,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,8BAA8B,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/themedLayoutV2/sider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AA4B1B,OAAO,EAAE,8BAA8B,EAAE,MAAM,UAAU,CAAC;AAO1D,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,8BAA8B,CAsTlE,CAAC"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
export interface IThemedLayoutContext {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
siderCollapsed: boolean;
|
3
|
+
setSiderCollapsed: (visible: boolean) => void;
|
4
|
+
mobileSiderOpen: boolean;
|
5
|
+
setMobileSiderOpen: (visible: boolean) => void;
|
6
6
|
}
|
7
7
|
//# sourceMappingURL=IThemedLayoutContext.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"IThemedLayoutContext.d.ts","sourceRoot":"","sources":["../../../src/contexts/themedLayoutContext/IThemedLayoutContext.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACjC,
|
1
|
+
{"version":3,"file":"IThemedLayoutContext.d.ts","sourceRoot":"","sources":["../../../src/contexts/themedLayoutContext/IThemedLayoutContext.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACjC,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C,eAAe,EAAE,OAAO,CAAC;IACzB,kBAAkB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CAClD"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/contexts/themedLayoutContext/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,eAAO,MAAM,mBAAmB,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/contexts/themedLayoutContext/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,eAAO,MAAM,mBAAmB,qCAK9B,CAAC;AAEH,eAAO,MAAM,2BAA2B,EAAE,KAAK,CAAC,EAAE,CAAC;IAC/C,QAAQ,EAAE,SAAS,CAAC;IACpB,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACnC,CAkBA,CAAC"}
|