@cloud-ru/ds-list 2.2.6-preview-1207a902.0 → 2.2.6-preview-c6bef496.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 +0 -1
- package/dist/cjs/components/Lists/types.d.ts +2 -2
- package/dist/cjs/helperComponents/MobileDroplist/MobileDroplist.d.ts +1 -1
- package/dist/cjs/helperComponents/MobileDroplist/MobileDroplist.js +2 -2
- package/dist/esm/components/Lists/types.d.ts +2 -2
- package/dist/esm/helperComponents/MobileDroplist/MobileDroplist.d.ts +1 -1
- package/dist/esm/helperComponents/MobileDroplist/MobileDroplist.js +3 -3
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/components/Lists/types.ts +2 -2
- package/src/helperComponents/MobileDroplist/MobileDroplist.tsx +2 -4
package/README.md
CHANGED
|
@@ -974,7 +974,6 @@ export function DroplistWithHeader() {
|
|
|
974
974
|
| `pinBottom` | `BaseItemWithoutNonGroup` \| `CommonGroupItem` \| `Item` \| `ScrollProps` | — | Элементы списка, закрепленные снизу |
|
|
975
975
|
| `pinTop` | `BaseItemWithoutNonGroup` \| `CommonGroupItem` \| `Item` \| `ScrollProps` | — | Элементы списка, закрепленные сверху |
|
|
976
976
|
| `placement` | `"bottom"` \| `"bottom-end"` \| `"bottom-start"` \| `"left"` \| `"left-end"` \| `"left-start"` \| `"right"` \| `"right-end"` \| `"right-start"` \| `"top"` \| `"top-end"` \| `"top-start"` | `top` | Положение поповера относительно своего триггера (children). |
|
|
977
|
-
| `safeArea` | `boolean` | `true` | Резервировать ли место под iOS notch / home-indicator и Android nav-bar. Реализовано паддингом <br/> на `.content` через `env(safe-area-inset-*)`: на устройстве без выреза/индикатора (и на desktop) <br/> inset = 0, поэтому никакого «лишнего» отступа не появляется; на notched-устройстве — ровно нужный. <br/> Верхний отступ добавляется только когда sheet раскрыт на полный вьюпорт (его верх под notch). |
|
|
978
977
|
| `scroll` | `boolean` | — | Включить ли скролл для основной части списка |
|
|
979
978
|
| `scrollContainerClassName` | `string` | — | CSS-класс для scroll обертки основного списка айтемов |
|
|
980
979
|
| `scrollContainerRef` | `Ref<HTMLElement>` | — | Ссылка на контейнер, который скроллится |
|
|
@@ -162,7 +162,7 @@ type DroplistMobileSlots = {
|
|
|
162
162
|
* (список size `l` в `BottomSheet`), иначе — `DesktopDroplist` (анкорный popover). Mobile-слоты
|
|
163
163
|
* применяются только на mobile.
|
|
164
164
|
*/
|
|
165
|
-
export type DroplistProps = BaseDroplistProps & DroplistMobileSlots & Pick<BottomSheetProps, 'snapPoints' | '
|
|
165
|
+
export type DroplistProps = BaseDroplistProps & DroplistMobileSlots & Pick<BottomSheetProps, 'snapPoints' | 'withDividers'>;
|
|
166
166
|
/**
|
|
167
167
|
* Props адаптивного `ReorderableDroplist`: props `ReorderableList` + popover/mobile-обвязка
|
|
168
168
|
* `Droplist`. Отдельный компонент по той же причине, что и `ReorderableList`.
|
|
@@ -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' | 'listRef' | 'triggerClassName'> & Pick<BottomSheetProps, 'snapPoints' | '
|
|
177
|
+
export type MobileDroplistProps = Omit<DesktopDroplistProps, 'trigger' | 'placement' | 'widthStrategy' | 'triggerElemRef' | 'listRef' | 'triggerClassName'> & Pick<BottomSheetProps, 'snapPoints' | 'withDividers'> & 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,
|
|
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, withDividers, ...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,
|
|
28
|
+
footer, onItemsReorder, withDividers, ...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 });
|
|
@@ -143,6 +143,6 @@ footer, onItemsReorder, safeArea, withDividers, ...rest }) {
|
|
|
143
143
|
container: container?.current ?? containerRef, open: isRoot ? open : true,
|
|
144
144
|
// Dismiss (backdrop / swipe / Esc): на корне — закрыть весь droplist; глубже — вернуться на уровень вверх,
|
|
145
145
|
// как ждёт пользователь на mobile (а не закрывать всю цепочку разом).
|
|
146
|
-
onClose: isRoot ? handleClose : popLevel, withDividers: withDividers, title: title, onBackButtonClick: handleBack, actionButton: isRoot ? actionButton : undefined, slotAfterTitle: isRoot ? slotAfterTitle : undefined, content: content, footer: isRoot ? footer : undefined, snapPoints: expanded ?
|
|
146
|
+
onClose: isRoot ? handleClose : popLevel, withDividers: withDividers, title: title, onBackButtonClick: handleBack, actionButton: isRoot ? actionButton : undefined, slotAfterTitle: isRoot ? slotAfterTitle : undefined, content: content, footer: isRoot ? footer : undefined, snapPoints: expanded ? bottom_sheet_1.SNAP_POINTS_PRESET.full : snapPoints, closeOnPopstate: closeOnPopstate ?? true }, isRoot ? 'root' : String(item?.id ?? levelIndex)));
|
|
147
147
|
})] }));
|
|
148
148
|
}
|
|
@@ -162,7 +162,7 @@ type DroplistMobileSlots = {
|
|
|
162
162
|
* (список size `l` в `BottomSheet`), иначе — `DesktopDroplist` (анкорный popover). Mobile-слоты
|
|
163
163
|
* применяются только на mobile.
|
|
164
164
|
*/
|
|
165
|
-
export type DroplistProps = BaseDroplistProps & DroplistMobileSlots & Pick<BottomSheetProps, 'snapPoints' | '
|
|
165
|
+
export type DroplistProps = BaseDroplistProps & DroplistMobileSlots & Pick<BottomSheetProps, 'snapPoints' | 'withDividers'>;
|
|
166
166
|
/**
|
|
167
167
|
* Props адаптивного `ReorderableDroplist`: props `ReorderableList` + popover/mobile-обвязка
|
|
168
168
|
* `Droplist`. Отдельный компонент по той же причине, что и `ReorderableList`.
|
|
@@ -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' | 'listRef' | 'triggerClassName'> & Pick<BottomSheetProps, 'snapPoints' | '
|
|
177
|
+
export type MobileDroplistProps = Omit<DesktopDroplistProps, 'trigger' | 'placement' | 'widthStrategy' | 'triggerElemRef' | 'listRef' | 'triggerClassName'> & Pick<BottomSheetProps, 'snapPoints' | 'withDividers'> & 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,
|
|
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, withDividers, ...rest }: MobileDroplistProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { BottomSheet } from '@cloud-ru/ds-bottom-sheet';
|
|
2
|
+
import { BottomSheet, SNAP_POINTS_PRESET } from '@cloud-ru/ds-bottom-sheet';
|
|
3
3
|
import { usePortalContext } from '@cloud-ru/ds-portal-context';
|
|
4
4
|
import { useValueControl } from '@cloud-ru/ds-utils';
|
|
5
5
|
import { cloneElement, isValidElement, useMemo, useRef, useState } from 'react';
|
|
@@ -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,
|
|
22
|
+
footer, onItemsReorder, withDividers, ...rest }) {
|
|
23
23
|
const portalContext = usePortalContext();
|
|
24
24
|
const scrollRef = useRef(null);
|
|
25
25
|
const [open = false, setIsOpen] = useValueControl({ value: openProp, onChange: onOpenChange });
|
|
@@ -137,6 +137,6 @@ footer, onItemsReorder, safeArea, withDividers, ...rest }) {
|
|
|
137
137
|
container: container?.current ?? containerRef, open: isRoot ? open : true,
|
|
138
138
|
// Dismiss (backdrop / swipe / Esc): на корне — закрыть весь droplist; глубже — вернуться на уровень вверх,
|
|
139
139
|
// как ждёт пользователь на mobile (а не закрывать всю цепочку разом).
|
|
140
|
-
onClose: isRoot ? handleClose : popLevel, withDividers: withDividers, title: title, onBackButtonClick: handleBack, actionButton: isRoot ? actionButton : undefined, slotAfterTitle: isRoot ? slotAfterTitle : undefined, content: content, footer: isRoot ? footer : undefined, snapPoints: expanded ?
|
|
140
|
+
onClose: isRoot ? handleClose : popLevel, withDividers: withDividers, title: title, onBackButtonClick: handleBack, actionButton: isRoot ? actionButton : undefined, slotAfterTitle: isRoot ? slotAfterTitle : undefined, content: content, footer: isRoot ? footer : undefined, snapPoints: expanded ? SNAP_POINTS_PRESET.full : snapPoints, closeOnPopstate: closeOnPopstate ?? true }, isRoot ? 'root' : String(item?.id ?? levelIndex)));
|
|
141
141
|
})] }));
|
|
142
142
|
}
|