@hh.ru/magritte-ui-tree-selector 5.6.0 → 5.7.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/Item.js +1 -1
- package/ItemContent.js +1 -1
- package/ItemsList.js +1 -1
- package/MobileDelimiter.d.ts +5 -2
- package/MobileDelimiter.js +3 -4
- package/MobileDelimiter.js.map +1 -1
- package/MobileItemsList.js +7 -4
- package/MobileItemsList.js.map +1 -1
- package/TreeSelector.js +4 -2
- package/TreeSelector.js.map +1 -1
- package/TreeSelectorDummy.js +4 -2
- package/TreeSelectorDummy.js.map +1 -1
- package/TreeSelectorWrapper.js +2 -2
- package/collection/types.d.ts +4 -0
- package/index.css +29 -29
- package/index.js +4 -2
- package/index.js.map +1 -1
- package/index.mock.js +1 -1
- package/package.json +4 -2
- package/tree-selector-item-CnEnj_YP.js +5 -0
- package/tree-selector-item-CnEnj_YP.js.map +1 -0
- package/useAnimationTimeout.js +1 -1
- package/tree-selector-item-7M3t_BRl.js +0 -5
- package/tree-selector-item-7M3t_BRl.js.map +0 -1
package/Item.js
CHANGED
|
@@ -9,7 +9,7 @@ import '@hh.ru/magritte-ui-checkbox-radio';
|
|
|
9
9
|
import './TreeSelectorItemBase.js';
|
|
10
10
|
import '@hh.ru/magritte-ui-cell';
|
|
11
11
|
import '@hh.ru/magritte-ui-typography';
|
|
12
|
-
import './tree-selector-item-
|
|
12
|
+
import './tree-selector-item-CnEnj_YP.js';
|
|
13
13
|
|
|
14
14
|
const ONE_BOX_MARGIN = 36;
|
|
15
15
|
const getMargin = (allBoxesCount, hasShift, hasIndent) => {
|
package/ItemContent.js
CHANGED
|
@@ -6,7 +6,7 @@ import { DotFilledSize24, ChevronRightOutlinedSize24 } from '@hh.ru/magritte-ui-
|
|
|
6
6
|
import { Action } from './Action.js';
|
|
7
7
|
import { TreeSelectorItemBase } from './TreeSelectorItemBase.js';
|
|
8
8
|
import { Text } from '@hh.ru/magritte-ui-typography';
|
|
9
|
-
import { s as styles } from './tree-selector-item-
|
|
9
|
+
import { s as styles } from './tree-selector-item-CnEnj_YP.js';
|
|
10
10
|
import '@hh.ru/magritte-ui-checkbox-radio';
|
|
11
11
|
import '@hh.ru/magritte-ui-cell';
|
|
12
12
|
|
package/ItemsList.js
CHANGED
|
@@ -4,7 +4,7 @@ import { useRef, useMemo, useState, useCallback, useEffect } from 'react';
|
|
|
4
4
|
import { useVirtualizer } from '@tanstack/react-virtual';
|
|
5
5
|
import { keyboardMatch, keyboardKeys } from '@hh.ru/magritte-common-keyboard';
|
|
6
6
|
import { Item } from './Item.js';
|
|
7
|
-
import { s as styles } from './tree-selector-item-
|
|
7
|
+
import { s as styles } from './tree-selector-item-CnEnj_YP.js';
|
|
8
8
|
import 'classnames';
|
|
9
9
|
import './ItemContent.js';
|
|
10
10
|
import '@hh.ru/magritte-ui-icon/icon';
|
package/MobileDelimiter.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { type SectionHeaderProps } from '@hh.ru/magritte-ui-section-header';
|
|
3
|
+
type MobileDelimiterProps = Pick<SectionHeaderProps, 'children' | 'link'>;
|
|
4
|
+
export declare const MobileDelimiter: FC<MobileDelimiterProps>;
|
|
5
|
+
export {};
|
package/MobileDelimiter.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import {
|
|
4
|
-
import { Text } from '@hh.ru/magritte-ui-typography';
|
|
3
|
+
import { SectionHeader } from '@hh.ru/magritte-ui-section-header';
|
|
5
4
|
|
|
6
|
-
const MobileDelimiter = ({ children }) => {
|
|
7
|
-
return /* @__PURE__ */ jsx(
|
|
5
|
+
const MobileDelimiter = ({ children, link }) => {
|
|
6
|
+
return /* @__PURE__ */ jsx(SectionHeader, { padding: 16, link, children });
|
|
8
7
|
};
|
|
9
8
|
|
|
10
9
|
export { MobileDelimiter };
|
package/MobileDelimiter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileDelimiter.js","sources":["src/MobileDelimiter.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"MobileDelimiter.js","sources":["src/MobileDelimiter.tsx"],"sourcesContent":["import { FC } from 'react';\n\nimport { type SectionHeaderProps, SectionHeader } from '@hh.ru/magritte-ui-section-header';\n\ntype MobileDelimiterProps = Pick<SectionHeaderProps, 'children' | 'link'>;\n\nexport const MobileDelimiter: FC<MobileDelimiterProps> = ({ children, link }) => {\n return (\n <SectionHeader padding={16} link={link}>\n {children}\n </SectionHeader>\n );\n};\n"],"names":[],"mappings":";;;AAMO,MAAM,eAA4C,GAAA,CAAC,EAAE,QAAA,EAAU,MAAW,KAAA;AAC7E,EAAA,uBACK,GAAA,CAAA,aAAA,EAAA,EAAc,OAAS,EAAA,EAAA,EAAI,MACvB,QACL,EAAA,CAAA,CAAA;AAER;;;;"}
|
package/MobileItemsList.js
CHANGED
|
@@ -6,16 +6,17 @@ import classnames from 'classnames';
|
|
|
6
6
|
import { debounce } from '@hh.ru/magritte-common-func-utils';
|
|
7
7
|
import { Cell, CellText } from '@hh.ru/magritte-ui-cell';
|
|
8
8
|
import { CheckableCardElement } from '@hh.ru/magritte-ui-checkable-card/CheckableCardElement';
|
|
9
|
+
import { Link } from '@hh.ru/magritte-ui-link';
|
|
9
10
|
import { Action } from './Action.js';
|
|
10
11
|
import { MobileDelimiter } from './MobileDelimiter.js';
|
|
11
12
|
import { MobileItem } from './MobileItem.js';
|
|
12
13
|
import { MobileParentItem } from './MobileParentItem.js';
|
|
13
|
-
import { s as styles } from './tree-selector-item-
|
|
14
|
+
import { s as styles } from './tree-selector-item-CnEnj_YP.js';
|
|
14
15
|
import '@hh.ru/magritte-ui-checkbox-radio';
|
|
15
|
-
import '@hh.ru/magritte-ui-
|
|
16
|
-
import '@hh.ru/magritte-ui-typography';
|
|
16
|
+
import '@hh.ru/magritte-ui-section-header';
|
|
17
17
|
import './TreeSelectorItemBase.js';
|
|
18
18
|
import '@hh.ru/magritte-ui-badge';
|
|
19
|
+
import '@hh.ru/magritte-ui-card';
|
|
19
20
|
|
|
20
21
|
const DEFAULT_ITEM_HEIGHT = 56;
|
|
21
22
|
const SCROLLEND_HANDLER_DEBOUNCE_MS = 150;
|
|
@@ -224,6 +225,8 @@ const MobileItemsListComponent = (props, ref) => {
|
|
|
224
225
|
const item = sortedItems[itemIndex];
|
|
225
226
|
const hasChildren = collection.hasChildren(item.id);
|
|
226
227
|
const hasLetter = item.additional?.char && !isSearch;
|
|
228
|
+
const link = item.additional?.link;
|
|
229
|
+
const delimiterLink = link && /* @__PURE__ */ jsx(Link, { href: link.href, children: link.anchor });
|
|
227
230
|
const delimiterContent = renderMobileDelimiter?.({
|
|
228
231
|
item,
|
|
229
232
|
order: orderHashMap[item.id],
|
|
@@ -244,7 +247,7 @@ const MobileItemsListComponent = (props, ref) => {
|
|
|
244
247
|
[styles.withGap]: withGap
|
|
245
248
|
}),
|
|
246
249
|
children: /* @__PURE__ */ jsxs("div", { className: styles.mobileItem, children: [
|
|
247
|
-
hasLetter && /* @__PURE__ */ jsx(MobileDelimiter, { children: item.additional?.char }),
|
|
250
|
+
hasLetter && /* @__PURE__ */ jsx(MobileDelimiter, { link: delimiterLink, children: item.additional?.char }),
|
|
248
251
|
delimiterContent && /* @__PURE__ */ jsx(MobileDelimiter, { children: delimiterContent }),
|
|
249
252
|
hasChildren ? /* @__PURE__ */ jsx(
|
|
250
253
|
MobileParentItem,
|
package/MobileItemsList.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileItemsList.js","sources":["src/MobileItemsList.tsx"],"sourcesContent":["import {\n ReactElement,\n useMemo,\n useState,\n useImperativeHandle,\n forwardRef,\n ForwardedRef,\n useRef,\n useEffect,\n RefCallback,\n useCallback,\n} from 'react';\nimport { useVirtualizer } from '@tanstack/react-virtual';\nimport classnames from 'classnames';\n\nimport { debounce } from '@hh.ru/magritte-common-func-utils';\nimport { Cell, CellText } from '@hh.ru/magritte-ui-cell';\nimport { CheckableCardElement } from '@hh.ru/magritte-ui-checkable-card/CheckableCardElement';\nimport { Action } from '@hh.ru/magritte-ui-tree-selector/Action';\nimport { MobileDelimiter } from '@hh.ru/magritte-ui-tree-selector/MobileDelimiter';\nimport { MobileItem } from '@hh.ru/magritte-ui-tree-selector/MobileItem';\nimport { MobileParentItem } from '@hh.ru/magritte-ui-tree-selector/MobileParentItem';\nimport { AdditionalDefault, TreeModel } from '@hh.ru/magritte-ui-tree-selector/collection/types';\nimport { ListControls, TreeSelectorDummyProps } from '@hh.ru/magritte-ui-tree-selector/types';\n\nimport styles from './tree-selector-item.less';\n\nconst DEFAULT_ITEM_HEIGHT = 56;\nconst SCROLLEND_HANDLER_DEBOUNCE_MS = 150;\nconst DELIMITER = ';';\n\ntype MobileItemsListProps<Additional extends AdditionalDefault> = {\n selected: string[];\n disabled: string[];\n getMobileSearchItemOrder: (model: TreeModel<Additional>) => number;\n setInputValue: (newValue: string) => void;\n handleChangeInput: (newValue: string) => void;\n contentFilterQuery: string;\n isSearch: boolean;\n} & Pick<\n TreeSelectorDummyProps<Additional>,\n | 'collection'\n | 'leavesOnly'\n | 'singleChoice'\n | 'checkSelectable'\n | 'onChange'\n | 'renderItem'\n | 'renderMobileDelimiter'\n | 'onMobileNavigationChange'\n | 'getSelectAllParentTrl'\n | 'renderContentBefore'\n | 'renderContentAfter'\n>;\n\nconst MobileItemsListComponent = <Additional extends AdditionalDefault>(\n props: MobileItemsListProps<Additional>,\n ref: ForwardedRef<ListControls>\n): ReactElement => {\n const {\n collection,\n selected,\n disabled,\n leavesOnly,\n singleChoice,\n onChange,\n checkSelectable,\n getMobileSearchItemOrder,\n setInputValue,\n handleChangeInput,\n isSearch,\n renderMobileDelimiter,\n renderItem,\n contentFilterQuery,\n getSelectAllParentTrl,\n renderContentBefore,\n renderContentAfter,\n onMobileNavigationChange,\n } = props;\n const navigationChangeCallback = useRef(onMobileNavigationChange);\n navigationChangeCallback.current = onMobileNavigationChange;\n const prevParentIds = useRef<(string | undefined)[]>([]);\n const prevQueries = useRef<string[]>([]);\n const currentQuery = useRef(contentFilterQuery);\n const [currentParentId, setCurrentParentId] = useState<string | undefined>();\n const items = useMemo(\n () => (currentParentId ? collection.getChildren(currentParentId) : collection.getTopLevel()),\n [currentParentId, collection]\n );\n const orderHashMap = useMemo(() => {\n return items.reduce<Record<TreeModel<Additional>['id'], number>>((acc, item) => {\n acc[item.id] = isSearch && !currentParentId ? getMobileSearchItemOrder(item) : 0;\n return acc;\n }, {});\n }, [items, isSearch, currentParentId, getMobileSearchItemOrder]);\n\n const sortedItems = useMemo(() => {\n return items.sort((itemA, itemB) => {\n return orderHashMap[itemA.id] - orderHashMap[itemB.id];\n });\n }, [items, orderHashMap]);\n\n const isSelectable = currentParentId && !leavesOnly && checkSelectable?.(currentParentId, collection);\n const withContentBefore = !!renderContentBefore;\n const withContentAfter = !!renderContentAfter;\n const count = items.length + (isSelectable ? 1 : 0) + (withContentBefore ? 1 : 0) + (withContentAfter ? 1 : 0);\n const parentRef = useRef<HTMLElement | null>(null);\n const isScrolling = useRef(false);\n\n const getItemKey = (index: number) => {\n if (withContentBefore && index === 0) {\n return 'promoTop';\n }\n\n if (withContentAfter && index === count - 1) {\n return 'promoBottom';\n }\n\n const isSelectAllItem =\n isSelectable && ((index === 0 && !withContentBefore) || (index === 1 && withContentBefore));\n\n if (isSelectAllItem) {\n return `current${currentParentId}`;\n }\n\n const itemIndex = index - (isSelectable ? 1 : 0) - (withContentBefore ? 1 : 0);\n const item = sortedItems[itemIndex];\n\n return currentParentId ? `${currentParentId}${DELIMITER}${item.id}` : `${item.id}`;\n };\n\n const virtualizer = useVirtualizer({\n count,\n getScrollElement: () => parentRef.current,\n estimateSize: () => DEFAULT_ITEM_HEIGHT,\n getItemKey,\n });\n\n const itemsVirtualizer = virtualizer.getVirtualItems();\n\n useEffect(() => {\n setCurrentParentId(undefined);\n prevParentIds.current = [];\n prevQueries.current = [];\n navigationChangeCallback.current?.(undefined);\n currentQuery.current = contentFilterQuery;\n }, [contentFilterQuery]);\n\n useImperativeHandle(\n ref,\n () => ({\n back: () => {\n if (!isScrolling.current) {\n const prevParentId = prevParentIds.current.pop();\n setCurrentParentId(prevParentId);\n navigationChangeCallback.current?.(prevParentId);\n if (prevQueries.current.length) {\n const prevInputValue = prevQueries.current.pop() as string;\n setInputValue(prevInputValue);\n currentQuery.current = prevInputValue;\n } else {\n handleChangeInput('');\n }\n }\n },\n }),\n [handleChangeInput, setInputValue]\n );\n\n useEffect(() => {\n const handleScrollEnd = debounce(() => {\n isScrolling.current = false;\n }, SCROLLEND_HANDLER_DEBOUNCE_MS);\n\n const handleScroll = () => {\n isScrolling.current = true;\n handleScrollEnd();\n };\n parentRef.current?.addEventListener('scroll', handleScroll);\n\n return () => {\n parentRef.current?.removeEventListener('scroll', handleScroll);\n };\n }, []);\n\n const refCallback: RefCallback<HTMLDivElement> = useCallback((node) => {\n parentRef.current = node ? node.parentElement : null;\n }, []);\n\n useEffect(() => {\n virtualizer.scrollToIndex(0);\n }, [currentParentId, sortedItems, virtualizer]);\n\n return (\n <div\n ref={refCallback}\n className={styles.virtualizedList}\n style={{\n height: `${virtualizer.getTotalSize()}px`,\n }}\n >\n {itemsVirtualizer.map((virtualItem) => {\n const isContentBeforeItem = withContentBefore && virtualItem.index === 0;\n const isContentAfterItem = withContentAfter && virtualItem.index === count - 1;\n const isSelectAllItem =\n isSelectable &&\n ((virtualItem.index === 0 && !withContentBefore) || (virtualItem.index === 1 && withContentBefore));\n\n if (isContentBeforeItem) {\n return (\n <div\n key={virtualItem.key}\n ref={virtualizer.measureElement}\n data-index={virtualItem.index}\n className={styles.virtualizedItem}\n style={{\n transform: `translateY(${virtualItem.start}px)`,\n }}\n >\n {renderContentBefore(isSearch)}\n </div>\n );\n }\n\n if (isContentAfterItem) {\n return (\n <div\n key={virtualItem.key}\n ref={virtualizer.measureElement}\n data-index={virtualItem.index}\n className={styles.virtualizedItem}\n style={{\n transform: `translateY(${virtualItem.start}px)`,\n }}\n >\n {renderContentAfter(isSearch)}\n </div>\n );\n }\n\n if (isSelectAllItem) {\n return (\n <div\n key={virtualItem.key}\n ref={virtualizer.measureElement}\n data-index={virtualItem.index}\n className={styles.virtualizedItem}\n style={{\n transform: `translateY(${virtualItem.start}px)`,\n }}\n >\n <div className={styles.mobileItem}>\n <CheckableCardElement\n padding={16}\n flexible\n borderRadius={12}\n Element=\"label\"\n checked={selected.includes(currentParentId)}\n data-qa={`tree-selector-select-all-${currentParentId}`}\n >\n <Cell\n Element={'div'}\n disabled={disabled.includes(currentParentId)}\n right={\n <Action\n selected={selected.includes(currentParentId)}\n onChange={onChange}\n id={currentParentId}\n singleChoice={singleChoice}\n />\n }\n >\n <CellText>{getSelectAllParentTrl(currentParentId)}</CellText>\n </Cell>\n </CheckableCardElement>\n </div>\n </div>\n );\n }\n const itemIndex = virtualItem.index - (isSelectable ? 1 : 0) - (withContentBefore ? 1 : 0);\n const item = sortedItems[itemIndex];\n const hasChildren = collection.hasChildren(item.id);\n const hasLetter = item.additional?.char && !isSearch;\n const delimiterContent = renderMobileDelimiter?.({\n item,\n order: orderHashMap[item.id],\n isSearch,\n index: itemIndex,\n isTopLevel: !currentParentId,\n });\n const withGap =\n (!!withContentBefore && virtualItem.index !== 1) || (!withContentBefore && virtualItem.index !== 0);\n return (\n <div\n key={virtualItem.key}\n ref={virtualizer.measureElement}\n data-index={virtualItem.index}\n style={{\n transform: `translateY(${virtualItem.start}px)`,\n }}\n className={classnames(styles.virtualizedItem, {\n [styles.withGap]: withGap,\n })}\n >\n <div className={styles.mobileItem}>\n {hasLetter && <MobileDelimiter>{item.additional?.char}</MobileDelimiter>}\n {delimiterContent && <MobileDelimiter>{delimiterContent}</MobileDelimiter>}\n {hasChildren ? (\n <MobileParentItem\n collection={collection}\n item={item}\n selected={selected}\n onClick={() => {\n prevParentIds.current.push(currentParentId);\n prevQueries.current.push(currentQuery.current);\n setCurrentParentId(item.id);\n setInputValue('');\n currentQuery.current = '';\n navigationChangeCallback.current?.(item.id);\n }}\n parentId={currentParentId}\n isSearch={isSearch}\n renderItem={renderItem}\n />\n ) : (\n <MobileItem\n item={item}\n singleChoice={singleChoice}\n isSelectable={checkSelectable?.(item.id, collection)}\n isSelected={selected.includes(item.id)}\n isDisabled={disabled.includes(item.id)}\n onChange={onChange}\n isSearch={isSearch}\n renderItem={renderItem}\n parentId={currentParentId}\n />\n )}\n </div>\n </div>\n );\n })}\n </div>\n );\n};\n\nexport const MobileItemsList = forwardRef(MobileItemsListComponent) as <Additional extends AdditionalDefault>(\n props: MobileItemsListProps<Additional> & { ref?: ForwardedRef<ListControls> }\n) => ReactElement;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA2BA,MAAM,mBAAsB,GAAA,EAAA,CAAA;AAC5B,MAAM,6BAAgC,GAAA,GAAA,CAAA;AACtC,MAAM,SAAY,GAAA,GAAA,CAAA;AAyBlB,MAAM,wBAAA,GAA2B,CAC7B,KAAA,EACA,GACe,KAAA;AACf,EAAM,MAAA;AAAA,IACF,UAAA;AAAA,IACA,QAAA;AAAA,IACA,QAAA;AAAA,IACA,UAAA;AAAA,IACA,YAAA;AAAA,IACA,QAAA;AAAA,IACA,eAAA;AAAA,IACA,wBAAA;AAAA,IACA,aAAA;AAAA,IACA,iBAAA;AAAA,IACA,QAAA;AAAA,IACA,qBAAA;AAAA,IACA,UAAA;AAAA,IACA,kBAAA;AAAA,IACA,qBAAA;AAAA,IACA,mBAAA;AAAA,IACA,kBAAA;AAAA,IACA,wBAAA;AAAA,GACA,GAAA,KAAA,CAAA;AACJ,EAAM,MAAA,wBAAA,GAA2B,OAAO,wBAAwB,CAAA,CAAA;AAChE,EAAA,wBAAA,CAAyB,OAAU,GAAA,wBAAA,CAAA;AACnC,EAAM,MAAA,aAAA,GAAgB,MAA+B,CA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|
+
{"version":3,"file":"MobileItemsList.js","sources":["src/MobileItemsList.tsx"],"sourcesContent":["import {\n ReactElement,\n useMemo,\n useState,\n useImperativeHandle,\n forwardRef,\n ForwardedRef,\n useRef,\n useEffect,\n RefCallback,\n useCallback,\n} from 'react';\nimport { useVirtualizer } from '@tanstack/react-virtual';\nimport classnames from 'classnames';\n\nimport { debounce } from '@hh.ru/magritte-common-func-utils';\nimport { Cell, CellText } from '@hh.ru/magritte-ui-cell';\nimport { CheckableCardElement } from '@hh.ru/magritte-ui-checkable-card/CheckableCardElement';\nimport { Link } from '@hh.ru/magritte-ui-link';\nimport { Action } from '@hh.ru/magritte-ui-tree-selector/Action';\nimport { MobileDelimiter } from '@hh.ru/magritte-ui-tree-selector/MobileDelimiter';\nimport { MobileItem } from '@hh.ru/magritte-ui-tree-selector/MobileItem';\nimport { MobileParentItem } from '@hh.ru/magritte-ui-tree-selector/MobileParentItem';\nimport { AdditionalDefault, TreeModel } from '@hh.ru/magritte-ui-tree-selector/collection/types';\nimport { ListControls, TreeSelectorDummyProps } from '@hh.ru/magritte-ui-tree-selector/types';\n\nimport styles from './tree-selector-item.less';\n\nconst DEFAULT_ITEM_HEIGHT = 56;\nconst SCROLLEND_HANDLER_DEBOUNCE_MS = 150;\nconst DELIMITER = ';';\n\ntype MobileItemsListProps<Additional extends AdditionalDefault> = {\n selected: string[];\n disabled: string[];\n getMobileSearchItemOrder: (model: TreeModel<Additional>) => number;\n setInputValue: (newValue: string) => void;\n handleChangeInput: (newValue: string) => void;\n contentFilterQuery: string;\n isSearch: boolean;\n} & Pick<\n TreeSelectorDummyProps<Additional>,\n | 'collection'\n | 'leavesOnly'\n | 'singleChoice'\n | 'checkSelectable'\n | 'onChange'\n | 'renderItem'\n | 'renderMobileDelimiter'\n | 'onMobileNavigationChange'\n | 'getSelectAllParentTrl'\n | 'renderContentBefore'\n | 'renderContentAfter'\n>;\n\nconst MobileItemsListComponent = <Additional extends AdditionalDefault>(\n props: MobileItemsListProps<Additional>,\n ref: ForwardedRef<ListControls>\n): ReactElement => {\n const {\n collection,\n selected,\n disabled,\n leavesOnly,\n singleChoice,\n onChange,\n checkSelectable,\n getMobileSearchItemOrder,\n setInputValue,\n handleChangeInput,\n isSearch,\n renderMobileDelimiter,\n renderItem,\n contentFilterQuery,\n getSelectAllParentTrl,\n renderContentBefore,\n renderContentAfter,\n onMobileNavigationChange,\n } = props;\n const navigationChangeCallback = useRef(onMobileNavigationChange);\n navigationChangeCallback.current = onMobileNavigationChange;\n const prevParentIds = useRef<(string | undefined)[]>([]);\n const prevQueries = useRef<string[]>([]);\n const currentQuery = useRef(contentFilterQuery);\n const [currentParentId, setCurrentParentId] = useState<string | undefined>();\n const items = useMemo(\n () => (currentParentId ? collection.getChildren(currentParentId) : collection.getTopLevel()),\n [currentParentId, collection]\n );\n const orderHashMap = useMemo(() => {\n return items.reduce<Record<TreeModel<Additional>['id'], number>>((acc, item) => {\n acc[item.id] = isSearch && !currentParentId ? getMobileSearchItemOrder(item) : 0;\n return acc;\n }, {});\n }, [items, isSearch, currentParentId, getMobileSearchItemOrder]);\n\n const sortedItems = useMemo(() => {\n return items.sort((itemA, itemB) => {\n return orderHashMap[itemA.id] - orderHashMap[itemB.id];\n });\n }, [items, orderHashMap]);\n\n const isSelectable = currentParentId && !leavesOnly && checkSelectable?.(currentParentId, collection);\n const withContentBefore = !!renderContentBefore;\n const withContentAfter = !!renderContentAfter;\n const count = items.length + (isSelectable ? 1 : 0) + (withContentBefore ? 1 : 0) + (withContentAfter ? 1 : 0);\n const parentRef = useRef<HTMLElement | null>(null);\n const isScrolling = useRef(false);\n\n const getItemKey = (index: number) => {\n if (withContentBefore && index === 0) {\n return 'promoTop';\n }\n\n if (withContentAfter && index === count - 1) {\n return 'promoBottom';\n }\n\n const isSelectAllItem =\n isSelectable && ((index === 0 && !withContentBefore) || (index === 1 && withContentBefore));\n\n if (isSelectAllItem) {\n return `current${currentParentId}`;\n }\n\n const itemIndex = index - (isSelectable ? 1 : 0) - (withContentBefore ? 1 : 0);\n const item = sortedItems[itemIndex];\n\n return currentParentId ? `${currentParentId}${DELIMITER}${item.id}` : `${item.id}`;\n };\n\n const virtualizer = useVirtualizer({\n count,\n getScrollElement: () => parentRef.current,\n estimateSize: () => DEFAULT_ITEM_HEIGHT,\n getItemKey,\n });\n\n const itemsVirtualizer = virtualizer.getVirtualItems();\n\n useEffect(() => {\n setCurrentParentId(undefined);\n prevParentIds.current = [];\n prevQueries.current = [];\n navigationChangeCallback.current?.(undefined);\n currentQuery.current = contentFilterQuery;\n }, [contentFilterQuery]);\n\n useImperativeHandle(\n ref,\n () => ({\n back: () => {\n if (!isScrolling.current) {\n const prevParentId = prevParentIds.current.pop();\n setCurrentParentId(prevParentId);\n navigationChangeCallback.current?.(prevParentId);\n if (prevQueries.current.length) {\n const prevInputValue = prevQueries.current.pop() as string;\n setInputValue(prevInputValue);\n currentQuery.current = prevInputValue;\n } else {\n handleChangeInput('');\n }\n }\n },\n }),\n [handleChangeInput, setInputValue]\n );\n\n useEffect(() => {\n const handleScrollEnd = debounce(() => {\n isScrolling.current = false;\n }, SCROLLEND_HANDLER_DEBOUNCE_MS);\n\n const handleScroll = () => {\n isScrolling.current = true;\n handleScrollEnd();\n };\n parentRef.current?.addEventListener('scroll', handleScroll);\n\n return () => {\n parentRef.current?.removeEventListener('scroll', handleScroll);\n };\n }, []);\n\n const refCallback: RefCallback<HTMLDivElement> = useCallback((node) => {\n parentRef.current = node ? node.parentElement : null;\n }, []);\n\n useEffect(() => {\n virtualizer.scrollToIndex(0);\n }, [currentParentId, sortedItems, virtualizer]);\n\n return (\n <div\n ref={refCallback}\n className={styles.virtualizedList}\n style={{\n height: `${virtualizer.getTotalSize()}px`,\n }}\n >\n {itemsVirtualizer.map((virtualItem) => {\n const isContentBeforeItem = withContentBefore && virtualItem.index === 0;\n const isContentAfterItem = withContentAfter && virtualItem.index === count - 1;\n const isSelectAllItem =\n isSelectable &&\n ((virtualItem.index === 0 && !withContentBefore) || (virtualItem.index === 1 && withContentBefore));\n\n if (isContentBeforeItem) {\n return (\n <div\n key={virtualItem.key}\n ref={virtualizer.measureElement}\n data-index={virtualItem.index}\n className={styles.virtualizedItem}\n style={{\n transform: `translateY(${virtualItem.start}px)`,\n }}\n >\n {renderContentBefore(isSearch)}\n </div>\n );\n }\n\n if (isContentAfterItem) {\n return (\n <div\n key={virtualItem.key}\n ref={virtualizer.measureElement}\n data-index={virtualItem.index}\n className={styles.virtualizedItem}\n style={{\n transform: `translateY(${virtualItem.start}px)`,\n }}\n >\n {renderContentAfter(isSearch)}\n </div>\n );\n }\n\n if (isSelectAllItem) {\n return (\n <div\n key={virtualItem.key}\n ref={virtualizer.measureElement}\n data-index={virtualItem.index}\n className={styles.virtualizedItem}\n style={{\n transform: `translateY(${virtualItem.start}px)`,\n }}\n >\n <div className={styles.mobileItem}>\n <CheckableCardElement\n padding={16}\n flexible\n borderRadius={12}\n Element=\"label\"\n checked={selected.includes(currentParentId)}\n data-qa={`tree-selector-select-all-${currentParentId}`}\n >\n <Cell\n Element={'div'}\n disabled={disabled.includes(currentParentId)}\n right={\n <Action\n selected={selected.includes(currentParentId)}\n onChange={onChange}\n id={currentParentId}\n singleChoice={singleChoice}\n />\n }\n >\n <CellText>{getSelectAllParentTrl(currentParentId)}</CellText>\n </Cell>\n </CheckableCardElement>\n </div>\n </div>\n );\n }\n const itemIndex = virtualItem.index - (isSelectable ? 1 : 0) - (withContentBefore ? 1 : 0);\n const item = sortedItems[itemIndex];\n const hasChildren = collection.hasChildren(item.id);\n const hasLetter = item.additional?.char && !isSearch;\n const link = item.additional?.link;\n const delimiterLink = link && <Link href={link.href}>{link.anchor}</Link>;\n const delimiterContent = renderMobileDelimiter?.({\n item,\n order: orderHashMap[item.id],\n isSearch,\n index: itemIndex,\n isTopLevel: !currentParentId,\n });\n const withGap =\n (!!withContentBefore && virtualItem.index !== 1) || (!withContentBefore && virtualItem.index !== 0);\n return (\n <div\n key={virtualItem.key}\n ref={virtualizer.measureElement}\n data-index={virtualItem.index}\n style={{\n transform: `translateY(${virtualItem.start}px)`,\n }}\n className={classnames(styles.virtualizedItem, {\n [styles.withGap]: withGap,\n })}\n >\n <div className={styles.mobileItem}>\n {hasLetter && (\n <MobileDelimiter link={delimiterLink}>{item.additional?.char}</MobileDelimiter>\n )}\n {delimiterContent && <MobileDelimiter>{delimiterContent}</MobileDelimiter>}\n {hasChildren ? (\n <MobileParentItem\n collection={collection}\n item={item}\n selected={selected}\n onClick={() => {\n prevParentIds.current.push(currentParentId);\n prevQueries.current.push(currentQuery.current);\n setCurrentParentId(item.id);\n setInputValue('');\n currentQuery.current = '';\n navigationChangeCallback.current?.(item.id);\n }}\n parentId={currentParentId}\n isSearch={isSearch}\n renderItem={renderItem}\n />\n ) : (\n <MobileItem\n item={item}\n singleChoice={singleChoice}\n isSelectable={checkSelectable?.(item.id, collection)}\n isSelected={selected.includes(item.id)}\n isDisabled={disabled.includes(item.id)}\n onChange={onChange}\n isSearch={isSearch}\n renderItem={renderItem}\n parentId={currentParentId}\n />\n )}\n </div>\n </div>\n );\n })}\n </div>\n );\n};\n\nexport const MobileItemsList = forwardRef(MobileItemsListComponent) as <Additional extends AdditionalDefault>(\n props: MobileItemsListProps<Additional> & { ref?: ForwardedRef<ListControls> }\n) => ReactElement;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AA4BA,MAAM,mBAAsB,GAAA,EAAA,CAAA;AAC5B,MAAM,6BAAgC,GAAA,GAAA,CAAA;AACtC,MAAM,SAAY,GAAA,GAAA,CAAA;AAyBlB,MAAM,wBAAA,GAA2B,CAC7B,KAAA,EACA,GACe,KAAA;AACf,EAAM,MAAA;AAAA,IACF,UAAA;AAAA,IACA,QAAA;AAAA,IACA,QAAA;AAAA,IACA,UAAA;AAAA,IACA,YAAA;AAAA,IACA,QAAA;AAAA,IACA,eAAA;AAAA,IACA,wBAAA;AAAA,IACA,aAAA;AAAA,IACA,iBAAA;AAAA,IACA,QAAA;AAAA,IACA,qBA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AA,EAAA,EAAI,UAAU,CAAA;AAAA,kBACnD,UAAY,EAAA,QAAA,CAAS,QAAS,CAAA,IAAA,CAAK,EAAE,CAAA;AAAA,kBACrC,UAAY,EAAA,QAAA,CAAS,QAAS,CAAA,IAAA,CAAK,EAAE,CAAA;AAAA,kBACrC,QAAA;AAAA,kBACA,QAAA;AAAA,kBACA,UAAA;AAAA,kBACA,QAAU,EAAA,eAAA;AAAA,iBAAA;AAAA,eACd;AAAA,aAER,EAAA,CAAA;AAAA,WAAA;AAAA,UA7CK,WAAY,CAAA,GAAA;AAAA,SA8CrB,CAAA;AAAA,OAEP,CAAA;AAAA,KAAA;AAAA,GACL,CAAA;AAER,CAAA,CAAA;AAEa,MAAA,eAAA,GAAkB,WAAW,wBAAwB;;;;"}
|
package/TreeSelector.js
CHANGED
|
@@ -19,15 +19,17 @@ import '@hh.ru/magritte-ui-checkbox-radio';
|
|
|
19
19
|
import './TreeSelectorItemBase.js';
|
|
20
20
|
import '@hh.ru/magritte-ui-cell';
|
|
21
21
|
import '@hh.ru/magritte-ui-typography';
|
|
22
|
-
import './tree-selector-item-
|
|
22
|
+
import './tree-selector-item-CnEnj_YP.js';
|
|
23
23
|
import './MobileItemsList.js';
|
|
24
24
|
import '@hh.ru/magritte-common-func-utils';
|
|
25
25
|
import '@hh.ru/magritte-ui-checkable-card/CheckableCardElement';
|
|
26
|
+
import '@hh.ru/magritte-ui-link';
|
|
26
27
|
import './MobileDelimiter.js';
|
|
27
|
-
import '@hh.ru/magritte-ui-
|
|
28
|
+
import '@hh.ru/magritte-ui-section-header';
|
|
28
29
|
import './MobileItem.js';
|
|
29
30
|
import './MobileParentItem.js';
|
|
30
31
|
import '@hh.ru/magritte-ui-badge';
|
|
32
|
+
import '@hh.ru/magritte-ui-card';
|
|
31
33
|
import './TreeSelectorWrapper.js';
|
|
32
34
|
import '@hh.ru/magritte-common-use-multiple-refs';
|
|
33
35
|
import '@hh.ru/magritte-internal-custom-scroll';
|
package/TreeSelector.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeSelector.js","sources":["src/TreeSelector.tsx"],"sourcesContent":["import { ForwardedRef, forwardRef, ReactElement, useMemo } from 'react';\n\nimport { TreeSelectorDummy } from '@hh.ru/magritte-ui-tree-selector/TreeSelectorDummy';\nimport { AdditionalDefault } from '@hh.ru/magritte-ui-tree-selector/collection/types';\nimport ImmutableSelectionStrategy from '@hh.ru/magritte-ui-tree-selector/strategy/immutableSelectionStrategy';\nimport { TreeSelectorProps, ListControls } from '@hh.ru/magritte-ui-tree-selector/types';\nimport { useDisabled } from '@hh.ru/magritte-ui-tree-selector/useDisabled';\nimport { useSelected } from '@hh.ru/magritte-ui-tree-selector/useSelected';\n\nconst TreeSelectorComponent = <Additional extends AdditionalDefault>(\n props: TreeSelectorProps<Additional>,\n ref: ForwardedRef<ListControls>\n): ReactElement => {\n const {\n value,\n collection,\n singleChoice,\n leavesOnly,\n collapseToParentId,\n checkSelectable,\n onChange,\n disabled,\n maxSelected,\n ...rest\n } = props;\n const strategy = useMemo(\n () =>\n new ImmutableSelectionStrategy(collection, {\n singleChoice,\n leavesOnly,\n checkSelectable,\n }),\n [collection, singleChoice, leavesOnly, checkSelectable]\n );\n\n if (maxSelected && !collapseToParentId && !leavesOnly) {\n throw new Error(\n `Magritte component TreeSelector: maxSelected can be used only with collapseToParentId or leavesOnly`\n );\n }\n\n const { selected, setSelected } = useSelected({\n value,\n strategy,\n collection,\n onChange,\n maxSelected,\n collapseToParentId,\n });\n\n const currentDisabled = useDisabled({ selected, disabled, collection, maxSelected });\n\n return (\n <TreeSelectorDummy\n {...rest}\n value={selected}\n disabled={currentDisabled}\n collection={collection}\n singleChoice={singleChoice}\n leavesOnly={leavesOnly}\n checkSelectable={checkSelectable}\n onChange={setSelected}\n ref={ref}\n />\n );\n};\n\nexport const TreeSelector = forwardRef(TreeSelectorComponent) as <Additional extends AdditionalDefault>(\n props: TreeSelectorProps<Additional> & { ref?: ForwardedRef<ListControls> }\n) => ReactElement;\n"],"names":["ImmutableSelectionStrategy"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TreeSelector.js","sources":["src/TreeSelector.tsx"],"sourcesContent":["import { ForwardedRef, forwardRef, ReactElement, useMemo } from 'react';\n\nimport { TreeSelectorDummy } from '@hh.ru/magritte-ui-tree-selector/TreeSelectorDummy';\nimport { AdditionalDefault } from '@hh.ru/magritte-ui-tree-selector/collection/types';\nimport ImmutableSelectionStrategy from '@hh.ru/magritte-ui-tree-selector/strategy/immutableSelectionStrategy';\nimport { TreeSelectorProps, ListControls } from '@hh.ru/magritte-ui-tree-selector/types';\nimport { useDisabled } from '@hh.ru/magritte-ui-tree-selector/useDisabled';\nimport { useSelected } from '@hh.ru/magritte-ui-tree-selector/useSelected';\n\nconst TreeSelectorComponent = <Additional extends AdditionalDefault>(\n props: TreeSelectorProps<Additional>,\n ref: ForwardedRef<ListControls>\n): ReactElement => {\n const {\n value,\n collection,\n singleChoice,\n leavesOnly,\n collapseToParentId,\n checkSelectable,\n onChange,\n disabled,\n maxSelected,\n ...rest\n } = props;\n const strategy = useMemo(\n () =>\n new ImmutableSelectionStrategy(collection, {\n singleChoice,\n leavesOnly,\n checkSelectable,\n }),\n [collection, singleChoice, leavesOnly, checkSelectable]\n );\n\n if (maxSelected && !collapseToParentId && !leavesOnly) {\n throw new Error(\n `Magritte component TreeSelector: maxSelected can be used only with collapseToParentId or leavesOnly`\n );\n }\n\n const { selected, setSelected } = useSelected({\n value,\n strategy,\n collection,\n onChange,\n maxSelected,\n collapseToParentId,\n });\n\n const currentDisabled = useDisabled({ selected, disabled, collection, maxSelected });\n\n return (\n <TreeSelectorDummy\n {...rest}\n value={selected}\n disabled={currentDisabled}\n collection={collection}\n singleChoice={singleChoice}\n leavesOnly={leavesOnly}\n checkSelectable={checkSelectable}\n onChange={setSelected}\n ref={ref}\n />\n );\n};\n\nexport const TreeSelector = forwardRef(TreeSelectorComponent) as <Additional extends AdditionalDefault>(\n props: TreeSelectorProps<Additional> & { ref?: ForwardedRef<ListControls> }\n) => ReactElement;\n"],"names":["ImmutableSelectionStrategy"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,MAAM,qBAAA,GAAwB,CAC1B,KAAA,EACA,GACe,KAAA;AACf,EAAM,MAAA;AAAA,IACF,KAAA;AAAA,IACA,UAAA;AAAA,IACA,YAAA;AAAA,IACA,UAAA;AAAA,IACA,kBAAA;AAAA,IACA,eAAA;AAAA,IACA,QAAA;AAAA,IACA,QAAA;AAAA,IACA,WAAA;AAAA,IACA,GAAG,IAAA;AAAA,GACH,GAAA,KAAA,CAAA;AACJ,EAAA,MAAM,QAAW,GAAA,OAAA;AAAA,IACb,MACI,IAAIA,kCAAA,CAA2B,UAAY,EAAA;AAAA,MACvC,YAAA;AAAA,MACA,UAAA;AAAA,MACA,eAAA;AAAA,KACH,CAAA;AAAA,IACL,CAAC,UAAA,EAAY,YAAc,EAAA,UAAA,EAAY,eAAe,CAAA;AAAA,GAC1D,CAAA;AAEA,EAAA,IAAI,WAAe,IAAA,CAAC,kBAAsB,IAAA,CAAC,UAAY,EAAA;AACnD,IAAA,MAAM,IAAI,KAAA;AAAA,MACN,CAAA,mGAAA,CAAA;AAAA,KACJ,CAAA;AAAA,GACJ;AAEA,EAAA,MAAM,EAAE,QAAA,EAAU,WAAY,EAAA,GAAI,WAAY,CAAA;AAAA,IAC1C,KAAA;AAAA,IACA,QAAA;AAAA,IACA,UAAA;AAAA,IACA,QAAA;AAAA,IACA,WAAA;AAAA,IACA,kBAAA;AAAA,GACH,CAAA,CAAA;AAED,EAAA,MAAM,kBAAkB,WAAY,CAAA,EAAE,UAAU,QAAU,EAAA,UAAA,EAAY,aAAa,CAAA,CAAA;AAEnF,EACI,uBAAA,GAAA;AAAA,IAAC,iBAAA;AAAA,IAAA;AAAA,MACI,GAAG,IAAA;AAAA,MACJ,KAAO,EAAA,QAAA;AAAA,MACP,QAAU,EAAA,eAAA;AAAA,MACV,UAAA;AAAA,MACA,YAAA;AAAA,MACA,UAAA;AAAA,MACA,eAAA;AAAA,MACA,QAAU,EAAA,WAAA;AAAA,MACV,GAAA;AAAA,KAAA;AAAA,GACJ,CAAA;AAER,CAAA,CAAA;AAEa,MAAA,YAAA,GAAe,WAAW,qBAAqB;;;;"}
|
package/TreeSelectorDummy.js
CHANGED
|
@@ -21,14 +21,16 @@ import '@hh.ru/magritte-ui-checkbox-radio';
|
|
|
21
21
|
import './TreeSelectorItemBase.js';
|
|
22
22
|
import '@hh.ru/magritte-ui-cell';
|
|
23
23
|
import '@hh.ru/magritte-ui-typography';
|
|
24
|
-
import './tree-selector-item-
|
|
24
|
+
import './tree-selector-item-CnEnj_YP.js';
|
|
25
25
|
import '@hh.ru/magritte-common-func-utils';
|
|
26
26
|
import '@hh.ru/magritte-ui-checkable-card/CheckableCardElement';
|
|
27
|
+
import '@hh.ru/magritte-ui-link';
|
|
27
28
|
import './MobileDelimiter.js';
|
|
28
|
-
import '@hh.ru/magritte-ui-
|
|
29
|
+
import '@hh.ru/magritte-ui-section-header';
|
|
29
30
|
import './MobileItem.js';
|
|
30
31
|
import './MobileParentItem.js';
|
|
31
32
|
import '@hh.ru/magritte-ui-badge';
|
|
33
|
+
import '@hh.ru/magritte-ui-card';
|
|
32
34
|
import '@hh.ru/magritte-common-use-multiple-refs';
|
|
33
35
|
import '@hh.ru/magritte-internal-custom-scroll';
|
|
34
36
|
import '@hh.ru/magritte-ui-scrollbar';
|
package/TreeSelectorDummy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeSelectorDummy.js","sources":["src/TreeSelectorDummy.tsx"],"sourcesContent":["import { ReactElement, forwardRef, ForwardedRef, useCallback, useEffect, useRef, useState, RefCallback } from 'react';\n\nimport { match } from '@hh.ru/magritte-common-fuzzy-search';\nimport { useBreakpoint } from '@hh.ru/magritte-ui-breakpoint';\nimport { ItemsList } from '@hh.ru/magritte-ui-tree-selector/ItemsList';\nimport { MobileItemsList } from '@hh.ru/magritte-ui-tree-selector/MobileItemsList';\nimport { TreeSelectorWrapper } from '@hh.ru/magritte-ui-tree-selector/TreeSelectorWrapper';\nimport { filterWithParents } from '@hh.ru/magritte-ui-tree-selector/collection/treeCollectionHelper';\nimport { AdditionalDefault, TreeModel } from '@hh.ru/magritte-ui-tree-selector/collection/types';\nimport { ListControls, TreeSelectorDummyProps } from '@hh.ru/magritte-ui-tree-selector/types';\nimport { useExpanded } from '@hh.ru/magritte-ui-tree-selector/useExpanded';\nimport { useIndeterminate } from '@hh.ru/magritte-ui-tree-selector/useIndeterminate';\nimport { useRenderInput } from '@hh.ru/magritte-ui-tree-selector/useRenderInput';\n\nconst defaultCheckSelectable = () => true;\nconst defaultArray: string[] = [];\n\nconst needToApply = (query: string): boolean => {\n return !!(query && query.length);\n};\n\nexport const TreeSelectorDummyComponent = <Additional extends AdditionalDefault>(\n {\n collection: initialCollection,\n checkSelectable = defaultCheckSelectable,\n initialExpanded = defaultArray,\n value: selected,\n leavesOnly,\n singleChoice,\n disabled = defaultArray,\n treeFilter = filterWithParents,\n suggestedNotFound = defaultArray,\n constantlySuggested = defaultArray,\n renderItemForDesktop,\n renderItem,\n renderMobileDelimiter,\n onExpand,\n onChange,\n onChangeFilterQuery,\n contentNotFound,\n onMobileNavigationChange,\n getMobileSearchItemOrder,\n expandTreeOnSelected = true,\n getSelectAllParentTrl,\n renderContentBefore,\n renderContentAfter,\n children,\n }: TreeSelectorDummyProps<Additional>,\n ref: ForwardedRef<ListControls>\n): ReactElement => {\n const [collection, setCollection] = useState(initialCollection);\n const [isSearch, setIsSearch] = useState(false);\n const currentQuery = useRef('');\n const inputRef = useRef<HTMLInputElement>(null);\n const suggestedNotFoundModels = useRef(initialCollection.getExistModels(suggestedNotFound));\n const constantlySuggestedModels = useRef(initialCollection.getExistModels(constantlySuggested));\n const getSearchItemOrderDefault = useCallback(\n (model: TreeModel<Additional>) => {\n return initialCollection.getModelLevel(model.id);\n },\n [initialCollection]\n );\n\n const { indeterminate } = useIndeterminate({ collection: initialCollection, selected });\n\n const {\n expanded: currentExpanded,\n setExpanded,\n handleExpansion,\n handleResetExpanded,\n } = useExpanded({\n initialValue: initialExpanded?.slice(),\n selected,\n expandTreeOnSelected,\n collection: initialCollection,\n onExpand,\n });\n const { isMobile } = useBreakpoint();\n\n const { contentFilterQuery, setInputValue, handleChangeInput, renderInput } = useRenderInput(inputRef);\n\n const treeRefCallback: RefCallback<HTMLDivElement> = useCallback(\n (node) => {\n // делаем сброс при монтировании компонента, пока он размонтирован нам не важно какой именно пункт раскрыт\n if (node) {\n handleResetExpanded();\n }\n },\n // игнорируем зависимость от selected, т.к. триггером сброса состояния expanded должен быть именно\n // маунт компонента, а не изменение выбранной опции\n [handleResetExpanded]\n );\n\n useEffect(() => {\n const contentFilterQueryTrimmed = contentFilterQuery.trim();\n const queryWasChanged = contentFilterQueryTrimmed !== currentQuery.current.trim();\n\n if (queryWasChanged && needToApply(contentFilterQueryTrimmed)) {\n const newExpanded: string[] = [];\n const newCollection = treeFilter(\n initialCollection,\n (item) => match(contentFilterQueryTrimmed, item.text),\n isMobile\n );\n newCollection.toList().forEach((item) => {\n if (newCollection.hasChildren(item.id)) {\n // Если есть в отфильтрованной коллекции есть дочерние элементы,\n // значит они заматчились, и нужно открыть родителя.\n newExpanded.push(item.id);\n } else {\n // Если заматчился только сам родитель, показываем его\n // схлопнутым => нужно добавить его ветку в коллекцию.\n initialCollection.walkChildren(item.id, (child, parents) => {\n newCollection.addModel({ ...child }, parents[0].id);\n });\n }\n });\n\n const filteredIds = newCollection.toList().map((model) => model.id);\n\n // Если в отфильтрованной коллекции нет моделей, но заданы предложенные,\n // то показываем их\n // Если в отфильтрованной коллекции модели есть, то пробуем добавить к ним\n // всегда показывающиеся модели, если их ещё нет в коллекции\n if (!filteredIds.length && suggestedNotFoundModels.current.length) {\n suggestedNotFoundModels.current.forEach((model) => newCollection.addModel({ ...model }));\n } else {\n constantlySuggestedModels.current.forEach((model) => {\n if (!filteredIds.includes(model.id)) {\n newCollection.addModel({ ...model });\n }\n });\n }\n\n setCollection(newCollection);\n currentQuery.current = contentFilterQuery;\n onChangeFilterQuery?.(filteredIds, contentFilterQueryTrimmed);\n setExpanded(newExpanded);\n setIsSearch(true);\n } else if (queryWasChanged) {\n // Запрос не годится для поиска.\n const newExpanded = initialExpanded.slice();\n setCollection(initialCollection);\n\n onChangeFilterQuery?.(\n initialCollection.toList().map((model) => model.id),\n contentFilterQueryTrimmed\n );\n currentQuery.current = contentFilterQuery;\n if (inputRef.current) {\n setExpanded(newExpanded);\n } else {\n handleResetExpanded();\n }\n\n setIsSearch(false);\n }\n }, [\n initialCollection,\n contentFilterQuery,\n treeFilter,\n selected,\n setExpanded,\n isMobile,\n onChangeFilterQuery,\n handleResetExpanded,\n initialExpanded,\n ]);\n\n const renderTreeSelector = useCallback(() => {\n const hasModels = collection.getTopLevel().length;\n return (\n <TreeSelectorWrapper forwardRef={treeRefCallback}>\n {/* eslint-disable-next-line no-nested-ternary */}\n {hasModels ? (\n isMobile ? (\n <MobileItemsList\n getMobileSearchItemOrder={getMobileSearchItemOrder || getSearchItemOrderDefault}\n collection={collection}\n selected={selected}\n disabled={disabled}\n onChange={onChange}\n leavesOnly={leavesOnly}\n checkSelectable={checkSelectable}\n singleChoice={singleChoice}\n ref={ref}\n setInputValue={setInputValue}\n renderItem={renderItem}\n renderMobileDelimiter={renderMobileDelimiter}\n handleChangeInput={handleChangeInput}\n contentFilterQuery={contentFilterQuery.trim()}\n onMobileNavigationChange={onMobileNavigationChange}\n isSearch={isSearch}\n getSelectAllParentTrl={getSelectAllParentTrl}\n renderContentBefore={renderContentBefore}\n renderContentAfter={renderContentAfter}\n />\n ) : (\n <ItemsList\n collection={collection}\n leavesOnly={leavesOnly}\n checkSelectable={checkSelectable}\n expanded={currentExpanded}\n onExpansion={handleExpansion}\n selected={selected}\n onChange={onChange}\n disabled={disabled}\n singleChoice={singleChoice}\n indeterminate={indeterminate}\n isSearch={isSearch}\n renderItemForDesktop={renderItemForDesktop}\n renderContentBefore={renderContentBefore}\n renderContentAfter={renderContentAfter}\n />\n )\n ) : (\n <>{contentNotFound}</>\n )}\n </TreeSelectorWrapper>\n );\n }, [\n collection,\n treeRefCallback,\n isMobile,\n getMobileSearchItemOrder,\n getSearchItemOrderDefault,\n selected,\n disabled,\n onChange,\n leavesOnly,\n checkSelectable,\n singleChoice,\n ref,\n setInputValue,\n renderItem,\n renderMobileDelimiter,\n handleChangeInput,\n contentFilterQuery,\n onMobileNavigationChange,\n isSearch,\n getSelectAllParentTrl,\n renderContentBefore,\n renderContentAfter,\n currentExpanded,\n handleExpansion,\n indeterminate,\n renderItemForDesktop,\n contentNotFound,\n ]);\n\n return <>{children({ renderTreeSelector, renderInput })}</>;\n};\n\nexport const TreeSelectorDummy = forwardRef(TreeSelectorDummyComponent) as <Additional extends AdditionalDefault>(\n props: TreeSelectorDummyProps<Additional> & { ref?: ForwardedRef<ListControls> }\n) => ReactElement;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,MAAM,yBAAyB,MAAM,IAAA,CAAA;AACrC,MAAM,eAAyB,EAAC,CAAA;AAEhC,MAAM,WAAA,GAAc,CAAC,KAA2B,KAAA;AAC5C,EAAO,OAAA,CAAC,EAAE,KAAA,IAAS,KAAM,CAAA,MAAA,CAAA,CAAA;AAC7B,CAAA,CAAA;AAEO,MAAM,6BAA6B,CACtC;AAAA,EACI,UAAY,EAAA,iBAAA;AAAA,EACZ,eAAkB,GAAA,sBAAA;AAAA,EAClB,eAAkB,GAAA,YAAA;AAAA,EAClB,KAAO,EAAA,QAAA;AAAA,EACP,UAAA;AAAA,EACA,YAAA;AAAA,EACA,QAAW,GAAA,YAAA;AAAA,EACX,UAAa,GAAA,iBAAA;AAAA,EACb,iBAAoB,GAAA,YAAA;AAAA,EACpB,mBAAsB,GAAA,YAAA;AAAA,EACtB,oBAAA;AAAA,EAC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AAAA,QACV,WAAa,EAAA,eAAA;AAAA,QACb,QAAA;AAAA,QACA,QAAA;AAAA,QACA,QAAA;AAAA,QACA,YAAA;AAAA,QACA,aAAA;AAAA,QACA,QAAA;AAAA,QACA,oBAAA;AAAA,QACA,mBAAA;AAAA,QACA,kBAAA;AAAA,OAAA;AAAA,KACJ,mBAGD,GAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA,eAAA,EAAgB,CAE3B,EAAA,CAAA,CAAA;AAAA,GAEL,EAAA;AAAA,IACC,UAAA;AAAA,IACA,eAAA;AAAA,IACA,QAAA;AAAA,IACA,wBAAA;AAAA,IACA,yBAAA;AAAA,IACA,QAAA;AAAA,IACA,QAAA;AAAA,IACA,QAAA;AAAA,IACA,UAAA;AAAA,IACA,eAAA;AAAA,IACA,YAAA;AAAA,IACA,GAAA;AAAA,IACA,aAAA;AAAA,IACA,UAAA;AAAA,IACA,qBAAA;AAAA,IACA,iBAAA;AAAA,IACA,kBAAA;AAAA,IACA,wBAAA;AAAA,IACA,QAAA;AAAA,IACA,qBAAA;AAAA,IACA,mBAAA;AAAA,IACA,kBAAA;AAAA,IACA,eAAA;AAAA,IACA,eAAA;AAAA,IACA,aAAA;AAAA,IACA,oBAAA;AAAA,IACA,eAAA;AAAA,GACH,CAAA,CAAA;AAED,EAAA,uCAAU,QAAS,EAAA,QAAA,CAAA,EAAE,kBAAoB,EAAA,WAAA,EAAa,CAAE,EAAA,CAAA,CAAA;AAC5D,EAAA;AAEa,MAAA,iBAAA,GAAoB,WAAW,0BAA0B;;;;"}
|
|
1
|
+
{"version":3,"file":"TreeSelectorDummy.js","sources":["src/TreeSelectorDummy.tsx"],"sourcesContent":["import { ReactElement, forwardRef, ForwardedRef, useCallback, useEffect, useRef, useState, RefCallback } from 'react';\n\nimport { match } from '@hh.ru/magritte-common-fuzzy-search';\nimport { useBreakpoint } from '@hh.ru/magritte-ui-breakpoint';\nimport { ItemsList } from '@hh.ru/magritte-ui-tree-selector/ItemsList';\nimport { MobileItemsList } from '@hh.ru/magritte-ui-tree-selector/MobileItemsList';\nimport { TreeSelectorWrapper } from '@hh.ru/magritte-ui-tree-selector/TreeSelectorWrapper';\nimport { filterWithParents } from '@hh.ru/magritte-ui-tree-selector/collection/treeCollectionHelper';\nimport { AdditionalDefault, TreeModel } from '@hh.ru/magritte-ui-tree-selector/collection/types';\nimport { ListControls, TreeSelectorDummyProps } from '@hh.ru/magritte-ui-tree-selector/types';\nimport { useExpanded } from '@hh.ru/magritte-ui-tree-selector/useExpanded';\nimport { useIndeterminate } from '@hh.ru/magritte-ui-tree-selector/useIndeterminate';\nimport { useRenderInput } from '@hh.ru/magritte-ui-tree-selector/useRenderInput';\n\nconst defaultCheckSelectable = () => true;\nconst defaultArray: string[] = [];\n\nconst needToApply = (query: string): boolean => {\n return !!(query && query.length);\n};\n\nexport const TreeSelectorDummyComponent = <Additional extends AdditionalDefault>(\n {\n collection: initialCollection,\n checkSelectable = defaultCheckSelectable,\n initialExpanded = defaultArray,\n value: selected,\n leavesOnly,\n singleChoice,\n disabled = defaultArray,\n treeFilter = filterWithParents,\n suggestedNotFound = defaultArray,\n constantlySuggested = defaultArray,\n renderItemForDesktop,\n renderItem,\n renderMobileDelimiter,\n onExpand,\n onChange,\n onChangeFilterQuery,\n contentNotFound,\n onMobileNavigationChange,\n getMobileSearchItemOrder,\n expandTreeOnSelected = true,\n getSelectAllParentTrl,\n renderContentBefore,\n renderContentAfter,\n children,\n }: TreeSelectorDummyProps<Additional>,\n ref: ForwardedRef<ListControls>\n): ReactElement => {\n const [collection, setCollection] = useState(initialCollection);\n const [isSearch, setIsSearch] = useState(false);\n const currentQuery = useRef('');\n const inputRef = useRef<HTMLInputElement>(null);\n const suggestedNotFoundModels = useRef(initialCollection.getExistModels(suggestedNotFound));\n const constantlySuggestedModels = useRef(initialCollection.getExistModels(constantlySuggested));\n const getSearchItemOrderDefault = useCallback(\n (model: TreeModel<Additional>) => {\n return initialCollection.getModelLevel(model.id);\n },\n [initialCollection]\n );\n\n const { indeterminate } = useIndeterminate({ collection: initialCollection, selected });\n\n const {\n expanded: currentExpanded,\n setExpanded,\n handleExpansion,\n handleResetExpanded,\n } = useExpanded({\n initialValue: initialExpanded?.slice(),\n selected,\n expandTreeOnSelected,\n collection: initialCollection,\n onExpand,\n });\n const { isMobile } = useBreakpoint();\n\n const { contentFilterQuery, setInputValue, handleChangeInput, renderInput } = useRenderInput(inputRef);\n\n const treeRefCallback: RefCallback<HTMLDivElement> = useCallback(\n (node) => {\n // делаем сброс при монтировании компонента, пока он размонтирован нам не важно какой именно пункт раскрыт\n if (node) {\n handleResetExpanded();\n }\n },\n // игнорируем зависимость от selected, т.к. триггером сброса состояния expanded должен быть именно\n // маунт компонента, а не изменение выбранной опции\n [handleResetExpanded]\n );\n\n useEffect(() => {\n const contentFilterQueryTrimmed = contentFilterQuery.trim();\n const queryWasChanged = contentFilterQueryTrimmed !== currentQuery.current.trim();\n\n if (queryWasChanged && needToApply(contentFilterQueryTrimmed)) {\n const newExpanded: string[] = [];\n const newCollection = treeFilter(\n initialCollection,\n (item) => match(contentFilterQueryTrimmed, item.text),\n isMobile\n );\n newCollection.toList().forEach((item) => {\n if (newCollection.hasChildren(item.id)) {\n // Если есть в отфильтрованной коллекции есть дочерние элементы,\n // значит они заматчились, и нужно открыть родителя.\n newExpanded.push(item.id);\n } else {\n // Если заматчился только сам родитель, показываем его\n // схлопнутым => нужно добавить его ветку в коллекцию.\n initialCollection.walkChildren(item.id, (child, parents) => {\n newCollection.addModel({ ...child }, parents[0].id);\n });\n }\n });\n\n const filteredIds = newCollection.toList().map((model) => model.id);\n\n // Если в отфильтрованной коллекции нет моделей, но заданы предложенные,\n // то показываем их\n // Если в отфильтрованной коллекции модели есть, то пробуем добавить к ним\n // всегда показывающиеся модели, если их ещё нет в коллекции\n if (!filteredIds.length && suggestedNotFoundModels.current.length) {\n suggestedNotFoundModels.current.forEach((model) => newCollection.addModel({ ...model }));\n } else {\n constantlySuggestedModels.current.forEach((model) => {\n if (!filteredIds.includes(model.id)) {\n newCollection.addModel({ ...model });\n }\n });\n }\n\n setCollection(newCollection);\n currentQuery.current = contentFilterQuery;\n onChangeFilterQuery?.(filteredIds, contentFilterQueryTrimmed);\n setExpanded(newExpanded);\n setIsSearch(true);\n } else if (queryWasChanged) {\n // Запрос не годится для поиска.\n const newExpanded = initialExpanded.slice();\n setCollection(initialCollection);\n\n onChangeFilterQuery?.(\n initialCollection.toList().map((model) => model.id),\n contentFilterQueryTrimmed\n );\n currentQuery.current = contentFilterQuery;\n if (inputRef.current) {\n setExpanded(newExpanded);\n } else {\n handleResetExpanded();\n }\n\n setIsSearch(false);\n }\n }, [\n initialCollection,\n contentFilterQuery,\n treeFilter,\n selected,\n setExpanded,\n isMobile,\n onChangeFilterQuery,\n handleResetExpanded,\n initialExpanded,\n ]);\n\n const renderTreeSelector = useCallback(() => {\n const hasModels = collection.getTopLevel().length;\n return (\n <TreeSelectorWrapper forwardRef={treeRefCallback}>\n {/* eslint-disable-next-line no-nested-ternary */}\n {hasModels ? (\n isMobile ? (\n <MobileItemsList\n getMobileSearchItemOrder={getMobileSearchItemOrder || getSearchItemOrderDefault}\n collection={collection}\n selected={selected}\n disabled={disabled}\n onChange={onChange}\n leavesOnly={leavesOnly}\n checkSelectable={checkSelectable}\n singleChoice={singleChoice}\n ref={ref}\n setInputValue={setInputValue}\n renderItem={renderItem}\n renderMobileDelimiter={renderMobileDelimiter}\n handleChangeInput={handleChangeInput}\n contentFilterQuery={contentFilterQuery.trim()}\n onMobileNavigationChange={onMobileNavigationChange}\n isSearch={isSearch}\n getSelectAllParentTrl={getSelectAllParentTrl}\n renderContentBefore={renderContentBefore}\n renderContentAfter={renderContentAfter}\n />\n ) : (\n <ItemsList\n collection={collection}\n leavesOnly={leavesOnly}\n checkSelectable={checkSelectable}\n expanded={currentExpanded}\n onExpansion={handleExpansion}\n selected={selected}\n onChange={onChange}\n disabled={disabled}\n singleChoice={singleChoice}\n indeterminate={indeterminate}\n isSearch={isSearch}\n renderItemForDesktop={renderItemForDesktop}\n renderContentBefore={renderContentBefore}\n renderContentAfter={renderContentAfter}\n />\n )\n ) : (\n <>{contentNotFound}</>\n )}\n </TreeSelectorWrapper>\n );\n }, [\n collection,\n treeRefCallback,\n isMobile,\n getMobileSearchItemOrder,\n getSearchItemOrderDefault,\n selected,\n disabled,\n onChange,\n leavesOnly,\n checkSelectable,\n singleChoice,\n ref,\n setInputValue,\n renderItem,\n renderMobileDelimiter,\n handleChangeInput,\n contentFilterQuery,\n onMobileNavigationChange,\n isSearch,\n getSelectAllParentTrl,\n renderContentBefore,\n renderContentAfter,\n currentExpanded,\n handleExpansion,\n indeterminate,\n renderItemForDesktop,\n contentNotFound,\n ]);\n\n return <>{children({ renderTreeSelector, renderInput })}</>;\n};\n\nexport const TreeSelectorDummy = forwardRef(TreeSelectorDummyComponent) as <Additional extends AdditionalDefault>(\n props: TreeSelectorDummyProps<Additional> & { ref?: ForwardedRef<ListControls> }\n) => ReactElement;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,MAAM,yBAAyB,MAAM,IAAA,CAAA;AACrC,MAAM,eAAyB,EAAC,CAAA;AAEhC,MAAM,WAAA,GAAc,CAAC,KAA2B,KAAA;AAC5C,EAAO,OAAA,CAAC,EAAE,KAAA,IAAS,KAAM,CAAA,MAAA,CAAA,CAAA;AAC7B,CAAA,CAAA;AAEO,MAAM,6BAA6B,CACtC;AAAA,EACI,UAAY,EAAA,iBAAA;AAAA,EACZ,eAAkB,GAAA,sBAAA;AAAA,EAClB,eAAkB,GAAA,YAAA;AAAA,EAClB,KAAO,EAAA,QAAA;AAAA,EACP,UAAA;AAAA,EACA,YAAA;AAAA,EACA,QAAW,GAAA,YAAA;AAAA,EACX,UAAa,GAAA,iBAAA;AAAA,EACb,iBAAoB,GAAA,YAAA;AAAA,EACpB,mBAAsB,GAAA,YAAA;AAAA,EACtB,oBAAA;AAAA,EACA,UAAA;AA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WAAa,EAAA,eAAA;AAAA,QACb,QAAA;AAAA,QACA,QAAA;AAAA,QACA,QAAA;AAAA,QACA,YAAA;AAAA,QACA,aAAA;AAAA,QACA,QAAA;AAAA,QACA,oBAAA;AAAA,QACA,mBAAA;AAAA,QACA,kBAAA;AAAA,OAAA;AAAA,KACJ,mBAGD,GAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA,eAAA,EAAgB,CAE3B,EAAA,CAAA,CAAA;AAAA,GAEL,EAAA;AAAA,IACC,UAAA;AAAA,IACA,eAAA;AAAA,IACA,QAAA;AAAA,IACA,wBAAA;AAAA,IACA,yBAAA;AAAA,IACA,QAAA;AAAA,IACA,QAAA;AAAA,IACA,QAAA;AAAA,IACA,UAAA;AAAA,IACA,eAAA;AAAA,IACA,YAAA;AAAA,IACA,GAAA;AAAA,IACA,aAAA;AAAA,IACA,UAAA;AAAA,IACA,qBAAA;AAAA,IACA,iBAAA;AAAA,IACA,kBAAA;AAAA,IACA,wBAAA;AAAA,IACA,QAAA;AAAA,IACA,qBAAA;AAAA,IACA,mBAAA;AAAA,IACA,kBAAA;AAAA,IACA,eAAA;AAAA,IACA,eAAA;AAAA,IACA,aAAA;AAAA,IACA,oBAAA;AAAA,IACA,eAAA;AAAA,GACH,CAAA,CAAA;AAED,EAAA,uCAAU,QAAS,EAAA,QAAA,CAAA,EAAE,kBAAoB,EAAA,WAAA,EAAa,CAAE,EAAA,CAAA,CAAA;AAC5D,EAAA;AAEa,MAAA,iBAAA,GAAoB,WAAW,0BAA0B;;;;"}
|
package/TreeSelectorWrapper.js
CHANGED
|
@@ -16,9 +16,9 @@ import '@hh.ru/magritte-ui-checkbox-radio';
|
|
|
16
16
|
import './TreeSelectorItemBase.js';
|
|
17
17
|
import '@hh.ru/magritte-ui-cell';
|
|
18
18
|
import '@hh.ru/magritte-ui-typography';
|
|
19
|
-
import './tree-selector-item-
|
|
19
|
+
import './tree-selector-item-CnEnj_YP.js';
|
|
20
20
|
|
|
21
|
-
var styles = {"wrapper":"magritte-wrapper___EzesX_5-
|
|
21
|
+
var styles = {"wrapper":"magritte-wrapper___EzesX_5-7-0","scroll-container":"magritte-scroll-container___wGzfI_5-7-0","scrollContainer":"magritte-scroll-container___wGzfI_5-7-0"};
|
|
22
22
|
|
|
23
23
|
const TreeSelectorWrapper = ({
|
|
24
24
|
forwardRef,
|
package/collection/types.d.ts
CHANGED
package/index.css
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
--magritte-semantic-animation-ease-in-out-200-timing-function-v26-0-2:cubic-bezier(0.25, 0.1, 0.25, 1);
|
|
9
9
|
--magritte-semantic-animation-ease-in-out-200-duration-v26-0-2:200ms;
|
|
10
10
|
}
|
|
11
|
-
@keyframes magritte-fade-in___yS4Ja_5-
|
|
11
|
+
@keyframes magritte-fade-in___yS4Ja_5-7-0{
|
|
12
12
|
0%{
|
|
13
13
|
opacity:0;
|
|
14
14
|
}
|
|
@@ -16,27 +16,27 @@
|
|
|
16
16
|
opacity:1;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
.magritte-item-animation-timeout___pbOyZ_5-
|
|
20
|
-
animation-name:magritte-fade-in___yS4Ja_5-
|
|
19
|
+
.magritte-item-animation-timeout___pbOyZ_5-7-0{
|
|
20
|
+
animation-name:magritte-fade-in___yS4Ja_5-7-0;
|
|
21
21
|
animation-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v26-0-2);
|
|
22
22
|
--animation-duration:0ms;
|
|
23
23
|
animation-duration:var(--animation-duration);
|
|
24
24
|
}
|
|
25
25
|
@media (prefers-reduced-motion: no-preference){
|
|
26
|
-
.magritte-item-animation-timeout___pbOyZ_5-
|
|
26
|
+
.magritte-item-animation-timeout___pbOyZ_5-7-0{
|
|
27
27
|
--animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v26-0-2);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
.magritte-wrapper___GHKV6_5-
|
|
30
|
+
.magritte-wrapper___GHKV6_5-7-0{
|
|
31
31
|
display:flex;
|
|
32
32
|
padding:12px 0;
|
|
33
33
|
gap:12px;
|
|
34
34
|
align-items:flex-start;
|
|
35
35
|
}
|
|
36
|
-
.magritte-wrapper___GHKV6_5-
|
|
36
|
+
.magritte-wrapper___GHKV6_5-7-0.focus-visible{
|
|
37
37
|
box-shadow:inset 0 0 0 4px var(--magritte-color-stroke-state-focused-accessible-v26-0-2);
|
|
38
38
|
}
|
|
39
|
-
.magritte-letter___yZOCU_5-
|
|
39
|
+
.magritte-letter___yZOCU_5-7-0{
|
|
40
40
|
width:24px;
|
|
41
41
|
height:24px;
|
|
42
42
|
display:flex;
|
|
@@ -44,74 +44,74 @@
|
|
|
44
44
|
justify-content:center;
|
|
45
45
|
flex-shrink:0;
|
|
46
46
|
}
|
|
47
|
-
.magritte-icon___kO3Fj_5-
|
|
48
|
-
.magritte-space___xTO79_5-
|
|
47
|
+
.magritte-icon___kO3Fj_5-7-0,
|
|
48
|
+
.magritte-space___xTO79_5-7-0{
|
|
49
49
|
flex-shrink:0;
|
|
50
50
|
line-height:0;
|
|
51
51
|
width:24px;
|
|
52
52
|
}
|
|
53
|
-
.magritte-icon___kO3Fj_5-
|
|
53
|
+
.magritte-icon___kO3Fj_5-7-0{
|
|
54
54
|
transform:rotate(0);
|
|
55
55
|
}
|
|
56
|
-
.magritte-wrapperActive___Hwk8p_5-
|
|
57
|
-
.magritte-iconActive___4yrG5_5-
|
|
56
|
+
.magritte-wrapperActive___Hwk8p_5-7-0,
|
|
57
|
+
.magritte-iconActive___4yrG5_5-7-0{
|
|
58
58
|
cursor:pointer;
|
|
59
59
|
}
|
|
60
|
-
.magritte-iconUp___mpXV6_5-
|
|
60
|
+
.magritte-iconUp___mpXV6_5-7-0{
|
|
61
61
|
transform:rotate(90deg);
|
|
62
62
|
}
|
|
63
63
|
@media (prefers-reduced-motion: no-preference){
|
|
64
|
-
.magritte-icon___kO3Fj_5-
|
|
64
|
+
.magritte-icon___kO3Fj_5-7-0{
|
|
65
65
|
transition-property:transform;
|
|
66
66
|
transition-duration:var(--magritte-semantic-animation-ease-in-out-100-duration-v26-0-2);
|
|
67
67
|
transition-timing-function:var(--magritte-semantic-animation-ease-in-out-100-timing-function-v26-0-2);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
.magritte-content___ZRc6R_5-
|
|
70
|
+
.magritte-content___ZRc6R_5-7-0{
|
|
71
71
|
flex-grow:1;
|
|
72
72
|
}
|
|
73
|
-
.magritte-mobile-item___ynALC_5-
|
|
73
|
+
.magritte-mobile-item___ynALC_5-7-0{
|
|
74
74
|
display:flex;
|
|
75
75
|
gap:12px;
|
|
76
76
|
flex-wrap:wrap;
|
|
77
77
|
}
|
|
78
|
-
.magritte-with-gap___gbvGO_5-
|
|
78
|
+
.magritte-with-gap___gbvGO_5-7-0{
|
|
79
79
|
padding-top:12px;
|
|
80
80
|
}
|
|
81
|
-
.magritte-virtualized-list___qt2E6_5-
|
|
81
|
+
.magritte-virtualized-list___qt2E6_5-7-0{
|
|
82
82
|
width:100%;
|
|
83
83
|
position:relative;
|
|
84
84
|
will-change:transform;
|
|
85
85
|
}
|
|
86
|
-
.magritte-virtualized-item___qAYVN_5-
|
|
86
|
+
.magritte-virtualized-item___qAYVN_5-7-0{
|
|
87
87
|
position:absolute;
|
|
88
88
|
top:0;
|
|
89
89
|
left:0;
|
|
90
90
|
width:100%;
|
|
91
91
|
}
|
|
92
|
-
.magritte-was-expanded___uCFbW_5-
|
|
93
|
-
animation-name:magritte-fade-in___yS4Ja_5-
|
|
92
|
+
.magritte-was-expanded___uCFbW_5-7-0{
|
|
93
|
+
animation-name:magritte-fade-in___yS4Ja_5-7-0;
|
|
94
94
|
animation-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v26-0-2);
|
|
95
95
|
--animation-duration:0ms;
|
|
96
96
|
animation-duration:var(--animation-duration);
|
|
97
97
|
}
|
|
98
98
|
@media (prefers-reduced-motion: no-preference){
|
|
99
|
-
.magritte-was-expanded___uCFbW_5-
|
|
99
|
+
.magritte-was-expanded___uCFbW_5-7-0{
|
|
100
100
|
--animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v26-0-2);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
.magritte-wrapper___EzesX_5-
|
|
104
|
+
.magritte-wrapper___EzesX_5-7-0{
|
|
105
105
|
height:100%;
|
|
106
106
|
position:relative;
|
|
107
107
|
}
|
|
108
|
-
.magritte-scroll-container___wGzfI_5-
|
|
108
|
+
.magritte-scroll-container___wGzfI_5-7-0{
|
|
109
109
|
height:100%;
|
|
110
110
|
overflow:auto;
|
|
111
111
|
overscroll-behavior:none;
|
|
112
112
|
scrollbar-width:none;
|
|
113
113
|
}
|
|
114
|
-
.magritte-scroll-container___wGzfI_5-
|
|
114
|
+
.magritte-scroll-container___wGzfI_5-7-0::-webkit-scrollbar{
|
|
115
115
|
display:none;
|
|
116
116
|
}
|
|
117
117
|
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
--magritte-semantic-animation-ease-in-out-200-timing-function-v26-0-2:cubic-bezier(0.25, 0.1, 0.25, 1);
|
|
120
120
|
--magritte-semantic-animation-ease-in-out-200-duration-v26-0-2:200ms;
|
|
121
121
|
}
|
|
122
|
-
@keyframes magritte-fade-in___FDoho_5-
|
|
122
|
+
@keyframes magritte-fade-in___FDoho_5-7-0{
|
|
123
123
|
0%{
|
|
124
124
|
opacity:0;
|
|
125
125
|
}
|
|
@@ -127,14 +127,14 @@
|
|
|
127
127
|
opacity:1;
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
.magritte-item-animation-timeout___Pdli9_5-
|
|
131
|
-
animation-name:magritte-fade-in___FDoho_5-
|
|
130
|
+
.magritte-item-animation-timeout___Pdli9_5-7-0{
|
|
131
|
+
animation-name:magritte-fade-in___FDoho_5-7-0;
|
|
132
132
|
animation-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v26-0-2);
|
|
133
133
|
--animation-duration:0ms;
|
|
134
134
|
animation-duration:var(--animation-duration);
|
|
135
135
|
}
|
|
136
136
|
@media (prefers-reduced-motion: no-preference){
|
|
137
|
-
.magritte-item-animation-timeout___Pdli9_5-
|
|
137
|
+
.magritte-item-animation-timeout___Pdli9_5-7-0{
|
|
138
138
|
--animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v26-0-2);
|
|
139
139
|
}
|
|
140
140
|
}
|
package/index.js
CHANGED
|
@@ -26,16 +26,18 @@ import '@hh.ru/magritte-ui-icon/icon';
|
|
|
26
26
|
import './Action.js';
|
|
27
27
|
import '@hh.ru/magritte-ui-checkbox-radio';
|
|
28
28
|
import '@hh.ru/magritte-ui-typography';
|
|
29
|
-
import './tree-selector-item-
|
|
29
|
+
import './tree-selector-item-CnEnj_YP.js';
|
|
30
30
|
import './MobileItemsList.js';
|
|
31
31
|
import '@hh.ru/magritte-common-func-utils';
|
|
32
32
|
import '@hh.ru/magritte-ui-cell';
|
|
33
33
|
import '@hh.ru/magritte-ui-checkable-card/CheckableCardElement';
|
|
34
|
+
import '@hh.ru/magritte-ui-link';
|
|
34
35
|
import './MobileDelimiter.js';
|
|
35
|
-
import '@hh.ru/magritte-ui-
|
|
36
|
+
import '@hh.ru/magritte-ui-section-header';
|
|
36
37
|
import './MobileItem.js';
|
|
37
38
|
import './MobileParentItem.js';
|
|
38
39
|
import '@hh.ru/magritte-ui-badge';
|
|
40
|
+
import '@hh.ru/magritte-ui-card';
|
|
39
41
|
import './useExpanded.js';
|
|
40
42
|
import './useIndeterminate.js';
|
|
41
43
|
import './useRenderInput.js';
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/index.mock.js
CHANGED
|
@@ -25,7 +25,7 @@ import '@hh.ru/magritte-ui-checkbox-radio';
|
|
|
25
25
|
import './TreeSelectorItemBase.js';
|
|
26
26
|
import '@hh.ru/magritte-ui-cell';
|
|
27
27
|
import '@hh.ru/magritte-ui-typography';
|
|
28
|
-
import './tree-selector-item-
|
|
28
|
+
import './tree-selector-item-CnEnj_YP.js';
|
|
29
29
|
|
|
30
30
|
const TreeSelector = mockComponent(
|
|
31
31
|
"TreeSelector",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hh.ru/magritte-ui-tree-selector",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.7.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"sideEffects": [
|
|
@@ -36,8 +36,10 @@
|
|
|
36
36
|
"@hh.ru/magritte-ui-checkbox-radio": "4.2.0",
|
|
37
37
|
"@hh.ru/magritte-ui-icon": "15.2.0",
|
|
38
38
|
"@hh.ru/magritte-ui-input": "9.5.0",
|
|
39
|
+
"@hh.ru/magritte-ui-link": "7.3.0",
|
|
39
40
|
"@hh.ru/magritte-ui-mock-component": "1.1.9",
|
|
40
41
|
"@hh.ru/magritte-ui-scrollbar": "1.1.0",
|
|
42
|
+
"@hh.ru/magritte-ui-section-header": "1.1.13",
|
|
41
43
|
"@hh.ru/magritte-ui-spacing": "2.1.32",
|
|
42
44
|
"@hh.ru/magritte-ui-typography": "5.3.17",
|
|
43
45
|
"@tanstack/react-virtual": "3.8.3"
|
|
@@ -50,5 +52,5 @@
|
|
|
50
52
|
"publishConfig": {
|
|
51
53
|
"access": "public"
|
|
52
54
|
},
|
|
53
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "f4405eda9cbc9deee847744b4e05e7d353c03a53"
|
|
54
56
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import './index.css';
|
|
2
|
+
var styles = {"item-animation-timeout":"magritte-item-animation-timeout___pbOyZ_5-7-0","itemAnimationTimeout":"magritte-item-animation-timeout___pbOyZ_5-7-0","fade-in":"magritte-fade-in___yS4Ja_5-7-0","fadeIn":"magritte-fade-in___yS4Ja_5-7-0","wrapper":"magritte-wrapper___GHKV6_5-7-0","letter":"magritte-letter___yZOCU_5-7-0","icon":"magritte-icon___kO3Fj_5-7-0","space":"magritte-space___xTO79_5-7-0","wrapperActive":"magritte-wrapperActive___Hwk8p_5-7-0","iconActive":"magritte-iconActive___4yrG5_5-7-0","iconUp":"magritte-iconUp___mpXV6_5-7-0","content":"magritte-content___ZRc6R_5-7-0","mobile-item":"magritte-mobile-item___ynALC_5-7-0","mobileItem":"magritte-mobile-item___ynALC_5-7-0","with-gap":"magritte-with-gap___gbvGO_5-7-0","withGap":"magritte-with-gap___gbvGO_5-7-0","virtualized-list":"magritte-virtualized-list___qt2E6_5-7-0","virtualizedList":"magritte-virtualized-list___qt2E6_5-7-0","virtualized-item":"magritte-virtualized-item___qAYVN_5-7-0","virtualizedItem":"magritte-virtualized-item___qAYVN_5-7-0","was-expanded":"magritte-was-expanded___uCFbW_5-7-0","wasExpanded":"magritte-was-expanded___uCFbW_5-7-0"};
|
|
3
|
+
|
|
4
|
+
export { styles as s };
|
|
5
|
+
//# sourceMappingURL=tree-selector-item-CnEnj_YP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-selector-item-CnEnj_YP.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
package/useAnimationTimeout.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
import { useState, useLayoutEffect } from 'react';
|
|
3
3
|
|
|
4
|
-
var styles = {"item-animation-timeout":"magritte-item-animation-timeout___Pdli9_5-
|
|
4
|
+
var styles = {"item-animation-timeout":"magritte-item-animation-timeout___Pdli9_5-7-0","itemAnimationTimeout":"magritte-item-animation-timeout___Pdli9_5-7-0","fade-in":"magritte-fade-in___FDoho_5-7-0","fadeIn":"magritte-fade-in___FDoho_5-7-0"};
|
|
5
5
|
|
|
6
6
|
const useAnimationTimeout = () => {
|
|
7
7
|
const [animationTimeout, setAnimationTimeout] = useState(0);
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import './index.css';
|
|
2
|
-
var styles = {"item-animation-timeout":"magritte-item-animation-timeout___pbOyZ_5-6-0","itemAnimationTimeout":"magritte-item-animation-timeout___pbOyZ_5-6-0","fade-in":"magritte-fade-in___yS4Ja_5-6-0","fadeIn":"magritte-fade-in___yS4Ja_5-6-0","wrapper":"magritte-wrapper___GHKV6_5-6-0","letter":"magritte-letter___yZOCU_5-6-0","icon":"magritte-icon___kO3Fj_5-6-0","space":"magritte-space___xTO79_5-6-0","wrapperActive":"magritte-wrapperActive___Hwk8p_5-6-0","iconActive":"magritte-iconActive___4yrG5_5-6-0","iconUp":"magritte-iconUp___mpXV6_5-6-0","content":"magritte-content___ZRc6R_5-6-0","mobile-item":"magritte-mobile-item___ynALC_5-6-0","mobileItem":"magritte-mobile-item___ynALC_5-6-0","with-gap":"magritte-with-gap___gbvGO_5-6-0","withGap":"magritte-with-gap___gbvGO_5-6-0","virtualized-list":"magritte-virtualized-list___qt2E6_5-6-0","virtualizedList":"magritte-virtualized-list___qt2E6_5-6-0","virtualized-item":"magritte-virtualized-item___qAYVN_5-6-0","virtualizedItem":"magritte-virtualized-item___qAYVN_5-6-0","was-expanded":"magritte-was-expanded___uCFbW_5-6-0","wasExpanded":"magritte-was-expanded___uCFbW_5-6-0"};
|
|
3
|
-
|
|
4
|
-
export { styles as s };
|
|
5
|
-
//# sourceMappingURL=tree-selector-item-7M3t_BRl.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tree-selector-item-7M3t_BRl.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|