@cloud-ru/ds-list 2.1.4-preview-a0540d7f.0 → 2.1.5

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,16 @@
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
+ ## 2.1.5 (2026-09-18)
7
+
8
+ **Note:** Version bump only for package @ds/list
9
+
10
+ ## 2.1.4 (2026-09-14)
11
+
12
+ ### Bug Fixes
13
+
14
+ - **FF-9049:** guard mobile droplist groups without items ([bdbe572](https://github.com/cloud-ru-tech/snack-v2/commit/bdbe572c9142739b58e480d3a23fa5350f2d757f))
15
+
6
16
  ## 2.1.3 (2026-09-10)
7
17
 
8
18
  **Note:** Version bump only for package @ds/list
@@ -174,7 +174,7 @@ export type DroplistImplProps = DesktopDroplistProps & DroplistMobileSlots;
174
174
  * @internal Props mobile-реализации (`BottomSheet`): реализация дроплиста без popover-пропов
175
175
  * + mobile-слоты.
176
176
  */
177
- export type MobileDroplistProps = Omit<DesktopDroplistProps, 'trigger' | 'placement' | 'widthStrategy' | 'triggerElemRef' | 'triggerClassName'> & Pick<BottomSheetProps, 'snapPoints'> & DroplistMobileSlots;
177
+ export type MobileDroplistProps = Omit<DesktopDroplistProps, 'trigger' | 'placement' | 'widthStrategy' | 'triggerElemRef' | 'listRef' | 'triggerClassName'> & Pick<BottomSheetProps, 'snapPoints'> & DroplistMobileSlots;
178
178
  export type ListPrivateProps = Omit<ListImplProps, 'pinTop' | 'pinBottom' | 'items' | 'hasListInFocusChain' | 'onItemsReorder' | 'virtualized'> & {
179
179
  nested?: boolean;
180
180
  active?: boolean;
@@ -6,4 +6,4 @@ import { MobileDroplistProps } from '../../components/Lists/types';
6
6
  * вложенного списка, в шапке появляется его заголовок и кнопка «назад». Internal — наружу не реэкспортится;
7
7
  * рендерится адаптивным `Droplist` на `layoutType='mobile'`.
8
8
  */
9
- export declare function MobileDroplist({ items, selection, open: openProp, onOpenChange, children, search, label, actionButton, slotAfterTitle, onBackButtonClick, virtualized, closeDroplistOnItemClick, scroll, container, closeOnPopstate, size, snapPoints, footer, onItemsReorder, listRef, ...rest }: MobileDroplistProps): import("react/jsx-runtime").JSX.Element;
9
+ export declare function MobileDroplist({ items, selection, open: openProp, onOpenChange, children, search, label, actionButton, slotAfterTitle, onBackButtonClick, virtualized, closeDroplistOnItemClick, scroll, container, closeOnPopstate, size, snapPoints, footer, onItemsReorder, ...rest }: MobileDroplistProps): import("react/jsx-runtime").JSX.Element;
@@ -25,7 +25,7 @@ function MobileDroplist({ items, selection, open: openProp, onOpenChange, childr
25
25
  // скроллятся вместе со списком). `header` + `headerDivider` / `footerDivider` НЕ деструктурируем —
26
26
  // они уходят в `...rest` на корневой `List` (он рендерит шапку и её divider).
27
27
  // `onItemsReorder` — только на корне: drill-down `next-list` ортогонален дереву `SimpleItem`.
28
- footer, onItemsReorder, listRef, ...rest }) {
28
+ footer, onItemsReorder, ...rest }) {
29
29
  const portalContext = (0, portal_context_1.usePortalContext)();
30
30
  const scrollRef = (0, react_1.useRef)(null);
31
31
  const [open = false, setIsOpen] = (0, utils_1.useValueControl)({ value: openProp, onChange: onOpenChange });
@@ -132,7 +132,7 @@ footer, onItemsReorder, listRef, ...rest }) {
132
132
  limitedScrollHeight: false,
133
133
  scrollContainerClassName: scrollable ? MobileDroplist_module_scss_1.default.sheetScroll : undefined,
134
134
  };
135
- const content = ((0, jsx_runtime_1.jsx)("div", { className: MobileDroplist_module_scss_1.default.listWrapper, "data-test-id": isRoot ? constants_1.TEST_IDS.mobileDroplistRoot : undefined, "data-fill": scrollable || undefined, children: reorderRoot && onItemsReorder ? ((0, jsx_runtime_1.jsx)(List_1.ReorderableList, { ...listCommonProps, items: items, onItemsReorder: onItemsReorder, ref: isRoot ? listRef : undefined })) : ((0, jsx_runtime_1.jsx)(List_1.List, { ...listCommonProps, items: levelItems ?? [], virtualized: isRoot && virtualized, ref: isRoot ? listRef : undefined })) }));
135
+ const content = ((0, jsx_runtime_1.jsx)("div", { className: MobileDroplist_module_scss_1.default.listWrapper, "data-test-id": isRoot ? constants_1.TEST_IDS.mobileDroplistRoot : undefined, "data-fill": scrollable || undefined, children: reorderRoot && onItemsReorder ? ((0, jsx_runtime_1.jsx)(List_1.ReorderableList, { ...listCommonProps, items: items, onItemsReorder: onItemsReorder })) : ((0, jsx_runtime_1.jsx)(List_1.List, { ...listCommonProps, items: levelItems ?? [], virtualized: isRoot && virtualized })) }));
136
136
  // Уход с уровня вверх по стеку (для глубже-корня sheet'ов).
137
137
  const popLevel = () => setPath(prev => prev.slice(0, levelIndex - 1));
138
138
  // «Назад»: на корне — только явный `onBackButtonClick` (иначе back-стрелки нет — корневой
@@ -68,7 +68,7 @@ function buildLevelItems(items, onDrill, onClose, closeOnClick, basePath = []) {
68
68
  };
69
69
  }
70
70
  if (item.type === constants_1.ITEM_TYPE.Group || item.type === constants_1.ITEM_TYPE.GroupSelect || item.type === constants_1.ITEM_TYPE.Collapse) {
71
- return { ...item, items: buildLevelItems(item.items, onDrill, onClose, closeOnClick, indexPath) };
71
+ return { ...item, items: buildLevelItems(item.items ?? [], onDrill, onClose, closeOnClick, indexPath) };
72
72
  }
73
73
  }
74
74
  if (closeOnClick && item && typeof item === 'object' && 'onClick' in item) {
@@ -174,7 +174,7 @@ export type DroplistImplProps = DesktopDroplistProps & DroplistMobileSlots;
174
174
  * @internal Props mobile-реализации (`BottomSheet`): реализация дроплиста без popover-пропов
175
175
  * + mobile-слоты.
176
176
  */
177
- export type MobileDroplistProps = Omit<DesktopDroplistProps, 'trigger' | 'placement' | 'widthStrategy' | 'triggerElemRef' | 'triggerClassName'> & Pick<BottomSheetProps, 'snapPoints'> & DroplistMobileSlots;
177
+ export type MobileDroplistProps = Omit<DesktopDroplistProps, 'trigger' | 'placement' | 'widthStrategy' | 'triggerElemRef' | 'listRef' | 'triggerClassName'> & Pick<BottomSheetProps, 'snapPoints'> & DroplistMobileSlots;
178
178
  export type ListPrivateProps = Omit<ListImplProps, 'pinTop' | 'pinBottom' | 'items' | 'hasListInFocusChain' | 'onItemsReorder' | 'virtualized'> & {
179
179
  nested?: boolean;
180
180
  active?: boolean;
@@ -6,4 +6,4 @@ import { MobileDroplistProps } from '../../components/Lists/types.js';
6
6
  * вложенного списка, в шапке появляется его заголовок и кнопка «назад». Internal — наружу не реэкспортится;
7
7
  * рендерится адаптивным `Droplist` на `layoutType='mobile'`.
8
8
  */
9
- export declare function MobileDroplist({ items, selection, open: openProp, onOpenChange, children, search, label, actionButton, slotAfterTitle, onBackButtonClick, virtualized, closeDroplistOnItemClick, scroll, container, closeOnPopstate, size, snapPoints, footer, onItemsReorder, listRef, ...rest }: MobileDroplistProps): import("react/jsx-runtime").JSX.Element;
9
+ export declare function MobileDroplist({ items, selection, open: openProp, onOpenChange, children, search, label, actionButton, slotAfterTitle, onBackButtonClick, virtualized, closeDroplistOnItemClick, scroll, container, closeOnPopstate, size, snapPoints, footer, onItemsReorder, ...rest }: MobileDroplistProps): import("react/jsx-runtime").JSX.Element;
@@ -19,7 +19,7 @@ export function MobileDroplist({ items, selection, open: openProp, onOpenChange,
19
19
  // скроллятся вместе со списком). `header` + `headerDivider` / `footerDivider` НЕ деструктурируем —
20
20
  // они уходят в `...rest` на корневой `List` (он рендерит шапку и её divider).
21
21
  // `onItemsReorder` — только на корне: drill-down `next-list` ортогонален дереву `SimpleItem`.
22
- footer, onItemsReorder, listRef, ...rest }) {
22
+ footer, onItemsReorder, ...rest }) {
23
23
  const portalContext = usePortalContext();
24
24
  const scrollRef = useRef(null);
25
25
  const [open = false, setIsOpen] = useValueControl({ value: openProp, onChange: onOpenChange });
@@ -126,7 +126,7 @@ footer, onItemsReorder, listRef, ...rest }) {
126
126
  limitedScrollHeight: false,
127
127
  scrollContainerClassName: scrollable ? styles.sheetScroll : undefined,
128
128
  };
129
- const content = (_jsx("div", { className: styles.listWrapper, "data-test-id": isRoot ? TEST_IDS.mobileDroplistRoot : undefined, "data-fill": scrollable || undefined, children: reorderRoot && onItemsReorder ? (_jsx(ReorderableList, { ...listCommonProps, items: items, onItemsReorder: onItemsReorder, ref: isRoot ? listRef : undefined })) : (_jsx(List, { ...listCommonProps, items: levelItems ?? [], virtualized: isRoot && virtualized, ref: isRoot ? listRef : undefined })) }));
129
+ const content = (_jsx("div", { className: styles.listWrapper, "data-test-id": isRoot ? TEST_IDS.mobileDroplistRoot : undefined, "data-fill": scrollable || undefined, children: reorderRoot && onItemsReorder ? (_jsx(ReorderableList, { ...listCommonProps, items: items, onItemsReorder: onItemsReorder })) : (_jsx(List, { ...listCommonProps, items: levelItems ?? [], virtualized: isRoot && virtualized })) }));
130
130
  // Уход с уровня вверх по стеку (для глубже-корня sheet'ов).
131
131
  const popLevel = () => setPath(prev => prev.slice(0, levelIndex - 1));
132
132
  // «Назад»: на корне — только явный `onBackButtonClick` (иначе back-стрелки нет — корневой
@@ -63,7 +63,7 @@ export function buildLevelItems(items, onDrill, onClose, closeOnClick, basePath
63
63
  };
64
64
  }
65
65
  if (item.type === ITEM_TYPE.Group || item.type === ITEM_TYPE.GroupSelect || item.type === ITEM_TYPE.Collapse) {
66
- return { ...item, items: buildLevelItems(item.items, onDrill, onClose, closeOnClick, indexPath) };
66
+ return { ...item, items: buildLevelItems(item.items ?? [], onDrill, onClose, closeOnClick, indexPath) };
67
67
  }
68
68
  }
69
69
  if (closeOnClick && item && typeof item === 'object' && 'onClick' in item) {