@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": ["../../../src/utils/object-helpers.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/utils/object-helpers.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["/* 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", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADKvB,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": ["../../../src/utils/refs-helpers.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/utils/refs-helpers.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["// 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", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEhB,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": []
@@ -65,12 +65,13 @@ const selectCheckboxItemModelParentsTillRoot = (modelToCheck, triggerTreeRerende
65
65
  triggerTreeRerender();
66
66
  return newSelections;
67
67
  };
68
- const toggleCheckboxItem = (itemToSelect, triggerTreeRerender = null) => {
68
+ const toggleCheckboxItem = (itemToSelect, currentlySelectedCheckboxes, triggerTreeRerender = null) => {
69
69
  const {
70
70
  node: {
71
- model: { id, isChecked, children = [] }
71
+ model: { id, children = [] }
72
72
  }
73
73
  } = itemToSelect;
74
+ const isChecked = currentlySelectedCheckboxes[id];
74
75
  const newSelections = {};
75
76
  const nextState = isChecked === "mixed" ? true : !isChecked;
76
77
  itemToSelect.node.model.isChecked = nextState;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/utils/selectable-helper.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* 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", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,0BAAiD;AAG1C,MAAM,qBAAqB,CAAC,SAAmC;AACpE,MAAI,kBAAkB;AACtB,MAAI,kBAAkB;AACtB,+CAAoB,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,uCAAY,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,iDAAoB,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": ["../../../src/utils/selectable-helper.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* 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", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,0BAAiD;AAG1C,MAAM,qBAAqB,CAAC,SAAmC;AACpE,MAAI,kBAAkB;AACtB,MAAI,kBAAkB;AAC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../../../src/utils/string-helpers.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/utils/string-helpers.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["export const standardizeSearchQueryString = (input: string) => input.trim().toLowerCase();\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,+BAA+B,CAAC,UAAkB,MAAM,KAAK,EAAE,YAAY;",
6
6
  "names": []
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/utils/tree-helpers.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* 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", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADIvB,mBAA0B;AAE1B,4BAA6C;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;AAE3B,MA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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;",
3
+ "sources": ["../../../src/utils/tree-helpers.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* 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", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADIvB,mBAA0B;AAE1B,4BAA6C;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,EA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;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": ["../../../src/utils/useInstanceRefActions.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/utils/useInstanceRefActions.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["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", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkE;AAClE,0BAA0B;AAC1B,mCAAsC;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,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;AAEA,UAAI,KAAK,cAAc,eAAe;AACpC,sBAAc,OAAO,IAAI;AACzB,mBAAW,MAAM;AACf,yBAAe,WAAW;AAC1B,6CAAU,WAAW;AACrB,sBAAY,iBAAiB;AAAA,QAC/B,GAAG,GAAG;AAAA,MACR,OAAO;AACL,uBAAe,WAAW;AAC1B,2CAAU,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": ["../../../src/utils/useTree.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/utils/useTree.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["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", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA0D;AAC1D,wBAAsB;AACtB,oBAA0B;AAC1B,0BAAwE;AAGxE,mCAAoC;AAE7B,MAAM,UAAU,CACrB,MACA,OACA,WAGG;AACH,QAAM,EAAE,kBAAkB,IAAI;AAC9B,QAAM,mBAAe,sBAAQ,UAAM,yBAAU,IAAI,GAAG,CAAC,IAAI,CAAC;AAK1D,QAAM,WAAO,sBAAQ,MAAM,IAAI,kBAAAA,QAAU,GAAG,CAAC,CAAC;AAC9C,QAAM,CAAC,UAAU,WAAW,QAAI,uBAAS;AAAA,IACvC,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,UAAU;AAAA,EACZ,CAAgC;AAEhC,8BAAU,MAAM;AACd,gBAAY;AAAA,MACV,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,UAAU;AAAA,IACZ,CAAgC;AAAA,EAClC,GAAG,CAAC,YAAY,CAAC;AAIjB,QAAM,CAAC,eAAe,gBAAgB,QAAI,uBAAS,CAAC,CAAC;AACrD,QAAM,0BAAsB,0BAAY,MAAM;AAC5C,qBAAiB,CAAC,CAAC;AAAA,EACrB,GAAG,CAAC,CAAC;AAKL,QAAM,CAAC,UAAU,WAAW,QAAI,uBAAS,MAAM,KAAK,MAAM,QAAQ,CAAC;AACnE,8BAAU,MAAM;AACd,gBAAY,KAAK,MAAM,QAAQ,CAAC;AAAA,EAClC,GAAG,CAAC,UAAU,eAAe,IAAI,CAAC;AAElC,QAAM,CAAC,cAAc,eAAe,QAAI,uBAA6B,CAAC,CAAC;AAEvE,QAAM,EAAE,aAAa,oBAAoB,sBAAsB,WAAW,UAAU,eAAe,IAAI;AAEvG,QAAM,8BAA0B,0BAAY,MAAM;AAChD,0DAAoB,UAAU,cAAc;AAAA,EAC9C,GAAG,CAAC,UAAU,cAAc,CAAC;AAK7B,8BAAU,MAAM;AACd,UAAM,qBAAyC,CAAC;AAChD,UAAM,qBAAgD,CAAC;AACvD,UAAM,wBAAwB;AAC9B,aAAS,KAAK,CAAC,SAAS;AACtB,sDAAuB,MAAM,aAAa,WAAW,QAAQ;AAC7D,UAAI,KAAK,MAAM,MAAM,KAAK,MAAM,WAAW,KAAK,MAAM;AAAY,2BAAmB,KAAK,MAAM,EAAE,IAAI;AACtG,aAAO;AAAA,IACT,CAAC;AAED;AAAA,MACE;AAAA,MACA,CAAC,SAAS;AACR,2BAAmB,KAAK,EAAE,GAAG,KAAK,OAAO,KAAK,CAAC;AAAA,MACjD;AAAA,MACA;AAAA,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,qBAAiB,sBAAQ,UAAM,uCAAkB,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": ["TreeModel"]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/TreeView.tsx"],
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/TreeView.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { TreeViewPropTypes } from './react-desc-prop-types.js';\nimport TreeViewContext from './TreeViewContext.js';\nimport { useTreeview } from './config/useTreeview.js';\nimport { TreeList } from './parts/TreeList.js';\nimport type { DSTreeviewT } from './react-desc-prop-types.js';\nexport const TreeView = (props: DSTreeviewT.Props) => {\n const { ctx } = useTreeview(props);\n\n return (\n <TreeViewContext.Provider value={ctx}>\n <TreeList />\n </TreeViewContext.Provider>\n );\n};\n\nTreeView.displayName = 'TreeView';\nconst TreeViewWithSchema = describe(TreeView);\nTreeViewWithSchema.propTypes = TreeViewPropTypes;\n\nexport { TreeViewWithSchema };\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACYjB;AAXN,SAAS,gBAAgB;AACzB,SAAS,yBAAyB;AAClC,OAAO,qBAAqB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AAElB,MAAM,WAAW,CAAC,UAA6B;AACpD,QAAM,EAAE,IAAI,IAAI,YAAY,KAAK;AAEjC,SACE,oBAAC,gBAAgB,UAAhB,EAAyB,OAAO,KAC/B,8BAAC,YAAS,GACZ;AAEJ;AAEA,SAAS,cAAc;AACvB,MAAM,qBAAqB,SAAS,QAAQ;AAC5C,mBAAmB,YAAY;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/TreeViewContext.tsx"],
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/TreeViewContext.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-unused-vars */\nimport { createContext, createRef } from 'react';\nimport type { DSTreeviewT } from './react-desc-prop-types.js';\nimport type { DSTreeviewInternalsT } from './sharedTypes.js';\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction noop<T extends unknown[]>(..._args: T): void {}\n\nexport const defaultProps = {\n plugins: [],\n selection: {},\n instanceRef: createRef(),\n isItemDisabled: () => false,\n disableIcons: false,\n isMultiSelect: false,\n isSingleSelect: false,\n getIsDropValid: () => true,\n showChildrenAmount: false,\n isLoading: false,\n highlightOnlyQuery: false,\n onItemClick: noop,\n onItemActivate: noop,\n onItemFocus: noop,\n onVisibleItemsChange: noop,\n onOrderChange: noop,\n onSelectionChange: noop,\n onExpandChange: noop,\n onInstanceRefInitialized: noop,\n rowSize: 'normal',\n labelOverflow: 'wrap',\n noItemsPlaceholder: 'No items found',\n nameKey: 'name',\n width: '100%',\n height: '100%',\n groupIcon: null,\n itemIcon: null,\n searchQuery: '',\n // workaround on the typings over the fact that\n // when we instantiate the context we can't have all the props\n // we only have a part of them but the final typings will include missing props\n // this is safe to do because\n // we will \"mergeWithDefaults\" + \"validatePropTypes\" when we do instantiate the context\n} as unknown as DSTreeviewT.Props;\n\nexport const defaultRelativeMouseCoord = {\n isBefore: false,\n isAfter: false,\n isValid: true,\n item: null,\n x: null,\n y: null,\n relativeElementDOMRect: null,\n relativeElementIndex: null,\n};\n\nconst defaultContext: DSTreeviewInternalsT.CTX = {\n props: defaultProps,\n visibleItems: [],\n flattenedItems: [],\n withRadioChecks: false,\n withCheckboxChecks: false,\n withDragAndDrop: false,\n triggerTreeRerender: noop,\n tree: undefined,\n treeRoot: undefined,\n virtualListHelpers: {\n virtualItems: [],\n totalSize: 0,\n scrollToOffset: noop,\n scrollToIndex: noop,\n measure: noop,\n },\n virtualListRef: undefined,\n uniqueTreeViewUUID: '',\n selectedItem: null,\n setSelectedItem: noop,\n focusedItem: null,\n setFocusedItem: noop,\n selectedCheckboxes: {},\n setInternallySelectedCheckboxes: noop,\n expandedGroups: {},\n setExpandedGroups: noop,\n latestToggledItem: null,\n setLatestToggledItem: noop,\n hoverItem: null,\n setHoverItem: noop,\n handleExpandGroup: noop,\n updateUserExpandedState: noop,\n};\n\n/** Context for cross component communication */\nconst TreeViewContext = createContext(defaultContext);\n\nexport default TreeViewContext;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,eAAe,iBAAiB;AAKzC,SAAS,QAA6B,OAAgB;AAAC;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AoB,CAAC;AAAA,EACrB,iCAAiC;AAAA,EACjC,gBAAgB,CAAC;AAAA,EACjB,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,sBAAsB;AAAA,EACtB,WAAW;AAAA,EACX,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,yBAAyB;AAC3B;AAGA,MAAM,kBAAkB,cAAc,cAAc;AAEpD,IAAO,0BAAQ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/cssClassesConstants.tsx"],
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/cssClassesConstants.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const DSTreeViewPrefix = 'em-ds';\nexport const treeItemBlockName = 'tree-item';\nexport const treeListBlockName = 'tree-list';\nexport const treeListNoItemsBn = `${treeListBlockName}-no-items`;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,mBAAmB;AACzB,MAAM,oBAAoB;AAC1B,MAAM,oBAAoB;AAC1B,MAAM,oBAAoB,GAAG;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useTreeview.tsx"],
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useTreeview.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable max-statements */\nimport { useState, useRef, useEffect, useMemo, useCallback } from 'react';\nimport { useVirtual } from 'react-virtual';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport { TreeViewPropTypes } from '../react-desc-prop-types.js';\nimport { defaultProps } from '../TreeViewContext.js';\nimport { TreeDndPlugin } from '../plugins/dnd/index.js';\nimport { useTree } from '../utils/useTree.js';\nimport { useNotifyExpandedChange, toggleItemExpand } from '../utils/group-expands-helpers.js';\nimport { useInstanceRefActions } from '../utils/useInstanceRefActions.js';\nimport { useGlobalToggleAllExpandShortcut } from '../utils/keyboard-helpers.js';\nimport type { DSTreeviewT } from '../react-desc-prop-types.js';\nimport type { DSTreeviewInternalsT } from '../sharedTypes.js';\n\ntype UseTreeviewT = (props: DSTreeviewT.Props) => { ctx: DSTreeviewInternalsT.CTX };\n\nexport const useTreeview: UseTreeviewT = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSTreeviewT.Props>(props, defaultProps);\n useValidateTypescriptPropTypes(propsWithDefault, TreeViewPropTypes, 'DSTreeView');\n const defaultActions = {\n actions: {\n toggleExpandAll: () => {},\n scrollTo: () => {},\n setSelectedItemByVirtualIndex: () => {},\n setFocusedItemByVirtualIndex: () => {},\n },\n } as unknown as DSTreeviewT.InstanceRef;\n const treeRef = useRef(defaultActions);\n const {\n data,\n plugins,\n onOrderChange,\n isMultiSelect,\n isSingleSelect,\n instanceRef,\n selection,\n controlledSelection,\n onInstanceRefInitialized,\n } = propsWithDefault;\n const [uniqueTreeViewUUID] = useState(uid(6));\n const [hoverItem, setHoverItem] = useState<DSTreeviewT.Item | null>(null);\n const [latestToggledItem, setLatestToggledItem] = useState<DSTreeviewT.Item | null>(null);\n const [selectedItem, setSelectedItem] = useState<DSTreeviewT.Item | null>(null);\n const [focusedItem, setFocusedItem] = useState<DSTreeviewT.Item | null>(null);\n const [internallySelectedCheckboxes, setInternallySelectedCheckboxes] = useState({\n ...selection,\n });\n\n // if user provides \"controlledSelection\" selectedCheckboxes containes the user selection\n // else it contains the internal selection\n const selectedCheckboxes = useMemo(() => {\n if (controlledSelection) return controlledSelection;\n return internallySelectedCheckboxes;\n }, [controlledSelection, internallySelectedCheckboxes]);\n\n const [expandedGroups, setExpandedGroups] = useState<DSTreeviewT.ExpandedItems>({});\n const { visibleItems, flattenedItems, tree, treeRoot, triggerTreeRerender, updateUserExpandedState } = useTree(\n data,\n propsWithDefault,\n {\n setExpandedGroups,\n },\n );\n\n const virtualListRef = useRef<HTMLUListElement>();\n // estimateSize should not be really required given what was stated on\n // https://github.com/tannerlinsley/react-virtual/issues/23\n\n const virtualListHelpers = useVirtual({\n size: visibleItems.length,\n parentRef: virtualListRef,\n overscan: 15,\n });\n\n const withDragAndDrop = !!(plugins?.includes(TreeDndPlugin) && onOrderChange);\n const withRadioChecks = isSingleSelect && !isMultiSelect;\n const withCheckboxChecks = !isSingleSelect && isMultiSelect;\n\n const handleExpandGroup = useCallback(toggleItemExpand, []);\n\n const ctx: DSTreeviewInternalsT.CTX = useMemo(\n () => ({\n props: propsWithDefault,\n virtualListHelpers,\n virtualListRef,\n tree,\n treeRoot,\n visibleItems,\n flattenedItems,\n triggerTreeRerender,\n withRadioChecks,\n withCheckboxChecks,\n withDragAndDrop,\n uniqueTreeViewUUID,\n selectedCheckboxes,\n setInternallySelectedCheckboxes,\n selectedItem,\n setSelectedItem,\n expandedGroups,\n setExpandedGroups,\n latestToggledItem,\n setLatestToggledItem,\n focusedItem,\n setFocusedItem,\n hoverItem,\n setHoverItem,\n handleExpandGroup,\n updateUserExpandedState,\n }),\n [\n propsWithDefault,\n virtualListHelpers,\n tree,\n treeRoot,\n visibleItems,\n flattenedItems,\n triggerTreeRerender,\n withRadioChecks,\n withCheckboxChecks,\n withDragAndDrop,\n uniqueTreeViewUUID,\n selectedCheckboxes,\n selectedItem,\n expandedGroups,\n latestToggledItem,\n focusedItem,\n hoverItem,\n handleExpandGroup,\n updateUserExpandedState,\n ],\n );\n // this hooks can't use the context because the context provider doesn't wrap this\n // as such we manually pass the second parameter as fit\n if (instanceRef) instanceRef.current = treeRef.current;\n useInstanceRefActions(treeRef.current, ctx);\n useGlobalToggleAllExpandShortcut(treeRoot, triggerTreeRerender, setLatestToggledItem, updateUserExpandedState);\n useNotifyExpandedChange(propsWithDefault, ctx);\n\n // this is an horrible hack.\n // this is required because there is no \"on rendered\" react-way to check if every children has finished rendering\n // this should be working for now, in the future we may want to review this for a better solution\n useEffect(() => {\n setTimeout(() => onInstanceRefInitialized(treeRef), 100);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return useMemo(() => ({ ctx }), [ctx]);\n};\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,UAAU,QAAQ,WAAW,SAAS,mBAAmB;AAClE,SAAS,kBAAkB;AAC3B,SAAS,8BAA8B,sCAAsC;AAC7E,SAAS,WAAW;AACpB,SAAS,yBAAyB;AAClC,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,eAAe;AACxB,SAAS,yBAAyB,wBAAwB;AAC1D,SAAS,6BAA6B;AACtC,SAAS,wCAAwC;AAM1C,MAAM,cAA4B,CAAC,UAAU;AAClD,QAAM,mBAAmB,6BAAgD,OAAO,YAAY;AAC5F,iCAA+B,kBAAkB,mBAAmB,YAAY;AAChF,QAAM,iBAAiB;AAAA,IACrB,SAAS;AAAA,MACP,iBAAiB,MAAM;AAAA,MAAC;AAAA,MACxB,UAAU,MAAM;AAAA,MAAC;AAAA,MACjB,+BAA+B,MAAM;AAAA,MAAC;AAAA,MACtC,8BAA8B,MAAM;AAAA,MAAC;AAAA,IACvC;AAAA,EACF;AACA,QAAM,UAAU,OAAO,cAAc;AACrC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,CAAC,kBAAkB,IAAI,SAAS,IAAI,CAAC,CAAC;AAC5C,QAAM,CAAC,WAAW,YAAY,IAAI,SAAkC,IAAI;AACxE,QAAM,CAAC,mBAAmB,oBAAoB,IAAI,SAAkC,IAAI;AACxF,QAAM,CAAC,cAAc,eAAe,IAAI,SAAkC,IAAI;AAC9E,QAAM,CAAC,aAAa,cAAc,IAAI,SAAkC,IAAI;AAC5E,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,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAGA,MAAI;AAAa,gBAAY,UAAU,QAAQ;AAC/C,wBAAsB,QAAQ,SAAS,GAAG;AAC1C,mCAAiC,UAAU,qBAAqB,sBAAsB,uBAAuB;AAC7G,0BAAwB,kBAAkB,GAAG;AAK7C,YAAU,MAAM;AACd,eAAW,MAAM,yBAAyB,OAAO,GAAG,GAAG;AAAA,EAEzD,GAAG,CAAC,CAAC;AAEL,SAAO,QAAQ,OAAO,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC;AACvC;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/hoc/DnDTreeContext.tsx"],
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/hoc/DnDTreeContext.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { createContext } from 'react';\nimport type { DSTreeviewT } from '../react-desc-prop-types.js';\nimport { DropIndicatorPosition } from './SortableItemContext.js';\n\ntype DnDTreeContextType = {\n visibleItems: DSTreeviewT.Item[] | undefined;\n dropIndicatorPosition: DropIndicatorPosition;\n isDropValid: boolean;\n};\n\nexport const DnDTreeContext = createContext<DnDTreeContextType>({\n visibleItems: undefined,\n dropIndicatorPosition: DropIndicatorPosition.None,\n isDropValid: false,\n});\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,qBAAqB;AAE9B,SAAS,6BAA6B;AAQ/B,MAAM,iBAAiB,cAAkC;AAAA,EAC9D,cAAc;AAAA,EACd,uBAAuB,sBAAsB;AAAA,EAC7C,aAAa;AACf,CAAC;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/hoc/SortableItemContext.tsx"],
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/hoc/SortableItemContext.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { useSortable } from '@elliemae/ds-drag-and-drop';\nimport { createContext } from 'react';\n\nexport enum DropIndicatorPosition {\n None = 'none',\n Before = 'before',\n After = 'after',\n Inside = 'inside',\n}\n\nexport type SortableItemContextType = {\n draggableProps:\n | false\n | (ReturnType<typeof useSortable> & {\n dropIndicatorPosition: DropIndicatorPosition;\n shouldShowDropIndicatorPosition: boolean;\n isDropValid: boolean;\n });\n};\n\n/** Context for cross component communication */\nexport const SortableItemContext = createContext<SortableItemContextType>({\n draggableProps: false,\n});\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,qBAAqB;AAEvB,IAAK,wBAAL,kBAAKA,2BAAL;AACL,EAAAA,uBAAA,UAAO;AACP,EAAAA,uBAAA,YAAS;AACT,EAAAA,uBAAA,WAAQ;AACR,EAAAA,uBAAA,YAAS;AAJC,SAAAA;AAAA,GAAA;AAkBL,MAAM,sBAAsB,cAAuC;AAAA,EACxE,gBAAgB;AAClB,CAAC;",
6
6
  "names": ["DropIndicatorPosition"]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/hoc/WithConditionalDnDContext.tsx"],
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/hoc/WithConditionalDnDContext.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useContext, useEffect, useMemo, useRef } from 'react';\nimport {\n DndContext,\n DragOverlay,\n SortableContext,\n useTreeDndkitConfig,\n removeChildrenOf,\n} from '@elliemae/ds-drag-and-drop';\nimport type { DSTreeviewT } from '../react-desc-prop-types.js';\nimport TreeViewContext from '../TreeViewContext.js';\nimport { TreeItem } from '../parts/TreeItem.js';\nimport { DnDTreeContext } from './DnDTreeContext.js';\nimport { DropIndicatorPosition } from './SortableItemContext.js';\nimport { toggleItemExpand } from '../utils/group-expands-helpers.js';\n\ntype FunctionalHOC = <T = unknown>(Component: React.ComponentType<T>, ...other: unknown[]) => (props: T) => JSX.Element;\n\nconst ensure = <T,>(argument: T | undefined | null, message = 'This should never happen'): T => {\n if (argument === undefined || argument === null) {\n throw new TypeError(message);\n }\n\n return argument;\n};\n\n// only wraps in \"DnDContext\" and \"DnDTreeContext\" if any Drag and Drop functionality is requested\nexport const withConditionalDnDRowContext: FunctionalHOC = (Component) =>\n function (props) {\n const {\n props: { data, onOrderChange, getIsDropValid },\n flattenedItems,\n updateUserExpandedState,\n triggerTreeRerender,\n visibleItems: flattenedVisibleTree,\n withDragAndDrop,\n } = useContext(TreeViewContext);\n\n const flattenedVisibleTreeForDnD = useMemo(\n () =>\n flattenedVisibleTree.map((item, index) => ({\n uid: item.id.toString(),\n depth: (item.treeDepth ?? 1) - 1,\n realIndex: index,\n childrenCount: item.children?.length ?? 0,\n parentId: item.node.parent?.model?.id?.toString() ?? null,\n original: item,\n })),\n [flattenedVisibleTree],\n );\n\n const onReorder = useCallback(\n (\n _active: DSTreeviewT.DndItem,\n _targetIndex: number,\n { movedData, fromIndex }: { movedData: Record<string, DSTreeviewT.DndItem[]>; fromIndex: number },\n ) => {\n const rootMovedData = movedData.root;\n\n // Pull the row's original data into an object\n const nodes: Record<DSTreeviewT.StringOrNum, DSTreeviewT.SimpleItem> = {};\n rootMovedData.forEach((item) => {\n const originalItem = item.original.model;\n originalItem.children = [];\n nodes[item.uid] = originalItem;\n });\n\n const newUserTree: DSTreeviewT.SimpleItem[] = [];\n rootMovedData.forEach((item) => {\n // If row has parent, insert it to it's subrows\n // otherwise append it to the new user data\n if (item.parentId !== null && item.parentId !== undefined && item.parentId !== '__ds_tree_root') {\n const parentNode = nodes[item.parentId];\n parentNode.children?.push(item.original.model);\n } else if (item.uid !== '__ds_tree_root') {\n newUserTree.push(item.original.model);\n }\n });\n // Tell the user that the order has change, he can chose to commit it or not\n onOrderChange(newUserTree, data, flattenedItems[fromIndex]);\n },\n [onOrderChange, data, flattenedItems],\n );\n\n const theFlattenedItems = useMemo(\n () => flattenedItems.map((datum) => ({ ...datum, collapsed: !datum.original.isExpanded })),\n [flattenedItems],\n );\n\n const { dndContextProps, sortableContextProps, active, dropIndicatorPosition, isDropValid, over } =\n useTreeDndkitConfig({\n flattenedItems: theFlattenedItems,\n isHorizontalDnD: false,\n isExpandable: true,\n onReorder,\n getIsDropValid,\n maxDragAndDropLevel: Infinity,\n });\n\n const containerSortableContextProps = sortableContextProps.root;\n\n const visibleItems = useMemo(() => {\n if (!active) return flattenedVisibleTreeForDnD;\n return removeChildrenOf(flattenedVisibleTreeForDnD, active.id);\n }, [active, flattenedVisibleTreeForDnD]);\n\n const timeoutRef = useRef<NodeJS.Timeout>();\n\n useEffect(() => {\n if (timeoutRef.current) clearTimeout(timeoutRef.current);\n if (dropIndicatorPosition === DropIndicatorPosition.Inside && over) {\n timeoutRef.current = setTimeout(() => {\n const overItem = visibleItems.find((item) => item.uid === over.id);\n if (overItem) {\n const realOverItem = overItem.original;\n if (realOverItem.isGroup && !realOverItem.isExpanded) {\n toggleItemExpand(realOverItem, triggerTreeRerender, updateUserExpandedState);\n }\n }\n }, 1000);\n }\n }, [over, dropIndicatorPosition, triggerTreeRerender, visibleItems, updateUserExpandedState]);\n\n if (withDragAndDrop)\n return (\n <DndContext {...dndContextProps}>\n <SortableContext {...containerSortableContextProps}>\n <DnDTreeContext.Provider\n value={{\n visibleItems: visibleItems.map((item) => item.original),\n dropIndicatorPosition,\n isDropValid,\n }}\n >\n <Component {...props} />\n </DnDTreeContext.Provider>\n </SortableContext>\n <DragOverlay style={{ width: 'auto' }}>\n {active ? (\n <TreeItem\n itemIndex={-1}\n item={ensure(flattenedVisibleTree.find((item) => item.id.toString() === active.id.toString()))}\n isDragOverlay\n />\n ) : null}\n </DragOverlay>\n </DndContext>\n );\n return <Component {...props} />;\n };\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;AC4Hf,SASM,KATN;AA5HR,SAA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AAAA,MACF,GAAG,GAAI;AAAA,IACT;AAAA,EACF,GAAG,CAAC,MAAM,uBAAuB,qBAAqB,cAAc,uBAAuB,CAAC;AAE5F,MAAI;AACF,WACE,qBAAC,cAAY,GAAG,iBACd;AAAA,0BAAC,mBAAiB,GAAG,+BACnB;AAAA,QAAC,eAAe;AAAA,QAAf;AAAA,UACC,OAAO;AAAA,YACL,cAAc,aAAa,IAAI,CAAC,SAAS,KAAK,QAAQ;AAAA,YACtD;AAAA,YACA;AAAA,UACF;AAAA,UAEA,8BAAC,aAAW,GAAG,OAAO;AAAA;AAAA,MACxB,GACF;AAAA,MACA,oBAAC,eAAY,OAAO,EAAE,OAAO,OAAO,GACjC,mBACC;AAAA,QAAC;AAAA;AAAA,UACC,WAAW;AAAA,UACX,MAAM,OAAO,qBAAqB,KAAK,CAAC,SAAS,KAAK,GAAG,SAAS,MAAM,OAAO,GAAG,SAAS,CAAC,CAAC;AAAA,UAC7F,eAAa;AAAA;AAAA,MACf,IACE,MACN;AAAA,OACF;AAEJ,SAAO,oBAAC,aAAW,GAAG,OAAO;AAC/B;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/hoc/WithDnDSortableItemContext.tsx"],
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/hoc/WithDnDSortableItemContext.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unsafe-call */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\nimport React, { useContext, useMemo } from 'react';\nimport { useSortable } from '@elliemae/ds-drag-and-drop';\nimport type { SortableItemContextType } from './SortableItemContext.js';\nimport { SortableItemContext } from './SortableItemContext.js';\nimport TreeViewContext from '../TreeViewContext.js';\nimport { DnDTreeContext } from './DnDTreeContext.js';\nimport type { DSTreeviewT } from '../react-desc-prop-types.js';\n\ntype FunctionalHOC = <T = unknown>(Component: React.ComponentType<T>, ...other: unknown[]) => (props: T) => JSX.Element;\n\nexport const withDnDSortableItemContext: FunctionalHOC = (Component) =>\n function (props: any) {\n const { withDragAndDrop } = useContext(TreeViewContext);\n const { dropIndicatorPosition, isDropValid } = useContext(DnDTreeContext);\n\n const id = (props as { item: DSTreeviewT.Item }).item.id.toString();\n\n // onMount generate unique options, so everyting is only ran once\n const draggableOptions = useMemo(\n () => ({\n id,\n }),\n [id],\n );\n\n const useSortableHelpers = useSortable(draggableOptions);\n\n // calculate all the \"useSortable\" values as per required\n const draggableProps = useMemo(() => {\n if (!withDragAndDrop) return false;\n\n const { index, overIndex } = useSortableHelpers;\n\n return {\n ...useSortableHelpers,\n shouldShowDropIndicatorPosition: overIndex === index,\n dropIndicatorPosition,\n isDropValid,\n };\n }, [withDragAndDrop, useSortableHelpers, dropIndicatorPosition, isDropValid]);\n\n // we use a context so we can easly access information wherever without bubbling down\n // this context is all Memoized so as long as component is not re-mounted,\n // the context won't trigger un-required renders per-se...\n const ctx: SortableItemContextType = useMemo(\n () => ({\n draggableProps,\n }),\n [draggableProps],\n );\n // we always add the context, if draggableProps===false we don't have the DnD enabled.\n return (\n <SortableItemContext.Provider value={ctx}>\n <Component {...props} />\n </SortableItemContext.Provider>\n );\n };\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACwDf;AArDR,SAAgB,YAAY,eAAe;AAC3C,SAAS,mBAAmB;AAE5B,SAAS,2BAA2B;AACpC,OAAO,qBAAqB;AAC5B,SAAS,sBAAsB;AAKxB,MAAM,6BAA4C,CAAC,cACxD,SAAU,OAAY;AACpB,QAAM,EAAE,gBAAgB,IAAI,WAAW,eAAe;AACtD,QAAM,EAAE,uBAAuB,YAAY,IAAI,WAAW,cAAc;AAExE,QAAM,KAAM,MAAqC,KAAK,GAAG,SAAS;AAGlE,QAAM,mBAAmB;AAAA,IACvB,OAAO;AAAA,MACL;AAAA,IACF;AAAA,IACA,CAAC,EAAE;AAAA,EACL;AAEA,QAAM,qBAAqB,YAAY,gBAAgB;AAGvD,QAAM,iBAAiB,QAAQ,MAAM;AACnC,QAAI,CAAC;AAAiB,aAAO;AAE7B,UAAM,EAAE,OAAO,UAAU,IAAI;AAE7B,WAAO;AAAA,MACL,GAAG;AAAA,MACH,iCAAiC,cAAc;AAAA,MAC/C;AAAA,MACA;AAAA,IACF;AAAA,EACF,GAAG,CAAC,iBAAiB,oBAAoB,uBAAuB,WAAW,CAAC;AAK5E,QAAM,MAA+B;AAAA,IACnC,OAAO;AAAA,MACL;AAAA,IACF;AAAA,IACA,CAAC,cAAc;AAAA,EACjB;AAEA,SACE,oBAAC,oBAAoB,UAApB,EAA6B,OAAO,KACnC,8BAAC,aAAW,GAAG,OAAO,GACxB;AAEJ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './TreeView.js';\nexport * from './plugins/index.js';\n\nexport { TreeViewSearchBar } from './related-components/TreeViewSearchBar.js';\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;AAEd,SAAS,yBAAyB;",
6
6
  "names": []
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { useContext, useCallback, useMemo } from "react";
4
- import { DSCheckbox } from "@elliemae/ds-form";
4
+ import { DSControlledCheckbox } from "@elliemae/ds-controlled-form";
5
5
  import { styled } from "@elliemae/ds-system";
6
6
  import TreeViewContext from "../TreeViewContext.js";
7
7
  import { toggleCheckboxItem } from "../utils/selectable-helper.js";
@@ -11,17 +11,18 @@ const StyledCheckboxWrapper = styled.span`
11
11
  `;
12
12
  const CheckboxSelectable = (props) => {
13
13
  const { item, itemIndex } = props;
14
- const { id } = item;
14
+ const { id, children } = item;
15
15
  const ctx = useContext(TreeViewContext);
16
16
  const {
17
17
  props: { onSelectionChange, isItemDisabled },
18
18
  virtualListHelpers: { scrollToIndex },
19
19
  triggerTreeRerender,
20
20
  selectedCheckboxes,
21
- setInternallySelectedCheckboxes
21
+ setInternallySelectedCheckboxes,
22
+ uniqueTreeViewUUID
22
23
  } = ctx;
23
24
  const onCheckboxChange = useCallback(() => {
24
- const newSelections = toggleCheckboxItem(item);
25
+ const newSelections = toggleCheckboxItem(item, selectedCheckboxes);
25
26
  const newSelectionHasmap = filterObject(
26
27
  { ...selectedCheckboxes, ...newSelections },
27
28
  (value) => value !== false
@@ -56,13 +57,22 @@ const CheckboxSelectable = (props) => {
56
57
  return false;
57
58
  }, [selectedCheckboxes, id]);
58
59
  const isDisabled = useMemo(() => isItemDisabled(item), [item, isItemDisabled]);
60
+ const ariaControls = useMemo(() => {
61
+ if (children.length) {
62
+ const childrenIds = children.map((child) => `ds-item-${uniqueTreeViewUUID}-${child.id}`);
63
+ return childrenIds.join(" ");
64
+ }
65
+ return void 0;
66
+ }, [children, uniqueTreeViewUUID]);
59
67
  return /* @__PURE__ */ jsx(StyledCheckboxWrapper, { children: /* @__PURE__ */ jsx(
60
- DSCheckbox,
68
+ DSControlledCheckbox,
61
69
  {
62
70
  checked: isChecked,
63
71
  disabled: isDisabled,
64
72
  className: "em-ds-tree-item-checkbox",
65
73
  "data-testid": "tree-item-checkbox",
74
+ "aria-controls": ariaControls,
75
+ id: `ds-item-${uniqueTreeViewUUID}-${id}`,
66
76
  onChange: onCheckboxChange,
67
77
  tabIndex: "0"
68
78
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/CheckboxSelectable.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext, useCallback, useMemo } from 'react';\nimport { DSCheckbox } from '@elliemae/ds-form';\nimport { styled } from '@elliemae/ds-system';\nimport TreeViewContext from '../TreeViewContext.js';\nimport { toggleCheckboxItem } from '../utils/selectable-helper.js';\nimport { filterObject } from '../utils/object-helpers.js';\nimport type { DSTreeviewT } from '../react-desc-prop-types.js';\nconst StyledCheckboxWrapper = styled.span`\n padding-top: 3px;\n`;\ninterface PropsT {\n item: DSTreeviewT.Item;\n itemIndex: number;\n}\nconst CheckboxSelectable = (props: PropsT): JSX.Element | null => {\n const { item, itemIndex } = props;\n const { id } = item;\n\n const ctx = useContext(TreeViewContext);\n const {\n props: { onSelectionChange, isItemDisabled },\n virtualListHelpers: { scrollToIndex },\n triggerTreeRerender,\n selectedCheckboxes,\n setInternallySelectedCheckboxes,\n } = ctx;\n\n const onCheckboxChange = useCallback(() => {\n const newSelections = toggleCheckboxItem(item);\n const newSelectionHasmap = filterObject<DSTreeviewT.SelectionState>(\n { ...selectedCheckboxes, ...newSelections },\n (value) => value !== false,\n );\n setInternallySelectedCheckboxes(newSelectionHasmap);\n triggerTreeRerender();\n\n const indexAndScrollTo = {\n scrollToItem: () => {\n if (typeof item.virtualIndex === 'number') scrollToIndex(item.virtualIndex);\n },\n itemIndex,\n };\n if (onSelectionChange) onSelectionChange(newSelectionHasmap, item, indexAndScrollTo);\n }, [\n item,\n triggerTreeRerender,\n onSelectionChange,\n itemIndex,\n scrollToIndex,\n selectedCheckboxes,\n setInternallySelectedCheckboxes,\n ]);\n const isChecked = useMemo(() => {\n if (selectedCheckboxes[id] === 'mixed') {\n return 'mixed' as const;\n }\n if (selectedCheckboxes[id] === true) {\n return true;\n }\n return false;\n }, [selectedCheckboxes, id]);\n\n const isDisabled = useMemo(() => isItemDisabled(item), [item, isItemDisabled]);\n\n return (\n <StyledCheckboxWrapper>\n <DSCheckbox\n checked={isChecked}\n disabled={isDisabled}\n className=\"em-ds-tree-item-checkbox\"\n data-testid=\"tree-item-checkbox\"\n onChange={onCheckboxChange}\n tabIndex=\"0\"\n />\n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AoB,EAAE,CAAC;AAE3B,QAAM,aAAa,QAAQ,MAAM,eAAe,IAAI,GAAG,CAAC,MAAM,cAAc,CAAC;AAE7E,SACE,oBAAC,yBACC;AAAA,IAAC;AAAA;AAAA,MACC,SAAS;AAAA,MACT,UAAU;AAAA,MACV,WAAU;AAAA,MACV,eAAY;AAAA,MACZ,UAAU;AAAA,MACV,UAAS;AAAA;AAAA,EACX,GACF;AAEJ;AAEA,IAAO,6BAAQ;",
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/CheckboxSelectable.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext, useCallback, useMemo } from 'react';\nimport { DSControlledCheckbox } from '@elliemae/ds-controlled-form';\nimport { styled } from '@elliemae/ds-system';\nimport TreeViewContext from '../TreeViewContext.js';\nimport { toggleCheckboxItem } from '../utils/selectable-helper.js';\nimport { filterObject } from '../utils/object-helpers.js';\nimport type { DSTreeviewT } from '../react-desc-prop-types.js';\nconst StyledCheckboxWrapper = styled.span`\n padding-top: 3px;\n`;\ninterface PropsT {\n item: DSTreeviewT.Item;\n itemIndex: number;\n}\nconst CheckboxSelectable = (props: PropsT): JSX.Element | null => {\n const { item, itemIndex } = props;\n const { id, children } = item;\n\n const ctx = useContext(TreeViewContext);\n const {\n props: { onSelectionChange, isItemDisabled },\n virtualListHelpers: { scrollToIndex },\n triggerTreeRerender,\n selectedCheckboxes,\n setInternallySelectedCheckboxes,\n uniqueTreeViewUUID,\n } = ctx;\n\n const onCheckboxChange = useCallback(() => {\n const newSelections = toggleCheckboxItem(item, selectedCheckboxes);\n const newSelectionHasmap = filterObject<DSTreeviewT.SelectionState>(\n { ...selectedCheckboxes, ...newSelections },\n (value) => value !== false,\n );\n setInternallySelectedCheckboxes(newSelectionHasmap);\n triggerTreeRerender();\n\n const indexAndScrollTo = {\n scrollToItem: () => {\n if (typeof item.virtualIndex === 'number') scrollToIndex(item.virtualIndex);\n },\n itemIndex,\n };\n if (onSelectionChange) onSelectionChange(newSelectionHasmap, item, indexAndScrollTo);\n }, [\n item,\n triggerTreeRerender,\n onSelectionChange,\n itemIndex,\n scrollToIndex,\n selectedCheckboxes,\n setInternallySelectedCheckboxes,\n ]);\n const isChecked = useMemo(() => {\n if (selectedCheckboxes[id] === 'mixed') {\n return 'mixed' as const;\n }\n if (selectedCheckboxes[id] === true) {\n return true;\n }\n return false;\n }, [selectedCheckboxes, id]);\n\n const isDisabled = useMemo(() => isItemDisabled(item), [item, isItemDisabled]);\n const ariaControls = useMemo(() => {\n if (children.length) {\n const childrenIds = children.map((child) => `ds-item-${uniqueTreeViewUUID}-${child.id}`);\n return childrenIds.join(' ');\n }\n return undefined;\n }, [children, uniqueTreeViewUUID]);\n\n return (\n <StyledCheckboxWrapper>\n <DSControlledCheckbox\n checked={isChecked}\n disabled={isDisabled}\n className=\"em-ds-tree-item-checkbox\"\n data-testid=\"tree-item-checkbox\"\n aria-controls={ariaControls}\n id={`ds-item-${uniqueTreeViewUUID}-${id}`}\n onChange={onCheckboxChange}\n tabIndex=\"0\"\n />\n </StyledCheckboxWrapper>\n );\n};\n\nexport default CheckboxSelectable;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;AC0EjB;AA1EN,SAAgB,YAAY,aAAa,eAAe;AACxD,SAAS,4BAA4B;AACrC,SAAS,cAAc;AACvB,OAAO,qBAAqB;AAC5B,SAAS,0BAA0B;AACnC,SAAS,oBAAoB;AAE7B,MAAM,wBAAwB,OAAO;AAAA;AAAA;AAOrC,MAAM,qBAAqB,CAAC,UAAsC;AAChE,QAAM,EAAE,MAAM,UAAU,IAAI;AAC5B,QAAM,EAAE,IAAI,SAAS,IAAI;AAEzB,QAAM,MAAM,WAAW,eAAe;AACtC,QAAM;AAAA,IACJ,OAAO,EAAE,mBAAmB,eAAe;AAAA,IAC3C,oBAAoB,EAAE,cAAc;AAAA,IACpC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QA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;AAEJ;AAEA,IAAO,6BAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/ChildrenCountDisplayer.tsx"],
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/ChildrenCountDisplayer.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/function-component-definition */\nimport React from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { DSTreeViewPrefix, treeItemBlockName } from '../config/cssClassesConstants.js';\nimport type { DSTreeviewT } from '../react-desc-prop-types.js';\n\nconst Separator = styled.span`\n width: 1px;\n height: 12px;\n margin: 0 8px;\n border-left: 1px solid ${(props) => props.theme.colors.neutral['600']};\n font-size: 12px;\n`;\n\nconst className = `${DSTreeViewPrefix}-${treeItemBlockName}-children-count-displayer`;\n\ninterface PropsT {\n item: DSTreeviewT.Item;\n}\n\nexport const ChildrenCountDisplayer: React.ComponentType<PropsT> = (props) => {\n const { item } = props;\n const { isGroup, children } = item;\n\n if (!isGroup) return null;\n return (\n <span data-testid=\"tree-item-children-count-displayer\" className={className}>\n <Separator />\n {`${children.length} Items`}\n </span>\n );\n};\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;AC0BnB,SACE,KADF;AAxBJ,SAAS,cAAc;AACvB,SAAS,kBAAkB,yBAAyB;AAGpD,MAAM,YAAY,OAAO;AAAA;AAAA;AAAA;AAAA,2BAIE,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK;AAAA;AAAA;AAItE,MAAM,YAAY,GAAG,oBAAoB;AAMlC,MAAM,yBAAsD,CAAC,UAAU;AAC5E,QAAM,EAAE,KAAK,IAAI;AACjB,QAAM,EAAE,SAAS,SAAS,IAAI;AAE9B,MAAI,CAAC;AAAS,WAAO;AACrB,SACE,qBAAC,UAAK,eAAY,sCAAqC,WACrD;AAAA,wBAAC,aAAU;AAAA,IACV,GAAG,SAAS;AAAA,KACf;AAEJ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/DnDHandle.tsx"],
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/DnDHandle.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { GripperVertical } from '@elliemae/ds-icons';\nimport { SortableItemContext } from '../hoc/SortableItemContext.js';\nimport type { DSTreeviewT } from '../react-desc-prop-types.js';\n\ninterface DnDHandleProps {\n id: DSTreeviewT.StringOrNum;\n isDragOverlay: boolean;\n}\n\nexport const DnDHandle = ({ id, isDragOverlay }: DnDHandleProps) => {\n const { draggableProps } = useContext(SortableItemContext);\n\n const isDragging = draggableProps && draggableProps.isDragging;\n\n return (\n <GripperVertical\n role=\"button\"\n {...(draggableProps && {\n ...draggableProps.listeners,\n ...draggableProps.attributes,\n })}\n data-testid=\"drag-handle\"\n data-isactive={draggableProps && !!draggableProps.active}\n data-isdragoverlay={isDragOverlay}\n id={`${id}-drag-handle`}\n key={`${id}-drag-handle`}\n className={`drag-handle ${isDragging ? '' : 'focuseable'}`}\n color={isDragging ? ['neutral', '080'] : ['brand-primary', '800']}\n size=\"s\"\n tabIndex={0}\n />\n );\n};\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACgBnB;AAhBJ,SAAgB,kBAAkB;AAClC,SAAS,uBAAuB;AAChC,SAAS,2BAA2B;AAQ7B,MAAM,YAAY,CAAC,EAAE,IAAI,cAAc,MAAsB;AAClE,QAAM,EAAE,eAAe,IAAI,WAAW,mBAAmB;AAEzD,QAAM,aAAa,kBAAkB,eAAe;AAEpD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACJ,GAAI,kBAAkB;AAAA,QACrB,GAAG,eAAe;AAAA,QAClB,GAAG,eAAe;AAAA,MACpB;AAAA,MACA,eAAY;AAAA,MACZ,iBAAe,kBAAkB,CAAC,CAAC,eAAe;AAAA,MAClD,sBAAoB;AAAA,MACpB,IAAI,GAAG;AAAA,MACP,KAAK,GAAG;AAAA,MACR,WAAW,eAAe,aAAa,KAAK;AAAA,MAC5C,OAAO,aAAa,CAAC,WAAW,KAAK,IAAI,CAAC,iBAAiB,KAAK;AAAA,MAChE,MAAK;AAAA,MACL,UAAU;AAAA;AAAA,EACZ;AAEJ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/DropIndicator.tsx"],
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/DropIndicator.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { DropIndicatorPosition } from '../hoc/SortableItemContext.js';\n\ninterface DropIndicatorProps {\n vertical?: boolean;\n dropIndicatorPosition: DropIndicatorPosition | false;\n isLast?: boolean;\n isDropValid?: boolean;\n}\n\nconst getPositionStyles = ({ dropIndicatorPosition }: DropIndicatorProps) => `\n top: ${dropIndicatorPosition === DropIndicatorPosition.Before ? '0' : 'unset'};\n bottom: ${dropIndicatorPosition === DropIndicatorPosition.After ? '0' : 'unset'};\n left: -2px;\n `;\n\nconst getCircleStyles = ({ dropIndicatorPosition }: DropIndicatorProps) => ({\n position: 'absolute',\n zIndex: 20,\n top: dropIndicatorPosition === DropIndicatorPosition.After ? 'unset' : '-2px',\n bottom: dropIndicatorPosition === DropIndicatorPosition.Before ? 'unset' : '-2px',\n left: '0px',\n opacity: 1,\n});\n\nconst StyledIndicator = styled.div<DropIndicatorProps>`\n position: absolute;\n ${getPositionStyles}\n box-sizing: border-box;\n width: ${(props) => (props.vertical ? '2px' : '100%')};\n height: ${(props) => (props.vertical ? '100%' : '2px')};\n background-color: ${({ isDropValid, theme }) => (isDropValid ? theme.colors.brand[600] : theme.colors.danger[900])};\n z-index: 20;\n`;\n\nconst CircleIndicator = (style: Record<string, unknown>, isDropValid: boolean | null | undefined) => (\n <svg height=\"6\" width=\"6\" style={style}>\n <circle cx=\"3\" cy=\"3\" r=\"3\" strokeWidth=\"0\" fill={isDropValid ? '#1E79C2' : '#C64252'} />\n </svg>\n);\n\nconst DropIndicator: React.ComponentType<DropIndicatorProps> = ({ dropIndicatorPosition, isLast, isDropValid }) => {\n if (\n ![DropIndicatorPosition.After, DropIndicatorPosition.Before].includes(\n dropIndicatorPosition as DropIndicatorPosition,\n )\n )\n return null;\n\n const safeDropIndicatorPosition = isLast ? DropIndicatorPosition.Before : dropIndicatorPosition;\n\n return (\n <>\n {CircleIndicator(getCircleStyles({ dropIndicatorPosition: safeDropIndicatorPosition }), isDropValid)}\n <StyledIndicator dropIndicatorPosition={safeDropIndicatorPosition} isDropValid={isDropValid} />\n </>\n );\n};\n\nexport default DropIndicator;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACsCnB,SAeA,UAfA,KAeA,YAfA;AArCJ,SAAS,cAAc;AACvB,SAAS,6BAA6B;AAStC,MAAM,oBAAoB,CAAC,EAAE,sBAAsB,MAA0B;AAAA,aAChE,0BAA0B,sBAAsB,SAAS,MAAM;AAAA,gBAC5D,0BAA0B,sBAAsB,QAAQ,MAAM;AAAA;AAAA;AAI9E,MAAM,kBAAkB,CAAC,EAAE,sBAAsB,OAA2B;AAAA,EAC1E,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,KAAK,0BAA0B,sBAAsB,QAAQ,UAAU;AAAA,EACvE,QAAQ,0BAA0B,sBAAsB,SAAS,UAAU;AAAA,EAC3E,MAAM;AAAA,EACN,SAAS;AACX;AAEA,MAAM,kBAAkB,OAAO;AAAA;AAAA,IAE3B;AAAA;AAAA,WAEO,CAAC,UAAW,MAAM,WAAW,QAAQ;AAAA,YACpC,CAAC,UAAW,MAAM,WAAW,SAAS;AAAA,sBAC5B,CAAC,EAAE,aAAa,MAAM,MAAO,cAAc,MAAM,OAAO,MAAM,GAAG,IAAI,MAAM,OAAO,OAAO,GAAG;AAAA;AAAA;AAIlH,MAAM,kBAAkB,CAAC,OAAgC,gBACvD,oBAAC,SAAI,QAAO,KAAI,OAAM,KAAI,OACxB,8BAAC,YAAO,IAAG,KAAI,IAAG,KAAI,GAAE,KAAI,aAAY,KAAI,MAAM,cAAc,YAAY,WAAW,GACzF;AAGF,MAAM,gBAAyD,CAAC,EAAE,uBAAuB,QAAQ,YAAY,MAAM;AACjH,MACE,CAAC,CAAC,sBAAsB,OAAO,sBAAsB,MAAM,EAAE;AAAA,IAC3D;AAAA,EACF;AAEA,WAAO;AAET,QAAM,4BAA4B,SAAS,sBAAsB,SAAS;AAE1E,SACE,iCACG;AAAA,oBAAgB,gBAAgB,EAAE,uBAAuB,0BAA0B,CAAC,GAAG,WAAW;AAAA,IACnG,oBAAC,mBAAgB,uBAAuB,2BAA2B,aAA0B;AAAA,KAC/F;AAEJ;AAEA,IAAO,wBAAQ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/ExpandCaret.tsx"],
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/ExpandCaret.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext, useCallback } from 'react';\nimport { DSButtonV2 } from '@elliemae/ds-button-v2';\nimport { ArrowheadDown, ArrowheadRight } from '@elliemae/ds-icons';\nimport { toggleItemExpand } from '../utils/group-expands-helpers.js';\nimport { focusItem } from '../utils/tree-helpers.js';\nimport TreeViewContext from '../TreeViewContext.js';\nimport type { DSTreeviewT } from '../react-desc-prop-types.js';\n\ninterface PropsT {\n item: DSTreeviewT.Item;\n}\n\nexport const ExpandCaret = (props: PropsT): JSX.Element | null => {\n const defaultHandleExpandGroup = useCallback(toggleItemExpand, []);\n const { item } = props;\n const { id, isExpanded, isGroup, children } = item;\n const isGroupOrHasChildrens = isGroup || (Array.isArray(children) && children.length > 0);\n const ctx = useContext(TreeViewContext);\n const {\n props: { onItemFocus },\n handleExpandGroup = defaultHandleExpandGroup,\n triggerTreeRerender,\n updateUserExpandedState,\n setLatestToggledItem,\n setFocusedItem,\n virtualListHelpers: { scrollToIndex },\n } = ctx;\n\n if (isGroupOrHasChildrens)\n return (\n <DSButtonV2\n buttonType=\"icon\"\n className=\"expandable-arrow\"\n data-testid=\"tree-item-expand-toggle\"\n key={`${id}-expand-addon`}\n onMouseDown={(e: React.MouseEvent) => {\n // prevent focusing the caret\n if (e) {\n e.preventDefault();\n }\n }}\n onClick={(e) => {\n e.stopPropagation();\n if (e) handleExpandGroup(item, triggerTreeRerender, updateUserExpandedState, scrollToIndex, e);\n setLatestToggledItem(item);\n const itemVitualIndex = item.virtualIndex;\n if (typeof itemVitualIndex === 'number') {\n onItemFocus({\n itemIndex: itemVitualIndex,\n scrollToItem: (opts = { align: 'start' }) => scrollToIndex(itemVitualIndex, opts),\n item,\n });\n }\n setFocusedItem(item);\n focusItem(item);\n }}\n size=\"s\"\n tabIndex={-1}\n >\n {isExpanded ? (\n <ArrowheadDown size=\"s\" data-testid=\"ic-arrow-head-down\" color={['brand-primary', '800']} />\n ) : (\n <ArrowheadRight size=\"s\" data-testid=\"ic-arrow-head-right\" color={['brand-primary', '800']} />\n )}\n </DSButtonV2>\n );\n return <div style={{ width: '24px' }} />;\n};\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;AC4Db;AA5DV,SAAgB,YAAY,mBAAmB;AAC/C,SAAS,kBAAkB;AAC3B,SAAS,eAAe,sBAAsB;AAC9C,SAAS,wBAAwB;AACjC,SAAS,iBAAiB;AAC1B,OAAO,qBAAqB;AAOrB,MAAM,cAAc,CAAC,UAAsC;AAChE,QAAM,2BAA2B,YAAY,kBAAkB,CAAC,CAAC;AACjE,QAAM,EAAE,KAAK,IAAI;AACjB,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sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/Icon.tsx"],
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/Icon.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { cx } from '@elliemae/ds-utilities';\nimport TreeViewContext from '../TreeViewContext.js';\nimport type { DSTreeviewT } from '../react-desc-prop-types.js';\ninterface PropsT {\n item: DSTreeviewT.Item;\n}\nexport const Icon = (props: PropsT): JSX.Element | null => {\n const { item } = props;\n const isGroupOrHasChildrens = item.isGroup || (Array.isArray(item.children) && item.children.length > 0);\n const ctx = useContext(TreeViewContext);\n const {\n props: { groupIcon, itemIcon },\n } = ctx;\n const icon = isGroupOrHasChildrens ? groupIcon : itemIcon;\n if (!icon) return null;\n\n return React.cloneElement(icon, {\n 'data-testid': isGroupOrHasChildrens ? 'tree-item-group-icon' : 'tree-item-icon',\n // legacy class-name way of handling things,\n // this will eventually be deprecated in favor of styled components\n // untill then, just eslint-ignore and move on\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment\n className: cx(icon.props.className, 'tree-item-icon'),\n });\n};\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,UAAS,kBAAkB;AAClC,SAAS,UAAU;AACnB,OAAO,qBAAqB;AAKrB,MAAM,OAAO,CAAC,UAAsC;AACzD,QAAM,EAAE,KAAK,IAAI;AACjB,QAAM,wBAAwB,KAAK,WAAY,MAAM,QAAQ,KAAK,QAAQ,KAAK,KAAK,SAAS,SAAS;AACtG,QAAM,MAAM,WAAW,eAAe;AACtC,QAAM;AAAA,IACJ,OAAO,EAAE,WAAW,SAAS;AAAA,EAC/B,IAAI;AACJ,QAAM,OAAO,wBAAwB,YAAY;AACjD,MAAI,CAAC;AAAM,WAAO;AAElB,SAAOA,OAAM,aAAa,MAAM;AAAA,IAC9B,eAAe,wBAAwB,yBAAyB;AAAA;AAAA;AAAA;AAAA;AAAA,IAKhE,WAAW,GAAG,KAAK,MAAM,WAAW,gBAAgB;AAAA,EACtD,CAAC;AACH;",
6
6
  "names": ["React"]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/NestingSpace.tsx"],
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/NestingSpace.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport type { DSTreeviewT } from '../react-desc-prop-types.js';\n\nconst getItemNestingLeftPadding = (level: number, opts: { spaceForNestingLevel: number }) => {\n const { spaceForNestingLevel = 1.5 } = opts;\n const groupLeftPadding = spaceForNestingLevel * (level - 1);\n const finalLeftPadding = groupLeftPadding + spaceForNestingLevel - 0.1;\n // root level left-padding would be negative and would not be applied\n // if \"root-level\" nesting, then defaults to 0 left-padding.\n return finalLeftPadding > 0 ? `${finalLeftPadding}em` : '0';\n};\n\ntype NestingSpacePropsType = {\n item: DSTreeviewT.Item;\n spaceForNestingLevel: number;\n};\n\nexport const NestingSpace = (props: NestingSpacePropsType): JSX.Element | null => {\n const { item, spaceForNestingLevel } = props;\n const { treeDepth } = item;\n if (treeDepth) {\n const itemNestingLeftPadding = getItemNestingLeftPadding(treeDepth - 1, {\n spaceForNestingLevel,\n });\n\n return <div data-testid=\"tree-item-nested-space\" style={{ width: itemNestingLeftPadding }} />;\n }\n return null;\n};\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACyBZ;AAtBX,MAAM,4BAA4B,CAAC,OAAe,SAA2C;AAC3F,QAAM,EAAE,uBAAuB,IAAI,IAAI;AACvC,QAAM,mBAAmB,wBAAwB,QAAQ;AACzD,QAAM,mBAAmB,mBAAmB,uBAAuB;AAGnE,SAAO,mBAAmB,IAAI,GAAG,uBAAuB;AAC1D;AAOO,MAAM,eAAe,CAAC,UAAqD;AAChF,QAAM,EAAE,MAAM,qBAAqB,IAAI;AACvC,QAAM,EAAE,UAAU,IAAI;AACtB,MAAI,WAAW;AACb,UAAM,yBAAyB,0BAA0B,YAAY,GAAG;AAAA,MACtE;AAAA,IACF,CAAC;AAED,WAAO,oBAAC,SAAI,eAAY,0BAAyB,OAAO,EAAE,OAAO,uBAAuB,GAAG;AAAA,EAC7F;AACA,SAAO;AACT;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/RadioSelectable.tsx"],
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/RadioSelectable.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext, useCallback, useMemo } from 'react';\nimport { DSRadio } from '@elliemae/ds-form';\nimport TreeViewContext from '../TreeViewContext.js';\nimport type { DSTreeviewT } from '../react-desc-prop-types.js';\ninterface PropsT {\n item: DSTreeviewT.Item;\n itemIndex: number;\n}\nconst RadioSelectable = (props: PropsT) => {\n const { item, itemIndex } = props;\n\n const ctx = useContext(TreeViewContext);\n const {\n props: { onSelectionChange, isItemDisabled },\n virtualListHelpers: { scrollToIndex },\n uniqueTreeViewUUID,\n selectedCheckboxes,\n setInternallySelectedCheckboxes,\n } = ctx;\n\n const { id } = item;\n\n const onRadioChange = useCallback(() => {\n const newSelectionHasmap = { [id]: true };\n setInternallySelectedCheckboxes(newSelectionHasmap);\n const indexAndScrollTo = {\n scrollToItem: () => {\n if (item.virtualIndex) scrollToIndex(item.virtualIndex);\n },\n itemIndex,\n };\n if (onSelectionChange) onSelectionChange(newSelectionHasmap, item, indexAndScrollTo);\n }, [id, setInternallySelectedCheckboxes, itemIndex, onSelectionChange, item, scrollToIndex]);\n\n const radioName = useMemo(() => `radios-${uniqueTreeViewUUID}`, [uniqueTreeViewUUID]);\n\n const isDisabled = useMemo(() => isItemDisabled(item), [item, isItemDisabled]);\n\n return (\n <DSRadio\n checked={selectedCheckboxes[id] === true}\n name={radioName}\n disabled={isDisabled}\n className=\"em-ds-tree-item-radio\"\n data-testid=\"tree-item-radio\"\n onChange={onRadioChange}\n tabIndex={0}\n />\n );\n};\n\nexport default RadioSelectable;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACuCnB;AAvCJ,SAAgB,YAAY,aAAa,eAAe;AACxD,SAAS,eAAe;AACxB,OAAO,qBAAqB;AAM5B,MAAM,kBAAkB,CAAC,UAAkB;AACzC,QAAM,EAAE,MAAM,UAAU,IAAI;AAE5B,QAAM,MAAM,WAAW,eAAe;AACtC,QAAM;AAAA,IACJ,OAAO,EAAE,mBAAmB,eAAe;AAAA,IAC3C,oBAAoB,EAAE,cAAc;AAAA,IACpC;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,EAAE,GAAG,IAAI;AAEf,QAAM,gBAAgB,YAAY,MAAM;AACtC,UAAM,qBAAqB,EAAE,CAAC,EAAE,GAAG,KAAK;AACxC,oCAAgC,kBAAkB;AAClD,UAAM,mBAAmB;AAAA,MACvB,cAAc,MAAM;AAClB,YAAI,KAAK;AAAc,wBAAc,KAAK,YAAY;AAAA,MACxD;AAAA,MACA;AAAA,IACF;AACA,QAAI;AAAmB,wBAAkB,oBAAoB,MAAM,gBAAgB;AAAA,EACrF,GAAG,CAAC,IAAI,iCAAiC,WAAW,mBAAmB,MAAM,aAAa,CAAC;AAE3F,QAAM,YAAY,QAAQ,MAAM,UAAU,sBAAsB,CAAC,kBAAkB,CAAC;AAEpF,QAAM,aAAa,QAAQ,MAAM,eAAe,IAAI,GAAG,CAAC,MAAM,cAAc,CAAC;AAE7E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,SAAS,mBAAmB,EAAE,MAAM;AAAA,MACpC,MAAM;AAAA,MACN,UAAU;AAAA,MACV,WAAU;AAAA,MACV,eAAY;AAAA,MACZ,UAAU;AAAA,MACV,UAAU;AAAA;AAAA,EACZ;AAEJ;AAEA,IAAO,0BAAQ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/TreeItem.tsx"],
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/TreeItem.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport React, { useContext, useMemo, useCallback } from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport RadioSelectable from './RadioSelectable.js';\nimport CheckboxSelectable from './CheckboxSelectable.js';\nimport TreeViewContext from '../TreeViewContext.js';\nimport { setMultipleRefs } from '../utils/refs-helpers.js';\nimport { useOnItemKeyDown } from '../utils/keyboard-helpers.js';\nimport { NestingSpace } from './NestingSpace.js';\nimport { Icon } from './Icon.js';\nimport { ExpandCaret } from './ExpandCaret.js';\nimport { TreeItemText } from './TreeItemText.js';\nimport { DSTreeViewPrefix, treeItemBlockName } from '../config/cssClassesConstants.js';\nimport type { DSTreeviewT } from '../react-desc-prop-types.js';\nimport { DnDHandle } from './DnDHandle.js';\nimport { withDnDSortableItemContext } from '../hoc/WithDnDSortableItemContext.js';\nimport { DropIndicatorPosition, SortableItemContext } from '../hoc/SortableItemContext.js';\nimport DropIndicator from './DropIndicator.js';\n\nexport const TreeListItem = aggregatedClasses('li', {\n 'data-testid': treeItemBlockName,\n role: 'treeitem',\n // temp fix untill we move to styled components\n})(treeItemBlockName) as unknown as React.ComponentType<React.ComponentProps<'li'>>;\n\nexport const TreeListItemAddonsWrapper = aggregatedClasses('div')(\n treeItemBlockName,\n 'addons',\n // temp fix untill we move to styled components\n) as unknown as React.ComponentType<React.ComponentProps<'div'>>;\n\ninterface PropsT {\n item: DSTreeviewT.Item;\n itemIndex: number;\n isDragOverlay?: boolean;\n virtualItemRef?: React.RefObject<HTMLLIElement>;\n itemWrapperStyle?: { [key: string]: unknown };\n spaceForNestingLevel?: number;\n}\n\n// we ensure the priority of legacy rightAddons over the new RightAddons\n// we also enable the cleaner syntax in the JSX returned by this component as per \"<FinalRightAddons />\"\n// NOTE: the legacy rightAddons is still not allowing for instanciated components even if we are enabling the cleaner syntax\n// NOTE 2: this component is meant to already wrap the right-addons in a TreeListItemAddonsWrapper for class-name purposes\nconst FinalRightAddons = ({\n item,\n RightAddons,\n rightAddons,\n}: {\n item: DSTreeviewT.Item;\n RightAddons: DSTreeviewT.PropsOptional['RightAddons'];\n rightAddons: DSTreeviewT.PropsOptional['rightAddons'];\n}) => {\n if (RightAddons)\n return (\n <TreeListItemAddonsWrapper>\n <RightAddons item={item} />\n </TreeListItemAddonsWrapper>\n );\n if (rightAddons)\n return (\n <TreeListItemAddonsWrapper>\n {typeof rightAddons === 'function' ? rightAddons(item) : rightAddons}\n </TreeListItemAddonsWrapper>\n );\n\n return null;\n};\n\nexport const TreeItem = (props: PropsT): JSX.Element => {\n const {\n item,\n itemIndex,\n itemWrapperStyle = {},\n virtualItemRef,\n spaceForNestingLevel = 1.5,\n isDragOverlay = false,\n } = props;\n const { id, node, children } = item;\n const { nodeItemRef } = node.model;\n\n const { draggableProps } = useContext(SortableItemContext);\n\n const onItemKeyDown = useOnItemKeyDown(item, draggableProps);\n\n const ctx = useContext(TreeViewContext);\n const {\n props: {\n disableIcons,\n rightAddons,\n RightAddons,\n onItemClick,\n onItemActivate,\n onItemFocus,\n rowSize,\n labelOverflow,\n nameKey,\n showChildrenAmount,\n },\n withRadioChecks,\n withCheckboxChecks,\n withDragAndDrop,\n selectedItem,\n selectedCheckboxes,\n hoverItem,\n virtualListHelpers: { scrollToIndex },\n setHoverItem,\n setSelectedItem,\n setFocusedItem,\n } = ctx;\n const itemLabelText = item[nameKey] as DSTreeviewT.Item['name'];\n\n // Sortable Items needs to update\n // - the virtual list ref (for react-virtual requirement)\n // - nodeItemRef which is a prop avaiable in the TreeModel nodes\n // - the drag and drop node reference\n const setItemRefs: React.LegacyRef<HTMLLIElement> | undefined = (ref: HTMLLIElement) => {\n setMultipleRefs(\n virtualItemRef,\n !isDragOverlay && nodeItemRef,\n !isDragOverlay && draggableProps && draggableProps.setNodeRef,\n )(ref);\n };\n\n const dropIndicatorPosition =\n draggableProps && draggableProps.shouldShowDropIndicatorPosition && draggableProps.dropIndicatorPosition;\n\n const isDropIndicatorPositionInside = dropIndicatorPosition === DropIndicatorPosition.Inside;\n\n const isDragging = draggableProps && draggableProps.isDragging;\n\n const isDropValid = draggableProps && draggableProps.isDropValid;\n\n const dropPreviewClassName = useMemo(() => {\n if (isDropIndicatorPositionInside) {\n const className = `${DSTreeViewPrefix}-${treeItemBlockName}${isDropValid ? '--valid' : '--invalid'}-drop-in`;\n return className;\n }\n return '';\n }, [isDropIndicatorPositionInside, isDropValid]);\n\n const dragOverlayClassName = useMemo(() => (isDragOverlay ? 'drag-overlay' : ''), [isDragOverlay]);\n\n const selectedClassName = useMemo(\n () => (selectedItem?.id === item.id && !isDragOverlay ? 'selected' : ''),\n [isDragOverlay, item.id, selectedItem?.id],\n );\n const hoverClassName = useMemo(\n () => (!isDragOverlay && hoverItem?.id === item.id && !isDragging ? 'hover' : ''),\n [isDragOverlay, hoverItem?.id, item.id, isDragging],\n );\n const fixedHeightClassname = useMemo(() => {\n if (labelOverflow === 'truncate') {\n if (rowSize === 'compact') return `${DSTreeViewPrefix}-${treeItemBlockName}--fixed-height-compact`;\n return `${DSTreeViewPrefix}-${treeItemBlockName}--fixed-height`;\n }\n return '';\n }, [labelOverflow, rowSize]);\n\n const isDraggingClassname = useMemo(() => {\n if (isDragging) return `${DSTreeViewPrefix}-${treeItemBlockName}--dragging`;\n return '';\n }, [isDragging]);\n\n const finalClassName = useMemo(\n () =>\n `${dropPreviewClassName} ${fixedHeightClassname} ${selectedClassName} ${hoverClassName} ${dragOverlayClassName} ${isDraggingClassname}`,\n [\n dropPreviewClassName,\n fixedHeightClassname,\n selectedClassName,\n hoverClassName,\n dragOverlayClassName,\n isDraggingClassname,\n ],\n );\n\n const handleItemClick = useCallback(\n (e: React.MouseEvent<HTMLLIElement>) => {\n onItemClick(item, e);\n setFocusedItem(item);\n setSelectedItem(item);\n onItemActivate(item, e);\n const itemVirtualIndex = typeof item.virtualIndex === 'number' ? item.virtualIndex : -1;\n onItemFocus({\n itemIndex: itemVirtualIndex,\n scrollToItem: (opts = { align: 'start' }) => scrollToIndex(itemVirtualIndex, opts),\n item,\n });\n },\n [onItemClick, item, setFocusedItem, setSelectedItem, onItemActivate, onItemFocus, scrollToIndex],\n );\n\n const childrenLength = useMemo(() => children?.length ?? 0, [children]);\n\n const ariaLabel = `${itemLabelText}${showChildrenAmount && childrenLength > 0 ? `, ${childrenLength} Items` : ''}`;\n\n return (\n <TreeListItem\n tabIndex={0}\n onMouseLeave={() => {\n if (hoverItem?.id === item.id) {\n setHoverItem(null);\n }\n }}\n onMouseEnter={() => {\n setHoverItem(item);\n }}\n onClick={handleItemClick}\n onBlur={() => setFocusedItem(null)}\n ref={setItemRefs}\n style={{ ...itemWrapperStyle }}\n className={finalClassName}\n aria-expanded={!!item.isExpanded}\n aria-selected={!!selectedCheckboxes[item.id]}\n aria-label={ariaLabel}\n data-id={item.id}\n data-index={item.virtualIndex}\n onKeyDown={onItemKeyDown}\n >\n <TreeListItemAddonsWrapper>\n {withDragAndDrop ? <DnDHandle id={id} isDragOverlay={isDragOverlay} /> : null}\n {withRadioChecks && !isDragOverlay ? <RadioSelectable item={item} itemIndex={itemIndex} /> : null}\n {withCheckboxChecks && !isDragOverlay ? <CheckboxSelectable item={item} itemIndex={itemIndex} /> : null}\n {!isDragOverlay && <NestingSpace item={item} spaceForNestingLevel={spaceForNestingLevel} />}\n {!isDragOverlay && <ExpandCaret item={item} />}\n {!disableIcons ? <Icon item={item} /> : null}\n </TreeListItemAddonsWrapper>\n <TreeItemText item={item} />\n <FinalRightAddons item={item} rightAddons={rightAddons} RightAddons={RightAddons} />\n <DropIndicator dropIndicatorPosition={dropIndicatorPosition}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