@snack-uikit/list 0.14.3 → 0.14.4-preview-2abd8357.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/README.md
CHANGED
|
@@ -81,6 +81,7 @@
|
|
|
81
81
|
| scroll | `boolean` | - | Включить ли скролл для основной части списка |
|
|
82
82
|
| scrollRef | `RefObject<HTMLElement>` | - | Ссылка на элемент, обозначающий самый конец прокручиваемого списка |
|
|
83
83
|
| scrollContainerRef | `RefObject<HTMLElement>` | - | Ссылка на контейнер, который скроллится |
|
|
84
|
+
| onScroll | `(event?: Event) => void` | - | Колбек на скролл прокручиваемого списка |
|
|
84
85
|
| dataFiltered | `boolean` | - | |
|
|
85
86
|
| dataError | `boolean` | - | |
|
|
86
87
|
| noDataState | `EmptyStateProps` | - | Экран при отстутствии данных |
|
|
@@ -108,6 +109,7 @@
|
|
|
108
109
|
| scroll | `boolean` | - | Включить ли скролл для основной части списка |
|
|
109
110
|
| scrollRef | `RefObject<HTMLElement>` | - | Ссылка на элемент, обозначающий самый конец прокручиваемого списка |
|
|
110
111
|
| scrollContainerRef | `RefObject<HTMLElement>` | - | Ссылка на контейнер, который скроллится |
|
|
112
|
+
| onScroll | `(event?: Event) => void` | - | Колбек на скролл прокручиваемого списка |
|
|
111
113
|
| dataFiltered | `boolean` | - | |
|
|
112
114
|
| dataError | `boolean` | - | |
|
|
113
115
|
| noDataState | `EmptyStateProps` | - | Экран при отстутствии данных |
|
|
@@ -21,7 +21,7 @@ import { useNewListContext } from '../contexts';
|
|
|
21
21
|
import commonStyles from '../styles.module.css';
|
|
22
22
|
import styles from './styles.module.css';
|
|
23
23
|
export const ListPrivate = forwardRef((_a, ref) => {
|
|
24
|
-
var { items, pinTop, pinBottom, onKeyDown, onBlur, onFocus, tabIndex, active, scroll, nested, search, searchItem, scrollRef, scrollContainerRef, footer, loading, limitedScrollHeight, className, noDataState, noResultsState, errorDataState, dataError, dataFiltered } = _a, props = __rest(_a, ["items", "pinTop", "pinBottom", "onKeyDown", "onBlur", "onFocus", "tabIndex", "active", "scroll", "nested", "search", "searchItem", "scrollRef", "scrollContainerRef", "footer", "loading", "limitedScrollHeight", "className", "noDataState", "noResultsState", "errorDataState", "dataError", "dataFiltered"]);
|
|
24
|
+
var { items, pinTop, pinBottom, onKeyDown, onBlur, onFocus, tabIndex, active, scroll, nested, search, searchItem, scrollRef, scrollContainerRef, onScroll, footer, loading, limitedScrollHeight, className, noDataState, noResultsState, errorDataState, dataError, dataFiltered } = _a, props = __rest(_a, ["items", "pinTop", "pinBottom", "onKeyDown", "onBlur", "onFocus", "tabIndex", "active", "scroll", "nested", "search", "searchItem", "scrollRef", "scrollContainerRef", "onScroll", "footer", "loading", "limitedScrollHeight", "className", "noDataState", "noResultsState", "errorDataState", "dataError", "dataFiltered"]);
|
|
25
25
|
const { size = 's' } = useNewListContext();
|
|
26
26
|
const itemsJSX = useRenderItems(items);
|
|
27
27
|
const itemsPinTopJSX = useRenderItems(pinTop);
|
|
@@ -34,7 +34,7 @@ export const ListPrivate = forwardRef((_a, ref) => {
|
|
|
34
34
|
[commonStyles.scrollContainerS]: scroll && limitedScrollHeight && size === 's',
|
|
35
35
|
[commonStyles.scrollContainerM]: scroll && limitedScrollHeight && size === 'm',
|
|
36
36
|
[commonStyles.scrollContainerL]: scroll && limitedScrollHeight && size === 'l',
|
|
37
|
-
}), barHideStrategy: 'never', size: size === 's' ? 's' : 'm', ref: scrollContainerRef, children: [content, _jsx("div", { className: styles.scrollStub, ref: scrollRef })] })) : (_jsx(_Fragment, { children: content })), Number(pinBottom === null || pinBottom === void 0 ? void 0 : pinBottom.length) > 0 && _jsx(PinBottomGroupItem, { children: itemsPinBottomJSX }), footer && (_jsx("div", { className: styles.footer, onFocus: e => e.stopPropagation(), children: footer }))] })));
|
|
37
|
+
}), barHideStrategy: 'never', size: size === 's' ? 's' : 'm', ref: scrollContainerRef, onScroll: onScroll, children: [content, _jsx("div", { className: styles.scrollStub, ref: scrollRef })] })) : (_jsx(_Fragment, { children: content })), Number(pinBottom === null || pinBottom === void 0 ? void 0 : pinBottom.length) > 0 && _jsx(PinBottomGroupItem, { children: itemsPinBottomJSX }), footer && (_jsx("div", { className: styles.footer, onFocus: e => e.stopPropagation(), children: footer }))] })));
|
|
38
38
|
if (!nested) {
|
|
39
39
|
return listJSX;
|
|
40
40
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
|
+
import { ScrollProps as OriginalScrollProps } from '@snack-uikit/scroll';
|
|
2
3
|
export type SearchState = {
|
|
3
4
|
placeholder?: string;
|
|
4
5
|
loading?: boolean;
|
|
@@ -12,4 +13,6 @@ export type ScrollProps = {
|
|
|
12
13
|
scrollRef?: RefObject<HTMLElement>;
|
|
13
14
|
/** Ссылка на контейнер, который скроллится */
|
|
14
15
|
scrollContainerRef?: RefObject<HTMLElement>;
|
|
16
|
+
/** Колбек на скролл прокручиваемого списка */
|
|
17
|
+
onScroll?: OriginalScrollProps['onScroll'];
|
|
15
18
|
};
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"title": "List",
|
|
7
|
-
"version": "0.14.
|
|
7
|
+
"version": "0.14.4-preview-2abd8357.0",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"*.css",
|
|
10
10
|
"*.woff",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"@snack-uikit/locale": "*"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "07f68b60d3d94bbadc0d70b6f191e8316a90cedc"
|
|
53
53
|
}
|
|
@@ -29,6 +29,7 @@ export const ListPrivate = forwardRef(
|
|
|
29
29
|
searchItem,
|
|
30
30
|
scrollRef,
|
|
31
31
|
scrollContainerRef,
|
|
32
|
+
onScroll,
|
|
32
33
|
footer,
|
|
33
34
|
loading,
|
|
34
35
|
limitedScrollHeight,
|
|
@@ -116,6 +117,7 @@ export const ListPrivate = forwardRef(
|
|
|
116
117
|
barHideStrategy='never'
|
|
117
118
|
size={size === 's' ? 's' : 'm'}
|
|
118
119
|
ref={scrollContainerRef}
|
|
120
|
+
onScroll={onScroll}
|
|
119
121
|
>
|
|
120
122
|
{content}
|
|
121
123
|
|
package/src/types.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
2
|
|
|
3
|
+
import { ScrollProps as OriginalScrollProps } from '@snack-uikit/scroll';
|
|
4
|
+
|
|
3
5
|
export type SearchState = {
|
|
4
6
|
placeholder?: string;
|
|
5
7
|
loading?: boolean;
|
|
@@ -14,4 +16,6 @@ export type ScrollProps = {
|
|
|
14
16
|
scrollRef?: RefObject<HTMLElement>;
|
|
15
17
|
/** Ссылка на контейнер, который скроллится */
|
|
16
18
|
scrollContainerRef?: RefObject<HTMLElement>;
|
|
19
|
+
/** Колбек на скролл прокручиваемого списка */
|
|
20
|
+
onScroll?: OriginalScrollProps['onScroll'];
|
|
17
21
|
};
|