@cloud-ru/ds-list 2.2.2-preview-43886f3e.0 → 2.2.2-preview-f80001f4.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.
@@ -1,2 +1,2 @@
1
1
  import { NextListItemProps } from './types';
2
- export declare function NextListItem({ items, placement, id, scroll, scrollRef, disabled, onSublistOpenChanged, allChildIds, loading, dataError, dataFiltered, focusId, untouchableScrollbars, ...option }: NextListItemProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function NextListItem({ items, placement, id, scroll, scrollRef, disabled, onSublistOpenChanged, allChildIds, loading, dataError, dataFiltered, focusId, untouchableScrollbars, listClassName, ...option }: NextListItemProps): import("react/jsx-runtime").JSX.Element;
@@ -12,7 +12,7 @@ const BaseItem_1 = require("../BaseItem");
12
12
  const hooks_1 = require("../hooks");
13
13
  const utils_1 = require("../utils");
14
14
  const constants_2 = require("./constants");
15
- function NextListItem({ items, placement = 'right-start', id, scroll, scrollRef, disabled, onSublistOpenChanged, allChildIds, loading = false, dataError = false, dataFiltered = false, focusId = id, untouchableScrollbars = false, ...option }) {
15
+ function NextListItem({ items, placement = 'right-start', id, scroll, scrollRef, disabled, onSublistOpenChanged, allChildIds, loading = false, dataError = false, dataFiltered = false, focusId = id, untouchableScrollbars = false, listClassName, ...option }) {
16
16
  const { flattenItems, focusFlattenItems, virtualized } = (0, contexts_1.useNewListContext)();
17
17
  const { value, isSelectionSingle, isSelectionMultiple } = (0, contexts_1.useSelectionContext)();
18
18
  const { openCollapseItems = [] } = (0, contexts_1.useCollapseContext)();
@@ -61,7 +61,7 @@ function NextListItem({ items, placement = 'right-start', id, scroll, scrollRef,
61
61
  listRef.current?.focus();
62
62
  }, 0);
63
63
  }, []);
64
- return ((0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { outsideClick: handleOutsideClick, fallbackPlacements: constants_2.FALLBACK_PLACEMENTS, bodyPadding: false, content: (0, jsx_runtime_1.jsx)(ListPrivate_1.ListPrivate, { onKeyDown: handleListKeyDown, items: items, nested: true, scroll: scroll, virtualized: virtualized, tabIndex: 0, ref: listRef, onFocus: e => {
64
+ return ((0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { outsideClick: handleOutsideClick, fallbackPlacements: constants_2.FALLBACK_PLACEMENTS, bodyPadding: false, className: listClassName, content: (0, jsx_runtime_1.jsx)(ListPrivate_1.ListPrivate, { onKeyDown: handleListKeyDown, items: items, nested: true, scroll: scroll, virtualized: virtualized, tabIndex: 0, ref: listRef, onFocus: e => {
65
65
  e.stopPropagation();
66
66
  forceUpdateActiveItemId?.(ids[0]);
67
67
  }, scrollRef: scrollRef, limitedScrollHeight: true, untouchableScrollbars: untouchableScrollbars, loading: loading, dataError: dataError, dataFiltered: dataFiltered }), trigger: 'hover', open: isOpen || open, onOpenChange: value => {
@@ -80,6 +80,11 @@ export type NextListItem = BaseItemWithoutNonGroup & ScrollProps & {
80
80
  dataFiltered?: boolean;
81
81
  /** Сторона, с которой раскрывается вложенный список относительно элемента */
82
82
  placement?: 'right-start' | 'left-start' | 'left' | 'right' | 'left-end' | 'right-end';
83
+ /**
84
+ * Только desktop: CSS-класс всплывающего окна вложенного списка. Окно рендерится в портале
85
+ * и не наследует классы родительского списка — например, класс плотности темы.
86
+ */
87
+ listClassName?: string;
83
88
  };
84
89
  type CommonGroupItem = {
85
90
  /** Заголовок группы */
@@ -56,6 +56,7 @@ function buildLevelItems(items, onDrill, onClose, closeOnClick, basePath = []) {
56
56
  delete base.dataError;
57
57
  delete base.dataFiltered;
58
58
  delete base.placement;
59
+ delete base.listClassName;
59
60
  delete base.scroll;
60
61
  delete base.scrollRef;
61
62
  return {
@@ -1,2 +1,2 @@
1
1
  import { NextListItemProps } from './types.js';
2
- export declare function NextListItem({ items, placement, id, scroll, scrollRef, disabled, onSublistOpenChanged, allChildIds, loading, dataError, dataFiltered, focusId, untouchableScrollbars, ...option }: NextListItemProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function NextListItem({ items, placement, id, scroll, scrollRef, disabled, onSublistOpenChanged, allChildIds, loading, dataError, dataFiltered, focusId, untouchableScrollbars, listClassName, ...option }: NextListItemProps): import("react/jsx-runtime").JSX.Element;
@@ -9,7 +9,7 @@ import { BaseItem } from '../BaseItem/index.js';
9
9
  import { useGroupItemSelection } from '../hooks.js';
10
10
  import { extractActiveItems, isNextListItem } from '../utils.js';
11
11
  import { FALLBACK_PLACEMENTS } from './constants.js';
12
- export function NextListItem({ items, placement = 'right-start', id, scroll, scrollRef, disabled, onSublistOpenChanged, allChildIds, loading = false, dataError = false, dataFiltered = false, focusId = id, untouchableScrollbars = false, ...option }) {
12
+ export function NextListItem({ items, placement = 'right-start', id, scroll, scrollRef, disabled, onSublistOpenChanged, allChildIds, loading = false, dataError = false, dataFiltered = false, focusId = id, untouchableScrollbars = false, listClassName, ...option }) {
13
13
  const { flattenItems, focusFlattenItems, virtualized } = useNewListContext();
14
14
  const { value, isSelectionSingle, isSelectionMultiple } = useSelectionContext();
15
15
  const { openCollapseItems = [] } = useCollapseContext();
@@ -58,7 +58,7 @@ export function NextListItem({ items, placement = 'right-start', id, scroll, scr
58
58
  listRef.current?.focus();
59
59
  }, 0);
60
60
  }, []);
61
- return (_jsx(Dropdown, { outsideClick: handleOutsideClick, fallbackPlacements: FALLBACK_PLACEMENTS, bodyPadding: false, content: _jsx(ListPrivate, { onKeyDown: handleListKeyDown, items: items, nested: true, scroll: scroll, virtualized: virtualized, tabIndex: 0, ref: listRef, onFocus: e => {
61
+ return (_jsx(Dropdown, { outsideClick: handleOutsideClick, fallbackPlacements: FALLBACK_PLACEMENTS, bodyPadding: false, className: listClassName, content: _jsx(ListPrivate, { onKeyDown: handleListKeyDown, items: items, nested: true, scroll: scroll, virtualized: virtualized, tabIndex: 0, ref: listRef, onFocus: e => {
62
62
  e.stopPropagation();
63
63
  forceUpdateActiveItemId?.(ids[0]);
64
64
  }, scrollRef: scrollRef, limitedScrollHeight: true, untouchableScrollbars: untouchableScrollbars, loading: loading, dataError: dataError, dataFiltered: dataFiltered }), trigger: 'hover', open: isOpen || open, onOpenChange: value => {
@@ -80,6 +80,11 @@ export type NextListItem = BaseItemWithoutNonGroup & ScrollProps & {
80
80
  dataFiltered?: boolean;
81
81
  /** Сторона, с которой раскрывается вложенный список относительно элемента */
82
82
  placement?: 'right-start' | 'left-start' | 'left' | 'right' | 'left-end' | 'right-end';
83
+ /**
84
+ * Только desktop: CSS-класс всплывающего окна вложенного списка. Окно рендерится в портале
85
+ * и не наследует классы родительского списка — например, класс плотности темы.
86
+ */
87
+ listClassName?: string;
83
88
  };
84
89
  type CommonGroupItem = {
85
90
  /** Заголовок группы */
@@ -51,6 +51,7 @@ export function buildLevelItems(items, onDrill, onClose, closeOnClick, basePath
51
51
  delete base.dataError;
52
52
  delete base.dataFiltered;
53
53
  delete base.placement;
54
+ delete base.listClassName;
54
55
  delete base.scroll;
55
56
  delete base.scrollRef;
56
57
  return {