@elliemae/ds-treeview 1.61.10 → 1.61.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/TreeView.js.map +1 -1
- package/cjs/TreeViewContext.js.map +1 -1
- package/cjs/deprecated/TreeView.js.map +1 -1
- package/cjs/deprecated/__testUtils__/utils.js.map +1 -1
- package/cjs/deprecated/plugins/dnd/TreeDndPlugin.js.map +1 -1
- package/cjs/deprecated/plugins/dnd/renderers/DraggableItem.js.map +1 -1
- package/cjs/deprecated/plugins/dnd/renderers/DroppableList.js.map +1 -1
- package/cjs/deprecated/plugins/dnd/utils.js.map +1 -1
- package/cjs/deprecated/plugins/roving/TreeRovingPlugin.js.map +1 -1
- package/cjs/deprecated/plugins/searchable/SearchableTreePlugin.js.map +1 -1
- package/cjs/deprecated/plugins/selectable/SelectablePluginTree.js.map +1 -1
- package/cjs/deprecated/plugins/selectable/utils.js.map +1 -1
- package/cjs/deprecated/plugins/toolbar/TreeToolbarPlugin.js.map +1 -1
- package/cjs/deprecated/plugins/tree/TreeDataPlugin.js.map +1 -1
- package/cjs/deprecated/plugins/tree/useExpandTreeState.js.map +1 -1
- package/cjs/deprecated/plugins/tree/utils.js.map +1 -1
- package/cjs/deprecated/plugins/tree/walkTreeStrategy.js.map +1 -1
- package/cjs/deprecated/plugins/virtualization/TreeVirtualizationPlugin.js.map +1 -1
- package/cjs/deprecated/renderers.js.map +1 -1
- package/cjs/index-69815fd3.js.map +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/parts/CheckboxSelectable.js.map +1 -1
- package/cjs/parts/ChildrenCountDisplayer.js.map +1 -1
- package/cjs/parts/ExpandCaret.js.map +1 -1
- package/cjs/parts/Icon.js.map +1 -1
- package/cjs/parts/NestingSpace.js.map +1 -1
- package/cjs/parts/RadioSelectable.js.map +1 -1
- package/cjs/parts/TreeItem.js.map +1 -1
- package/cjs/parts/TreeItemText.js.map +1 -1
- package/cjs/parts/TreeList.js.map +1 -1
- package/cjs/plugins/dnd/TreeDndPlugin.js.map +1 -1
- package/cjs/prop-types.js.map +1 -1
- package/cjs/react-desc-prop-types.js.map +1 -1
- package/cjs/related-components/TreeViewSearchBar.js.map +1 -1
- package/cjs/utils/array-helpers.js.map +1 -1
- package/cjs/utils/dnd-helpers.js.map +1 -1
- package/cjs/utils/group-expands-helpers.js.map +1 -1
- package/cjs/utils/keyboard-helpers.js.map +1 -1
- package/cjs/utils/object-helpers.js.map +1 -1
- package/cjs/utils/refs-helpers.js.map +1 -1
- package/cjs/utils/selectable-helper.js.map +1 -1
- package/cjs/utils/string-helpers.js.map +1 -1
- package/cjs/utils/tree-helpers.js.map +1 -1
- package/cjs/utils/useDnDHelpers.js.map +1 -1
- package/cjs/utils/useInstanceRefActions.js.map +1 -1
- package/cjs/utils/useTree.js.map +1 -1
- package/esm/TreeView.js.map +1 -1
- package/esm/TreeViewContext.js.map +1 -1
- package/esm/deprecated/TreeView.js.map +1 -1
- package/esm/deprecated/__testUtils__/utils.js.map +1 -1
- package/esm/deprecated/plugins/dnd/TreeDndPlugin.js.map +1 -1
- package/esm/deprecated/plugins/dnd/renderers/DraggableItem.js.map +1 -1
- package/esm/deprecated/plugins/dnd/renderers/DroppableList.js.map +1 -1
- package/esm/deprecated/plugins/dnd/utils.js.map +1 -1
- package/esm/deprecated/plugins/roving/TreeRovingPlugin.js.map +1 -1
- package/esm/deprecated/plugins/searchable/SearchableTreePlugin.js.map +1 -1
- package/esm/deprecated/plugins/selectable/SelectablePluginTree.js.map +1 -1
- package/esm/deprecated/plugins/selectable/utils.js.map +1 -1
- package/esm/deprecated/plugins/toolbar/TreeToolbarPlugin.js.map +1 -1
- package/esm/deprecated/plugins/tree/TreeDataPlugin.js.map +1 -1
- package/esm/deprecated/plugins/tree/useExpandTreeState.js.map +1 -1
- package/esm/deprecated/plugins/tree/utils.js.map +1 -1
- package/esm/deprecated/plugins/tree/walkTreeStrategy.js.map +1 -1
- package/esm/deprecated/plugins/virtualization/TreeVirtualizationPlugin.js.map +1 -1
- package/esm/deprecated/renderers.js.map +1 -1
- package/esm/index-f9def0ea.js.map +1 -1
- package/esm/index.js.map +1 -1
- package/esm/parts/CheckboxSelectable.js.map +1 -1
- package/esm/parts/ChildrenCountDisplayer.js.map +1 -1
- package/esm/parts/ExpandCaret.js.map +1 -1
- package/esm/parts/Icon.js.map +1 -1
- package/esm/parts/NestingSpace.js.map +1 -1
- package/esm/parts/RadioSelectable.js.map +1 -1
- package/esm/parts/TreeItem.js.map +1 -1
- package/esm/parts/TreeItemText.js.map +1 -1
- package/esm/parts/TreeList.js.map +1 -1
- package/esm/plugins/dnd/TreeDndPlugin.js.map +1 -1
- package/esm/prop-types.js.map +1 -1
- package/esm/react-desc-prop-types.js.map +1 -1
- package/esm/related-components/TreeViewSearchBar.js.map +1 -1
- package/esm/utils/array-helpers.js.map +1 -1
- package/esm/utils/dnd-helpers.js.map +1 -1
- package/esm/utils/group-expands-helpers.js.map +1 -1
- package/esm/utils/keyboard-helpers.js.map +1 -1
- package/esm/utils/object-helpers.js.map +1 -1
- package/esm/utils/refs-helpers.js.map +1 -1
- package/esm/utils/selectable-helper.js.map +1 -1
- package/esm/utils/string-helpers.js.map +1 -1
- package/esm/utils/tree-helpers.js.map +1 -1
- package/esm/utils/useDnDHelpers.js.map +1 -1
- package/esm/utils/useInstanceRefActions.js.map +1 -1
- package/esm/utils/useTree.js.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useExpandTreeState.js","sources":["../../../../../src/deprecated/plugins/tree/useExpandTreeState.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport { isFunction, useExpandState } from '@elliemae/ds-utilities';\nimport { walkTreeStrategy } from './walkTreeStrategy';\n\nconst toggleExpandAllAsync = (expand, data) =>\n new Promise((resolve) => {\n const nextState = {};\n if (expand) {\n walkTreeStrategy({\n data,\n cb: (node) => {\n if (node.isGroup) nextState[node.id] = true;\n },\n });\n }\n resolve(nextState);\n });\n\nexport const useExpandTreeState = (instance) => {\n const {\n originalData,\n props: {\n searchQuery,\n expandedRows: expandedItemsProp = {},\n itemKey = 'id',\n onExpand,\n onExpandChange,\n onExpandAll,\n onToggleExpand,\n onCollapse,\n },\n } = instance;\n const expandedState = useExpandState({\n items: originalData,\n itemKey,\n expanded: expandedItemsProp,\n onExpand,\n onExpandChange,\n onExpandAll,\n onToggleExpand,\n onCollapse,\n });\n const totalExpandableRecords = useRef(0);\n const [expandedAll, setExpandAll] = useState(false);\n\n useEffect(() => {\n totalExpandableRecords.current = 0;\n walkTreeStrategy({\n data: originalData,\n cb: (node) => {\n if (node.isGroup) totalExpandableRecords.current += 1;\n },\n });\n }, [originalData]);\n\n useEffect(() => {\n const currLength = Object.keys(expandedState.state.expanded || {}).length;\n let isExpandedAll;\n\n if (currLength === 0) isExpandedAll = false;\n else if (totalExpandableRecords.current !== currLength)\n isExpandedAll = 'mixed';\n else if (currLength === totalExpandableRecords.current)\n isExpandedAll = true;\n\n setExpandAll(isExpandedAll);\n }, [expandedState.state.expanded, originalData]);\n\n const toggleExpand = (item, opts) => {\n const { expandAllChildren } = opts || {};\n expandedState.setExpanded((prevState) => {\n const nextExpandState = { ...prevState };\n const nextState = !prevState[item[itemKey]];\n\n if (nextState) nextExpandState[item[itemKey]] = true;\n else delete nextExpandState[item[itemKey]];\n\n if (expandAllChildren) {\n walkTreeStrategy({\n data: item.children,\n cb: (node) => {\n if (node.isGroup) {\n if (nextState) nextExpandState[node.id] = true;\n else delete nextExpandState[node.id];\n }\n },\n });\n }\n if (onExpandChange) {\n onExpandChange(nextExpandState, item);\n }\n return nextExpandState;\n });\n };\n\n const handleToggleExpand = (item, opts) => {\n if (isFunction(onToggleExpand)) {\n onToggleExpand(item);\n } else {\n toggleExpand(item, opts);\n }\n };\n\n const toggleExpandAll = (expanded) => {\n let nextExpanded = true;\n // if no param is passed, keep toggle behavior\n if (typeof expandedAll === 'boolean') nextExpanded = !expandedAll;\n if (typeof expanded !== 'undefined') nextExpanded = expanded;\n setExpandAll(nextExpanded);\n\n return toggleExpandAllAsync(nextExpanded, originalData).then((nextState) =>\n expandedState.setExpanded(nextState),\n );\n };\n\n useEffect(() => {\n if (searchQuery && (!expandedAll || expandedAll === 'mixed'))\n toggleExpandAll(true);\n }, [searchQuery]);\n\n // eslint-disable-next-line max-lines\n return {\n state: { ...expandedState.state, expandedAll },\n actions: {\n ...expandedState.actions,\n toggleExpandAll,\n toggleExpand,\n _toggleExpand: handleToggleExpand,\n },\n };\n};\n"],"names":["toggleExpandAllAsync","expand","data","Promise","resolve","nextState","walkTreeStrategy","cb","node","isGroup","id","useExpandTreeState","instance","originalData","props","searchQuery","expandedRows","expandedItemsProp","itemKey","onExpand","onExpandChange","onExpandAll","onToggleExpand","onCollapse","expandedState","useExpandState","items","expanded","totalExpandableRecords","useRef","useState","expandedAll","setExpandAll","useEffect","current","currLength","Object","keys","state","length","isExpandedAll","toggleExpand","item","opts","expandAllChildren","setExpanded","prevState","nextExpandState","children","handleToggleExpand","isFunction","toggleExpandAll","nextExpanded","then","actions","_toggleExpand"],"mappings":";;;;;;;;;;;AAIA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAuB,CAACC,MAAD,EAASC,IAAT;
|
|
1
|
+
{"version":3,"file":"useExpandTreeState.js","sources":["../../../../../src/deprecated/plugins/tree/useExpandTreeState.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport { isFunction, useExpandState } from '@elliemae/ds-utilities';\nimport { walkTreeStrategy } from './walkTreeStrategy';\n\nconst toggleExpandAllAsync = (expand, data) =>\n new Promise((resolve) => {\n const nextState = {};\n if (expand) {\n walkTreeStrategy({\n data,\n cb: (node) => {\n if (node.isGroup) nextState[node.id] = true;\n },\n });\n }\n resolve(nextState);\n });\n\nexport const useExpandTreeState = (instance) => {\n const {\n originalData,\n props: {\n searchQuery,\n expandedRows: expandedItemsProp = {},\n itemKey = 'id',\n onExpand,\n onExpandChange,\n onExpandAll,\n onToggleExpand,\n onCollapse,\n },\n } = instance;\n const expandedState = useExpandState({\n items: originalData,\n itemKey,\n expanded: expandedItemsProp,\n onExpand,\n onExpandChange,\n onExpandAll,\n onToggleExpand,\n onCollapse,\n });\n const totalExpandableRecords = useRef(0);\n const [expandedAll, setExpandAll] = useState(false);\n\n useEffect(() => {\n totalExpandableRecords.current = 0;\n walkTreeStrategy({\n data: originalData,\n cb: (node) => {\n if (node.isGroup) totalExpandableRecords.current += 1;\n },\n });\n }, [originalData]);\n\n useEffect(() => {\n const currLength = Object.keys(expandedState.state.expanded || {}).length;\n let isExpandedAll;\n\n if (currLength === 0) isExpandedAll = false;\n else if (totalExpandableRecords.current !== currLength)\n isExpandedAll = 'mixed';\n else if (currLength === totalExpandableRecords.current)\n isExpandedAll = true;\n\n setExpandAll(isExpandedAll);\n }, [expandedState.state.expanded, originalData]);\n\n const toggleExpand = (item, opts) => {\n const { expandAllChildren } = opts || {};\n expandedState.setExpanded((prevState) => {\n const nextExpandState = { ...prevState };\n const nextState = !prevState[item[itemKey]];\n\n if (nextState) nextExpandState[item[itemKey]] = true;\n else delete nextExpandState[item[itemKey]];\n\n if (expandAllChildren) {\n walkTreeStrategy({\n data: item.children,\n cb: (node) => {\n if (node.isGroup) {\n if (nextState) nextExpandState[node.id] = true;\n else delete nextExpandState[node.id];\n }\n },\n });\n }\n if (onExpandChange) {\n onExpandChange(nextExpandState, item);\n }\n return nextExpandState;\n });\n };\n\n const handleToggleExpand = (item, opts) => {\n if (isFunction(onToggleExpand)) {\n onToggleExpand(item);\n } else {\n toggleExpand(item, opts);\n }\n };\n\n const toggleExpandAll = (expanded) => {\n let nextExpanded = true;\n // if no param is passed, keep toggle behavior\n if (typeof expandedAll === 'boolean') nextExpanded = !expandedAll;\n if (typeof expanded !== 'undefined') nextExpanded = expanded;\n setExpandAll(nextExpanded);\n\n return toggleExpandAllAsync(nextExpanded, originalData).then((nextState) =>\n expandedState.setExpanded(nextState),\n );\n };\n\n useEffect(() => {\n if (searchQuery && (!expandedAll || expandedAll === 'mixed'))\n toggleExpandAll(true);\n }, [searchQuery]);\n\n // eslint-disable-next-line max-lines\n return {\n state: { ...expandedState.state, expandedAll },\n actions: {\n ...expandedState.actions,\n toggleExpandAll,\n toggleExpand,\n _toggleExpand: handleToggleExpand,\n },\n };\n};\n"],"names":["toggleExpandAllAsync","expand","data","Promise","resolve","nextState","walkTreeStrategy","cb","node","isGroup","id","useExpandTreeState","instance","originalData","props","searchQuery","expandedRows","expandedItemsProp","itemKey","onExpand","onExpandChange","onExpandAll","onToggleExpand","onCollapse","expandedState","useExpandState","items","expanded","totalExpandableRecords","useRef","useState","expandedAll","setExpandAll","useEffect","current","currLength","Object","keys","state","length","isExpandedAll","toggleExpand","item","opts","expandAllChildren","setExpanded","prevState","nextExpandState","children","handleToggleExpand","isFunction","toggleExpandAll","nextExpanded","then","actions","_toggleExpand"],"mappings":";;;;;;;;;;;AAIA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAuB,CAACC,MAAD,EAASC,IAAT;EAAA,OAC3B,IAAIC,OAAJ,CAAY,UAACC,OAAD,EAAa;IACvB,IAAMC,SAAS,GAAG,EAAlB;;IACA,IAAIJ,MAAJ,EAAY;MACVK,gBAAgB,CAAC;QACfJ,IAAI,EAAJA,IADe;QAEfK,EAAE,EAAE,YAACC,IAAD,EAAU;UACZ,IAAIA,IAAI,CAACC,OAAT,EAAkBJ,SAAS,CAACG,IAAI,CAACE,EAAN,CAAT,GAAqB,IAArB;;OAHN,CAAhB;;;IAOFN,OAAO,CAACC,SAAD,CAAP;GAVF,CAD2B;AAAA,CAA7B;;IAcaM,kBAAkB,GAAG,SAArBA,kBAAqB,CAACC,QAAD,EAAc;EAC9C,IACEC,YADF,GAYID,QAZJ,CACEC,YADF;wBAYID,QAZJ,CAEEE,KAFF;MAGIC,WAHJ,mBAGIA,WAHJ;8CAIIC,YAJJ;MAIkBC,iBAJlB,sCAIsC,EAJtC;8CAKIC,OALJ;MAK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AAe,GAAG,SAAlBA,eAAkB,CAACxB,QAAD,EAAc;IACpC,IAAIyB,YAAY,GAAG,IAAnB,CADoC;;IAGpC,IAAI,OAAOrB,WAAP,KAAuB,SAA3B,EAAsCqB,YAAY,GAAG,CAACrB,WAAhB;IACtC,IAAI,OAAOJ,QAAP,KAAoB,WAAxB,EAAqCyB,YAAY,GAAGzB,QAAf;IACrCK,YAAY,CAACoB,YAAD,CAAZ;IAEA,OAAOpD,oBAAoB,CAACoD,YAAD,EAAevC,YAAf,CAApB,CAAiDwC,IAAjD,CAAsD,UAAChD,SAAD;MAAA,OAC3DmB,aAAa,CAACqB,WAAd,CAA0BxC,SAA1B,CAD2D;KAAtD,CAAP;GAPF;;EAYA4B,SAAS,CAAC,YAAM;IACd,IAAIlB,WAAW,KAAK,CAACgB,WAAD,IAAgBA,WAAW,KAAK,OAArC,CAAf,EACEoB,eAAe,CAAC,IAAD,CAAf;GAFK,EAGN,CAACpC,WAAD,CAHM,CAAT,CAjG8C;;EAuG9C,OAAO;IACLuB,KAAK,kCAAOd,aAAa,CAACc,KAArB;MAA4BP,WAAW,EAAXA;MAD5B;IAELuB,OAAO,kCACF9B,aAAa,CAAC8B,OADZ;MAELH,eAAe,EAAfA,eAFK;MAGLV,YAAY,EAAZA,YAHK;MAILc,aAAa,EAAEN;;GANnB;AASD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../../src/deprecated/plugins/tree/utils.tsx"],"sourcesContent":["import get from 'lodash/get';\n\nexport const getParentId = (record) => get(record, ['parentNode', 'id']);\nexport const findItemOnDocument = (id) =>\n document.querySelector(`[data-id=\"${id}\"]`);\nexport const getListFromDocument = () =>\n document.querySelector(`[data-testid=\"tree-list\"]`);\nexport const getParentChildren = (record, childrenKey = 'children') =>\n get(record, ['parentNode', 'data', childrenKey]);\nexport const getItemLabel = (record, nameKey = 'name') =>\n get(record, ['data', nameKey]);\nexport const getItemChildren = (record, childrenKey = 'children') =>\n get(record, ['data', childrenKey]);\nexport const getItemChildrenLength = (record, childrenKey = 'children') => {\n const children = get(record, ['data', childrenKey]);\n return children && children.length;\n};\nexport const findItemById = (records, id) =>\n records.find((record) => String(record.id) === id);\n"],"names":["getParentId","record","get","findItemOnDocument","id","document","querySelector","getListFromDocument","getParentChildren","childrenKey","getItemLabel","nameKey","getItemChildren","getItemChildrenLength","children","length","findItemById","records","find","String"],"mappings":";;IAEaA,WAAW,GAAG,SAAdA,WAAc,CAACC,MAAD;
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../../src/deprecated/plugins/tree/utils.tsx"],"sourcesContent":["import get from 'lodash/get';\n\nexport const getParentId = (record) => get(record, ['parentNode', 'id']);\nexport const findItemOnDocument = (id) =>\n document.querySelector(`[data-id=\"${id}\"]`);\nexport const getListFromDocument = () =>\n document.querySelector(`[data-testid=\"tree-list\"]`);\nexport const getParentChildren = (record, childrenKey = 'children') =>\n get(record, ['parentNode', 'data', childrenKey]);\nexport const getItemLabel = (record, nameKey = 'name') =>\n get(record, ['data', nameKey]);\nexport const getItemChildren = (record, childrenKey = 'children') =>\n get(record, ['data', childrenKey]);\nexport const getItemChildrenLength = (record, childrenKey = 'children') => {\n const children = get(record, ['data', childrenKey]);\n return children && children.length;\n};\nexport const findItemById = (records, id) =>\n records.find((record) => String(record.id) === id);\n"],"names":["getParentId","record","get","findItemOnDocument","id","document","querySelector","getListFromDocument","getParentChildren","childrenKey","getItemLabel","nameKey","getItemChildren","getItemChildrenLength","children","length","findItemById","records","find","String"],"mappings":";;IAEaA,WAAW,GAAG,SAAdA,WAAc,CAACC,MAAD;EAAA,OAAYC,GAAG,CAACD,MAAD,EAAS,CAAC,YAAD,EAAe,IAAf,CAAT,CAAf;AAAA;IACdE,kBAAkB,GAAG,SAArBA,kBAAqB,CAACC,EAAD;EAAA,OAChCC,QAAQ,CAACC,aAAT,sBAAoCF,EAApC,SADgC;AAAA;IAErBG,mBAAmB,GAAG,SAAtBA,mBAAsB;EAAA,OACjCF,QAAQ,CAACC,aAAT,+BADiC;AAAA;IAEtBE,iBAAiB,GAAG,SAApBA,iBAAoB,CAACP,MAAD;EAAA,IAASQ,WAAT,uEAAuB,UAAvB;EAAA,OAC/BP,GAAG,CAACD,MAAD,EAAS,CAAC,YAAD,EAAe,MAAf,EAAuBQ,WAAvB,CAAT,CAD4B;AAAA;IAEpBC,YAAY,GAAG,SAAfA,YAAe,CAACT,MAAD;EAAA,IAASU,OAAT,uEAAmB,MAAnB;EAAA,OAC1BT,GAAG,CAACD,MAAD,EAAS,CAAC,MAAD,EAASU,OAAT,CAAT,CADuB;AAAA;IAEfC,eAAe,GAAG,SAAlBA,eAAkB,CAACX,MAAD;EAAA,IAASQ,WAAT,uEAAuB,UAAvB;EAAA,OAC7BP,GAAG,CAACD,MAAD,EAAS,CAAC,MAAD,EAASQ,WAAT,CAAT,CAD0B;AAAA;IAElBI,qBAAqB,GAAG,SAAxBA,qBAAwB,CAACZ,MAAD,EAAsC;EAAA,IAA7BQ,WAA6B,uEAAf,UAAe;EACzE,IAAMK,QAAQ,GAAGZ,GAAG,CAACD,MAAD,EAAS,CAAC,MAAD,EAASQ,WAAT,CAAT,CAApB;EACA,OAAOK,QAAQ,IAAIA,QAAQ,CAACC,MAA5B;AACD;IACYC,YAAY,GAAG,SAAfA,YAAe,CAACC,OAAD,EAAUb,EAAV;EAAA,OAC1Ba,OAAO,CAACC,IAAR,CAAa,UAACjB,MAAD;IAAA,OAAYkB,MAAM,CAAClB,MAAM,CAACG,EAAR,CAAN,KAAsBA,EAAlC;GAAb,CAD0B;AAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walkTreeStrategy.js","sources":["../../../../../src/deprecated/plugins/tree/walkTreeStrategy.tsx"],"sourcesContent":["function getPath(parentNode, index, childrenKey) {\n if (!parentNode) return [index];\n return [...parentNode.path, childrenKey, index];\n}\n\nexport function walkTreeStrategy({\n data,\n childrenKey = 'children',\n level = 0,\n getId = (item) => item.id,\n parentNode,\n shouldWalkChildren = () => true,\n cb,\n}) {\n // eslint-disable-next-line no-plusplus\n for (let i = 0; i < data.length; i++) {\n const currLevel = level + 1;\n const item = data[i];\n\n if (!item)\n throw new Error('no item received, invalid tree walking strategy!');\n\n const children = item[childrenKey];\n const { isGroup } = item;\n\n const node = {\n index: i,\n id: getId(item),\n data: item,\n path: getPath(parentNode, i, childrenKey),\n isGroup: (children && !!children.length) || isGroup,\n nestingLevel: currLevel,\n parentNode: parentNode || {\n isGroup: true,\n data: { children: data },\n },\n };\n\n cb(node);\n\n if (shouldWalkChildren(node) && children && children.length) {\n walkTreeStrategy({\n data: children,\n level: currLevel,\n parentNode: node,\n shouldWalkChildren,\n cb,\n });\n }\n }\n}\n"],"names":["getPath","parentNode","index","childrenKey","path","walkTreeStrategy","data","level","getId","item","id","shouldWalkChildren","cb","i","length","currLevel","Error","children","isGroup","node","nestingLevel"],"mappings":";;AAAA,SAASA,OAAT,CAAiBC,UAAjB,EAA6BC,KAA7B,EAAoCC,WAApC,EAAiD;
|
|
1
|
+
{"version":3,"file":"walkTreeStrategy.js","sources":["../../../../../src/deprecated/plugins/tree/walkTreeStrategy.tsx"],"sourcesContent":["function getPath(parentNode, index, childrenKey) {\n if (!parentNode) return [index];\n return [...parentNode.path, childrenKey, index];\n}\n\nexport function walkTreeStrategy({\n data,\n childrenKey = 'children',\n level = 0,\n getId = (item) => item.id,\n parentNode,\n shouldWalkChildren = () => true,\n cb,\n}) {\n // eslint-disable-next-line no-plusplus\n for (let i = 0; i < data.length; i++) {\n const currLevel = level + 1;\n const item = data[i];\n\n if (!item)\n throw new Error('no item received, invalid tree walking strategy!');\n\n const children = item[childrenKey];\n const { isGroup } = item;\n\n const node = {\n index: i,\n id: getId(item),\n data: item,\n path: getPath(parentNode, i, childrenKey),\n isGroup: (children && !!children.length) || isGroup,\n nestingLevel: currLevel,\n parentNode: parentNode || {\n isGroup: true,\n data: { children: data },\n },\n };\n\n cb(node);\n\n if (shouldWalkChildren(node) && children && children.length) {\n walkTreeStrategy({\n data: children,\n level: currLevel,\n parentNode: node,\n shouldWalkChildren,\n cb,\n });\n }\n }\n}\n"],"names":["getPath","parentNode","index","childrenKey","path","walkTreeStrategy","data","level","getId","item","id","shouldWalkChildren","cb","i","length","currLevel","Error","children","isGroup","node","nestingLevel"],"mappings":";;AAAA,SAASA,OAAT,CAAiBC,UAAjB,EAA6BC,KAA7B,EAAoCC,WAApC,EAAiD;EAC/C,IAAI,CAACF,UAAL,EAAiB,OAAO,CAACC,KAAD,CAAP;EACjB,oCAAWD,UAAU,CAACG,IAAtB,IAA4BD,WAA5B,EAAyCD,KAAzC;AACD;;AAEM,SAASG,gBAAT,OAQJ;EAAA,IAPDC,IAOC,QAPDA,IAOC;8BANDH,WAMC;MANDA,WAMC,iCANa,UAMb;wBALDI,KAKC;MALDA,KAKC,2BALO,CAKP;wBAJDC,KAIC;MAJDA,KAIC,2BAJO,UAACC,IAAD;IAAA,OAAUA,IAAI,CAACC,EAAf;GAIP;MAHDT,UAGC,QAHDA,UAGC;mCAFDU,kBAEC;MAFDA,kBAEC,sCAFoB;IAAA,OAAM,IAAN;GAEpB;MADDC,EACC,QADDA,EACC;;;EAED,KAAK,IAAIC,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGP,IAAI,CAACQ,MAAzB,EAAiCD,CAAC,EAAlC,EAAsC;IACpC,IAAME,SAAS,GAAGR,KAAK,GAAG,CAA1B;IACA,IAAME,IAAI,GAAGH,IAAI,CAACO,CAAD,CAAjB;IAEA,IAAI,CAACJ,IAAL,EACE,MAAM,IAAIO,KAAJ,CAAU,kDAAV,CAAN;IAEF,IAAMC,QAAQ,GAAGR,IAAI,CAACN,WAAD,CAArB;IACA,IAAQe,OAAR,GAAoBT,IAApB,CAAQS,OAAR;IAEA,IAAMC,IAAI,GAAG;MACXjB,KAAK,EAAEW,CADI;MAEXH,EAAE,EAAEF,KAAK,CAACC,IAAD,CAFE;MAGXH,IAAI,EAAEG,IAHK;MAIXL,IAAI,EAAEJ,OAAO,CAACC,UAAD,EAAaY,CAAb,EAAgBV,WAAhB,CAJF;MAKXe,OAAO,EAAGD,QAAQ,IAAI,CAAC,CAACA,QAAQ,CAACH,MAAxB,IAAmCI,OALjC;MAMXE,YAAY,EAAEL,SANH;MAOXd,UAAU,EAAEA,UAAU,IAAI;QACxBiB,OAAO,EAAE,IADe;QAExBZ,IAAI,EAAE;UAAEW,QAAQ,EAAEX;;;KATtB;IAaAM,EAAE,CAACO,IAAD,CAAF;;IAEA,IAAIR,kBAAkB,CAACQ,IAAD,CAAlB,IAA4BF,QAA5B,IAAwCA,QAAQ,CAACH,MAArD,EAA6D;MAC3DT,gBAAgB,CAAC;QACfC,IAAI,EAAEW,QADS;QAEfV,KAAK,EAAEQ,SAFQ;QAGfd,UAAU,EAAEkB,IAHG;QAIfR,kBAAkB,EAAlBA,kBAJe;QAKfC,EAAE,EAAFA;OALc,CAAhB;;;AASL;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeVirtualizationPlugin.js","sources":["../../../../../src/deprecated/plugins/virtualization/TreeVirtualizationPlugin.tsx"],"sourcesContent":["/* eslint-disable react/prop-types */\n/* eslint-disable react/prop-types, max-lines */\nimport React, { useMemo, useRef } from 'react';\nimport { DynamicSizeList } from '@john-osullivan/react-window-dynamic-fork';\nimport { getVirtualListComponent } from '@elliemae/ds-shared/virtualization';\nimport createInstancePlugin from '@elliemae/ds-shared/createDataInstance/createInstancePlugin';\nimport { TreeListNoItems } from '../../renderers';\n\n// from react-window 1.8.5\nfunction shallowDiffers(prev, next) {\n // eslint-disable-next-line no-restricted-syntax\n for (const attribute in prev) {\n if (!(attribute in next)) {\n return true;\n }\n }\n // eslint-disable-next-line no-restricted-syntax\n for (const attribute in next) {\n if (prev[attribute] !== next[attribute]) {\n return true;\n }\n }\n return false;\n}\n\n// more performant alternative to areEqual from react-window 1.8.5\nfunction areEqualRecords(prevProps, nextProps) {\n const { style: prevStyle, index: pIdx, data: pData } = prevProps;\n const { style: nextStyle, index: nIdx, data: nData } = nextProps;\n\n return (\n !shallowDiffers(prevStyle, nextStyle) &&\n !shallowDiffers(pData?.records[pIdx], nData?.records[nIdx])\n );\n}\n\n// memoized list items strategy\n// https://react-window.now.sh/#/examples/list/memoized-list-items\nconst VirtualizedTreeItem = React.memo(\n React.forwardRef(({ index, style, data }, ref) => {\n const { instance, records, listRef } = data;\n const { itemRenderer, getItemProps, renderers } = instance.getInstance();\n const record = records[index];\n\n const ItemComponent = renderers.item;\n\n // needed to show the shadow below the row and because\n // of absolute positioning from react-window\n const mixedProps = getItemProps(\n {\n index,\n record,\n style,\n listRef,\n innerRef: ref,\n },\n { record },\n );\n\n record.style = style;\n\n return (\n <ItemComponent {...mixedProps} tabIndex={-1}>\n {itemRenderer(mixedProps)}\n </ItemComponent>\n );\n }),\n areEqualRecords,\n);\n\n// eslint-disable-next-line react/display-name\nconst VirtualizedTree = (renderers, instance) => ({\n records,\n itemRenderer,\n innerRef,\n ...rest\n}) => {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const {\n props: {\n autoHeight,\n fluid,\n width,\n height = 500,\n noItemsPlaceholder = 'No items found',\n initialOffset,\n },\n state: { listRef },\n renderers: currRenderers,\n setListRef,\n } = instance.getInstance();\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const ListComponent = useMemo(\n () =>\n getVirtualListComponent({\n component: DynamicSizeList,\n height,\n fluid,\n autoHeight,\n }),\n [height, autoHeight],\n );\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const itemData = useMemo(\n () => ({\n instance,\n listRef,\n renderers: currRenderers,\n records,\n }),\n [records, currRenderers, listRef],\n ); // todo: revise this\n\n if (records && !records.length) {\n return <TreeListNoItems>{noItemsPlaceholder}</TreeListNoItems>;\n }\n\n return (\n <ListComponent\n innerRef={setListRef}\n {...rest}\n ref={listRef}\n component={DynamicSizeList}\n height={height}\n initialScrollOffset={initialOffset}\n itemCount={records.length}\n itemData={itemData}\n outerElementType={renderers.list}\n outerRef={innerRef}\n width={width}\n >\n {VirtualizedTreeItem}\n </ListComponent>\n );\n};\n\nexport const TreeVirtualizationPlugin = createInstancePlugin(\n 'tree-virtualization',\n {\n state() {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const listRef = useRef();\n return {\n state: { listRef },\n actions: {\n scrollTo: (...args) => {\n if (listRef?.current?.scrollTo) {\n listRef.current.scrollTo(args);\n }\n },\n scrollToItem: (...args) => {\n if (listRef?.current?.scrollToItem) {\n listRef.current.scrollToItem(args);\n }\n },\n },\n };\n },\n renderers(renderers, instance) {\n return {\n item: renderers.item,\n // eslint-disable-next-line react-hooks/rules-of-hooks\n list: useMemo(() => VirtualizedTree(renderers, instance), []),\n };\n },\n },\n);\n"],"names":["shallowDiffers","prev","next","attribute","areEqualRecords","prevProps","nextProps","prevStyle","style","pIdx","index","pData","data","nextStyle","nIdx","nData","records","VirtualizedTreeItem","React","memo","forwardRef","ref","instance","listRef","getInstance","itemRenderer","getItemProps","renderers","record","ItemComponent","item","mixedProps","innerRef","VirtualizedTree","rest","props","autoHeight","fluid","width","height","noItemsPlaceholder","initialOffset","state","currRenderers","setListRef","ListComponent","useMemo","getVirtualListComponent","component","DynamicSizeList","itemData","length","list","TreeVirtualizationPlugin","createInstancePlugin","useRef","actions","scrollTo","current","args","scrollToItem"],"mappings":";;;;;;;;;;;;AASA,SAASA,cAAT,CAAwBC,IAAxB,EAA8BC,IAA9B,EAAoC
|
|
1
|
+
{"version":3,"file":"TreeVirtualizationPlugin.js","sources":["../../../../../src/deprecated/plugins/virtualization/TreeVirtualizationPlugin.tsx"],"sourcesContent":["/* eslint-disable react/prop-types */\n/* eslint-disable react/prop-types, max-lines */\nimport React, { useMemo, useRef } from 'react';\nimport { DynamicSizeList } from '@john-osullivan/react-window-dynamic-fork';\nimport { getVirtualListComponent } from '@elliemae/ds-shared/virtualization';\nimport createInstancePlugin from '@elliemae/ds-shared/createDataInstance/createInstancePlugin';\nimport { TreeListNoItems } from '../../renderers';\n\n// from react-window 1.8.5\nfunction shallowDiffers(prev, next) {\n // eslint-disable-next-line no-restricted-syntax\n for (const attribute in prev) {\n if (!(attribute in next)) {\n return true;\n }\n }\n // eslint-disable-next-line no-restricted-syntax\n for (const attribute in next) {\n if (prev[attribute] !== next[attribute]) {\n return true;\n }\n }\n return false;\n}\n\n// more performant alternative to areEqual from react-window 1.8.5\nfunction areEqualRecords(prevProps, nextProps) {\n const { style: prevStyle, index: pIdx, data: pData } = prevProps;\n const { style: nextStyle, index: nIdx, data: nData } = nextProps;\n\n return (\n !shallowDiffers(prevStyle, nextStyle) &&\n !shallowDiffers(pData?.records[pIdx], nData?.records[nIdx])\n );\n}\n\n// memoized list items strategy\n// https://react-window.now.sh/#/examples/list/memoized-list-items\nconst VirtualizedTreeItem = React.memo(\n React.forwardRef(({ index, style, data }, ref) => {\n const { instance, records, listRef } = data;\n const { itemRenderer, getItemProps, renderers } = instance.getInstance();\n const record = records[index];\n\n const ItemComponent = renderers.item;\n\n // needed to show the shadow below the row and because\n // of absolute positioning from react-window\n const mixedProps = getItemProps(\n {\n index,\n record,\n style,\n listRef,\n innerRef: ref,\n },\n { record },\n );\n\n record.style = style;\n\n return (\n <ItemComponent {...mixedProps} tabIndex={-1}>\n {itemRenderer(mixedProps)}\n </ItemComponent>\n );\n }),\n areEqualRecords,\n);\n\n// eslint-disable-next-line react/display-name\nconst VirtualizedTree = (renderers, instance) => ({\n records,\n itemRenderer,\n innerRef,\n ...rest\n}) => {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const {\n props: {\n autoHeight,\n fluid,\n width,\n height = 500,\n noItemsPlaceholder = 'No items found',\n initialOffset,\n },\n state: { listRef },\n renderers: currRenderers,\n setListRef,\n } = instance.getInstance();\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const ListComponent = useMemo(\n () =>\n getVirtualListComponent({\n component: DynamicSizeList,\n height,\n fluid,\n autoHeight,\n }),\n [height, autoHeight],\n );\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const itemData = useMemo(\n () => ({\n instance,\n listRef,\n renderers: currRenderers,\n records,\n }),\n [records, currRenderers, listRef],\n ); // todo: revise this\n\n if (records && !records.length) {\n return <TreeListNoItems>{noItemsPlaceholder}</TreeListNoItems>;\n }\n\n return (\n <ListComponent\n innerRef={setListRef}\n {...rest}\n ref={listRef}\n component={DynamicSizeList}\n height={height}\n initialScrollOffset={initialOffset}\n itemCount={records.length}\n itemData={itemData}\n outerElementType={renderers.list}\n outerRef={innerRef}\n width={width}\n >\n {VirtualizedTreeItem}\n </ListComponent>\n );\n};\n\nexport const TreeVirtualizationPlugin = createInstancePlugin(\n 'tree-virtualization',\n {\n state() {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const listRef = useRef();\n return {\n state: { listRef },\n actions: {\n scrollTo: (...args) => {\n if (listRef?.current?.scrollTo) {\n listRef.current.scrollTo(args);\n }\n },\n scrollToItem: (...args) => {\n if (listRef?.current?.scrollToItem) {\n listRef.current.scrollToItem(args);\n }\n },\n },\n };\n },\n renderers(renderers, instance) {\n return {\n item: renderers.item,\n // eslint-disable-next-line react-hooks/rules-of-hooks\n list: useMemo(() => VirtualizedTree(renderers, instance), []),\n };\n },\n },\n);\n"],"names":["shallowDiffers","prev","next","attribute","areEqualRecords","prevProps","nextProps","prevStyle","style","pIdx","index","pData","data","nextStyle","nIdx","nData","records","VirtualizedTreeItem","React","memo","forwardRef","ref","instance","listRef","getInstance","itemRenderer","getItemProps","renderers","record","ItemComponent","item","mixedProps","innerRef","VirtualizedTree","rest","props","autoHeight","fluid","width","height","noItemsPlaceholder","initialOffset","state","currRenderers","setListRef","ListComponent","useMemo","getVirtualListComponent","component","DynamicSizeList","itemData","length","list","TreeVirtualizationPlugin","createInstancePlugin","useRef","actions","scrollTo","current","args","scrollToItem"],"mappings":";;;;;;;;;;;;AASA,SAASA,cAAT,CAAwBC,IAAxB,EAA8BC,IAA9B,EAAoC;;EAElC,KAAK,IAAM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,IACoB;cADpBA,IACoB;;;YAC9BpC,OAAO,CAACmC,OAAR,CAAgBD,QAAhB,CAAyBE,IAAzB;;SAHG;QAMPC,YAAY,EAAE,wBAAa;UAAA;;UACzB,IAAIrC,OAAJ,aAAIA,OAAJ,oCAAIA,OAAO,CAAEmC,OAAb,8CAAI,kBAAkBE,YAAtB,EAAoC;YAAA,mCADpBD,IACoB;cADpBA,IACoB;;;YAClCpC,OAAO,CAACmC,OAAR,CAAgBE,YAAhB,CAA6BD,IAA7B;;;;KAVR;GAJJ;EAoBEhC,SApBF,qBAoBYA,UApBZ,EAoBuBL,QApBvB,EAoBiC;IAC7B,OAAO;MACLQ,IAAI,EAAEH,UAAS,CAACG,IADX;;MAGLsB,IAAI,EAAEN,OAAO,CAAC;QAAA,OAAMb,eAAe,CAACN,UAAD,EAAYL,QAAZ,CAArB;OAAD,EAA6C,EAA7C;KAHf;;AArBJ,CAF0D;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderers.js","sources":["../../../src/deprecated/renderers.tsx"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport React from 'react';\n\nexport const treeListBlockName = 'tree-list';\nexport const treeItemBlockName = 'tree-item';\nexport const treeListNoItemsBn = `${treeListBlockName}-no-items`;\n\nexport const TreeListItem = aggregatedClasses('li', {\n 'data-testid': treeItemBlockName,\n role: 'treeitem',\n})(treeItemBlockName);\nexport const TreeListItemAddonsWrapper = aggregatedClasses('div')(\n treeItemBlockName,\n 'addons',\n);\nexport const TreeList = aggregatedClasses('ul', {\n 'data-testid': treeListBlockName,\n role: 'tree',\n})(treeListBlockName, null, ({ rowSize }) => ({\n [`rowsize-${rowSize}`]: rowSize,\n}));\nexport const TreeListNoItems = aggregatedClasses('div', {\n 'data-testid': treeListNoItemsBn,\n})(treeListNoItemsBn);\n\nfunction TreeItem({ leftAddons, rightAddons, children, ...rest }) {\n return (\n <TreeListItem {...rest}>\n {leftAddons && (\n <TreeListItemAddonsWrapper>{leftAddons}</TreeListItemAddonsWrapper>\n )}\n {children}\n {rightAddons && (\n <TreeListItemAddonsWrapper>{rightAddons}</TreeListItemAddonsWrapper>\n )}\n </TreeListItem>\n );\n}\n\nexport const TreeRenderers = {\n list: TreeList,\n item: TreeItem,\n};\n"],"names":["treeListBlockName","treeItemBlockName","treeListNoItemsBn","TreeListItem","aggregatedClasses","role","TreeListItemAddonsWrapper","TreeList","rowSize","TreeListNoItems","TreeItem","leftAddons","rightAddons","children","rest","TreeRenderers","list","item"],"mappings":";;;;;;IAIaA,iBAAiB,GAAG;IACpBC,iBAAiB,GAAG;IACpBC,iBAAiB,aAAMF,iBAAN;IAEjBG,YAAY,GAAGC,iBAAiB,CAAC,IAAD,EAAO;
|
|
1
|
+
{"version":3,"file":"renderers.js","sources":["../../../src/deprecated/renderers.tsx"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport React from 'react';\n\nexport const treeListBlockName = 'tree-list';\nexport const treeItemBlockName = 'tree-item';\nexport const treeListNoItemsBn = `${treeListBlockName}-no-items`;\n\nexport const TreeListItem = aggregatedClasses('li', {\n 'data-testid': treeItemBlockName,\n role: 'treeitem',\n})(treeItemBlockName);\nexport const TreeListItemAddonsWrapper = aggregatedClasses('div')(\n treeItemBlockName,\n 'addons',\n);\nexport const TreeList = aggregatedClasses('ul', {\n 'data-testid': treeListBlockName,\n role: 'tree',\n})(treeListBlockName, null, ({ rowSize }) => ({\n [`rowsize-${rowSize}`]: rowSize,\n}));\nexport const TreeListNoItems = aggregatedClasses('div', {\n 'data-testid': treeListNoItemsBn,\n})(treeListNoItemsBn);\n\nfunction TreeItem({ leftAddons, rightAddons, children, ...rest }) {\n return (\n <TreeListItem {...rest}>\n {leftAddons && (\n <TreeListItemAddonsWrapper>{leftAddons}</TreeListItemAddonsWrapper>\n )}\n {children}\n {rightAddons && (\n <TreeListItemAddonsWrapper>{rightAddons}</TreeListItemAddonsWrapper>\n )}\n </TreeListItem>\n );\n}\n\nexport const TreeRenderers = {\n list: TreeList,\n item: TreeItem,\n};\n"],"names":["treeListBlockName","treeItemBlockName","treeListNoItemsBn","TreeListItem","aggregatedClasses","role","TreeListItemAddonsWrapper","TreeList","rowSize","TreeListNoItems","TreeItem","leftAddons","rightAddons","children","rest","TreeRenderers","list","item"],"mappings":";;;;;;IAIaA,iBAAiB,GAAG;IACpBC,iBAAiB,GAAG;IACpBC,iBAAiB,aAAMF,iBAAN;IAEjBG,YAAY,GAAGC,iBAAiB,CAAC,IAAD,EAAO;EAClD,eAAeH,iBADmC;EAElDI,IAAI,EAAE;AAF4C,CAAP,CAAjB,CAGzBJ,iBAHyB;IAIfK,yBAAyB,GAAGF,iBAAiB,CAAC,KAAD,CAAjB,CACvCH,iBADuC,EAEvC,QAFuC;IAI5BM,QAAQ,GAAGH,iBAAiB,CAAC,IAAD,EAAO;EAC9C,eAAeJ,iBAD+B;EAE9CK,IAAI,EAAE;AAFwC,CAAP,CAAjB,CAGrBL,iBAHqB,EAGF,IAHE,EAGI;EAAA,IAAGQ,OAAH,QAAGA,OAAH;EAAA,6CACdA,OADc,GACFA,OADE;AAAA,CAHJ;IAMXC,eAAe,GAAGL,iBAAiB,CAAC,KAAD,EAAQ;EACtD,eAAeF;AADuC,CAAR,CAAjB,CAE5BA,iBAF4B;;AAI/B,SAASQ,QAAT,QAAkE;EAAA,IAA9CC,UAA8C,SAA9CA,UAA8C;MAAlCC,WAAkC,SAAlCA,WAAkC;MAArBC,QAAqB,SAArBA,QAAqB;MAARC,IAAQ;;EAChE,oBACE,oBAAC,YAAD,EAAkBA,IAAlB,EACGH,UAAU,iBACT,oBAAC,yBAAD,QAA4BA,UAA5B,CAFJ,EAIGE,QAJH,EAKGD,WAAW,iBACV,oBAAC,yBAAD,QAA4BA,WAA5B,CANJ,CADF;AAWD;;IAEYG,aAAa,GAAG;EAC3BC,IAAI,EAAET,QADqB;EAE3BU,IAAI,EAAEP;AAFqB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-f9def0ea.js","sources":["../../src/deprecated/index.tsx"],"sourcesContent":["/* eslint-disable global-require */\n// Polyfill ResizeObserver for demo\nif (typeof ResizeObserver === 'undefined') {\n global.ResizeObserver = require('resize-observer-polyfill').default;\n}\n\nexport * from './TreeView';\nexport * from './plugins';\n"],"names":["ResizeObserver","global","require","default"],"mappings":";;;;;;;;;AAAA;AACA;AACA,IAAI,OAAOA,cAAP,KAA0B,WAA9B,EAA2C;
|
|
1
|
+
{"version":3,"file":"index-f9def0ea.js","sources":["../../src/deprecated/index.tsx"],"sourcesContent":["/* eslint-disable global-require */\n// Polyfill ResizeObserver for demo\nif (typeof ResizeObserver === 'undefined') {\n global.ResizeObserver = require('resize-observer-polyfill').default;\n}\n\nexport * from './TreeView';\nexport * from './plugins';\n"],"names":["ResizeObserver","global","require","default"],"mappings":";;;;;;;;;AAAA;AACA;AACA,IAAI,OAAOA,cAAP,KAA0B,WAA9B,EAA2C;EACzCC,MAAM,CAACD,cAAP,GAAwBE,OAAO,CAAC,0BAAD,CAAP,CAAoCC,OAA5D;AACD;;;;;;;;;;;;;;;;"}
|
package/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/index.tsx"],"sourcesContent":["/* eslint-disable global-require */\n// Polyfill ResizeObserver for demo\nif (typeof ResizeObserver === 'undefined') {\n global.ResizeObserver = require('resize-observer-polyfill').default;\n}\n\nexport * from './TreeView';\nexport * from './plugins';\n\nexport { TreeViewSearchBar } from './related-components/TreeViewSearchBar';\nexport * as DEPRECATED from './deprecated';\n"],"names":["ResizeObserver","global","require","default"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA,IAAI,OAAOA,cAAP,KAA0B,WAA9B,EAA2C;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.tsx"],"sourcesContent":["/* eslint-disable global-require */\n// Polyfill ResizeObserver for demo\nif (typeof ResizeObserver === 'undefined') {\n global.ResizeObserver = require('resize-observer-polyfill').default;\n}\n\nexport * from './TreeView';\nexport * from './plugins';\n\nexport { TreeViewSearchBar } from './related-components/TreeViewSearchBar';\nexport * as DEPRECATED from './deprecated';\n"],"names":["ResizeObserver","global","require","default"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA,IAAI,OAAOA,cAAP,KAA0B,WAA9B,EAA2C;EACzCC,MAAM,CAACD,cAAP,GAAwBE,OAAO,CAAC,0BAAD,CAAP,CAAoCC,OAA5D;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxSelectable.js","sources":["../../../src/parts/CheckboxSelectable.tsx"],"sourcesContent":["import React, { useContext, useCallback, useMemo } from 'react';\nimport { DSCheckbox } from '@elliemae/ds-form';\nimport styled from 'styled-components';\nimport { TreeItemCheckboxPropTypes } from '../prop-types';\nimport TreeViewContext from '../TreeViewContext';\nimport { toggleCheckboxItem } from '../utils/selectable-helper';\nimport { filterObject } from '../utils/object-helpers';\n\nconst StyledCheckboxWrapper = styled.span`\n padding-top: 3px;\n`;\nfunction CheckboxSelectable(props) {\n const { item, itemIndex } = props;\n const { id } = item;\n\n const ctx = useContext(TreeViewContext);\n const {\n props: {\n disableGroups, // radio allows disabling this, checkbox doesnt? check specs\n disableLeafs, // radio allows disabling this, checkbox doesnt? check specs\n onSelectionChange,\n },\n virtualListHelpers: { scrollToIndex },\n triggerTreeRerender,\n selectedCheckboxes,\n setSelectedCheckboxes,\n } = ctx;\n\n const onCheckboxChange = useCallback(() => {\n const newSelections = toggleCheckboxItem(item);\n const newSelectionHasmap = filterObject({ ...selectedCheckboxes, ...newSelections }, (value) => value !== false);\n setSelectedCheckboxes(newSelectionHasmap);\n triggerTreeRerender();\n\n const indexAndScrollTo = {\n scrollToItem: () => {\n 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 setSelectedCheckboxes,\n ]);\n const isChecked = useMemo(() => {\n if (selectedCheckboxes[id] === 'mixed') {\n return 'mixed';\n }\n if (selectedCheckboxes[id] === true) {\n return true;\n }\n return false;\n }, [selectedCheckboxes, id]);\n\n return (\n <StyledCheckboxWrapper>\n <DSCheckbox\n checked={isChecked}\n disabled={item.isGroup ? disableGroups : disableLeafs}\n className=\"em-ds-tree-item-checkbox\"\n data-testid=\"tree-item-checkbox\"\n onChange={onCheckboxChange}\n tabIndex=\"0\"\n />\n </StyledCheckboxWrapper>\n );\n}\n\nCheckboxSelectable.propTypes = TreeItemCheckboxPropTypes;\n\nexport default CheckboxSelectable;\n"],"names":["StyledCheckboxWrapper","styled","span","CheckboxSelectable","props","item","itemIndex","id","ctx","useContext","TreeViewContext","disableGroups","disableLeafs","onSelectionChange","scrollToIndex","virtualListHelpers","triggerTreeRerender","selectedCheckboxes","setSelectedCheckboxes","onCheckboxChange","useCallback","newSelections","toggleCheckboxItem","newSelectionHasmap","filterObject","value","indexAndScrollTo","scrollToItem","virtualIndex","isChecked","useMemo","isGroup","propTypes","TreeItemCheckboxPropTypes"],"mappings":";;;;;;;;;;;;;;;;;AAQA,IAAMA,qBAAqB,gBAAGC,MAAM,CAACC,IAAV;
|
|
1
|
+
{"version":3,"file":"CheckboxSelectable.js","sources":["../../../src/parts/CheckboxSelectable.tsx"],"sourcesContent":["import React, { useContext, useCallback, useMemo } from 'react';\nimport { DSCheckbox } from '@elliemae/ds-form';\nimport styled from 'styled-components';\nimport { TreeItemCheckboxPropTypes } from '../prop-types';\nimport TreeViewContext from '../TreeViewContext';\nimport { toggleCheckboxItem } from '../utils/selectable-helper';\nimport { filterObject } from '../utils/object-helpers';\n\nconst StyledCheckboxWrapper = styled.span`\n padding-top: 3px;\n`;\nfunction CheckboxSelectable(props) {\n const { item, itemIndex } = props;\n const { id } = item;\n\n const ctx = useContext(TreeViewContext);\n const {\n props: {\n disableGroups, // radio allows disabling this, checkbox doesnt? check specs\n disableLeafs, // radio allows disabling this, checkbox doesnt? check specs\n onSelectionChange,\n },\n virtualListHelpers: { scrollToIndex },\n triggerTreeRerender,\n selectedCheckboxes,\n setSelectedCheckboxes,\n } = ctx;\n\n const onCheckboxChange = useCallback(() => {\n const newSelections = toggleCheckboxItem(item);\n const newSelectionHasmap = filterObject({ ...selectedCheckboxes, ...newSelections }, (value) => value !== false);\n setSelectedCheckboxes(newSelectionHasmap);\n triggerTreeRerender();\n\n const indexAndScrollTo = {\n scrollToItem: () => {\n 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 setSelectedCheckboxes,\n ]);\n const isChecked = useMemo(() => {\n if (selectedCheckboxes[id] === 'mixed') {\n return 'mixed';\n }\n if (selectedCheckboxes[id] === true) {\n return true;\n }\n return false;\n }, [selectedCheckboxes, id]);\n\n return (\n <StyledCheckboxWrapper>\n <DSCheckbox\n checked={isChecked}\n disabled={item.isGroup ? disableGroups : disableLeafs}\n className=\"em-ds-tree-item-checkbox\"\n data-testid=\"tree-item-checkbox\"\n onChange={onCheckboxChange}\n tabIndex=\"0\"\n />\n </StyledCheckboxWrapper>\n );\n}\n\nCheckboxSelectable.propTypes = TreeItemCheckboxPropTypes;\n\nexport default CheckboxSelectable;\n"],"names":["StyledCheckboxWrapper","styled","span","CheckboxSelectable","props","item","itemIndex","id","ctx","useContext","TreeViewContext","disableGroups","disableLeafs","onSelectionChange","scrollToIndex","virtualListHelpers","triggerTreeRerender","selectedCheckboxes","setSelectedCheckboxes","onCheckboxChange","useCallback","newSelections","toggleCheckboxItem","newSelectionHasmap","filterObject","value","indexAndScrollTo","scrollToItem","virtualIndex","isChecked","useMemo","isGroup","propTypes","TreeItemCheckboxPropTypes"],"mappings":";;;;;;;;;;;;;;;;;AAQA,IAAMA,qBAAqB,gBAAGC,MAAM,CAACC,IAAV;EAAA;AAAA,wBAA3B;;AAGA,SAASC,kBAAT,CAA4BC,KAA5B,EAAmC;EACjC,IAAQC,IAAR,GAA4BD,KAA5B,CAAQC,IAAR;MAAcC,SAAd,GAA4BF,KAA5B,CAAcE,SAAd;EACA,IAAQC,EAAR,GAAeF,IAAf,CAAQE,EAAR;EAEA,IAAMC,GAAG,GAAGC,UAAU,CAACC,eAAD,CAAtB;EACA,iBAUIF,GAVJ,CACEJ,KADF;MAEIO,aAFJ,cAEIA,aAFJ;MAGIC,YAHJ,cAGIA,YAHJ;MAIIC,iBAJJ,cAIIA,iBAJJ;MAMwBC,aANxB,GAUIN,GAVJ,CAMEO,kBANF,CAMwBD,aANxB;MAOEE,mBAPF,GAUIR,GAVJ,CAOEQ,mBAPF;MAQEC,kBARF,GAUIT,GAVJ,CAQES,kBARF;MASEC,qBATF,GAUIV,GAVJ,CASEU,qBATF;EAYA,IAAMC,gBAAgB,GAAGC,WAAW,CAAC,YAAM;IACzC,IAAMC,aAAa,GAAGC,kBAAkB,CAACjB,IAAD,CAAxC;IACA,IAAMkB,kBAAkB,GAAGC,YAAY,iCAAMP,kBAAN,GAA6BI,aAA7B,GAA8C,UAACI,KAAD;MAAA,OAAWA,KAAK,KAAK,KAArB;KAA9C,CAAvC;IACAP,qBAAqB,CAACK,kBAAD,CAArB;IACAP,mBAAmB;IAEnB,IAAMU,gBAAgB,GAAG;MACvBC,YAAY,EAAE,wBAAM;QAClBb,aAAa,CAACT,IAAI,CAACuB,YAAN,CAAb;OAFqB;MAIvBtB,SAAS,EAATA;KAJF;IAMA,IAAIO,iBAAJ,EAAuBA,iBAAiB,CAACU,kBAAD,EAAqBlB,IAArB,EAA2BqB,gBAA3B,CAAjB;GAZW,EAajC,CACDrB,IADC,EAEDW,mBAFC,EAGDH,iBAHC,EAIDP,SAJC,EAKDQ,aALC,EAMDG,kBANC,EAODC,qBAPC,CAbiC,CAApC;EAsBA,IAAMW,SAAS,GAAGC,OAAO,CAAC,YAAM;IAC9B,IAAIb,kBAAkB,CAACV,EAAD,CAAlB,KAA2B,OAA/B,EAAwC;MACtC,OAAO,OAAP;;;IAEF,IAAIU,kBAAkB,CAACV,EAAD,CAAlB,KAA2B,IAA/B,EAAqC;MACnC,OAAO,IAAP;;;IAEF,OAAO,KAAP;GAPuB,EAQtB,CAACU,kBAAD,EAAqBV,EAArB,CARsB,CAAzB;EAUA,oBACE,oBAAC,qBAAD,qBACE,oBAAC,UAAD;IACE,OAAO,EAAEsB,SADX;IAEE,QAAQ,EAAExB,IAAI,CAAC0B,OAAL,GAAepB,aAAf,GAA+BC,YAF3C;IAGE,SAAS,EAAC,0BAHZ;IAIE,eAAY,oBAJd;IAKE,QAAQ,EAAEO,gBALZ;IAME,QAAQ,EAAC;IAPb,CADF;AAYD;;AAEDhB,kBAAkB,CAAC6B,SAAnB,GAA+BC,yBAA/B;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChildrenCountDisplayer.js","sources":["../../../src/parts/ChildrenCountDisplayer.tsx"],"sourcesContent":["import React from 'react';\nimport { TreeViewItemPropType } from '../prop-types';\nimport {\n DSTreeViewPrefix,\n treeItemBlockName,\n} from '../config/cssClassesConstants';\n\nconst className = `${DSTreeViewPrefix}-${treeItemBlockName}-children-count-displayer`;\n\nexport const ChildrenCountDisplayer = (props) => {\n const { item } = props;\n const { isGroup, children } = item;\n\n if (!isGroup) return null;\n // return ` | ${children.length} Items`;\n return (\n <span\n data-testid=\"tree-item-children-count-displayer\"\n className={className}\n >{` | ${children.length} Items`}</span>\n );\n};\nChildrenCountDisplayer.propTypes = { item: TreeViewItemPropType.isRequired };\n"],"names":["className","DSTreeViewPrefix","treeItemBlockName","ChildrenCountDisplayer","props","item","isGroup","children","length","propTypes","TreeViewItemPropType","isRequired"],"mappings":";;;;;AAOA,IAAMA,SAAS,aAAMC,gBAAN,cAA0BC,iBAA1B,8BAAf;IAEaC,sBAAsB,GAAG,SAAzBA,sBAAyB,CAACC,KAAD,EAAW;
|
|
1
|
+
{"version":3,"file":"ChildrenCountDisplayer.js","sources":["../../../src/parts/ChildrenCountDisplayer.tsx"],"sourcesContent":["import React from 'react';\nimport { TreeViewItemPropType } from '../prop-types';\nimport {\n DSTreeViewPrefix,\n treeItemBlockName,\n} from '../config/cssClassesConstants';\n\nconst className = `${DSTreeViewPrefix}-${treeItemBlockName}-children-count-displayer`;\n\nexport const ChildrenCountDisplayer = (props) => {\n const { item } = props;\n const { isGroup, children } = item;\n\n if (!isGroup) return null;\n // return ` | ${children.length} Items`;\n return (\n <span\n data-testid=\"tree-item-children-count-displayer\"\n className={className}\n >{` | ${children.length} Items`}</span>\n );\n};\nChildrenCountDisplayer.propTypes = { item: TreeViewItemPropType.isRequired };\n"],"names":["className","DSTreeViewPrefix","treeItemBlockName","ChildrenCountDisplayer","props","item","isGroup","children","length","propTypes","TreeViewItemPropType","isRequired"],"mappings":";;;;;AAOA,IAAMA,SAAS,aAAMC,gBAAN,cAA0BC,iBAA1B,8BAAf;IAEaC,sBAAsB,GAAG,SAAzBA,sBAAyB,CAACC,KAAD,EAAW;EAC/C,IAAQC,IAAR,GAAiBD,KAAjB,CAAQC,IAAR;EACA,IAAQC,OAAR,GAA8BD,IAA9B,CAAQC,OAAR;MAAiBC,QAAjB,GAA8BF,IAA9B,CAAiBE,QAAjB;EAEA,IAAI,CAACD,OAAL,EAAc,OAAO,IAAP,CAJiC;;EAM/C,oBACE;IACE,eAAY,oCADd;IAEE,SAAS,EAAEN;kBACLO,QAAQ,CAACC,MAHjB,YADF;AAMD;AACDL,sBAAsB,CAACM,SAAvB,GAAmC;EAAEJ,IAAI,EAAEK,oBAAoB,CAACC;AAA7B,CAAnC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpandCaret.js","sources":["../../../src/parts/ExpandCaret.tsx"],"sourcesContent":["import React, { useContext, useCallback } from 'react';\nimport Button from '@elliemae/ds-button';\nimport { ArrowheadDown, ArrowheadRight } from '@elliemae/ds-icons';\nimport { toggleItemExpand } from '../utils/group-expands-helpers';\nimport { focusItem } from '../utils/tree-helpers';\nimport TreeViewContext from '../TreeViewContext';\nimport { TreeItemExpandCaretPropTypes } from '../prop-types';\n\nexport const ExpandCaret = (props) => {\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 setLatestToggledItem,\n setFocusedItem,\n virtualListHelpers: { scrollToIndex },\n } = ctx;\n\n if (isGroupOrHasChildrens)\n return (\n <Button\n buttonType=\"text\"\n className=\"expandable-arrow\"\n data-testid=\"tree-item-expand-toggle\"\n key={`${id}-expand-addon`}\n icon={\n isExpanded ? (\n <ArrowheadDown size=\"s\" data-testid=\"ic-arrow-head-down\" />\n ) : (\n <ArrowheadRight size=\"s\" data-testid=\"ic-arrow-head-right\" />\n )\n }\n onMouseDown={(e) => {\n // prevent focusing the caret\n if (e) {\n e.preventDefault();\n }\n }}\n onClick={(e) => {\n e.stopPropagation();\n handleExpandGroup(item, triggerTreeRerender, scrollToIndex, e);\n setLatestToggledItem(item);\n onItemFocus({\n itemIndex: item.virtualIndex,\n scrollToItem: (opts = { align: 'start' }) => scrollToIndex(item.virtualIndex, opts),\n item,\n });\n setFocusedItem(item);\n focusItem(item);\n }}\n size=\"s\"\n tabIndex={-1}\n />\n );\n return <div style={{ width: '24px' }} />;\n};\n\nExpandCaret.propTypes = TreeItemExpandCaretPropTypes;\n"],"names":["ExpandCaret","props","defaultHandleExpandGroup","useCallback","toggleItemExpand","item","id","isExpanded","isGroup","children","isGroupOrHasChildrens","Array","isArray","length","ctx","useContext","TreeViewContext","onItemFocus","handleExpandGroup","triggerTreeRerender","setLatestToggledItem","setFocusedItem","scrollToIndex","virtualListHelpers","e","preventDefault","stopPropagation","itemIndex","virtualIndex","scrollToItem","opts","align","focusItem","width","propTypes","TreeItemExpandCaretPropTypes"],"mappings":";;;;;;;;;;;IAQaA,WAAW,GAAG,SAAdA,WAAc,CAACC,KAAD,EAAW;
|
|
1
|
+
{"version":3,"file":"ExpandCaret.js","sources":["../../../src/parts/ExpandCaret.tsx"],"sourcesContent":["import React, { useContext, useCallback } from 'react';\nimport Button from '@elliemae/ds-button';\nimport { ArrowheadDown, ArrowheadRight } from '@elliemae/ds-icons';\nimport { toggleItemExpand } from '../utils/group-expands-helpers';\nimport { focusItem } from '../utils/tree-helpers';\nimport TreeViewContext from '../TreeViewContext';\nimport { TreeItemExpandCaretPropTypes } from '../prop-types';\n\nexport const ExpandCaret = (props) => {\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 setLatestToggledItem,\n setFocusedItem,\n virtualListHelpers: { scrollToIndex },\n } = ctx;\n\n if (isGroupOrHasChildrens)\n return (\n <Button\n buttonType=\"text\"\n className=\"expandable-arrow\"\n data-testid=\"tree-item-expand-toggle\"\n key={`${id}-expand-addon`}\n icon={\n isExpanded ? (\n <ArrowheadDown size=\"s\" data-testid=\"ic-arrow-head-down\" />\n ) : (\n <ArrowheadRight size=\"s\" data-testid=\"ic-arrow-head-right\" />\n )\n }\n onMouseDown={(e) => {\n // prevent focusing the caret\n if (e) {\n e.preventDefault();\n }\n }}\n onClick={(e) => {\n e.stopPropagation();\n handleExpandGroup(item, triggerTreeRerender, scrollToIndex, e);\n setLatestToggledItem(item);\n onItemFocus({\n itemIndex: item.virtualIndex,\n scrollToItem: (opts = { align: 'start' }) => scrollToIndex(item.virtualIndex, opts),\n item,\n });\n setFocusedItem(item);\n focusItem(item);\n }}\n size=\"s\"\n tabIndex={-1}\n />\n );\n return <div style={{ width: '24px' }} />;\n};\n\nExpandCaret.propTypes = TreeItemExpandCaretPropTypes;\n"],"names":["ExpandCaret","props","defaultHandleExpandGroup","useCallback","toggleItemExpand","item","id","isExpanded","isGroup","children","isGroupOrHasChildrens","Array","isArray","length","ctx","useContext","TreeViewContext","onItemFocus","handleExpandGroup","triggerTreeRerender","setLatestToggledItem","setFocusedItem","scrollToIndex","virtualListHelpers","e","preventDefault","stopPropagation","itemIndex","virtualIndex","scrollToItem","opts","align","focusItem","width","propTypes","TreeItemExpandCaretPropTypes"],"mappings":";;;;;;;;;;;IAQaA,WAAW,GAAG,SAAdA,WAAc,CAACC,KAAD,EAAW;EACpC,IAAMC,wBAAwB,GAAGC,WAAW,CAACC,gBAAD,EAAmB,EAAnB,CAA5C;EACA,IAAQC,IAAR,GAAiBJ,KAAjB,CAAQI,IAAR;EACA,IAAQC,EAAR,GAA8CD,IAA9C,CAAQC,EAAR;MAAYC,UAAZ,GAA8CF,IAA9C,CAAYE,UAAZ;MAAwBC,OAAxB,GAA8CH,IAA9C,CAAwBG,OAAxB;MAAiCC,QAAjC,GAA8CJ,IAA9C,CAAiCI,QAAjC;EACA,IAAMC,qBAAqB,GAAGF,OAAO,IAAKG,KAAK,CAACC,OAAN,CAAcH,QAAd,KAA2BA,QAAQ,CAACI,MAAT,GAAkB,CAAvF;EACA,IAAMC,GAAG,GAAGC,UAAU,CAACC,eAAD,CAAtB;EACA,IACWC,WADX,GAOIH,GAPJ,CACEb,KADF,CACWgB,WADX;8BAOIH,G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AAE;;IAA5B;AACD;AAEDjC,WAAW,CAACkC,SAAZ,GAAwBC,4BAAxB;;;;"}
|
package/esm/parts/Icon.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.js","sources":["../../../src/parts/Icon.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { cx } from '@elliemae/ds-utilities';\n\nimport TreeViewContext from '../TreeViewContext';\n\nexport const Icon = (props) => {\n const { item } = props;\n const isGroupOrHasChildrens =\n 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\n ? 'tree-item-group-icon'\n : 'tree-item-icon',\n className: cx(icon.props.className, 'tree-item-icon'),\n });\n};\n"],"names":["Icon","props","item","isGroupOrHasChildrens","isGroup","Array","isArray","children","length","ctx","useContext","TreeViewContext","groupIcon","itemIcon","icon","React","cloneElement","className","cx"],"mappings":";;;;IAKaA,IAAI,GAAG,SAAPA,IAAO,CAACC,KAAD,EAAW;
|
|
1
|
+
{"version":3,"file":"Icon.js","sources":["../../../src/parts/Icon.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { cx } from '@elliemae/ds-utilities';\n\nimport TreeViewContext from '../TreeViewContext';\n\nexport const Icon = (props) => {\n const { item } = props;\n const isGroupOrHasChildrens =\n 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\n ? 'tree-item-group-icon'\n : 'tree-item-icon',\n className: cx(icon.props.className, 'tree-item-icon'),\n });\n};\n"],"names":["Icon","props","item","isGroupOrHasChildrens","isGroup","Array","isArray","children","length","ctx","useContext","TreeViewContext","groupIcon","itemIcon","icon","React","cloneElement","className","cx"],"mappings":";;;;IAKaA,IAAI,GAAG,SAAPA,IAAO,CAACC,KAAD,EAAW;EAC7B,IAAQC,IAAR,GAAiBD,KAAjB,CAAQC,IAAR;EACA,IAAMC,qBAAqB,GACzBD,IAAI,CAACE,OAAL,IAAiBC,KAAK,CAACC,OAAN,CAAcJ,IAAI,CAACK,QAAnB,KAAgCL,IAAI,CAACK,QAAL,CAAcC,MAAd,GAAuB,CAD1E;EAEA,IAAMC,GAAG,GAAGC,UAAU,CAACC,eAAD,CAAtB;EACA,iBAEIF,GAFJ,CACER,KADF;MACWW,SADX,cACWA,SADX;MACsBC,QADtB,cACsBA,QADtB;EAGA,IAAMC,IAAI,GAAGX,qBAAqB,GAAGS,SAAH,GAAeC,QAAjD;EACA,IAAI,CAACC,IAAL,EAAW,OAAO,IAAP;EAEX,oBAAOC,KAAK,CAACC,YAAN,CAAmBF,IAAnB,EAAyB;IAC9B,eAAeX,qBAAqB,GAChC,sBADgC,GAEhC,gBAH0B;IAI9Bc,SAAS,EAAEC,EAAE,CAACJ,IAAI,CAACb,KAAL,CAAWgB,SAAZ,EAAuB,gBAAvB;GAJR,CAAP;AAMD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NestingSpace.js","sources":["../../../src/parts/NestingSpace.tsx"],"sourcesContent":["import React from 'react';\nimport { TreeItemNestingSpacePropTypes } from '../prop-types';\n\nconst getItemNestingLeftPadding = (level, opts) => {\n const { spaceForNestingLevel = 1.5 } = {\n ...opts,\n };\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: Record<string, any>;\n spaceForNestingLevel: number;\n};\n\nexport const NestingSpace = (props: NestingSpacePropsType): JSX.Element => {\n const { item, spaceForNestingLevel } = props;\n const { treeDepth } = item;\n\n const itemNestingLeftPadding = getItemNestingLeftPadding(treeDepth - 1, {\n spaceForNestingLevel,\n });\n\n return (\n <div\n data-testid=\"tree-item-nested-space\"\n style={{ width: itemNestingLeftPadding }}\n />\n );\n};\nNestingSpace.propTypes = TreeItemNestingSpacePropTypes;\n"],"names":["getItemNestingLeftPadding","level","opts","spaceForNestingLevel","groupLeftPadding","finalLeftPadding","NestingSpace","props","item","treeDepth","itemNestingLeftPadding","width","propTypes","TreeItemNestingSpacePropTypes"],"mappings":";;;;;;;;;AAGA,IAAMA,yBAAyB,GAAG,SAA5BA,yBAA4B,CAACC,KAAD,EAAQC,IAAR,EAAiB;
|
|
1
|
+
{"version":3,"file":"NestingSpace.js","sources":["../../../src/parts/NestingSpace.tsx"],"sourcesContent":["import React from 'react';\nimport { TreeItemNestingSpacePropTypes } from '../prop-types';\n\nconst getItemNestingLeftPadding = (level, opts) => {\n const { spaceForNestingLevel = 1.5 } = {\n ...opts,\n };\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: Record<string, any>;\n spaceForNestingLevel: number;\n};\n\nexport const NestingSpace = (props: NestingSpacePropsType): JSX.Element => {\n const { item, spaceForNestingLevel } = props;\n const { treeDepth } = item;\n\n const itemNestingLeftPadding = getItemNestingLeftPadding(treeDepth - 1, {\n spaceForNestingLevel,\n });\n\n return (\n <div\n data-testid=\"tree-item-nested-space\"\n style={{ width: itemNestingLeftPadding }}\n />\n );\n};\nNestingSpace.propTypes = TreeItemNestingSpacePropTypes;\n"],"names":["getItemNestingLeftPadding","level","opts","spaceForNestingLevel","groupLeftPadding","finalLeftPadding","NestingSpace","props","item","treeDepth","itemNestingLeftPadding","width","propTypes","TreeItemNestingSpacePropTypes"],"mappings":";;;;;;;;;AAGA,IAAMA,yBAAyB,GAAG,SAA5BA,yBAA4B,CAACC,KAAD,EAAQC,IAAR,EAAiB;EACjD,8BACKA,IADL;oCAAQC,oBAAR;MAAQA,oBAAR,sCAA+B,GAA/B;;EAGA,IAAMC,gBAAgB,GAAGD,oBAAoB,IAAIF,KAAK,GAAG,CAAZ,CAA7C;EACA,IAAMI,gBAAgB,GAAGD,gBAAgB,GAAGD,oBAAnB,GAA0C,GAAnE,CALiD;;;EAQjD,OAAOE,gBAAgB,GAAG,CAAnB,aAA0BA,gBAA1B,UAAiD,GAAxD;AACD,CATD;;IAgBaC,YAAY,GAAG,SAAfA,YAAe,CAACC,KAAD,EAA+C;EACzE,IAAQC,IAAR,GAAuCD,KAAvC,CAAQC,IAAR;MAAcL,oBAAd,GAAuCI,KAAvC,CAAcJ,oBAAd;EACA,IAAQM,SAAR,GAAsBD,IAAtB,CAAQC,SAAR;EAEA,IAAMC,sBAAsB,GAAGV,yBAAyB,CAACS,SAAS,GAAG,CAAb,EAAgB;IACtEN,oBAAoB,EAApBA;GADsD,CAAxD;EAIA,oBACE;IACE,eAAY,wBADd;IAEE,KAAK,EAAE;MAAEQ,KAAK,EAAED;;IAHpB;AAMD;AACDJ,YAAY,CAACM,SAAb,GAAyBC,6BAAzB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioSelectable.js","sources":["../../../src/parts/RadioSelectable.tsx"],"sourcesContent":["import React, { useContext, useCallback, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport { DSRadio } from '@elliemae/ds-form';\nimport { TreeViewItemPropType } from '../prop-types';\nimport TreeViewContext from '../TreeViewContext';\n\nfunction RadioSelectable(props) {\n const { item, itemIndex } = props;\n\n const ctx = useContext(TreeViewContext);\n const {\n props: {\n disableGroups, // radio allows disabling this, checkbox doesnt? check specs\n disableLeafs, // radio allows disabling this, checkbox doesnt? check specs\n onSelectionChange,\n },\n virtualListHelpers: { scrollToIndex },\n uniqueTreeViewUUID,\n selectedCheckboxes,\n setSelectedCheckboxes,\n } = ctx;\n\n const { id } = item;\n\n const onRadioChange = useCallback(() => {\n const newSelectionHasmap = { [id]: true };\n setSelectedCheckboxes(newSelectionHasmap);\n const indexAndScrollTo = {\n scrollToItem: () => {\n scrollToIndex(item.virtualIndex);\n },\n itemIndex,\n };\n if (onSelectionChange) onSelectionChange(newSelectionHasmap, item, indexAndScrollTo);\n }, [item, id, onSelectionChange, scrollToIndex]);\n\n const radioName = useMemo(() => `radios-${uniqueTreeViewUUID}`, [uniqueTreeViewUUID]);\n\n return (\n <DSRadio\n checked={selectedCheckboxes[id] === true}\n name={radioName}\n disabled={item.isGroup ? disableGroups : disableLeafs}\n className=\"em-ds-tree-item-radio\"\n data-testid=\"tree-item-radio\"\n onChange={onRadioChange}\n tabIndex=\"0\"\n />\n );\n}\n\nRadioSelectable.propTypes = {\n item: TreeViewItemPropType.isRequired,\n itemIndex: PropTypes.number.isRequired,\n};\n\nexport default RadioSelectable;\n"],"names":["RadioSelectable","props","item","itemIndex","ctx","useContext","TreeViewContext","disableGroups","disableLeafs","onSelectionChange","scrollToIndex","virtualListHelpers","uniqueTreeViewUUID","selectedCheckboxes","setSelectedCheckboxes","id","onRadioChange","useCallback","newSelectionHasmap","indexAndScrollTo","scrollToItem","virtualIndex","radioName","useMemo","isGroup","propTypes","TreeViewItemPropType","isRequired","PropTypes","number"],"mappings":";;;;;;;AAMA,SAASA,eAAT,CAAyBC,KAAzB,EAAgC;
|
|
1
|
+
{"version":3,"file":"RadioSelectable.js","sources":["../../../src/parts/RadioSelectable.tsx"],"sourcesContent":["import React, { useContext, useCallback, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport { DSRadio } from '@elliemae/ds-form';\nimport { TreeViewItemPropType } from '../prop-types';\nimport TreeViewContext from '../TreeViewContext';\n\nfunction RadioSelectable(props) {\n const { item, itemIndex } = props;\n\n const ctx = useContext(TreeViewContext);\n const {\n props: {\n disableGroups, // radio allows disabling this, checkbox doesnt? check specs\n disableLeafs, // radio allows disabling this, checkbox doesnt? check specs\n onSelectionChange,\n },\n virtualListHelpers: { scrollToIndex },\n uniqueTreeViewUUID,\n selectedCheckboxes,\n setSelectedCheckboxes,\n } = ctx;\n\n const { id } = item;\n\n const onRadioChange = useCallback(() => {\n const newSelectionHasmap = { [id]: true };\n setSelectedCheckboxes(newSelectionHasmap);\n const indexAndScrollTo = {\n scrollToItem: () => {\n scrollToIndex(item.virtualIndex);\n },\n itemIndex,\n };\n if (onSelectionChange) onSelectionChange(newSelectionHasmap, item, indexAndScrollTo);\n }, [item, id, onSelectionChange, scrollToIndex]);\n\n const radioName = useMemo(() => `radios-${uniqueTreeViewUUID}`, [uniqueTreeViewUUID]);\n\n return (\n <DSRadio\n checked={selectedCheckboxes[id] === true}\n name={radioName}\n disabled={item.isGroup ? disableGroups : disableLeafs}\n className=\"em-ds-tree-item-radio\"\n data-testid=\"tree-item-radio\"\n onChange={onRadioChange}\n tabIndex=\"0\"\n />\n );\n}\n\nRadioSelectable.propTypes = {\n item: TreeViewItemPropType.isRequired,\n itemIndex: PropTypes.number.isRequired,\n};\n\nexport default RadioSelectable;\n"],"names":["RadioSelectable","props","item","itemIndex","ctx","useContext","TreeViewContext","disableGroups","disableLeafs","onSelectionChange","scrollToIndex","virtualListHelpers","uniqueTreeViewUUID","selectedCheckboxes","setSelectedCheckboxes","id","onRadioChange","useCallback","newSelectionHasmap","indexAndScrollTo","scrollToItem","virtualIndex","radioName","useMemo","isGroup","propTypes","TreeViewItemPropType","isRequired","PropTypes","number"],"mappings":";;;;;;;AAMA,SAASA,eAAT,CAAyBC,KAAzB,EAAgC;EAC9B,IAAQC,IAAR,GAA4BD,KAA5B,CAAQC,IAAR;MAAcC,SAAd,GAA4BF,KAA5B,CAAcE,SAAd;EAEA,IAAMC,GAAG,GAAGC,U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B;EAC1BvB,IAAI,EAAEwB,oBAAoB,CAACC,UADD;EAE1BxB,SAAS,EAAEyB,SAAS,CAACC,MAAV,CAAiBF;AAFF,CAA5B;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeItem.js","sources":["../../../src/parts/TreeItem.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport React, { useContext, useState, useMemo, useRef, useCallback } from 'react';\nimport { SortableElement, SortableHandle } from '@elliemae/react-sortable-hoc';\n\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { GripperVertical } from '@elliemae/ds-icons';\n\nimport { TreeItemPropTypes } from '../prop-types';\n\nimport RadioSelectable from './RadioSelectable';\nimport CheckboxSelectable from './CheckboxSelectable';\nimport TreeViewContext from '../TreeViewContext';\nimport { setMultipleRefs } from '../utils/refs-helpers';\nimport { useOnItemKeyDown } from '../utils/keyboard-helpers';\nimport { NestingSpace } from './NestingSpace';\nimport { Icon } from './Icon';\nimport { ExpandCaret } from './ExpandCaret';\nimport { TreeItemText } from './TreeItemText';\nimport { DSTreeViewPrefix, treeItemBlockName } from '../config/cssClassesConstants';\n\nexport const TreeListItem = aggregatedClasses('li', {\n 'data-testid': treeItemBlockName,\n role: 'treeitem',\n})(treeItemBlockName);\nexport const TreeListItemAddonsWrapper = aggregatedClasses('div')(treeItemBlockName, 'addons');\nconst DnDHandle = SortableHandle(({ id }) => (\n <GripperVertical\n data-testid=\"drag-handle\"\n key={`${id}-drag-handle`}\n className=\"drag-handle\"\n size=\"s\"\n onMouseDown={(e) => {\n // prevent focusing the drag-handle to avoid borders\n if (e) {\n e.preventDefault();\n }\n }}\n tabIndex=\"0\"\n />\n));\n\nexport const TreeItem = (props) => {\n const {\n item,\n itemIndex,\n itemWrapperStyle = {},\n virtualItemRef,\n spaceForNestingLevel = 1.5,\n onMouseDragOverItem,\n } = props;\n const { id, node } = item;\n const { nodeItemRef } = node.model;\n const openFolderOnHoverTimeout = useRef();\n\n const [isDraggingOverThis, setIsDraggingOverThis] = useState(false);\n const onItemKeyDown = useOnItemKeyDown(item);\n\n const ctx = useContext(TreeViewContext);\n const {\n props: { disableIcons, rightAddons, onItemClick, onItemFocus, rowSize, labelOverflow },\n relativeMouseCord,\n withRadioChecks,\n withCheckboxChecks,\n withDragAndDrop,\n selectedItem,\n selectedCheckboxes,\n hoverItem,\n isDragging,\n virtualListHelpers: { scrollToIndex },\n setHoverItem,\n setSelectedItem,\n setFocusedItem,\n } = ctx;\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 const setItemRefs = (ref) => {\n setMultipleRefs(virtualItemRef, nodeItemRef)(ref);\n };\n\n const dropPreviewClassName = useMemo(() => {\n if (!withDragAndDrop || !relativeMouseCord || !isDraggingOverThis) return '';\n const { isBefore, isAfter, isValid } = relativeMouseCord;\n let className = `${DSTreeViewPrefix}-${treeItemBlockName}${isValid ? '--valid' : '--invalid'}`;\n\n if (isBefore) className += '-drop-before';\n else if (isAfter) className += '-drop-after';\n else className += '-drop-in';\n return className;\n }, [withDragAndDrop, relativeMouseCord, isDraggingOverThis]);\n\n const selectedClassName = useMemo(() => (selectedItem?.id === item.id ? 'selected' : ''), [selectedItem]);\n const hoverClassName = useMemo(\n () => (hoverItem?.id !== item.id || (withDragAndDrop && isDragging) ? '' : 'hover'),\n [hoverItem, withDragAndDrop, 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 finalClassName = useMemo(\n () => `${dropPreviewClassName} ${fixedHeightClassname} ${selectedClassName} ${hoverClassName}`,\n [dropPreviewClassName, selectedClassName, hoverClassName, fixedHeightClassname],\n );\n\n const handleItemClick = useCallback(\n (e) => {\n onItemClick(item, e);\n setFocusedItem(item);\n setSelectedItem(item);\n onItemFocus({\n itemIndex: item.virtualIndex,\n scrollToItem: (opts = { align: 'start' }) => scrollToIndex(item.virtualIndex, opts),\n item,\n });\n },\n [item, scrollToIndex, onItemClick, onItemFocus, setSelectedItem, setFocusedItem],\n );\n\n return (\n <TreeListItem\n tabIndex=\"0\"\n onMouseMove={(event) => {\n if (withDragAndDrop) {\n onMouseDragOverItem({\n event,\n item,\n itemIndex,\n setIsDraggingOverThis,\n openFolderOnHoverTimeout,\n });\n }\n }}\n onMouseLeave={() => {\n if (withDragAndDrop) {\n setIsDraggingOverThis(false);\n if (openFolderOnHoverTimeout?.current) clearTimeout(openFolderOnHoverTimeout.current);\n }\n if (hoverItem?.id === item.id) {\n setHoverItem(null);\n }\n }}\n onMouseEnter={() => {\n setHoverItem(item);\n }}\n onClick={handleItemClick}\n ref={setItemRefs}\n style={{ ...itemWrapperStyle }}\n className={finalClassName}\n aria-expanded={item.isExpanded}\n aria-selected={selectedCheckboxes[item.id]}\n data-id={item.id}\n data-index={item.virtualIndex}\n onKeyDown={onItemKeyDown}\n >\n <TreeListItemAddonsWrapper>\n {withDragAndDrop ? <DnDHandle id={id} /> : null}\n {withRadioChecks ? <RadioSelectable item={item} itemIndex={itemIndex} /> : null}\n {withCheckboxChecks ? <CheckboxSelectable item={item} itemIndex={itemIndex} /> : null}\n <NestingSpace item={item} spaceForNestingLevel={spaceForNestingLevel} />\n <ExpandCaret item={item} />\n {!disableIcons ? <Icon item={item} /> : null}\n </TreeListItemAddonsWrapper>\n <TreeItemText item={item} />\n {rightAddons && (\n <TreeListItemAddonsWrapper>\n {typeof rightAddons === 'function' ? rightAddons(item) : rightAddons}\n </TreeListItemAddonsWrapper>\n )}\n </TreeListItem>\n );\n};\n\nTreeItem.propTypes = TreeItemPropTypes;\n\nexport const DragAndDropTreeItem = SortableElement(TreeItem);\n"],"names":["TreeListItem","aggregatedClasses","treeItemBlockName","role","TreeListItemAddonsWrapper","DnDHandle","SortableHandle","id","e","preventDefault","TreeItem","props","item","itemIndex","itemWrapperStyle","virtualItemRef","spaceForNestingLevel","onMouseDragOverItem","node","nodeItemRef","model","openFolderOnHoverTimeout","useRef","useState","isDraggingOverThis","setIsDraggingOverThis","onItemKeyDown","useOnItemKeyDown","ctx","useContext","TreeViewContext","disableIcons","rightAddons","onItemClick","onItemFocus","rowSize","labelOverflow","relativeMouseCord","withRadioChecks","withCheckboxChecks","withDragAndDrop","selectedItem","selectedCheckboxes","hoverItem","isDragging","scrollToIndex","virtualListHelpers","setHoverItem","setSelectedItem","setFocusedItem","setItemRefs","ref","setMultipleRefs","dropPreviewClassName","useMemo","isBefore","isAfter","isValid","className","DSTreeViewPrefix","selectedClassName","hoverClassName","fixedHeightClassname","finalClassName","handleItemClick","useCallback","virtualIndex","scrollToItem","opts","align","event","current","clearTimeout","isExpanded","propTypes","TreeItemPropTypes","DragAndDropTreeItem","SortableElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoBaA,YAAY,GAAGC,iBAAiB,CAAC,IAAD,EAAO;AAClD,iBAAeC,iBADmC;AAElDC,EAAAA,IAAI,EAAE;AAF4C,CAAP,CAAjB,CAGzBD,iBAHyB;IAIfE,yBAAyB,GAAGH,iBAAiB,CAAC,KAAD,CAAjB,CAAyBC,iBAAzB,EAA4C,QAA5C;AACzC,IAAMG,SAAS,GAAGC,cAAc,CAAC;AAAA,MAAGC,EAAH,QAAGA,EAAH;AAAA,sBAC/B,oBAAC,eAAD;AACE,mBAAY,aADd;AAEE,IAAA,GAAG,YAAKA,EAAL,iBAFL;AAGE,IAAA,SAAS,EAAC,aAHZ;AAIE,IAAA,IAAI,EAAC,GAJP;AAKE,IAAA,WAAW,EAAE,qBAACC,CAAD,EAAO;AAClB;AACA,UAAIA,CAAJ,EAAO;AACLA,QAAAA,CAAC,CAACC,cAAF;AACD;AACF,KAVH;AAWE,IAAA,QAAQ,EAAC;AAXX,IAD+B;AAAA,CAAD,CAAhC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disable max-lines */\nimport React, { useContext, useState, useMemo, useRef, useCallback } from 'react';\nimport { SortableElement, SortableHandle } from '@elliemae/react-sortable-hoc';\n\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { GripperVertical } from '@elliemae/ds-icons';\n\nimport { TreeItemPropTypes } from '../prop-types';\n\nimport RadioSelectable from './RadioSelectable';\nimport CheckboxSelectable from './CheckboxSelectable';\nimport TreeViewContext from '../TreeViewContext';\nimport { setMultipleRefs } from '../utils/refs-helpers';\nimport { useOnItemKeyDown } from '../utils/keyboard-helpers';\nimport { NestingSpace } from './NestingSpace';\nimport { Icon } from './Icon';\nimport { ExpandCaret } from './ExpandCaret';\nimport { TreeItemText } from './TreeItemText';\nimport { DSTreeViewPrefix, treeItemBlockName } from '../config/cssClassesConstants';\n\nexport const TreeListItem = aggregatedClasses('li', {\n 'data-testid': treeItemBlockName,\n role: 'treeitem',\n})(treeItemBlockName);\nexport const TreeListItemAddonsWrapper = aggregatedClasses('div')(treeItemBlockName, 'addons');\nconst DnDHandle = SortableHandle(({ id }) => (\n <GripperVertical\n data-testid=\"drag-handle\"\n key={`${id}-drag-handle`}\n className=\"drag-handle\"\n size=\"s\"\n onMouseDown={(e) => {\n // prevent focusing the drag-handle to avoid borders\n if (e) {\n e.preventDefault();\n }\n }}\n tabIndex=\"0\"\n />\n));\n\nexport const TreeItem = (props) => {\n const {\n item,\n itemIndex,\n itemWrapperStyle = {},\n virtualItemRef,\n spaceForNestingLevel = 1.5,\n onMouseDragOverItem,\n } = props;\n const { id, node } = item;\n const { nodeItemRef } = node.model;\n const openFolderOnHoverTimeout = useRef();\n\n const [isDraggingOverThis, setIsDraggingOverThis] = useState(false);\n const onItemKeyDown = useOnItemKeyDown(item);\n\n const ctx = useContext(TreeViewContext);\n const {\n props: { disableIcons, rightAddons, onItemClick, onItemFocus, rowSize, labelOverflow },\n relativeMouseCord,\n withRadioChecks,\n withCheckboxChecks,\n withDragAndDrop,\n selectedItem,\n selectedCheckboxes,\n hoverItem,\n isDragging,\n virtualListHelpers: { scrollToIndex },\n setHoverItem,\n setSelectedItem,\n setFocusedItem,\n } = ctx;\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 const setItemRefs = (ref) => {\n setMultipleRefs(virtualItemRef, nodeItemRef)(ref);\n };\n\n const dropPreviewClassName = useMemo(() => {\n if (!withDragAndDrop || !relativeMouseCord || !isDraggingOverThis) return '';\n const { isBefore, isAfter, isValid } = relativeMouseCord;\n let className = `${DSTreeViewPrefix}-${treeItemBlockName}${isValid ? '--valid' : '--invalid'}`;\n\n if (isBefore) className += '-drop-before';\n else if (isAfter) className += '-drop-after';\n else className += '-drop-in';\n return className;\n }, [withDragAndDrop, relativeMouseCord, isDraggingOverThis]);\n\n const selectedClassName = useMemo(() => (selectedItem?.id === item.id ? 'selected' : ''), [selectedItem]);\n const hoverClassName = useMemo(\n () => (hoverItem?.id !== item.id || (withDragAndDrop && isDragging) ? '' : 'hover'),\n [hoverItem, withDragAndDrop, 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 finalClassName = useMemo(\n () => `${dropPreviewClassName} ${fixedHeightClassname} ${selectedClassName} ${hoverClassName}`,\n [dropPreviewClassName, selectedClassName, hoverClassName, fixedHeightClassname],\n );\n\n const handleItemClick = useCallback(\n (e) => {\n onItemClick(item, e);\n setFocusedItem(item);\n setSelectedItem(item);\n onItemFocus({\n itemIndex: item.virtualIndex,\n scrollToItem: (opts = { align: 'start' }) => scrollToIndex(item.virtualIndex, opts),\n item,\n });\n },\n [item, scrollToIndex, onItemClick, onItemFocus, setSelectedItem, setFocusedItem],\n );\n\n return (\n <TreeListItem\n tabIndex=\"0\"\n onMouseMove={(event) => {\n if (withDragAndDrop) {\n onMouseDragOverItem({\n event,\n item,\n itemIndex,\n setIsDraggingOverThis,\n openFolderOnHoverTimeout,\n });\n }\n }}\n onMouseLeave={() => {\n if (withDragAndDrop) {\n setIsDraggingOverThis(false);\n if (openFolderOnHoverTimeout?.current) clearTimeout(openFolderOnHoverTimeout.current);\n }\n if (hoverItem?.id === item.id) {\n setHoverItem(null);\n }\n }}\n onMouseEnter={() => {\n setHoverItem(item);\n }}\n onClick={handleItemClick}\n ref={setItemRefs}\n style={{ ...itemWrapperStyle }}\n className={finalClassName}\n aria-expanded={item.isExpanded}\n aria-selected={selectedCheckboxes[item.id]}\n data-id={item.id}\n data-index={item.virtualIndex}\n onKeyDown={onItemKeyDown}\n >\n <TreeListItemAddonsWrapper>\n {withDragAndDrop ? <DnDHandle id={id} /> : null}\n {withRadioChecks ? <RadioSelectable item={item} itemIndex={itemIndex} /> : null}\n {withCheckboxChecks ? <CheckboxSelectable item={item} itemIndex={itemIndex} /> : null}\n <NestingSpace item={item} spaceForNestingLevel={spaceForNestingLevel} />\n <ExpandCaret item={item} />\n {!disableIcons ? <Icon item={item} /> : null}\n </TreeListItemAddonsWrapper>\n <TreeItemText item={item} />\n {rightAddons && (\n <TreeListItemAddonsWrapper>\n {typeof rightAddons === 'function' ? rightAddons(item) : rightAddons}\n </TreeListItemAddonsWrapper>\n )}\n </TreeListItem>\n );\n};\n\nTreeItem.propTypes = TreeItemPropTypes;\n\nexport const DragAndDropTreeItem = SortableElement(TreeItem);\n"],"names":["TreeListItem","aggregatedClasses","treeItemBlockName","role","TreeListItemAddonsWrapper","DnDHandle","SortableHandle","id","e","preventDefault","TreeItem","props","item","itemIndex","itemWrapperStyle","virtualItemRef","spaceForNestingLevel","onMouseDragOverItem","node","nodeItemRef","model","openFolderOnHoverTimeout","useRef","useState","isDraggingOverThis","setIsDraggingOverThis","onItemKeyDown","useOnItemKeyDown","ctx","useContext","TreeViewContext","disableIcons","rightAddons","onItemClick","onItemFocus","rowSize","labelOverflow","relativeMouseCord","withRadioChecks","withCheckboxChecks","withDragAndDrop","selectedItem","selectedCheckboxes","hoverItem","isDragging","scrollToIndex","virtualListHelpers","setHoverItem","setSelectedItem","setFocusedItem","setItemRefs","ref","setMultipleRefs","dropPreviewClassName","useMemo","isBefore","isAfter","isValid","className","DSTreeViewPrefix","selectedClassName","hoverClassName","fixedHeightClassname","finalClassName","handleItemClick","useCallback","virtualIndex","scrollToItem","opts","align","event","current","clearTimeout","isExpanded","propTypes","TreeItemPropTypes","DragAndDropTreeItem","SortableElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoBaA,YAAY,GAAGC,iBAAiB,CAAC,IAAD,EAAO;EAClD,eAAeC,iBADmC;EAElDC,IAAI,EAAE;AAF4C,CAAP,CAAjB,CAGzBD,iBAHyB;IAIfE,yBAAyB,GAAGH,iBAAiB,CAAC,KAAD,CAAjB,CAAyBC,iBAAzB,EAA4C,QAA5C;AACzC,IAAMG,SAAS,GAAGC,cAAc,CAAC;EAAA,IAAGC,EAAH,QAAGA,EAAH;EAAA,oBAC/B,oBAAC,eAAD;IACE,eAAY,aADd;IAEE,GAAG,YAAKA,EAAL,iBAFL;IAGE,SAAS,EAAC,aAHZ;IAIE,IAAI,EAAC,GAJP;IAKE,WAAW,EAAE,qBAACC,CAAD,EAAO;;MAElB,IAAIA,CAAJ,EAAO;QACLA,CAAC,CAACC,cAAF;;KARN;IAWE,QAAQ,EAAC;IAZoB;AAAA,CAAD,CAAhC;IAgBaC,QAAQ,GAAG,SAAXA,QAAW,CAACC,KAAD,EAAW;EACjC,IACEC,IADF,GAOID,KAPJ,CACEC,IADF;MAEEC,SAFF,GAOIF,KAPJ,CAEEE,SAFF;8BAOIF,KAPJ,CAGEG,gBAHF;MAGEA,gBAHF,sCAGqB,EAHrB;MAIEC,cAJF,GAOIJ,KAPJ,CAIEI,cAJF;8BAOIJ,KAPJ,CAKEK,oBALF;MAKEA,oBALF,sC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1C,CAnCF,eA2CE,oBAAC,YAAD;IAAc,IAAI,EAAEA;IA3CtB,EA4CGoB,WAAW,iBACV,oBAAC,yBAAD,QACG,OAAOA,WAAP,KAAuB,UAAvB,GAAoCA,WAAW,CAACpB,IAAD,CAA/C,GAAwDoB,WAD3D,CA7CJ,CADF;AAoDD;AAEDtB,QAAQ,CAACgE,SAAT,GAAqBC,iBAArB;IAEaC,mBAAmB,GAAGC,eAAe,CAACnE,QAAD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeItemText.js","sources":["../../../src/parts/TreeItemText.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport React, { useMemo, useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport Highlighter from 'react-highlight-words';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\n\nimport { ChildrenCountDisplayer } from './ChildrenCountDisplayer';\nimport { DSTreeViewPrefix, treeItemBlockName } from '../config/cssClassesConstants';\n\nimport TreeViewContext from '../TreeViewContext';\n\nconst ItemContent = aggregatedClasses('div')(`${treeItemBlockName}-content`);\nconst ItemValue = aggregatedClasses('span')(treeItemBlockName, 'value');\n\n// const wrapperClassName = `${DSTreeViewPrefix}-${treeItemBlockName}-content`;\nconst classNameModifierWrapAll = `${DSTreeViewPrefix}-${treeItemBlockName}__value--wrap-all`;\nconst classNameModifierTruncate = `${DSTreeViewPrefix}-${treeItemBlockName}__value--truncate`;\n\n// eslint-disable-next-line react/prop-types\nconst CustomHighlight = ({ children }) => (\n <mark className=\"tree-text-highlight\" data-testid=\"tree-text-highlight\">\n {children}\n </mark>\n);\nexport function TreeItemText(props) {\n const { item } = props;\n const ctx = useContext(TreeViewContext);\n const {\n props: { searchQuery, showChildrenAmount, labelOverflow, nameKey },\n } = ctx;\n\n const Text = useMemo(() => {\n const itemLabelText = item[nameKey];\n if (searchQuery) {\n if (labelOverflow === 'truncate') {\n return (\n <SimpleTruncatedTooltipText\n value={\n <>\n <Highlighter\n autoEscape\n highlightTag={CustomHighlight}\n searchWords={[searchQuery]}\n textToHighlight={itemLabelText}\n />\n {showChildrenAmount ? <ChildrenCountDisplayer item={item} /> : null}\n </>\n }\n />\n );\n }\n return (\n <>\n <Highlighter\n autoEscape\n highlightTag={CustomHighlight}\n searchWords={[searchQuery]}\n textToHighlight={itemLabelText}\n />\n {showChildrenAmount ? <ChildrenCountDisplayer item={item} /> : null}\n </>\n );\n }\n if (labelOverflow === 'truncate') {\n return (\n <SimpleTruncatedTooltipText\n value={\n <>\n {itemLabelText}\n {showChildrenAmount ? <ChildrenCountDisplayer item={item} /> : null}\n </>\n }\n />\n );\n }\n return (\n <>\n {itemLabelText}\n {showChildrenAmount ? <ChildrenCountDisplayer item={item} /> : null}\n </>\n );\n }, [item, searchQuery, nameKey, showChildrenAmount, labelOverflow]);\n\n let className = '';\n if (labelOverflow === 'wrap-all') className += `${classNameModifierWrapAll} `;\n if (labelOverflow === 'truncate') className += `${classNameModifierTruncate} `;\n\n return (\n <ItemContent data-testid={`${treeItemBlockName}-content`}>\n <ItemValue className={className}>{Text}</ItemValue>\n </ItemContent>\n );\n}\n\nTreeItemText.propTypes = {\n item: PropTypes.object.isRequired,\n};\n"],"names":["ItemContent","aggregatedClasses","treeItemBlockName","ItemValue","classNameModifierWrapAll","DSTreeViewPrefix","classNameModifierTruncate","CustomHighlight","children","TreeItemText","props","item","ctx","useContext","TreeViewContext","searchQuery","showChildrenAmount","labelOverflow","nameKey","Text","useMemo","itemLabelText","className","propTypes","PropTypes","object","isRequired"],"mappings":";;;;;;;;;;AAAA;AAYA,IAAMA,WAAW,GAAGC,iBAAiB,CAAC,KAAD,CAAjB,WAA4BC,iBAA5B,cAApB;AACA,IAAMC,SAAS,GAAGF,iBAAiB,CAAC,MAAD,CAAjB,CAA0BC,iBAA1B,EAA6C,OAA7C,CAAlB;;AAGA,IAAME,wBAAwB,aAAMC,gBAAN,cAA0BH,iBAA1B,sBAA9B;AACA,IAAMI,yBAAyB,aAAMD,gBAAN,cAA0BH,iBAA1B,sBAA/B;;AAGA,IAAMK,eAAe,GAAG,SAAlBA,eAAkB;
|
|
1
|
+
{"version":3,"file":"TreeItemText.js","sources":["../../../src/parts/TreeItemText.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport React, { useMemo, useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport Highlighter from 'react-highlight-words';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\n\nimport { ChildrenCountDisplayer } from './ChildrenCountDisplayer';\nimport { DSTreeViewPrefix, treeItemBlockName } from '../config/cssClassesConstants';\n\nimport TreeViewContext from '../TreeViewContext';\n\nconst ItemContent = aggregatedClasses('div')(`${treeItemBlockName}-content`);\nconst ItemValue = aggregatedClasses('span')(treeItemBlockName, 'value');\n\n// const wrapperClassName = `${DSTreeViewPrefix}-${treeItemBlockName}-content`;\nconst classNameModifierWrapAll = `${DSTreeViewPrefix}-${treeItemBlockName}__value--wrap-all`;\nconst classNameModifierTruncate = `${DSTreeViewPrefix}-${treeItemBlockName}__value--truncate`;\n\n// eslint-disable-next-line react/prop-types\nconst CustomHighlight = ({ children }) => (\n <mark className=\"tree-text-highlight\" data-testid=\"tree-text-highlight\">\n {children}\n </mark>\n);\nexport function TreeItemText(props) {\n const { item } = props;\n const ctx = useContext(TreeViewContext);\n const {\n props: { searchQuery, showChildrenAmount, labelOverflow, nameKey },\n } = ctx;\n\n const Text = useMemo(() => {\n const itemLabelText = item[nameKey];\n if (searchQuery) {\n if (labelOverflow === 'truncate') {\n return (\n <SimpleTruncatedTooltipText\n value={\n <>\n <Highlighter\n autoEscape\n highlightTag={CustomHighlight}\n searchWords={[searchQuery]}\n textToHighlight={itemLabelText}\n />\n {showChildrenAmount ? <ChildrenCountDisplayer item={item} /> : null}\n </>\n }\n />\n );\n }\n return (\n <>\n <Highlighter\n autoEscape\n highlightTag={CustomHighlight}\n searchWords={[searchQuery]}\n textToHighlight={itemLabelText}\n />\n {showChildrenAmount ? <ChildrenCountDisplayer item={item} /> : null}\n </>\n );\n }\n if (labelOverflow === 'truncate') {\n return (\n <SimpleTruncatedTooltipText\n value={\n <>\n {itemLabelText}\n {showChildrenAmount ? <ChildrenCountDisplayer item={item} /> : null}\n </>\n }\n />\n );\n }\n return (\n <>\n {itemLabelText}\n {showChildrenAmount ? <ChildrenCountDisplayer item={item} /> : null}\n </>\n );\n }, [item, searchQuery, nameKey, showChildrenAmount, labelOverflow]);\n\n let className = '';\n if (labelOverflow === 'wrap-all') className += `${classNameModifierWrapAll} `;\n if (labelOverflow === 'truncate') className += `${classNameModifierTruncate} `;\n\n return (\n <ItemContent data-testid={`${treeItemBlockName}-content`}>\n <ItemValue className={className}>{Text}</ItemValue>\n </ItemContent>\n );\n}\n\nTreeItemText.propTypes = {\n item: PropTypes.object.isRequired,\n};\n"],"names":["ItemContent","aggregatedClasses","treeItemBlockName","ItemValue","classNameModifierWrapAll","DSTreeViewPrefix","classNameModifierTruncate","CustomHighlight","children","TreeItemText","props","item","ctx","useContext","TreeViewContext","searchQuery","showChildrenAmount","labelOverflow","nameKey","Text","useMemo","itemLabelText","className","propTypes","PropTypes","object","isRequired"],"mappings":";;;;;;;;;;AAAA;AAYA,IAAMA,WAAW,GAAGC,iBAAiB,CAAC,KAAD,CAAjB,WAA4BC,iBAA5B,cAApB;AACA,IAAMC,SAAS,GAAGF,iBAAiB,CAAC,MAAD,CAAjB,CAA0BC,iBAA1B,EAA6C,OAA7C,CAAlB;;AAGA,IAAME,wBAAwB,aAAMC,gBAAN,cAA0BH,iBAA1B,sBAA9B;AACA,IAAMI,yBAAyB,aAAMD,gBAAN,cAA0BH,iBAA1B,sBAA/B;;AAGA,IAAMK,eAAe,GAAG,SAAlBA,eAAkB;EAAA,IAAGC,QAAH,QAAGA,QAAH;EAAA,oBACtB;IAAM,SAAS,EAAC,qBAAhB;IAA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L;MAAjC,GAA4C,IAFjE,CADF;GA5CkB,EAkDjB,CAACA,IAAD,EAAOI,WAAP,EAAoBG,OAApB,EAA6BF,kBAA7B,EAAiDC,aAAjD,CAlDiB,CAApB;EAoDA,IAAIK,SAAS,GAAG,EAAhB;EACA,IAAIL,aAAa,KAAK,UAAtB,EAAkCK,SAAS,cAAOlB,wBAAP,MAAT;EAClC,IAAIa,aAAa,KAAK,UAAtB,EAAkCK,SAAS,cAAOhB,yBAAP,MAAT;EAElC,oBACE,oBAAC,WAAD;IAAa,yBAAgBJ,iBAAhB;kBACX,oBAAC,SAAD;IAAW,SAAS,EAAEoB;KAAYH,IAAlC,CADF,CADF;AAKD;AAEDV,YAAY,CAACc,SAAb,GAAyB;EACvBZ,IAAI,EAAEa,SAAS,CAACC,MAAV,CAAiBC;AADA,CAAzB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeList.js","sources":["../../../src/parts/TreeList.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport React, { useContext } from 'react';\nimport { SortableContainer } from '@elliemae/react-sortable-hoc';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { DSCircularProgressIndicator } from '@elliemae/ds-circular-progress-indicator';\n\nimport TreeViewContext from '../TreeViewContext';\nimport { TreeListPropTypes } from '../prop-types';\n\nimport { TreeItem, DragAndDropTreeItem } from './TreeItem';\nimport {\n DSTreeViewPrefix,\n treeListBlockName,\n} from '../config/cssClassesConstants';\n\nexport const treeListNoItemsBn = `${treeListBlockName}-no-items`;\nexport const TreeListNoItems = aggregatedClasses('div', {\n 'data-testid': treeListNoItemsBn,\n})(treeListNoItemsBn);\n\nexport const TreeListWrapper = aggregatedClasses('ul', {\n 'data-testid': treeListBlockName,\n role: 'tree',\n})(treeListBlockName, null, ({ rowSize }) => ({\n [`rowsize-${rowSize}`]: rowSize,\n}));\n\nconst compactRowClass = `${DSTreeViewPrefix}-tv-row-size-compact`;\nconst normaRowClass = `${DSTreeViewPrefix}-tv-row-size-normal`;\n\nexport const TreeList = (props) => {\n const { onMouseDragOverItem } = props;\n const ctx = useContext(TreeViewContext);\n const {\n virtualListRef,\n virtualListHelpers,\n visibleItems,\n withDragAndDrop,\n props: { width, height, rowSize, noItemsPlaceholder, isLoading },\n } = ctx;\n const { totalSize, virtualItems } = virtualListHelpers;\n const className = `${\n rowSize === 'compact' ? `${compactRowClass}` : `${normaRowClass}`\n }`;\n\n return (\n <TreeListWrapper\n ref={virtualListRef}\n className={className}\n style={{\n height: `${typeof height === 'number' ? `${height}px` : height}`,\n width: `${typeof width === 'number' ? `${width}px` : width}`,\n overflow: 'auto',\n }}\n >\n {isLoading ? (\n <div\n style={{\n width: '100%',\n height: '100%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n }}\n >\n <DSCircularProgressIndicator\n size=\"xl\"\n loading={isLoading}\n showLabel\n waiting={false}\n showTooltip={false}\n />\n </div>\n ) : null}\n {!isLoading && virtualItems.length === 0 ? (\n <TreeListNoItems>{noItemsPlaceholder}</TreeListNoItems>\n ) : null}\n {!isLoading && virtualItems.length !== 0 ? (\n <div\n style={{\n height: `${totalSize}px`,\n width: '100%',\n position: 'relative',\n }}\n >\n {virtualItems.map((virtualItem) => {\n const { index, measureRef, start } = virtualItem;\n const item = visibleItems[index];\n item.virtualIndex = index;\n const { id } = item;\n\n const style = {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n transform: `translateY(${start}px)`,\n };\n\n const listItemProps = {\n key: `DS-TreeView-List-Item-${id}`,\n virtualItemRef: measureRef,\n index, // this is consumed by the DnD HOC\n itemIndex: index,\n item,\n itemWrapperStyle: style,\n };\n\n if (withDragAndDrop)\n return (\n <DragAndDropTreeItem\n {...listItemProps}\n onMouseDragOverItem={onMouseDragOverItem}\n />\n );\n return <TreeItem {...listItemProps} />;\n })}\n </div>\n ) : null}\n </TreeListWrapper>\n );\n};\nTreeList.propTypes = TreeListPropTypes;\nexport const DragAndDropTreeList = SortableContainer(TreeList);\n"],"names":["treeListNoItemsBn","treeListBlockName","TreeListNoItems","aggregatedClasses","TreeListWrapper","role","rowSize","compactRowClass","DSTreeViewPrefix","normaRowClass","TreeList","props","onMouseDragOverItem","ctx","useContext","TreeViewContext","virtualListRef","virtualListHelpers","visibleItems","withDragAndDrop","width","height","noItemsPlaceholder","isLoading","totalSize","virtualItems","className","overflow","display","alignItems","justifyContent","length","position","map","virtualItem","index","measureRef","start","item","virtualIndex","id","style","top","left","transform","listItemProps","key","virtualItemRef","itemIndex","itemWrapperStyle","propTypes","TreeListPropTypes","DragAndDropTreeList","SortableContainer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAeaA,iBAAiB,aAAMC,iBAAN;IACjBC,eAAe,GAAGC,iBAAiB,CAAC,KAAD,EAAQ;
|
|
1
|
+
{"version":3,"file":"TreeList.js","sources":["../../../src/parts/TreeList.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport React, { useContext } from 'react';\nimport { SortableContainer } from '@elliemae/react-sortable-hoc';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { DSCircularProgressIndicator } from '@elliemae/ds-circular-progress-indicator';\n\nimport TreeViewContext from '../TreeViewContext';\nimport { TreeListPropTypes } from '../prop-types';\n\nimport { TreeItem, DragAndDropTreeItem } from './TreeItem';\nimport {\n DSTreeViewPrefix,\n treeListBlockName,\n} from '../config/cssClassesConstants';\n\nexport const treeListNoItemsBn = `${treeListBlockName}-no-items`;\nexport const TreeListNoItems = aggregatedClasses('div', {\n 'data-testid': treeListNoItemsBn,\n})(treeListNoItemsBn);\n\nexport const TreeListWrapper = aggregatedClasses('ul', {\n 'data-testid': treeListBlockName,\n role: 'tree',\n})(treeListBlockName, null, ({ rowSize }) => ({\n [`rowsize-${rowSize}`]: rowSize,\n}));\n\nconst compactRowClass = `${DSTreeViewPrefix}-tv-row-size-compact`;\nconst normaRowClass = `${DSTreeViewPrefix}-tv-row-size-normal`;\n\nexport const TreeList = (props) => {\n const { onMouseDragOverItem } = props;\n const ctx = useContext(TreeViewContext);\n const {\n virtualListRef,\n virtualListHelpers,\n visibleItems,\n withDragAndDrop,\n props: { width, height, rowSize, noItemsPlaceholder, isLoading },\n } = ctx;\n const { totalSize, virtualItems } = virtualListHelpers;\n const className = `${\n rowSize === 'compact' ? `${compactRowClass}` : `${normaRowClass}`\n }`;\n\n return (\n <TreeListWrapper\n ref={virtualListRef}\n className={className}\n style={{\n height: `${typeof height === 'number' ? `${height}px` : height}`,\n width: `${typeof width === 'number' ? `${width}px` : width}`,\n overflow: 'auto',\n }}\n >\n {isLoading ? (\n <div\n style={{\n width: '100%',\n height: '100%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n }}\n >\n <DSCircularProgressIndicator\n size=\"xl\"\n loading={isLoading}\n showLabel\n waiting={false}\n showTooltip={false}\n />\n </div>\n ) : null}\n {!isLoading && virtualItems.length === 0 ? (\n <TreeListNoItems>{noItemsPlaceholder}</TreeListNoItems>\n ) : null}\n {!isLoading && virtualItems.length !== 0 ? (\n <div\n style={{\n height: `${totalSize}px`,\n width: '100%',\n position: 'relative',\n }}\n >\n {virtualItems.map((virtualItem) => {\n const { index, measureRef, start } = virtualItem;\n const item = visibleItems[index];\n item.virtualIndex = index;\n const { id } = item;\n\n const style = {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n transform: `translateY(${start}px)`,\n };\n\n const listItemProps = {\n key: `DS-TreeView-List-Item-${id}`,\n virtualItemRef: measureRef,\n index, // this is consumed by the DnD HOC\n itemIndex: index,\n item,\n itemWrapperStyle: style,\n };\n\n if (withDragAndDrop)\n return (\n <DragAndDropTreeItem\n {...listItemProps}\n onMouseDragOverItem={onMouseDragOverItem}\n />\n );\n return <TreeItem {...listItemProps} />;\n })}\n </div>\n ) : null}\n </TreeListWrapper>\n );\n};\nTreeList.propTypes = TreeListPropTypes;\nexport const DragAndDropTreeList = SortableContainer(TreeList);\n"],"names":["treeListNoItemsBn","treeListBlockName","TreeListNoItems","aggregatedClasses","TreeListWrapper","role","rowSize","compactRowClass","DSTreeViewPrefix","normaRowClass","TreeList","props","onMouseDragOverItem","ctx","useContext","TreeViewContext","virtualListRef","virtualListHelpers","visibleItems","withDragAndDrop","width","height","noItemsPlaceholder","isLoading","totalSize","virtualItems","className","overflow","display","alignItems","justifyContent","length","position","map","virtualItem","index","measureRef","start","item","virtualIndex","id","style","top","left","transform","listItemProps","key","virtualItemRef","itemIndex","itemWrapperStyle","propTypes","TreeListPropTypes","DragAndDropTreeList","SortableContainer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAeaA,iBAAiB,aAAMC,iBAAN;IACjBC,eAAe,GAAGC,iBAAiB,CAAC,KAAD,EAAQ;EACtD,eAAeH;AADuC,CAAR,CAAjB,CAE5BA,iBAF4B;IAIlBI,eAAe,GAAGD,iBAAiB,CAAC,IAAD,EAAO;EACrD,eAAeF,iBADsC;EAErDI,IAAI,EAAE;AAF+C,CAAP,CAAjB,CAG5BJ,iBAH4B,EAGT,IAHS,EAGH;EAAA,IAAGK,OAAH,QAAGA,OAAH;EAAA,6CACdA,OADc,GACFA,OADE;AAAA,CAHG;AAO/B,IAAMC,eAAe,aAAMC,gBAAN,yBAArB;AACA,IAAMC,aAAa,aAAMD,gBAAN,wBAAnB;IAEaE,QAAQ,GAAG,SAAXA,QAAW,CAACC,KAAD,EAAW;EACjC,IAAQC,mBAAR,GAAgCD,KAAhC,CAAQC,mBAAR;EACA,IAAMC,GAAG,GAAGC,UAAU,CAACC,eAAD,CAAtB;EACA,IACEC,cADF,GAMIH,GANJ,CACEG,cADF;MAEEC,kBAFF,GAMIJ,GANJ,CAEEI,kBAFF;MAGEC,YAHF,GAMIL,GANJ,CAGEK,YAHF;MAIEC,eAJF,GAMIN,GANJ,CAIEM,eAJF;mBAMIN,GANJ,CAKEF,KALF;MAKWS,KALX,cAKWA,KALX;MAKkBC,MALlB,cAKkBA,MALlB;MAK0Bf,OAL1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UAAf,GAAqCF,WAArC,CAAeE,UAAf;QAA2BC,KAA3B,GAAqCH,WAArC,CAA2BG,KAA3B;IACA,IAAMC,IAAI,GAAGpB,YAAY,CAACiB,KAAD,CAAzB;IACAG,IAAI,CAACC,YAAL,GAAoBJ,KAApB;IACA,IAAQK,EAAR,GAAeF,IAAf,CAAQE,EAAR;IAEA,IAAMC,KAAK,GAAG;MACZT,QAAQ,EAAE,UADE;MAEZU,GAAG,EAAE,CAFO;MAGZC,IAAI,EAAE,CAHM;MAIZvB,KAAK,EAAE,MAJK;MAKZwB,SAAS,uBAAgBP,KAAhB;KALX;IAQA,IAAMQ,aAAa,GAAG;MACpBC,GAAG,kCAA2BN,EAA3B,CADiB;MAEpBO,cAAc,EAAEX,UAFI;MAGpBD,KAAK,EAALA,KAHoB;;MAIpBa,SAAS,EAAEb,KAJS;MAKpBG,IAAI,EAAJA,IALoB;MAMpBW,gBAAgB,EAAER;KANpB;IASA,IAAItB,eAAJ,EACE,oBACE,oBAAC,mBAAD,eACM0B,aADN;MAEE,mBAAmB,EAAEjC;OAHzB;IAMF,oBAAO,oBAAC,QAAD,EAAciC,aAAd,CAAP;GA9BD,CAPH,CADD,GAyCG,IAxEN,CADF;AA4ED;AACDnC,QAAQ,CAACwC,SAAT,GAAqBC,iBAArB;IACaC,mBAAmB,GAAGC,iBAAiB,CAAC3C,QAAD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeDndPlugin.js","sources":["../../../../src/plugins/dnd/TreeDndPlugin.tsx"],"sourcesContent":["import React, { useContext } from 'react';\n\nimport { DragAndDropTreeList } from '../../parts/TreeList';\n\nimport { useDnDHelpers } from '../../utils/useDnDHelpers';\nimport { keyCodes } from '../../utils/dnd-helpers';\n\nimport TreeViewContext from '../../TreeViewContext';\nexport const TreeDnD = () => {\n const {\n updateBeforeSortStart,\n onSortStart,\n onMouseDragOverItem,\n onSortEnd,\n } = useDnDHelpers();\n const ctx = useContext(TreeViewContext);\n const { virtualListRef } = ctx;\n return (\n <DragAndDropTreeList\n useDragHandle\n transitionDuration={0}\n keyboardSortingTransitionDuration={0}\n hideSortableGhost={false}\n disableAnimation\n updateBeforeSortStart={updateBeforeSortStart}\n onSortStart={onSortStart}\n onMouseDragOverItem={onMouseDragOverItem}\n onSortEnd={onSortEnd}\n getContainer={() => virtualListRef.current}\n keyCodes={keyCodes}\n />\n );\n};\n\nexport const TreeDndPlugin = 'tree-dnd';\n"],"names":["TreeDnD","useDnDHelpers","updateBeforeSortStart","onSortStart","onMouseDragOverItem","onSortEnd","ctx","useContext","TreeViewContext","virtualListRef","current","keyCodes","TreeDndPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAQaA,OAAO,GAAG,SAAVA,OAAU,GAAM;
|
|
1
|
+
{"version":3,"file":"TreeDndPlugin.js","sources":["../../../../src/plugins/dnd/TreeDndPlugin.tsx"],"sourcesContent":["import React, { useContext } from 'react';\n\nimport { DragAndDropTreeList } from '../../parts/TreeList';\n\nimport { useDnDHelpers } from '../../utils/useDnDHelpers';\nimport { keyCodes } from '../../utils/dnd-helpers';\n\nimport TreeViewContext from '../../TreeViewContext';\nexport const TreeDnD = () => {\n const {\n updateBeforeSortStart,\n onSortStart,\n onMouseDragOverItem,\n onSortEnd,\n } = useDnDHelpers();\n const ctx = useContext(TreeViewContext);\n const { virtualListRef } = ctx;\n return (\n <DragAndDropTreeList\n useDragHandle\n transitionDuration={0}\n keyboardSortingTransitionDuration={0}\n hideSortableGhost={false}\n disableAnimation\n updateBeforeSortStart={updateBeforeSortStart}\n onSortStart={onSortStart}\n onMouseDragOverItem={onMouseDragOverItem}\n onSortEnd={onSortEnd}\n getContainer={() => virtualListRef.current}\n keyCodes={keyCodes}\n />\n );\n};\n\nexport const TreeDndPlugin = 'tree-dnd';\n"],"names":["TreeDnD","useDnDHelpers","updateBeforeSortStart","onSortStart","onMouseDragOverItem","onSortEnd","ctx","useContext","TreeViewContext","virtualListRef","current","keyCodes","TreeDndPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAQaA,OAAO,GAAG,SAAVA,OAAU,GAAM;EAC3B,qBAKIC,aAAa,EALjB;MACEC,qBADF,kBACEA,qBADF;MAEEC,WAFF,kBAEEA,WAFF;MAGEC,mBAHF,kBAGEA,mBAHF;MAIEC,SAJF,kBAIEA,SAJF;;EAMA,IAAMC,GAAG,GAAGC,UAAU,CAACC,eAAD,CAAtB;EACA,IAAQC,cAAR,GAA2BH,GAA3B,CAAQG,cAAR;EACA,oBACE,oBAAC,mBAAD;IACE,aAAa,MADf;IAEE,kBAAkB,EAAE,CAFtB;IAGE,iCAAiC,EAAE,CAHrC;IAIE,iBAAiB,EAAE,KAJrB;IAKE,gBAAgB,MALlB;IAME,qBAAqB,EAAEP,qBANzB;IAOE,WAAW,EAAEC,WAPf;IAQE,mBAAmB,EAAEC,mBARvB;IASE,SAAS,EAAEC,SATb;IAUE,YAAY,EAAE;MAAA,OAAMI,cAAc,CAACC,OAArB;KAVhB;IAWE,QAAQ,EAAEC;IAZd;AAeD;IAEYC,aAAa,GAAG;;;;"}
|
package/esm/prop-types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.js","sources":["../../src/prop-types.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport PropTypes from 'prop-types';\n\nexport const InstanceActionsPropTypes = PropTypes.shape({\n toggleExpandAll: PropTypes.func,\n scrollTo: PropTypes.func,\n});\n\nexport const TreeViewInstancePropType = PropTypes.shape({\n current: PropTypes.oneOfType([\n PropTypes.oneOf([null]),\n PropTypes.shape({\n actions: InstanceActionsPropTypes.isRequired,\n }),\n ]),\n});\n\nexport const TreeViewItemPropType = PropTypes.shape({\n children: PropTypes.arrayOf(PropTypes.object),\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n isGroup: PropTypes.oneOfType([\n PropTypes.oneOf([undefined, null]),\n PropTypes.bool,\n ]),\n name: PropTypes.string,\n node: PropTypes.object,\n});\n\nexport const TreeListPropTypes = {\n // required when drag and drop is enabled, tracks the drag and drop results after drop and visual feedback borders\n // passed down to TreeItem\n onMouseDragOverItem: PropTypes.func,\n};\nexport const TreeItemPropTypes = {\n item: TreeViewItemPropType.isRequired,\n index: PropTypes.number,\n itemIndex: PropTypes.number,\n itemWrapperStyle: PropTypes.object,\n virtualItemRef: PropTypes.func,\n spaceForNestingLevel: PropTypes.number,\n onMouseDragOverItem: PropTypes.func,\n};\n\nexport const TreeItemExpandCaretPropTypes = {\n item: TreeViewItemPropType.isRequired,\n};\nexport const TreeItemNestingSpacePropTypes = {\n item: TreeViewItemPropType.isRequired,\n spaceForNestingLevel: PropTypes.number.isRequired,\n};\n\nexport const TreeItemCheckboxPropTypes = {\n item: TreeViewItemPropType.isRequired,\n itemIndex: PropTypes.number.isRequired,\n};\n"],"names":["InstanceActionsPropTypes","PropTypes","shape","toggleExpandAll","func","scrollTo","TreeViewInstancePropType","current","oneOfType","oneOf","actions","isRequired","TreeViewItemPropType","children","arrayOf","object","id","string","number","isGroup","undefined","bool","name","node","TreeListPropTypes","onMouseDragOverItem","TreeItemPropTypes","item","index","itemIndex","itemWrapperStyle","virtualItemRef","spaceForNestingLevel","TreeItemExpandCaretPropTypes","TreeItemNestingSpacePropTypes","TreeItemCheckboxPropTypes"],"mappings":";;AAAA;IAGaA,wBAAwB,GAAGC,SAAS,CAACC,KAAV,CAAgB;
|
|
1
|
+
{"version":3,"file":"prop-types.js","sources":["../../src/prop-types.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport PropTypes from 'prop-types';\n\nexport const InstanceActionsPropTypes = PropTypes.shape({\n toggleExpandAll: PropTypes.func,\n scrollTo: PropTypes.func,\n});\n\nexport const TreeViewInstancePropType = PropTypes.shape({\n current: PropTypes.oneOfType([\n PropTypes.oneOf([null]),\n PropTypes.shape({\n actions: InstanceActionsPropTypes.isRequired,\n }),\n ]),\n});\n\nexport const TreeViewItemPropType = PropTypes.shape({\n children: PropTypes.arrayOf(PropTypes.object),\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n isGroup: PropTypes.oneOfType([\n PropTypes.oneOf([undefined, null]),\n PropTypes.bool,\n ]),\n name: PropTypes.string,\n node: PropTypes.object,\n});\n\nexport const TreeListPropTypes = {\n // required when drag and drop is enabled, tracks the drag and drop results after drop and visual feedback borders\n // passed down to TreeItem\n onMouseDragOverItem: PropTypes.func,\n};\nexport const TreeItemPropTypes = {\n item: TreeViewItemPropType.isRequired,\n index: PropTypes.number,\n itemIndex: PropTypes.number,\n itemWrapperStyle: PropTypes.object,\n virtualItemRef: PropTypes.func,\n spaceForNestingLevel: PropTypes.number,\n onMouseDragOverItem: PropTypes.func,\n};\n\nexport const TreeItemExpandCaretPropTypes = {\n item: TreeViewItemPropType.isRequired,\n};\nexport const TreeItemNestingSpacePropTypes = {\n item: TreeViewItemPropType.isRequired,\n spaceForNestingLevel: PropTypes.number.isRequired,\n};\n\nexport const TreeItemCheckboxPropTypes = {\n item: TreeViewItemPropType.isRequired,\n itemIndex: PropTypes.number.isRequired,\n};\n"],"names":["InstanceActionsPropTypes","PropTypes","shape","toggleExpandAll","func","scrollTo","TreeViewInstancePropType","current","oneOfType","oneOf","actions","isRequired","TreeViewItemPropType","children","arrayOf","object","id","string","number","isGroup","undefined","bool","name","node","TreeListPropTypes","onMouseDragOverItem","TreeItemPropTypes","item","index","itemIndex","itemWrapperStyle","virtualItemRef","spaceForNestingLevel","TreeItemExpandCaretPropTypes","TreeItemNestingSpacePropTypes","TreeItemCheckboxPropTypes"],"mappings":";;AAAA;IAGaA,wBAAwB,GAAGC,SAAS,CAACC,KAAV,CAAgB;EACtDC,eAAe,EAAEF,SAAS,CAACG,IAD2B;EAEtDC,QAAQ,EAAEJ,SAAS,CAACG;AAFkC,CAAhB;IAK3BE,wBAAwB,GAAGL,SAAS,CAACC,KAAV,CAAgB;EACtDK,OAAO,EAAEN,SAAS,CAAC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MAAV,CAAiBP;AAFI;IAKhCwB,yBAAyB,GAAG;EACvCR,IAAI,EAAEf,oBAAoB,CAACD,UADY;EAEvCkB,SAAS,EAAE5B,SAAS,CAACiB,MAAV,CAAiBP;AAFW;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-desc-prop-types.js","sources":["../../src/react-desc-prop-types.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport { PropTypes } from 'react-desc';\n\nconst InstanceActionsPropTypes = PropTypes.shape({\n toggleExpandAll: PropTypes.func,\n scrollTo: PropTypes.func,\n});\nconst TreeViewItemPropType = PropTypes.shape({\n children: PropTypes.arrayOf(PropTypes.object),\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n isGroup: PropTypes.oneOfType([\n PropTypes.oneOf([undefined, null]),\n PropTypes.bool,\n ]),\n name: PropTypes.string,\n node: PropTypes.object,\n});\n\nconst TreeViewInstancePropType = PropTypes.shape({\n current: PropTypes.oneOfType([\n PropTypes.oneOf([null]),\n PropTypes.shape({\n actions: InstanceActionsPropTypes.isRequired,\n }),\n ]),\n});\n\nexport const TreeViewPropTypes = {\n data: PropTypes.arrayOf(TreeViewItemPropType).description(\n 'data to populate tree view',\n ).isRequired,\n plugins: PropTypes.arrayOf(PropTypes.string)\n .description('list of enabled plugins')\n .defaultValue([]),\n selection: PropTypes.object\n .description('pre selected items')\n .defaultValue({}),\n instanceRef: TreeViewInstancePropType.description('instance ref'),\n disableGroups: PropTypes.bool\n .description('disable grouping funcionality')\n .defaultValue(false),\n disableLeafs: PropTypes.bool\n .description('disable leaf items')\n .defaultValue(false),\n disableIcons: PropTypes.bool.description('disable icons').defaultValue(false),\n fluid: PropTypes.bool\n .description('whether is fluid or not')\n .defaultValue(false),\n isMultiSelect: PropTypes.bool\n .description('whether the tree view is multi select or not')\n .defaultValue(false),\n isSingleSelect: PropTypes.bool\n .description('wheter the tree view is single select or not')\n .defaultValue(false),\n restrictDragAndDrop: PropTypes.bool\n .description('whether to restrict DnD functionality or not')\n .defaultValue(false),\n showChildrenAmount: PropTypes.bool\n .description('whether to show the amount of children or not')\n .defaultValue(false),\n sortable: PropTypes.bool\n .description('whether the sortable functionality is active or not')\n .defaultValue(false),\n labelRenderer: PropTypes.func.description('custom renderer for labels'),\n onItemClick: PropTypes.func.description(\n 'function executed when clicking on an item',\n ),\n onItemFocus: PropTypes.func.description(\n 'function executed when focusing on an item',\n ),\n onVisibleItemsChange: PropTypes.func.description(\n 'function executed when the visible items change',\n ),\n onOrderChange: PropTypes.func.description(\n 'function executed when the items order changes',\n ),\n onSelectionChange: PropTypes.func.description(\n 'function executed when the selection changes',\n ),\n onExpandChange: PropTypes.func.description(\n 'function executed when expanding an item',\n ),\n rowSize: PropTypes.oneOf(['normal', 'compact'])\n .description('size of the row')\n .defaultValue('normal'),\n width: PropTypes.oneOfType([PropTypes.number, PropTypes.string])\n .description('components width')\n .defaultValue('100%'),\n height: PropTypes.oneOfType([PropTypes.number, PropTypes.string])\n .description('components height')\n .defaultValue('100%'),\n groupIcon: PropTypes.node.description('icon for groups'),\n itemIcon: PropTypes.node.description('icon for items'),\n searchQuery: PropTypes.string.description('search query value'),\n highlightOnlyQuery: PropTypes.bool\n .description('whether to highlight results or not')\n .defaultValue(false),\n};\n"],"names":["InstanceActionsPropTypes","PropTypes","shape","toggleExpandAll","func","scrollTo","TreeViewItemPropType","children","arrayOf","object","id","oneOfType","string","number","isGroup","oneOf","undefined","bool","name","node","TreeViewInstancePropType","current","actions","isRequired","TreeViewPropTypes","data","description","plugins","defaultValue","selection","instanceRef","disableGroups","disableLeafs","disableIcons","fluid","isMultiSelect","isSingleSelect","restrictDragAndDrop","showChildrenAmount","sortable","labelRenderer","onItemClick","onItemFocus","onVisibleItemsChange","onOrderChange","onSelectionChange","onExpandChange","rowSize","width","height","groupIcon","itemIcon","searchQuery","highlightOnlyQuery"],"mappings":";;AAAA;AAGA,IAAMA,wBAAwB,GAAGC,SAAS,CAACC,KAAV,CAAgB;
|
|
1
|
+
{"version":3,"file":"react-desc-prop-types.js","sources":["../../src/react-desc-prop-types.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport { PropTypes } from 'react-desc';\n\nconst InstanceActionsPropTypes = PropTypes.shape({\n toggleExpandAll: PropTypes.func,\n scrollTo: PropTypes.func,\n});\nconst TreeViewItemPropType = PropTypes.shape({\n children: PropTypes.arrayOf(PropTypes.object),\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n isGroup: PropTypes.oneOfType([\n PropTypes.oneOf([undefined, null]),\n PropTypes.bool,\n ]),\n name: PropTypes.string,\n node: PropTypes.object,\n});\n\nconst TreeViewInstancePropType = PropTypes.shape({\n current: PropTypes.oneOfType([\n PropTypes.oneOf([null]),\n PropTypes.shape({\n actions: InstanceActionsPropTypes.isRequired,\n }),\n ]),\n});\n\nexport const TreeViewPropTypes = {\n data: PropTypes.arrayOf(TreeViewItemPropType).description(\n 'data to populate tree view',\n ).isRequired,\n plugins: PropTypes.arrayOf(PropTypes.string)\n .description('list of enabled plugins')\n .defaultValue([]),\n selection: PropTypes.object\n .description('pre selected items')\n .defaultValue({}),\n instanceRef: TreeViewInstancePropType.description('instance ref'),\n disableGroups: PropTypes.bool\n .description('disable grouping funcionality')\n .defaultValue(false),\n disableLeafs: PropTypes.bool\n .description('disable leaf items')\n .defaultValue(false),\n disableIcons: PropTypes.bool.description('disable icons').defaultValue(false),\n fluid: PropTypes.bool\n .description('whether is fluid or not')\n .defaultValue(false),\n isMultiSelect: PropTypes.bool\n .description('whether the tree view is multi select or not')\n .defaultValue(false),\n isSingleSelect: PropTypes.bool\n .description('wheter the tree view is single select or not')\n .defaultValue(false),\n restrictDragAndDrop: PropTypes.bool\n .description('whether to restrict DnD functionality or not')\n .defaultValue(false),\n showChildrenAmount: PropTypes.bool\n .description('whether to show the amount of children or not')\n .defaultValue(false),\n sortable: PropTypes.bool\n .description('whether the sortable functionality is active or not')\n .defaultValue(false),\n labelRenderer: PropTypes.func.description('custom renderer for labels'),\n onItemClick: PropTypes.func.description(\n 'function executed when clicking on an item',\n ),\n onItemFocus: PropTypes.func.description(\n 'function executed when focusing on an item',\n ),\n onVisibleItemsChange: PropTypes.func.description(\n 'function executed when the visible items change',\n ),\n onOrderChange: PropTypes.func.description(\n 'function executed when the items order changes',\n ),\n onSelectionChange: PropTypes.func.description(\n 'function executed when the selection changes',\n ),\n onExpandChange: PropTypes.func.description(\n 'function executed when expanding an item',\n ),\n rowSize: PropTypes.oneOf(['normal', 'compact'])\n .description('size of the row')\n .defaultValue('normal'),\n width: PropTypes.oneOfType([PropTypes.number, PropTypes.string])\n .description('components width')\n .defaultValue('100%'),\n height: PropTypes.oneOfType([PropTypes.number, PropTypes.string])\n .description('components height')\n .defaultValue('100%'),\n groupIcon: PropTypes.node.description('icon for groups'),\n itemIcon: PropTypes.node.description('icon for items'),\n searchQuery: PropTypes.string.description('search query value'),\n highlightOnlyQuery: PropTypes.bool\n .description('whether to highlight results or not')\n .defaultValue(false),\n};\n"],"names":["InstanceActionsPropTypes","PropTypes","shape","toggleExpandAll","func","scrollTo","TreeViewItemPropType","children","arrayOf","object","id","oneOfType","string","number","isGroup","oneOf","undefined","bool","name","node","TreeViewInstancePropType","current","actions","isRequired","TreeViewPropTypes","data","description","plugins","defaultValue","selection","instanceRef","disableGroups","disableLeafs","disableIcons","fluid","isMultiSelect","isSingleSelect","restrictDragAndDrop","showChildrenAmount","sortable","labelRenderer","onItemClick","onItemFocus","onVisibleItemsChange","onOrderChange","onSelectionChange","onExpandChange","rowSize","width","height","groupIcon","itemIcon","searchQuery","highlightOnlyQuery"],"mappings":";;AAAA;AAGA,IAAMA,wBAAwB,GAAGC,SAAS,CAACC,KAAV,CAAgB;EAC/CC,eAAe,EAAEF,SAAS,CAACG,IADoB;EAE/CC,QAAQ,EAAEJ,SAAS,CAACG;AAF2B,CAAhB,CAAjC;AAIA,IAAME,oBAAoB,GAAGL,SAAS,CAACC,KAAV,CAAgB;EAC3CK,QAAQ,E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,8CADiB,CAjDY;EAoD/BoB,cAAc,EAAE7C,SAAS,CAACG,IAAV,CAAesB,WAAf,CACd,0CADc,CApDe;EAuD/BqB,OAAO,EAAE9C,SAAS,CAACc,KAAV,CAAgB,CAAC,QAAD,EAAW,SAAX,CAAhB,EACNW,WADM,CACM,iBADN,EAENE,YAFM,CAEO,QAFP,CAvDsB;EA0D/BoB,KAAK,EAAE/C,SAAS,CAACU,SAAV,CAAoB,CAACV,SAAS,CAACY,MAAX,EAAmBZ,SAAS,CAACW,MAA7B,CAApB,EACJc,WADI,CACQ,kBADR,EAEJE,YAFI,CAES,MAFT,CA1DwB;EA6D/BqB,MAAM,EAAEhD,SAAS,CAACU,SAAV,CAAoB,CAACV,SAAS,CAACY,MAAX,EAAmBZ,SAAS,CAACW,MAA7B,CAApB,EACLc,WADK,CACO,mBADP,EAELE,YAFK,CAEQ,MAFR,CA7DuB;EAgE/BsB,SAAS,EAAEjD,SAAS,CAACkB,IAAV,CAAeO,WAAf,CAA2B,iBAA3B,CAhEoB;EAiE/ByB,QAAQ,EAAElD,SAAS,CAACkB,IAAV,CAAeO,WAAf,CAA2B,gBAA3B,CAjEqB;EAkE/B0B,WAAW,EAAEnD,SAAS,CAACW,MAAV,CAAiBc,WAAjB,CAA6B,oBAA7B,CAlEkB;EAmE/B2B,kBAAkB,EAAEpD,SAAS,CAACgB,IAAV,CACjBS,WADiB,CACL,qCADK,EAEjBE,YAFiB,CAEJ,KAFI;AAnEW;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeViewSearchBar.js","sources":["../../../src/related-components/TreeViewSearchBar.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { DSNavSearchBox } from '@elliemae/ds-form';\n\nexport function TreeViewSearchBar(props) {\n const { handleChange, onNext, onPrevious, onClear, currentResultIndex, totalResults, value } = props;\n\n return (\n <DSNavSearchBox\n onChange={(v) => {\n handleChange({ target: { value: v } });\n }}\n onNext={onNext}\n onPrevious={onPrevious}\n onClear={onClear}\n currentResultIndex={currentResultIndex}\n totalResults={totalResults}\n value={value}\n />\n );\n}\n\nTreeViewSearchBar.propTypes = {\n value: PropTypes.string.isRequired,\n handleChange: PropTypes.func.isRequired,\n onNext: PropTypes.func.isRequired,\n onPrevious: PropTypes.func.isRequired,\n onClear: PropTypes.func.isRequired,\n currentResultIndex: PropTypes.number.isRequired,\n totalResults: PropTypes.number.isRequired,\n};\n"],"names":["TreeViewSearchBar","props","handleChange","onNext","onPrevious","onClear","currentResultIndex","totalResults","value","v","target","propTypes","PropTypes","string","isRequired","func","number"],"mappings":";;;;AAAA;AAKO,SAASA,iBAAT,CAA2BC,KAA3B,EAAkC;
|
|
1
|
+
{"version":3,"file":"TreeViewSearchBar.js","sources":["../../../src/related-components/TreeViewSearchBar.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { DSNavSearchBox } from '@elliemae/ds-form';\n\nexport function TreeViewSearchBar(props) {\n const { handleChange, onNext, onPrevious, onClear, currentResultIndex, totalResults, value } = props;\n\n return (\n <DSNavSearchBox\n onChange={(v) => {\n handleChange({ target: { value: v } });\n }}\n onNext={onNext}\n onPrevious={onPrevious}\n onClear={onClear}\n currentResultIndex={currentResultIndex}\n totalResults={totalResults}\n value={value}\n />\n );\n}\n\nTreeViewSearchBar.propTypes = {\n value: PropTypes.string.isRequired,\n handleChange: PropTypes.func.isRequired,\n onNext: PropTypes.func.isRequired,\n onPrevious: PropTypes.func.isRequired,\n onClear: PropTypes.func.isRequired,\n currentResultIndex: PropTypes.number.isRequired,\n totalResults: PropTypes.number.isRequired,\n};\n"],"names":["TreeViewSearchBar","props","handleChange","onNext","onPrevious","onClear","currentResultIndex","totalResults","value","v","target","propTypes","PropTypes","string","isRequired","func","number"],"mappings":";;;;AAAA;AAKO,SAASA,iBAAT,CAA2BC,KAA3B,EAAkC;EACvC,IAAQC,YAAR,GAA+FD,KAA/F,CAAQC,YAAR;MAAsBC,MAAtB,GAA+FF,KAA/F,CAAsBE,MAAtB;MAA8BC,UAA9B,GAA+FH,KAA/F,CAA8BG,UAA9B;MAA0CC,OAA1C,GAA+FJ,KAA/F,CAA0CI,OAA1C;MAAmDC,kBAAnD,GAA+FL,KAA/F,CAAmDK,kBAAnD;MAAuEC,YAAvE,GAA+FN,KAA/F,CAAuEM,YAAvE;MAAqFC,KAArF,GAA+FP,KAA/F,CAAqFO,KAArF;EAEA,oBACE,oBAAC,cAAD;IACE,QAAQ,EAAE,kBAACC,CAAD,EAAO;MACfP,YAAY,CAAC;QAAEQ,MAAM,EAAE;UAAEF,KAAK,EAAEC;;OAApB,CAAZ;KAFJ;IAIE,MAAM,EAAEN,MAJV;IAKE,UAAU,EAAEC,UALd;IAME,OAAO,EAAEC,OANX;IAOE,kBAAkB,EAAEC,kBAPtB;IAQE,YAAY,EAAEC,YARhB;IASE,KAAK,EAAEC;IAVX;AAaD;AAEDR,iBAAiB,CAACW,SAAlB,GAA8B;EAC5BH,KAAK,EAAEI,SAAS,CAACC,MAAV,CAAiBC,UADI;EAE5BZ,YAAY,EAAEU,SAAS,CAACG,IAAV,CAAeD,UAFD;EAG5BX,MAAM,EAAES,SAAS,CAACG,IAAV,CAAeD,UAHK;EAI5BV,UAAU,EAAEQ,SAAS,CAACG,IAAV,CAAeD,UAJC;EAK5BT,OAAO,EAAEO,SAAS,CAACG,IAAV,CAAeD,UALI;EAM5BR,kBAAkB,EAAEM,SAAS,CAACI,MAAV,CAAiBF,UANT;EAO5BP,YAAY,EAAEK,SAAS,CAACI,MAAV,CAAiBF;AAPH,CAA9B;;;;"}
|