@refinedev/core 4.44.9 → 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.
Files changed (32) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/definitions/helpers/flatten-object-keys/index.d.ts +2 -0
  3. package/dist/definitions/helpers/flatten-object-keys/index.d.ts.map +1 -0
  4. package/dist/definitions/helpers/index.d.ts +2 -0
  5. package/dist/definitions/helpers/index.d.ts.map +1 -1
  6. package/dist/definitions/helpers/menu/create-tree.d.ts +1 -1
  7. package/dist/definitions/helpers/menu/create-tree.d.ts.map +1 -1
  8. package/dist/definitions/helpers/property-path-to-array/index.d.ts +2 -0
  9. package/dist/definitions/helpers/property-path-to-array/index.d.ts.map +1 -0
  10. package/dist/esm/index.js +6 -6
  11. package/dist/esm/index.js.map +1 -1
  12. package/dist/hooks/menu/useMenu.d.ts +1 -1
  13. package/dist/hooks/menu/useMenu.d.ts.map +1 -1
  14. package/dist/hooks/useSelect/index.d.ts +4 -4
  15. package/dist/hooks/useSelect/index.d.ts.map +1 -1
  16. package/dist/iife/index.js +6 -6
  17. package/dist/iife/index.js.map +1 -1
  18. package/dist/index.d.ts +2 -2
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +6 -6
  21. package/dist/index.js.map +1 -1
  22. package/dist/interfaces/index.d.ts +8 -3
  23. package/dist/interfaces/index.d.ts.map +1 -1
  24. package/package.json +1 -1
  25. package/src/definitions/helpers/flatten-object-keys/index.ts +36 -0
  26. package/src/definitions/helpers/index.ts +2 -0
  27. package/src/definitions/helpers/menu/create-tree.ts +1 -1
  28. package/src/definitions/helpers/property-path-to-array/index.ts +5 -0
  29. package/src/hooks/menu/useMenu.tsx +1 -1
  30. package/src/hooks/useSelect/index.ts +32 -24
  31. package/src/index.tsx +3 -0
  32. package/src/interfaces/index.ts +10 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,40 @@
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
+
3
38
  ## 4.44.9
4
39
 
5
40
  ### Patch Changes
@@ -0,0 +1,2 @@
1
+ export declare const flattenObjectKeys: (obj: any, prefix?: string) => Record<string, unknown>;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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,mBAAm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ACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -1,4 +1,4 @@
1
- import { IResourceItem } from "@contexts/resource";
1
+ import { IResourceItem } from "../../../contexts/resource";
2
2
  export declare type Tree = {
3
3
  item: IResourceItem;
4
4
  children: {
@@ -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,oBAAoB,CAAC;AAInD,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"}
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,2 @@
1
+ export declare const propertyPathToArray: (propertyPath: string) => (string | number)[];
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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"}