@elliemae/ds-treeview 3.80.0-next.2 → 3.80.0-next.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/TreeViewContext.js +8 -3
- package/dist/cjs/TreeViewContext.js.map +2 -2
- package/dist/cjs/config/useTreeview.js +8 -5
- package/dist/cjs/config/useTreeview.js.map +2 -2
- package/dist/cjs/hoc/WithConditionalDnDContext.js +1 -1
- package/dist/cjs/hoc/WithConditionalDnDContext.js.map +2 -2
- package/dist/cjs/hoc/WithDnDSortableItemContext.js +32 -29
- package/dist/cjs/hoc/WithDnDSortableItemContext.js.map +2 -2
- package/dist/cjs/parts/Icon.js +1 -1
- package/dist/cjs/parts/Icon.js.map +1 -1
- package/dist/cjs/parts/TreeItem.js.map +1 -1
- package/dist/cjs/parts/TreeItemText.js +1 -1
- package/dist/cjs/parts/TreeItemText.js.map +2 -2
- package/dist/cjs/parts/TreeList.js +4 -3
- package/dist/cjs/parts/TreeList.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js.map +1 -1
- package/dist/cjs/sharedTypes.js.map +1 -1
- package/dist/cjs/utils/object-helpers.js +6 -3
- package/dist/cjs/utils/object-helpers.js.map +2 -2
- package/dist/esm/TreeViewContext.js +8 -3
- package/dist/esm/TreeViewContext.js.map +2 -2
- package/dist/esm/config/useTreeview.js +8 -5
- package/dist/esm/config/useTreeview.js.map +2 -2
- package/dist/esm/hoc/WithConditionalDnDContext.js +1 -1
- package/dist/esm/hoc/WithConditionalDnDContext.js.map +2 -2
- package/dist/esm/hoc/WithDnDSortableItemContext.js +32 -29
- package/dist/esm/hoc/WithDnDSortableItemContext.js.map +2 -2
- package/dist/esm/parts/Icon.js +1 -1
- package/dist/esm/parts/Icon.js.map +1 -1
- package/dist/esm/parts/TreeItem.js.map +1 -1
- package/dist/esm/parts/TreeItemText.js +1 -1
- package/dist/esm/parts/TreeItemText.js.map +2 -2
- package/dist/esm/parts/TreeList.js +4 -3
- package/dist/esm/parts/TreeList.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js.map +1 -1
- package/dist/esm/utils/object-helpers.js +6 -3
- package/dist/esm/utils/object-helpers.js.map +2 -2
- package/dist/types/parts/TreeItem.d.ts +1 -1
- package/dist/types/react-desc-prop-types.d.ts +3 -3
- package/dist/types/sharedTypes.d.ts +2 -2
- package/package.json +17 -17
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport type React from 'react';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport type { ValidationMap } from '@elliemae/ds-props-helpers';\nimport type TreeModel from 'tree-model';\nimport type {
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport type React from 'react';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport type { ValidationMap } from '@elliemae/ds-props-helpers';\nimport type TreeModel from 'tree-model';\nimport type { useVirtualizer } from '@tanstack/react-virtual';\nexport declare namespace DSTreeviewT {\n export type StringOrNum = string | number;\n export type SelectionState = boolean | 'mixed';\n export type SelectionItems = Record<StringOrNum, SelectionState>;\n export type ScrollToFunc = ReturnType<typeof useVirtualizer>['scrollToIndex'];\n export type ScrollToItemOptions = Parameters<ReturnType<typeof useVirtualizer>['scrollToIndex']>[1];\n export type ScrollToItemFunc = (options: ScrollToItemOptions) => void;\n export type ExpandedItems = Record<StringOrNum, true>; // { [id]:true } -> e.g. {1:true; 2:true} // false are not listed\n export interface SimpleItem {\n [key: string]: unknown;\n name: string;\n children?: SimpleItem[];\n id: StringOrNum;\n }\n\n export interface Item extends SimpleItem {\n children: Item[];\n treeDepth?: number;\n virtualIndex?: number;\n isChecked?: boolean | 'mixed';\n isGroup?: boolean;\n isExpanded?: boolean;\n disableActions?: boolean;\n childrenMatchesSearchQuery?: boolean;\n matchesSearchQuery?: boolean;\n nodeItemRef?: React.RefObject<HTMLLIElement>;\n model: TreeModel.Node<Item>['model'];\n node: TreeModel.Node<Item> & { parent?: TreeModel.Node<Item> };\n nodePath: TreeModel.Node<Item>[];\n }\n\n export interface DndItem {\n uid: string;\n depth: number;\n realIndex: number;\n childrenCount: number;\n parentId: string | null;\n original: DSTreeviewT.Item;\n }\n\n export interface Actions {\n toggleExpandAll: (isExpand: boolean) => Promise<DSTreeviewT.Item[]>;\n scrollTo: DSTreeviewT.ScrollToFunc;\n setSelectedItemByVirtualIndex: (index: number) => void;\n setFocusedItemByVirtualIndex: (\n index: number,\n scrollOpts: DSTreeviewT.ScrollToItemOptions & { withScroll?: boolean },\n ) => void;\n }\n export interface InstanceRef {\n actions: Actions;\n }\n\n export interface DefaultProps {\n plugins: string[];\n selection: SelectionItems;\n instanceRef: React.MutableRefObject<InstanceRef>;\n isItemDisabled: (item: Item) => boolean;\n disableActions: boolean;\n disableIcons: boolean;\n isMultiSelect: boolean;\n isSingleSelect: boolean;\n getIsDropValid: (\n active: DndItem,\n over: DndItem,\n dropIndicatorPosition: 'none' | 'before' | 'after' | 'inside',\n ) => boolean;\n showChildrenAmount: boolean;\n isLoading: boolean;\n highlightOnlyQuery: boolean;\n onItemClick: (item: Item, e: React.MouseEvent<HTMLLIElement>) => void;\n onItemActivate: (item: Item, e?: React.MouseEvent<HTMLLIElement> | React.KeyboardEvent<HTMLLIElement>) => void;\n onItemFocus: (meta: { scrollToItem: ScrollToItemFunc; itemIndex: number; item: Item }) => void;\n onVisibleItemsChange: (newVisibleItems: Item[]) => void;\n onOrderChange: (newData: SimpleItem[], oldData: SimpleItem[], draggedItem: DndItem) => void;\n onSelectionChange: (\n selection: SelectionItems,\n item: Item,\n meta: { scrollToItem: ScrollToItemFunc; itemIndex: number },\n ) => void;\n onExpandChange: (expandedHashmap: ExpandedItems, itemToggled: Item | null | undefined) => void;\n onInstanceRefInitialized: (instanceRef: React.MutableRefObject<InstanceRef>) => void;\n rowSize: 'normal' | 'compact';\n labelOverflow: 'wrap' | 'wrap-all' | 'truncate';\n noItemsPlaceholder: string;\n nameKey: string;\n width: StringOrNum;\n height: StringOrNum;\n groupIcon: JSX.Element | null;\n itemIcon: JSX.Element | null;\n searchQuery: string;\n applyAriaDisabled: boolean;\n removeWidthMaxContent: boolean;\n }\n export interface PropsOptional {\n controlledSelection: SelectionItems;\n expanded: ExpandedItems;\n rightAddons: ((item: Item) => React.ReactNode[]) | JSX.Element;\n RightAddons: React.ComponentType<{ item: Item }>;\n }\n export interface PropsRequired {\n data: Item[];\n }\n export interface Props extends DefaultProps, PropsOptional, PropsRequired {}\n}\n\nexport const TreeViewPropTypes = {\n data: PropTypes.arrayOf(\n PropTypes.shape({\n children: PropTypes.arrayOf(PropTypes.object),\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n isGroup: PropTypes.oneOfType([PropTypes.oneOf([undefined, null]), PropTypes.bool]),\n disableActions: PropTypes.bool.description('whether to disable drag & drop and expand/collapse actions or not'),\n name: PropTypes.string,\n node: PropTypes.object,\n }),\n ).description('data to populate tree view').isRequired,\n plugins: PropTypes.tuple([PropTypes.oneOf(['tree-dnd'])])\n .description(\n 'only accepted value is TreeDndPlugin constant\\nother legacy plugins are now supported via different props',\n )\n .defaultValue([]),\n selection: PropTypes.object.description('pre selected items').defaultValue({}),\n RightAddons: PropTypes.func\n .description('A React component that will be rendered on the right side of each rows')\n .signature('React.ComponentType<{item}>'),\n expanded: PropTypes.object.description('control what items are expanded').defaultValue(undefined),\n instanceRef: PropTypes.shape({\n current: PropTypes.oneOfType([\n PropTypes.oneOf([null, undefined]),\n PropTypes.shape({\n actions: PropTypes.shape({\n toggleExpandAll: PropTypes.func,\n scrollTo: PropTypes.func,\n }).description('').isRequired,\n }),\n ]),\n }).description('instance ref'),\n isItemDisabled: PropTypes.func\n .description('Function that receives an item, and returns whether that item should be disabled')\n .defaultValue('() => false'),\n disableIcons: PropTypes.bool.description('disable icons').defaultValue(false),\n isMultiSelect: PropTypes.bool.description('whether the tree view is multi select or not').defaultValue(false),\n isSingleSelect: PropTypes.bool.description('wheter the tree view is single select or not').defaultValue(false),\n isLoading: PropTypes.bool.description('wheter the tree should show the loading state or not').defaultValue(false),\n getIsDropValid: PropTypes.func\n .description(\"Function that returns true if the drop is valid and false if it's not\")\n .defaultValue('() => true'),\n showChildrenAmount: PropTypes.bool.description('whether to show the amount of children or not').defaultValue(false),\n onItemClick: PropTypes.func.description('function executed when clicking on an item').defaultValue('() => {}'),\n onItemActivate: PropTypes.func.description('function executed when an item gets activated').defaultValue('() => {}'),\n onItemFocus: PropTypes.func.description('function executed when focusing on an item').defaultValue('() => {}'),\n onVisibleItemsChange: PropTypes.func\n .description('function executed when the visible items change')\n .defaultValue('() => {}'),\n onOrderChange: PropTypes.func.description('function executed when the items order changes').defaultValue('() => {}'),\n onSelectionChange: PropTypes.func\n .description('function executed when the selection changes')\n .defaultValue('() => {}'),\n onExpandChange: PropTypes.func.description('function executed when expanding an item').defaultValue('() => {}'),\n onInstanceRefInitialized: PropTypes.func\n .description('function executed when instanceRef has terminated instanciation')\n .defaultValue('() => {}'),\n rowSize: PropTypes.oneOf(['normal', 'compact']).description('size of the row').defaultValue('normal'),\n labelOverflow: PropTypes.oneOf(['wrap', 'wrap-all', 'truncate'])\n .description('label truncation preference')\n .defaultValue('wrap'),\n width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('components width').defaultValue('100%'),\n height: PropTypes.oneOfType([PropTypes.number, PropTypes.string])\n .description('components height')\n .defaultValue('100%'),\n groupIcon: PropTypes.node.description('icon for groups'),\n itemIcon: PropTypes.node.description('icon for items'),\n searchQuery: PropTypes.string.description('search query value'),\n noItemsPlaceholder: PropTypes.string\n .description('message to be shown when there are no items in the treeview to be displayed')\n .defaultValue('No items found'),\n nameKey: PropTypes.string.description('property key to identifier for items labels').defaultValue('name'),\n highlightOnlyQuery: PropTypes.bool.description('whether to highlight results or not').defaultValue(false),\n applyAriaDisabled: PropTypes.bool\n .description(\n 'Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION',\n )\n .defaultValue(false),\n removeWidthMaxContent: PropTypes.bool\n .description('Whether the list wrapper should apply width:max-content to the list items.')\n .defaultValue(false),\n} as ValidationMap<unknown>;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,iBAAiB;AA8GnB,MAAM,oBAAoB;AAAA,EAC/B,MAAM,UAAU;AAAA,IACd,UAAU,MAAM;AAAA,MACd,UAAU,UAAU,QAAQ,UAAU,MAAM;AAAA,MAC5C,IAAI,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,MAC5D,SAAS,UAAU,UAAU,CAAC,UAAU,MAAM,CAAC,QAAW,IAAI,CAAC,GAAG,UAAU,IAAI,CAAC;AAAA,MACjF,gBAAgB,UAAU,KAAK,YAAY,mEAAmE;AAAA,MAC9G,MAAM,UAAU;AAAA,MAChB,MAAM,UAAU;AAAA,IAClB,CAAC;AAAA,EACH,EAAE,YAAY,4BAA4B,EAAE;AAAA,EAC5C,SAAS,UAAU,MAAM,CAAC,UAAU,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EACrD;AAAA,IACC;AAAA,EACF,EACC,aAAa,CAAC,CAAC;AAAA,EAClB,WAAW,UAAU,OAAO,YAAY,oBAAoB,EAAE,aAAa,CAAC,CAAC;AAAA,EAC7E,aAAa,UAAU,KACpB,YAAY,wEAAwE,EACpF,UAAU,6BAA6B;AAAA,EAC1C,UAAU,UAAU,OAAO,YAAY,iCAAiC,EAAE,aAAa,MAAS;AAAA,EAChG,aAAa,UAAU,MAAM;AAAA,IAC3B,SAAS,UAAU,UAAU;AAAA,MAC3B,UAAU,MAAM,CAAC,MAAM,MAAS,CAAC;AAAA,MACjC,UAAU,MAAM;AAAA,QACd,SAAS,UAAU,MAAM;AAAA,UACvB,iBAAiB,UAAU;AAAA,UAC3B,UAAU,UAAU;AAAA,QACtB,CAAC,EAAE,YAAY,EAAE,EAAE;AAAA,MACrB,CAAC;AAAA,IACH,CAAC;AAAA,EACH,CAAC,EAAE,YAAY,cAAc;AAAA,EAC7B,gBAAgB,UAAU,KACvB,YAAY,kFAAkF,EAC9F,aAAa,aAAa;AAAA,EAC7B,cAAc,UAAU,KAAK,YAAY,eAAe,EAAE,aAAa,KAAK;AAAA,EAC5E,eAAe,UAAU,KAAK,YAAY,8CAA8C,EAAE,aAAa,KAAK;AAAA,EAC5G,gBAAgB,UAAU,KAAK,YAAY,8CAA8C,EAAE,aAAa,KAAK;AAAA,EAC7G,WAAW,UAAU,KAAK,YAAY,sDAAsD,EAAE,aAAa,KAAK;AAAA,EAChH,gBAAgB,UAAU,KACvB,YAAY,uEAAuE,EACnF,aAAa,YAAY;AAAA,EAC5B,oBAAoB,UAAU,KAAK,YAAY,+CAA+C,EAAE,aAAa,KAAK;AAAA,EAClH,aAAa,UAAU,KAAK,YAAY,4CAA4C,EAAE,aAAa,UAAU;AAAA,EAC7G,gBAAgB,UAAU,KAAK,YAAY,+CAA+C,EAAE,aAAa,UAAU;AAAA,EACnH,aAAa,UAAU,KAAK,YAAY,4CAA4C,EAAE,aAAa,UAAU;AAAA,EAC7G,sBAAsB,UAAU,KAC7B,YAAY,iDAAiD,EAC7D,aAAa,UAAU;AAAA,EAC1B,eAAe,UAAU,KAAK,YAAY,gDAAgD,EAAE,aAAa,UAAU;AAAA,EACnH,mBAAmB,UAAU,KAC1B,YAAY,8CAA8C,EAC1D,aAAa,UAAU;AAAA,EAC1B,gBAAgB,UAAU,KAAK,YAAY,0CAA0C,EAAE,aAAa,UAAU;AAAA,EAC9G,0BAA0B,UAAU,KACjC,YAAY,iEAAiE,EAC7E,aAAa,UAAU;AAAA,EAC1B,SAAS,UAAU,MAAM,CAAC,UAAU,SAAS,CAAC,EAAE,YAAY,iBAAiB,EAAE,aAAa,QAAQ;AAAA,EACpG,eAAe,UAAU,MAAM,CAAC,QAAQ,YAAY,UAAU,CAAC,EAC5D,YAAY,6BAA6B,EACzC,aAAa,MAAM;AAAA,EACtB,OAAO,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,EAAE,YAAY,kBAAkB,EAAE,aAAa,MAAM;AAAA,EACpH,QAAQ,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,EAC7D,YAAY,mBAAmB,EAC/B,aAAa,MAAM;AAAA,EACtB,WAAW,UAAU,KAAK,YAAY,iBAAiB;AAAA,EACvD,UAAU,UAAU,KAAK,YAAY,gBAAgB;AAAA,EACrD,aAAa,UAAU,OAAO,YAAY,oBAAoB;AAAA,EAC9D,oBAAoB,UAAU,OAC3B,YAAY,6EAA6E,EACzF,aAAa,gBAAgB;AAAA,EAChC,SAAS,UAAU,OAAO,YAAY,6CAA6C,EAAE,aAAa,MAAM;AAAA,EACxG,oBAAoB,UAAU,KAAK,YAAY,qCAAqC,EAAE,aAAa,KAAK;AAAA,EACxG,mBAAmB,UAAU,KAC1B;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AAAA,EACrB,uBAAuB,UAAU,KAC9B,YAAY,4EAA4E,EACxF,aAAa,KAAK;AACvB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -5,7 +5,10 @@ function isObjectADate(o) {
|
|
|
5
5
|
function isObjectAnArray(o) {
|
|
6
6
|
return Array.isArray(o);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function isObjectAPrimitiveString(o) {
|
|
9
|
+
return typeof o === "string";
|
|
10
|
+
}
|
|
11
|
+
function isObjectAPlainObject(o) {
|
|
9
12
|
return typeof o === "object";
|
|
10
13
|
}
|
|
11
14
|
const unfreeze = (o) => {
|
|
@@ -21,9 +24,9 @@ const unfreeze = (o) => {
|
|
|
21
24
|
o.forEach((v) => {
|
|
22
25
|
oo.push(v);
|
|
23
26
|
});
|
|
24
|
-
} else if (
|
|
27
|
+
} else if (isObjectAPrimitiveString(o)) {
|
|
25
28
|
oo = String(o);
|
|
26
|
-
} else if (
|
|
29
|
+
} else if (isObjectAPlainObject(o)) {
|
|
27
30
|
oo = {};
|
|
28
31
|
for (const property in o) {
|
|
29
32
|
oo[property] = o[property];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/object-helpers.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-sequences */\n/* eslint-disable no-return-assign */\n/* eslint-disable no-restricted-syntax */\n/* eslint-disable guard-for-in */\n\nfunction isObjectADate(o: string | number | unknown[] | Date | null | undefined | Record<string, unknown>): o is Date {\n return o?.constructor?.name === 'Date';\n}\nfunction isObjectAnArray(\n o: string | number | unknown[] | Date | null | undefined | Record<string, unknown>,\n): o is unknown[] {\n return Array.isArray(o);\n}\nfunction
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACKvB,SAAS,cAAc,GAA+F;AACpH,SAAO,GAAG,aAAa,SAAS;AAClC;AACA,SAAS,gBACP,GACgB;AAChB,SAAO,MAAM,QAAQ,CAAC;AACxB;AACA,SAAS,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-sequences */\n/* eslint-disable no-return-assign */\n/* eslint-disable no-restricted-syntax */\n/* eslint-disable guard-for-in */\n\nfunction isObjectADate(o: string | number | unknown[] | Date | null | undefined | Record<string, unknown>): o is Date {\n return o?.constructor?.name === 'Date';\n}\nfunction isObjectAnArray(\n o: string | number | unknown[] | Date | null | undefined | Record<string, unknown>,\n): o is unknown[] {\n return Array.isArray(o);\n}\nfunction isObjectAPrimitiveString(\n o: string | number | unknown[] | Date | null | undefined | Record<string, unknown>,\n): o is string {\n return typeof o === 'string';\n}\nfunction isObjectAPlainObject(\n o: string | number | unknown[] | Date | null | undefined | Record<string, unknown>,\n): o is Record<string, unknown> {\n return typeof o === 'object';\n}\n\nexport const unfreeze = (o: string | number | unknown[] | Date | null | undefined | Record<string, unknown>) => {\n let oo: string | number | unknown[] | Date | null | undefined | Record<string, unknown>;\n if (o === null) {\n oo = null;\n } else if (o === undefined) {\n oo = undefined;\n } else if (isObjectADate(o)) {\n oo = new Date(o);\n } else if (isObjectAnArray(o)) {\n oo = [];\n o.forEach((v) => {\n (oo as unknown[]).push(v);\n });\n } else if (isObjectAPrimitiveString(o)) {\n oo = String(o);\n } else if (isObjectAPlainObject(o)) {\n oo = {};\n for (const property in o) {\n oo[property] = o[property];\n }\n } else {\n oo = o;\n }\n return oo;\n};\n\ntype GenericItemT<T = unknown> = { [key: string]: T };\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function filterObject<T = unknown>(obj: GenericItemT<T>, predicate: (val: T) => boolean) {\n return Object.keys(obj).reduce<GenericItemT<T>>((res, key) => {\n if (predicate(obj[key])) res[key] = obj[key];\n return res;\n }, {} as GenericItemT<T>);\n}\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACKvB,SAAS,cAAc,GAA+F;AACpH,SAAO,GAAG,aAAa,SAAS;AAClC;AACA,SAAS,gBACP,GACgB;AAChB,SAAO,MAAM,QAAQ,CAAC;AACxB;AACA,SAAS,yBACP,GACa;AACb,SAAO,OAAO,MAAM;AACtB;AACA,SAAS,qBACP,GAC8B;AAC9B,SAAO,OAAO,MAAM;AACtB;AAEO,MAAM,WAAW,CAAC,MAAuF;AAC9G,MAAI;AACJ,MAAI,MAAM,MAAM;AACd,SAAK;AAAA,EACP,WAAW,MAAM,QAAW;AAC1B,SAAK;AAAA,EACP,WAAW,cAAc,CAAC,GAAG;AAC3B,SAAK,IAAI,KAAK,CAAC;AAAA,EACjB,WAAW,gBAAgB,CAAC,GAAG;AAC7B,SAAK,CAAC;AACN,MAAE,QAAQ,CAAC,MAAM;AACf,MAAC,GAAiB,KAAK,CAAC;AAAA,IAC1B,CAAC;AAAA,EACH,WAAW,yBAAyB,CAAC,GAAG;AACtC,SAAK,OAAO,CAAC;AAAA,EACf,WAAW,qBAAqB,CAAC,GAAG;AAClC,SAAK,CAAC;AACN,eAAW,YAAY,GAAG;AACxB,SAAG,QAAQ,IAAI,EAAE,QAAQ;AAAA,IAC3B;AAAA,EACF,OAAO;AACL,SAAK;AAAA,EACP;AACA,SAAO;AACT;AAIO,SAAS,aAA0B,KAAsB,WAAgC;AAC9F,SAAO,OAAO,KAAK,GAAG,EAAE,OAAwB,CAAC,KAAK,QAAQ;AAC5D,QAAI,UAAU,IAAI,GAAG,CAAC,EAAG,KAAI,GAAG,IAAI,IAAI,GAAG;AAC3C,WAAO;AAAA,EACT,GAAG,CAAC,CAAoB;AAC1B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -6,7 +6,7 @@ interface PropsT {
|
|
|
6
6
|
item: DSTreeviewT.Item;
|
|
7
7
|
itemIndex: number;
|
|
8
8
|
isDragOverlay?: boolean;
|
|
9
|
-
virtualItemRef?:
|
|
9
|
+
virtualItemRef?: (node: HTMLElement | null | undefined) => void;
|
|
10
10
|
itemWrapperStyle?: {
|
|
11
11
|
[key: string]: unknown;
|
|
12
12
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { ValidationMap } from '@elliemae/ds-props-helpers';
|
|
3
3
|
import type TreeModel from 'tree-model';
|
|
4
|
-
import type {
|
|
4
|
+
import type { useVirtualizer } from '@tanstack/react-virtual';
|
|
5
5
|
export declare namespace DSTreeviewT {
|
|
6
6
|
type StringOrNum = string | number;
|
|
7
7
|
type SelectionState = boolean | 'mixed';
|
|
8
8
|
type SelectionItems = Record<StringOrNum, SelectionState>;
|
|
9
|
-
type ScrollToFunc = ReturnType<typeof
|
|
10
|
-
type ScrollToItemOptions = Parameters<ReturnType<typeof
|
|
9
|
+
type ScrollToFunc = ReturnType<typeof useVirtualizer>['scrollToIndex'];
|
|
10
|
+
type ScrollToItemOptions = Parameters<ReturnType<typeof useVirtualizer>['scrollToIndex']>[1];
|
|
11
11
|
type ScrollToItemFunc = (options: ScrollToItemOptions) => void;
|
|
12
12
|
type ExpandedItems = Record<StringOrNum, true>;
|
|
13
13
|
interface SimpleItem {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type TreeModel from 'tree-model';
|
|
2
2
|
import { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';
|
|
3
|
-
import type {
|
|
3
|
+
import type { useVirtualizer } from '@tanstack/react-virtual';
|
|
4
4
|
import type { SetStateAction } from 'react';
|
|
5
5
|
import type { DSTreeviewT } from './react-desc-prop-types.js';
|
|
6
6
|
export declare namespace DSTreeviewInternalsT {
|
|
@@ -28,7 +28,7 @@ export declare namespace DSTreeviewInternalsT {
|
|
|
28
28
|
triggerTreeRerender: () => void;
|
|
29
29
|
tree?: TreeModel;
|
|
30
30
|
treeRoot?: TreeModel.Node<DSTreeviewT.Item>;
|
|
31
|
-
virtualListHelpers: ReturnType<typeof
|
|
31
|
+
virtualListHelpers: ReturnType<typeof useVirtualizer>;
|
|
32
32
|
virtualListRef?: React.MutableRefObject<HTMLUListElement | undefined>;
|
|
33
33
|
uniqueTreeViewUUID: string;
|
|
34
34
|
selectedItem: DSTreeviewT.Item | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-treeview",
|
|
3
|
-
"version": "3.80.0-next.
|
|
3
|
+
"version": "3.80.0-next.20",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Tree View",
|
|
6
6
|
"files": [
|
|
@@ -40,28 +40,28 @@
|
|
|
40
40
|
"typeSafety": false
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
+
"@elliemae/ds-button-v2": "3.80.0-next.20",
|
|
44
|
+
"@elliemae/ds-circular-progress-indicator": "3.80.0-next.20",
|
|
45
|
+
"@elliemae/ds-classnames": "3.80.0-next.20",
|
|
46
|
+
"@elliemae/ds-drag-and-drop": "3.80.0-next.20",
|
|
47
|
+
"@elliemae/ds-floating-context": "3.80.0-next.20",
|
|
48
|
+
"@elliemae/ds-form-checkbox": "3.80.0-next.20",
|
|
49
|
+
"@elliemae/ds-form-radio": "3.80.0-next.20",
|
|
50
|
+
"@elliemae/ds-icons": "3.80.0-next.20",
|
|
43
51
|
"@elliemae/ds-legacy-form": "1.0.16",
|
|
52
|
+
"@elliemae/ds-props-helpers": "3.80.0-next.20",
|
|
53
|
+
"@elliemae/ds-system": "3.80.0-next.20",
|
|
54
|
+
"@elliemae/ds-typescript-helpers": "3.80.0-next.20",
|
|
55
|
+
"@tanstack/react-virtual": "3.13.18",
|
|
44
56
|
"react-highlight-words": "~0.18.0",
|
|
45
|
-
"react-virtual": "~2.10.4",
|
|
46
57
|
"tree-model": "~1.0.7",
|
|
47
|
-
"uid": "^2.0.2"
|
|
48
|
-
"@elliemae/ds-button-v2": "3.80.0-next.2",
|
|
49
|
-
"@elliemae/ds-classnames": "3.80.0-next.2",
|
|
50
|
-
"@elliemae/ds-floating-context": "3.80.0-next.2",
|
|
51
|
-
"@elliemae/ds-form-checkbox": "3.80.0-next.2",
|
|
52
|
-
"@elliemae/ds-drag-and-drop": "3.80.0-next.2",
|
|
53
|
-
"@elliemae/ds-circular-progress-indicator": "3.80.0-next.2",
|
|
54
|
-
"@elliemae/ds-form-radio": "3.80.0-next.2",
|
|
55
|
-
"@elliemae/ds-props-helpers": "3.80.0-next.2",
|
|
56
|
-
"@elliemae/ds-system": "3.80.0-next.2",
|
|
57
|
-
"@elliemae/ds-icons": "3.80.0-next.2",
|
|
58
|
-
"@elliemae/ds-typescript-helpers": "3.80.0-next.2"
|
|
58
|
+
"uid": "^2.0.2"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
+
"@elliemae/ds-monorepo-devops": "3.80.0-next.20",
|
|
62
|
+
"@elliemae/ds-test-utils": "3.80.0-next.20",
|
|
61
63
|
"jest": "^30.0.0",
|
|
62
|
-
"styled-components": "~5.3.11"
|
|
63
|
-
"@elliemae/ds-monorepo-devops": "3.80.0-next.2",
|
|
64
|
-
"@elliemae/ds-test-utils": "3.80.0-next.2"
|
|
64
|
+
"styled-components": "~5.3.11"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"lodash-es": "^4.18.1",
|