@elliemae/ds-treeview 3.22.0-next.3 → 3.22.0-next.30

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.
Files changed (86) hide show
  1. package/dist/cjs/TreeView.js.map +1 -1
  2. package/dist/cjs/TreeViewContext.js.map +1 -1
  3. package/dist/cjs/config/cssClassesConstants.js.map +1 -1
  4. package/dist/cjs/config/useTreeview.js.map +1 -1
  5. package/dist/cjs/hoc/DnDTreeContext.js.map +1 -1
  6. package/dist/cjs/hoc/SortableItemContext.js.map +1 -1
  7. package/dist/cjs/hoc/WithConditionalDnDContext.js.map +1 -1
  8. package/dist/cjs/hoc/WithDnDSortableItemContext.js.map +1 -1
  9. package/dist/cjs/index.js.map +1 -1
  10. package/dist/cjs/parts/CheckboxSelectable.js +15 -5
  11. package/dist/cjs/parts/CheckboxSelectable.js.map +3 -3
  12. package/dist/cjs/parts/ChildrenCountDisplayer.js.map +1 -1
  13. package/dist/cjs/parts/DnDHandle.js.map +1 -1
  14. package/dist/cjs/parts/DropIndicator.js.map +1 -1
  15. package/dist/cjs/parts/ExpandCaret.js.map +1 -1
  16. package/dist/cjs/parts/Icon.js.map +1 -1
  17. package/dist/cjs/parts/NestingSpace.js.map +1 -1
  18. package/dist/cjs/parts/RadioSelectable.js.map +1 -1
  19. package/dist/cjs/parts/TreeItem.js.map +1 -1
  20. package/dist/cjs/parts/TreeItemText.js.map +1 -1
  21. package/dist/cjs/parts/TreeList.js.map +1 -1
  22. package/dist/cjs/plugins/dnd/TreeDndPlugin.js.map +1 -1
  23. package/dist/cjs/plugins/dnd/index.js.map +1 -1
  24. package/dist/cjs/plugins/index.js.map +1 -1
  25. package/dist/cjs/react-desc-prop-types.js.map +1 -1
  26. package/dist/cjs/related-components/TreeViewSearchBar.js.map +1 -1
  27. package/dist/cjs/sharedTypes.js.map +1 -1
  28. package/dist/cjs/utils/array-helpers.js.map +1 -1
  29. package/dist/cjs/utils/group-expands-helpers.js.map +1 -1
  30. package/dist/cjs/utils/keyboard-helpers.js.map +1 -1
  31. package/dist/cjs/utils/object-helpers.js.map +1 -1
  32. package/dist/cjs/utils/refs-helpers.js.map +1 -1
  33. package/dist/cjs/utils/selectable-helper.js +3 -2
  34. package/dist/cjs/utils/selectable-helper.js.map +3 -3
  35. package/dist/cjs/utils/string-helpers.js.map +1 -1
  36. package/dist/cjs/utils/tree-helpers.js.map +3 -3
  37. package/dist/cjs/utils/useInstanceRefActions.js.map +1 -1
  38. package/dist/cjs/utils/useTree.js.map +1 -1
  39. package/dist/esm/TreeView.js.map +1 -1
  40. package/dist/esm/TreeViewContext.js.map +1 -1
  41. package/dist/esm/config/cssClassesConstants.js.map +1 -1
  42. package/dist/esm/config/useTreeview.js.map +1 -1
  43. package/dist/esm/hoc/DnDTreeContext.js.map +1 -1
  44. package/dist/esm/hoc/SortableItemContext.js.map +1 -1
  45. package/dist/esm/hoc/WithConditionalDnDContext.js.map +1 -1
  46. package/dist/esm/hoc/WithDnDSortableItemContext.js.map +1 -1
  47. package/dist/esm/index.js.map +1 -1
  48. package/dist/esm/parts/CheckboxSelectable.js +15 -5
  49. package/dist/esm/parts/CheckboxSelectable.js.map +3 -3
  50. package/dist/esm/parts/ChildrenCountDisplayer.js.map +1 -1
  51. package/dist/esm/parts/DnDHandle.js.map +1 -1
  52. package/dist/esm/parts/DropIndicator.js.map +1 -1
  53. package/dist/esm/parts/ExpandCaret.js.map +1 -1
  54. package/dist/esm/parts/Icon.js.map +1 -1
  55. package/dist/esm/parts/NestingSpace.js.map +1 -1
  56. package/dist/esm/parts/RadioSelectable.js.map +1 -1
  57. package/dist/esm/parts/TreeItem.js.map +1 -1
  58. package/dist/esm/parts/TreeItemText.js.map +1 -1
  59. package/dist/esm/parts/TreeList.js.map +1 -1
  60. package/dist/esm/plugins/dnd/TreeDndPlugin.js.map +1 -1
  61. package/dist/esm/plugins/dnd/index.js.map +1 -1
  62. package/dist/esm/plugins/index.js.map +1 -1
  63. package/dist/esm/react-desc-prop-types.js.map +1 -1
  64. package/dist/esm/related-components/TreeViewSearchBar.js.map +1 -1
  65. package/dist/esm/sharedTypes.js.map +1 -1
  66. package/dist/esm/utils/array-helpers.js.map +1 -1
  67. package/dist/esm/utils/group-expands-helpers.js.map +1 -1
  68. package/dist/esm/utils/keyboard-helpers.js.map +1 -1
  69. package/dist/esm/utils/object-helpers.js.map +1 -1
  70. package/dist/esm/utils/refs-helpers.js.map +1 -1
  71. package/dist/esm/utils/selectable-helper.js +3 -2
  72. package/dist/esm/utils/selectable-helper.js.map +3 -3
  73. package/dist/esm/utils/string-helpers.js.map +1 -1
  74. package/dist/esm/utils/tree-helpers.js.map +3 -3
  75. package/dist/esm/utils/useInstanceRefActions.js.map +1 -1
  76. package/dist/esm/utils/useTree.js.map +1 -1
  77. package/dist/types/config/cssClassesConstants.d.ts +1 -1
  78. package/dist/types/parts/CheckboxSelectable.d.ts +1 -0
  79. package/dist/types/parts/ExpandCaret.d.ts +1 -0
  80. package/dist/types/parts/Icon.d.ts +1 -0
  81. package/dist/types/parts/NestingSpace.d.ts +1 -0
  82. package/dist/types/parts/TreeItemText.d.ts +1 -0
  83. package/dist/types/parts/TreeList.d.ts +1 -1
  84. package/dist/types/utils/selectable-helper.d.ts +1 -1
  85. package/dist/types/utils/tree-helpers.d.ts +3 -4
  86. package/package.json +20 -19
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/TreeItemText.tsx"],
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/TreeItemText.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useMemo, useContext } from 'react';\nimport Highlighter from 'react-highlight-words';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { ChildrenCountDisplayer } from './ChildrenCountDisplayer.js';\nimport { DSTreeViewPrefix, treeItemBlockName } from '../config/cssClassesConstants.js';\nimport TreeViewContext from '../TreeViewContext.js';\nimport type { DSTreeviewT } from '../react-desc-prop-types.js';\n\nconst ItemContent = aggregatedClasses('div')(`${treeItemBlockName}-content`) as unknown as React.ComponentType<\n React.ComponentProps<'div'>\n>;\nconst ItemValue = aggregatedClasses('span')(treeItemBlockName, 'value') as unknown as React.ComponentType<\n React.ComponentProps<'span'>\n>;\n\n// const wrapperClassName = `${DSTreeViewPrefix}-${treeItemBlockName}-content`;\nconst classNameModifierWrapAll = `${DSTreeViewPrefix}-${treeItemBlockName}__value--wrap-all`;\nconst classNameModifierTruncate = `${DSTreeViewPrefix}-${treeItemBlockName}__value--truncate`;\n\n// eslint-disable-next-line react/prop-types\nconst CustomHighlight = ({ children }: { children: React.ReactNode }) => (\n <mark className=\"tree-text-highlight\" data-testid=\"tree-text-highlight\">\n {children}\n </mark>\n);\ninterface PropsT {\n item: DSTreeviewT.Item;\n}\nexport const TreeItemText = (props: PropsT): JSX.Element => {\n const { item } = props;\n const ctx = useContext(TreeViewContext);\n const {\n props: { searchQuery, showChildrenAmount, labelOverflow, nameKey },\n } = ctx;\n\n const Text = useMemo(() => {\n const itemLabelText = item[nameKey] as DSTreeviewT.Item['name'];\n if (searchQuery) {\n if (labelOverflow === 'truncate') {\n return (\n <SimpleTruncatedTooltipText\n value={\n <>\n <Highlighter\n autoEscape\n highlightTag={CustomHighlight}\n searchWords={[searchQuery]}\n textToHighlight={itemLabelText}\n />\n {showChildrenAmount ? <ChildrenCountDisplayer item={item} /> : null}\n </>\n }\n />\n );\n }\n return (\n <>\n <Highlighter\n autoEscape\n highlightTag={CustomHighlight}\n searchWords={[searchQuery]}\n textToHighlight={itemLabelText}\n />\n {showChildrenAmount ? <ChildrenCountDisplayer item={item} /> : null}\n </>\n );\n }\n if (labelOverflow === 'truncate') {\n return (\n <SimpleTruncatedTooltipText\n value={\n <>\n {itemLabelText}\n {showChildrenAmount ? <ChildrenCountDisplayer item={item} /> : null}\n </>\n }\n />\n );\n }\n return (\n <>\n {itemLabelText}\n {showChildrenAmount ? <ChildrenCountDisplayer item={item} /> : null}\n </>\n );\n }, [item, searchQuery, nameKey, showChildrenAmount, labelOverflow]);\n\n let className = '';\n if (labelOverflow === 'wrap-all') className += `${classNameModifierWrapAll} `;\n if (labelOverflow === 'truncate') className += `${classNameModifierTruncate} `;\n\n return (\n <ItemContent data-testid={`${treeItemBlockName}-content`}>\n <ItemValue className={className}>{Text}</ItemValue>\n </ItemContent>\n );\n};\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACuBrB,SAqBY,UArBZ,KAqBY,YArBZ;AAtBF,SAAgB,SAAS,kBAAkB;AAC3C,OAAO,iBAAiB;AACxB,SAAS,kCAAkC;AAC3C,SAAS,yBAAyB;AAClC,SAAS,8BAA8B;AACvC,SAAS,kBAAkB,yBAAyB;AACpD,OAAO,qBAAqB;AAG5B,MAAM,cAAc,kBAAkB,KAAK,EAAE,GAAG,2BAA2B;AAG3E,MAAM,YAAY,kBAAkB,MAAM,EAAE,mBAAmB,OAAO;AAKtE,MAAM,2BAA2B,GAAG,oBAAoB;AACxD,MAAM,4BAA4B,GAAG,oBAAoB;AAGzD,MAAM,kBAAkB,CAAC,EAAE,SAAS,MAClC,oBAAC,UAAK,WAAU,uBAAsB,eAAY,uBAC/C,UACH;AAKK,MAAM,eAAe,CAAC,UAA+B;AAC1D,QAAM,EAAE,KAAK,IAAI;AACjB,QAAM,MAAM,WAAW,eAAe;AACtC,QAAM;AAAA,IACJ,OAAO,EAAE,aAAa,oBAAoB,eAAe,QAAQ;AAAA,EACnE,IAAI;AAEJ,QAAM,OAAO,QAAQ,MAAM;AACzB,UAAM,gBAAgB,KAAK,OAAO;AAClC,QAAI,aAAa;AACf,UAAI,kBAAkB,YAAY;AAChC,eACE;AAAA,UAAC;AAAA;AAAA,YACC,OACE,iCACE;AAAA;AAAA,gBAAC;AAAA;AAAA,kBACC,YAAU;AAAA,kBACV,cAAc;AAAA,kBACd,aAAa,CAAC,WAAW;AAAA,kBACzB,iBAAiB;AAAA;AAAA,cACnB;AAAA,cACC,qBAAqB,oBAAC,0BAAuB,MAAY,IAAK;AAAA,eACjE;AAAA;AAAA,QAEJ;AAAA,MAEJ;AACA,aACE,iCACE;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,YAAU;AAAA,YACV,cAAc;AAAA,YACd,aAAa,CAAC,WAAW;AAAA,YACzB,iBAAiB;AAAA;AAAA,QACnB;AAAA,QACC,qBAAqB,oBAAC,0BAAuB,MAAY,IAAK;AAAA,SACjE;AAAA,IAEJ;AACA,QAAI,kBAAkB,YAAY;AAChC,aACE;AAAA,QAAC;AAAA;AAAA,UACC,OACE,iCACG;AAAA;AAAA,YACA,qBAAqB,oBAAC,0BAAuB,MAAY,IAAK;AAAA,aACjE;AAAA;AAAA,MAEJ;AAAA,IAEJ;AACA,WACE,iCACG;AAAA;AAAA,MACA,qBAAqB,oBAAC,0BAAuB,MAAY,IAAK;AAAA,OACjE;AAAA,EAEJ,GAAG,CAAC,MAAM,aAAa,SAAS,oBAAoB,aAAa,CAAC;AAElE,MAAI,YAAY;AAChB,MAAI,kBAAkB;AAAY,iBAAa,GAAG;AAClD,MAAI,kBAAkB;AAAY,iBAAa,GAAG;AAElD,SACE,oBAAC,eAAY,eAAa,GAAG,6BAC3B,8BAAC,aAAU,WAAuB,gBAAK,GACzC;AAEJ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/TreeList.tsx"],
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/TreeList.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useContext } from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { DSCircularProgressIndicator } from '@elliemae/ds-circular-progress-indicator';\nimport TreeViewContext from '../TreeViewContext.js';\nimport { DSTreeViewPrefix, treeListBlockName } from '../config/cssClassesConstants.js';\nimport TreeItem from './TreeItem.js';\nimport type { DSTreeviewT } from '../react-desc-prop-types.js';\nimport { withConditionalDnDRowContext } from '../hoc/WithConditionalDnDContext.js';\nimport { DnDTreeContext } from '../hoc/DnDTreeContext.js';\n\nexport const treeListNoItemsBn = `${treeListBlockName}-no-items`;\nexport const TreeListNoItems = aggregatedClasses('div', {\n 'data-testid': treeListNoItemsBn,\n})(treeListNoItemsBn) as unknown as React.ComponentType<React.ComponentProps<'div'>>;\n\n// React.ComponentProps<'ul'> uses LegacyRef typings that existed pre-hook era\n// we omit the LegacyRef typings in favor of hook-era typings\ninterface UlProps extends Omit<React.ComponentProps<'ul'>, 'ref'> {\n ref: React.MutableRefObject<HTMLUListElement | undefined> | undefined;\n}\nexport const TreeListWrapper = aggregatedClasses('ul', {\n 'data-testid': treeListBlockName,\n role: 'tree',\n})(treeListBlockName, null, ({ rowSize }: { rowSize: 'normal' | 'compact' }) => ({\n [`rowsize-${rowSize}`]: rowSize,\n})) as unknown as React.ComponentType<UlProps>;\n\nconst compactRowClass = `${DSTreeViewPrefix}-tv-row-size-compact`;\nconst normaRowClass = `${DSTreeViewPrefix}-tv-row-size-normal`;\n\ninterface PropsT {\n onMouseDragOverItem?: (opts: {\n event: React.MouseEvent<HTMLLIElement>;\n item: DSTreeviewT.Item;\n itemIndex: number;\n setIsDraggingOverThis: React.Dispatch<React.SetStateAction<boolean>>;\n openFolderOnHoverTimeout: React.MutableRefObject<NodeJS.Timeout | null>;\n }) => void;\n}\n\nconst TreeListComp: React.ComponentType<PropsT> = () => {\n const ctx = useContext(TreeViewContext);\n const {\n virtualListRef,\n virtualListHelpers,\n visibleItems: flattenedVisibleItems,\n props: { width, height, rowSize, noItemsPlaceholder, isLoading },\n } = ctx;\n const { totalSize, virtualItems } = virtualListHelpers;\n const className = `${rowSize === 'compact' ? `${compactRowClass}` : `${normaRowClass}`}`;\n\n const { visibleItems } = useContext(DnDTreeContext);\n\n return (\n <TreeListWrapper\n ref={virtualListRef}\n className={className}\n style={{\n height: `${typeof height === 'number' ? `${height}px` : height}`,\n width: `${typeof width === 'number' ? `${width}px` : width}`,\n overflow: 'auto',\n }}\n >\n {isLoading ? (\n <div\n style={{\n width: '100%',\n height: '100%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n }}\n >\n <DSCircularProgressIndicator size=\"xl\" loading={isLoading} showLabel waiting={false} showTooltip={false} />\n </div>\n ) : null}\n {!isLoading && virtualItems.length === 0 ? <TreeListNoItems>{noItemsPlaceholder}</TreeListNoItems> : null}\n {!isLoading && virtualItems.length !== 0 ? (\n <div\n style={{\n height: `${totalSize}px`,\n width: '100%',\n position: 'relative',\n }}\n >\n {virtualItems.map((virtualItem) => {\n const { index, measureRef, start } = virtualItem;\n const item = (visibleItems || flattenedVisibleItems)[index];\n if (!item) return null;\n item.virtualIndex = index;\n const { id } = item;\n\n const style = {\n position: 'absolute',\n top: `${start}px`,\n left: 0,\n width: '100%',\n };\n\n const listItemProps = {\n key: `DS-TreeView-List-Item-${id}`,\n virtualItemRef: measureRef,\n index, // this is consumed by the DnD HOC\n itemIndex: index,\n item,\n itemWrapperStyle: style,\n };\n\n return <TreeItem {...listItemProps} />;\n })}\n </div>\n ) : null}\n </TreeListWrapper>\n );\n};\n\nexport const TreeList = withConditionalDnDRowContext(TreeListComp);\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACuDnB,SAmBM,KAnBN;AAtDJ,SAAgB,kBAAkB;AAClC,SAAS,yBAAyB;AAClC,SAAS,mCAAmC;AAC5C,OAAO,qBAAqB;AAC5B,SAAS,kBAAkB,yBAAyB;AACpD,OAAO,cAAc;AAErB,SAAS,oCAAoC;AAC7C,SAAS,sBAAsB;AAExB,MAAM,oBAAoB,GAAG;AAC7B,MAAM,kBAAkB,kBAAkB,OAAO;AAAA,EACtD,eAAe;AACjB,CAAC,EAAE,iB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AAA,cACP,UAAU;AAAA,YACZ;AAAA,YAEC,uBAAa,IAAI,CAAC,gBAAgB;AACjC,oBAAM,EAAE,OAAO,YAAY,MAAM,IAAI;AACrC,oBAAM,QAAQ,gBAAgB,uBAAuB,KAAK;AAC1D,kBAAI,CAAC;AAAM,uBAAO;AAClB,mBAAK,eAAe;AACpB,oBAAM,EAAE,GAAG,IAAI;AAEf,oBAAM,QAAQ;AAAA,gBACZ,UAAU;AAAA,gBACV,KAAK,GAAG;AAAA,gBACR,MAAM;AAAA,gBACN,OAAO;AAAA,cACT;AAEA,oBAAM,gBAAgB;AAAA,gBACpB,KAAK,yBAAyB;AAAA,gBAC9B,gBAAgB;AAAA,gBAChB;AAAA;AAAA,gBACA,WAAW;AAAA,gBACX;AAAA,gBACA,kBAAkB;AAAA,cACpB;AAEA,qBAAO,oBAAC,YAAU,GAAG,eAAe;AAAA,YACtC,CAAC;AAAA;AAAA,QACH,IACE;AAAA;AAAA;AAAA,EACN;AAEJ;AAEO,MAAM,WAAW,6BAA6B,YAAY;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/dnd/TreeDndPlugin.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/dnd/TreeDndPlugin.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const TreeDndPlugin = 'tree-dnd';\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,gBAAgB;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/dnd/index.tsx"],
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/dnd/index.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './TreeDndPlugin.js';\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/plugins/index.tsx"],
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/plugins/index.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './dnd/index.js';\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.tsx"],
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport type { WeakValidationMap } from 'react';\nimport type React from 'react';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport type TreeModel from 'tree-model';\nimport type { useVirtual } from 'react-virtual';\nexport declare namespace DSTreeviewT {\n export type StringOrNum = string | number;\n export type SelectionState = boolean | 'mixed';\n export type SelectionItems = Record<StringOrNum, SelectionState>;\n export type ScrollToFunc = ReturnType<typeof useVirtual>['scrollToIndex'];\n export type ScrollToItemOptions = Parameters<ReturnType<typeof useVirtual>['scrollToIndex']>[1];\n export type ScrollToItemFunc = (options: ScrollToItemOptions) => void;\n export type ExpandedItems = Record<StringOrNum, true>; // { [id]:true } -> e.g. {1:true; 2:true} // false are not listed\n export interface SimpleItem {\n [key: string]: unknown;\n name: string;\n children?: SimpleItem[];\n id: StringOrNum;\n }\n\n export interface Item extends SimpleItem {\n children: Item[];\n treeDepth?: number;\n virtualIndex?: number;\n isChecked?: boolean | 'mixed';\n isGroup?: boolean;\n isExpanded?: boolean;\n childrenMatchesSearchQuery?: boolean;\n matchesSearchQuery?: boolean;\n nodeItemRef?: React.RefObject<HTMLLIElement>;\n model: TreeModel.Node<Item>['model'];\n node: TreeModel.Node<Item> & { parent?: TreeModel.Node<Item> };\n nodePath: TreeModel.Node<Item>[];\n }\n\n export interface DndItem {\n uid: string;\n depth: number;\n realIndex: number;\n childrenCount: number;\n parentId: string | null;\n original: DSTreeviewT.Item;\n }\n\n export interface Actions {\n toggleExpandAll: (isExpand: boolean) => Promise<DSTreeviewT.Item[]>;\n scrollTo: DSTreeviewT.ScrollToFunc;\n setSelectedItemByVirtualIndex: (index: number) => void;\n setFocusedItemByVirtualIndex: (\n index: number,\n scrollOpts: DSTreeviewT.ScrollToItemOptions & { withScroll?: boolean },\n ) => void;\n }\n export interface InstanceRef {\n actions: Actions;\n }\n\n export interface DefaultProps {\n plugins: string[];\n selection: SelectionItems;\n instanceRef: React.MutableRefObject<InstanceRef>;\n isItemDisabled: (item: Item) => boolean;\n disableIcons: boolean;\n isMultiSelect: boolean;\n isSingleSelect: boolean;\n getIsDropValid: (\n active: DndItem,\n over: DndItem,\n dropIndicatorPosition: 'none' | 'before' | 'after' | 'inside',\n ) => boolean;\n showChildrenAmount: boolean;\n isLoading: boolean;\n highlightOnlyQuery: boolean;\n onItemClick: (item: Item, e: React.MouseEvent<HTMLLIElement>) => void;\n onItemActivate: (item: Item, e?: React.MouseEvent<HTMLLIElement> | React.KeyboardEvent<HTMLLIElement>) => void;\n onItemFocus: (meta: { scrollToItem: ScrollToItemFunc; itemIndex: number; item: Item }) => void;\n onVisibleItemsChange: (newVisibleItems: Item[]) => void;\n onOrderChange: (newData: SimpleItem[], oldData: SimpleItem[], draggedItem: DndItem) => void;\n onSelectionChange: (\n selection: SelectionItems,\n item: Item,\n meta: { scrollToItem: ScrollToItemFunc; itemIndex: number },\n ) => void;\n onExpandChange: (expandedHashmap: ExpandedItems, itemToggled: Item | null | undefined) => void;\n onInstanceRefInitialized: (instanceRef: React.MutableRefObject<InstanceRef>) => void;\n rowSize: 'normal' | 'compact';\n labelOverflow: 'wrap' | 'wrap-all' | 'truncate';\n noItemsPlaceholder: string;\n nameKey: string;\n width: StringOrNum;\n height: StringOrNum;\n groupIcon: JSX.Element | null;\n itemIcon: JSX.Element | null;\n searchQuery: string;\n }\n export interface PropsOptional {\n controlledSelection: SelectionItems;\n expanded: ExpandedItems;\n rightAddons: ((item: Item) => React.ReactNode[]) | JSX.Element;\n RightAddons: React.ComponentType<{ item: Item }>;\n }\n export interface PropsRequired {\n data: Item[];\n }\n export interface Props extends DefaultProps, PropsOptional, PropsRequired {}\n}\n\nexport const TreeViewPropTypes = {\n data: PropTypes.arrayOf(\n PropTypes.shape({\n children: PropTypes.arrayOf(PropTypes.object),\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n isGroup: PropTypes.oneOfType([PropTypes.oneOf([undefined, null]), PropTypes.bool]),\n name: PropTypes.string,\n node: PropTypes.object,\n }),\n ).description('data to populate tree view').isRequired,\n plugins: PropTypes.tuple([PropTypes.oneOf(['tree-dnd'])])\n .description(\n 'only accepted value is TreeDndPlugin constant\\nother legacy plugins are now supported via different props',\n )\n .defaultValue([]),\n selection: PropTypes.object.description('pre selected items').defaultValue({}),\n RightAddons: PropTypes.func\n .description('A React component that will be rendered on the right side of each rows')\n .signature('React.ComponentType<{item}>'),\n expanded: PropTypes.object.description('control what items are expanded').defaultValue(undefined),\n instanceRef: PropTypes.shape({\n current: PropTypes.oneOfType([\n PropTypes.oneOf([null, undefined]),\n PropTypes.shape({\n actions: PropTypes.shape({\n toggleExpandAll: PropTypes.func,\n scrollTo: PropTypes.func,\n }).description('').isRequired,\n }),\n ]),\n }).description('instance ref'),\n isItemDisabled: PropTypes.func\n .description('Function that receives an item, and returns whether that item should be disabled')\n .defaultValue('() => false'),\n disableIcons: PropTypes.bool.description('disable icons').defaultValue(false),\n isMultiSelect: PropTypes.bool.description('whether the tree view is multi select or not').defaultValue(false),\n isSingleSelect: PropTypes.bool.description('wheter the tree view is single select or not').defaultValue(false),\n isLoading: PropTypes.bool.description('wheter the tree should show the loading state or not').defaultValue(false),\n getIsDropValid: PropTypes.func\n .description(\"Function that returns true if the drop is valid and false if it's not\")\n .defaultValue('() => true'),\n showChildrenAmount: PropTypes.bool.description('whether to show the amount of children or not').defaultValue(false),\n onItemClick: PropTypes.func.description('function executed when clicking on an item').defaultValue('() => {}'),\n onItemActivate: PropTypes.func.description('function executed when an item gets activated').defaultValue('() => {}'),\n onItemFocus: PropTypes.func.description('function executed when focusing on an item').defaultValue('() => {}'),\n onVisibleItemsChange: PropTypes.func\n .description('function executed when the visible items change')\n .defaultValue('() => {}'),\n onOrderChange: PropTypes.func.description('function executed when the items order changes').defaultValue('() => {}'),\n onSelectionChange: PropTypes.func\n .description('function executed when the selection changes')\n .defaultValue('() => {}'),\n onExpandChange: PropTypes.func.description('function executed when expanding an item').defaultValue('() => {}'),\n onInstanceRefInitialized: PropTypes.func\n .description('function executed when instanceRef has terminated instanciation')\n .defaultValue('() => {}'),\n rowSize: PropTypes.oneOf(['normal', 'compact']).description('size of the row').defaultValue('normal'),\n labelOverflow: PropTypes.oneOf(['wrap', 'wrap-all', 'truncate'])\n .description('label truncation preference')\n .defaultValue('wrap'),\n width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('components width').defaultValue('100%'),\n height: PropTypes.oneOfType([PropTypes.number, PropTypes.string])\n .description('components height')\n .defaultValue('100%'),\n groupIcon: PropTypes.node.description('icon for groups'),\n itemIcon: PropTypes.node.description('icon for items'),\n searchQuery: PropTypes.string.description('search query value'),\n noItemsPlaceholder: PropTypes.string\n .description('message to be shown when there are no items in the treeview to be displayed')\n .defaultValue('No items found'),\n nameKey: PropTypes.string.description('property key to identifier for items labels').defaultValue('name'),\n highlightOnlyQuery: PropTypes.bool.description('whether to highlight results or not').defaultValue(false),\n} as WeakValidationMap<unknown>;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,iBAAiB;AAyGnB,MAAM,oBAAoB;AAAA,EAC/B,MAAM,UAAU;AAAA,IACd,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EACrD,aAAa,UAAU,OAAO,YAAY,oBAAoB;AAAA,EAC9D,oBAAoB,UAAU,OAC3B,YAAY,6EAA6E,EACzF,aAAa,gBAAgB;AAAA,EAChC,SAAS,UAAU,OAAO,YAAY,6CAA6C,EAAE,aAAa,MAAM;AAAA,EACxG,oBAAoB,UAAU,KAAK,YAAY,qCAAqC,EAAE,aAAa,KAAK;AAC1G;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/related-components/TreeViewSearchBar.tsx"],
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/related-components/TreeViewSearchBar.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React from 'react';\nimport { DSNavSearchBox } from '@elliemae/ds-form';\n\ninterface PropsT {\n handleChange: (opt: { target: { value: string } }) => void;\n onNext: () => void;\n onPrevious: () => void;\n onClear: () => void;\n currentResultIndex: number;\n totalResults: number;\n value: string;\n}\n\nexport const TreeViewSearchBar = (props: PropsT) => {\n const { handleChange, onNext, onPrevious, onClear, currentResultIndex, totalResults, value } = props;\n\n return (\n <DSNavSearchBox\n onChange={(v: string) => {\n handleChange({ target: { value: v } });\n }}\n onNext={onNext}\n onPrevious={onPrevious}\n onClear={onClear}\n currentResultIndex={currentResultIndex}\n totalResults={totalResults}\n value={value}\n />\n );\n};\n\n// TreeViewSearchBar.propTypes = {\n// value: PropTypes.string.isRequired,\n// handleChange: PropTypes.func.isRequired,\n// onNext: PropTypes.func.isRequired,\n// onPrevious: PropTypes.func.isRequired,\n// onClear: PropTypes.func.isRequired,\n// currentResultIndex: PropTypes.number.isRequired,\n// totalResults: PropTypes.number.isRequired,\n// };\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACkBnB;AAhBJ,SAAS,sBAAsB;AAYxB,MAAM,oBAAoB,CAAC,UAAkB;AAClD,QAAM,EAAE,cAAc,QAAQ,YAAY,SAAS,oBAAoB,cAAc,MAAM,IAAI;AAE/F,SACE;AAAA,IAAC;AAAA;AAAA,MACC,UAAU,CAAC,MAAc;AACvB,qBAAa,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,CAAC;AAAA,MACvC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,EACF;AAEJ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/array-helpers.tsx"],
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/array-helpers.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "// https://github.com/sindresorhus/array-move/blob/master/index.js\nexport const arrayMoveMutate = (array: unknown[], from: number, to: number) => {\n const startIndex = from < 0 ? array.length + from : from;\n\n if (startIndex >= 0 && startIndex < array.length) {\n const endIndex = to < 0 ? array.length + to : to;\n\n const [item] = array.splice(from, 1);\n array.splice(endIndex, 0, item);\n }\n};\n\nexport const arrayMove = (array: unknown[], from: number, to: number) => {\n const newArray = [...array];\n arrayMoveMutate(newArray, from, to);\n return newArray;\n};\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACChB,MAAM,kBAAkB,CAAC,OAAkB,MAAc,OAAe;AAC7E,QAAM,aAAa,OAAO,IAAI,MAAM,SAAS,OAAO;AAEpD,MAAI,cAAc,KAAK,aAAa,MAAM,QAAQ;AAChD,UAAM,WAAW,KAAK,IAAI,MAAM,SAAS,KAAK;AAE9C,UAAM,CAAC,IAAI,IAAI,MAAM,OAAO,MAAM,CAAC;AACnC,UAAM,OAAO,UAAU,GAAG,IAAI;AAAA,EAChC;AACF;AAEO,MAAM,YAAY,CAAC,OAAkB,MAAc,OAAe;AACvE,QAAM,WAAW,CAAC,GAAG,KAAK;AAC1B,kBAAgB,UAAU,MAAM,EAAE;AAClC,SAAO;AACT;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/group-expands-helpers.tsx"],
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/group-expands-helpers.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-params */\nimport { useCallback, useEffect } from 'react';\nimport type { DSTreeviewT } from '../react-desc-prop-types.js';\nimport type { DSTreeviewInternalsT } from '../sharedTypes.js';\n\nexport const updateExpandedState = (\n treeRoot: DSTreeviewT.Item['node'],\n onExpandChange: DSTreeviewT.Props['onExpandChange'] | null | undefined,\n) => {\n const shouldContinueWalking = true;\n const newExpandedHashMap: DSTreeviewT.ExpandedItems = { __ds_tree_root: true };\n treeRoot.walk((node) => {\n if (!node.isRoot() && node.model.isGroup && node.model.isExpanded) {\n newExpandedHashMap[node.model.id] = true;\n }\n return shouldContinueWalking;\n });\n if (onExpandChange) onExpandChange(newExpandedHashMap, null);\n};\n\nexport const toggleItemExpand = (\n itemToToggle: DSTreeviewT.Item,\n triggerTreeRerender: () => void,\n updateUserExpandedState: DSTreeviewInternalsT.CTX['updateUserExpandedState'],\n scrollTo: DSTreeviewT.ScrollToFunc = () => {},\n) => {\n const {\n node: {\n model: { isExpanded },\n },\n virtualIndex,\n } = itemToToggle;\n if (itemToToggle.node.model.isGroup) {\n itemToToggle.node.model.isExpanded = !isExpanded;\n updateUserExpandedState();\n triggerTreeRerender();\n setTimeout(() => {\n if (typeof virtualIndex === 'number') scrollTo(virtualIndex, { align: 'start' });\n });\n }\n};\n\nexport const expandItemModel = (modelToExpand: DSTreeviewT.Item['model']) => {\n if (modelToExpand.isGroup) modelToExpand.isExpanded = true;\n};\n\nexport const collapseItemModel = (modelToCollapse: DSTreeviewT.Item['model']) => {\n if (modelToCollapse.isGroup) modelToCollapse.isExpanded = false;\n};\n\nexport const expandAll = (treeRoot: DSTreeviewT.Item['node'], triggerTreeRerender: () => void) => {\n const shouldContinueWalking = true;\n treeRoot.walk((node) => {\n if (!node.isRoot()) expandItemModel(node.model);\n return shouldContinueWalking;\n });\n triggerTreeRerender();\n};\n\nexport const collapseAll = (treeRoot: DSTreeviewT.Item['node'], triggerTreeRerender: () => void) => {\n const shouldContinueWalking = true; // tree-model ask we return true if we want to continue walking\n treeRoot.walk((node) => {\n if (!node.isRoot()) collapseItemModel(node.model);\n return shouldContinueWalking;\n });\n triggerTreeRerender();\n};\n\nexport const getToggleExpandShouldExpand = (treeRoot: DSTreeviewT.Item['node']) => {\n let shouldExpand = false;\n const shouldContinueWalking = true; // tree-model ask we return true if we want to continue walking\n treeRoot.walk((node) => {\n if (!node.isRoot()) {\n if (!node.model.isExpanded && node.model.isGroup) {\n shouldExpand = true;\n // eslint-disable-next-line no-useless-return\n return shouldContinueWalking;\n }\n }\n return shouldContinueWalking;\n });\n return shouldExpand;\n};\n\nexport const toggleExpandAllHelper = (\n isExpand: boolean | 'toggle',\n treeRoot: DSTreeviewT.Item['node'],\n triggerTreeRerender: () => void,\n setLatestToggledItem: DSTreeviewInternalsT.CTX['setLatestToggledItem'],\n updateUserExpandedState: DSTreeviewInternalsT.CTX['updateUserExpandedState'],\n) => {\n if (isExpand === true) expandAll(treeRoot, triggerTreeRerender);\n else if (isExpand === false) collapseAll(treeRoot, triggerTreeRerender);\n else {\n const shouldExpand = getToggleExpandShouldExpand(treeRoot);\n if (shouldExpand === true) expandAll(treeRoot, triggerTreeRerender);\n else collapseAll(treeRoot, triggerTreeRerender);\n }\n setLatestToggledItem(null);\n updateUserExpandedState();\n};\n\nexport const useNotifyExpandedChange = (\n propsWithDefaults: DSTreeviewT.Props,\n {\n latestToggledItem,\n expandedGroups,\n }: {\n latestToggledItem?: DSTreeviewInternalsT.CTX['latestToggledItem'];\n expandedGroups?: DSTreeviewInternalsT.CTX['expandedGroups'];\n },\n) => {\n const notifyExpandedChange = useCallback(\n (expandedGroupHashmap?: DSTreeviewInternalsT.CTX['expandedGroups']) =>\n propsWithDefaults?.onExpandChange(expandedGroupHashmap || {}, latestToggledItem),\n [propsWithDefaults, latestToggledItem],\n );\n\n useEffect(() => {\n if (!propsWithDefaults.expanded) notifyExpandedChange(expandedGroups);\n }, [expandedGroups, notifyExpandedChange, propsWithDefaults.expanded]);\n};\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,aAAa,iBAAiB;AAIhC,MAAM,sBAAsB,CACjC,UACA,mBACG;AACH,QAAM,wBAAwB;AAC9B,QAAM,qBAAgD,EAAE,gBAAgB,KAAK;AAC7E,WAAS,KAAK,CAAC,SAAS;AACtB,QAAI,CAAC,KAAK,OAAO,KAAK,KAAK,MAAM,WAAW,KAAK,MAAM,YAAY;AACjE,yBAAmB,KAAK,MAAM,EAAE,IAAI;AAAA,IACtC;AACA,WAAO;AAAA,EACT,CAAC;AACD,MAAI;AAAgB,mBAAe,oBAAoB,IAAI;AAC7D;AAEO,MAAM,mBAAmB,CAC9B,cACA,qBACA,yBACA,WAAqC,MAAM;AAAC,MACzC;AACH,QAAM;AAAA,IACJ,MAAM;AAAA,MACJ,OAAO,EAAE,WAAW;AAAA,IACtB;AAAA,IACA;AAAA,EACF,IAAI;AACJ,MAAI,aAAa,KAAK,MAAM,SAAS;AACnC,iBAAa,KAAK,MAAM,aAAa,CAAC;AACtC,4BAAwB;AACxB,wBAAoB;AACpB,eAAW,MAAM;AACf,UAAI,OAAO,iBAAiB;AAAU,iBAAS,cAAc,EAAE,OAAO,QAAQ,CAAC;AAAA,IACjF,CAAC;AAAA,EACH;AACF;AAEO,MA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uBAAuB;AAAA,IAC3B,CAAC,yBACC,mBAAmB,eAAe,wBAAwB,CAAC,GAAG,iBAAiB;AAAA,IACjF,CAAC,mBAAmB,iBAAiB;AAAA,EACvC;AAEA,YAAU,MAAM;AACd,QAAI,CAAC,kBAAkB;AAAU,2BAAqB,cAAc;AAAA,EACtE,GAAG,CAAC,gBAAgB,sBAAsB,kBAAkB,QAAQ,CAAC;AACvE;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/keyboard-helpers.tsx"],
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/keyboard-helpers.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-params */\n/* eslint-disable max-lines */\n/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport { useCallback, useContext, useEffect } from 'react';\nimport TreeViewContext from '../TreeViewContext.js';\nimport { focusItem } from './tree-helpers.js';\nimport { toggleExpandAllHelper, toggleItemExpand } from './group-expands-helpers.js';\nimport type { DSTreeviewT } from '../react-desc-prop-types.js';\nimport type { DSTreeviewInternalsT } from '../sharedTypes.js';\nimport type { SortableItemContextType } from '../hoc/SortableItemContext.js';\n\n// 9 tab\n// 13 enter\n// 32 space\n// 37 left arrow\n// 38 up arrow\n// 39 right arrow\n// 40 down arrow\n// 35 end\n// 36 home\n\n// 56 number 8\n// 106 (NumPad) *\n\nexport const useOnItemKeyDown = (item: DSTreeviewT.Item, draggableProps: SortableItemContextType['draggableProps']) => {\n const ctx = useContext(TreeViewContext);\n const {\n props: { onItemFocus, onItemActivate },\n triggerTreeRerender,\n visibleItems,\n setFocusedItem,\n setSelectedItem,\n setLatestToggledItem,\n updateUserExpandedState,\n virtualListHelpers: { scrollToIndex },\n } = ctx;\n const { isGroup, isExpanded } = item;\n const onItemFocusCurry = useCallback(\n (newFocusItem: DSTreeviewT.Item) =>\n onItemFocus({\n itemIndex: newFocusItem.virtualIndex as number,\n scrollToItem: (opts = { align: 'start' }) => scrollToIndex(newFocusItem.virtualIndex as number, opts),\n item: newFocusItem,\n }),\n [onItemFocus, scrollToIndex],\n );\n\n const onItemKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLLIElement>) => {\n const { key } = e;\n if (!(draggableProps && draggableProps.active)) {\n // intercept \"Scroll\" keys to prevent scrolling the page when item is focused\n if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(key)) e.preventDefault();\n if ([' ', 'Space', 'Enter'].includes(key) && (e.target as HTMLElement).tagName === 'LI') {\n setSelectedItem(item);\n onItemActivate(item, e);\n }\n\n if (key === 'ArrowLeft') {\n if (isGroup && isExpanded) {\n toggleItemExpand(item, triggerTreeRerender, updateUserExpandedState, scrollToIndex);\n setLatestToggledItem(item);\n }\n }\n if (key === 'ArrowRight') {\n if (isGroup && !isExpanded) {\n toggleItemExpand(item, triggerTreeRerender, updateUserExpandedState, scrollToIndex);\n setLatestToggledItem(item);\n }\n }\n\n const { virtualIndex } = item;\n if (typeof virtualIndex === 'number') {\n const lastItemIndex = visibleItems.length - 1;\n if (key === 'ArrowUp') {\n const isLoopedFocus = virtualIndex === 0;\n const newFocusIndex = isLoopedFocus ? lastItemIndex : virtualIndex - 1;\n const newFocusItem = visibleItems[newFocusIndex];\n scrollToIndex(newFocusIndex);\n if (isLoopedFocus) {\n // when looping the list from start to end we need to wait a bit before focusing\n setTimeout(() => {\n setFocusedItem(newFocusItem);\n focusItem(newFocusItem);\n onItemFocusCurry(newFocusItem);\n }, 300);\n } else {\n setFocusedItem(newFocusItem);\n onItemFocusCurry(newFocusItem);\n focusItem(newFocusItem);\n }\n }\n if (key === 'ArrowDown') {\n const isLoopedFocus = virtualIndex === lastItemIndex;\n const newFocusIndex = isLoopedFocus ? 0 : virtualIndex + 1;\n const newFocusItem = visibleItems[newFocusIndex];\n scrollToIndex(newFocusIndex);\n if (isLoopedFocus) {\n // when looping the list from start to end we need to wait a bit before focusing\n setTimeout(() => {\n setFocusedItem(newFocusItem);\n onItemFocusCurry(newFocusItem);\n focusItem(newFocusItem);\n }, 300);\n } else {\n setFocusedItem(newFocusItem);\n onItemFocusCurry(newFocusItem);\n focusItem(newFocusItem);\n }\n }\n if (key === 'End') {\n if (virtualIndex !== lastItemIndex) {\n const newFocusItem = visibleItems[lastItemIndex];\n scrollToIndex(lastItemIndex);\n setTimeout(() => {\n setFocusedItem(newFocusItem);\n onItemFocusCurry(newFocusItem);\n focusItem(newFocusItem);\n }, 300);\n }\n }\n if (key === 'Home') {\n if (virtualIndex !== 0) {\n const newFocusItem = visibleItems[0];\n scrollToIndex(0);\n setTimeout(() => {\n setFocusedItem(newFocusItem);\n onItemFocusCurry(newFocusItem);\n focusItem(newFocusItem);\n }, 300);\n }\n }\n }\n }\n },\n [\n draggableProps,\n item,\n setSelectedItem,\n onItemActivate,\n isGroup,\n isExpanded,\n triggerTreeRerender,\n updateUserExpandedState,\n scrollToIndex,\n setLatestToggledItem,\n visibleItems,\n setFocusedItem,\n onItemFocusCurry,\n ],\n );\n\n return onItemKeyDown;\n};\n\nexport const useGlobalKeyboardListener = (func: (e: KeyboardEvent) => void) => {\n useEffect(() => {\n document.addEventListener('keydown', func);\n return () => document.removeEventListener('keydown', func);\n }, [func]);\n};\n\nexport const useGlobalToggleAllExpandShortcut = (\n treeRoot: DSTreeviewT.Item['node'],\n triggerTreeRerender: () => void,\n setLatestToggledItem: DSTreeviewInternalsT.CTX['setLatestToggledItem'],\n updateUserExpandedState: DSTreeviewInternalsT.CTX['updateUserExpandedState'],\n) => {\n const memoizedToggleAllKeyboardShortcut = useCallback(\n (e: KeyboardEvent) => {\n const { key } = e;\n if (key === '*') {\n toggleExpandAllHelper('toggle', treeRoot, triggerTreeRerender, setLatestToggledItem, updateUserExpandedState);\n }\n },\n [setLatestToggledItem, treeRoot, triggerTreeRerender, updateUserExpandedState],\n );\n\n return useGlobalKeyboardListener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AC;AACnC,4BAAc,CAAC;AACf,yBAAW,MAAM;AACf,+BAAe,YAAY;AAC3B,iCAAiB,YAAY;AAC7B,0BAAU,YAAY;AAAA,cACxB,GAAG,GAAG;AAAA,YACR;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;AAEO,MAAM,4BAA4B,CAAC,SAAqC;AAC7E,YAAU,MAAM;AACd,aAAS,iBAAiB,WAAW,IAAI;AACzC,WAAO,MAAM,SAAS,oBAAoB,WAAW,IAAI;AAAA,EAC3D,GAAG,CAAC,IAAI,CAAC;AACX;AAEO,MAAM,mCAAmC,CAC9C,UACA,qBACA,sBACA,4BACG;AACH,QAAM,oCAAoC;AAAA,IACxC,CAAC,MAAqB;AACpB,YAAM,EAAE,IAAI,IAAI;AAChB,UAAI,QAAQ,KAAK;AACf,8BAAsB,UAAU,UAAU,qBAAqB,sBAAsB,uBAAuB;AAAA,MAC9G;AAAA,IACF;AAAA,IACA,CAAC,sBAAsB,UAAU,qBAAqB,uBAAuB;AAAA,EAC/E;AAEA,SAAO,0BAA0B,iCAAiC;AACpE;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/object-helpers.tsx"],
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/object-helpers.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-sequences */\n/* eslint-disable no-return-assign */\n/* eslint-disable no-restricted-syntax */\n/* eslint-disable guard-for-in */\n\nfunction isObjectADate(o: string | number | unknown[] | Date | null | undefined | Record<string, unknown>): o is Date {\n return o?.constructor?.name === 'Date';\n}\nfunction isObjectAnArray(\n o: string | number | unknown[] | Date | null | undefined | Record<string, unknown>,\n): o is unknown[] {\n return Array.isArray(o);\n}\nfunction isObjectAString(\n o: string | number | unknown[] | Date | null | undefined | Record<string, unknown>,\n): o is Record<string, unknown> {\n return typeof o === 'object';\n}\n\nexport const unfreeze = (o: string | number | unknown[] | Date | null | undefined | Record<string, unknown>) => {\n let oo: string | number | unknown[] | Date | null | undefined | Record<string, unknown>;\n if (o === null) {\n oo = null;\n } else if (o === undefined) {\n oo = undefined;\n } else if (isObjectADate(o)) {\n oo = new Date(o);\n } else if (isObjectAnArray(o)) {\n oo = [];\n o.forEach((v) => {\n (oo as unknown[]).push(v);\n });\n } else if (isObjectAString(o)) {\n oo = String(o);\n } else if (isObjectAString(o)) {\n oo = {};\n for (const property in o) {\n oo[property] = o[property];\n }\n } else {\n oo = o;\n }\n return oo;\n};\n\ntype GenericItemT<T = unknown> = { [key: string]: T };\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function filterObject<T = unknown>(obj: GenericItemT<T>, predicate: (val: T) => boolean) {\n return Object.keys(obj).reduce<GenericItemT<T>>((res, key) => {\n if (predicate(obj[key])) res[key] = obj[key];\n return res;\n }, {} as GenericItemT<T>);\n}\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACKvB,SAAS,cAAc,GAA+F;AACpH,SAAO,GAAG,aAAa,SAAS;AAClC;AACA,SAAS,gBACP,GACgB;AAChB,SAAO,MAAM,QAAQ,CAAC;AACxB;AACA,SAAS,gBACP,GAC8B;AAC9B,SAAO,OAAO,MAAM;AACtB;AAEO,MAAM,WAAW,CAAC,MAAuF;AAC9G,MAAI;AACJ,MAAI,MAAM,MAAM;AACd,SAAK;AAAA,EACP,WAAW,MAAM,QAAW;AAC1B,SAAK;AAAA,EACP,WAAW,cAAc,CAAC,GAAG;AAC3B,SAAK,IAAI,KAAK,CAAC;AAAA,EACjB,WAAW,gBAAgB,CAAC,GAAG;AAC7B,SAAK,CAAC;AACN,MAAE,QAAQ,CAAC,MAAM;AACf,MAAC,GAAiB,KAAK,CAAC;AAAA,IAC1B,CAAC;AAAA,EACH,WAAW,gBAAgB,CAAC,GAAG;AAC7B,SAAK,OAAO,CAAC;AAAA,EACf,WAAW,gBAAgB,CAAC,GAAG;AAC7B,SAAK,CAAC;AACN,eAAW,YAAY,GAAG;AACxB,SAAG,QAAQ,IAAI,EAAE,QAAQ;AAAA,IAC3B;AAAA,EACF,OAAO;AACL,SAAK;AAAA,EACP;AACA,SAAO;AACT;AAIO,SAAS,aAA0B,KAAsB,WAAgC;AAC9F,SAAO,OAAO,KAAK,GAAG,EAAE,OAAwB,CAAC,KAAK,QAAQ;AAC5D,QAAI,UAAU,IAAI,GAAG,CAAC;AAAG,UAAI,GAAG,IAAI,IAAI,GAAG;AAC3C,WAAO;AAAA,EACT,GAAG,CAAC,CAAoB;AAC1B;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/refs-helpers.tsx"],
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/refs-helpers.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "// allow multiple refs to be set to point to the same DOM element\ntype GenericMergeableRef = null | undefined | React.MutableRefObject<unknown> | ((ref: HTMLElement) => void) | false;\nexport const setMultipleRefs = (...refs: GenericMergeableRef[]): ((ref: HTMLElement) => void) => {\n const filteredRefs = refs.filter(Boolean);\n if (!filteredRefs.length) return () => {};\n if (filteredRefs.length === 0) return () => {};\n\n return (newRef) => {\n filteredRefs.forEach((refToBeUpdated) => {\n if (typeof refToBeUpdated === 'function') {\n refToBeUpdated(newRef);\n } else if (refToBeUpdated) {\n refToBeUpdated.current = newRef;\n }\n });\n };\n};\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACEhB,MAAM,kBAAkB,IAAI,SAA8D;AAC/F,QAAM,eAAe,KAAK,OAAO,OAAO;AACxC,MAAI,CAAC,aAAa;AAAQ,WAAO,MAAM;AAAA,IAAC;AACxC,MAAI,aAAa,WAAW;AAAG,WAAO,MAAM;AAAA,IAAC;AAE7C,SAAO,CAAC,WAAW;AACjB,iBAAa,QAAQ,CAAC,mBAAmB;AACvC,UAAI,OAAO,mBAAmB,YAAY;AACxC,uBAAe,MAAM;AAAA,MACvB,WAAW,gBAAgB;AACzB,uBAAe,UAAU;AAAA,MAC3B;AAAA,IACF,CAAC;AAAA,EACH;AACF;",
6
6
  "names": []
@@ -30,12 +30,13 @@ const selectCheckboxItemModelParentsTillRoot = (modelToCheck, triggerTreeRerende
30
30
  triggerTreeRerender();
31
31
  return newSelections;
32
32
  };
33
- const toggleCheckboxItem = (itemToSelect, triggerTreeRerender = null) => {
33
+ const toggleCheckboxItem = (itemToSelect, currentlySelectedCheckboxes, triggerTreeRerender = null) => {
34
34
  const {
35
35
  node: {
36
- model: { id, isChecked, children = [] }
36
+ model: { id, children = [] }
37
37
  }
38
38
  } = itemToSelect;
39
+ const isChecked = currentlySelectedCheckboxes[id];
39
40
  const newSelections = {};
40
41
  const nextState = isChecked === "mixed" ? true : !isChecked;
41
42
  itemToSelect.node.model.isChecked = nextState;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/selectable-helper.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-params */\nimport { walkParents, walkAllNodeChildren } from './tree-helpers.js';\nimport type { DSTreeviewT } from '../react-desc-prop-types.js';\n\nexport const getGroupCheckState = (node: DSTreeviewT.Item['node']) => {\n let childAllChecked = true;\n let anyChildChecked = false;\n walkAllNodeChildren(node, (childNode) => {\n const {\n model: { isChecked },\n } = childNode;\n if (isChecked === 'mixed' || isChecked === true) anyChildChecked = true;\n else childAllChecked = false;\n });\n\n if (childAllChecked) return true;\n if (anyChildChecked) return 'mixed';\n return false;\n};\n\nexport const selectCheckboxItemModelParentsTillRoot = (\n modelToCheck: DSTreeviewT.Item,\n triggerTreeRerender: (() => void) | null = null,\n) => {\n const newSelections: DSTreeviewT.SelectionItems = {};\n const { nodePath } = modelToCheck;\n walkParents(nodePath, (parentNode) => {\n const nextState = getGroupCheckState(parentNode);\n parentNode.model.isChecked = nextState;\n newSelections[parentNode.model.id] = nextState;\n });\n if (triggerTreeRerender) triggerTreeRerender();\n return newSelections;\n};\n\nexport const toggleCheckboxItem = (itemToSelect: DSTreeviewT.Item, triggerTreeRerender: (() => void) | null = null) => {\n const {\n node: {\n model: { id, isChecked, children = [] },\n },\n } = itemToSelect;\n\n const newSelections: DSTreeviewT.SelectionItems = {};\n // 'mixed' -> true -> false -> true [...->false -> true]\n const nextState = isChecked === 'mixed' ? true : !isChecked;\n itemToSelect.node.model.isChecked = nextState;\n newSelections[id] = nextState;\n\n if (children.length > 0 && (nextState === true || nextState === false)) {\n walkAllNodeChildren(itemToSelect.node, (childNode) => {\n childNode.model.isChecked = nextState;\n newSelections[childNode.model.id] = nextState;\n });\n }\n\n const parentsNewSelections = selectCheckboxItemModelParentsTillRoot(itemToSelect);\n\n if (triggerTreeRerender) triggerTreeRerender();\n return { ...parentsNewSelections, ...newSelections };\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,aAAa,2BAA2B;AAG1C,MAAM,qBAAqB,CAAC,SAAmC;AACpE,MAAI,kBAAkB;AACtB,MAAI,kBAAkB;AACtB,sBAAoB,MAAM,CAAC,cAAc;AACvC,UAAM;AAAA,MACJ,OAAO,EAAE,UAAU;AAAA,IACrB,IAAI;AACJ,QAAI,cAAc,WAAW,cAAc;AAAM,wBAAkB;AAAA;AAC9D,wBAAkB;AAAA,EACzB,CAAC;AAED,MAAI;AAAiB,WAAO;AAC5B,MAAI;AAAiB,WAAO;AAC5B,SAAO;AACT;AAEO,MAAM,yCAAyC,CACpD,cACA,sBAA2C,SACxC;AACH,QAAM,gBAA4C,CAAC;AACnD,QAAM,EAAE,SAAS,IAAI;AACrB,cAAY,UAAU,CAAC,eAAe;AACpC,UAAM,YAAY,mBAAmB,UAAU;AAC/C,eAAW,MAAM,YAAY;AAC7B,kBAAc,WAAW,MAAM,EAAE,IAAI;AAAA,EACvC,CAAC;AACD,MAAI;AAAqB,wBAAoB;AAC7C,SAAO;AACT;AAEO,MAAM,qBAAqB,CAAC,cAAgC,sBAA2C,SAAS;AACrH,QAAM;AAAA,IACJ,MAAM;AAAA,MACJ,OAAO,EAAE,IAAI,WAAW,WAAW,CAAC,EAAE;AAAA,IACxC;AAAA,EACF,IAAI;AAEJ,QAAM,gBAA4C,CAAC;AAEnD,QAAM,YAAY,cAAc,UAAU,OAAO,CAAC;AAClD,eAAa,KAAK,MAAM,YAAY;AACpC,gBAAc,EAAE,IAAI;AAEpB,MAAI,SAAS,SAAS,MAAM,cAAc,QAAQ,cAAc,QAAQ;AACtE,wBAAoB,aAAa,MAAM,CAAC,cAAc;AACpD,gBAAU,MAAM,YAAY;AAC5B,oBAAc,UAAU,MAAM,EAAE,IAAI;AAAA,IACtC,CAAC;AAAA,EACH;AAEA,QAAM,uBAAuB,uCAAuC,YAAY;AAEhF,MAAI;AAAqB,wBAAoB;AAC7C,SAAO,EAAE,GAAG,sBAAsB,GAAG,cAAc;AACrD;",
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/selectable-helper.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-params */\nimport { walkParents, walkAllNodeChildren } from './tree-helpers.js';\nimport type { DSTreeviewT } from '../react-desc-prop-types.js';\n\nexport const getGroupCheckState = (node: DSTreeviewT.Item['node']) => {\n let childAllChecked = true;\n let anyChildChecked = false;\n walkAllNodeChildren(node, (childNode) => {\n const {\n model: { isChecked },\n } = childNode;\n if (isChecked === 'mixed' || isChecked === true) anyChildChecked = true;\n else childAllChecked = false;\n });\n\n if (childAllChecked) return true;\n if (anyChildChecked) return 'mixed';\n return false;\n};\n\nexport const selectCheckboxItemModelParentsTillRoot = (\n modelToCheck: DSTreeviewT.Item,\n triggerTreeRerender: (() => void) | null = null,\n) => {\n const newSelections: DSTreeviewT.SelectionItems = {};\n const { nodePath } = modelToCheck;\n walkParents(nodePath, (parentNode) => {\n const nextState = getGroupCheckState(parentNode);\n parentNode.model.isChecked = nextState;\n newSelections[parentNode.model.id] = nextState;\n });\n if (triggerTreeRerender) triggerTreeRerender();\n return newSelections;\n};\n\nexport const toggleCheckboxItem = (\n itemToSelect: DSTreeviewT.Item,\n currentlySelectedCheckboxes: DSTreeviewT.SelectionItems,\n triggerTreeRerender: (() => void) | null = null,\n) => {\n const {\n node: {\n model: { id, children = [] },\n },\n } = itemToSelect;\n const isChecked = currentlySelectedCheckboxes[id];\n\n const newSelections: DSTreeviewT.SelectionItems = {};\n // 'mixed' -> true -> false -> true [...->false -> true]\n const nextState = isChecked === 'mixed' ? true : !isChecked;\n itemToSelect.node.model.isChecked = nextState;\n newSelections[id] = nextState;\n\n if (children.length > 0 && (nextState === true || nextState === false)) {\n walkAllNodeChildren(itemToSelect.node, (childNode) => {\n childNode.model.isChecked = nextState;\n newSelections[childNode.model.id] = nextState;\n });\n }\n\n const parentsNewSelections = selectCheckboxItemModelParentsTillRoot(itemToSelect);\n\n if (triggerTreeRerender) triggerTreeRerender();\n return { ...parentsNewSelections, ...newSelections };\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,aAAa,2BAA2B;AAG1C,MAAM,qBAAqB,CAAC,SAAmC;AACpE,MAAI,kBAAkB;AACtB,MAAI,kBAAkB;AACtB,sBAAoB,MAAM,CAAC,cAAc;AACvC,UAAM;AAAA,MACJ,OAAO,EAAE,UAAU;AAAA,IACrB,IAAI;AACJ,QAAI,cAAc,WAAW,cAAc;AAAM,wBAAkB;AAAA;AAC9D,wBAAkB;AAAA,EACzB,CAAC;AAED,MAAI;AAAiB,WAAO;AAC5B,MAAI;AAAiB,WAAO;AAC5B,SAAO;AACT;AAEO,MAAM,yCAAyC,CACpD,cACA,sBAA2C,SACxC;AACH,QAAM,gBAA4C,CAAC;AACnD,QAAM,EAAE,SAAS,IAAI;AACrB,cAAY,UAAU,CAAC,eAAe;AACpC,UAAM,YAAY,mBAAmB,UAAU;AAC/C,eAAW,MAAM,YAAY;AAC7B,kBAAc,WAAW,MAAM,EAAE,IAAI;AAAA,EACvC,CAAC;AACD,MAAI;AAAqB,wBAAoB;AAC7C,SAAO;AACT;AAEO,MAAM,qBAAqB,CAChC,cACA,6BACA,sBAA2C,SACxC;AACH,QAAM;AAAA,IACJ,MAAM;AAAA,MACJ,OAAO,EAAE,IAAI,WAAW,CAAC,EAAE;AAAA,IAC7B;AAAA,EACF,IAAI;AACJ,QAAM,YAAY,4BAA4B,EAAE;AAEhD,QAAM,gBAA4C,CAAC;AAEnD,QAAM,YAAY,cAAc,UAAU,OAAO,CAAC;AAClD,eAAa,KAAK,MAAM,YAAY;AACpC,gBAAc,EAAE,IAAI;AAEpB,MAAI,SAAS,SAAS,MAAM,cAAc,QAAQ,cAAc,QAAQ;AACtE,wBAAoB,aAAa,MAAM,CAAC,cAAc;AACpD,gBAAU,MAAM,YAAY;AAC5B,oBAAc,UAAU,MAAM,EAAE,IAAI;AAAA,IACtC,CAAC;AAAA,EACH;AAEA,QAAM,uBAAuB,uCAAuC,YAAY;AAEhF,MAAI;AAAqB,wBAAoB;AAC7C,SAAO,EAAE,GAAG,sBAAsB,GAAG,cAAc;AACrD;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/string-helpers.tsx"],
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/string-helpers.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const standardizeSearchQueryString = (input: string) => input.trim().toLowerCase();\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,+BAA+B,CAAC,UAAkB,MAAM,KAAK,EAAE,YAAY;",
6
6
  "names": []
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/tree-helpers.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable max-params */\n/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport { createRef } from 'react';\nimport type TreeModel from 'tree-model';\nimport { standardizeSearchQueryString } from './string-helpers.js';\nimport type { DSTreeviewT } from '../react-desc-prop-types.js';\n\nexport const walkVisibles = (\n node: DSTreeviewT.Item['node'],\n callback: (node: DSTreeviewT.Item['node']) => void,\n skipRoot = true,\n highlightOnlyQuery = false,\n) => {\n const { children, model } = node;\n const { name, isExpanded, childrenMatchesSearchQuery, matchesSearchQuery } = model;\n\n const shouldSkipBecauseIsRoot = skipRoot && name === '__root';\n const queryRestrictionsPassed = !!(highlightOnlyQuery || childrenMatchesSearchQuery || matchesSearchQuery);\n\n if (!shouldSkipBecauseIsRoot && queryRestrictionsPassed) callback(node);\n\n const shouldWalkChildren = !!(children.length > 0 && isExpanded && queryRestrictionsPassed);\n if (shouldWalkChildren) {\n children.forEach((childNode) => {\n walkVisibles(childNode, callback, skipRoot, highlightOnlyQuery);\n });\n }\n};\n\nexport const walkParents = (\n nodePath: DSTreeviewT.Item['nodePath'],\n callback: (currParent: DSTreeviewT.Item['node']) => void,\n skipRoot = true,\n) => {\n const parents = [...nodePath].reverse();\n parents.shift(); // remove current node from the parents array\n if (skipRoot) parents.pop(); // remove the root from the parents if skipping root\n parents.forEach(callback);\n};\n\ntype RecursiveCallbackT = (childNode: DSTreeviewT.Item['node'], cb?: RecursiveCallbackT, isFirst?: boolean) => void;\nexport const walkAllNodeChildren = (node: DSTreeviewT.Item['node'], callback: RecursiveCallbackT, isFirst = true) => {\n const { children = [] } = node;\n const shouldWalkChildren = children.length;\n\n if (!isFirst) callback(node);\n\n if (shouldWalkChildren) {\n children.forEach((childNode) => {\n walkAllNodeChildren(childNode, callback, false);\n });\n }\n};\n\nexport const getNodeById = (treeRoot: DSTreeviewT.Item['node'], id: DSTreeviewT.StringOrNum) => {\n const nodes = treeRoot.all((node) => (node as unknown as DSTreeviewT.Item).model.id === id);\n return nodes[0];\n};\n\nexport const cloneNode = (tree: TreeModel, node: DSTreeviewT.Item) => tree.parse(node.model);\n\nexport const itemsShareSameParent = (items: DSTreeviewT.Item[] = []) => {\n if (items.length === 0) throw new Error('Received empty items for comparison');\n if (items.length === 1) return true;\n\n // when moving in first position we receive [undefined,...{items}]\n // when moving in last position we receive [...{items}, undefined]\n const firstExistingItem = items.find((item) => !!item);\n if (!firstExistingItem) throw new Error(\"Received no items, can't retrieve parent\");\n\n const firstExistingItemPath = firstExistingItem.node.getPath();\n // path is like [rootParent, ...[parentsNodes], currentNode]\n // length -1 is the current-node\n // length -2 is the parent-node\n // root node is not printed and is always present so minimum path length is 2 (root + currentNode)\n const directParentNode = firstExistingItemPath[firstExistingItemPath.length - 2];\n\n return items.every((item) => {\n // undefined nodes count as having the same parent\n if (!item) return true;\n const itemPath = item.node.getPath();\n const itemDirectParent = itemPath[itemPath.length - 2];\n return directParentNode === itemDirectParent;\n });\n};\n\nexport const getItemsParentNode = (items: DSTreeviewT.Item[] = [], skipSameParentCheck = false) => {\n if (items.length === 0) throw new Error(\"Received empty items, can't retrieve parent\");\n\n // in case we already know the items compared shares the same parent\n if (!skipSameParentCheck)\n if (!itemsShareSameParent(items))\n // if we don't know (default, we don't) check if they share the parent\n throw new Error(\"Received items don't share the same parent, can't retrieve parent\");\n\n // when moving in first position we receive [undefined,...{items}]\n // when moving in last position we receive [...{items}, undefined]\n const firstExistingItem = items.find((item) => !!item);\n if (!firstExistingItem) throw new Error(\"Received no items, can't retrieve parent\");\n\n const firstExistingItemPath = firstExistingItem.node.getPath();\n // path is like [rootParent, ...[parentsNodes], currentNode]\n // length -1 is the current-node\n // length -2 is the parent-node\n // root node is not printed and is always present so minimum path length is 2 (root + currentNode)\n const directParentNode = firstExistingItemPath[firstExistingItemPath.length - 2];\n return directParentNode as unknown as DSTreeviewT.Item['node'];\n};\n\nexport const getNodeMatchesSearchQuery = (node: DSTreeviewT.Item['node'], searchQuery = '') => {\n const standardizedName = standardizeSearchQueryString(node.model.name);\n const standardizedSearchQuery = standardizeSearchQueryString(searchQuery);\n return standardizedName.includes(standardizedSearchQuery);\n};\n\nexport const getChildrenMatchesSearchQuery = (parentNode: DSTreeviewT.Item['node'], searchQuery = '') => {\n let anyChildMatch = false;\n walkAllNodeChildren(parentNode, (node) => {\n if (getNodeMatchesSearchQuery(node, searchQuery)) anyChildMatch = true;\n });\n return anyChildMatch;\n};\n\n/**\n * Mutate in place a node from tree-model normalizing object properties like \"isGroup\" even if user didn't specify it explicitly,\n * after execution the node will have \"nodePath\" \"treeDepth\" \"nodeItemRef\" \"isGroup\" \"isExpanded\"\n * (optionally, based on the provided arguments) \"matchesSearchQuery\" \"childrenMatchesSearchQuery\" \"isChecked\"\n *\n * @param {object} node - node (based on 'tree-model' lib) that you wish to mutate with extra props\n * @param {string} [searchQuery=''] - optional string used to parse \"matchesSearchQuery\"/\"childrenMatchesSearchQuery\" properties\n * @param {object} [selection=null] - optional selection hashmap used to parse \"isChecked\" properties\n * @param {object} [expanded=null] - optional expanded hashmap used to parse \"isExpanded\" properties\n */\nexport const enrichNodeModelInPlace = (\n node: TreeModel.Node<DSTreeviewT.SimpleItem>,\n searchQuery = '',\n selection: DSTreeviewT.SelectionItems | null = null,\n expanded: DSTreeviewT.ExpandedItems | null = null,\n) => {\n const path = node.getPath();\n const depth = path.length - 1;\n node.model.nodePath = path;\n node.model.treeDepth = depth;\n\n if (!node.model.nodeItemRef) {\n node.model.nodeItemRef = createRef();\n }\n\n // if a node has children but was not marked as isGroup, force-mark as group\n // this is useful to avoid having to always check both the flag and the children.length...\n if (typeof node.model.isGroup !== 'boolean' && (node.model?.children?.length ?? 0) > 0) {\n node.model.isGroup = true;\n }\n\n if (node.model.isGroup && node.model.id !== '__ds_tree_root') {\n if (expanded) node.model.isExpanded = !!expanded[node.model.id];\n else if (typeof node.model.isExpanded !== 'boolean') {\n node.model.isExpanded = false;\n }\n }\n\n node.model.matchesSearchQuery = true;\n node.model.childrenMatchesSearchQuery = false;\n const partiallyEnrichedNode = node as unknown as TreeModel.Node<DSTreeviewT.Item>;\n if (searchQuery) {\n partiallyEnrichedNode.model.matchesSearchQuery = getNodeMatchesSearchQuery(partiallyEnrichedNode, searchQuery);\n\n if (partiallyEnrichedNode.model.isGroup === true) {\n partiallyEnrichedNode.model.childrenMatchesSearchQuery = getChildrenMatchesSearchQuery(\n partiallyEnrichedNode,\n searchQuery,\n );\n if (partiallyEnrichedNode.model.childrenMatchesSearchQuery) partiallyEnrichedNode.model.isExpanded = true;\n }\n }\n if (selection && selection[partiallyEnrichedNode.model.id]) {\n partiallyEnrichedNode.model.isChecked = selection[partiallyEnrichedNode.model.id];\n }\n};\n\nexport const focusItem = (item: DSTreeviewT.Item | null) => {\n item?.nodeItemRef?.current?.focus();\n};\n\nexport const flattenTreeForDnD = (\n data: TreeModel.Node<DSTreeviewT.Item>,\n shouldDescend: (datum: TreeModel.Node<DSTreeviewT.Item>) => boolean = () => true,\n) => {\n const flattenedTree: DSTreeviewT.DndItem[] = [];\n let index = 0;\n const doit = (node: TreeModel.Node<DSTreeviewT.Item>, depth = 0, parentId: DSTreeviewT.StringOrNum | null = null) => {\n flattenedTree.push({\n uid: node.model.id.toString(),\n depth,\n realIndex: index,\n childrenCount: node.children?.length ?? 0,\n parentId: parentId !== null ? parentId.toString() : null,\n original: { ...node, ...node.model, node },\n });\n index += 1;\n if (shouldDescend(node)) node.children?.forEach((child) => doit(child, depth + 1, node.model.id.toString()));\n };\n\n data.children.forEach((node) => doit(node));\n return flattenedTree;\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;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AAQ;AACZ,QAAM,OAAO,CAAC,MAAwC,QAAQ,GAAG,WAA2C,SAAS;AACnH,kBAAc,KAAK;AAAA,MACjB,KAAK,KAAK,MAAM,GAAG,SAAS;AAAA,MAC5B;AAAA,MACA,WAAW;AAAA,MACX,eAAe,KAAK,UAAU,UAAU;AAAA,MACxC,UAAU,aAAa,OAAO,SAAS,SAAS,IAAI;AAAA,MACpD,UAAU,EAAE,GAAG,MAAM,GAAG,KAAK,OAAO,KAAK;AAAA,IAC3C,CAAC;AACD,aAAS;AACT,QAAI,cAAc,IAAI;AAAG,WAAK,UAAU,QAAQ,CAAC,UAAU,KAAK,OAAO,QAAQ,GAAG,KAAK,MAAM,GAAG,SAAS,CAAC,CAAC;AAAA,EAC7G;AAEA,OAAK,SAAS,QAAQ,CAAC,SAAS,KAAK,IAAI,CAAC;AAC1C,SAAO;AACT;",
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/tree-helpers.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable max-params */\n/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport { createRef } from 'react';\nimport type TreeModel from 'tree-model';\nimport { standardizeSearchQueryString } from './string-helpers.js';\nimport type { DSTreeviewT } from '../react-desc-prop-types.js';\n\nexport const walkVisibles = (\n node: DSTreeviewT.Item['node'],\n callback: (node: DSTreeviewT.Item['node']) => void,\n skipRoot = true,\n highlightOnlyQuery = false,\n) => {\n const { children, model } = node;\n const { name, isExpanded, childrenMatchesSearchQuery, matchesSearchQuery } = model;\n\n const shouldSkipBecauseIsRoot = skipRoot && name === '__root';\n const queryRestrictionsPassed = !!(highlightOnlyQuery || childrenMatchesSearchQuery || matchesSearchQuery);\n\n if (!shouldSkipBecauseIsRoot && queryRestrictionsPassed) callback(node);\n\n const shouldWalkChildren = !!(children.length > 0 && isExpanded && queryRestrictionsPassed);\n if (shouldWalkChildren) {\n children.forEach((childNode) => {\n walkVisibles(childNode, callback, skipRoot, highlightOnlyQuery);\n });\n }\n};\n\nexport const walkParents = (\n nodePath: DSTreeviewT.Item['nodePath'],\n callback: (currParent: DSTreeviewT.Item['node']) => void,\n skipRoot = true,\n) => {\n const parents = [...nodePath].reverse();\n parents.shift(); // remove current node from the parents array\n if (skipRoot) parents.pop(); // remove the root from the parents if skipping root\n parents.forEach(callback);\n};\n\ntype RecursiveCallbackT = (childNode: DSTreeviewT.Item['node'], cb?: RecursiveCallbackT, isFirst?: boolean) => void;\nexport const walkAllNodeChildren = (node: DSTreeviewT.Item['node'], callback: RecursiveCallbackT, isFirst = true) => {\n const { children = [] } = node;\n const shouldWalkChildren = children.length;\n\n if (!isFirst) callback(node);\n\n if (shouldWalkChildren) {\n children.forEach((childNode) => {\n walkAllNodeChildren(childNode, callback, false);\n });\n }\n};\n\nexport const getNodeById = (treeRoot: DSTreeviewT.Item['node'], id: DSTreeviewT.StringOrNum) => {\n const nodes = treeRoot.all((node) => (node as unknown as DSTreeviewT.Item).model.id === id);\n return nodes[0];\n};\n\nexport const cloneNode = (tree: TreeModel, node: DSTreeviewT.Item) => tree.parse(node.model);\n\nexport const itemsShareSameParent = (items: DSTreeviewT.Item[] = []) => {\n if (items.length === 0) throw new Error('Received empty items for comparison');\n if (items.length === 1) return true;\n\n // when moving in first position we receive [undefined,...{items}]\n // when moving in last position we receive [...{items}, undefined]\n const firstExistingItem = items.find((item) => !!item);\n if (!firstExistingItem) throw new Error(\"Received no items, can't retrieve parent\");\n\n const firstExistingItemPath = firstExistingItem.node.getPath();\n // path is like [rootParent, ...[parentsNodes], currentNode]\n // length -1 is the current-node\n // length -2 is the parent-node\n // root node is not printed and is always present so minimum path length is 2 (root + currentNode)\n const directParentNode = firstExistingItemPath[firstExistingItemPath.length - 2];\n\n return items.every((item) => {\n // undefined nodes count as having the same parent\n if (!item) return true;\n const itemPath = item.node.getPath();\n const itemDirectParent = itemPath[itemPath.length - 2];\n return directParentNode === itemDirectParent;\n });\n};\n\nexport const getItemsParentNode = (items: DSTreeviewT.Item[] = [], skipSameParentCheck = false) => {\n if (items.length === 0) throw new Error(\"Received empty items, can't retrieve parent\");\n\n // in case we already know the items compared shares the same parent\n if (!skipSameParentCheck)\n if (!itemsShareSameParent(items))\n // if we don't know (default, we don't) check if they share the parent\n throw new Error(\"Received items don't share the same parent, can't retrieve parent\");\n\n // when moving in first position we receive [undefined,...{items}]\n // when moving in last position we receive [...{items}, undefined]\n const firstExistingItem = items.find((item) => !!item);\n if (!firstExistingItem) throw new Error(\"Received no items, can't retrieve parent\");\n\n const firstExistingItemPath = firstExistingItem.node.getPath();\n // path is like [rootParent, ...[parentsNodes], currentNode]\n // length -1 is the current-node\n // length -2 is the parent-node\n // root node is not printed and is always present so minimum path length is 2 (root + currentNode)\n const directParentNode = firstExistingItemPath[firstExistingItemPath.length - 2];\n return directParentNode as unknown as DSTreeviewT.Item['node'];\n};\n\nexport const getNodeMatchesSearchQuery = (node: DSTreeviewT.Item['node'], searchQuery = '') => {\n const standardizedName = standardizeSearchQueryString(node.model.name);\n const standardizedSearchQuery = standardizeSearchQueryString(searchQuery);\n return standardizedName.includes(standardizedSearchQuery);\n};\n\nexport const getChildrenMatchesSearchQuery = (parentNode: DSTreeviewT.Item['node'], searchQuery = '') => {\n let anyChildMatch = false;\n walkAllNodeChildren(parentNode, (node) => {\n if (getNodeMatchesSearchQuery(node, searchQuery)) anyChildMatch = true;\n });\n return anyChildMatch;\n};\n\n/**\n * Mutate in place a node from tree-model normalizing object properties like \"isGroup\" even if user didn't specify it explicitly,\n * after execution the node will have \"nodePath\" \"treeDepth\" \"nodeItemRef\" \"isGroup\" \"isExpanded\"\n * (optionally, based on the provided arguments) \"matchesSearchQuery\" \"childrenMatchesSearchQuery\" \"isChecked\"\n * @param {object} node - node (based on 'tree-model' lib) that you wish to mutate with extra props\n * @param {string} [searchQuery] - optional string used to parse \"matchesSearchQuery\"/\"childrenMatchesSearchQuery\" properties\n * @param {object} [selection] - optional selection hashmap used to parse \"isChecked\" properties\n * @param {object} [expanded] - optional expanded hashmap used to parse \"isExpanded\" properties\n */\nexport const enrichNodeModelInPlace = (\n node: TreeModel.Node<DSTreeviewT.SimpleItem>,\n searchQuery = '',\n selection: DSTreeviewT.SelectionItems | null = null,\n expanded: DSTreeviewT.ExpandedItems | null = null,\n) => {\n const path = node.getPath();\n const depth = path.length - 1;\n node.model.nodePath = path;\n node.model.treeDepth = depth;\n\n if (!node.model.nodeItemRef) {\n node.model.nodeItemRef = createRef();\n }\n\n // if a node has children but was not marked as isGroup, force-mark as group\n // this is useful to avoid having to always check both the flag and the children.length...\n if (typeof node.model.isGroup !== 'boolean' && (node.model?.children?.length ?? 0) > 0) {\n node.model.isGroup = true;\n }\n\n if (node.model.isGroup && node.model.id !== '__ds_tree_root') {\n if (expanded) node.model.isExpanded = !!expanded[node.model.id];\n else if (typeof node.model.isExpanded !== 'boolean') {\n node.model.isExpanded = false;\n }\n }\n\n node.model.matchesSearchQuery = true;\n node.model.childrenMatchesSearchQuery = false;\n const partiallyEnrichedNode = node as unknown as TreeModel.Node<DSTreeviewT.Item>;\n if (searchQuery) {\n partiallyEnrichedNode.model.matchesSearchQuery = getNodeMatchesSearchQuery(partiallyEnrichedNode, searchQuery);\n\n if (partiallyEnrichedNode.model.isGroup === true) {\n partiallyEnrichedNode.model.childrenMatchesSearchQuery = getChildrenMatchesSearchQuery(\n partiallyEnrichedNode,\n searchQuery,\n );\n if (partiallyEnrichedNode.model.childrenMatchesSearchQuery) partiallyEnrichedNode.model.isExpanded = true;\n }\n }\n if (selection && selection[partiallyEnrichedNode.model.id]) {\n partiallyEnrichedNode.model.isChecked = selection[partiallyEnrichedNode.model.id];\n }\n};\n\nexport const focusItem = (item: DSTreeviewT.Item | null) => {\n item?.nodeItemRef?.current?.focus();\n};\n\nexport const flattenTreeForDnD = (\n data: TreeModel.Node<DSTreeviewT.Item>,\n shouldDescend: (datum: TreeModel.Node<DSTreeviewT.Item>) => boolean = () => true,\n) => {\n const flattenedTree: DSTreeviewT.DndItem[] = [];\n let index = 0;\n const doit = (node: TreeModel.Node<DSTreeviewT.Item>, depth = 0, parentId: DSTreeviewT.StringOrNum | null = null) => {\n flattenedTree.push({\n uid: node.model.id.toString(),\n depth,\n realIndex: index,\n childrenCount: node.children?.length ?? 0,\n parentId: parentId !== null ? parentId.toString() : null,\n original: { ...node, ...node.model, node },\n });\n index += 1;\n if (shouldDescend(node)) node.children?.forEach((child) => doit(child, depth + 1, node.model.id.toString()));\n };\n\n data.children.forEach((node) => doit(node));\n return flattenedTree;\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACIvB,SAAS,iBAAiB;AAE1B,SAAS,oCAAoC;AAGtC,MAAM,eAAe,CAC1B,MACA,UACA,WAAW,MACX,qBAAqB,UAClB;AACH,QAAM,EAAE,UAAU,MAAM,IAAI;AAC5B,QAAM,EAAE,MAAM,YAAY,4BAA4B,mBAAmB,IAAI;AAE7E,QAAM,0BAA0B,YAAY,SAAS;AACrD,QAAM,0BAA0B,CAAC,EAAE,sBAAsB,8BAA8B;AAEvF,MAAI,CAAC,2BAA2B;AAAyB,aAAS,IAAI;AAEtE,QAAM,qBAAqB,CAAC,EAAE,SAAS,SAAS,KAAK,cAAc;AACnE,MAAI,oBAAoB;AACtB,aAAS,QAAQ,CAAC,cAAc;AAC9B,mBAAa,WAAW,UAAU,UAAU,kBAAkB;AAAA,IAChE,CAAC;AAAA,EACH;AACF;AAEO,MAAM,cAAc,CACzB,UACA,UACA,WAAW,SACR;AACH,QAAM,UAAU,CAAC,GAAG,QAAQ,EAAE,QAAQ;AACtC,UAAQ,MAAM;AACd,MAAI;AAAU,YAAQ,IAAI;AAC1B,UAAQ,QAAQ,QAAQ;AAC1B;AAGO,MAAM,sBAAsB,CAAC,MAAgC,UAA8B,UAAU,SAAS;AACnH,QAAM,EAAE,WAAW,CAAC,EAAE,IAAI;AAC1B,QAAM,qBAAqB,SAAS;AAEpC,MAAI,CAAC;AAAS,aAAS,IAAI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A,QACvD;AAAA,QACA;AAAA,MACF;AACA,UAAI,sBAAsB,MAAM;AAA4B,8BAAsB,MAAM,aAAa;AAAA,IACvG;AAAA,EACF;AACA,MAAI,aAAa,UAAU,sBAAsB,MAAM,EAAE,GAAG;AAC1D,0BAAsB,MAAM,YAAY,UAAU,sBAAsB,MAAM,EAAE;AAAA,EAClF;AACF;AAEO,MAAM,YAAY,CAAC,SAAkC;AAC1D,QAAM,aAAa,SAAS,MAAM;AACpC;AAEO,MAAM,oBAAoB,CAC/B,MACA,gBAAsE,MAAM,SACzE;AACH,QAAM,gBAAuC,CAAC;AAC9C,MAAI,QAAQ;AACZ,QAAM,OAAO,CAAC,MAAwC,QAAQ,GAAG,WAA2C,SAAS;AACnH,kBAAc,KAAK;AAAA,MACjB,KAAK,KAAK,MAAM,GAAG,SAAS;AAAA,MAC5B;AAAA,MACA,WAAW;AAAA,MACX,eAAe,KAAK,UAAU,UAAU;AAAA,MACxC,UAAU,aAAa,OAAO,SAAS,SAAS,IAAI;AAAA,MACpD,UAAU,EAAE,GAAG,MAAM,GAAG,KAAK,OAAO,KAAK;AAAA,IAC3C,CAAC;AACD,aAAS;AACT,QAAI,cAAc,IAAI;AAAG,WAAK,UAAU,QAAQ,CAAC,UAAU,KAAK,OAAO,QAAQ,GAAG,KAAK,MAAM,GAAG,SAAS,CAAC,CAAC;AAAA,EAC7G;AAEA,OAAK,SAAS,QAAQ,CAAC,SAAS,KAAK,IAAI,CAAC;AAC1C,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/useInstanceRefActions.tsx"],
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/useInstanceRefActions.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useEffect, useMemo, useState, useRef, useCallback } from 'react';\nimport { focusItem } from './tree-helpers.js';\nimport { toggleExpandAllHelper } from './group-expands-helpers.js';\nimport type { DSTreeviewT } from '../react-desc-prop-types.js';\nimport type { DSTreeviewInternalsT } from '../sharedTypes.js';\n\ninterface PromisesRefT {\n expandResolve?: null | ((value: DSTreeviewT.Item[] | PromiseLike<DSTreeviewT.Item[]>) => void);\n scrollTo?: null | ((value: DSTreeviewT.Item[] | PromiseLike<DSTreeviewT.Item[]>) => void);\n}\n\nexport const useInstanceRefActions = ({ actions }: DSTreeviewT.InstanceRef, ctx: DSTreeviewInternalsT.CTX) => {\n const {\n props: { onItemFocus, onItemActivate },\n virtualListHelpers,\n treeRoot,\n visibleItems,\n triggerTreeRerender,\n updateUserExpandedState,\n setSelectedItem,\n setFocusedItem,\n setLatestToggledItem,\n } = ctx;\n const { current: promises } = useRef<PromisesRefT>({});\n const { scrollToIndex } = useMemo(() => virtualListHelpers, [virtualListHelpers]);\n const [expandPromise, setPromise] = useState<Promise<DSTreeviewT.Item[]> | undefined | null>();\n\n useEffect(() => {\n if (expandPromise && promises.expandResolve) {\n promises.expandResolve(visibleItems);\n promises.expandResolve = null;\n setPromise(null);\n }\n }, [visibleItems, expandPromise, promises]);\n\n actions.toggleExpandAll = useCallback(\n (isExpand) => {\n const p = new Promise<DSTreeviewT.Item[]>((resolve) => {\n promises.expandResolve = resolve;\n if (treeRoot)\n toggleExpandAllHelper(isExpand, treeRoot, triggerTreeRerender, setLatestToggledItem, updateUserExpandedState);\n });\n setPromise(p);\n return p;\n },\n [promises, treeRoot, triggerTreeRerender, setLatestToggledItem, updateUserExpandedState],\n );\n actions.scrollTo = useCallback(\n (indx, opts = { align: 'start' }) => {\n if (scrollToIndex) scrollToIndex(indx, opts);\n },\n [scrollToIndex],\n );\n\n actions.setSelectedItemByVirtualIndex = useCallback(\n (index) => {\n const itemByIndex = visibleItems[index];\n setSelectedItem(itemByIndex);\n onItemActivate(itemByIndex);\n },\n [visibleItems, setSelectedItem, onItemActivate],\n );\n\n actions.setFocusedItemByVirtualIndex = useCallback(\n (index, opts = { align: 'start', withScroll: false }) => {\n const itemByIndex = visibleItems[index];\n const onItemFocusParams = {\n itemIndex: itemByIndex.virtualIndex as number,\n scrollToItem: () => scrollToIndex(index, opts),\n item: itemByIndex,\n };\n\n if (opts.withScroll && scrollToIndex) {\n scrollToIndex(index, opts);\n setTimeout(() => {\n setFocusedItem(itemByIndex);\n focusItem(itemByIndex);\n onItemFocus(onItemFocusParams);\n }, 300);\n } else {\n setFocusedItem(itemByIndex);\n focusItem(itemByIndex);\n onItemFocus(onItemFocusParams);\n }\n },\n [visibleItems, scrollToIndex, setFocusedItem, onItemFocus],\n );\n\n return actions;\n};\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,WAAW,SAAS,UAAU,QAAQ,mBAAmB;AAClE,SAAS,iBAAiB;AAC1B,SAAS,6BAA6B;AAS/B,MAAM,wBAAwB,CAAC,EAAE,QAAQ,GAA4B,QAAkC;AAC5G,QAAM;AAAA,IACJ,OAAO,EAAE,aAAa,eAAe;AAAA,IACrC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,EAAE,SAAS,SAAS,IAAI,OAAqB,CAAC,CAAC;AACrD,QAAM,EAAE,cAAc,IAAI,QAAQ,MAAM,oBAAoB,CAAC,kBAAkB,CAAC;AAChF,QAAM,CAAC,eAAe,UAAU,IAAI,SAAyD;AAE7F,YAAU,MAAM;AACd,QAAI,iBAAiB,SAAS,eAAe;AAC3C,eAAS,cAAc,YAAY;AACnC,eAAS,gBAAgB;AACzB,iBAAW,IAAI;AAAA,IACjB;AAAA,EACF,GAAG,CAAC,cAAc,eAAe,QAAQ,CAAC;AAE1C,UAAQ,kBAAkB;AAAA,IACxB,CAAC,aAAa;AACZ,YAAM,IAAI,IAAI,QAA4B,CAAC,YAAY;AACrD,iBAAS,gBAAgB;AACzB,YAAI;AACF,gCAAsB,UAAU,UAAU,qBAAqB,sBAAsB,uBAAuB;AAAA,MAChH,CAAC;AACD,iBAAW,CAAC;AACZ,aAAO;AAAA,IACT;AAAA,IACA,CAAC,UAAU,UAAU,qBAAqB,sBAAsB,uBAAuB;AAAA,EACzF;AACA,UAAQ,WAAW;AAAA,IACjB,CAAC,MAAM,OAAO,EAAE,OAAO,QAAQ,MAAM;AACnC,UAAI;AAAe,sBAAc,MAAM,IAAI;AAAA,IAC7C;AAAA,IACA,CAAC,aAAa;AAAA,EAChB;AAEA,UAAQ,gCAAgC;AAAA,IACtC,CAAC,UAAU;AACT,YAAM,cAAc,aAAa,KAAK;AACtC,sBAAgB,WAAW;AAC3B,qBAAe,WAAW;AAAA,IAC5B;AAAA,IACA,CAAC,cAAc,iBAAiB,cAAc;AAAA,EAChD;AAEA,UAAQ,+BAA+B;AAAA,IACrC,CAAC,OAAO,OAAO,EAAE,OAAO,SAAS,YAAY,MAAM,MAAM;AACvD,YAAM,cAAc,aAAa,KAAK;AACtC,YAAM,oBAAoB;AAAA,QACxB,WAAW,YAAY;AAAA,QACvB,cAAc,MAAM,cAAc,OAAO,IAAI;AAAA,QAC7C,MAAM;AAAA,MACR;AAEA,UAAI,KAAK,cAAc,eAAe;AACpC,sBAAc,OAAO,IAAI;AACzB,mBAAW,MAAM;AACf,yBAAe,WAAW;AAC1B,oBAAU,WAAW;AACrB,sBAAY,iBAAiB;AAAA,QAC/B,GAAG,GAAG;AAAA,MACR,OAAO;AACL,uBAAe,WAAW;AAC1B,kBAAU,WAAW;AACrB,oBAAY,iBAAiB;AAAA,MAC/B;AAAA,IACF;AAAA,IACA,CAAC,cAAc,eAAe,gBAAgB,WAAW;AAAA,EAC3D;AAEA,SAAO;AACT;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/useTree.tsx"],
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/useTree.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useState, useCallback, useMemo, useEffect } from 'react';\nimport TreeModel from 'tree-model';\nimport { cloneDeep } from 'lodash';\nimport { walkVisibles, enrichNodeModelInPlace, flattenTreeForDnD } from './tree-helpers.js';\nimport type { DSTreeviewT } from '../react-desc-prop-types.js';\nimport type { DSTreeviewInternalsT } from '../sharedTypes.js';\nimport { updateExpandedState } from './group-expands-helpers.js';\n\nexport const useTree = (\n data: DSTreeviewT.SimpleItem[],\n props: DSTreeviewT.Props,\n states: {\n setExpandedGroups: DSTreeviewInternalsT.StateSetter<DSTreeviewT.ExpandedItems>;\n },\n) => {\n const { setExpandedGroups } = states;\n const unfrozenData = useMemo(() => cloneDeep(data), [data]);\n\n // convert data into a TreeModel with extra isExpanded prop\n // root element type is an exception, children model is based on what the dev passed on\n // since root is an excepcion we must typecast\n const tree = useMemo(() => new TreeModel(), []);\n const [treeData, setTreeData] = useState({\n id: '__ds_tree_root',\n name: '__root',\n isExpanded: true,\n children: unfrozenData,\n } as unknown as DSTreeviewT.Item);\n\n useEffect(() => {\n setTreeData({\n id: '__ds_tree_root',\n name: '__root',\n isExpanded: true,\n children: unfrozenData,\n } as unknown as DSTreeviewT.Item);\n }, [unfrozenData]);\n\n // expose a way to rerender the tree\n // used for expand functionality\n const [rerenderItems, setRerenderItems] = useState({});\n const triggerTreeRerender = useCallback(() => {\n setRerenderItems({});\n }, []);\n\n // when re-rendering we re-parse the list\n // Here we are initializing the tree with a function since for some reason,\n // tree.parse is re-executing every time the treeview is re-rendered. I honestly don't know why.\n const [treeRoot, setTreeRoot] = useState(() => tree.parse(treeData));\n useEffect(() => {\n setTreeRoot(tree.parse(treeData));\n }, [treeData, rerenderItems, tree]);\n\n const [visibleItems, setVisibleItems] = useState<DSTreeviewT.Item[]>([]);\n\n const { searchQuery, highlightOnlyQuery, onVisibleItemsChange, selection, expanded, onExpandChange } = props;\n\n const updateUserExpandedState = useCallback(() => {\n updateExpandedState(treeRoot, onExpandChange);\n }, [treeRoot, onExpandChange]);\n // we add missing properties to the received Items\n // not the best of the patterns, but it works\n // this is where we convert \"SimpleItems\" to \"Items\"\n // this was done to avoid breaking changes back in v1\n useEffect(() => {\n const parsedVisibleItems: DSTreeviewT.Item[] = [];\n const newExpandedHashMap: DSTreeviewT.ExpandedItems = {};\n const shouldContinueWalking = true; // tree-model ask we return true if we want to continue walking\n treeRoot.walk((node) => {\n enrichNodeModelInPlace(node, searchQuery, selection, expanded);\n if (node.model.id && node.model.isGroup && node.model.isExpanded) newExpandedHashMap[node.model.id] = true;\n return shouldContinueWalking;\n });\n\n walkVisibles(\n treeRoot,\n (node) => {\n parsedVisibleItems.push({ ...node.model, node });\n },\n true,\n highlightOnlyQuery,\n );\n setVisibleItems(parsedVisibleItems);\n onVisibleItemsChange(parsedVisibleItems);\n\n setExpandedGroups(newExpandedHashMap);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n treeRoot,\n rerenderItems,\n searchQuery,\n highlightOnlyQuery,\n selection,\n expanded,\n setExpandedGroups,\n // onVisibleItemsChange // evaluate potential performance hit?\n ]);\n\n const flattenedItems = useMemo(() => flattenTreeForDnD(treeRoot), [treeRoot]);\n\n return {\n visibleItems,\n flattenedItems,\n tree,\n treeRoot,\n rerenderItems,\n triggerTreeRerender,\n updateUserExpandedState,\n };\n};\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,UAAU,aAAa,SAAS,iBAAiB;AAC1D,OAAO,eAAe;AACtB,SAAS,iBAAiB;AAC1B,SAAS,cAAc,wBAAwB,yBAAyB;AAGxE,SAAS,2BAA2B;AAE7B,MAAM,UAAU,CACrB,MACA,OACA,WAGG;AACH,QAAM,EAAE,kBAAkB,IAAI;AAC9B,QAAM,eAAe,QAAQ,MAAM,UAAU,IAAI,GAAG,CAAC,IAAI,CAAC;AAK1D,QAAM,OAAO,QAAQ,MAAM,IAAI,UAAU,GAAG,CAAC,CAAC;AAC9C,QAAM,CAA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AAA,MACA;AAAA,IACF;AACA,oBAAgB,kBAAkB;AAClC,yBAAqB,kBAAkB;AAEvC,sBAAkB,kBAAkB;AAAA,EAEtC,GAAG;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,EAEF,CAAC;AAED,QAAM,iBAAiB,QAAQ,MAAM,kBAAkB,QAAQ,GAAG,CAAC,QAAQ,CAAC;AAE5E,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
6
6
  "names": []
@@ -1,4 +1,4 @@
1
1
  export declare const DSTreeViewPrefix = "em-ds";
2
2
  export declare const treeItemBlockName = "tree-item";
3
3
  export declare const treeListBlockName = "tree-list";
4
- export declare const treeListNoItemsBn: string;
4
+ export declare const treeListNoItemsBn = "tree-list-no-items";
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { DSTreeviewT } from '../react-desc-prop-types.js';
2
3
  interface PropsT {
3
4
  item: DSTreeviewT.Item;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { DSTreeviewT } from '../react-desc-prop-types.js';
2
3
  interface PropsT {
3
4
  item: DSTreeviewT.Item;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { DSTreeviewT } from '../react-desc-prop-types.js';
2
3
  interface PropsT {
3
4
  item: DSTreeviewT.Item;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { DSTreeviewT } from '../react-desc-prop-types.js';
2
3
  type NestingSpacePropsType = {
3
4
  item: DSTreeviewT.Item;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { DSTreeviewT } from '../react-desc-prop-types.js';
2
3
  interface PropsT {
3
4
  item: DSTreeviewT.Item;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import React from 'react';
3
3
  import type { DSTreeviewT } from '../react-desc-prop-types.js';
4
- export declare const treeListNoItemsBn: string;
4
+ export declare const treeListNoItemsBn = "tree-list-no-items";
5
5
  export declare const TreeListNoItems: React.ComponentType<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
6
6
  interface UlProps extends Omit<React.ComponentProps<'ul'>, 'ref'> {
7
7
  ref: React.MutableRefObject<HTMLUListElement | undefined> | undefined;
@@ -1,7 +1,7 @@
1
1
  import type { DSTreeviewT } from '../react-desc-prop-types.js';
2
2
  export declare const getGroupCheckState: (node: DSTreeviewT.Item['node']) => boolean | "mixed";
3
3
  export declare const selectCheckboxItemModelParentsTillRoot: (modelToCheck: DSTreeviewT.Item, triggerTreeRerender?: (() => void) | null) => DSTreeviewT.SelectionItems;
4
- export declare const toggleCheckboxItem: (itemToSelect: DSTreeviewT.Item, triggerTreeRerender?: (() => void) | null) => {
4
+ export declare const toggleCheckboxItem: (itemToSelect: DSTreeviewT.Item, currentlySelectedCheckboxes: DSTreeviewT.SelectionItems, triggerTreeRerender?: (() => void) | null) => {
5
5
  [x: string]: DSTreeviewT.SelectionState;
6
6
  [x: number]: DSTreeviewT.SelectionState;
7
7
  };
@@ -16,11 +16,10 @@ export declare const getChildrenMatchesSearchQuery: (parentNode: DSTreeviewT.Ite
16
16
  * Mutate in place a node from tree-model normalizing object properties like "isGroup" even if user didn't specify it explicitly,
17
17
  * after execution the node will have "nodePath" "treeDepth" "nodeItemRef" "isGroup" "isExpanded"
18
18
  * (optionally, based on the provided arguments) "matchesSearchQuery" "childrenMatchesSearchQuery" "isChecked"
19
- *
20
19
  * @param {object} node - node (based on 'tree-model' lib) that you wish to mutate with extra props
21
- * @param {string} [searchQuery=''] - optional string used to parse "matchesSearchQuery"/"childrenMatchesSearchQuery" properties
22
- * @param {object} [selection=null] - optional selection hashmap used to parse "isChecked" properties
23
- * @param {object} [expanded=null] - optional expanded hashmap used to parse "isExpanded" properties
20
+ * @param {string} [searchQuery] - optional string used to parse "matchesSearchQuery"/"childrenMatchesSearchQuery" properties
21
+ * @param {object} [selection] - optional selection hashmap used to parse "isChecked" properties
22
+ * @param {object} [expanded] - optional expanded hashmap used to parse "isExpanded" properties
24
23
  */
25
24
  export declare const enrichNodeModelInPlace: (node: TreeModel.Node<DSTreeviewT.SimpleItem>, searchQuery?: string, selection?: DSTreeviewT.SelectionItems | null, expanded?: DSTreeviewT.ExpandedItems | null) => void;
26
25
  export declare const focusItem: (item: DSTreeviewT.Item | null) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-treeview",
3
- "version": "3.22.0-next.3",
3
+ "version": "3.22.0-next.30",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Tree View",
6
6
  "files": [
@@ -231,23 +231,24 @@
231
231
  "react-virtual": "~2.10.4",
232
232
  "tree-model": "~1.0.7",
233
233
  "uid": "~2.0.1",
234
- "@elliemae/ds-button-v2": "3.22.0-next.3",
235
- "@elliemae/ds-classnames": "3.22.0-next.3",
236
- "@elliemae/ds-circular-progress-indicator": "3.22.0-next.3",
237
- "@elliemae/ds-drag-and-drop": "3.22.0-next.3",
238
- "@elliemae/ds-form": "3.22.0-next.3",
239
- "@elliemae/ds-icons": "3.22.0-next.3",
240
- "@elliemae/ds-props-helpers": "3.22.0-next.3",
241
- "@elliemae/ds-system": "3.22.0-next.3",
242
- "@elliemae/ds-truncated-tooltip-text": "3.22.0-next.3",
243
- "@elliemae/ds-utilities": "3.22.0-next.3"
234
+ "@elliemae/ds-button-v2": "3.22.0-next.30",
235
+ "@elliemae/ds-circular-progress-indicator": "3.22.0-next.30",
236
+ "@elliemae/ds-classnames": "3.22.0-next.30",
237
+ "@elliemae/ds-drag-and-drop": "3.22.0-next.30",
238
+ "@elliemae/ds-icons": "3.22.0-next.30",
239
+ "@elliemae/ds-form": "3.22.0-next.30",
240
+ "@elliemae/ds-props-helpers": "3.22.0-next.30",
241
+ "@elliemae/ds-system": "3.22.0-next.30",
242
+ "@elliemae/ds-truncated-tooltip-text": "3.22.0-next.30",
243
+ "@elliemae/ds-utilities": "3.22.0-next.30"
244
244
  },
245
245
  "devDependencies": {
246
- "@elliemae/pui-cli": "~9.0.0-next.17",
246
+ "@elliemae/pui-cli": "~9.0.0-next.22",
247
247
  "@testing-library/jest-dom": "~5.16.5",
248
248
  "@testing-library/react": "~12.1.3",
249
249
  "styled-components": "~5.3.9",
250
- "@elliemae/ds-monorepo-devops": "3.22.0-next.3"
250
+ "@elliemae/ds-controlled-form": "3.22.0-next.30",
251
+ "@elliemae/ds-monorepo-devops": "3.22.0-next.30"
251
252
  },
252
253
  "peerDependencies": {
253
254
  "lodash": "^4.17.21",
@@ -256,17 +257,17 @@
256
257
  "styled-components": "~5.3.9"
257
258
  },
258
259
  "scripts": {
259
- "dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
260
+ "dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
260
261
  "test": "pui-cli test --passWithNoTests",
261
262
  "test:e2e": "../../../node_modules/pui-e2e-test-sdk/node_modules/.bin/wdio run ../../../wdio.conf.js",
262
263
  "test:reports": "../../../node_modules/pui-e2e-test-sdk/node_modules/.bin/allure open",
263
- "lint": "node ../../scripts/lint.mjs",
264
- "eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../.eslintrc.js' src/",
265
- "dts": "node ../../scripts/dts.mjs",
264
+ "lint": "node ../../../scripts/lint.mjs",
265
+ "eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../../.eslintrc.js' src/",
266
+ "dts": "node ../../../scripts/dts.mjs",
266
267
  "dts:withdeps": "pnpm --filter {.}... dts",
267
- "build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs",
268
+ "build": "cross-env NODE_ENV=production node ../../../scripts/build/build.mjs",
268
269
  "dev:build": "pnpm --filter {.}... build",
269
270
  "dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
270
- "checkDeps": "npm exec ../ds-codemods -- check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
271
+ "checkDeps": "npm exec ../../util/ds-codemods -- check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
271
272
  }
272
273
  }