@hh.ru/magritte-ui-tree-selector 4.3.8 → 4.3.10
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 +2 -1
- package/Item.js.map +1 -1
- package/ItemContent.js +1 -1
- package/ItemsList.js +1 -1
- package/MobileItemsList.js +12 -1
- package/MobileItemsList.js.map +1 -1
- package/TreeSelector.js +1 -1
- package/TreeSelectorDummy.js +1 -1
- package/index.css +25 -25
- package/index.js +1 -1
- package/package.json +10 -10
- package/tree-selector-item-y-DKCUTr.js +5 -0
- package/tree-selector-item-y-DKCUTr.js.map +1 -0
- package/useAnimationTimeout.js +1 -1
- package/useExpanded.js +2 -2
- package/useExpanded.js.map +1 -1
- package/tree-selector-item-Bj2mYshn.js +0 -5
- package/tree-selector-item-Bj2mYshn.js.map +0 -1
package/Item.js
CHANGED
|
@@ -10,7 +10,7 @@ import '@hh.ru/magritte-ui-checkbox-radio';
|
|
|
10
10
|
import './TreeSelectorItemBase.js';
|
|
11
11
|
import '@hh.ru/magritte-ui-cell';
|
|
12
12
|
import '@hh.ru/magritte-ui-typography';
|
|
13
|
-
import './tree-selector-item-
|
|
13
|
+
import './tree-selector-item-y-DKCUTr.js';
|
|
14
14
|
|
|
15
15
|
const ONE_BOX_MARGIN = 36;
|
|
16
16
|
const getMargin = (allBoxesCount, hasShift, hasIndent) => {
|
|
@@ -60,6 +60,7 @@ const ItemComponent = ({ collection, item, parentId, isExpanded, isSelected, isI
|
|
|
60
60
|
const hasIndent = allBoxesCount === 0;
|
|
61
61
|
useMemo(() => {
|
|
62
62
|
cache[item.id] = getMargin(allBoxesCount, !!hasShift, hasIndent) + (parentId ? cache[parentId] : 0);
|
|
63
|
+
// eslint-disable-next-line disable-autofix/react-hooks/exhaustive-deps
|
|
63
64
|
}, [item.id, parentId]);
|
|
64
65
|
let margin = parentId ? cache[parentId] : 0;
|
|
65
66
|
margin = margin + (hasShift ? -ONE_BOX_MARGIN : 0) + (hasIndent ? ONE_BOX_MARGIN : 0);
|
package/Item.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.js","sources":["../src/Item.tsx"],"sourcesContent":["import { PropsWithChildren, ReactElement, useMemo, memo } from 'react';\nimport classnames from 'classnames';\n\nimport { ItemContent } from '@hh.ru/magritte-ui-tree-selector/ItemContent';\nimport TreeCollection from '@hh.ru/magritte-ui-tree-selector/collection/treeCollection';\nimport { AdditionalDefault, IdCollectionPredicate, TreeModel } from '@hh.ru/magritte-ui-tree-selector/collection/types';\nimport { RenderItem } from '@hh.ru/magritte-ui-tree-selector/types';\n\nconst ONE_BOX_MARGIN = 36;\n\nconst getMargin = (allBoxesCount: number, hasShift: boolean, hasIndent: boolean): number => {\n let margin = 0;\n if (allBoxesCount === 2) {\n margin = ONE_BOX_MARGIN * 2;\n } else if (allBoxesCount === 3) {\n margin = ONE_BOX_MARGIN * 3;\n } else {\n margin = ONE_BOX_MARGIN;\n }\n if (hasIndent) {\n return margin + ONE_BOX_MARGIN;\n }\n\n if (hasShift) {\n return margin - ONE_BOX_MARGIN;\n }\n\n return margin;\n};\n\ninterface ItemProps<Additional extends AdditionalDefault> extends PropsWithChildren {\n collection: TreeCollection<Additional>;\n parentId?: TreeModel<Additional>['id'];\n item: TreeModel<Additional>;\n leavesOnly?: boolean;\n checkSelectable?: IdCollectionPredicate;\n isExpanded: boolean;\n isSelected: boolean;\n isDisabled: boolean;\n singleChoice?: boolean;\n isIndeterminate: boolean;\n isSearch: boolean;\n onExpansion: (id: string) => void;\n onChange: (id: string, isSelected: boolean) => void;\n renderItemForDesktop?: RenderItem<Additional>;\n cache: Record<string, number>;\n}\n\nconst ItemComponent = <Additional extends AdditionalDefault>({\n collection,\n item,\n parentId,\n isExpanded,\n isSelected,\n isIndeterminate,\n isDisabled,\n leavesOnly,\n singleChoice,\n isSearch,\n checkSelectable,\n onExpansion,\n onChange,\n renderItemForDesktop,\n cache,\n children,\n}: ItemProps<Additional>): ReactElement => {\n const modelsOnLevel = useMemo(\n () => (parentId ? collection.getChildren(parentId) : collection.getTopLevel()),\n [parentId, collection]\n );\n\n const hasLetterOnLevel = useMemo(() => {\n return !isSearch && modelsOnLevel.some((model) => model.additional?.char);\n }, [modelsOnLevel, isSearch]);\n\n // максимальное кол-во контролов на уровне, максимум может быть 2 - шеврон + чекбокс/радио\n const maxControlsOnLevel = useMemo(() => {\n return modelsOnLevel.reduce((currentMax, model) => {\n const hasChildren = collection.hasChildren(model.id);\n const hasAction = !(leavesOnly && hasChildren) && checkSelectable?.(model.id, collection);\n const actionCount = +hasChildren + +!!hasAction;\n return Math.max(currentMax, actionCount);\n }, 0);\n }, [modelsOnLevel, checkSelectable, leavesOnly, collection]);\n\n const hasChildren = collection.hasChildren(item.id);\n const hasAction = !(leavesOnly && hasChildren) && checkSelectable?.(item.id, collection);\n const hasLetter = item.additional?.char && !isSearch;\n const realControlsCount = +hasChildren + +!!hasAction;\n\n // точка заменяет недостающий контрол, если их суммарное кол-во на уровне больше суммарного значения на текущем уровне\n const hasDot = realControlsCount < maxControlsOnLevel && (hasAction || hasChildren);\n const hasParentAction = parentId ? !leavesOnly && checkSelectable?.(parentId, collection) : false;\n\n const allBoxesCount = +hasLetterOnLevel + maxControlsOnLevel;\n\n const hasShift =\n allBoxesCount > 1 &&\n parentId &&\n ((hasParentAction && (hasLetterOnLevel || hasChildren || hasDot)) || (!hasParentAction && hasLetterOnLevel));\n\n const hasIndent = allBoxesCount === 0;\n\n useMemo(() => {\n cache[item.id] = getMargin(allBoxesCount, !!hasShift, hasIndent) + (parentId ? cache[parentId] : 0);\n }, [item.id, parentId]);\n\n let margin = parentId ? cache[parentId] : 0;\n\n margin = margin + (hasShift ? -ONE_BOX_MARGIN : 0) + (hasIndent ? ONE_BOX_MARGIN : 0);\n\n return (\n <div\n style={{ paddingLeft: margin }}\n data-qa={classnames('tree-selector-item', `tree-selector-item-${item.id}`, {\n 'tree-selector-item-expanded': isExpanded,\n [`tree-selector-child-${parentId}`]: parentId,\n })}\n >\n <ItemContent\n item={item}\n parentId={parentId}\n hasChildren={hasChildren}\n hasAction={!!hasAction}\n letter={hasLetter ? item.additional?.char : undefined}\n isExpanded={isExpanded}\n onExpansion={onExpansion}\n isSelected={isSelected}\n onChange={onChange}\n singleChoice={singleChoice}\n isIndeterminate={isIndeterminate}\n isDisabled={isDisabled}\n hasLetterOnLevel={hasLetterOnLevel}\n hasDot={hasDot}\n maxControlsOnLevel={maxControlsOnLevel}\n isSearch={isSearch}\n renderItemForDesktop={renderItemForDesktop}\n />\n\n {children}\n </div>\n );\n};\n\nexport const Item = memo(ItemComponent) as <Additional extends AdditionalDefault>(\n props: ItemProps<Additional>\n) => ReactElement;\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;AAQA,MAAM,cAAc,GAAG,EAAE,CAAC;AAE1B,MAAM,SAAS,GAAG,CAAC,aAAqB,EAAE,QAAiB,EAAE,SAAkB,KAAY;IACvF,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,IAAI,aAAa,KAAK,CAAC,EAAE;AACrB,QAAA,MAAM,GAAG,cAAc,GAAG,CAAC,CAAC;AAC/B,KAAA;SAAM,IAAI,aAAa,KAAK,CAAC,EAAE;AAC5B,QAAA,MAAM,GAAG,cAAc,GAAG,CAAC,CAAC;AAC/B,KAAA;AAAM,SAAA;QACH,MAAM,GAAG,cAAc,CAAC;AAC3B,KAAA;AACD,IAAA,IAAI,SAAS,EAAE;QACX,OAAO,MAAM,GAAG,cAAc,CAAC;AAClC,KAAA;AAED,IAAA,IAAI,QAAQ,EAAE;QACV,OAAO,MAAM,GAAG,cAAc,CAAC;AAClC,KAAA;AAED,IAAA,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AAoBF,MAAM,aAAa,GAAG,CAAuC,EACzD,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,UAAU,EACV,eAAe,EACf,UAAU,EACV,UAAU,EACV,YAAY,EACZ,QAAQ,E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CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;IACzF,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,EAAE,IAAI,IAAI,CAAC,QAAQ,CAAC;IACrD,MAAM,iBAAiB,GAAG,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;;IAGtD,MAAM,MAAM,GAAG,iBAAiB,GAAG,kBAAkB,KAAK,SAAS,IAAI,WAAW,CAAC,CAAC;IACpF,MAAM,eAAe,GAAG,QAAQ,GAAG,CAAC,UAAU,IAAI,eAAe,GAAG,QAAQ,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC;AAElG,IAAA,MAAM,aAAa,GAAG,CAAC,gBAAgB,GAAG,kBAAkB,CAAC;AAE7D,IAAA,MAAM,QAAQ,GACV,aAAa,GAAG,CAAC;QACjB,QAAQ;AACR,SAAC,CAAC,eAAe,KAAK,gBAAgB,IAAI,WAAW,IAAI,MAAM,CAAC,MAAM,CAAC,eAAe,IAAI,gBAAgB,CAAC,CAAC,CAAC;AAEjH,IAAA,MAAM,SAAS,GAAG,aAAa,KAAK,CAAC,CAAC;IAEtC,OAAO,CAAC,MAAK;AACT,QAAA,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,aAAa,EAAE,CAAC,CAAC,QAAQ,EAAE,SAAS,CAAC,IAAI,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC
|
|
1
|
+
{"version":3,"file":"Item.js","sources":["../src/Item.tsx"],"sourcesContent":["import { PropsWithChildren, ReactElement, useMemo, memo } from 'react';\nimport classnames from 'classnames';\n\nimport { ItemContent } from '@hh.ru/magritte-ui-tree-selector/ItemContent';\nimport TreeCollection from '@hh.ru/magritte-ui-tree-selector/collection/treeCollection';\nimport { AdditionalDefault, IdCollectionPredicate, TreeModel } from '@hh.ru/magritte-ui-tree-selector/collection/types';\nimport { RenderItem } from '@hh.ru/magritte-ui-tree-selector/types';\n\nconst ONE_BOX_MARGIN = 36;\n\nconst getMargin = (allBoxesCount: number, hasShift: boolean, hasIndent: boolean): number => {\n let margin = 0;\n if (allBoxesCount === 2) {\n margin = ONE_BOX_MARGIN * 2;\n } else if (allBoxesCount === 3) {\n margin = ONE_BOX_MARGIN * 3;\n } else {\n margin = ONE_BOX_MARGIN;\n }\n if (hasIndent) {\n return margin + ONE_BOX_MARGIN;\n }\n\n if (hasShift) {\n return margin - ONE_BOX_MARGIN;\n }\n\n return margin;\n};\n\ninterface ItemProps<Additional extends AdditionalDefault> extends PropsWithChildren {\n collection: TreeCollection<Additional>;\n parentId?: TreeModel<Additional>['id'];\n item: TreeModel<Additional>;\n leavesOnly?: boolean;\n checkSelectable?: IdCollectionPredicate;\n isExpanded: boolean;\n isSelected: boolean;\n isDisabled: boolean;\n singleChoice?: boolean;\n isIndeterminate: boolean;\n isSearch: boolean;\n onExpansion: (id: string) => void;\n onChange: (id: string, isSelected: boolean) => void;\n renderItemForDesktop?: RenderItem<Additional>;\n cache: Record<string, number>;\n}\n\nconst ItemComponent = <Additional extends AdditionalDefault>({\n collection,\n item,\n parentId,\n isExpanded,\n isSelected,\n isIndeterminate,\n isDisabled,\n leavesOnly,\n singleChoice,\n isSearch,\n checkSelectable,\n onExpansion,\n onChange,\n renderItemForDesktop,\n cache,\n children,\n}: ItemProps<Additional>): ReactElement => {\n const modelsOnLevel = useMemo(\n () => (parentId ? collection.getChildren(parentId) : collection.getTopLevel()),\n [parentId, collection]\n );\n\n const hasLetterOnLevel = useMemo(() => {\n return !isSearch && modelsOnLevel.some((model) => model.additional?.char);\n }, [modelsOnLevel, isSearch]);\n\n // максимальное кол-во контролов на уровне, максимум может быть 2 - шеврон + чекбокс/радио\n const maxControlsOnLevel = useMemo(() => {\n return modelsOnLevel.reduce((currentMax, model) => {\n const hasChildren = collection.hasChildren(model.id);\n const hasAction = !(leavesOnly && hasChildren) && checkSelectable?.(model.id, collection);\n const actionCount = +hasChildren + +!!hasAction;\n return Math.max(currentMax, actionCount);\n }, 0);\n }, [modelsOnLevel, checkSelectable, leavesOnly, collection]);\n\n const hasChildren = collection.hasChildren(item.id);\n const hasAction = !(leavesOnly && hasChildren) && checkSelectable?.(item.id, collection);\n const hasLetter = item.additional?.char && !isSearch;\n const realControlsCount = +hasChildren + +!!hasAction;\n\n // точка заменяет недостающий контрол, если их суммарное кол-во на уровне больше суммарного значения на текущем уровне\n const hasDot = realControlsCount < maxControlsOnLevel && (hasAction || hasChildren);\n const hasParentAction = parentId ? !leavesOnly && checkSelectable?.(parentId, collection) : false;\n\n const allBoxesCount = +hasLetterOnLevel + maxControlsOnLevel;\n\n const hasShift =\n allBoxesCount > 1 &&\n parentId &&\n ((hasParentAction && (hasLetterOnLevel || hasChildren || hasDot)) || (!hasParentAction && hasLetterOnLevel));\n\n const hasIndent = allBoxesCount === 0;\n\n useMemo(() => {\n cache[item.id] = getMargin(allBoxesCount, !!hasShift, hasIndent) + (parentId ? cache[parentId] : 0);\n // eslint-disable-next-line disable-autofix/react-hooks/exhaustive-deps\n }, [item.id, parentId]);\n\n let margin = parentId ? cache[parentId] : 0;\n\n margin = margin + (hasShift ? -ONE_BOX_MARGIN : 0) + (hasIndent ? ONE_BOX_MARGIN : 0);\n\n return (\n <div\n style={{ paddingLeft: margin }}\n data-qa={classnames('tree-selector-item', `tree-selector-item-${item.id}`, {\n 'tree-selector-item-expanded': isExpanded,\n [`tree-selector-child-${parentId}`]: parentId,\n })}\n >\n <ItemContent\n item={item}\n parentId={parentId}\n hasChildren={hasChildren}\n hasAction={!!hasAction}\n letter={hasLetter ? item.additional?.char : undefined}\n isExpanded={isExpanded}\n onExpansion={onExpansion}\n isSelected={isSelected}\n onChange={onChange}\n singleChoice={singleChoice}\n isIndeterminate={isIndeterminate}\n isDisabled={isDisabled}\n hasLetterOnLevel={hasLetterOnLevel}\n hasDot={hasDot}\n maxControlsOnLevel={maxControlsOnLevel}\n isSearch={isSearch}\n renderItemForDesktop={renderItemForDesktop}\n />\n\n {children}\n </div>\n );\n};\n\nexport const Item = memo(ItemComponent) as <Additional extends AdditionalDefault>(\n props: ItemProps<Additional>\n) => ReactElement;\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;AAQA,MAAM,cAAc,GAAG,EAAE,CAAC;AAE1B,MAAM,SAAS,GAAG,CAAC,aAAqB,EAAE,QAAiB,EAAE,SAAkB,KAAY;IACvF,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,IAAI,aAAa,KAAK,CAAC,EAAE;AACrB,QAAA,MAAM,GAAG,cAAc,GAAG,CAAC,CAAC;AAC/B,KAAA;SAAM,IAAI,aAAa,KAAK,CAAC,EAAE;AAC5B,QAAA,MAAM,GAAG,cAAc,GAAG,CAAC,CAAC;AAC/B,KAAA;AAAM,SAAA;QACH,MAAM,GAAG,cAAc,CAAC;AAC3B,KAAA;AACD,IAAA,IAAI,SAAS,EAAE;QACX,OAAO,MAAM,GAAG,cAAc,CAAC;AAClC,KAAA;AAED,IAAA,IAAI,QAAQ,EAAE;QACV,OAAO,MAAM,GAAG,cAAc,CAAC;AAClC,KAAA;AAED,IAAA,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AAoBF,MAAM,aAAa,GAAG,CAAuC,EACzD,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,UAAU,EACV,eAAe,EACf,UAAU,EACV,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,eAAe,EACf,WAAW,EACX,QAAQ,EACR,oBAAoB,EACpB,KAAK,EACL,QAAQ,GACY,KAAkB;AACtC,IAAA,MAAM,aAAa,GAAG,OAAO,CACzB,OAAO,QAAQ,GAAG,UAAU,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC,EAC9E,CAAC,QAAQ,EAAE,UAAU,CAAC,CACzB,CAAC;AAEF,IAAA,MAAM,gBAAgB,GAAG,OAAO,CAAC,MAAK;AAClC,QAAA,OAAO,CAAC,QAAQ,IAAI,aAAa,CAAC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AAS,EACtB,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC,UAAU,EAAE,IAAI,GAAG,SAAS,EACrD,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,eAAe,EAAE,eAAe,EAChC,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,EAAE,MAAM,EACd,kBAAkB,EAAE,kBAAkB,EACtC,QAAQ,EAAE,QAAQ,EAClB,oBAAoB,EAAE,oBAAoB,EAAA,CAC5C,EAED,QAAQ,CAAA,EAAA,CACP,EACR;AACN,CAAC,CAAC;MAEW,IAAI,GAAG,IAAI,CAAC,aAAa;;;;"}
|
package/ItemContent.js
CHANGED
|
@@ -7,7 +7,7 @@ import { DotFilledSize24, ChevronRightOutlinedSize24 } from '@hh.ru/magritte-ui-
|
|
|
7
7
|
import { Action } from './Action.js';
|
|
8
8
|
import { TreeSelectorItemBase } from './TreeSelectorItemBase.js';
|
|
9
9
|
import { Text } from '@hh.ru/magritte-ui-typography';
|
|
10
|
-
import { s as styles } from './tree-selector-item-
|
|
10
|
+
import { s as styles } from './tree-selector-item-y-DKCUTr.js';
|
|
11
11
|
import '@hh.ru/magritte-ui-checkbox-radio';
|
|
12
12
|
import '@hh.ru/magritte-ui-cell';
|
|
13
13
|
|
package/ItemsList.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { useRef, useMemo, useCallback, useEffect } from 'react';
|
|
4
4
|
import { useVirtualizer } from '@tanstack/react-virtual';
|
|
5
5
|
import { Item } from './Item.js';
|
|
6
|
-
import { s as styles } from './tree-selector-item-
|
|
6
|
+
import { s as styles } from './tree-selector-item-y-DKCUTr.js';
|
|
7
7
|
import 'classnames';
|
|
8
8
|
import './ItemContent.js';
|
|
9
9
|
import '@hh.ru/magritte-common-keyboard';
|
package/MobileItemsList.js
CHANGED
|
@@ -9,7 +9,7 @@ import { Action } from './Action.js';
|
|
|
9
9
|
import { MobileDelimiter } from './MobileDelimiter.js';
|
|
10
10
|
import { MobileItem } from './MobileItem.js';
|
|
11
11
|
import { MobileParentItem } from './MobileParentItem.js';
|
|
12
|
-
import { s as styles } from './tree-selector-item-
|
|
12
|
+
import { s as styles } from './tree-selector-item-y-DKCUTr.js';
|
|
13
13
|
import '@hh.ru/magritte-ui-checkbox-radio';
|
|
14
14
|
import '@hh.ru/magritte-ui-card';
|
|
15
15
|
import '@hh.ru/magritte-ui-typography';
|
|
@@ -69,6 +69,17 @@ const MobileItemsListComponent = (props, ref) => {
|
|
|
69
69
|
}, [contentFilterQuery]);
|
|
70
70
|
useImperativeHandle(ref, () => ({
|
|
71
71
|
back: () => {
|
|
72
|
+
// virtualizer добавляет два обработчика, scroll и scrollend
|
|
73
|
+
// в первом выставляет флаг isScrolling = true, во втором false
|
|
74
|
+
// проблема в том, что если происходит переход с экрана где есть скролл и список проскроллен
|
|
75
|
+
// на экран где скролла нет происходит только событие scroll, из-за этого isScrolling зависает
|
|
76
|
+
// в состоянии true, в этом случае сбрасываю его принудительно
|
|
77
|
+
// https://github.com/TanStack/virtual/blob/9f8ac018787016628aa091a4a1f5042c8dcfed52/packages/virtual-core/src/index.ts#L169-L170
|
|
78
|
+
if (virtualizer.isScrolling &&
|
|
79
|
+
parentRef.current &&
|
|
80
|
+
parentRef.current.scrollHeight <= parentRef.current.clientHeight) {
|
|
81
|
+
virtualizer.isScrolling = false;
|
|
82
|
+
}
|
|
72
83
|
if (!virtualizer.isScrolling) {
|
|
73
84
|
const prevParentId = prevParentIds.current.pop();
|
|
74
85
|
setCurrentParentId(prevParentId);
|
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 { 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;\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>;\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 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 count = items.length + (isSelectable ? 1 : 0) + (withContentBefore ? 1 : 0);\n const parentRef = useRef<HTMLElement | null>(null);\n\n const getItemKey = (index: number) => {\n if (withContentBefore && index === 0) {\n return 'promo';\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}${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 (!virtualizer.isScrolling) {\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, virtualizer]\n );\n\n const refCallback: RefCallback<HTMLDivElement> = useCallback((node) => {\n parentRef.current = node ? node.parentElement : null;\n }, []);\n\n useEffect(() => {\n virtualizer.scrollToOffset(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 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 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":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;AA0BA,MAAM,mBAA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wBAAwB;;;;"}
|
|
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 { 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;\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>;\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 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 count = items.length + (isSelectable ? 1 : 0) + (withContentBefore ? 1 : 0);\n const parentRef = useRef<HTMLElement | null>(null);\n\n const getItemKey = (index: number) => {\n if (withContentBefore && index === 0) {\n return 'promo';\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}${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 // virtualizer добавляет два обработчика, scroll и scrollend\n // в первом выставляет флаг isScrolling = true, во втором false\n // проблема в том, что если происходит переход с экрана где есть скролл и список проскроллен\n // на экран где скролла нет происходит только событие scroll, из-за этого isScrolling зависает\n // в состоянии true, в этом случае сбрасываю его принудительно\n // https://github.com/TanStack/virtual/blob/9f8ac018787016628aa091a4a1f5042c8dcfed52/packages/virtual-core/src/index.ts#L169-L170\n if (\n virtualizer.isScrolling &&\n parentRef.current &&\n parentRef.current.scrollHeight <= parentRef.current.clientHeight\n ) {\n virtualizer.isScrolling = false;\n }\n\n if (!virtualizer.isScrolling) {\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, virtualizer]\n );\n\n const refCallback: RefCallback<HTMLDivElement> = useCallback((node) => {\n parentRef.current = node ? node.parentElement : null;\n }, []);\n\n useEffect(() => {\n virtualizer.scrollToOffset(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 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 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":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;AA0BA,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAwB/B,MAAM,wBAAwB,GAAG,CAC7B,KAAuC,EACvC,GAA+B,KACjB;AACd,IAAA,MAAM,EACF,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,eAAe,EACf,wBAAwB,EACxB,aAAa,EACb,iBAAiB,EACjB,QAAQ,EACR,qBAAqB,EACrB,UAAU,EACV,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,wBAAwB,GAC3B,GAAG,KAAK,CAAC;AACV,IAAA,MAAM,wBAAwB,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAClE,IAAA,wBAAwB,CAAC,OAAO,GAAG,wBAAwB,CAAC;AAC5D,IAAA,MAAM,aAAa,GAAG,MAAM,CAAyB,EAAE,CAAC,CAAC;AACzD,IAAA,MAAM,WAAW,GAAG,MAAM,CAAW,EAAE,CAAC,CAAC;AACzC,IAAA,MAAM,YAAY,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;IAChD,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,EAAsB,CAAC;AAC7E,IAAA,MAAM,KAAK,GAAG,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AAC;gCAC1B,wBAAwB,CAAC,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;AAChD,6BAAC,EACD,QAAQ,EAAE,eAAe,EACzB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,EACxB,CAAA,KAEFA,GAAC,CAAA,UAAU,EACP,EAAA,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,eAAe,GAAG,IAAI,CAAC,EAAE,EAAE,UAAU,CAAC,EACpD,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,EACtC,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,EACtC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,eAAe,EAC3B,CAAA,CACL,IACC,EA3CD,EAAA,WAAW,CAAC,GAAG,CA4ClB,EACR;SACL,CAAC,EACA,CAAA,EACR;AACN,CAAC,CAAC;MAEW,eAAe,GAAG,UAAU,CAAC,wBAAwB;;;;"}
|
package/TreeSelector.js
CHANGED
|
@@ -19,7 +19,7 @@ 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-y-DKCUTr.js';
|
|
23
23
|
import './MobileItemsList.js';
|
|
24
24
|
import '@hh.ru/magritte-ui-checkable-card/CheckableCardElement';
|
|
25
25
|
import './MobileDelimiter.js';
|
package/TreeSelectorDummy.js
CHANGED
|
@@ -21,7 +21,7 @@ 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-y-DKCUTr.js';
|
|
25
25
|
import '@hh.ru/magritte-ui-checkable-card/CheckableCardElement';
|
|
26
26
|
import './MobileDelimiter.js';
|
|
27
27
|
import '@hh.ru/magritte-ui-card';
|
package/index.css
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
--magritte-semantic-animation-ease-in-out-200-timing-function-v19-0-0:cubic-bezier(0.25, 0.1, 0.25, 1);
|
|
5
5
|
--magritte-semantic-animation-ease-in-out-200-duration-v19-0-0:200ms;
|
|
6
6
|
}
|
|
7
|
-
@keyframes magritte-fade-in___yS4Ja_4-3-
|
|
7
|
+
@keyframes magritte-fade-in___yS4Ja_4-3-10{
|
|
8
8
|
0%{
|
|
9
9
|
opacity:0;
|
|
10
10
|
}
|
|
@@ -12,24 +12,24 @@
|
|
|
12
12
|
opacity:1;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
.magritte-item-animation-timeout___pbOyZ_4-3-
|
|
16
|
-
animation-name:magritte-fade-in___yS4Ja_4-3-
|
|
15
|
+
.magritte-item-animation-timeout___pbOyZ_4-3-10{
|
|
16
|
+
animation-name:magritte-fade-in___yS4Ja_4-3-10;
|
|
17
17
|
animation-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v19-0-0);
|
|
18
18
|
--animation-duration:0ms;
|
|
19
19
|
animation-duration:var(--animation-duration);
|
|
20
20
|
}
|
|
21
21
|
@media (prefers-reduced-motion: no-preference){
|
|
22
|
-
.magritte-item-animation-timeout___pbOyZ_4-3-
|
|
22
|
+
.magritte-item-animation-timeout___pbOyZ_4-3-10{
|
|
23
23
|
--animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v19-0-0);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
.magritte-wrapper___GHKV6_4-3-
|
|
26
|
+
.magritte-wrapper___GHKV6_4-3-10{
|
|
27
27
|
display:flex;
|
|
28
28
|
padding:12px 0;
|
|
29
29
|
gap:12px;
|
|
30
30
|
align-items:flex-start;
|
|
31
31
|
}
|
|
32
|
-
.magritte-letter___yZOCU_4-3-
|
|
32
|
+
.magritte-letter___yZOCU_4-3-10{
|
|
33
33
|
width:24px;
|
|
34
34
|
height:24px;
|
|
35
35
|
display:flex;
|
|
@@ -37,59 +37,59 @@
|
|
|
37
37
|
justify-content:center;
|
|
38
38
|
flex-shrink:0;
|
|
39
39
|
}
|
|
40
|
-
.magritte-icon___kO3Fj_4-3-
|
|
41
|
-
.magritte-space___xTO79_4-3-
|
|
40
|
+
.magritte-icon___kO3Fj_4-3-10,
|
|
41
|
+
.magritte-space___xTO79_4-3-10{
|
|
42
42
|
flex-shrink:0;
|
|
43
43
|
line-height:0;
|
|
44
44
|
width:24px;
|
|
45
45
|
}
|
|
46
|
-
.magritte-icon___kO3Fj_4-3-
|
|
46
|
+
.magritte-icon___kO3Fj_4-3-10{
|
|
47
47
|
transform:rotate(0);
|
|
48
48
|
}
|
|
49
|
-
.magritte-wrapperActive___Hwk8p_4-3-
|
|
50
|
-
.magritte-iconActive___4yrG5_4-3-
|
|
49
|
+
.magritte-wrapperActive___Hwk8p_4-3-10,
|
|
50
|
+
.magritte-iconActive___4yrG5_4-3-10{
|
|
51
51
|
cursor:pointer;
|
|
52
52
|
}
|
|
53
|
-
.magritte-iconUp___mpXV6_4-3-
|
|
53
|
+
.magritte-iconUp___mpXV6_4-3-10{
|
|
54
54
|
transform:rotate(90deg);
|
|
55
55
|
}
|
|
56
56
|
@media (prefers-reduced-motion: no-preference){
|
|
57
|
-
.magritte-icon___kO3Fj_4-3-
|
|
57
|
+
.magritte-icon___kO3Fj_4-3-10{
|
|
58
58
|
transition-property:transform;
|
|
59
59
|
transition-duration:var(--magritte-semantic-animation-ease-in-out-100-duration-v19-0-0);
|
|
60
60
|
transition-timing-function:var(--magritte-semantic-animation-ease-in-out-100-timing-function-v19-0-0);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
.magritte-content___ZRc6R_4-3-
|
|
63
|
+
.magritte-content___ZRc6R_4-3-10{
|
|
64
64
|
flex-grow:1;
|
|
65
65
|
}
|
|
66
|
-
.magritte-mobile-item___ynALC_4-3-
|
|
66
|
+
.magritte-mobile-item___ynALC_4-3-10{
|
|
67
67
|
display:flex;
|
|
68
68
|
gap:12px;
|
|
69
69
|
flex-wrap:wrap;
|
|
70
70
|
}
|
|
71
|
-
.magritte-with-gap___gbvGO_4-3-
|
|
71
|
+
.magritte-with-gap___gbvGO_4-3-10{
|
|
72
72
|
padding-top:12px;
|
|
73
73
|
}
|
|
74
|
-
.magritte-virtualized-list___qt2E6_4-3-
|
|
74
|
+
.magritte-virtualized-list___qt2E6_4-3-10{
|
|
75
75
|
width:100%;
|
|
76
76
|
position:relative;
|
|
77
77
|
will-change:transform;
|
|
78
78
|
}
|
|
79
|
-
.magritte-virtualized-item___qAYVN_4-3-
|
|
79
|
+
.magritte-virtualized-item___qAYVN_4-3-10{
|
|
80
80
|
position:absolute;
|
|
81
81
|
top:0;
|
|
82
82
|
left:0;
|
|
83
83
|
width:100%;
|
|
84
84
|
}
|
|
85
|
-
.magritte-was-expanded___uCFbW_4-3-
|
|
86
|
-
animation-name:magritte-fade-in___yS4Ja_4-3-
|
|
85
|
+
.magritte-was-expanded___uCFbW_4-3-10{
|
|
86
|
+
animation-name:magritte-fade-in___yS4Ja_4-3-10;
|
|
87
87
|
animation-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v19-0-0);
|
|
88
88
|
--animation-duration:0ms;
|
|
89
89
|
animation-duration:var(--animation-duration);
|
|
90
90
|
}
|
|
91
91
|
@media (prefers-reduced-motion: no-preference){
|
|
92
|
-
.magritte-was-expanded___uCFbW_4-3-
|
|
92
|
+
.magritte-was-expanded___uCFbW_4-3-10{
|
|
93
93
|
--animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v19-0-0);
|
|
94
94
|
}
|
|
95
95
|
}
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
--magritte-semantic-animation-ease-in-out-200-timing-function-v19-0-0:cubic-bezier(0.25, 0.1, 0.25, 1);
|
|
99
99
|
--magritte-semantic-animation-ease-in-out-200-duration-v19-0-0:200ms;
|
|
100
100
|
}
|
|
101
|
-
@keyframes magritte-fade-in___FDoho_4-3-
|
|
101
|
+
@keyframes magritte-fade-in___FDoho_4-3-10{
|
|
102
102
|
0%{
|
|
103
103
|
opacity:0;
|
|
104
104
|
}
|
|
@@ -106,14 +106,14 @@
|
|
|
106
106
|
opacity:1;
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
.magritte-item-animation-timeout___Pdli9_4-3-
|
|
110
|
-
animation-name:magritte-fade-in___FDoho_4-3-
|
|
109
|
+
.magritte-item-animation-timeout___Pdli9_4-3-10{
|
|
110
|
+
animation-name:magritte-fade-in___FDoho_4-3-10;
|
|
111
111
|
animation-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v19-0-0);
|
|
112
112
|
--animation-duration:0ms;
|
|
113
113
|
animation-duration:var(--animation-duration);
|
|
114
114
|
}
|
|
115
115
|
@media (prefers-reduced-motion: no-preference){
|
|
116
|
-
.magritte-item-animation-timeout___Pdli9_4-3-
|
|
116
|
+
.magritte-item-animation-timeout___Pdli9_4-3-10{
|
|
117
117
|
--animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v19-0-0);
|
|
118
118
|
}
|
|
119
119
|
}
|
package/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import '@hh.ru/magritte-ui-icon/icon';
|
|
|
27
27
|
import './Action.js';
|
|
28
28
|
import '@hh.ru/magritte-ui-checkbox-radio';
|
|
29
29
|
import '@hh.ru/magritte-ui-typography';
|
|
30
|
-
import './tree-selector-item-
|
|
30
|
+
import './tree-selector-item-y-DKCUTr.js';
|
|
31
31
|
import './MobileItemsList.js';
|
|
32
32
|
import '@hh.ru/magritte-ui-cell';
|
|
33
33
|
import '@hh.ru/magritte-ui-checkable-card/CheckableCardElement';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hh.ru/magritte-ui-tree-selector",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.10",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"sideEffects": [
|
|
@@ -26,16 +26,16 @@
|
|
|
26
26
|
"@hh.ru/magritte-common-resize": "0.1.13",
|
|
27
27
|
"@hh.ru/magritte-common-use-multiple-refs": "1.1.4",
|
|
28
28
|
"@hh.ru/magritte-design-tokens": "19.0.0",
|
|
29
|
-
"@hh.ru/magritte-internal-custom-scroll": "1.2.
|
|
29
|
+
"@hh.ru/magritte-internal-custom-scroll": "1.2.1",
|
|
30
30
|
"@hh.ru/magritte-types": "4.0.2",
|
|
31
|
-
"@hh.ru/magritte-ui-badge": "2.2.
|
|
31
|
+
"@hh.ru/magritte-ui-badge": "2.2.6",
|
|
32
32
|
"@hh.ru/magritte-ui-breakpoint": "4.0.3",
|
|
33
|
-
"@hh.ru/magritte-ui-card": "6.1.
|
|
34
|
-
"@hh.ru/magritte-ui-cell": "4.0.
|
|
35
|
-
"@hh.ru/magritte-ui-checkable-card": "3.0.
|
|
36
|
-
"@hh.ru/magritte-ui-checkbox-radio": "3.0.
|
|
37
|
-
"@hh.ru/magritte-ui-icon": "7.5.
|
|
38
|
-
"@hh.ru/magritte-ui-input": "6.0.
|
|
33
|
+
"@hh.ru/magritte-ui-card": "6.1.5",
|
|
34
|
+
"@hh.ru/magritte-ui-cell": "4.0.8",
|
|
35
|
+
"@hh.ru/magritte-ui-checkable-card": "3.0.32",
|
|
36
|
+
"@hh.ru/magritte-ui-checkbox-radio": "3.0.16",
|
|
37
|
+
"@hh.ru/magritte-ui-icon": "7.5.3",
|
|
38
|
+
"@hh.ru/magritte-ui-input": "6.0.8",
|
|
39
39
|
"@hh.ru/magritte-ui-mock-component": "1.0.11",
|
|
40
40
|
"@hh.ru/magritte-ui-spacing": "2.0.28",
|
|
41
41
|
"@hh.ru/magritte-ui-theme-provider": "1.1.28",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "90e0f59e27d32f6666c5b5a8053386166b41aca1"
|
|
54
54
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import './index.css';
|
|
2
|
+
var styles = {"item-animation-timeout":"magritte-item-animation-timeout___pbOyZ_4-3-10","itemAnimationTimeout":"magritte-item-animation-timeout___pbOyZ_4-3-10","fade-in":"magritte-fade-in___yS4Ja_4-3-10","fadeIn":"magritte-fade-in___yS4Ja_4-3-10","wrapper":"magritte-wrapper___GHKV6_4-3-10","letter":"magritte-letter___yZOCU_4-3-10","icon":"magritte-icon___kO3Fj_4-3-10","space":"magritte-space___xTO79_4-3-10","wrapperActive":"magritte-wrapperActive___Hwk8p_4-3-10","iconActive":"magritte-iconActive___4yrG5_4-3-10","iconUp":"magritte-iconUp___mpXV6_4-3-10","content":"magritte-content___ZRc6R_4-3-10","mobile-item":"magritte-mobile-item___ynALC_4-3-10","mobileItem":"magritte-mobile-item___ynALC_4-3-10","with-gap":"magritte-with-gap___gbvGO_4-3-10","withGap":"magritte-with-gap___gbvGO_4-3-10","virtualized-list":"magritte-virtualized-list___qt2E6_4-3-10","virtualizedList":"magritte-virtualized-list___qt2E6_4-3-10","virtualized-item":"magritte-virtualized-item___qAYVN_4-3-10","virtualizedItem":"magritte-virtualized-item___qAYVN_4-3-10","was-expanded":"magritte-was-expanded___uCFbW_4-3-10","wasExpanded":"magritte-was-expanded___uCFbW_4-3-10"};
|
|
3
|
+
|
|
4
|
+
export { styles as s };
|
|
5
|
+
//# sourceMappingURL=tree-selector-item-y-DKCUTr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-selector-item-y-DKCUTr.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_4-3-
|
|
4
|
+
var styles = {"item-animation-timeout":"magritte-item-animation-timeout___Pdli9_4-3-10","itemAnimationTimeout":"magritte-item-animation-timeout___Pdli9_4-3-10","fade-in":"magritte-fade-in___FDoho_4-3-10","fadeIn":"magritte-fade-in___FDoho_4-3-10"};
|
|
5
5
|
|
|
6
6
|
const useAnimationTimeout = () => {
|
|
7
7
|
const [animationTimeout, setAnimationTimeout] = useState(0);
|
package/useExpanded.js
CHANGED
|
@@ -22,7 +22,7 @@ const calculateInitialExpanded = (initialExpanded, selected, expandTreeOnSelecte
|
|
|
22
22
|
};
|
|
23
23
|
const useExpanded = ({ initialValue, selected, expandTreeOnSelected, collection, onExpand, }) => {
|
|
24
24
|
const calculatedInitialValue = useMemo(() => calculateInitialExpanded(initialValue, selected, expandTreeOnSelected, collection),
|
|
25
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
25
|
+
// eslint-disable-next-line disable-autofix/react-hooks/exhaustive-deps
|
|
26
26
|
[]);
|
|
27
27
|
const [expanded, setExpanded] = useState(calculatedInitialValue);
|
|
28
28
|
const expandedRef = useRef(calculatedInitialValue);
|
|
@@ -51,7 +51,7 @@ const useExpanded = ({ initialValue, selected, expandTreeOnSelected, collection,
|
|
|
51
51
|
if (!areEqualArrays(expandedRef.current, calculatedResetValue)) {
|
|
52
52
|
setExpanded(calculatedResetValue);
|
|
53
53
|
}
|
|
54
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
54
|
+
// eslint-disable-next-line disable-autofix/react-hooks/exhaustive-deps
|
|
55
55
|
}, []);
|
|
56
56
|
useEffect(() => {
|
|
57
57
|
handlerRef.current = onExpand;
|
package/useExpanded.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useExpanded.js","sources":["../src/useExpanded.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState, useMemo } from 'react';\n\nimport TreeCollection from '@hh.ru/magritte-ui-tree-selector/collection/treeCollection';\nimport { AdditionalDefault } from '@hh.ru/magritte-ui-tree-selector/collection/types';\n\nexport const areEqualArrays = (arr1: string[], arr2: string[]): boolean => {\n if (arr1.length !== arr2.length) {\n return false;\n }\n const sortArr2 = arr2.slice().sort();\n return arr1\n .slice()\n .sort()\n .every((item, index) => item === sortArr2[index]);\n};\n\nexport const calculateInitialExpanded = <Additional extends AdditionalDefault>(\n initialExpanded: string[],\n selected: string[],\n expandTreeOnSelected: boolean,\n collection: TreeCollection<Additional>\n): string[] => {\n let expanded: string[] = initialExpanded.slice();\n if (expandTreeOnSelected) {\n expanded = selected.reduce<string[]>((acc, id) => {\n return acc.concat(collection.getParentIds(id));\n }, expanded);\n }\n return [...new Set(expanded)];\n};\n\ninterface UseExpandedHookProps<Additional extends AdditionalDefault> {\n initialValue: string[];\n onExpand?: (expanded: string[]) => void;\n expandTreeOnSelected: boolean;\n selected: string[];\n collection: TreeCollection<Additional>;\n}\n\ninterface UseExpandedHookReturn {\n expanded: string[];\n setExpanded: (expanded: string[]) => void;\n handleExpansion: (id: string) => void;\n handleResetExpanded: () => void;\n}\ninterface UseExpandedHook {\n <Additional extends AdditionalDefault>(props: UseExpandedHookProps<Additional>): UseExpandedHookReturn;\n}\n\nexport const useExpanded: UseExpandedHook = ({\n initialValue,\n selected,\n expandTreeOnSelected,\n collection,\n onExpand,\n}) => {\n const calculatedInitialValue = useMemo(\n () => calculateInitialExpanded(initialValue, selected, expandTreeOnSelected, collection),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n []\n );\n const [expanded, setExpanded] = useState(calculatedInitialValue);\n const expandedRef = useRef(calculatedInitialValue);\n const selectedRef = useRef(selected);\n selectedRef.current = selected;\n const handlerRef = useRef(onExpand);\n\n const handleSetExpanded = useCallback((updatedExpanded: string[]) => {\n handlerRef.current?.(updatedExpanded.slice());\n\n if (!areEqualArrays(expandedRef.current, updatedExpanded)) {\n setExpanded(updatedExpanded);\n }\n }, []);\n\n const handleExpansion = useCallback(\n (id: string): void => {\n let updatedExpanded;\n if (expandedRef.current.includes(id)) {\n updatedExpanded = expandedRef.current.filter((itemId) => itemId !== id);\n } else {\n updatedExpanded = expandedRef.current.slice();\n updatedExpanded.push(id);\n }\n handleSetExpanded(updatedExpanded);\n },\n [handleSetExpanded]\n );\n\n const handleResetExpanded = useCallback(() => {\n const calculatedResetValue = calculateInitialExpanded(\n initialValue,\n selectedRef.current,\n expandTreeOnSelected,\n collection\n );\n if (!areEqualArrays(expandedRef.current, calculatedResetValue)) {\n setExpanded(calculatedResetValue);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n handlerRef.current = onExpand;\n }, [onExpand]);\n\n useEffect(() => {\n expandedRef.current = expanded;\n }, [expanded]);\n\n return { expanded, setExpanded: handleSetExpanded, handleExpansion, handleResetExpanded };\n};\n"],"names":[],"mappings":";;MAKa,cAAc,GAAG,CAAC,IAAc,EAAE,IAAc,KAAa;AACtE,IAAA,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,EAAE;AAC7B,QAAA,OAAO,KAAK,CAAC;AAChB,KAAA;IACD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC;AACrC,IAAA,OAAO,IAAI;AACN,SAAA,KAAK,EAAE;AACP,SAAA,IAAI,EAAE;AACN,SAAA,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,KAAK,IAAI,KAAK,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;AAC1D,EAAE;AAEK,MAAM,wBAAwB,GAAG,CACpC,eAAyB,EACzB,QAAkB,EAClB,oBAA6B,EAC7B,UAAsC,K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ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState, useMemo } from 'react';\n\nimport TreeCollection from '@hh.ru/magritte-ui-tree-selector/collection/treeCollection';\nimport { AdditionalDefault } from '@hh.ru/magritte-ui-tree-selector/collection/types';\n\nexport const areEqualArrays = (arr1: string[], arr2: string[]): boolean => {\n if (arr1.length !== arr2.length) {\n return false;\n }\n const sortArr2 = arr2.slice().sort();\n return arr1\n .slice()\n .sort()\n .every((item, index) => item === sortArr2[index]);\n};\n\nexport const calculateInitialExpanded = <Additional extends AdditionalDefault>(\n initialExpanded: string[],\n selected: string[],\n expandTreeOnSelected: boolean,\n collection: TreeCollection<Additional>\n): string[] => {\n let expanded: string[] = initialExpanded.slice();\n if (expandTreeOnSelected) {\n expanded = selected.reduce<string[]>((acc, id) => {\n return acc.concat(collection.getParentIds(id));\n }, expanded);\n }\n return [...new Set(expanded)];\n};\n\ninterface UseExpandedHookProps<Additional extends AdditionalDefault> {\n initialValue: string[];\n onExpand?: (expanded: string[]) => void;\n expandTreeOnSelected: boolean;\n selected: string[];\n collection: TreeCollection<Additional>;\n}\n\ninterface UseExpandedHookReturn {\n expanded: string[];\n setExpanded: (expanded: string[]) => void;\n handleExpansion: (id: string) => void;\n handleResetExpanded: () => void;\n}\ninterface UseExpandedHook {\n <Additional extends AdditionalDefault>(props: UseExpandedHookProps<Additional>): UseExpandedHookReturn;\n}\n\nexport const useExpanded: UseExpandedHook = ({\n initialValue,\n selected,\n expandTreeOnSelected,\n collection,\n onExpand,\n}) => {\n const calculatedInitialValue = useMemo(\n () => calculateInitialExpanded(initialValue, selected, expandTreeOnSelected, collection),\n // eslint-disable-next-line disable-autofix/react-hooks/exhaustive-deps\n []\n );\n const [expanded, setExpanded] = useState(calculatedInitialValue);\n const expandedRef = useRef(calculatedInitialValue);\n const selectedRef = useRef(selected);\n selectedRef.current = selected;\n const handlerRef = useRef(onExpand);\n\n const handleSetExpanded = useCallback((updatedExpanded: string[]) => {\n handlerRef.current?.(updatedExpanded.slice());\n\n if (!areEqualArrays(expandedRef.current, updatedExpanded)) {\n setExpanded(updatedExpanded);\n }\n }, []);\n\n const handleExpansion = useCallback(\n (id: string): void => {\n let updatedExpanded;\n if (expandedRef.current.includes(id)) {\n updatedExpanded = expandedRef.current.filter((itemId) => itemId !== id);\n } else {\n updatedExpanded = expandedRef.current.slice();\n updatedExpanded.push(id);\n }\n handleSetExpanded(updatedExpanded);\n },\n [handleSetExpanded]\n );\n\n const handleResetExpanded = useCallback(() => {\n const calculatedResetValue = calculateInitialExpanded(\n initialValue,\n selectedRef.current,\n expandTreeOnSelected,\n collection\n );\n if (!areEqualArrays(expandedRef.current, calculatedResetValue)) {\n setExpanded(calculatedResetValue);\n }\n // eslint-disable-next-line disable-autofix/react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n handlerRef.current = onExpand;\n }, [onExpand]);\n\n useEffect(() => {\n expandedRef.current = expanded;\n }, [expanded]);\n\n return { expanded, setExpanded: handleSetExpanded, handleExpansion, handleResetExpanded };\n};\n"],"names":[],"mappings":";;MAKa,cAAc,GAAG,CAAC,IAAc,EAAE,IAAc,KAAa;AACtE,IAAA,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,EAAE;AAC7B,QAAA,OAAO,KAAK,CAAC;AAChB,KAAA;IACD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC;AACrC,IAAA,OAAO,IAAI;AACN,SAAA,KAAK,EAAE;AACP,SAAA,IAAI,EAAE;AACN,SAAA,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,KAAK,IAAI,KAAK,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;AAC1D,EAAE;AAEK,MAAM,wBAAwB,GAAG,CACpC,eAAyB,EACzB,QAAkB,EAClB,oBAA6B,EAC7B,UAAsC,KAC5B;AACV,IAAA,IAAI,QAAQ,GAAa,eAAe,CAAC,KAAK,EAAE,CAAC;AACjD,IAAA,IAAI,o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timeout___pbOyZ_4-3-8","fade-in":"magritte-fade-in___yS4Ja_4-3-8","fadeIn":"magritte-fade-in___yS4Ja_4-3-8","wrapper":"magritte-wrapper___GHKV6_4-3-8","letter":"magritte-letter___yZOCU_4-3-8","icon":"magritte-icon___kO3Fj_4-3-8","space":"magritte-space___xTO79_4-3-8","wrapperActive":"magritte-wrapperActive___Hwk8p_4-3-8","iconActive":"magritte-iconActive___4yrG5_4-3-8","iconUp":"magritte-iconUp___mpXV6_4-3-8","content":"magritte-content___ZRc6R_4-3-8","mobile-item":"magritte-mobile-item___ynALC_4-3-8","mobileItem":"magritte-mobile-item___ynALC_4-3-8","with-gap":"magritte-with-gap___gbvGO_4-3-8","withGap":"magritte-with-gap___gbvGO_4-3-8","virtualized-list":"magritte-virtualized-list___qt2E6_4-3-8","virtualizedList":"magritte-virtualized-list___qt2E6_4-3-8","virtualized-item":"magritte-virtualized-item___qAYVN_4-3-8","virtualizedItem":"magritte-virtualized-item___qAYVN_4-3-8","was-expanded":"magritte-was-expanded___uCFbW_4-3-8","wasExpanded":"magritte-was-expanded___uCFbW_4-3-8"};
|
|
3
|
-
|
|
4
|
-
export { styles as s };
|
|
5
|
-
//# sourceMappingURL=tree-selector-item-Bj2mYshn.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tree-selector-item-Bj2mYshn.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|