@refinedev/core 4.44.8 → 4.44.10
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 +45 -0
- package/dist/definitions/helpers/flatten-object-keys/index.d.ts +2 -0
- package/dist/definitions/helpers/flatten-object-keys/index.d.ts.map +1 -0
- package/dist/definitions/helpers/index.d.ts +2 -0
- package/dist/definitions/helpers/index.d.ts.map +1 -1
- package/dist/definitions/helpers/menu/create-tree.d.ts +1 -1
- package/dist/definitions/helpers/menu/create-tree.d.ts.map +1 -1
- package/dist/definitions/helpers/property-path-to-array/index.d.ts +2 -0
- package/dist/definitions/helpers/property-path-to-array/index.d.ts.map +1 -0
- package/dist/esm/index.js +6 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/hooks/menu/useMenu.d.ts +1 -1
- package/dist/hooks/menu/useMenu.d.ts.map +1 -1
- package/dist/hooks/useSelect/index.d.ts +4 -4
- package/dist/hooks/useSelect/index.d.ts.map +1 -1
- package/dist/iife/index.js +6 -6
- package/dist/iife/index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/interfaces/index.d.ts +8 -3
- package/dist/interfaces/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/definitions/helpers/flatten-object-keys/index.ts +36 -0
- package/src/definitions/helpers/index.ts +2 -0
- package/src/definitions/helpers/menu/create-tree.ts +1 -1
- package/src/definitions/helpers/property-path-to-array/index.ts +5 -0
- package/src/hooks/menu/useMenu.tsx +1 -1
- package/src/hooks/useSelect/index.ts +32 -24
- package/src/index.tsx +3 -0
- package/src/interfaces/index.ts +10 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
# @refinedev/core
|
|
2
2
|
|
|
3
|
+
## 4.44.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#5199](https://github.com/refinedev/refine/pull/5199) [`2b8d658a17a`](https://github.com/refinedev/refine/commit/2b8d658a17a20ae347ba92b63487418f04ec255c) Thanks [@aliemir](https://github.com/aliemir)! - Exported `BaseOption` type as successor of the deprecated `Option` type. `BaseOption` is `{ label: any; value: any; }`.
|
|
8
|
+
|
|
9
|
+
Usage of the deprecated `Option` type was correctly assuming that the `value` property of the option is of type `string`. This assumption was wrong and now the types are changed to reflect the correct values of options with the ability to change it via 4th generic type `TOption` of `useSelect` hook.
|
|
10
|
+
|
|
11
|
+
- [#5199](https://github.com/refinedev/refine/pull/5199) [`2b8d658a17a`](https://github.com/refinedev/refine/commit/2b8d658a17a20ae347ba92b63487418f04ec255c) Thanks [@aliemir](https://github.com/aliemir)! - Reverted the faulty assumption on option values of `useSelect` hook to be of type `string`. Now changed the types and the logic to reflect the correct values of options with the ability to change it via 4th generic type `TOption` of `useSelect` hook. (Reverted PR #5160)
|
|
12
|
+
|
|
13
|
+
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:
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { HttpError, useSelect } from "@refinedev/core";
|
|
17
|
+
|
|
18
|
+
type MyData = {
|
|
19
|
+
id: number;
|
|
20
|
+
title: string;
|
|
21
|
+
description: string;
|
|
22
|
+
category: { id: string };
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
type Option = { label: MyData["title"]; value: MyData["id"] }; // equals to { label: string; value: number; }
|
|
26
|
+
|
|
27
|
+
useSelect<MyData, HttpError, MyData, Option>({
|
|
28
|
+
resource: "posts",
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
- [#5194](https://github.com/refinedev/refine/pull/5194) [`9df999ca643`](https://github.com/refinedev/refine/commit/9df999ca6431fb0465c294207309fe32e58eb85f) Thanks [@fitrahfm](https://github.com/fitrahfm)! - fix: use relative path instead of path alias to import FlatTreeItem
|
|
33
|
+
|
|
34
|
+
Using path alias causes imported types being any during build/compilation process which should be TreeMenuItem[]
|
|
35
|
+
|
|
36
|
+
- [#5201](https://github.com/refinedev/refine/pull/5201) [`760cfbaaa2a`](https://github.com/refinedev/refine/commit/760cfbaaa2ac8b8c070ade1e174784358cc112b0) Thanks [@aliemir](https://github.com/aliemir)! - Exported the `flattenObjectKeys` and `propertyPathToArray` helpers from `@refinedev/core` package.
|
|
37
|
+
|
|
38
|
+
## 4.44.9
|
|
39
|
+
|
|
40
|
+
### Patch Changes
|
|
41
|
+
|
|
42
|
+
- [#5177](https://github.com/refinedev/refine/pull/5177) [`4e0f6f9a69f`](https://github.com/refinedev/refine/commit/4e0f6f9a69f7613ef9b1b249ae21d2f0dba38f57) Thanks [@aliemir](https://github.com/aliemir)! - Fixed the issue of `useList` hook requiring an empty object as prop even if there was no parameter passed to it.
|
|
43
|
+
|
|
44
|
+
- [#5132](https://github.com/refinedev/refine/pull/5132) [`f616d6ffd94`](https://github.com/refinedev/refine/commit/f616d6ffd94e0c38eea56f5850898892551231f6) Thanks [@mlukasik-dev](https://github.com/mlukasik-dev)! - fix: `useSelect`'s `optionLabel` and `optionValue` types are wrong.
|
|
45
|
+
|
|
46
|
+
- [#5160](https://github.com/refinedev/refine/pull/5160) [`9b9d5032b3a`](https://github.com/refinedev/refine/commit/9b9d5032b3ab1598eabc8e78ab2c70839929b775) Thanks [@an-tran511](https://github.com/an-tran511)! - fix: convert type of an option's `value` to `string`
|
|
47
|
+
|
|
3
48
|
## 4.44.8
|
|
4
49
|
|
|
5
50
|
### Patch Changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/definitions/helpers/flatten-object-keys/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,iBAAiB,QAAS,GAAG,6CAgCzC,CAAC"}
|
|
@@ -25,4 +25,6 @@ export { generateDefaultDocumentTitle } from "./generateDocumentTitle";
|
|
|
25
25
|
export { useUserFriendlyName } from "./useUserFriendlyName";
|
|
26
26
|
export { keys, stripUndefined } from "./keys";
|
|
27
27
|
export { KeyBuilder } from "./keys";
|
|
28
|
+
export { flattenObjectKeys } from "./flatten-object-keys";
|
|
29
|
+
export { propertyPathToArray } from "./property-path-to-array";
|
|
28
30
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/definitions/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EACH,gBAAgB,EAChB,oBAAoB,GACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,O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AAsB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EACH,gBAAgB,EAChB,oBAAoB,GACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-tree.d.ts","sourceRoot":"","sources":["../../../../src/definitions/helpers/menu/create-tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"create-tree.d.ts","sourceRoot":"","sources":["../../../../src/definitions/helpers/menu/create-tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAI3D,oBAAY,IAAI,GAAG;IACf,IAAI,EAAE,aAAa,CAAC;IACpB,QAAQ,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;CACrC,CAAC;AAEF,oBAAY,YAAY,GAAG,aAAa,GAAG;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,YAAY,EAAE,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,UAAU,cACR,aAAa,EAAE,uBAE3B,YAAY,EAqEd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/definitions/helpers/property-path-to-array/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,iBAAkB,MAAM,wBAIvD,CAAC"}
|