@ryuzaki13/react-foundation-ui 1.1.7 → 1.1.8
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/dist/advanced-search/index.js +136 -136
- package/dist/base-table/index.js +2 -2
- package/dist/chunks/{CalendarView-C0gJvre1.js → CalendarView-KCkhCtK-.js} +101 -101
- package/dist/chunks/{CalendarView-C0gJvre1.js.map → CalendarView-KCkhCtK-.js.map} +1 -1
- package/dist/chunks/SelectOptionContent-CI7wq9Oi.js +27 -0
- package/dist/chunks/SelectOptionContent-CI7wq9Oi.js.map +1 -0
- package/dist/chunks/{TextEditorLexicalClient-DYZ32dnX.js → TextEditorLexicalClient-DeBA6fQX.js} +157 -157
- package/dist/chunks/{TextEditorLexicalClient-DYZ32dnX.js.map → TextEditorLexicalClient-DeBA6fQX.js.map} +1 -1
- package/dist/chunks/{base-table-BXKFSgIk.js → base-table-Dv9i3CAT.js} +73 -73
- package/dist/chunks/{base-table-BXKFSgIk.js.map → base-table-Dv9i3CAT.js.map} +1 -1
- package/dist/chunks/{date-input-DKkW7_uw.js → date-input-DT9E8dhk.js} +44 -44
- package/dist/chunks/{date-input-DKkW7_uw.js.map → date-input-DT9E8dhk.js.map} +1 -1
- package/dist/chunks/{date-range-preset-select-UgsfaOeM.js → date-range-preset-select-BLnY47cv.js} +20 -20
- package/dist/chunks/{date-range-preset-select-UgsfaOeM.js.map → date-range-preset-select-BLnY47cv.js.map} +1 -1
- package/dist/chunks/{input-CZLUUggm.js → input-BCJfUdK_.js} +43 -43
- package/dist/chunks/{input-CZLUUggm.js.map → input-BCJfUdK_.js.map} +1 -1
- package/dist/chunks/{input-files-aB8iaqGk.js → input-files-Dcc5K-_1.js} +2 -2
- package/dist/chunks/{input-files-aB8iaqGk.js.map → input-files-Dcc5K-_1.js.map} +1 -1
- package/dist/chunks/{input-search-eMvnvgV0.js → input-search-B7HmrAM7.js} +2 -2
- package/dist/chunks/{input-search-eMvnvgV0.js.map → input-search-B7HmrAM7.js.map} +1 -1
- package/dist/chunks/{multi-select-DaOKgHKE.js → multi-select-BCpRct-k.js} +105 -104
- package/dist/chunks/{multi-select-DaOKgHKE.js.map → multi-select-BCpRct-k.js.map} +1 -1
- package/dist/chunks/{picker-BZ05h_ZJ.js → picker-DTZk09Ag.js} +27 -27
- package/dist/chunks/{picker-BZ05h_ZJ.js.map → picker-DTZk09Ag.js.map} +1 -1
- package/dist/chunks/select-Bd48kVI3.js +328 -0
- package/dist/chunks/{select-Dj3FfpS0.js.map → select-Bd48kVI3.js.map} +1 -1
- package/dist/chunks/{table-BdpMzhLH.js → table-BtXVqa2I.js} +10 -10
- package/dist/chunks/{table-BdpMzhLH.js.map → table-BtXVqa2I.js.map} +1 -1
- package/dist/chunks/{table-column-interactions-6RGjmiI5.js → table-column-interactions-BGd5Lwy9.js} +19 -19
- package/dist/chunks/{table-column-interactions-6RGjmiI5.js.map → table-column-interactions-BGd5Lwy9.js.map} +1 -1
- package/dist/chunks/{useODataSelectBase-BxAvhDww.js → useODataSelectBase-wZ07hQFv.js} +10 -10
- package/dist/chunks/{useODataSelectBase-BxAvhDww.js.map → useODataSelectBase-wZ07hQFv.js.map} +1 -1
- package/dist/date-input/index.js +2 -2
- package/dist/date-range-preset-select/index.js +1 -1
- package/dist/date-time-input/index.js +41 -41
- package/dist/drop-zone/index.js +1 -1
- package/dist/errors/index.js +39 -39
- package/dist/image/index.js +2 -2
- package/dist/input/index.js +1 -1
- package/dist/input-date-time/index.js +1 -1
- package/dist/input-file/index.js +1 -1
- package/dist/input-files/index.js +1 -1
- package/dist/input-image/index.js +1 -1
- package/dist/input-search/index.js +1 -1
- package/dist/layout-picker/index.js +1 -1
- package/dist/multi-select/index.js +1 -1
- package/dist/notifications/index.js +26 -26
- package/dist/period-select/index.js +19 -19
- package/dist/picker/index.js +1 -1
- package/dist/preset-range-date-input/index.js +2 -2
- package/dist/preset-select/index.js +1 -1
- package/dist/select/index.js +1 -1
- package/dist/simple-table/index.js +1 -1
- package/dist/slider/index.js +312 -312
- package/dist/slider/index.js.map +1 -1
- package/dist/state-select/index.js +14 -14
- package/dist/styles.css +1 -1
- package/dist/table/index.js +1 -1
- package/dist/table-column-interactions/index.js +1 -1
- package/dist/tag-input/index.js +1 -1
- package/dist/text/index.js +10 -10
- package/dist/text-editor/index.js +1 -1
- package/dist/textarea/index.js +1 -1
- package/dist/tree-select/index.js +240 -239
- package/dist/tree-select/index.js.map +1 -1
- package/dist/tree-table/index.js +15 -15
- package/package.json +2 -1
- package/storybook-static/project.json +1 -1
- package/dist/chunks/SelectOptionContent-lfEtHXfO.js +0 -1132
- package/dist/chunks/SelectOptionContent-lfEtHXfO.js.map +0 -1
- package/dist/chunks/select-Dj3FfpS0.js +0 -327
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/tree-select/helpers.ts","../../src/tree-select/model/buildODataTreeNodes.ts","../../src/tree-select/model/resolveOrderedTreeSegmentItems.ts","../../src/tree-select/model/useODataTreeData.ts","../../src/tree-select/model/treeUtils.ts","../../src/tree-select/TreeSelect.module.scss","../../src/tree-select/TreeNodeContent.tsx","../../src/tree-select/TreePickerBase.tsx","../../src/tree-select/TreeMultiSelect.tsx","../../src/tree-select/ODataTreeMultiSelect.tsx","../../src/tree-select/TreeSelect.tsx","../../src/tree-select/ODataTreeSelect.tsx"],"sourcesContent":["import { TreeMultiSelectValue, TreeSelectValue } from \"./types\";\n\nexport function treeSelectValueToSelectedFilters(value: TreeSelectValue | undefined): TreeMultiSelectValue {\n\tif (!value) {\n\t\treturn {};\n\t}\n\n\treturn {\n\t\t[value.codeKey]: [value.value]\n\t};\n}\n","import { CollectionItem } from \"@ryuzaki13/react-foundation-lib/odata\";\n\nimport { TreeSelectNode } from \"../types\";\n\ntype BuildODataTreeNodesArgs = {\n\titems: CollectionItem[];\n\torderedCodeKeys: string[];\n\tkeyPairsMap: Record<string, string>;\n\thiddenCodeKeys: Set<string>;\n\ttextValueCodeKeys?: Set<string>;\n};\n\ntype MutableTreeNode = TreeSelectNode & {\n\tchildren: MutableTreeNode[];\n\tchildByBranchKey: Map<string, MutableTreeNode>;\n};\n\nfunction createNodeId(parentId: string | undefined, codeKey: string, value: string) {\n\treturn parentId ? `${parentId}/${codeKey}:${value}` : `${codeKey}:${value}`;\n}\n\nfunction resolveNodeLabel(item: CollectionItem, codeKey: string, keyPairsMap: Record<string, string>) {\n\tconst textKey = keyPairsMap[codeKey];\n\treturn (textKey && item[textKey]) || item[codeKey];\n}\n\nfunction createSearchText(parts: Array<string | undefined>) {\n\treturn [...new Set(parts.filter(Boolean))].join(\" \");\n}\n\nfunction createMutableNode(args: { parentId?: string; codeKey: string; value: string; label: string; code?: string }): MutableTreeNode {\n\treturn {\n\t\tid: createNodeId(args.parentId, args.codeKey, args.value),\n\t\tcodeKey: args.codeKey,\n\t\tvalue: args.value,\n\t\tlabel: args.label,\n\t\tcode: args.code,\n\t\tsearchText: createSearchText([args.value, args.label, args.code]),\n\t\tchildren: [],\n\t\tchildByBranchKey: new Map()\n\t};\n}\n\nfunction toPublicNode(node: MutableTreeNode): TreeSelectNode {\n\treturn {\n\t\tid: node.id,\n\t\tcodeKey: node.codeKey,\n\t\tvalue: node.value,\n\t\tlabel: node.label,\n\t\tcode: node.code,\n\t\tsearchText: node.searchText,\n\t\tchildren: node.children.length > 0 ? node.children.map(toPublicNode) : undefined\n\t};\n}\n\nexport function buildODataTreeNodes({\n\titems,\n\torderedCodeKeys,\n\tkeyPairsMap,\n\thiddenCodeKeys,\n\ttextValueCodeKeys\n}: BuildODataTreeNodesArgs): TreeSelectNode[] {\n\tif (orderedCodeKeys.length === 0 || items.length === 0) {\n\t\treturn [];\n\t}\n\n\tconst roots: MutableTreeNode[] = [];\n\tconst rootByBranchKey = new Map<string, MutableTreeNode>();\n\n\tfor (const item of items) {\n\t\tlet parentNode: MutableTreeNode | undefined;\n\n\t\tfor (const codeKey of orderedCodeKeys) {\n\t\t\tconst codeValue = String(item[codeKey] ?? \"\");\n\n\t\t\tif (!codeValue) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst label = String(resolveNodeLabel(item, codeKey, keyPairsMap) ?? \"\");\n\t\t\tconst value = textValueCodeKeys?.has(codeKey) ? label : codeValue;\n\t\t\tconst branchKey = `${codeKey}:${value}`;\n\t\t\tconst container = parentNode ? parentNode.childByBranchKey : rootByBranchKey;\n\t\t\tlet currentNode = container.get(branchKey);\n\n\t\t\tif (!currentNode) {\n\t\t\t\tcurrentNode = createMutableNode({\n\t\t\t\t\tparentId: parentNode?.id,\n\t\t\t\t\tcodeKey,\n\t\t\t\t\tvalue,\n\t\t\t\t\tlabel,\n\t\t\t\t\tcode: hiddenCodeKeys.has(codeKey) ? undefined : codeValue\n\t\t\t\t});\n\t\t\t\tcontainer.set(branchKey, currentNode);\n\n\t\t\t\tif (parentNode) {\n\t\t\t\t\tparentNode.children.push(currentNode);\n\t\t\t\t} else {\n\t\t\t\t\troots.push(currentNode);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tparentNode = currentNode;\n\t\t}\n\t}\n\n\treturn roots.map(toPublicNode);\n}\n","import { ODataDependentSegmentItem, sortODataDependentSegmentItemsByChains } from \"@ryuzaki13/react-foundation-api/odata\";\nimport { ODataChainsMap } from \"@ryuzaki13/react-foundation-lib/odata-service\";\n\nexport function resolveOrderedTreeSegmentItems(items: readonly ODataDependentSegmentItem[], chains: ODataChainsMap) {\n\treturn sortODataDependentSegmentItemsByChains(items, chains);\n}\n","import { useMemo } from \"react\";\n\nimport {\n\tflattenODataDependentServices,\n\tODataCollectionModel,\n\tODataDependentBaseProps,\n\tODataDependentSegmentItem,\n\tuseODataCollection,\n\tuseODataCollectionChains,\n\tuseODataCollectionModel\n} from \"@ryuzaki13/react-foundation-api/odata\";\n\nimport { buildODataTreeNodes } from \"./buildODataTreeNodes\";\nimport { resolveOrderedTreeSegmentItems } from \"./resolveOrderedTreeSegmentItems\";\n\nfunction buildOrderedSegmentItems(\n\todata: ODataDependentBaseProps[\"odata\"],\n\tsegments: ODataDependentBaseProps[\"segments\"],\n\tmodel?: Omit<ODataCollectionModel, \"codeKey\">\n) {\n\treturn flattenODataDependentServices([\n\t\t{\n\t\t\todata,\n\t\t\tsegments,\n\t\t\tmodel\n\t\t}\n\t]);\n}\n\nfunction getRootCodeKey(orderedSegmentItems: readonly ODataDependentSegmentItem[]) {\n\treturn orderedSegmentItems[0]?.id;\n}\n\nexport function useODataTreeData({ odata, segments, model }: Pick<ODataDependentBaseProps, \"odata\" | \"segments\" | \"model\">) {\n\tconst serviceKey = `${odata.service}.${odata.target}`;\n\tconst baseSegmentItems = useMemo(() => buildOrderedSegmentItems(odata, segments, model), [odata, segments, model]);\n\tconst chains = useODataCollectionChains([odata]);\n\tconst orderedSegmentItems = useMemo(() => resolveOrderedTreeSegmentItems(baseSegmentItems, chains), [baseSegmentItems, chains]);\n\tconst orderedCodeKeys = useMemo(() => orderedSegmentItems.map((item) => item.id), [orderedSegmentItems]);\n\tconst rootCodeKey = getRootCodeKey(orderedSegmentItems) ?? Object.keys(segments)[0];\n\tconst odataModel = useODataCollectionModel({\n\t\tcodeKey: rootCodeKey,\n\t\t...model\n\t});\n\tconst collection = useODataCollection({\n\t\todata,\n\t\tmodel: odataModel\n\t});\n\tconst { hiddenCodeKeys, textValueCodeKeys } = useMemo(() => {\n\t\tconst nextHiddenCodeKeys = new Set<string>();\n\t\tconst nextTextValueCodeKeys = new Set<string>();\n\n\t\tfor (const item of orderedSegmentItems) {\n\t\t\tif (item.segment.hideCode ?? odata.hideCode) {\n\t\t\t\tnextHiddenCodeKeys.add(item.id);\n\t\t\t}\n\t\t\tif (item.segment.selectText) {\n\t\t\t\tnextTextValueCodeKeys.add(item.id);\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\thiddenCodeKeys: nextHiddenCodeKeys,\n\t\t\ttextValueCodeKeys: nextTextValueCodeKeys\n\t\t};\n\t}, [odata.hideCode, orderedSegmentItems]);\n\tconst nodes = useMemo(\n\t\t() =>\n\t\t\tbuildODataTreeNodes({\n\t\t\t\titems: collection.data?.items ?? [],\n\t\t\t\torderedCodeKeys,\n\t\t\t\tkeyPairsMap: collection.data?.keyPairsMap ?? {},\n\t\t\t\thiddenCodeKeys,\n\t\t\t\ttextValueCodeKeys\n\t\t\t}),\n\t\t[collection.data?.items, collection.data?.keyPairsMap, hiddenCodeKeys, orderedCodeKeys, textValueCodeKeys]\n\t);\n\tconst placeholder = orderedSegmentItems[0]?.segment.placeholder ?? \"Выберите значение\";\n\tconst hasResolvedChain = Boolean(chains[serviceKey]?.length);\n\n\treturn {\n\t\tnodes,\n\t\torderedSegmentItems,\n\t\torderedCodeKeys,\n\t\tisLoading: collection.isLoading,\n\t\tisError: collection.isError,\n\t\tplaceholder,\n\t\thasResolvedChain\n\t};\n}\n","import { TreeMultiSelectValue, TreeSelectNode, TreeSelectValue } from \"../types\";\n\nexport type TreeNodeIndex = {\n\trootIds: string[];\n\tnodeById: Map<string, TreeSelectNode>;\n\tparentById: Map<string, string | undefined>;\n\tchildrenById: Map<string, string[]>;\n\tpreorderIndexById: Map<string, number>;\n\tnodeIdByCodeValue: Map<string, string>;\n};\n\nexport type TreeNodeSelectionState = {\n\tselectedIds: Set<string>;\n\tpartialIds: Set<string>;\n};\n\nexport type TreeVisibleEntry = {\n\tnode: TreeSelectNode;\n\tlevel: number;\n\tparentId?: string;\n\thasChildren: boolean;\n\tisExpanded: boolean;\n\tisLeaf: boolean;\n};\n\nfunction makeCodeValueKey(codeKey: string, value: string) {\n\treturn `${codeKey}::${value}`;\n}\n\nexport function createTreeNodeIndex(nodes: readonly TreeSelectNode[]): TreeNodeIndex {\n\tconst nodeById = new Map<string, TreeSelectNode>();\n\tconst parentById = new Map<string, string | undefined>();\n\tconst childrenById = new Map<string, string[]>();\n\tconst preorderIndexById = new Map<string, number>();\n\tconst nodeIdByCodeValue = new Map<string, string>();\n\tlet preorderIndex = 0;\n\n\tconst walk = (node: TreeSelectNode, parentId?: string) => {\n\t\tnodeById.set(node.id, node);\n\t\tparentById.set(node.id, parentId);\n\t\tpreorderIndexById.set(node.id, preorderIndex++);\n\t\tnodeIdByCodeValue.set(makeCodeValueKey(node.codeKey, node.value), node.id);\n\n\t\tconst childIds = (node.children ?? []).map((child) => child.id);\n\t\tchildrenById.set(node.id, childIds);\n\n\t\tfor (const child of node.children ?? []) {\n\t\t\twalk(child, node.id);\n\t\t}\n\t};\n\n\tfor (const node of nodes) {\n\t\twalk(node);\n\t}\n\n\treturn {\n\t\trootIds: nodes.map((node) => node.id),\n\t\tnodeById,\n\t\tparentById,\n\t\tchildrenById,\n\t\tpreorderIndexById,\n\t\tnodeIdByCodeValue\n\t};\n}\n\nexport function treeSelectValueToId(value: TreeSelectValue | undefined, index: TreeNodeIndex) {\n\tif (!value) return undefined;\n\treturn index.nodeIdByCodeValue.get(makeCodeValueKey(value.codeKey, value.value));\n}\n\nexport function treeMultiValueToSelectedIds(value: TreeMultiSelectValue | undefined, index: TreeNodeIndex) {\n\tconst selectedIds = new Set<string>();\n\n\tif (!value) {\n\t\treturn selectedIds;\n\t}\n\n\tfor (const [codeKey, values] of Object.entries(value)) {\n\t\tfor (const itemValue of values) {\n\t\t\tconst nodeId = index.nodeIdByCodeValue.get(makeCodeValueKey(codeKey, itemValue));\n\t\t\tif (nodeId) {\n\t\t\t\tselectedIds.add(nodeId);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn canonicalizeTreeSelection(selectedIds, index);\n}\n\nexport function treeSelectedIdsToMultiValue(selectedIds: Set<string>, index: TreeNodeIndex): TreeMultiSelectValue {\n\tconst orderedIds = [...selectedIds].sort(\n\t\t(leftId, rightId) =>\n\t\t\t(index.preorderIndexById.get(leftId) ?? Number.MAX_SAFE_INTEGER) -\n\t\t\t(index.preorderIndexById.get(rightId) ?? Number.MAX_SAFE_INTEGER)\n\t);\n\tconst result: TreeMultiSelectValue = {};\n\n\tfor (const nodeId of orderedIds) {\n\t\tconst node = index.nodeById.get(nodeId);\n\t\tif (!node) continue;\n\n\t\tresult[node.codeKey] = result[node.codeKey] ?? [];\n\t\tresult[node.codeKey].push(node.value);\n\t}\n\n\treturn result;\n}\n\nexport function treeSelectValueToMultiValue(value: TreeSelectValue | undefined): TreeMultiSelectValue {\n\tif (!value) {\n\t\treturn {};\n\t}\n\n\treturn {\n\t\t[value.codeKey]: [value.value]\n\t};\n}\n\nfunction getAncestorIds(nodeId: string, index: TreeNodeIndex) {\n\tconst ancestors: string[] = [];\n\tlet currentId = index.parentById.get(nodeId);\n\n\twhile (currentId) {\n\t\tancestors.push(currentId);\n\t\tcurrentId = index.parentById.get(currentId);\n\t}\n\n\treturn ancestors;\n}\n\nfunction isDescendantOf(nodeId: string, ancestorId: string, index: TreeNodeIndex) {\n\tlet currentId = index.parentById.get(nodeId);\n\n\twhile (currentId) {\n\t\tif (currentId === ancestorId) {\n\t\t\treturn true;\n\t\t}\n\n\t\tcurrentId = index.parentById.get(currentId);\n\t}\n\n\treturn false;\n}\n\nfunction removeDescendantSelections(selectedIds: Set<string>, nodeId: string, index: TreeNodeIndex) {\n\tfor (const selectedId of [...selectedIds]) {\n\t\tif (isDescendantOf(selectedId, nodeId, index)) {\n\t\t\tselectedIds.delete(selectedId);\n\t\t}\n\t}\n}\n\nfunction isNodeFullySelected(nodeId: string, selectedIds: Set<string>, index: TreeNodeIndex): boolean {\n\tif (selectedIds.has(nodeId)) {\n\t\treturn true;\n\t}\n\n\tconst children = index.childrenById.get(nodeId) ?? [];\n\tif (children.length === 0) {\n\t\treturn false;\n\t}\n\n\treturn children.every((childId) => isNodeFullySelected(childId, selectedIds, index));\n}\n\nexport function canonicalizeTreeSelection(selectedIds: Set<string>, index: TreeNodeIndex) {\n\tconst nextSelectedIds = new Set(selectedIds);\n\n\tfor (const selectedId of [...nextSelectedIds]) {\n\t\tif (getAncestorIds(selectedId, index).some((ancestorId) => nextSelectedIds.has(ancestorId))) {\n\t\t\tnextSelectedIds.delete(selectedId);\n\t\t}\n\t}\n\n\tconst orderedNodeIds = [...index.nodeById.keys()].sort(\n\t\t(leftId, rightId) => (index.preorderIndexById.get(rightId) ?? 0) - (index.preorderIndexById.get(leftId) ?? 0)\n\t);\n\n\tfor (const nodeId of orderedNodeIds) {\n\t\tconst children = index.childrenById.get(nodeId) ?? [];\n\n\t\tif (children.length === 0 || nextSelectedIds.has(nodeId)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (children.every((childId) => isNodeFullySelected(childId, nextSelectedIds, index))) {\n\t\t\tremoveDescendantSelections(nextSelectedIds, nodeId, index);\n\t\t\tnextSelectedIds.add(nodeId);\n\t\t}\n\t}\n\n\treturn nextSelectedIds;\n}\n\nfunction expandNearestSelectedAncestor(selectedIds: Set<string>, nodeId: string, index: TreeNodeIndex) {\n\tlet currentId = index.parentById.get(nodeId);\n\n\twhile (currentId) {\n\t\tif (selectedIds.has(currentId)) {\n\t\t\tselectedIds.delete(currentId);\n\n\t\t\tfor (const childId of index.childrenById.get(currentId) ?? []) {\n\t\t\t\tselectedIds.add(childId);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tcurrentId = index.parentById.get(currentId);\n\t}\n\n\treturn false;\n}\n\nexport function isTreeNodeSelected(nodeId: string, selectedIds: Set<string>, index: TreeNodeIndex): boolean {\n\tif (selectedIds.has(nodeId)) {\n\t\treturn true;\n\t}\n\n\treturn getAncestorIds(nodeId, index).some((ancestorId) => selectedIds.has(ancestorId));\n}\n\nfunction resolveTreeSelectionState(nodeId: string, selectedIds: Set<string>, index: TreeNodeIndex, state: TreeNodeSelectionState) {\n\tconst children = index.childrenById.get(nodeId) ?? [];\n\n\tif (selectedIds.has(nodeId)) {\n\t\tstate.selectedIds.add(nodeId);\n\t\treturn { selected: true, partial: false };\n\t}\n\n\tif (children.length === 0) {\n\t\treturn { selected: false, partial: false };\n\t}\n\n\tconst childStates = children.map((childId) => resolveTreeSelectionState(childId, selectedIds, index, state));\n\tconst allSelected = childStates.every((childState) => childState.selected && !childState.partial);\n\tconst hasAnySelected = childStates.some((childState) => childState.selected || childState.partial);\n\n\tif (allSelected) {\n\t\tstate.selectedIds.add(nodeId);\n\t\treturn { selected: true, partial: false };\n\t}\n\n\tif (hasAnySelected) {\n\t\tstate.partialIds.add(nodeId);\n\t\treturn { selected: false, partial: true };\n\t}\n\n\treturn { selected: false, partial: false };\n}\n\nexport function getTreeNodeSelectionState(selectedIds: Set<string>, index: TreeNodeIndex): TreeNodeSelectionState {\n\tconst state: TreeNodeSelectionState = {\n\t\tselectedIds: new Set(),\n\t\tpartialIds: new Set()\n\t};\n\n\tfor (const rootId of index.rootIds) {\n\t\tresolveTreeSelectionState(rootId, selectedIds, index, state);\n\t}\n\n\treturn state;\n}\n\nexport function toggleTreeMultiSelection(currentValue: TreeMultiSelectValue | undefined, targetNodeId: string, index: TreeNodeIndex) {\n\tconst selectedIds = treeMultiValueToSelectedIds(currentValue, index);\n\n\tconst toggle = (targetId: string) => {\n\t\tif (isTreeNodeSelected(targetId, selectedIds, index)) {\n\t\t\tif (selectedIds.has(targetId)) {\n\t\t\t\tselectedIds.delete(targetId);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (expandNearestSelectedAncestor(selectedIds, targetId, index)) {\n\t\t\t\ttoggle(targetId);\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tremoveDescendantSelections(selectedIds, targetId, index);\n\t\tselectedIds.add(targetId);\n\t};\n\n\ttoggle(targetNodeId);\n\n\treturn treeSelectedIdsToMultiValue(canonicalizeTreeSelection(selectedIds, index), index);\n}\n\nfunction collectExpandedIds(nodeId: string, index: TreeNodeIndex, expandedIds: Set<string>) {\n\tlet currentId = index.parentById.get(nodeId);\n\n\twhile (currentId) {\n\t\texpandedIds.add(currentId);\n\t\tcurrentId = index.parentById.get(currentId);\n\t}\n}\n\nexport function getSelectionExpandedIds(selectedIds: Set<string>, index: TreeNodeIndex) {\n\tconst expandedIds = new Set<string>();\n\n\tfor (const selectedId of selectedIds) {\n\t\tcollectExpandedIds(selectedId, index, expandedIds);\n\t}\n\n\treturn expandedIds;\n}\n\nfunction filterTreeNode(node: TreeSelectNode, normalizedQuery: string, expandedIds: Set<string>): TreeSelectNode | null {\n\tconst filteredChildren = (node.children ?? [])\n\t\t.map((childNode) => filterTreeNode(childNode, normalizedQuery, expandedIds))\n\t\t.filter((childNode): childNode is TreeSelectNode => Boolean(childNode));\n\tconst isMatched = node.searchText.toLowerCase().includes(normalizedQuery);\n\n\tif (!isMatched && filteredChildren.length === 0) {\n\t\treturn null;\n\t}\n\n\tif (filteredChildren.length > 0) {\n\t\texpandedIds.add(node.id);\n\t}\n\n\tif (filteredChildren.length === 0) {\n\t\treturn node;\n\t}\n\n\treturn {\n\t\t...node,\n\t\tchildren: filteredChildren\n\t};\n}\n\nexport function filterTreeNodes(nodes: readonly TreeSelectNode[], query: string) {\n\tconst normalizedQuery = query.trim().toLowerCase();\n\n\tif (!normalizedQuery) {\n\t\treturn {\n\t\t\tnodes: [...nodes],\n\t\t\texpandedIds: new Set<string>()\n\t\t};\n\t}\n\n\tconst expandedIds = new Set<string>();\n\tconst filteredNodes = nodes\n\t\t.map((node) => filterTreeNode(node, normalizedQuery, expandedIds))\n\t\t.filter((node): node is TreeSelectNode => Boolean(node));\n\n\treturn {\n\t\tnodes: filteredNodes,\n\t\texpandedIds\n\t};\n}\n\nexport function flattenVisibleTreeNodes(nodes: readonly TreeSelectNode[], expandedIds: Set<string>): TreeVisibleEntry[] {\n\tconst entries: TreeVisibleEntry[] = [];\n\n\tconst walk = (node: TreeSelectNode, level: number, parentId?: string) => {\n\t\tconst hasChildren = (node.children?.length ?? 0) > 0;\n\t\tconst isExpanded = hasChildren && expandedIds.has(node.id);\n\n\t\tentries.push({\n\t\t\tnode,\n\t\t\tlevel,\n\t\t\tparentId,\n\t\t\thasChildren,\n\t\t\tisExpanded,\n\t\t\tisLeaf: !hasChildren\n\t\t});\n\n\t\tif (!isExpanded) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (const childNode of node.children ?? []) {\n\t\t\twalk(childNode, level + 1, node.id);\n\t\t}\n\t};\n\n\tfor (const node of nodes) {\n\t\twalk(node, 0);\n\t}\n\n\treturn entries;\n}\n","@use \"@/styles/mixins\" as *;\n\n// .uiOptionRow\n.treeRow {\n\tdisplay: flex;\n\talign-items: stretch;\n\tborder-radius: var(--radius-sm);\n\tcursor: pointer;\n\n\t&:focus {\n\t\t@include focusVisible;\n\n\t\tbackground-color: var(--surface-accent);\n\t\tborder-color: var(--border-1);\n\t\tcursor: pointer;\n\t}\n\n\t&:hover {\n\t\tbackground-color: var(--surface-accent);\n\t\tcursor: pointer;\n\t}\n}\n\n// .uiOptionRowSelected\n.treeRowSelected {\n\tbackground-color: var(--surface-2);\n\tcolor: var(--content-accent);\n\tcursor: default;\n}\n\n// .uiOptionRowActive\n.treeRowActive {\n\tbackground-color: var(--surface-1);\n}\n\n.treeNodeButton {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: var(--space-xs);\n\twidth: 100%;\n\tpadding: var(--space-xs) var(--space-xs) var(--space-xs) 0;\n\tbackground: transparent;\n\ttext-align: left;\n\tborder-radius: var(--radius-sm);\n}\n\n.treeIndent {\n\tflex-shrink: 0;\n\twidth: calc(var(--tree-level) * 1em);\n}\n\n.treeExpander,\n.treeExpanderPlaceholder {\n\tflex-shrink: 0;\n\twidth: 1.5em;\n\theight: 1.5em;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n.treeExpander {\n\tbackground: transparent;\n\tborder: none;\n\tborder-radius: var(--radius-sm);\n\tcolor: var(--content-2);\n\n\t&:hover {\n\t\tcolor: var(--content-0);\n\t\tbackground-color: var(--surface-0);\n\t}\n}\n\n.treeExpanderIcon {\n\ttransition: transform var(--transition-fast) ease;\n}\n\n.treeExpanderIconExpanded {\n\ttransform: rotate(90deg);\n}\n\n.treeSelection {\n\tflex-shrink: 0;\n\twidth: 1em;\n\theight: 1em;\n\tborder: var(--border);\n\tborder-radius: var(--radius-xs);\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\tbackground-color: var(--surface-0);\n\tcolor: transparent;\n}\n\n.treeSelectionChecked {\n\tbackground-color: var(--status-info-text);\n\tborder-color: var(--status-info-text);\n\tcolor: var(--white);\n\n\t// outline: 1px dashed rgb(255, 100, 141);\n\t// outline-offset: -1px;\n}\n\n.treeSelectionPartial {\n\tbackground-color: var(--surface-1);\n\tborder-color: var(--status-info-text);\n\tcolor: var(--status-info-text);\n}\n\n.treeSelectionIcon {\n\twidth: 0.75rem;\n\theight: 0.75rem;\n}\n\n.treeSummary {\n\tpadding-right: calc(var(--control-height) * 2);\n}\n\n.inputWithOverlay {\n\tcolor: transparent;\n\tcaret-color: transparent;\n}\n\n.valueOverlay {\n\tposition: absolute;\n\tinset: 0 calc(var(--control-height) * 2) 0 var(--space-md);\n\tdisplay: flex;\n\talign-items: center;\n\tpointer-events: none;\n\toverflow: hidden;\n}\n\n.treeActions {\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n\theight: 100%;\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.treeClearButton {\n\tcolor: var(--status-error-text);\n}\n","import { CSSProperties } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { CheckIcon, ChevronRightIcon, MinusIcon } from \"lucide-react\";\n\nimport { SelectOptionContent } from \"../select/SelectOptionContent\";\n\nimport styles from \"./TreeSelect.module.scss\";\nimport { TreeSelectNode } from \"./types\";\n\ntype TreeNodeContentProps = {\n\tnode: TreeSelectNode;\n\tlevel: number;\n\thighlight?: string;\n\thasChildren: boolean;\n\tisExpanded: boolean;\n\tselected: boolean;\n\tpartial: boolean;\n\tselectionMode: \"single\" | \"multi\";\n\tonToggleExpand?: () => void;\n};\n\nexport function TreeNodeContent({\n\tnode,\n\tlevel,\n\thighlight,\n\thasChildren,\n\tisExpanded,\n\tselected,\n\tpartial,\n\tselectionMode,\n\tonToggleExpand\n}: TreeNodeContentProps) {\n\treturn (\n\t\t<>\n\t\t\t<span className={styles.treeIndent} style={{ \"--tree-level\": level } as CSSProperties} aria-hidden=\"true\" />\n\t\t\t{hasChildren ? (\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclassName={styles.treeExpander}\n\t\t\t\t\tonClick={(event) => {\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tonToggleExpand?.();\n\t\t\t\t\t}}\n\t\t\t\t\taria-label={isExpanded ? \"Свернуть ветку\" : \"Развернуть ветку\"}\n\t\t\t\t\tdata-ui=\"tree-select-expander\"\n\t\t\t\t\tdata-action={isExpanded ? \"collapse-tree-select-node\" : \"expand-tree-select-node\"}>\n\t\t\t\t\t<ChevronRightIcon className={cn(styles.treeExpanderIcon, isExpanded && styles.treeExpanderIconExpanded)} />\n\t\t\t\t</button>\n\t\t\t) : (\n\t\t\t\t<span className={styles.treeExpanderPlaceholder} aria-hidden=\"true\" />\n\t\t\t)}\n\n\t\t\t{selectionMode === \"multi\" && (\n\t\t\t\t<span\n\t\t\t\t\tclassName={cn(styles.treeSelection, selected && styles.treeSelectionChecked, partial && styles.treeSelectionPartial)}\n\t\t\t\t\taria-hidden=\"true\">\n\t\t\t\t\t{selected ? (\n\t\t\t\t\t\t<CheckIcon className={styles.treeSelectionIcon} />\n\t\t\t\t\t) : partial ? (\n\t\t\t\t\t\t<MinusIcon className={styles.treeSelectionIcon} />\n\t\t\t\t\t) : null}\n\t\t\t\t</span>\n\t\t\t)}\n\n\t\t\t<SelectOptionContent label={node.label} code={node.code} highlight={highlight} />\n\t\t</>\n\t);\n}\n","import { ReactNode, useEffect, useMemo, useRef, useState } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { XIcon } from \"lucide-react\";\n\nimport { InputText } from \"../input\";\nimport {\n\tPickerField,\n\tPickerPopup,\n\tPickerStatus,\n\tPickerTriggerActions,\n\tPickerTriggerInput,\n\tusePickerFloatingListbox,\n\tusePickerQuery,\n\tusePickerTriggerController\n} from \"../picker\";\nimport { UiBaseProps } from \"../types\";\nimport uiStyles from \"../ui.module.scss\";\n\nimport {\n\tcreateTreeNodeIndex,\n\tfilterTreeNodes,\n\tflattenVisibleTreeNodes,\n\tgetSelectionExpandedIds,\n\tTreeVisibleEntry\n} from \"./model/treeUtils\";\nimport { TreeNodeContent } from \"./TreeNodeContent\";\nimport styles from \"./TreeSelect.module.scss\";\nimport { TreeSelectNode } from \"./types\";\n\ntype TreePickerBaseProps = Omit<UiBaseProps<never>, \"value\" | \"onChange\"> & {\n\tnodes: readonly TreeSelectNode[];\n\tselectedIds: Set<string>;\n\tpartialIds: Set<string>;\n\tselectionMode: \"single\" | \"multi\";\n\ttriggerMode?: \"display\" | \"search\";\n\tselectedSummary?: ReactNode;\n\tselectedSummaryText?: string;\n\tquery?: string;\n\tdefaultQuery?: string;\n\tonQuery?: (value: string) => void;\n\tonNodeActivate: (node: TreeSelectNode) => void;\n\tonClearSelection?: () => void;\n\tisLoading?: boolean;\n\terror?: string;\n};\n\nexport function TreePickerBase({\n\tlabel,\n\tdescription,\n\tdisabled,\n\tplaceholder,\n\tsize,\n\tnodes,\n\tselectedIds,\n\tpartialIds,\n\tselectionMode,\n\ttriggerMode = \"display\",\n\tselectedSummary,\n\tselectedSummaryText,\n\tquery,\n\tdefaultQuery,\n\tonQuery,\n\tonNodeActivate,\n\tonClearSelection,\n\tisLoading,\n\terror\n}: TreePickerBaseProps) {\n\tconst inputRef = useRef<HTMLInputElement | null>(null);\n\tconst previousOpenRef = useRef(false);\n\tconst [expandedIds, setExpandedIds] = useState<Set<string>>(() => new Set());\n\tconst resolvedTriggerMode = triggerMode === \"search\" ? \"search-single\" : \"display\";\n\tconst treeIndex = useMemo(() => createTreeNodeIndex(nodes), [nodes]);\n\tconst { query: currentQuery, setQuery } = usePickerQuery({\n\t\topen: true,\n\t\tquery,\n\t\tdefaultQuery,\n\t\tonQuery,\n\t\ttriggerMode: \"display\"\n\t});\n\tconst { nodes: filteredNodes, expandedIds: searchExpandedIds } = useMemo(\n\t\t() => filterTreeNodes(nodes, currentQuery),\n\t\t[nodes, currentQuery]\n\t);\n\tconst selectedExpandedIds = useMemo(() => getSelectionExpandedIds(selectedIds, treeIndex), [selectedIds, treeIndex]);\n\tconst resolvedExpandedIds = useMemo(\n\t\t() => new Set([...expandedIds, ...searchExpandedIds, ...selectedExpandedIds]),\n\t\t[expandedIds, searchExpandedIds, selectedExpandedIds]\n\t);\n\tconst visibleEntries = useMemo(() => flattenVisibleTreeNodes(filteredNodes, resolvedExpandedIds), [filteredNodes, resolvedExpandedIds]);\n\tconst selectedIndex = useMemo(() => visibleEntries.findIndex((entry) => selectedIds.has(entry.node.id)), [selectedIds, visibleEntries]);\n\tconst {\n\t\topen,\n\t\tactiveIndex,\n\t\tcontext,\n\t\tfloatingStyles,\n\t\tgetFloatingProps,\n\t\tsetReference,\n\t\tsetFloating,\n\t\tsetOptionRef,\n\t\tclose,\n\t\topenList,\n\t\ttoggleOpen,\n\t\tselectOption,\n\t\thandleReferenceKeyDown,\n\t\thandleFloatingKeyDown,\n\t\tgetOptionId,\n\t\tgetActiveOptionId\n\t} = usePickerFloatingListbox({\n\t\toptions: visibleEntries,\n\t\tselectedIndex,\n\t\tonSelect: (entry) => onNodeActivate(entry.node),\n\t\tdisabled: disabled || isLoading,\n\t\tcloseOnSelect: selectionMode === \"single\",\n\t\tallowOpenWithoutOptions: true,\n\t\ttriggerMode: resolvedTriggerMode\n\t});\n\tconst hasSelection = selectedIds.size > 0;\n\tconst showTriggerQuery = triggerMode === \"search\" && (open || currentQuery.length > 0);\n\tconst triggerValue = showTriggerQuery ? currentQuery : (selectedSummaryText ?? \"\");\n\tconst showSummaryOverlay = triggerMode === \"display\" && Boolean(selectedSummary);\n\tconst triggerController = usePickerTriggerController({\n\t\tmode: resolvedTriggerMode,\n\t\topen,\n\t\tcurrentQuery,\n\t\thasDisplayValue: Boolean(selectedSummaryText),\n\t\tinputRef,\n\t\tsetQuery,\n\t\topenList,\n\t\tclose,\n\t\ttoggleOpen\n\t});\n\n\tuseEffect(() => {\n\t\tif (previousOpenRef.current && !open && triggerController.policy.resetQueryOnClose) {\n\t\t\tsetQuery(\"\");\n\t\t}\n\n\t\tpreviousOpenRef.current = open;\n\t}, [open, setQuery, triggerController.policy.resetQueryOnClose]);\n\n\tconst setInputNode = (node: HTMLInputElement | null) => {\n\t\tinputRef.current = node;\n\t};\n\tconst handleClearSelection = () => {\n\t\tonClearSelection?.();\n\t\tsetQuery(\"\");\n\t\tclose();\n\t};\n\n\tconst toggleExpand = (entry: TreeVisibleEntry) => {\n\t\tif (!entry.hasChildren) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetExpandedIds((currentExpandedIds) => {\n\t\t\tconst nextExpandedIds = new Set(currentExpandedIds);\n\n\t\t\tif (nextExpandedIds.has(entry.node.id)) {\n\t\t\t\tnextExpandedIds.delete(entry.node.id);\n\t\t\t} else {\n\t\t\t\tnextExpandedIds.add(entry.node.id);\n\t\t\t}\n\n\t\t\treturn nextExpandedIds;\n\t\t});\n\t};\n\n\treturn (\n\t\t<PickerField label={label} description={description} disabled={disabled} placeholder={placeholder} size={size}>\n\t\t\t{({ controlId, labelId, describedBy }) => {\n\t\t\t\tconst listId = `${controlId}-listbox`;\n\n\t\t\t\treturn (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PickerTriggerInput\n\t\t\t\t\t\t\tref={setInputNode}\n\t\t\t\t\t\t\trootRef={setReference}\n\t\t\t\t\t\t\tid={controlId}\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\tdisabled={disabled || isLoading}\n\t\t\t\t\t\t\treadOnly={triggerMode !== \"search\"}\n\t\t\t\t\t\t\tvalue={triggerMode === \"display\" && showSummaryOverlay ? \"\" : triggerValue}\n\t\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\t\ttriggerMode === \"search\"\n\t\t\t\t\t\t\t\t\t? !selectedSummaryText || showTriggerQuery\n\t\t\t\t\t\t\t\t\t\t? placeholder\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t: hasSelection\n\t\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t\t: placeholder\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taria-labelledby={labelId}\n\t\t\t\t\t\t\taria-describedby={describedBy}\n\t\t\t\t\t\t\taria-haspopup=\"listbox\"\n\t\t\t\t\t\t\taria-expanded={open}\n\t\t\t\t\t\t\taria-controls={open ? listId : undefined}\n\t\t\t\t\t\t\taria-autocomplete={triggerMode === \"search\" ? \"list\" : \"none\"}\n\t\t\t\t\t\t\taria-activedescendant={open && visibleEntries.length > 0 ? getActiveOptionId(listId) : undefined}\n\t\t\t\t\t\t\tinputClassName={cn(hasSelection && styles.treeSummary, showSummaryOverlay && styles.inputWithOverlay)}\n\t\t\t\t\t\t\toverlay={showSummaryOverlay ? <div className={styles.valueOverlay}>{selectedSummary}</div> : undefined}\n\t\t\t\t\t\t\tendAdornment={\n\t\t\t\t\t\t\t\t<PickerTriggerActions\n\t\t\t\t\t\t\t\t\topen={open}\n\t\t\t\t\t\t\t\t\tdisabled={disabled || isLoading}\n\t\t\t\t\t\t\t\t\tonToggleMouseDown={triggerController.handleToggleMouseDown}\n\t\t\t\t\t\t\t\t\tonToggleClick={triggerController.handleToggleClick}>\n\t\t\t\t\t\t\t\t\t{hasSelection && onClearSelection ? (\n\t\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\tclassName={styles.treeClearButton}\n\t\t\t\t\t\t\t\t\t\t\tonMouseDown={(event) => {\n\t\t\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\tonClick={(event) => {\n\t\t\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\t\t\thandleClearSelection();\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\taria-label=\"Очистить выбор\">\n\t\t\t\t\t\t\t\t\t\t\t<XIcon />\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t</PickerTriggerActions>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonChange={(event) => {\n\t\t\t\t\t\t\t\tif (triggerMode !== \"search\") {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\ttriggerController.handleTriggerInputChange(event.target.value);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tonClick={triggerController.handleTriggerClick}\n\t\t\t\t\t\t\tonFocus={(event) => {\n\t\t\t\t\t\t\t\ttriggerController.handleTriggerFocus(event.currentTarget);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tonKeyDown={(event) => {\n\t\t\t\t\t\t\t\thandleReferenceKeyDown(event);\n\n\t\t\t\t\t\t\t\tif (event.defaultPrevented) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\ttriggerController.handleTriggerKeyDown({\n\t\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\t\tonActivateWhenOpen: () => {\n\t\t\t\t\t\t\t\t\t\tconst activeEntry = activeIndex >= 0 ? visibleEntries[activeIndex] : undefined;\n\t\t\t\t\t\t\t\t\t\tif (activeEntry) {\n\t\t\t\t\t\t\t\t\t\t\tselectOption(activeEntry);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tenableSpaceActivation: triggerMode === \"display\"\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t<PickerPopup\n\t\t\t\t\t\t\topen={open}\n\t\t\t\t\t\t\tcontext={context}\n\t\t\t\t\t\t\tfloatingStyles={floatingStyles}\n\t\t\t\t\t\t\tlistId={listId}\n\t\t\t\t\t\t\tlabelId={labelId}\n\t\t\t\t\t\t\tdescriptionId={describedBy}\n\t\t\t\t\t\t\tactiveOptionId={visibleEntries.length > 0 ? getActiveOptionId(listId) : undefined}\n\t\t\t\t\t\t\tsetFloating={setFloating}\n\t\t\t\t\t\t\tgetFloatingProps={getFloatingProps}\n\t\t\t\t\t\t\tonKeyDown={handleFloatingKeyDown}\n\t\t\t\t\t\t\tclassName={cn(uiStyles.uiPopupOptions, \"scrollable\")}\n\t\t\t\t\t\t\theader={\n\t\t\t\t\t\t\t\ttriggerMode === \"display\" ? (\n\t\t\t\t\t\t\t\t\t<InputText\n\t\t\t\t\t\t\t\t\t\tvalue={currentQuery}\n\t\t\t\t\t\t\t\t\t\tonChange={setQuery}\n\t\t\t\t\t\t\t\t\t\tonClear={() => setQuery(\"\")}\n\t\t\t\t\t\t\t\t\t\tplaceholder=\"Поиск по дереву\"\n\t\t\t\t\t\t\t\t\t\tonKeyDown={(event) => {\n\t\t\t\t\t\t\t\t\t\t\tif (event.key !== \"Escape\" && event.key !== \"Tab\") {\n\t\t\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\tonClick={(event) => {\n\t\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) : undefined\n\t\t\t\t\t\t\t}>\n\t\t\t\t\t\t\t<div className=\"\">\n\t\t\t\t\t\t\t\t{visibleEntries.length === 0 ? (\n\t\t\t\t\t\t\t\t\t<PickerStatus\n\t\t\t\t\t\t\t\t\t\terrorState={error}\n\t\t\t\t\t\t\t\t\t\tloadingState={isLoading ? \"Загрузка...\" : undefined}\n\t\t\t\t\t\t\t\t\t\temptyState={!error && !isLoading ? \"Нет данных\" : undefined}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\tvisibleEntries.map((entry, index) => {\n\t\t\t\t\t\t\t\t\t\tconst selected = selectedIds.has(entry.node.id);\n\t\t\t\t\t\t\t\t\t\tconst partial = !selected && partialIds.has(entry.node.id);\n\t\t\t\t\t\t\t\t\t\tconst active = index === activeIndex;\n\n\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\tkey={entry.node.id}\n\t\t\t\t\t\t\t\t\t\t\t\tid={getOptionId(listId, index)}\n\t\t\t\t\t\t\t\t\t\t\t\tref={(node) => setOptionRef(index, node)}\n\t\t\t\t\t\t\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\t\t\t\t\t\t\taria-selected={selected}\n\t\t\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyles.treeRow,\n\t\t\t\t\t\t\t\t\t\t\t\t\tactive && styles.treeRowActive,\n\t\t\t\t\t\t\t\t\t\t\t\t\tselected && styles.treeRowSelected\n\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\tonMouseDown={(event) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={() => selectOption(entry)}>\n\t\t\t\t\t\t\t\t\t\t\t\t<div className={styles.treeNodeButton}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<TreeNodeContent\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tnode={entry.node}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlevel={entry.level}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\thighlight={currentQuery}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\thasChildren={entry.hasChildren}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tisExpanded={entry.isExpanded}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tselected={selected}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpartial={partial}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tselectionMode={selectionMode}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonToggleExpand={() => toggleExpand(entry)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</PickerPopup>\n\t\t\t\t\t</>\n\t\t\t\t);\n\t\t\t}}\n\t\t</PickerField>\n\t);\n}\n","import { useMemo } from \"react\";\n\nimport { UiBaseProps } from \"../types\";\n\nimport { createTreeNodeIndex, getTreeNodeSelectionState, toggleTreeMultiSelection, treeMultiValueToSelectedIds } from \"./model/treeUtils\";\nimport { TreePickerBase } from \"./TreePickerBase\";\nimport { TreeMultiSelectValue, TreeSelectNode } from \"./types\";\n\nexport interface TreeMultiSelectProps extends Omit<UiBaseProps<TreeMultiSelectValue>, \"placeholder\"> {\n\tnodes: readonly TreeSelectNode[];\n\tplaceholder?: string;\n\tquery?: string;\n\tdefaultQuery?: string;\n\tonQuery?: (value: string) => void;\n\tisLoading?: boolean;\n\terror?: string;\n}\n\nfunction formatTreeMultiSummary(selectedIds: Set<string>, treeIndex: ReturnType<typeof createTreeNodeIndex>) {\n\tif (selectedIds.size === 0) {\n\t\treturn undefined;\n\t}\n\n\tif (selectedIds.size === 1) {\n\t\tconst selectedNode = treeIndex.nodeById.get([...selectedIds][0]);\n\n\t\tif (!selectedNode) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (selectedNode.code && selectedNode.code !== selectedNode.label) {\n\t\t\treturn `${selectedNode.label} · ${selectedNode.code}`;\n\t\t}\n\n\t\treturn selectedNode.label;\n\t}\n\n\treturn `Выбрано ${selectedIds.size} узл.`;\n}\n\nexport function TreeMultiSelect({\n\tlabel,\n\tdescription,\n\tdisabled,\n\tplaceholder = \"Выберите значения\",\n\tsize,\n\tnodes,\n\tvalue,\n\tonChange,\n\tquery,\n\tdefaultQuery,\n\tonQuery,\n\tisLoading,\n\terror\n}: TreeMultiSelectProps) {\n\tconst treeIndex = useMemo(() => createTreeNodeIndex(nodes), [nodes]);\n\tconst selectedIds = useMemo(() => treeMultiValueToSelectedIds(value, treeIndex), [treeIndex, value]);\n\tconst selectionState = useMemo(() => getTreeNodeSelectionState(selectedIds, treeIndex), [selectedIds, treeIndex]);\n\tconst selectedSummary = useMemo(() => formatTreeMultiSummary(selectedIds, treeIndex), [selectedIds, treeIndex]);\n\n\treturn (\n\t\t<TreePickerBase\n\t\t\tlabel={label}\n\t\t\tdescription={description}\n\t\t\tdisabled={disabled}\n\t\t\tplaceholder={placeholder}\n\t\t\tsize={size}\n\t\t\tnodes={nodes}\n\t\t\tselectedIds={selectionState.selectedIds}\n\t\t\tpartialIds={selectionState.partialIds}\n\t\t\tselectionMode=\"multi\"\n\t\t\ttriggerMode=\"search\"\n\t\t\tselectedSummary={selectedSummary}\n\t\t\tquery={query}\n\t\t\tdefaultQuery={defaultQuery}\n\t\t\tonQuery={onQuery}\n\t\t\tonNodeActivate={(node) => onChange(toggleTreeMultiSelection(value, node.id, treeIndex))}\n\t\t\tonClearSelection={() => onChange({})}\n\t\t\tisLoading={isLoading}\n\t\t\terror={error}\n\t\t/>\n\t);\n}\n","import { ODataDependentBaseProps } from \"@ryuzaki13/react-foundation-api/odata\";\n\nimport { UiBaseProps } from \"../types\";\n\nimport { useODataTreeData } from \"./model/useODataTreeData\";\nimport { TreeMultiSelect } from \"./TreeMultiSelect\";\nimport { TreeMultiSelectValue } from \"./types\";\n\nexport interface ODataTreeMultiSelectProps\n\textends Omit<ODataDependentBaseProps, \"model\" | \"value\" | \"dependencies\">, Omit<UiBaseProps<TreeMultiSelectValue>, \"placeholder\"> {\n\tmodel?: ODataDependentBaseProps[\"model\"];\n\tplaceholder?: string;\n\tquery?: string;\n\tdefaultQuery?: string;\n\tonQuery?: (value: string) => void;\n}\n\nexport function ODataTreeMultiSelect({\n\tlabel,\n\tdescription,\n\tdisabled,\n\tsize,\n\tplaceholder,\n\tquery,\n\tdefaultQuery,\n\tonQuery,\n\tvalue,\n\tonChange,\n\todata,\n\tsegments,\n\tmodel\n}: ODataTreeMultiSelectProps) {\n\tconst treeData = useODataTreeData({\n\t\todata,\n\t\tsegments,\n\t\tmodel\n\t});\n\n\treturn (\n\t\t<TreeMultiSelect\n\t\t\tlabel={label}\n\t\t\tdescription={description}\n\t\t\tdisabled={disabled || treeData.isLoading}\n\t\t\tsize={size}\n\t\t\tplaceholder={placeholder ?? treeData.placeholder}\n\t\t\tnodes={treeData.nodes}\n\t\t\tvalue={value}\n\t\t\tonChange={onChange}\n\t\t\tquery={query}\n\t\t\tdefaultQuery={defaultQuery}\n\t\t\tonQuery={onQuery}\n\t\t\tisLoading={treeData.isLoading}\n\t\t\terror={treeData.isError ? \"Ошибка загрузки\" : undefined}\n\t\t/>\n\t);\n}\n","import { useMemo } from \"react\";\n\nimport { UiBaseProps } from \"../types\";\n\nimport { createTreeNodeIndex, treeSelectValueToId } from \"./model/treeUtils\";\nimport { TreePickerBase } from \"./TreePickerBase\";\nimport { TreeSelectNode, TreeSelectValue } from \"./types\";\n\nexport interface TreeSelectProps extends Omit<UiBaseProps<TreeSelectValue | undefined>, \"placeholder\"> {\n\tnodes: readonly TreeSelectNode[];\n\tplaceholder?: string;\n\tquery?: string;\n\tdefaultQuery?: string;\n\tonQuery?: (value: string) => void;\n\tisLoading?: boolean;\n\terror?: string;\n\tclearable?: boolean;\n}\n\nfunction formatTreeNodeSummary(node: TreeSelectNode | undefined) {\n\tif (!node) {\n\t\treturn undefined;\n\t}\n\n\tif (node.code && node.code !== node.label) {\n\t\treturn `${node.label} · ${node.code}`;\n\t}\n\n\treturn node.label;\n}\n\nexport function TreeSelect({\n\tlabel,\n\tdescription,\n\tdisabled,\n\tplaceholder = \"Выберите значение\",\n\tsize,\n\tnodes,\n\tvalue,\n\tonChange,\n\tquery,\n\tdefaultQuery,\n\tonQuery,\n\tisLoading,\n\terror,\n\tclearable = false\n}: TreeSelectProps) {\n\tconst treeIndex = useMemo(() => createTreeNodeIndex(nodes), [nodes]);\n\tconst selectedId = treeSelectValueToId(value, treeIndex);\n\tconst selectedNode = selectedId ? treeIndex.nodeById.get(selectedId) : undefined;\n\n\treturn (\n\t\t<TreePickerBase\n\t\t\tlabel={label}\n\t\t\tdescription={description}\n\t\t\tdisabled={disabled}\n\t\t\tplaceholder={placeholder}\n\t\t\tsize={size}\n\t\t\tnodes={nodes}\n\t\t\tselectedIds={selectedId ? new Set([selectedId]) : new Set()}\n\t\t\tpartialIds={new Set()}\n\t\t\tselectionMode=\"single\"\n\t\t\ttriggerMode=\"search\"\n\t\t\tselectedSummaryText={formatTreeNodeSummary(selectedNode)}\n\t\t\tquery={query}\n\t\t\tdefaultQuery={defaultQuery}\n\t\t\tonQuery={onQuery}\n\t\t\tonNodeActivate={(node) => onChange({ codeKey: node.codeKey, value: node.value })}\n\t\t\tonClearSelection={clearable ? () => onChange(undefined) : undefined}\n\t\t\tisLoading={isLoading}\n\t\t\terror={error}\n\t\t/>\n\t);\n}\n","import { ODataDependentBaseProps } from \"@ryuzaki13/react-foundation-api/odata\";\n\nimport { UiBaseProps } from \"../types\";\n\nimport { useODataTreeData } from \"./model/useODataTreeData\";\nimport { TreeSelect } from \"./TreeSelect\";\nimport { TreeSelectValue } from \"./types\";\n\nexport interface ODataTreeSelectProps\n\textends\n\t\tOmit<ODataDependentBaseProps, \"model\" | \"value\" | \"dependencies\">,\n\t\tOmit<UiBaseProps<TreeSelectValue | undefined>, \"placeholder\"> {\n\tmodel?: ODataDependentBaseProps[\"model\"];\n\tplaceholder?: string;\n\tquery?: string;\n\tdefaultQuery?: string;\n\tonQuery?: (value: string) => void;\n\tclearable?: boolean;\n}\n\nexport function ODataTreeSelect({\n\tlabel,\n\tdescription,\n\tdisabled,\n\tsize,\n\tplaceholder,\n\tquery,\n\tdefaultQuery,\n\tonQuery,\n\tvalue,\n\tonChange,\n\todata,\n\tsegments,\n\tmodel,\n\tclearable\n}: ODataTreeSelectProps) {\n\tconst treeData = useODataTreeData({\n\t\todata,\n\t\tsegments,\n\t\tmodel\n\t});\n\n\treturn (\n\t\t<TreeSelect\n\t\t\tlabel={label}\n\t\t\tdescription={description}\n\t\t\tdisabled={disabled || treeData.isLoading}\n\t\t\tsize={size}\n\t\t\tplaceholder={placeholder ?? treeData.placeholder}\n\t\t\tnodes={treeData.nodes}\n\t\t\tvalue={value}\n\t\t\tonChange={onChange}\n\t\t\tquery={query}\n\t\t\tdefaultQuery={defaultQuery}\n\t\t\tonQuery={onQuery}\n\t\t\tisLoading={treeData.isLoading}\n\t\t\terror={treeData.isError ? \"Ошибка загрузки\" : undefined}\n\t\t\tclearable={clearable}\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;;AAEA,SAAgB,EAAiC,GAA0D;CAK1G,OAJK,IAIE,GACL,EAAM,UAAU,CAAC,EAAM,KAAK,EAC9B,IALQ,CAAC;AAMV;;;ACOA,SAAS,EAAa,GAA8B,GAAiB,GAAe;CACnF,OAAO,IAAW,GAAG,EAAS,GAAG,EAAQ,GAAG,MAAU,GAAG,EAAQ,GAAG;AACrE;AAEA,SAAS,EAAiB,GAAsB,GAAiB,GAAqC;CACrG,IAAM,IAAU,EAAY;CAC5B,OAAQ,KAAW,EA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C,CAAA;AAEH;;;ACpCA,SAAS,EAAsB,GAAkC;CAC3D,OAQL,OAJI,EAAK,QAAQ,EAAK,SAAS,EAAK,QAC5B,GAAG,EAAK,MAAM,KAAK,EAAK,SAGzB,EAAK;AACb;AAEA,SAAgB,EAAW,EAC1B,UACA,gBACA,aACA,iBAAc,qBACd,SACA,UACA,UACA,aACA,UACA,iBACA,YACA,cACA,UACA,eAAY,MACO;CACnB,IAAM,IAAY,QAAc,EAAoB,CAAK,GAAG,CAAC,CAAK,CAAC,GAC7D,IAAa,EAAoB,GAAO,CAAS,GACjD,IAAe,IAAa,EAAU,SAAS,IAAI,CAAU,IAAI,KAAA;CAEvE,OACC,kBAAC,GAAD;EACQ;EACM;EACH;EACG;EACP;EACC;EACP,aAAa,oBAAa,IAAI,IAAI,CAAC,CAAU,CAAC,oBAAI,IAAI,IAAI;EAC1D,4BAAY,IAAI,IAAI;EACpB,eAAc;EACd,aAAY;EACZ,qBAAqB,EAAsB,CAAY;EAChD;EACO;EACL;EACT,iBAAiB,MAAS,EAAS;GAAE,SAAS,EAAK;GAAS,OAAO,EAAK;EAAM,CAAC;EAC/E,kBAAkB,UAAkB,EAAS,KAAA,CAAS,IAAI,KAAA;EAC/C;EACJ;CACP,CAAA;AAEH;;;ACrDA,SAAgB,GAAgB,EAC/B,UACA,gBACA,aACA,SACA,gBACA,UACA,iBACA,YACA,UACA,aACA,UACA,aACA,UACA,gBACwB;CACxB,IAAM,IAAW,EAAiB;EACjC;EACA;EACA;CACD,CAAC;CAED,OACC,kBAAC,GAAD;EACQ;EACM;EACb,UAAU,KAAY,EAAS;EACzB;EACN,aAAa,KAAe,EAAS;EACrC,OAAO,EAAS;EACT;EACG;EACH;EACO;EACL;EACT,WAAW,EAAS;EACpB,OAAO,EAAS,UAAU,oBAAoB,KAAA;EACnC;CACX,CAAA;AAEH"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/tree-select/helpers.ts","../../src/tree-select/model/buildODataTreeNodes.ts","../../src/tree-select/model/resolveOrderedTreeSegmentItems.ts","../../src/tree-select/model/useODataTreeData.ts","../../src/tree-select/model/treeUtils.ts","../../src/tree-select/TreeSelect.module.scss","../../src/tree-select/TreeNodeContent.tsx","../../src/tree-select/TreePickerBase.tsx","../../src/tree-select/TreeMultiSelect.tsx","../../src/tree-select/ODataTreeMultiSelect.tsx","../../src/tree-select/TreeSelect.tsx","../../src/tree-select/ODataTreeSelect.tsx"],"sourcesContent":["import { TreeMultiSelectValue, TreeSelectValue } from \"./types\";\n\nexport function treeSelectValueToSelectedFilters(value: TreeSelectValue | undefined): TreeMultiSelectValue {\n\tif (!value) {\n\t\treturn {};\n\t}\n\n\treturn {\n\t\t[value.codeKey]: [value.value]\n\t};\n}\n","import { CollectionItem } from \"@ryuzaki13/react-foundation-lib/odata\";\n\nimport { TreeSelectNode } from \"../types\";\n\ntype BuildODataTreeNodesArgs = {\n\titems: CollectionItem[];\n\torderedCodeKeys: string[];\n\tkeyPairsMap: Record<string, string>;\n\thiddenCodeKeys: Set<string>;\n\ttextValueCodeKeys?: Set<string>;\n};\n\ntype MutableTreeNode = TreeSelectNode & {\n\tchildren: MutableTreeNode[];\n\tchildByBranchKey: Map<string, MutableTreeNode>;\n};\n\nfunction createNodeId(parentId: string | undefined, codeKey: string, value: string) {\n\treturn parentId ? `${parentId}/${codeKey}:${value}` : `${codeKey}:${value}`;\n}\n\nfunction resolveNodeLabel(item: CollectionItem, codeKey: string, keyPairsMap: Record<string, string>) {\n\tconst textKey = keyPairsMap[codeKey];\n\treturn (textKey && item[textKey]) || item[codeKey];\n}\n\nfunction createSearchText(parts: Array<string | undefined>) {\n\treturn [...new Set(parts.filter(Boolean))].join(\" \");\n}\n\nfunction createMutableNode(args: { parentId?: string; codeKey: string; value: string; label: string; code?: string }): MutableTreeNode {\n\treturn {\n\t\tid: createNodeId(args.parentId, args.codeKey, args.value),\n\t\tcodeKey: args.codeKey,\n\t\tvalue: args.value,\n\t\tlabel: args.label,\n\t\tcode: args.code,\n\t\tsearchText: createSearchText([args.value, args.label, args.code]),\n\t\tchildren: [],\n\t\tchildByBranchKey: new Map()\n\t};\n}\n\nfunction toPublicNode(node: MutableTreeNode): TreeSelectNode {\n\treturn {\n\t\tid: node.id,\n\t\tcodeKey: node.codeKey,\n\t\tvalue: node.value,\n\t\tlabel: node.label,\n\t\tcode: node.code,\n\t\tsearchText: node.searchText,\n\t\tchildren: node.children.length > 0 ? node.children.map(toPublicNode) : undefined\n\t};\n}\n\nexport function buildODataTreeNodes({\n\titems,\n\torderedCodeKeys,\n\tkeyPairsMap,\n\thiddenCodeKeys,\n\ttextValueCodeKeys\n}: BuildODataTreeNodesArgs): TreeSelectNode[] {\n\tif (orderedCodeKeys.length === 0 || items.length === 0) {\n\t\treturn [];\n\t}\n\n\tconst roots: MutableTreeNode[] = [];\n\tconst rootByBranchKey = new Map<string, MutableTreeNode>();\n\n\tfor (const item of items) {\n\t\tlet parentNode: MutableTreeNode | undefined;\n\n\t\tfor (const codeKey of orderedCodeKeys) {\n\t\t\tconst codeValue = String(item[codeKey] ?? \"\");\n\n\t\t\tif (!codeValue) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst label = String(resolveNodeLabel(item, codeKey, keyPairsMap) ?? \"\");\n\t\t\tconst value = textValueCodeKeys?.has(codeKey) ? label : codeValue;\n\t\t\tconst branchKey = `${codeKey}:${value}`;\n\t\t\tconst container = parentNode ? parentNode.childByBranchKey : rootByBranchKey;\n\t\t\tlet currentNode = container.get(branchKey);\n\n\t\t\tif (!currentNode) {\n\t\t\t\tcurrentNode = createMutableNode({\n\t\t\t\t\tparentId: parentNode?.id,\n\t\t\t\t\tcodeKey,\n\t\t\t\t\tvalue,\n\t\t\t\t\tlabel,\n\t\t\t\t\tcode: hiddenCodeKeys.has(codeKey) ? undefined : codeValue\n\t\t\t\t});\n\t\t\t\tcontainer.set(branchKey, currentNode);\n\n\t\t\t\tif (parentNode) {\n\t\t\t\t\tparentNode.children.push(currentNode);\n\t\t\t\t} else {\n\t\t\t\t\troots.push(currentNode);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tparentNode = currentNode;\n\t\t}\n\t}\n\n\treturn roots.map(toPublicNode);\n}\n","import { ODataDependentSegmentItem, sortODataDependentSegmentItemsByChains } from \"@ryuzaki13/react-foundation-api/odata\";\nimport { ODataChainsMap } from \"@ryuzaki13/react-foundation-lib/odata-service\";\n\nexport function resolveOrderedTreeSegmentItems(items: readonly ODataDependentSegmentItem[], chains: ODataChainsMap) {\n\treturn sortODataDependentSegmentItemsByChains(items, chains);\n}\n","import { useMemo } from \"react\";\n\nimport {\n\tflattenODataDependentServices,\n\tODataCollectionModel,\n\tODataDependentBaseProps,\n\tODataDependentSegmentItem,\n\tuseODataCollection,\n\tuseODataCollectionChains,\n\tuseODataCollectionModel\n} from \"@ryuzaki13/react-foundation-api/odata\";\n\nimport { buildODataTreeNodes } from \"./buildODataTreeNodes\";\nimport { resolveOrderedTreeSegmentItems } from \"./resolveOrderedTreeSegmentItems\";\n\nfunction buildOrderedSegmentItems(\n\todata: ODataDependentBaseProps[\"odata\"],\n\tsegments: ODataDependentBaseProps[\"segments\"],\n\tmodel?: Omit<ODataCollectionModel, \"codeKey\">\n) {\n\treturn flattenODataDependentServices([\n\t\t{\n\t\t\todata,\n\t\t\tsegments,\n\t\t\tmodel\n\t\t}\n\t]);\n}\n\nfunction getRootCodeKey(orderedSegmentItems: readonly ODataDependentSegmentItem[]) {\n\treturn orderedSegmentItems[0]?.id;\n}\n\nexport function useODataTreeData({ odata, segments, model }: Pick<ODataDependentBaseProps, \"odata\" | \"segments\" | \"model\">) {\n\tconst serviceKey = `${odata.service}.${odata.target}`;\n\tconst baseSegmentItems = useMemo(() => buildOrderedSegmentItems(odata, segments, model), [odata, segments, model]);\n\tconst chains = useODataCollectionChains([odata]);\n\tconst orderedSegmentItems = useMemo(() => resolveOrderedTreeSegmentItems(baseSegmentItems, chains), [baseSegmentItems, chains]);\n\tconst orderedCodeKeys = useMemo(() => orderedSegmentItems.map((item) => item.id), [orderedSegmentItems]);\n\tconst rootCodeKey = getRootCodeKey(orderedSegmentItems) ?? Object.keys(segments)[0];\n\tconst odataModel = useODataCollectionModel({\n\t\tcodeKey: rootCodeKey,\n\t\t...model\n\t});\n\tconst collection = useODataCollection({\n\t\todata,\n\t\tmodel: odataModel\n\t});\n\tconst { hiddenCodeKeys, textValueCodeKeys } = useMemo(() => {\n\t\tconst nextHiddenCodeKeys = new Set<string>();\n\t\tconst nextTextValueCodeKeys = new Set<string>();\n\n\t\tfor (const item of orderedSegmentItems) {\n\t\t\tif (item.segment.hideCode ?? odata.hideCode) {\n\t\t\t\tnextHiddenCodeKeys.add(item.id);\n\t\t\t}\n\t\t\tif (item.segment.selectText) {\n\t\t\t\tnextTextValueCodeKeys.add(item.id);\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\thiddenCodeKeys: nextHiddenCodeKeys,\n\t\t\ttextValueCodeKeys: nextTextValueCodeKeys\n\t\t};\n\t}, [odata.hideCode, orderedSegmentItems]);\n\tconst nodes = useMemo(\n\t\t() =>\n\t\t\tbuildODataTreeNodes({\n\t\t\t\titems: collection.data?.items ?? [],\n\t\t\t\torderedCodeKeys,\n\t\t\t\tkeyPairsMap: collection.data?.keyPairsMap ?? {},\n\t\t\t\thiddenCodeKeys,\n\t\t\t\ttextValueCodeKeys\n\t\t\t}),\n\t\t[collection.data?.items, collection.data?.keyPairsMap, hiddenCodeKeys, orderedCodeKeys, textValueCodeKeys]\n\t);\n\tconst placeholder = orderedSegmentItems[0]?.segment.placeholder ?? \"Выберите значение\";\n\tconst hasResolvedChain = Boolean(chains[serviceKey]?.length);\n\n\treturn {\n\t\tnodes,\n\t\torderedSegmentItems,\n\t\torderedCodeKeys,\n\t\tisLoading: collection.isLoading,\n\t\tisError: collection.isError,\n\t\tplaceholder,\n\t\thasResolvedChain\n\t};\n}\n","import { TreeMultiSelectValue, TreeSelectNode, TreeSelectValue } from \"../types\";\n\nexport type TreeNodeIndex = {\n\trootIds: string[];\n\tnodeById: Map<string, TreeSelectNode>;\n\tparentById: Map<string, string | undefined>;\n\tchildrenById: Map<string, string[]>;\n\tpreorderIndexById: Map<string, number>;\n\tnodeIdByCodeValue: Map<string, string>;\n};\n\nexport type TreeNodeSelectionState = {\n\tselectedIds: Set<string>;\n\tpartialIds: Set<string>;\n};\n\nexport type TreeVisibleEntry = {\n\tnode: TreeSelectNode;\n\tlevel: number;\n\tparentId?: string;\n\thasChildren: boolean;\n\tisExpanded: boolean;\n\tisLeaf: boolean;\n};\n\nfunction makeCodeValueKey(codeKey: string, value: string) {\n\treturn `${codeKey}::${value}`;\n}\n\nexport function createTreeNodeIndex(nodes: readonly TreeSelectNode[]): TreeNodeIndex {\n\tconst nodeById = new Map<string, TreeSelectNode>();\n\tconst parentById = new Map<string, string | undefined>();\n\tconst childrenById = new Map<string, string[]>();\n\tconst preorderIndexById = new Map<string, number>();\n\tconst nodeIdByCodeValue = new Map<string, string>();\n\tlet preorderIndex = 0;\n\n\tconst walk = (node: TreeSelectNode, parentId?: string) => {\n\t\tnodeById.set(node.id, node);\n\t\tparentById.set(node.id, parentId);\n\t\tpreorderIndexById.set(node.id, preorderIndex++);\n\t\tnodeIdByCodeValue.set(makeCodeValueKey(node.codeKey, node.value), node.id);\n\n\t\tconst childIds = (node.children ?? []).map((child) => child.id);\n\t\tchildrenById.set(node.id, childIds);\n\n\t\tfor (const child of node.children ?? []) {\n\t\t\twalk(child, node.id);\n\t\t}\n\t};\n\n\tfor (const node of nodes) {\n\t\twalk(node);\n\t}\n\n\treturn {\n\t\trootIds: nodes.map((node) => node.id),\n\t\tnodeById,\n\t\tparentById,\n\t\tchildrenById,\n\t\tpreorderIndexById,\n\t\tnodeIdByCodeValue\n\t};\n}\n\nexport function treeSelectValueToId(value: TreeSelectValue | undefined, index: TreeNodeIndex) {\n\tif (!value) return undefined;\n\treturn index.nodeIdByCodeValue.get(makeCodeValueKey(value.codeKey, value.value));\n}\n\nexport function treeMultiValueToSelectedIds(value: TreeMultiSelectValue | undefined, index: TreeNodeIndex) {\n\tconst selectedIds = new Set<string>();\n\n\tif (!value) {\n\t\treturn selectedIds;\n\t}\n\n\tfor (const [codeKey, values] of Object.entries(value)) {\n\t\tfor (const itemValue of values) {\n\t\t\tconst nodeId = index.nodeIdByCodeValue.get(makeCodeValueKey(codeKey, itemValue));\n\t\t\tif (nodeId) {\n\t\t\t\tselectedIds.add(nodeId);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn canonicalizeTreeSelection(selectedIds, index);\n}\n\nexport function treeSelectedIdsToMultiValue(selectedIds: Set<string>, index: TreeNodeIndex): TreeMultiSelectValue {\n\tconst orderedIds = [...selectedIds].sort(\n\t\t(leftId, rightId) =>\n\t\t\t(index.preorderIndexById.get(leftId) ?? Number.MAX_SAFE_INTEGER) -\n\t\t\t(index.preorderIndexById.get(rightId) ?? Number.MAX_SAFE_INTEGER)\n\t);\n\tconst result: TreeMultiSelectValue = {};\n\n\tfor (const nodeId of orderedIds) {\n\t\tconst node = index.nodeById.get(nodeId);\n\t\tif (!node) continue;\n\n\t\tresult[node.codeKey] = result[node.codeKey] ?? [];\n\t\tresult[node.codeKey].push(node.value);\n\t}\n\n\treturn result;\n}\n\nexport function treeSelectValueToMultiValue(value: TreeSelectValue | undefined): TreeMultiSelectValue {\n\tif (!value) {\n\t\treturn {};\n\t}\n\n\treturn {\n\t\t[value.codeKey]: [value.value]\n\t};\n}\n\nfunction getAncestorIds(nodeId: string, index: TreeNodeIndex) {\n\tconst ancestors: string[] = [];\n\tlet currentId = index.parentById.get(nodeId);\n\n\twhile (currentId) {\n\t\tancestors.push(currentId);\n\t\tcurrentId = index.parentById.get(currentId);\n\t}\n\n\treturn ancestors;\n}\n\nfunction isDescendantOf(nodeId: string, ancestorId: string, index: TreeNodeIndex) {\n\tlet currentId = index.parentById.get(nodeId);\n\n\twhile (currentId) {\n\t\tif (currentId === ancestorId) {\n\t\t\treturn true;\n\t\t}\n\n\t\tcurrentId = index.parentById.get(currentId);\n\t}\n\n\treturn false;\n}\n\nfunction removeDescendantSelections(selectedIds: Set<string>, nodeId: string, index: TreeNodeIndex) {\n\tfor (const selectedId of [...selectedIds]) {\n\t\tif (isDescendantOf(selectedId, nodeId, index)) {\n\t\t\tselectedIds.delete(selectedId);\n\t\t}\n\t}\n}\n\nfunction isNodeFullySelected(nodeId: string, selectedIds: Set<string>, index: TreeNodeIndex): boolean {\n\tif (selectedIds.has(nodeId)) {\n\t\treturn true;\n\t}\n\n\tconst children = index.childrenById.get(nodeId) ?? [];\n\tif (children.length === 0) {\n\t\treturn false;\n\t}\n\n\treturn children.every((childId) => isNodeFullySelected(childId, selectedIds, index));\n}\n\nexport function canonicalizeTreeSelection(selectedIds: Set<string>, index: TreeNodeIndex) {\n\tconst nextSelectedIds = new Set(selectedIds);\n\n\tfor (const selectedId of [...nextSelectedIds]) {\n\t\tif (getAncestorIds(selectedId, index).some((ancestorId) => nextSelectedIds.has(ancestorId))) {\n\t\t\tnextSelectedIds.delete(selectedId);\n\t\t}\n\t}\n\n\tconst orderedNodeIds = [...index.nodeById.keys()].sort(\n\t\t(leftId, rightId) => (index.preorderIndexById.get(rightId) ?? 0) - (index.preorderIndexById.get(leftId) ?? 0)\n\t);\n\n\tfor (const nodeId of orderedNodeIds) {\n\t\tconst children = index.childrenById.get(nodeId) ?? [];\n\n\t\tif (children.length === 0 || nextSelectedIds.has(nodeId)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (children.every((childId) => isNodeFullySelected(childId, nextSelectedIds, index))) {\n\t\t\tremoveDescendantSelections(nextSelectedIds, nodeId, index);\n\t\t\tnextSelectedIds.add(nodeId);\n\t\t}\n\t}\n\n\treturn nextSelectedIds;\n}\n\nfunction expandNearestSelectedAncestor(selectedIds: Set<string>, nodeId: string, index: TreeNodeIndex) {\n\tlet currentId = index.parentById.get(nodeId);\n\n\twhile (currentId) {\n\t\tif (selectedIds.has(currentId)) {\n\t\t\tselectedIds.delete(currentId);\n\n\t\t\tfor (const childId of index.childrenById.get(currentId) ?? []) {\n\t\t\t\tselectedIds.add(childId);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tcurrentId = index.parentById.get(currentId);\n\t}\n\n\treturn false;\n}\n\nexport function isTreeNodeSelected(nodeId: string, selectedIds: Set<string>, index: TreeNodeIndex): boolean {\n\tif (selectedIds.has(nodeId)) {\n\t\treturn true;\n\t}\n\n\treturn getAncestorIds(nodeId, index).some((ancestorId) => selectedIds.has(ancestorId));\n}\n\nfunction resolveTreeSelectionState(nodeId: string, selectedIds: Set<string>, index: TreeNodeIndex, state: TreeNodeSelectionState) {\n\tconst children = index.childrenById.get(nodeId) ?? [];\n\n\tif (selectedIds.has(nodeId)) {\n\t\tstate.selectedIds.add(nodeId);\n\t\treturn { selected: true, partial: false };\n\t}\n\n\tif (children.length === 0) {\n\t\treturn { selected: false, partial: false };\n\t}\n\n\tconst childStates = children.map((childId) => resolveTreeSelectionState(childId, selectedIds, index, state));\n\tconst allSelected = childStates.every((childState) => childState.selected && !childState.partial);\n\tconst hasAnySelected = childStates.some((childState) => childState.selected || childState.partial);\n\n\tif (allSelected) {\n\t\tstate.selectedIds.add(nodeId);\n\t\treturn { selected: true, partial: false };\n\t}\n\n\tif (hasAnySelected) {\n\t\tstate.partialIds.add(nodeId);\n\t\treturn { selected: false, partial: true };\n\t}\n\n\treturn { selected: false, partial: false };\n}\n\nexport function getTreeNodeSelectionState(selectedIds: Set<string>, index: TreeNodeIndex): TreeNodeSelectionState {\n\tconst state: TreeNodeSelectionState = {\n\t\tselectedIds: new Set(),\n\t\tpartialIds: new Set()\n\t};\n\n\tfor (const rootId of index.rootIds) {\n\t\tresolveTreeSelectionState(rootId, selectedIds, index, state);\n\t}\n\n\treturn state;\n}\n\nexport function toggleTreeMultiSelection(currentValue: TreeMultiSelectValue | undefined, targetNodeId: string, index: TreeNodeIndex) {\n\tconst selectedIds = treeMultiValueToSelectedIds(currentValue, index);\n\n\tconst toggle = (targetId: string) => {\n\t\tif (isTreeNodeSelected(targetId, selectedIds, index)) {\n\t\t\tif (selectedIds.has(targetId)) {\n\t\t\t\tselectedIds.delete(targetId);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (expandNearestSelectedAncestor(selectedIds, targetId, index)) {\n\t\t\t\ttoggle(targetId);\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tremoveDescendantSelections(selectedIds, targetId, index);\n\t\tselectedIds.add(targetId);\n\t};\n\n\ttoggle(targetNodeId);\n\n\treturn treeSelectedIdsToMultiValue(canonicalizeTreeSelection(selectedIds, index), index);\n}\n\nfunction collectExpandedIds(nodeId: string, index: TreeNodeIndex, expandedIds: Set<string>) {\n\tlet currentId = index.parentById.get(nodeId);\n\n\twhile (currentId) {\n\t\texpandedIds.add(currentId);\n\t\tcurrentId = index.parentById.get(currentId);\n\t}\n}\n\nexport function getSelectionExpandedIds(selectedIds: Set<string>, index: TreeNodeIndex) {\n\tconst expandedIds = new Set<string>();\n\n\tfor (const selectedId of selectedIds) {\n\t\tcollectExpandedIds(selectedId, index, expandedIds);\n\t}\n\n\treturn expandedIds;\n}\n\nfunction filterTreeNode(node: TreeSelectNode, normalizedQuery: string, expandedIds: Set<string>): TreeSelectNode | null {\n\tconst filteredChildren = (node.children ?? [])\n\t\t.map((childNode) => filterTreeNode(childNode, normalizedQuery, expandedIds))\n\t\t.filter((childNode): childNode is TreeSelectNode => Boolean(childNode));\n\tconst isMatched = node.searchText.toLowerCase().includes(normalizedQuery);\n\n\tif (!isMatched && filteredChildren.length === 0) {\n\t\treturn null;\n\t}\n\n\tif (filteredChildren.length > 0) {\n\t\texpandedIds.add(node.id);\n\t}\n\n\tif (filteredChildren.length === 0) {\n\t\treturn node;\n\t}\n\n\treturn {\n\t\t...node,\n\t\tchildren: filteredChildren\n\t};\n}\n\nexport function filterTreeNodes(nodes: readonly TreeSelectNode[], query: string) {\n\tconst normalizedQuery = query.trim().toLowerCase();\n\n\tif (!normalizedQuery) {\n\t\treturn {\n\t\t\tnodes: [...nodes],\n\t\t\texpandedIds: new Set<string>()\n\t\t};\n\t}\n\n\tconst expandedIds = new Set<string>();\n\tconst filteredNodes = nodes\n\t\t.map((node) => filterTreeNode(node, normalizedQuery, expandedIds))\n\t\t.filter((node): node is TreeSelectNode => Boolean(node));\n\n\treturn {\n\t\tnodes: filteredNodes,\n\t\texpandedIds\n\t};\n}\n\nexport function flattenVisibleTreeNodes(nodes: readonly TreeSelectNode[], expandedIds: Set<string>): TreeVisibleEntry[] {\n\tconst entries: TreeVisibleEntry[] = [];\n\n\tconst walk = (node: TreeSelectNode, level: number, parentId?: string) => {\n\t\tconst hasChildren = (node.children?.length ?? 0) > 0;\n\t\tconst isExpanded = hasChildren && expandedIds.has(node.id);\n\n\t\tentries.push({\n\t\t\tnode,\n\t\t\tlevel,\n\t\t\tparentId,\n\t\t\thasChildren,\n\t\t\tisExpanded,\n\t\t\tisLeaf: !hasChildren\n\t\t});\n\n\t\tif (!isExpanded) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (const childNode of node.children ?? []) {\n\t\t\twalk(childNode, level + 1, node.id);\n\t\t}\n\t};\n\n\tfor (const node of nodes) {\n\t\twalk(node, 0);\n\t}\n\n\treturn entries;\n}\n","@use \"@/styles/mixins\" as *;\n\n// .uiOptionRow\n.treeRow {\n\tdisplay: flex;\n\talign-items: stretch;\n\tborder-radius: var(--radius-sm);\n\tcursor: pointer;\n\n\t&:focus {\n\t\t@include focusVisible;\n\n\t\tbackground-color: var(--surface-accent);\n\t\tborder-color: var(--border-1);\n\t\tcursor: pointer;\n\t}\n\n\t&:hover {\n\t\tbackground-color: var(--surface-accent);\n\t\tcursor: pointer;\n\t}\n}\n\n// .uiOptionRowSelected\n.treeRowSelected {\n\tbackground-color: var(--surface-2);\n\tcolor: var(--content-accent);\n\tcursor: default;\n}\n\n// .uiOptionRowActive\n.treeRowActive {\n\tbackground-color: var(--surface-1);\n}\n\n.treeNodeButton {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: var(--space-xs);\n\twidth: 100%;\n\tpadding: var(--space-xs) var(--space-xs) var(--space-xs) 0;\n\tbackground: transparent;\n\ttext-align: left;\n\tborder-radius: var(--radius-sm);\n}\n\n.treeIndent {\n\tflex-shrink: 0;\n\twidth: calc(var(--tree-level) * 1em);\n}\n\n.treeExpander,\n.treeExpanderPlaceholder {\n\tflex-shrink: 0;\n\twidth: 1.5em;\n\theight: 1.5em;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n.treeExpander {\n\tbackground: transparent;\n\tborder: none;\n\tborder-radius: var(--radius-sm);\n\tcolor: var(--content-2);\n\n\t&:hover {\n\t\tcolor: var(--content-0);\n\t\tbackground-color: var(--surface-0);\n\t}\n}\n\n.treeExpanderIcon {\n\ttransition: transform var(--transition-fast) ease;\n}\n\n.treeExpanderIconExpanded {\n\ttransform: rotate(90deg);\n}\n\n.treeSelection {\n\tflex-shrink: 0;\n\twidth: 1em;\n\theight: 1em;\n\tborder: var(--border);\n\tborder-radius: var(--radius-xs);\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\tbackground-color: var(--surface-0);\n\tcolor: transparent;\n}\n\n.treeSelectionChecked {\n\tbackground-color: var(--status-info-text);\n\tborder-color: var(--status-info-text);\n\tcolor: var(--white);\n\n\t// outline: 1px dashed rgb(255, 100, 141);\n\t// outline-offset: -1px;\n}\n\n.treeSelectionPartial {\n\tbackground-color: var(--surface-1);\n\tborder-color: var(--status-info-text);\n\tcolor: var(--status-info-text);\n}\n\n.treeSelectionIcon {\n\twidth: 0.75rem;\n\theight: 0.75rem;\n}\n\n.treeSummary {\n\tpadding-right: calc(var(--control-height) * 2);\n}\n\n.inputWithOverlay {\n\tcolor: transparent;\n\tcaret-color: transparent;\n}\n\n.valueOverlay {\n\tposition: absolute;\n\tinset: 0 calc(var(--control-height) * 2) 0 var(--space-md);\n\tdisplay: flex;\n\talign-items: center;\n\tpointer-events: none;\n\toverflow: hidden;\n}\n\n.treeActions {\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n\theight: 100%;\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.treeClearButton {\n\tcolor: var(--status-error-text);\n}\n","import { CSSProperties } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { CheckIcon, ChevronRightIcon, MinusIcon } from \"lucide-react\";\n\nimport { SelectOptionContent } from \"../select/SelectOptionContent\";\n\nimport styles from \"./TreeSelect.module.scss\";\nimport { TreeSelectNode } from \"./types\";\n\ntype TreeNodeContentProps = {\n\tnode: TreeSelectNode;\n\tlevel: number;\n\thighlight?: string;\n\thasChildren: boolean;\n\tisExpanded: boolean;\n\tselected: boolean;\n\tpartial: boolean;\n\tselectionMode: \"single\" | \"multi\";\n\tonToggleExpand?: () => void;\n};\n\nexport function TreeNodeContent({\n\tnode,\n\tlevel,\n\thighlight,\n\thasChildren,\n\tisExpanded,\n\tselected,\n\tpartial,\n\tselectionMode,\n\tonToggleExpand\n}: TreeNodeContentProps) {\n\treturn (\n\t\t<>\n\t\t\t<span className={styles.treeIndent} style={{ \"--tree-level\": level } as CSSProperties} aria-hidden=\"true\" />\n\t\t\t{hasChildren ? (\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclassName={styles.treeExpander}\n\t\t\t\t\tonClick={(event) => {\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tonToggleExpand?.();\n\t\t\t\t\t}}\n\t\t\t\t\taria-label={isExpanded ? \"Свернуть ветку\" : \"Развернуть ветку\"}\n\t\t\t\t\tdata-ui=\"tree-select-expander\"\n\t\t\t\t\tdata-action={isExpanded ? \"collapse-tree-select-node\" : \"expand-tree-select-node\"}>\n\t\t\t\t\t<ChevronRightIcon className={cn(styles.treeExpanderIcon, isExpanded && styles.treeExpanderIconExpanded)} />\n\t\t\t\t</button>\n\t\t\t) : (\n\t\t\t\t<span className={styles.treeExpanderPlaceholder} aria-hidden=\"true\" />\n\t\t\t)}\n\n\t\t\t{selectionMode === \"multi\" && (\n\t\t\t\t<span\n\t\t\t\t\tclassName={cn(styles.treeSelection, selected && styles.treeSelectionChecked, partial && styles.treeSelectionPartial)}\n\t\t\t\t\taria-hidden=\"true\">\n\t\t\t\t\t{selected ? (\n\t\t\t\t\t\t<CheckIcon className={styles.treeSelectionIcon} />\n\t\t\t\t\t) : partial ? (\n\t\t\t\t\t\t<MinusIcon className={styles.treeSelectionIcon} />\n\t\t\t\t\t) : null}\n\t\t\t\t</span>\n\t\t\t)}\n\n\t\t\t<SelectOptionContent label={node.label} code={node.code} highlight={highlight} />\n\t\t</>\n\t);\n}\n","import { ReactNode, useEffect, useMemo, useRef, useState } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { XIcon } from \"lucide-react\";\n\nimport { InputText } from \"../input\";\nimport {\n\tPickerField,\n\tPickerPopup,\n\tPickerStatus,\n\tPickerTriggerActions,\n\tPickerTriggerInput,\n\tusePickerFloatingListbox,\n\tusePickerQuery,\n\tusePickerTriggerController\n} from \"../picker\";\nimport { UiBaseProps } from \"../types\";\nimport uiStyles from \"../ui.module.scss\";\n\nimport {\n\tcreateTreeNodeIndex,\n\tfilterTreeNodes,\n\tflattenVisibleTreeNodes,\n\tgetSelectionExpandedIds,\n\tTreeVisibleEntry\n} from \"./model/treeUtils\";\nimport { TreeNodeContent } from \"./TreeNodeContent\";\nimport styles from \"./TreeSelect.module.scss\";\nimport { TreeSelectNode } from \"./types\";\n\ntype TreePickerBaseProps = Omit<UiBaseProps<never>, \"value\" | \"onChange\"> & {\n\tnodes: readonly TreeSelectNode[];\n\tselectedIds: Set<string>;\n\tpartialIds: Set<string>;\n\tselectionMode: \"single\" | \"multi\";\n\ttriggerMode?: \"display\" | \"search\";\n\tselectedSummary?: ReactNode;\n\tselectedSummaryText?: string;\n\tquery?: string;\n\tdefaultQuery?: string;\n\tonQuery?: (value: string) => void;\n\tonNodeActivate: (node: TreeSelectNode) => void;\n\tonClearSelection?: () => void;\n\tisLoading?: boolean;\n\terror?: string;\n};\n\nexport function TreePickerBase({\n\tlabel,\n\tdescription,\n\tdisabled,\n\tplaceholder,\n\tsize,\n\tnodes,\n\tselectedIds,\n\tpartialIds,\n\tselectionMode,\n\ttriggerMode = \"display\",\n\tselectedSummary,\n\tselectedSummaryText,\n\tquery,\n\tdefaultQuery,\n\tonQuery,\n\tonNodeActivate,\n\tonClearSelection,\n\tisLoading,\n\terror\n}: TreePickerBaseProps) {\n\tconst inputRef = useRef<HTMLInputElement | null>(null);\n\tconst previousOpenRef = useRef(false);\n\tconst [expandedIds, setExpandedIds] = useState<Set<string>>(() => new Set());\n\tconst resolvedTriggerMode = triggerMode === \"search\" ? \"search-single\" : \"display\";\n\tconst treeIndex = useMemo(() => createTreeNodeIndex(nodes), [nodes]);\n\tconst { query: currentQuery, setQuery } = usePickerQuery({\n\t\topen: true,\n\t\tquery,\n\t\tdefaultQuery,\n\t\tonQuery,\n\t\ttriggerMode: \"display\"\n\t});\n\tconst { nodes: filteredNodes, expandedIds: searchExpandedIds } = useMemo(\n\t\t() => filterTreeNodes(nodes, currentQuery),\n\t\t[nodes, currentQuery]\n\t);\n\tconst selectedExpandedIds = useMemo(() => getSelectionExpandedIds(selectedIds, treeIndex), [selectedIds, treeIndex]);\n\tconst resolvedExpandedIds = useMemo(\n\t\t() => new Set([...expandedIds, ...searchExpandedIds, ...selectedExpandedIds]),\n\t\t[expandedIds, searchExpandedIds, selectedExpandedIds]\n\t);\n\tconst visibleEntries = useMemo(() => flattenVisibleTreeNodes(filteredNodes, resolvedExpandedIds), [filteredNodes, resolvedExpandedIds]);\n\tconst selectedIndex = useMemo(() => visibleEntries.findIndex((entry) => selectedIds.has(entry.node.id)), [selectedIds, visibleEntries]);\n\tconst {\n\t\topen,\n\t\tactiveIndex,\n\t\tcontext,\n\t\tfloatingStyles,\n\t\tgetFloatingProps,\n\t\tsetReference,\n\t\tsetFloating,\n\t\tsetOptionRef,\n\t\tclose,\n\t\topenList,\n\t\ttoggleOpen,\n\t\tselectOption,\n\t\thandleReferenceKeyDown,\n\t\thandleFloatingKeyDown,\n\t\tgetOptionId,\n\t\tgetActiveOptionId\n\t} = usePickerFloatingListbox({\n\t\toptions: visibleEntries,\n\t\tselectedIndex,\n\t\tonSelect: (entry) => onNodeActivate(entry.node),\n\t\tdisabled: disabled || isLoading,\n\t\tcloseOnSelect: selectionMode === \"single\",\n\t\tallowOpenWithoutOptions: true,\n\t\ttriggerMode: resolvedTriggerMode\n\t});\n\tconst hasSelection = selectedIds.size > 0;\n\tconst showTriggerQuery = triggerMode === \"search\" && (open || currentQuery.length > 0);\n\tconst triggerValue = showTriggerQuery ? currentQuery : (selectedSummaryText ?? \"\");\n\tconst showSummaryOverlay = triggerMode === \"display\" && Boolean(selectedSummary);\n\tconst triggerController = usePickerTriggerController({\n\t\tmode: resolvedTriggerMode,\n\t\topen,\n\t\tcurrentQuery,\n\t\thasDisplayValue: Boolean(selectedSummaryText),\n\t\tinputRef,\n\t\tsetQuery,\n\t\topenList,\n\t\tclose,\n\t\ttoggleOpen\n\t});\n\n\tuseEffect(() => {\n\t\tif (previousOpenRef.current && !open && triggerController.policy.resetQueryOnClose) {\n\t\t\tsetQuery(\"\");\n\t\t}\n\n\t\tpreviousOpenRef.current = open;\n\t}, [open, setQuery, triggerController.policy.resetQueryOnClose]);\n\n\tconst setInputNode = (node: HTMLInputElement | null) => {\n\t\tinputRef.current = node;\n\t};\n\tconst handleClearSelection = () => {\n\t\tonClearSelection?.();\n\t\tsetQuery(\"\");\n\t\tclose();\n\t};\n\n\tconst toggleExpand = (entry: TreeVisibleEntry) => {\n\t\tif (!entry.hasChildren) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetExpandedIds((currentExpandedIds) => {\n\t\t\tconst nextExpandedIds = new Set(currentExpandedIds);\n\n\t\t\tif (nextExpandedIds.has(entry.node.id)) {\n\t\t\t\tnextExpandedIds.delete(entry.node.id);\n\t\t\t} else {\n\t\t\t\tnextExpandedIds.add(entry.node.id);\n\t\t\t}\n\n\t\t\treturn nextExpandedIds;\n\t\t});\n\t};\n\n\treturn (\n\t\t<PickerField label={label} description={description} disabled={disabled} placeholder={placeholder} size={size}>\n\t\t\t{({ controlId, labelId, describedBy }) => {\n\t\t\t\tconst listId = `${controlId}-listbox`;\n\n\t\t\t\treturn (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PickerTriggerInput\n\t\t\t\t\t\t\tref={setInputNode}\n\t\t\t\t\t\t\trootRef={setReference}\n\t\t\t\t\t\t\tid={controlId}\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\tdisabled={disabled || isLoading}\n\t\t\t\t\t\t\treadOnly={triggerMode !== \"search\"}\n\t\t\t\t\t\t\tvalue={triggerMode === \"display\" && showSummaryOverlay ? \"\" : triggerValue}\n\t\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\t\ttriggerMode === \"search\"\n\t\t\t\t\t\t\t\t\t? !selectedSummaryText || showTriggerQuery\n\t\t\t\t\t\t\t\t\t\t? placeholder\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t: hasSelection\n\t\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t\t: placeholder\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taria-labelledby={labelId}\n\t\t\t\t\t\t\taria-describedby={describedBy}\n\t\t\t\t\t\t\taria-haspopup=\"listbox\"\n\t\t\t\t\t\t\taria-expanded={open}\n\t\t\t\t\t\t\taria-controls={open ? listId : undefined}\n\t\t\t\t\t\t\taria-autocomplete={triggerMode === \"search\" ? \"list\" : \"none\"}\n\t\t\t\t\t\t\taria-activedescendant={open && visibleEntries.length > 0 ? getActiveOptionId(listId) : undefined}\n\t\t\t\t\t\t\tinputClassName={cn(hasSelection && styles.treeSummary, showSummaryOverlay && styles.inputWithOverlay)}\n\t\t\t\t\t\t\toverlay={showSummaryOverlay ? <div className={styles.valueOverlay}>{selectedSummary}</div> : undefined}\n\t\t\t\t\t\t\tendAdornment={\n\t\t\t\t\t\t\t\t<PickerTriggerActions\n\t\t\t\t\t\t\t\t\topen={open}\n\t\t\t\t\t\t\t\t\tdisabled={disabled || isLoading}\n\t\t\t\t\t\t\t\t\tonToggleMouseDown={triggerController.handleToggleMouseDown}\n\t\t\t\t\t\t\t\t\tonToggleClick={triggerController.handleToggleClick}>\n\t\t\t\t\t\t\t\t\t{hasSelection && onClearSelection ? (\n\t\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\tclassName={styles.treeClearButton}\n\t\t\t\t\t\t\t\t\t\t\tonMouseDown={(event) => {\n\t\t\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\tonClick={(event) => {\n\t\t\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\t\t\thandleClearSelection();\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\taria-label=\"Очистить выбор\">\n\t\t\t\t\t\t\t\t\t\t\t<XIcon />\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t</PickerTriggerActions>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonChange={(event) => {\n\t\t\t\t\t\t\t\tif (triggerMode !== \"search\") {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\ttriggerController.handleTriggerInputChange(event.target.value);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tonClick={triggerController.handleTriggerClick}\n\t\t\t\t\t\t\tonFocus={(event) => {\n\t\t\t\t\t\t\t\ttriggerController.handleTriggerFocus(event.currentTarget);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tonKeyDown={(event) => {\n\t\t\t\t\t\t\t\thandleReferenceKeyDown(event);\n\n\t\t\t\t\t\t\t\tif (event.defaultPrevented) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\ttriggerController.handleTriggerKeyDown({\n\t\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\t\tonActivateWhenOpen: () => {\n\t\t\t\t\t\t\t\t\t\tconst activeEntry = activeIndex >= 0 ? visibleEntries[activeIndex] : undefined;\n\t\t\t\t\t\t\t\t\t\tif (activeEntry) {\n\t\t\t\t\t\t\t\t\t\t\tselectOption(activeEntry);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tenableSpaceActivation: triggerMode === \"display\"\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t<PickerPopup\n\t\t\t\t\t\t\topen={open}\n\t\t\t\t\t\t\tcontext={context}\n\t\t\t\t\t\t\tfloatingStyles={floatingStyles}\n\t\t\t\t\t\t\tlistId={listId}\n\t\t\t\t\t\t\tlabelId={labelId}\n\t\t\t\t\t\t\tdescriptionId={describedBy}\n\t\t\t\t\t\t\tactiveOptionId={visibleEntries.length > 0 ? getActiveOptionId(listId) : undefined}\n\t\t\t\t\t\t\tsetFloating={setFloating}\n\t\t\t\t\t\t\tgetFloatingProps={getFloatingProps}\n\t\t\t\t\t\t\tonKeyDown={handleFloatingKeyDown}\n\t\t\t\t\t\t\tclassName={cn(uiStyles.uiPopupOptions, \"scrollable\")}\n\t\t\t\t\t\t\theader={\n\t\t\t\t\t\t\t\ttriggerMode === \"display\" ? (\n\t\t\t\t\t\t\t\t\t<InputText\n\t\t\t\t\t\t\t\t\t\tvalue={currentQuery}\n\t\t\t\t\t\t\t\t\t\tonChange={setQuery}\n\t\t\t\t\t\t\t\t\t\tonClear={() => setQuery(\"\")}\n\t\t\t\t\t\t\t\t\t\tplaceholder=\"Поиск по дереву\"\n\t\t\t\t\t\t\t\t\t\tonKeyDown={(event) => {\n\t\t\t\t\t\t\t\t\t\t\tif (event.key !== \"Escape\" && event.key !== \"Tab\") {\n\t\t\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\tonClick={(event) => {\n\t\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) : undefined\n\t\t\t\t\t\t\t}>\n\t\t\t\t\t\t\t<div className=\"\">\n\t\t\t\t\t\t\t\t{visibleEntries.length === 0 ? (\n\t\t\t\t\t\t\t\t\t<PickerStatus\n\t\t\t\t\t\t\t\t\t\terrorState={error}\n\t\t\t\t\t\t\t\t\t\tloadingState={isLoading ? \"Загрузка...\" : undefined}\n\t\t\t\t\t\t\t\t\t\temptyState={!error && !isLoading ? \"Нет данных\" : undefined}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\tvisibleEntries.map((entry, index) => {\n\t\t\t\t\t\t\t\t\t\tconst selected = selectedIds.has(entry.node.id);\n\t\t\t\t\t\t\t\t\t\tconst partial = !selected && partialIds.has(entry.node.id);\n\t\t\t\t\t\t\t\t\t\tconst active = index === activeIndex;\n\n\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\tkey={entry.node.id}\n\t\t\t\t\t\t\t\t\t\t\t\tid={getOptionId(listId, index)}\n\t\t\t\t\t\t\t\t\t\t\t\tref={(node) => setOptionRef(index, node)}\n\t\t\t\t\t\t\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\t\t\t\t\t\t\taria-selected={selected}\n\t\t\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyles.treeRow,\n\t\t\t\t\t\t\t\t\t\t\t\t\tactive && styles.treeRowActive,\n\t\t\t\t\t\t\t\t\t\t\t\t\tselected && styles.treeRowSelected\n\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\tonMouseDown={(event) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={() => selectOption(entry)}>\n\t\t\t\t\t\t\t\t\t\t\t\t<div className={styles.treeNodeButton}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<TreeNodeContent\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tnode={entry.node}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlevel={entry.level}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\thighlight={currentQuery}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\thasChildren={entry.hasChildren}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tisExpanded={entry.isExpanded}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tselected={selected}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpartial={partial}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tselectionMode={selectionMode}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonToggleExpand={() => toggleExpand(entry)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</PickerPopup>\n\t\t\t\t\t</>\n\t\t\t\t);\n\t\t\t}}\n\t\t</PickerField>\n\t);\n}\n","import { useMemo } from \"react\";\n\nimport { UiBaseProps } from \"../types\";\n\nimport { createTreeNodeIndex, getTreeNodeSelectionState, toggleTreeMultiSelection, treeMultiValueToSelectedIds } from \"./model/treeUtils\";\nimport { TreePickerBase } from \"./TreePickerBase\";\nimport { TreeMultiSelectValue, TreeSelectNode } from \"./types\";\n\nexport interface TreeMultiSelectProps extends Omit<UiBaseProps<TreeMultiSelectValue>, \"placeholder\"> {\n\tnodes: readonly TreeSelectNode[];\n\tplaceholder?: string;\n\tquery?: string;\n\tdefaultQuery?: string;\n\tonQuery?: (value: string) => void;\n\tisLoading?: boolean;\n\terror?: string;\n}\n\nfunction formatTreeMultiSummary(selectedIds: Set<string>, treeIndex: ReturnType<typeof createTreeNodeIndex>) {\n\tif (selectedIds.size === 0) {\n\t\treturn undefined;\n\t}\n\n\tif (selectedIds.size === 1) {\n\t\tconst selectedNode = treeIndex.nodeById.get([...selectedIds][0]);\n\n\t\tif (!selectedNode) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (selectedNode.code && selectedNode.code !== selectedNode.label) {\n\t\t\treturn `${selectedNode.label} · ${selectedNode.code}`;\n\t\t}\n\n\t\treturn selectedNode.label;\n\t}\n\n\treturn `Выбрано ${selectedIds.size} узл.`;\n}\n\nexport function TreeMultiSelect({\n\tlabel,\n\tdescription,\n\tdisabled,\n\tplaceholder = \"Выберите значения\",\n\tsize,\n\tnodes,\n\tvalue,\n\tonChange,\n\tquery,\n\tdefaultQuery,\n\tonQuery,\n\tisLoading,\n\terror\n}: TreeMultiSelectProps) {\n\tconst treeIndex = useMemo(() => createTreeNodeIndex(nodes), [nodes]);\n\tconst selectedIds = useMemo(() => treeMultiValueToSelectedIds(value, treeIndex), [treeIndex, value]);\n\tconst selectionState = useMemo(() => getTreeNodeSelectionState(selectedIds, treeIndex), [selectedIds, treeIndex]);\n\tconst selectedSummary = useMemo(() => formatTreeMultiSummary(selectedIds, treeIndex), [selectedIds, treeIndex]);\n\n\treturn (\n\t\t<TreePickerBase\n\t\t\tlabel={label}\n\t\t\tdescription={description}\n\t\t\tdisabled={disabled}\n\t\t\tplaceholder={placeholder}\n\t\t\tsize={size}\n\t\t\tnodes={nodes}\n\t\t\tselectedIds={selectionState.selectedIds}\n\t\t\tpartialIds={selectionState.partialIds}\n\t\t\tselectionMode=\"multi\"\n\t\t\ttriggerMode=\"search\"\n\t\t\tselectedSummary={selectedSummary}\n\t\t\tquery={query}\n\t\t\tdefaultQuery={defaultQuery}\n\t\t\tonQuery={onQuery}\n\t\t\tonNodeActivate={(node) => onChange(toggleTreeMultiSelection(value, node.id, treeIndex))}\n\t\t\tonClearSelection={() => onChange({})}\n\t\t\tisLoading={isLoading}\n\t\t\terror={error}\n\t\t/>\n\t);\n}\n","import { ODataDependentBaseProps } from \"@ryuzaki13/react-foundation-api/odata\";\n\nimport { UiBaseProps } from \"../types\";\n\nimport { useODataTreeData } from \"./model/useODataTreeData\";\nimport { TreeMultiSelect } from \"./TreeMultiSelect\";\nimport { TreeMultiSelectValue } from \"./types\";\n\nexport interface ODataTreeMultiSelectProps\n\textends Omit<ODataDependentBaseProps, \"model\" | \"value\" | \"dependencies\">, Omit<UiBaseProps<TreeMultiSelectValue>, \"placeholder\"> {\n\tmodel?: ODataDependentBaseProps[\"model\"];\n\tplaceholder?: string;\n\tquery?: string;\n\tdefaultQuery?: string;\n\tonQuery?: (value: string) => void;\n}\n\nexport function ODataTreeMultiSelect({\n\tlabel,\n\tdescription,\n\tdisabled,\n\tsize,\n\tplaceholder,\n\tquery,\n\tdefaultQuery,\n\tonQuery,\n\tvalue,\n\tonChange,\n\todata,\n\tsegments,\n\tmodel\n}: ODataTreeMultiSelectProps) {\n\tconst treeData = useODataTreeData({\n\t\todata,\n\t\tsegments,\n\t\tmodel\n\t});\n\n\treturn (\n\t\t<TreeMultiSelect\n\t\t\tlabel={label}\n\t\t\tdescription={description}\n\t\t\tdisabled={disabled || treeData.isLoading}\n\t\t\tsize={size}\n\t\t\tplaceholder={placeholder ?? treeData.placeholder}\n\t\t\tnodes={treeData.nodes}\n\t\t\tvalue={value}\n\t\t\tonChange={onChange}\n\t\t\tquery={query}\n\t\t\tdefaultQuery={defaultQuery}\n\t\t\tonQuery={onQuery}\n\t\t\tisLoading={treeData.isLoading}\n\t\t\terror={treeData.isError ? \"Ошибка загрузки\" : undefined}\n\t\t/>\n\t);\n}\n","import { useMemo } from \"react\";\n\nimport { UiBaseProps } from \"../types\";\n\nimport { createTreeNodeIndex, treeSelectValueToId } from \"./model/treeUtils\";\nimport { TreePickerBase } from \"./TreePickerBase\";\nimport { TreeSelectNode, TreeSelectValue } from \"./types\";\n\nexport interface TreeSelectProps extends Omit<UiBaseProps<TreeSelectValue | undefined>, \"placeholder\"> {\n\tnodes: readonly TreeSelectNode[];\n\tplaceholder?: string;\n\tquery?: string;\n\tdefaultQuery?: string;\n\tonQuery?: (value: string) => void;\n\tisLoading?: boolean;\n\terror?: string;\n\tclearable?: boolean;\n}\n\nfunction formatTreeNodeSummary(node: TreeSelectNode | undefined) {\n\tif (!node) {\n\t\treturn undefined;\n\t}\n\n\tif (node.code && node.code !== node.label) {\n\t\treturn `${node.label} · ${node.code}`;\n\t}\n\n\treturn node.label;\n}\n\nexport function TreeSelect({\n\tlabel,\n\tdescription,\n\tdisabled,\n\tplaceholder = \"Выберите значение\",\n\tsize,\n\tnodes,\n\tvalue,\n\tonChange,\n\tquery,\n\tdefaultQuery,\n\tonQuery,\n\tisLoading,\n\terror,\n\tclearable = false\n}: TreeSelectProps) {\n\tconst treeIndex = useMemo(() => createTreeNodeIndex(nodes), [nodes]);\n\tconst selectedId = treeSelectValueToId(value, treeIndex);\n\tconst selectedNode = selectedId ? treeIndex.nodeById.get(selectedId) : undefined;\n\n\treturn (\n\t\t<TreePickerBase\n\t\t\tlabel={label}\n\t\t\tdescription={description}\n\t\t\tdisabled={disabled}\n\t\t\tplaceholder={placeholder}\n\t\t\tsize={size}\n\t\t\tnodes={nodes}\n\t\t\tselectedIds={selectedId ? new Set([selectedId]) : new Set()}\n\t\t\tpartialIds={new Set()}\n\t\t\tselectionMode=\"single\"\n\t\t\ttriggerMode=\"search\"\n\t\t\tselectedSummaryText={formatTreeNodeSummary(selectedNode)}\n\t\t\tquery={query}\n\t\t\tdefaultQuery={defaultQuery}\n\t\t\tonQuery={onQuery}\n\t\t\tonNodeActivate={(node) => onChange({ codeKey: node.codeKey, value: node.value })}\n\t\t\tonClearSelection={clearable ? () => onChange(undefined) : undefined}\n\t\t\tisLoading={isLoading}\n\t\t\terror={error}\n\t\t/>\n\t);\n}\n","import { ODataDependentBaseProps } from \"@ryuzaki13/react-foundation-api/odata\";\n\nimport { UiBaseProps } from \"../types\";\n\nimport { useODataTreeData } from \"./model/useODataTreeData\";\nimport { TreeSelect } from \"./TreeSelect\";\nimport { TreeSelectValue } from \"./types\";\n\nexport interface ODataTreeSelectProps\n\textends\n\t\tOmit<ODataDependentBaseProps, \"model\" | \"value\" | \"dependencies\">,\n\t\tOmit<UiBaseProps<TreeSelectValue | undefined>, \"placeholder\"> {\n\tmodel?: ODataDependentBaseProps[\"model\"];\n\tplaceholder?: string;\n\tquery?: string;\n\tdefaultQuery?: string;\n\tonQuery?: (value: string) => void;\n\tclearable?: boolean;\n}\n\nexport function ODataTreeSelect({\n\tlabel,\n\tdescription,\n\tdisabled,\n\tsize,\n\tplaceholder,\n\tquery,\n\tdefaultQuery,\n\tonQuery,\n\tvalue,\n\tonChange,\n\todata,\n\tsegments,\n\tmodel,\n\tclearable\n}: ODataTreeSelectProps) {\n\tconst treeData = useODataTreeData({\n\t\todata,\n\t\tsegments,\n\t\tmodel\n\t});\n\n\treturn (\n\t\t<TreeSelect\n\t\t\tlabel={label}\n\t\t\tdescription={description}\n\t\t\tdisabled={disabled || treeData.isLoading}\n\t\t\tsize={size}\n\t\t\tplaceholder={placeholder ?? treeData.placeholder}\n\t\t\tnodes={treeData.nodes}\n\t\t\tvalue={value}\n\t\t\tonChange={onChange}\n\t\t\tquery={query}\n\t\t\tdefaultQuery={defaultQuery}\n\t\t\tonQuery={onQuery}\n\t\t\tisLoading={treeData.isLoading}\n\t\t\terror={treeData.isError ? \"Ошибка загрузки\" : undefined}\n\t\t\tclearable={clearable}\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;;;AAEA,SAAgB,EAAiC,GAA0D;CAK1G,OAJK,IAIE,GACL,EAAM,UAAU,CAAC,EAAM,KAAK,EAC9B,IALQ,CAAC;AAMV;;;ACOA,SAAS,EAAa,GAA8B,GAAiB,GAAe;CACnF,OAAO,IAAW,GAAG,EAAS,GAAG,EAAQ,GAAG,MAAU,GAAG,EAAQ,GAAG;AACrE;AAEA,SAAS,EAAiB,GAAsB,GAAiB,GAAqC;CACrG,IAAM,IAAU,EAAY;CAC5B,OAAQ,KAAW,EAAK,MAAa,EAAK;AAC3C;AAEA,SAAS,GAAiB,GAAkC;CAC3D,OAAO,CAAC,GAAG,IAAI,IAAI,EAAM,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG;AACpD;AAEA,SAAS,GAAkB,GAA4G;CACtI,OAAO;EACN,IAAI,EAAa,EAAK,UAAU,EAAK,SAAS,EAAK,KAAK;EACxD,SAAS,EAAK;EACd,OAAO,EAAK;EACZ,OAAO,EAAK;EACZ,MAAM,EAAK;EACX,YAAY,GAAiB;GAAC,EAAK;GAAO,EAAK;GAAO,EAAK;EAAI,CAAC;EAChE,UAAU,CAAC;EACX,kCAAkB,IAAI,IAAI;CAC3B;AACD;AAEA,SAAS,EAAa,GAAuC;CAC5D,OAAO;EACN,IAAI,EAAK;EACT,SAAS,EAAK;EACd,OAAO,EAAK;EACZ,OAAO,EAAK;EACZ,MAAM,EAAK;EACX,YAAY,EAAK;EACj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AAY;EACZ,qBAAqB,EAAsB,CAAY;EAChD;EACO;EACL;EACT,iBAAiB,MAAS,EAAS;GAAE,SAAS,EAAK;GAAS,OAAO,EAAK;EAAM,CAAC;EAC/E,kBAAkB,UAAkB,EAAS,KAAA,CAAS,IAAI,KAAA;EAC/C;EACJ;CACP,CAAA;AAEH;;;ACrDA,SAAgB,GAAgB,EAC/B,UACA,gBACA,aACA,SACA,gBACA,UACA,iBACA,YACA,UACA,aACA,UACA,aACA,UACA,gBACwB;CACxB,IAAM,IAAW,EAAiB;EACjC;EACA;EACA;CACD,CAAC;CAED,OACC,kBAAC,GAAD;EACQ;EACM;EACb,UAAU,KAAY,EAAS;EACzB;EACN,aAAa,KAAe,EAAS;EACrC,OAAO,EAAS;EACT;EACG;EACH;EACO;EACL;EACT,WAAW,EAAS;EACpB,OAAO,EAAS,UAAU,oBAAoB,KAAA;EACnC;CACX,CAAA;AAEH"}
|
package/dist/tree-table/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { a as e, c as t, d as n, i as r, m as i, n as ee, o as te, r as ne, s as re, t as ie } from "../chunks/base-table-
|
|
1
|
+
import { a as e, c as t, d as n, i as r, m as i, n as ee, o as te, r as ne, s as re, t as ie } from "../chunks/base-table-Dv9i3CAT.js";
|
|
2
2
|
import { useEffect as a, useEffectEvent as o, useMemo as s, useRef as c, useState as ae } from "react";
|
|
3
3
|
import { cn as oe } from "@ryuzaki13/react-foundation-lib/utils";
|
|
4
|
+
import { ChevronDownIcon as l, ChevronRightIcon as u } from "lucide-react";
|
|
5
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
4
6
|
import { formatPipelineDisplayValue as se } from "@ryuzaki13/react-foundation-lib/formatters";
|
|
5
|
-
import { resolveTableLength as
|
|
6
|
-
import { ChevronDownIcon as u, ChevronRightIcon as d } from "lucide-react";
|
|
7
|
-
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
7
|
+
import { resolveTableLength as p, useTableRowSelection as ce } from "@ryuzaki13/react-foundation-lib/table";
|
|
8
8
|
import { getCoreRowModel as m, getExpandedRowModel as le, useReactTable as ue } from "@tanstack/react-table";
|
|
9
9
|
import { buildTreeTableRows as de } from "@ryuzaki13/react-foundation-lib/tree-table";
|
|
10
10
|
var h = {
|
|
@@ -28,10 +28,10 @@ function v(e, t) {
|
|
|
28
28
|
return t.get(e.id) ?? e.original;
|
|
29
29
|
}
|
|
30
30
|
function fe(e, t, n, r) {
|
|
31
|
-
return e.cell.column.id === n ? /* @__PURE__ */
|
|
31
|
+
return e.cell.column.id === n ? /* @__PURE__ */ f("div", {
|
|
32
32
|
className: h.treeCell,
|
|
33
|
-
style: { paddingInlineStart: `calc(${e.row.depth} * ${
|
|
34
|
-
children: [e.row.getCanExpand() ? /* @__PURE__ */
|
|
33
|
+
style: { paddingInlineStart: `calc(${e.row.depth} * ${p(r) ?? "0em"})` },
|
|
34
|
+
children: [e.row.getCanExpand() ? /* @__PURE__ */ d("button", {
|
|
35
35
|
type: "button",
|
|
36
36
|
className: h.expanderButton,
|
|
37
37
|
"aria-label": e.row.getIsExpanded() ? "Свернуть строку" : "Развернуть строку",
|
|
@@ -41,17 +41,17 @@ function fe(e, t, n, r) {
|
|
|
41
41
|
onClick: (t) => {
|
|
42
42
|
t.stopPropagation(), e.row.toggleExpanded();
|
|
43
43
|
},
|
|
44
|
-
children: e.row.getIsExpanded() ? /* @__PURE__ */
|
|
45
|
-
}) : /* @__PURE__ */
|
|
44
|
+
children: e.row.getIsExpanded() ? /* @__PURE__ */ d(l, { size: 16 }) : /* @__PURE__ */ d(u, { size: 16 })
|
|
45
|
+
}) : /* @__PURE__ */ d("span", {
|
|
46
46
|
className: h.expanderSpacer,
|
|
47
47
|
"aria-hidden": "true"
|
|
48
|
-
}), /* @__PURE__ */
|
|
48
|
+
}), /* @__PURE__ */ d("div", {
|
|
49
49
|
className: h.treeCellContent,
|
|
50
50
|
children: t
|
|
51
51
|
})]
|
|
52
52
|
}) : t;
|
|
53
53
|
}
|
|
54
|
-
function y({ title: l, isLoading: u, isFetching:
|
|
54
|
+
function y({ title: l, isLoading: u, isFetching: f, data: p, columns: y, hierarchy: b, selectionMode: x = "none", expandFirstLevel: S = !1, defaultExpandedRowIds: C, treeColumnId: pe, indentSize: me = 1, className: he, tableClassName: ge, columnVisibility: _e, defaultColumnVisibility: ve, columnOrder: ye, defaultColumnOrder: be, columnSizing: xe, defaultColumnSizing: Se, columnPinning: w, defaultColumnPinning: T, enableColumnResizing: E = !1, enableColumnReordering: D = !1, columnResizeMinWidth: O, onColumnVisibilityChange: k, onColumnOrderChange: A, onColumnSizingChange: j, onColumnPinningChange: Ce, onRowClick: M, onRowSelectionChange: we, onExpandedRowIdsChange: Te, onReachEnd: N, getRowCanSelect: P, getRowClassName: Ee, renderHeaderContextMenu: De, renderCellContent: F }) {
|
|
55
55
|
let I = s(() => de(p ?? [], b), [p, b]), L = s(() => t(y), [y]), R = s(() => {
|
|
56
56
|
let e = new Set(C ?? []);
|
|
57
57
|
if (S) for (let t of I.rootRowIds) e.add(t);
|
|
@@ -161,12 +161,12 @@ function y({ title: l, isLoading: u, isFetching: d, data: p, columns: y, hierarc
|
|
|
161
161
|
Z,
|
|
162
162
|
Q
|
|
163
163
|
]);
|
|
164
|
-
return /* @__PURE__ */
|
|
164
|
+
return /* @__PURE__ */ d(ee, {
|
|
165
165
|
table: X,
|
|
166
166
|
columnState: Y,
|
|
167
167
|
title: l,
|
|
168
168
|
isLoading: u,
|
|
169
|
-
isFetching:
|
|
169
|
+
isFetching: f,
|
|
170
170
|
className: he,
|
|
171
171
|
tableClassName: ge,
|
|
172
172
|
selectionMode: x,
|
|
@@ -197,7 +197,7 @@ function y({ title: l, isLoading: u, isFetching: d, data: p, columns: y, hierarc
|
|
|
197
197
|
columnId: e.cell.column.id,
|
|
198
198
|
runtimeByColumnId: L.runtimeByColumnId,
|
|
199
199
|
customCellColumnIds: L.customCellColumnIds
|
|
200
|
-
}) ? /* @__PURE__ */
|
|
200
|
+
}) ? /* @__PURE__ */ d(ie, {
|
|
201
201
|
displayValue: r,
|
|
202
202
|
align: e.columnMeta?.align
|
|
203
203
|
}) : e.defaultContent;
|
|
@@ -207,7 +207,7 @@ function y({ title: l, isLoading: u, isFetching: d, data: p, columns: y, hierarc
|
|
|
207
207
|
displayValue: r
|
|
208
208
|
}) : i, Q, me);
|
|
209
209
|
},
|
|
210
|
-
afterTableContent: N ? /* @__PURE__ */
|
|
210
|
+
afterTableContent: N ? /* @__PURE__ */ d("div", {
|
|
211
211
|
ref: U,
|
|
212
212
|
className: h.sentinel,
|
|
213
213
|
"aria-hidden": "true"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ryuzaki13/react-foundation-ui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8",
|
|
4
4
|
"description": "Reusable React foundation UI primitives and Storybook stories.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Ryuzaki13",
|
|
@@ -366,6 +366,7 @@
|
|
|
366
366
|
"@lexical/rich-text": "^0.46.0",
|
|
367
367
|
"@lexical/selection": "^0.46.0",
|
|
368
368
|
"@lexical/utils": "^0.46.0",
|
|
369
|
+
"@ryuzaki13/react-foundation-api": ">=0.1.0 <2.0.0",
|
|
369
370
|
"@ryuzaki13/react-foundation-lib": ">=0.1.0 <2.0.0",
|
|
370
371
|
"@storybook/react-vite": "^10.4.6",
|
|
371
372
|
"@tanstack/react-query": "^5.101.1",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"generatedAt":
|
|
1
|
+
{"generatedAt":1784277929711,"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":false,"hasStorybookEslint":false,"refCount":0,"metaFramework":{"name":"tanstack-react","packageName":"@tanstack/react-router","version":"1.170.17"},"knownPackages":{"testPackages":{"@testing-library/dom":"10.4.1","@testing-library/react":"16.3.2","@testing-library/user-event":"^14.6.1","vitest":"4.1.10"},"stateManagementPackages":{"zustand":"^5.0.14"},"dataFetchingPackages":{"@tanstack/react-query":"^5.101.1"},"routerPackages":{"@tanstack/react-router":"^1.170.16"}},"hasRouterPackage":false,"packageManager":{"type":"npm","version":"11.7.0","agent":"npm","nodeLinker":"node_modules"},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/react-vite","options":{}},"builder":"@storybook/builder-vite","renderer":"@storybook/react","portableStoriesFileCount":0,"applicationFileCount":9,"storybookVersion":"10.4.6","storybookVersionSpecifier":"^10.4.6","language":"typescript","storybookPackages":{"@storybook/react-vite":{"version":"10.4.6"},"storybook":{}},"addons":{"@storybook/addon-docs":{"version":"10.4.6"},"@storybook/addon-a11y":{"version":"10.4.6"}},"packageJsonType":"module"}
|