@cloud-ru/ds-list 2.1.3 → 2.1.4-preview-a42433ce.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.
@@ -62,7 +62,9 @@ export type BaseItem = WithSupportProps<{
62
62
  checked?: boolean;
63
63
  }>;
64
64
  type BaseItemWithoutNonGroup = Omit<BaseItem, 'switch' | 'inactive'>;
65
- export type Item = BaseItem | AccordionItem | NextListItem | GroupItem | GroupSelectItem;
65
+ export type Item = (BaseItem & {
66
+ type?: undefined;
67
+ }) | AccordionItem | NextListItem | GroupItem | GroupSelectItem;
66
68
  export type AccordionItem = BaseItemWithoutNonGroup & {
67
69
  items: Item[];
68
70
  type: typeof ITEM_TYPE.Collapse;
@@ -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) {
@@ -62,7 +62,9 @@ export type BaseItem = WithSupportProps<{
62
62
  checked?: boolean;
63
63
  }>;
64
64
  type BaseItemWithoutNonGroup = Omit<BaseItem, 'switch' | 'inactive'>;
65
- export type Item = BaseItem | AccordionItem | NextListItem | GroupItem | GroupSelectItem;
65
+ export type Item = (BaseItem & {
66
+ type?: undefined;
67
+ }) | AccordionItem | NextListItem | GroupItem | GroupSelectItem;
66
68
  export type AccordionItem = BaseItemWithoutNonGroup & {
67
69
  items: Item[];
68
70
  type: typeof ITEM_TYPE.Collapse;
@@ -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) {