@commercetools-uikit/hooks 15.0.0 → 15.1.2

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.
@@ -353,7 +353,7 @@ var useDataTableSortingState = function useDataTableSortingState() {
353
353
  var useDataTableSortingState$1 = useDataTableSortingState;
354
354
 
355
355
  // NOTE: This string will be replaced on build time with the package version.
356
- var version = "15.0.0";
356
+ var version = "15.1.2";
357
357
 
358
358
  exports.useDataTableSortingState = useDataTableSortingState$1;
359
359
  exports.useFieldId = useFieldId$1;
@@ -353,7 +353,7 @@ var useDataTableSortingState = function useDataTableSortingState() {
353
353
  var useDataTableSortingState$1 = useDataTableSortingState;
354
354
 
355
355
  // NOTE: This string will be replaced on build time with the package version.
356
- var version = "15.0.0";
356
+ var version = "15.1.2";
357
357
 
358
358
  exports.useDataTableSortingState = useDataTableSortingState$1;
359
359
  exports.useFieldId = useFieldId$1;
@@ -333,6 +333,6 @@ var useDataTableSortingState = function useDataTableSortingState() {
333
333
  var useDataTableSortingState$1 = useDataTableSortingState;
334
334
 
335
335
  // NOTE: This string will be replaced on build time with the package version.
336
- var version = "15.0.0";
336
+ var version = "15.1.2";
337
337
 
338
338
  export { useDataTableSortingState$1 as useDataTableSortingState, useFieldId$1 as useFieldId, usePaginationState$1 as usePaginationState, usePrevious$1 as usePrevious, useRowSelection$1 as useRowSelection, useSorting$1 as useSorting, useToggleState$1 as useToggleState, version };
@@ -1,12 +1,11 @@
1
1
  /// <reference types="lodash" />
2
+ import sortBy from 'lodash/sortBy';
2
3
  interface TItem {
3
4
  id: string;
4
5
  }
5
6
  declare type TSortDirection = 'asc' | 'desc';
6
- declare const useSorting: <Item extends TItem = TItem>(items: Item[], field?: string | undefined, sortDirection?: TSortDirection | undefined, sortingFunction?: {
7
- <T>(collection: import("lodash").List<T> | null | undefined, ...iteratees: import("lodash").Many<import("lodash").ListIteratee<T>>[]): T[];
8
- <T_1 extends object>(collection: T_1 | null | undefined, ...iteratees: import("lodash").Many<import("lodash").ObjectIteratee<T_1>>[]): T_1[keyof T_1][];
9
- } | undefined) => {
7
+ declare type TSortingFn = typeof sortBy;
8
+ declare const useSorting: <Item extends TItem = TItem>(items: Item[], field?: string, sortDirection?: TSortDirection, sortingFunction?: TSortingFn) => {
10
9
  items: Item[];
11
10
  sortedBy: string | undefined;
12
11
  sortDirection: TSortDirection | undefined;
@@ -1,2 +1,2 @@
1
- declare const useToggleState: (defaultValue?: boolean | undefined) => [boolean, (forceIsToggled?: boolean | undefined) => void];
1
+ declare const useToggleState: (defaultValue?: boolean) => [boolean, (forceIsToggled?: boolean) => void];
2
2
  export default useToggleState;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercetools-uikit/hooks",
3
3
  "description": "A collection of React hooks used across some of the UI-Kit components.",
4
- "version": "15.0.0",
4
+ "version": "15.1.2",
5
5
  "bugs": "https://github.com/commercetools/ui-kit/issues",
6
6
  "repository": {
7
7
  "type": "git",
@@ -21,7 +21,7 @@
21
21
  "dependencies": {
22
22
  "@babel/runtime": "^7.17.2",
23
23
  "@babel/runtime-corejs3": "^7.17.2",
24
- "@commercetools-uikit/utils": "15.0.0",
24
+ "@commercetools-uikit/utils": "15.1.2",
25
25
  "lodash": "4.17.21"
26
26
  },
27
27
  "devDependencies": {