@snack-uikit/table 0.14.6-preview-84a92753.0 → 0.14.6

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 CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 0.14.6 (2024-02-26)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **FF-4334:** add props for manual sort, pagination, filter; add scroll ref props ([06c57b0](https://github.com/cloud-ru-tech/snack-uikit/commit/06c57b0320f75d5e81ae1bbac0b3157cded96a5d))
12
+
13
+
14
+
15
+
16
+
6
17
  ## 0.14.5 (2024-02-23)
7
18
 
8
19
  ### Only dependencies have been changed
@@ -11,15 +11,15 @@ var __rest = (this && this.__rest) || function (s, e) {
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { useCallback, useMemo, useState } from 'react';
14
- import { useUncontrolledProp } from 'uncontrollable';
15
14
  import { STATUS_APPEARANCE } from '../../helperComponents';
16
15
  import { Table } from '../Table';
16
+ import { useStateControl } from '../Table/hooks/useStateControl';
17
17
  import { DEFAULT_PAGINATION_LIMIT } from './constants';
18
18
  import { onSearchDebounced } from './utils';
19
19
  export function ServerTable(_a) {
20
20
  // добавить uncontrolledState
21
21
  var { items, total = DEFAULT_PAGINATION_LIMIT, limit = DEFAULT_PAGINATION_LIMIT, offset = 0, onChangePage, search: searchProp, pagination, columnFilters, manualSorting = true, manualPagination = true, manualFiltering = true } = _a, rest = __rest(_a, ["items", "total", "limit", "offset", "onChangePage", "search", "pagination", "columnFilters", "manualSorting", "manualPagination", "manualFiltering"]);
22
- const [search, setSearch] = useUncontrolledProp(searchProp === null || searchProp === void 0 ? void 0 : searchProp.state, searchProp === null || searchProp === void 0 ? void 0 : searchProp.initialValue, searchProp === null || searchProp === void 0 ? void 0 : searchProp.onChange);
22
+ const { state: search, onStateChange: setSearch } = useStateControl(searchProp, '');
23
23
  const [tempSearch, setTempSearch] = useState(search || '');
24
24
  const handleSearch = useCallback((newValue) => {
25
25
  setTempSearch(newValue);
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "title": "Table",
7
- "version": "0.14.6-preview-84a92753.0",
7
+ "version": "0.14.6",
8
8
  "sideEffects": [
9
9
  "*.css",
10
10
  "*.woff",
@@ -33,18 +33,18 @@
33
33
  "scripts": {},
34
34
  "dependencies": {
35
35
  "@snack-uikit/button": "0.16.1",
36
- "@snack-uikit/chips": "0.11.10-preview-84a92753.0",
36
+ "@snack-uikit/chips": "0.12.0",
37
37
  "@snack-uikit/icon-predefined": "0.4.2",
38
38
  "@snack-uikit/icons": "0.20.1",
39
- "@snack-uikit/info-block": "0.2.1-preview-84a92753.0",
40
- "@snack-uikit/list": "0.4.1-preview-84a92753.0",
39
+ "@snack-uikit/info-block": "0.3.0",
40
+ "@snack-uikit/list": "0.4.1",
41
41
  "@snack-uikit/pagination": "0.6.4",
42
42
  "@snack-uikit/scroll": "0.5.2",
43
43
  "@snack-uikit/skeleton": "0.3.3",
44
44
  "@snack-uikit/tag": "0.8.0",
45
45
  "@snack-uikit/toggles": "0.9.6",
46
- "@snack-uikit/toolbar": "0.7.14-preview-84a92753.0",
47
- "@snack-uikit/truncate-string": "0.4.9-preview-84a92753.0",
46
+ "@snack-uikit/toolbar": "0.7.14",
47
+ "@snack-uikit/truncate-string": "0.4.9",
48
48
  "@snack-uikit/typography": "0.6.1",
49
49
  "@snack-uikit/utils": "3.2.0",
50
50
  "@tanstack/match-sorter-utils": "8.11.8",
@@ -58,5 +58,5 @@
58
58
  "peerDependencies": {
59
59
  "@snack-uikit/locale": "*"
60
60
  },
61
- "gitHead": "0080e56c820f760ce8bbfc2ce2cb6f131571c265"
61
+ "gitHead": "eca9622fe5915bb18e60c4eb7a195ebc04f19f9c"
62
62
  }
@@ -1,9 +1,9 @@
1
1
  import { useCallback, useMemo, useState } from 'react';
2
- import { useUncontrolledProp } from 'uncontrollable';
3
2
 
4
3
  import { STATUS_APPEARANCE } from '../../helperComponents';
5
4
  import { PaginationState } from '../../types';
6
5
  import { Table } from '../Table';
6
+ import { useStateControl } from '../Table/hooks/useStateControl';
7
7
  import { ServerTableProps } from '../types';
8
8
  import { DEFAULT_PAGINATION_LIMIT } from './constants';
9
9
  import { onSearchDebounced } from './utils';
@@ -24,11 +24,7 @@ export function ServerTable<TData extends object>({
24
24
  }: ServerTableProps<TData>) {
25
25
  // добавить uncontrolledState
26
26
 
27
- const [search, setSearch] = useUncontrolledProp<string>(
28
- searchProp?.state,
29
- searchProp?.initialValue,
30
- searchProp?.onChange,
31
- );
27
+ const { state: search, onStateChange: setSearch } = useStateControl<string>(searchProp, '');
32
28
 
33
29
  const [tempSearch, setTempSearch] = useState(search || '');
34
30