@snack-uikit/list 0.11.1-preview-5d3667ec.0 → 0.11.1
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 +13 -0
- package/README.md +22 -61
- package/dist/components/Items/AccordionItem/AccordionItem.d.ts +4 -2
- package/dist/components/Items/AccordionItem/AccordionItem.js +18 -16
- package/dist/components/Items/BaseItem/BaseItem.d.ts +8 -4
- package/dist/components/Items/BaseItem/BaseItem.js +20 -14
- package/dist/components/Items/BaseItem/styles.module.css +20 -119
- package/dist/components/Items/GroupItem/GroupItem.d.ts +5 -1
- package/dist/components/Items/GroupItem/GroupItem.js +1 -3
- package/dist/components/Items/GroupSelectItem/GroupSelectItem.d.ts +4 -0
- package/dist/components/Items/GroupSelectItem/GroupSelectItem.js +18 -0
- package/dist/components/Items/GroupSelectItem/index.d.ts +1 -0
- package/dist/components/Items/GroupSelectItem/index.js +1 -0
- package/dist/components/Items/NextListItem/NextListItem.d.ts +6 -2
- package/dist/components/Items/NextListItem/NextListItem.js +55 -45
- package/dist/components/Items/NextListItem/constants.d.ts +2 -0
- package/dist/components/Items/NextListItem/constants.js +10 -0
- package/dist/components/Items/PinGroupItem/PinGroupItem.js +7 -3
- package/dist/components/Items/PinGroupItem/styles.module.css +26 -14
- package/dist/components/Items/SearchItem/SearchItem.d.ts +3 -1
- package/dist/components/Items/SearchItem/SearchItem.js +5 -8
- package/dist/components/Items/hooks.d.ts +11 -10
- package/dist/components/Items/hooks.js +64 -46
- package/dist/components/Items/index.d.ts +1 -5
- package/dist/components/Items/index.js +1 -5
- package/dist/components/Items/styles.module.css +33 -26
- package/dist/components/Items/types.d.ts +68 -34
- package/dist/components/Items/utils.d.ts +34 -16
- package/dist/components/Items/utils.js +135 -37
- package/dist/components/Lists/Droplist/DropList.d.ts +1 -1
- package/dist/components/Lists/Droplist/DropList.js +78 -50
- package/dist/components/Lists/List/List.d.ts +5 -9
- package/dist/components/Lists/List/List.js +61 -54
- package/dist/components/Lists/ListPrivate/ListPrivate.d.ts +6 -20
- package/dist/components/Lists/ListPrivate/ListPrivate.js +9 -8
- package/dist/components/Lists/ListPrivate/styles.module.css +1 -0
- package/dist/components/Lists/contexts/CollapseProvider.d.ts +13 -1
- package/dist/components/Lists/contexts/CollapseProvider.js +2 -0
- package/dist/components/Lists/contexts/FocusListProvider.d.ts +9 -0
- package/dist/components/Lists/contexts/FocusListProvider.js +5 -0
- package/dist/components/Lists/contexts/NewListProvider.d.ts +32 -0
- package/dist/components/Lists/contexts/{ListProvider.js → NewListProvider.js} +10 -5
- package/dist/components/Lists/contexts/SelectionProvider.d.ts +25 -15
- package/dist/components/Lists/contexts/SelectionProvider.js +17 -13
- package/dist/components/Lists/contexts/index.d.ts +3 -2
- package/dist/components/Lists/contexts/index.js +3 -2
- package/dist/components/Lists/hooks.d.ts +10 -12
- package/dist/components/Lists/hooks.js +73 -40
- package/dist/components/Lists/index.d.ts +2 -1
- package/dist/components/Lists/index.js +1 -0
- package/dist/components/Lists/types.d.ts +12 -14
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.js +1 -1
- package/dist/helperComponents/ItemContent/ItemContent.d.ts +15 -0
- package/dist/helperComponents/ItemContent/ItemContent.js +23 -0
- package/dist/helperComponents/ItemContent/index.d.ts +1 -0
- package/dist/helperComponents/ItemContent/index.js +1 -0
- package/dist/helperComponents/ItemContent/styles.module.css +117 -0
- package/dist/helperComponents/ListEmptyState/ListEmptyState.d.ts +2 -2
- package/dist/helperComponents/ListEmptyState/ListEmptyState.js +13 -4
- package/dist/helperComponents/Separator/Separator.d.ts +8 -2
- package/dist/helperComponents/Separator/Separator.js +22 -2
- package/dist/helperComponents/Separator/constants.d.ts +2 -0
- package/dist/helperComponents/Separator/constants.js +5 -0
- package/dist/helperComponents/Separator/styles.module.css +20 -1
- package/dist/helperComponents/index.d.ts +1 -0
- package/dist/helperComponents/index.js +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/types.d.ts +1 -1
- package/package.json +13 -18
- package/src/components/Items/AccordionItem/AccordionItem.tsx +24 -20
- package/src/components/Items/BaseItem/BaseItem.tsx +91 -82
- package/src/components/Items/BaseItem/styles.module.scss +19 -77
- package/src/components/Items/GroupItem/GroupItem.tsx +5 -5
- package/src/components/Items/GroupSelectItem/GroupSelectItem.tsx +44 -0
- package/src/components/Items/GroupSelectItem/index.ts +1 -0
- package/src/components/Items/NextListItem/NextListItem.tsx +88 -85
- package/src/components/Items/NextListItem/constants.ts +12 -0
- package/src/components/Items/PinGroupItem/PinGroupItem.tsx +14 -4
- package/src/components/Items/PinGroupItem/styles.module.scss +14 -14
- package/src/components/Items/SearchItem/SearchItem.tsx +6 -8
- package/src/components/Items/hooks.tsx +86 -66
- package/src/components/Items/index.ts +1 -5
- package/src/components/Items/styles.module.scss +36 -25
- package/src/components/Items/types.ts +91 -42
- package/src/components/Items/utils.ts +199 -52
- package/src/components/Lists/Droplist/DropList.tsx +155 -98
- package/src/components/Lists/List/List.tsx +129 -104
- package/src/components/Lists/ListPrivate/ListPrivate.tsx +19 -20
- package/src/components/Lists/ListPrivate/styles.module.scss +1 -0
- package/src/components/Lists/contexts/CollapseProvider.tsx +22 -0
- package/src/components/Lists/contexts/FocusListProvider.tsx +15 -0
- package/src/components/Lists/contexts/NewListProvider.tsx +54 -0
- package/src/components/Lists/contexts/SelectionProvider.tsx +56 -39
- package/src/components/Lists/contexts/index.ts +3 -2
- package/src/components/Lists/hooks.ts +124 -75
- package/src/components/Lists/index.ts +2 -2
- package/src/components/Lists/types.ts +20 -24
- package/src/components/index.ts +17 -2
- package/src/helperComponents/ItemContent/ItemContent.tsx +63 -0
- package/src/helperComponents/ItemContent/index.ts +1 -0
- package/src/helperComponents/ItemContent/styles.module.scss +78 -0
- package/src/helperComponents/ListEmptyState/ListEmptyState.tsx +26 -12
- package/src/helperComponents/Separator/Separator.tsx +49 -3
- package/src/helperComponents/Separator/constants.ts +7 -0
- package/src/helperComponents/Separator/styles.module.scss +41 -1
- package/src/helperComponents/index.ts +1 -0
- package/src/index.ts +4 -2
- package/src/types.ts +1 -1
- package/dist/components/Items/NextListItem/hooks.d.ts +0 -19
- package/dist/components/Items/NextListItem/hooks.js +0 -80
- package/dist/components/Lists/contexts/ListProvider.d.ts +0 -17
- package/dist/components/Lists/contexts/ParentListProvider.d.ts +0 -18
- package/dist/components/Lists/contexts/ParentListProvider.js +0 -12
- package/dist/hooks.d.ts +0 -5
- package/dist/hooks.js +0 -15
- package/dist/utils.d.ts +0 -30
- package/dist/utils.js +0 -115
- package/src/components/Items/NextListItem/hooks.ts +0 -105
- package/src/components/Lists/contexts/CollapseProvider.ts +0 -9
- package/src/components/Lists/contexts/ListProvider.tsx +0 -28
- package/src/components/Lists/contexts/ParentListProvider.tsx +0 -35
- package/src/hooks.ts +0 -27
- package/src/utils.ts +0 -175
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,19 @@
|
|
|
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.11.1 (2024-04-23)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **FF-01:** fix pseudo background ([ee468df](https://github.com/cloud-ru-tech/snack-uikit/commit/ee468df9494a81c7948fb20a647a87bdd0b1e980))
|
|
12
|
+
* **PDS-59:** fix group selection item in single mode ([069b191](https://github.com/cloud-ru-tech/snack-uikit/commit/069b1913a6fafc3f6ce64e779c5c43de1df7e977))
|
|
13
|
+
* **PDS-59:** upd tests ([df72712](https://github.com/cloud-ru-tech/snack-uikit/commit/df7271268ac1621316dbb98b274e3d6602515b23))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
6
19
|
# 0.11.0 (2024-04-22)
|
|
7
20
|
|
|
8
21
|
|
package/README.md
CHANGED
|
@@ -8,33 +8,30 @@
|
|
|
8
8
|
|
|
9
9
|
[//]: DOCUMENTATION_SECTION_START
|
|
10
10
|
[//]: THIS_SECTION_IS_AUTOGENERATED_PLEASE_DONT_EDIT_IT
|
|
11
|
-
##
|
|
12
|
-
Нечеткий поиск среди айтемов по полям 'content.option', 'content.caption', 'content.description', 'label'
|
|
11
|
+
## kindFlattenItems
|
|
13
12
|
### Props
|
|
14
13
|
| name | type | default value | description |
|
|
15
14
|
|------|------|---------------|-------------|
|
|
16
|
-
|
|
15
|
+
| items* | `any[]` | - | |
|
|
16
|
+
| prefix | `ItemId` | - | |
|
|
17
|
+
| parentId | `ItemId` | - | |
|
|
18
|
+
## isAccordionItem
|
|
17
19
|
### Props
|
|
18
20
|
| name | type | default value | description |
|
|
19
21
|
|------|------|---------------|-------------|
|
|
20
|
-
|
|
21
|
-
## flattenItems
|
|
22
|
-
`flattenItems`
|
|
23
|
-
|
|
24
|
-
Функция разворачивает массив айтемов в плоский список
|
|
25
|
-
## isAccordionItemProps
|
|
22
|
+
## isBaseItem
|
|
26
23
|
### Props
|
|
27
24
|
| name | type | default value | description |
|
|
28
25
|
|------|------|---------------|-------------|
|
|
29
|
-
##
|
|
26
|
+
## isGroupItem
|
|
30
27
|
### Props
|
|
31
28
|
| name | type | default value | description |
|
|
32
29
|
|------|------|---------------|-------------|
|
|
33
|
-
##
|
|
30
|
+
## isNextListItem
|
|
34
31
|
### Props
|
|
35
32
|
| name | type | default value | description |
|
|
36
33
|
|------|------|---------------|-------------|
|
|
37
|
-
##
|
|
34
|
+
## isGroupSelectItem
|
|
38
35
|
### Props
|
|
39
36
|
| name | type | default value | description |
|
|
40
37
|
|------|------|---------------|-------------|
|
|
@@ -42,8 +39,9 @@
|
|
|
42
39
|
### Props
|
|
43
40
|
| name | type | default value | description |
|
|
44
41
|
|------|------|---------------|-------------|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
42
|
+
| id* | `ItemId` | - | |
|
|
43
|
+
| items* | `ItemId[]` | - | |
|
|
44
|
+
| allChildIds* | `ItemId[]` | - | |
|
|
47
45
|
| disabled | `boolean` | - | |
|
|
48
46
|
## isSelectionSingleProps
|
|
49
47
|
### Props
|
|
@@ -57,61 +55,24 @@
|
|
|
57
55
|
### Props
|
|
58
56
|
| name | type | default value | description |
|
|
59
57
|
|------|------|---------------|-------------|
|
|
60
|
-
|
|
|
58
|
+
| triggerClassName* | `DropdownProps` | - | |
|
|
59
|
+
| onOpenChange* | `DropdownProps` | - | |
|
|
60
|
+
| open* | `DropdownProps` | - | |
|
|
61
|
+
| widthStrategy* | `DropdownProps` | - | |
|
|
62
|
+
| placement* | `DropdownProps` | - | |
|
|
63
|
+
| trigger* | `DropdownProps` | - | |
|
|
61
64
|
| children* | `ReactNode \| ({onKeyDown}) => ReactNode * Рендер функция принимает аргументы `onKeyDown` - хендлер ввода, для поддержки управления с клавиатуры` | - | Триггер для дроплиста |
|
|
62
65
|
| triggerElemRef | `RefObject<HTMLElement>` | - | Ссылка на элемент-триггер для дроплиста |
|
|
63
|
-
| open | `boolean` | - | Управляет состоянием показан/не показан. |
|
|
64
|
-
| onOpenChange | `(isOpen: boolean) => void` | - | Колбек отображения компонента. Срабатывает при изменении состояния open. |
|
|
65
|
-
| widthStrategy | enum PopoverWidthStrategy: `"auto"`, `"gte"`, `"eq"` | auto | Стратегия управления шириной контейнера поповера <br> - `auto` - соответствует ширине контента, <br> - `gte` - Great Than or Equal, равен ширине таргета или больше ее, если контент в поповере шире, <br> - `eq` - Equal, строго равен ширине таргета. |
|
|
66
|
-
| trigger | enum Trigger: `"click"`, `"hover"`, `"focusVisible"`, `"focus"`, `"hoverAndFocusVisible"`, `"hoverAndFocus"`, `"clickAndFocusVisible"` | - | Условие отображения поповера: <br> - `click` - открывать по клику <br> - `hover` - открывать по ховеру <br> - `focusVisible` - открывать по focus-visible <br> - `focus` - открывать по фокусу <br> - `hoverAndFocusVisible` - открывать по ховеру и focus-visible <br> - `hoverAndFocus` - открывать по ховеру и фокусу <br> - `clickAndFocusVisible` - открывать по клику и focus-visible |
|
|
67
|
-
| placement | enum Placement: `"left"`, `"left-start"`, `"left-end"`, `"right"`, `"right-start"`, `"right-end"`, `"top"`, `"top-start"`, `"top-end"`, `"bottom"`, `"bottom-start"`, `"bottom-end"` | top | Положение поповера относительно своего триггера (children). |
|
|
68
|
-
| className | `string` | - | CSS-класс |
|
|
69
|
-
| size | "s" \| "m" \| "l" | - | Размер списка |
|
|
70
|
-
| pinTop | `ItemProps[]` | - | Элементы списка, закрепленные сверху |
|
|
71
|
-
| pinBottom | `ItemProps[]` | - | Элементы списка, закрепленные снизу |
|
|
72
|
-
| footer | `ReactNode ;` | - | Кастомизируемый элемент в конце списка |
|
|
73
|
-
| footerActiveElementsRefs | `RefObject<HTMLElement>[]` | - | Список ссылок на кастомные элементы, помещенные в специальную секцию внизу списка |
|
|
74
|
-
| search | `SearchState` | - | Настройки поисковой строки |
|
|
75
|
-
| collapse | `CollapseState` | {} | Настройки раскрытия элементов |
|
|
76
|
-
| loading | `boolean` | - | Флаг, отвещающий за состояние загрузки списка |
|
|
77
|
-
| selection | `SelectionSingleState \| SelectionMultipleState` | - | |
|
|
78
|
-
| marker | `boolean` | - | Отображать ли маркер у выбранного жлемента списка |
|
|
79
|
-
| scroll | `boolean` | - | Включить ли скролл для основной части списка |
|
|
80
|
-
| scrollRef | `RefObject<HTMLElement>` | - | Ссылка на элемент, обозначающий самый конец прокручиваемого списка |
|
|
81
|
-
| scrollContainerRef | `RefObject<HTMLElement>` | - | Ссылка на контейнер, который скроллится |
|
|
82
|
-
| dataFiltered | `boolean` | - | |
|
|
83
|
-
| dataError | `boolean` | - | |
|
|
84
|
-
| noDataState | `EmptyStateProps` | - | Экран при отстутствии данных |
|
|
85
|
-
| noResultsState | `EmptyStateProps` | - | Экран при отстутствии результатов поиска или фильтров |
|
|
86
|
-
| errorDataState | `EmptyStateProps` | - | Экран при ошибке запроса |
|
|
87
66
|
## List
|
|
88
67
|
### Props
|
|
89
68
|
| name | type | default value | description |
|
|
90
69
|
|------|------|---------------|-------------|
|
|
91
|
-
| items* | `ItemProps[]` | - | Основные элементы списка |
|
|
92
|
-
| pinTop | `ItemProps[]` | - | Элементы списка, закрепленные сверху |
|
|
93
|
-
| pinBottom | `ItemProps[]` | - | Элементы списка, закрепленные снизу |
|
|
94
|
-
| footer | `ReactNode ;` | - | Кастомизируемый элемент в конце списка |
|
|
95
|
-
| footerActiveElementsRefs | `RefObject<HTMLElement>[]` | - | Список ссылок на кастомные элементы, помещенные в специальную секцию внизу списка |
|
|
96
|
-
| search | `SearchState` | - | Настройки поисковой строки |
|
|
97
|
-
| tabIndex | `number` | - | Tab Index |
|
|
98
|
-
| collapse | `CollapseState` | {} | Настройки раскрытия элементов |
|
|
99
|
-
| className | `string` | - | CSS-класс |
|
|
100
|
-
| onKeyDown | `(e: KeyboardEvent<HTMLElement>) => void` | - | |
|
|
101
|
-
| loading | `boolean` | - | Флаг, отвещающий за состояние загрузки списка |
|
|
102
|
-
| selection | `SelectionSingleState \| SelectionMultipleState` | - | |
|
|
103
|
-
| size | "s" \| "m" \| "l" | - | Размер списка |
|
|
104
|
-
| marker | `boolean` | - | Отображать ли маркер у выбранного жлемента списка |
|
|
105
|
-
| scroll | `boolean` | - | Включить ли скролл для основной части списка |
|
|
106
|
-
| scrollRef | `RefObject<HTMLElement>` | - | Ссылка на элемент, обозначающий самый конец прокручиваемого списка |
|
|
107
|
-
| scrollContainerRef | `RefObject<HTMLElement>` | - | Ссылка на контейнер, который скроллится |
|
|
108
|
-
| dataFiltered | `boolean` | - | |
|
|
109
|
-
| dataError | `boolean` | - | |
|
|
110
|
-
| noDataState | `EmptyStateProps` | - | Экран при отстутствии данных |
|
|
111
|
-
| noResultsState | `EmptyStateProps` | - | Экран при отстутствии результатов поиска или фильтров |
|
|
112
|
-
| errorDataState | `EmptyStateProps` | - | Экран при ошибке запроса |
|
|
113
70
|
| ref | `Ref<HTMLElement>` | - | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). @see https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom |
|
|
114
71
|
| key | `Key` | - | |
|
|
72
|
+
## ItemContent
|
|
73
|
+
### Props
|
|
74
|
+
| name | type | default value | description |
|
|
75
|
+
|------|------|---------------|-------------|
|
|
115
76
|
|
|
116
77
|
|
|
117
78
|
[//]: DOCUMENTATION_SECTION_END
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { CommonFlattenProps, FlattenAccordionItem } from '../types';
|
|
2
|
+
type AccordionItemProps = Omit<FlattenAccordionItem, 'type>'> & CommonFlattenProps;
|
|
3
|
+
export declare function AccordionItem({ id, disabled, allChildIds, items, ...option }: AccordionItemProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export {};
|
|
@@ -10,29 +10,31 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { useCallback } from 'react';
|
|
13
14
|
import { ChevronDownSVG, ChevronUpSVG } from '@snack-uikit/icons';
|
|
14
15
|
import { CollapseBlockPrivate } from '../../../helperComponents';
|
|
15
|
-
import {
|
|
16
|
+
import { CollapseLevelContext, useCollapseContext, useCollapseLevelContext } from '../../Lists/contexts';
|
|
16
17
|
import { BaseItem } from '../BaseItem';
|
|
17
18
|
import { useGroupItemSelection, useRenderItems } from '../hooks';
|
|
18
19
|
export function AccordionItem(_a) {
|
|
19
|
-
var {
|
|
20
|
-
const { level = 1 } =
|
|
21
|
-
const {
|
|
22
|
-
const {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
20
|
+
var { id, disabled, allChildIds, items } = _a, option = __rest(_a, ["id", "disabled", "allChildIds", "items"]);
|
|
21
|
+
const { level = 1 } = useCollapseLevelContext();
|
|
22
|
+
const { openCollapseItems = [], toggleOpenCollapseItem } = useCollapseContext();
|
|
23
|
+
const { indeterminate, checked, handleOnSelect } = useGroupItemSelection({
|
|
24
|
+
items,
|
|
25
|
+
id,
|
|
26
|
+
disabled,
|
|
27
|
+
allChildIds,
|
|
28
|
+
});
|
|
29
|
+
const isOpen = Boolean(openCollapseItems.includes(id !== null && id !== void 0 ? id : ''));
|
|
30
|
+
const handleKeyDown = useCallback(() => {
|
|
31
|
+
toggleOpenCollapseItem === null || toggleOpenCollapseItem === void 0 ? void 0 : toggleOpenCollapseItem(id !== null && id !== void 0 ? id : '');
|
|
32
|
+
}, [id, toggleOpenCollapseItem]);
|
|
33
|
+
const itemsJSX = useRenderItems(items);
|
|
32
34
|
const handleItemClick = (e) => {
|
|
33
35
|
var _a;
|
|
34
|
-
|
|
36
|
+
toggleOpenCollapseItem === null || toggleOpenCollapseItem === void 0 ? void 0 : toggleOpenCollapseItem(id !== null && id !== void 0 ? id : '');
|
|
35
37
|
(_a = option.onClick) === null || _a === void 0 ? void 0 : _a.call(option, e);
|
|
36
38
|
};
|
|
37
|
-
return (_jsx(CollapseBlockPrivate, { header: _jsx(BaseItem, Object.assign({}, option, { id: id, disabled: disabled, expandIcon: isOpen ? _jsx(ChevronUpSVG, {}) : _jsx(ChevronDownSVG, {}), onClick: handleItemClick, isParentNode: true,
|
|
39
|
+
return (_jsx(CollapseBlockPrivate, { header: _jsx(BaseItem, Object.assign({}, option, { id: id, disabled: disabled, expandIcon: isOpen ? _jsx(ChevronUpSVG, {}) : _jsx(ChevronDownSVG, {}), onClick: handleItemClick, isParentNode: true, onOpenNestedList: handleKeyDown, checked: checked, indeterminate: indeterminate, onSelect: !disabled ? handleOnSelect : undefined })), expanded: isOpen, "data-test-id": `list__accordion-item-${id}`, children: _jsx(CollapseLevelContext.Provider, { value: { level: level + 1 }, children: itemsJSX }) }));
|
|
38
40
|
}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
type AllBaseItemProps =
|
|
1
|
+
import { KeyboardEvent, ReactNode } from 'react';
|
|
2
|
+
import { FlattenBaseItem } from '../types';
|
|
3
|
+
type AllBaseItemProps = FlattenBaseItem & {
|
|
4
|
+
expandIcon?: ReactNode;
|
|
5
|
+
open?: boolean;
|
|
4
6
|
indeterminate?: boolean;
|
|
7
|
+
checked?: boolean;
|
|
5
8
|
onSelect?(): void;
|
|
6
9
|
isParentNode?: boolean;
|
|
10
|
+
onOpenNestedList?(e?: KeyboardEvent<HTMLElement>): void;
|
|
7
11
|
};
|
|
8
|
-
export declare function BaseItem({ beforeContent, afterContent, content, onClick, onMouseDown, id, expandIcon, disabled, open, itemRef, switch: switchProp, onKeyDown, onFocus, indeterminate, onSelect, isParentNode, className, inactive, itemWrapRender, ...rest }: AllBaseItemProps): string | number | boolean | Iterable<
|
|
12
|
+
export declare function BaseItem({ beforeContent, afterContent, content, onClick, onMouseDown, id, expandIcon, disabled, open, itemRef, switch: switchProp, onKeyDown, onFocus, indeterminate, checked: checkedProp, onSelect, onOpenNestedList, isParentNode, className, inactive, itemWrapRender, ...rest }: AllBaseItemProps): string | number | boolean | Iterable<ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
9
13
|
export {};
|
|
@@ -12,38 +12,44 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import cn from 'classnames';
|
|
14
14
|
import { Checkbox, Switch } from '@snack-uikit/toggles';
|
|
15
|
-
import { TruncateString } from '@snack-uikit/truncate-string';
|
|
16
15
|
import { extractSupportProps } from '@snack-uikit/utils';
|
|
17
|
-
import {
|
|
16
|
+
import { ItemContent } from '../../../helperComponents';
|
|
17
|
+
import { useCollapseLevelContext, useFocusListContext, useNewListContext, useSelectionContext, } from '../../Lists/contexts';
|
|
18
18
|
import commonStyles from '../styles.module.css';
|
|
19
|
+
import { isContentItem } from '../utils';
|
|
19
20
|
import { CHECKBOX_SIZE_MAP } from './constants';
|
|
20
21
|
import styles from './styles.module.css';
|
|
21
22
|
export function BaseItem(_a) {
|
|
22
|
-
var _b
|
|
23
|
-
var { beforeContent, afterContent, content, onClick, onMouseDown, id, expandIcon, disabled, open, itemRef, switch: switchProp, onKeyDown, onFocus, indeterminate, onSelect, isParentNode, className, inactive, itemWrapRender } = _a, rest = __rest(_a, ["beforeContent", "afterContent", "content", "onClick", "onMouseDown", "id", "expandIcon", "disabled", "open", "itemRef", "switch", "onKeyDown", "onFocus", "indeterminate", "onSelect", "isParentNode", "className", "inactive", "itemWrapRender"]);
|
|
24
|
-
const { option, caption, description, truncate: contentTruncate } = content || {};
|
|
23
|
+
var _b;
|
|
24
|
+
var { beforeContent, afterContent, content, onClick, onMouseDown, id, expandIcon, disabled, open, itemRef, switch: switchProp, onKeyDown, onFocus, indeterminate, checked: checkedProp, onSelect, onOpenNestedList, isParentNode, className, inactive, itemWrapRender } = _a, rest = __rest(_a, ["beforeContent", "afterContent", "content", "onClick", "onMouseDown", "id", "expandIcon", "disabled", "open", "itemRef", "switch", "onKeyDown", "onFocus", "indeterminate", "checked", "onSelect", "onOpenNestedList", "isParentNode", "className", "inactive", "itemWrapRender"]);
|
|
25
25
|
const interactive = !inactive;
|
|
26
|
-
const {
|
|
27
|
-
const {
|
|
28
|
-
const {
|
|
26
|
+
const { size = 's', marker, contentRender } = useNewListContext();
|
|
27
|
+
const { level = 0 } = useCollapseLevelContext();
|
|
28
|
+
const { forceUpdateActiveItemId } = useFocusListContext();
|
|
29
29
|
const { value, onChange, mode, isSelectionSingle, isSelectionMultiple } = useSelectionContext();
|
|
30
|
-
const isChecked = isSelectionSingle ? value === id : value === null || value === void 0 ? void 0 : value.includes(id);
|
|
30
|
+
const isChecked = isSelectionSingle ? value === id : checkedProp !== null && checkedProp !== void 0 ? checkedProp : value === null || value === void 0 ? void 0 : value.includes(id !== null && id !== void 0 ? id : '');
|
|
31
31
|
const handleChange = () => {
|
|
32
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(id
|
|
32
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(id);
|
|
33
33
|
};
|
|
34
34
|
const handleItemMouseDown = (e) => {
|
|
35
35
|
if (disabled)
|
|
36
36
|
return;
|
|
37
37
|
if (interactive) {
|
|
38
|
-
parentResetActiveFocusIndex === null || parentResetActiveFocusIndex === void 0 ? void 0 : parentResetActiveFocusIndex();
|
|
39
38
|
if (!isParentNode) {
|
|
40
39
|
handleChange();
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
42
|
onMouseDown === null || onMouseDown === void 0 ? void 0 : onMouseDown(e);
|
|
43
|
+
forceUpdateActiveItemId === null || forceUpdateActiveItemId === void 0 ? void 0 : forceUpdateActiveItemId('~drop-focus');
|
|
44
44
|
};
|
|
45
45
|
const handleItemKeyDown = (e) => {
|
|
46
46
|
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
|
|
47
|
+
if (e.key === 'ArrowRight') {
|
|
48
|
+
onOpenNestedList === null || onOpenNestedList === void 0 ? void 0 : onOpenNestedList(e);
|
|
49
|
+
e.preventDefault();
|
|
50
|
+
e.stopPropagation();
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
47
53
|
if (e.code === 'Space' || e.key === 'Enter') {
|
|
48
54
|
if (isSelectionMultiple && isParentNode && onSelect) {
|
|
49
55
|
onSelect();
|
|
@@ -71,9 +77,9 @@ export function BaseItem(_a) {
|
|
|
71
77
|
e.stopPropagation();
|
|
72
78
|
};
|
|
73
79
|
const props = extractSupportProps(rest);
|
|
74
|
-
const
|
|
80
|
+
const itemJSX = (_jsx("div", { className: cn(commonStyles.itemWrapper, styles.innerWrapper, className), "data-inactive": inactive || undefined, "data-disabled": disabled || undefined, "data-variant": mode || undefined, "data-checked": (isParentNode && (indeterminate || isChecked)) || (isChecked && !switchProp) || undefined, children: _jsxs("li", { "data-type": 'outside', role: 'menuitem', "data-test-id": props['data-test-id'] || 'list__base-item_' + id, "data-checked": (isParentNode && (indeterminate || isChecked)) || (isChecked && !switchProp) || undefined, ref: itemRef, className: cn(commonStyles.listItem, styles.droplistItem), "data-size": size, onClick: onClick, onMouseDown: handleItemMouseDown, tabIndex: -1, "data-non-pointer": inactive && !onClick, "data-variant": mode || undefined, "data-open": open || undefined, onKeyDown: handleItemKeyDown, onFocus: handleItemFocus, style: { '--level': level }, children: [!switchProp && isSelectionSingle && marker && !isParentNode && interactive && (_jsx("div", { className: styles.markerContainer, "data-test-id": 'list__base-item-marker' })), !switchProp && isSelectionMultiple && interactive && (_jsx("div", { className: styles.checkbox, children: _jsx(Checkbox, { size: CHECKBOX_SIZE_MAP[size !== null && size !== void 0 ? size : 's'], disabled: disabled, tabIndex: -1, onChange: isParentNode ? handleCheckboxChange : undefined, checked: isChecked, "data-test-id": 'list__base-item-checkbox', onClick: handleCheckboxClick, indeterminate: indeterminate }) })), beforeContent && _jsx("div", { className: styles.beforeContent, children: beforeContent }), content && isContentItem(content) ? ((_b = contentRender === null || contentRender === void 0 ? void 0 : contentRender({ id, content })) !== null && _b !== void 0 ? _b : _jsx(ItemContent, Object.assign({ disabled: disabled }, content))) : (_jsxs("div", { className: styles.content, children: [" ", content, " "] })), afterContent, switchProp && interactive && (_jsx(Switch, { disabled: disabled, checked: isChecked, "data-test-id": 'list__base-item-switch' })), !switchProp && expandIcon && _jsx("span", { className: styles.expandableIcon, children: expandIcon })] }) }));
|
|
75
81
|
if (!itemWrapRender) {
|
|
76
|
-
return
|
|
82
|
+
return itemJSX;
|
|
77
83
|
}
|
|
78
|
-
return itemWrapRender(
|
|
84
|
+
return itemWrapRender(itemJSX);
|
|
79
85
|
}
|
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
.headline{
|
|
2
|
-
display:flex;
|
|
3
|
-
align-items:center;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.option{
|
|
7
|
-
overflow:hidden;
|
|
8
|
-
flex:1;
|
|
9
|
-
color:var(--sys-neutral-text-main, #33333b);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.caption{
|
|
13
|
-
overflow:hidden;
|
|
14
|
-
color:var(--sys-neutral-text-light, #868892);
|
|
15
|
-
text-overflow:ellipsis;
|
|
16
|
-
white-space:nowrap;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.description{
|
|
20
|
-
color:var(--sys-neutral-text-support, #656771);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
1
|
.checkbox{
|
|
24
2
|
display:inline-flex;
|
|
25
3
|
flex-grow:0;
|
|
@@ -41,8 +19,8 @@
|
|
|
41
19
|
color:var(--sys-neutral-text-light, #868892);
|
|
42
20
|
}
|
|
43
21
|
.beforeContent svg{
|
|
44
|
-
width:100
|
|
45
|
-
height:100
|
|
22
|
+
max-width:100%;
|
|
23
|
+
max-height:100%;
|
|
46
24
|
}
|
|
47
25
|
|
|
48
26
|
.expandableIcon{
|
|
@@ -71,13 +49,6 @@
|
|
|
71
49
|
height:100%;
|
|
72
50
|
}
|
|
73
51
|
|
|
74
|
-
.content{
|
|
75
|
-
overflow:hidden;
|
|
76
|
-
flex-grow:1;
|
|
77
|
-
flex-shrink:1;
|
|
78
|
-
box-sizing:border-box;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
52
|
.droplistItem{
|
|
82
53
|
width:100%;
|
|
83
54
|
}
|
|
@@ -88,30 +59,6 @@
|
|
|
88
59
|
gap:var(--space-drop-list-item-s-container-headline-gap, 8px);
|
|
89
60
|
height:var(--size-drop-list-item-headline, 24px);
|
|
90
61
|
}
|
|
91
|
-
.droplistItem[data-size=s] .option{
|
|
92
|
-
font-family:var(--sans-body-s-font-family, SB Sans Interface);
|
|
93
|
-
font-weight:var(--sans-body-s-font-weight, Regular);
|
|
94
|
-
line-height:var(--sans-body-s-line-height, 16px);
|
|
95
|
-
font-size:var(--sans-body-s-font-size, 12px);
|
|
96
|
-
letter-spacing:var(--sans-body-s-letter-spacing, 0.1px);
|
|
97
|
-
paragraph-spacing:var(--sans-body-s-paragraph-spacing, 6.6px);
|
|
98
|
-
}
|
|
99
|
-
.droplistItem[data-size=s] .caption{
|
|
100
|
-
font-family:var(--sans-body-s-font-family, SB Sans Interface);
|
|
101
|
-
font-weight:var(--sans-body-s-font-weight, Regular);
|
|
102
|
-
line-height:var(--sans-body-s-line-height, 16px);
|
|
103
|
-
font-size:var(--sans-body-s-font-size, 12px);
|
|
104
|
-
letter-spacing:var(--sans-body-s-letter-spacing, 0.1px);
|
|
105
|
-
paragraph-spacing:var(--sans-body-s-paragraph-spacing, 6.6px);
|
|
106
|
-
}
|
|
107
|
-
.droplistItem[data-size=s] .description{
|
|
108
|
-
font-family:var(--sans-body-s-font-family, SB Sans Interface);
|
|
109
|
-
font-weight:var(--sans-body-s-font-weight, Regular);
|
|
110
|
-
line-height:var(--sans-body-s-line-height, 16px);
|
|
111
|
-
font-size:var(--sans-body-s-font-size, 12px);
|
|
112
|
-
letter-spacing:var(--sans-body-s-letter-spacing, 0.1px);
|
|
113
|
-
paragraph-spacing:var(--sans-body-s-paragraph-spacing, 6.6px);
|
|
114
|
-
}
|
|
115
62
|
.droplistItem[data-size=m]{
|
|
116
63
|
padding-left:calc(var(--level, 0) * var(--dimension-050m, 4px) + var(--space-drop-list-item-m-container-horizontal-padding, 10px));
|
|
117
64
|
}
|
|
@@ -119,30 +66,6 @@
|
|
|
119
66
|
gap:var(--space-drop-list-item-m-container-headline-gap, 8px);
|
|
120
67
|
height:var(--size-drop-list-item-headline, 24px);
|
|
121
68
|
}
|
|
122
|
-
.droplistItem[data-size=m] .option{
|
|
123
|
-
font-family:var(--sans-body-m-font-family, SB Sans Interface);
|
|
124
|
-
font-weight:var(--sans-body-m-font-weight, Regular);
|
|
125
|
-
line-height:var(--sans-body-m-line-height, 20px);
|
|
126
|
-
font-size:var(--sans-body-m-font-size, 14px);
|
|
127
|
-
letter-spacing:var(--sans-body-m-letter-spacing, 0.1px);
|
|
128
|
-
paragraph-spacing:var(--sans-body-m-paragraph-spacing, 7.7px);
|
|
129
|
-
}
|
|
130
|
-
.droplistItem[data-size=m] .caption{
|
|
131
|
-
font-family:var(--sans-body-s-font-family, SB Sans Interface);
|
|
132
|
-
font-weight:var(--sans-body-s-font-weight, Regular);
|
|
133
|
-
line-height:var(--sans-body-s-line-height, 16px);
|
|
134
|
-
font-size:var(--sans-body-s-font-size, 12px);
|
|
135
|
-
letter-spacing:var(--sans-body-s-letter-spacing, 0.1px);
|
|
136
|
-
paragraph-spacing:var(--sans-body-s-paragraph-spacing, 6.6px);
|
|
137
|
-
}
|
|
138
|
-
.droplistItem[data-size=m] .description{
|
|
139
|
-
font-family:var(--sans-body-s-font-family, SB Sans Interface);
|
|
140
|
-
font-weight:var(--sans-body-s-font-weight, Regular);
|
|
141
|
-
line-height:var(--sans-body-s-line-height, 16px);
|
|
142
|
-
font-size:var(--sans-body-s-font-size, 12px);
|
|
143
|
-
letter-spacing:var(--sans-body-s-letter-spacing, 0.1px);
|
|
144
|
-
paragraph-spacing:var(--sans-body-s-paragraph-spacing, 6.6px);
|
|
145
|
-
}
|
|
146
69
|
.droplistItem[data-size=l]{
|
|
147
70
|
padding-left:calc(var(--level, 0) * var(--dimension-050m, 4px) + var(--space-drop-list-item-l-container-horizontal-padding, 12px));
|
|
148
71
|
}
|
|
@@ -150,62 +73,40 @@
|
|
|
150
73
|
gap:var(--space-drop-list-item-l-container-headline-gap, 8px);
|
|
151
74
|
height:var(--size-drop-list-item-headline, 24px);
|
|
152
75
|
}
|
|
153
|
-
.droplistItem[data-size=l] .option{
|
|
154
|
-
font-family:var(--sans-body-l-font-family, SB Sans Interface);
|
|
155
|
-
font-weight:var(--sans-body-l-font-weight, Regular);
|
|
156
|
-
line-height:var(--sans-body-l-line-height, 24px);
|
|
157
|
-
font-size:var(--sans-body-l-font-size, 16px);
|
|
158
|
-
letter-spacing:var(--sans-body-l-letter-spacing, 0.1px);
|
|
159
|
-
paragraph-spacing:var(--sans-body-l-paragraph-spacing, 8.8px);
|
|
160
|
-
}
|
|
161
|
-
.droplistItem[data-size=l] .caption{
|
|
162
|
-
font-family:var(--sans-body-m-font-family, SB Sans Interface);
|
|
163
|
-
font-weight:var(--sans-body-m-font-weight, Regular);
|
|
164
|
-
line-height:var(--sans-body-m-line-height, 20px);
|
|
165
|
-
font-size:var(--sans-body-m-font-size, 14px);
|
|
166
|
-
letter-spacing:var(--sans-body-m-letter-spacing, 0.1px);
|
|
167
|
-
paragraph-spacing:var(--sans-body-m-paragraph-spacing, 7.7px);
|
|
168
|
-
}
|
|
169
|
-
.droplistItem[data-size=l] .description{
|
|
170
|
-
font-family:var(--sans-body-m-font-family, SB Sans Interface);
|
|
171
|
-
font-weight:var(--sans-body-m-font-weight, Regular);
|
|
172
|
-
line-height:var(--sans-body-m-line-height, 20px);
|
|
173
|
-
font-size:var(--sans-body-m-font-size, 14px);
|
|
174
|
-
letter-spacing:var(--sans-body-m-letter-spacing, 0.1px);
|
|
175
|
-
paragraph-spacing:var(--sans-body-m-paragraph-spacing, 7.7px);
|
|
176
|
-
}
|
|
177
76
|
.droplistItem[data-non-pointer]{
|
|
178
77
|
cursor:inherit;
|
|
179
78
|
}
|
|
180
|
-
|
|
181
|
-
.
|
|
182
|
-
.droplistItem[aria-disabled] .caption,
|
|
183
|
-
.droplistItem[aria-disabled] .expandableIcon, .droplistItem[data-disabled] .option,
|
|
184
|
-
.droplistItem[data-disabled] .description,
|
|
185
|
-
.droplistItem[data-disabled] .caption,
|
|
186
|
-
.droplistItem[data-disabled] .expandableIcon{
|
|
79
|
+
|
|
80
|
+
.innerWrapper[data-disabled] .expandableIcon{
|
|
187
81
|
color:var(--sys-neutral-text-disabled, #b3b6bf);
|
|
188
82
|
}
|
|
189
|
-
.
|
|
83
|
+
.innerWrapper[data-disabled] .beforeContent{
|
|
190
84
|
opacity:var(--opacity-a064, 0.64);
|
|
191
85
|
}
|
|
192
|
-
.
|
|
86
|
+
.innerWrapper[data-disabled] .droplistItem{
|
|
87
|
+
cursor:not-allowed;
|
|
88
|
+
}
|
|
89
|
+
.innerWrapper[data-has-checked][data-variant=single]::before, .innerWrapper[data-checked][data-variant=single]::before{
|
|
193
90
|
opacity:var(--opacity-a008, 0.08);
|
|
194
91
|
background-color:var(--sys-primary-accent-default, #794ed3);
|
|
195
92
|
}
|
|
196
|
-
.
|
|
93
|
+
.innerWrapper[data-has-checked][data-variant=single]:hover::before, .innerWrapper[data-checked][data-variant=single]:hover::before{
|
|
197
94
|
opacity:var(--opacity-a016, 0.16);
|
|
198
95
|
background-color:var(--sys-primary-accent-default, #794ed3);
|
|
199
96
|
}
|
|
200
|
-
.
|
|
97
|
+
.innerWrapper[data-has-checked] .markerContainer:before, .innerWrapper[data-checked] .markerContainer:before{
|
|
201
98
|
background-color:var(--sys-primary-accent-default, #794ed3);
|
|
202
99
|
}
|
|
203
|
-
.
|
|
100
|
+
.innerWrapper[data-has-checked] .droplistItem:focus-visible[data-variant=single], .innerWrapper[data-checked] .droplistItem:focus-visible[data-variant=single]{
|
|
204
101
|
outline-color:var(--sys-primary-accent-default, #794ed3);
|
|
205
102
|
}
|
|
206
|
-
.
|
|
207
|
-
display:none;
|
|
208
|
-
}
|
|
209
|
-
.droplistItem[data-has-checked][data-disabled] .markerContainer:before, .droplistItem[data-checked][data-disabled] .markerContainer:before{
|
|
103
|
+
.innerWrapper[data-has-checked][data-disabled] .markerContainer:before, .innerWrapper[data-checked][data-disabled] .markerContainer:before{
|
|
210
104
|
background-color:var(--sys-neutral-text-disabled, #b3b6bf);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.content{
|
|
108
|
+
overflow:hidden;
|
|
109
|
+
flex-grow:1;
|
|
110
|
+
flex-shrink:1;
|
|
111
|
+
box-sizing:border-box;
|
|
211
112
|
}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FlattenGroupListItem, ItemId } from '../types';
|
|
2
|
+
type GroupItemProps = Omit<FlattenGroupListItem, 'type'> & {
|
|
3
|
+
items: ItemId[];
|
|
4
|
+
};
|
|
2
5
|
export declare function GroupItem({ label, truncate, divider, items, mode }: GroupItemProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Separator } from '../../../helperComponents';
|
|
3
|
-
import { useListContext } from '../../Lists/contexts';
|
|
4
3
|
import { useRenderItems } from '../hooks';
|
|
5
4
|
export function GroupItem({ label, truncate, divider, items, mode }) {
|
|
6
|
-
const { size } = useListContext();
|
|
7
5
|
const itemsJSX = useRenderItems(items);
|
|
8
|
-
return (_jsxs(_Fragment, { children: [_jsx(Separator, { label: label, truncate: truncate, divider: divider, mode: mode
|
|
6
|
+
return (_jsxs(_Fragment, { children: [_jsx(Separator, { label: label, truncate: truncate, divider: divider, mode: mode }), itemsJSX] }));
|
|
9
7
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CommonFlattenProps, FlattenGroupSelectListItem } from '../types';
|
|
2
|
+
type GroupSelectItemProps = Omit<FlattenGroupSelectListItem, 'type'> & CommonFlattenProps;
|
|
3
|
+
export declare function GroupSelectItem({ label, truncate, divider, items, mode, id, itemRef, allChildIds, }: GroupSelectItemProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Separator } from '../../../helperComponents';
|
|
3
|
+
import { useGroupItemSelection, useRenderItems } from '../hooks';
|
|
4
|
+
export function GroupSelectItem({ label, truncate, divider, items, mode, id, itemRef, allChildIds, }) {
|
|
5
|
+
const { indeterminate, checked, handleOnSelect } = useGroupItemSelection({
|
|
6
|
+
items,
|
|
7
|
+
id,
|
|
8
|
+
disabled: false,
|
|
9
|
+
allChildIds,
|
|
10
|
+
});
|
|
11
|
+
const itemsJSX = useRenderItems(items);
|
|
12
|
+
return (_jsxs(_Fragment, { children: [_jsx(Separator, { label: label, truncate: truncate, divider: divider, mode: mode, selectButton: {
|
|
13
|
+
indeterminate,
|
|
14
|
+
checked,
|
|
15
|
+
itemRef,
|
|
16
|
+
onClick: handleOnSelect,
|
|
17
|
+
} }), itemsJSX] }));
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './GroupSelectItem';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './GroupSelectItem';
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { CommonFlattenProps, FlattenNextListItem, ItemId } from '../types';
|
|
2
|
+
type NextListItemProps = Omit<FlattenNextListItem, 'type'> & CommonFlattenProps & {
|
|
3
|
+
focusId?: ItemId;
|
|
4
|
+
};
|
|
5
|
+
export declare function NextListItem({ items, placement, id, scroll, scrollRef, disabled, onSublistOpenChanged, allChildIds, loading, focusId, ...option }: NextListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|