- Fixed
itree.parent
being lost on tree node clone.
- Additional fixes for recursive keys, and fixed recursion test oversight.
- Made
TreeNode#context
anditree#parent
fields unenumerable to prevent recursion errors from libraries that deeply iterate object properties.
- Fixed
selectFirstAvailableNode
to look deeply.
- Fixed
selectFirstAvailableNode
trying to select unselectable nodes.
- Fixed typo in method type.
- Fixed careless mistake placing
unshiftChild
method on the wrong interface.
- Added missed type definition for
unshiftChild
.
- Added
TreeNode.unshiftChild(child)
.
- Fixed inconsistent
TreeNode.tree
return.
- Added
cancelEditOnBlur
config.
- Clears
lastSelectedNode
if that node is deselected. - Fixed
tree.splice
not mapping nodessplice
correctly. - Updated dependencies.
Breaking Changes
v7 drops Promise
polyfills, so older browser without native Promise support are no longer supported.
v7 will be the LTS version pre-v8. It will effectively be maintenance work only.
- Added TreeNode#indexList for an array of context array indices.
- Reworked Tree#boundingNodes to fix issues with sorting.
- Fixed miscellaneous types.
- Fixed miscellaneous types.
- Fixed miscellaneous types.
- Fixed miscellaneous types.
- Fixed miscellaneous types.
- Fixed dist files never being updated in any 7.0.0 builds. I forgot to run
yarn deploy
first...
- Improved lodash imports.
- Added
node.contextmenu
event to type definitions.
- Improved node resolve type definitions.
Improvements to the typescript definition file:
- Added
TreeNode.hasLoadedChildren()
. - Added
TreeNode.isOnlyRenderable()
. - Added support for user-defined state properties on itree in
NodeConfig
. - Fixed
TreeNode.children
definitions.
- Fixed typescript definitions for
data
config property. - Added typescript entry for
TreeNode.children
. - Dropped
Promise
polyfill (Internet Explorer support). - Updated dependencies.
- Fixes copy not cloning exported object, sharing object references.
- Added
TreeNodes.first
andTreeNodes.last
shallow search functions. - Added
TreeNode.renderable
,TreeNode.isFirstRenderable
,TreeNode.isLastRenderable
, andTreeNode.isOnlyRenderable
check functions. - Moved batch/end/applyChanges to the TreeNodes level. Calling this on the tree as usual aliases the root-level model.
- Updated TreeNodes method to call batch/end on their context in most cases, not the entire tree.
- Added
TreeNodes.context()
as a parameter forchanges.applied
events. Some renderers could possibly ignore these if the context is a TreeNode. - Added a config object argument to the TreeNodes constructor. Internally, calculateRenderablePositions is only used for "renderable" TreeNodes.
- Added pass-through of
includeState
parameter forcopy/copyHierarchy
methods which rely ontoObject
. - Minor cleanup.
Breaking Changes
Dirty
Internally, first/last/only "renderable" nodes are calculated on add/remove or position change operations (addNode, push, splice, sort, etc).
These are useful to rendering engines, and in order to communicate the change, nodes are marked as dirty when their first/last/only position changes.
This will cause dirty
flags to be true for some nodes when it wasn't previously.
changes.applied
Batching is now handled contextually. Each TreeNodes collection may fire its own changes.applied
event. The event
now includes a context
argument which will be the result of TreeNodes.context()
. The context will either be
the InspireTree object, or a parent TreeNode.
If your entire tree is rendered on this event, you can either ignore the event when fired for a specific node, or debounce it.
- Fixed incorrect
find
method typescript definition. - Fixed minor spelling/linting errors.
- Fixed duplicate rerender call on model reset.
- Fixed parent checkbox not overriding indeterminate children.
- Added
TreeNode.assign
. - Added
TreeNodes.find
. - Added
TreeNodes.sortDeep
. - Added state object argument support to
TreeNode.state
. - Fixed argument support for
TreeNodes.invokeDeep
. - Fixed typescript definition issues.
- Switched API doc generator from docdown to jsdoc.
Breaking Changes
- Removed
{ to() }
return ofcopy
methods. For examplenodes.copy(dest)
instead ofnodes.copy().to(dest)
.
- Fixed crypto error resulting from build tool regression.
- Typescript definition file cleanup and improvements:
- Added
NodeConfig
interface. - Imports
EventEmitter2
definitions. - Various cleanup.
- Improves typescript definitions.
- Moves four npm dependencies to the
dependencies
array to support ES6 users.
- Added
includeState
parameter toTreeNode.remove
. - Added
draggable
anddrop-target
to node state objects. - Improved logic for calculating pagination totals when using arrays.
- Fixed batch end error in
TreeNode.states
.
- Added
TreeNode.states
which sets multiple states to a single value. toObject
now supports optionally exporting node state.- Fixed pagination totals for nested data loaded via array.
- Added
TreeNode@hasAncestor
.
Breaking Changes
- Removes string typing of node ID.
This means that you must query your nodes by ID using the same type as the ID was given to the tree.
Using id: 1
means you must query by a number, tree.node(1)
. Previously, querying by a number or string
would work. This change allows your data to remain typed, if you need it later.
Anything except numbers or strings will still be converted to a string using toString
.
- Added
TreeNode.hasOrWillHaveChildren
. Returns true when children are present orchildren
property is true.
- Added
createNode
method for creating a node, without adding it. - Added
TreeNode.tree
method. - Implemented tests and support for inherited Array prototype methods (excluding those not available in IE10+).
- Updated typescript definition file to include Array methods.
Breaking Changes
- Removed
isNode
alias ofisTreeNode
. isTreeNode
andisTreeNodes
are now static methods.- Renamed
filter
tofilterBy
to avoid overridingArray.filter
. - Renamed
sort
tosortBy
to avoid overridingArray.sort
.
- Added
isLoadEvent
boolean to state events.true
only when event fires on load and is inallowLoadEvents
config.
- Added
TreeNodes.move
. - Added
TreeNodes.swap
andTreeNode.swap
. - Added event-related methods to typescript definition file.
- Fixed empty arrays not being converted to TreeNodes instances.
- Cached initial load promise on the tree rather than throwing its error.
- Added safety check for invalid arrays on data load.
- Clears existing data on
load
when not using deferred loading. Was broken with 1.11.
- Addressed incorrect version in distribution file banners.
- Added
TreeNode.reload
method. - Removed bower support.
- Added
isTreeNode
alias to (and deprecated)isNode
. - Fixed uglify-incompatible instance checks.
2.0 is an overhaul (and improvement) with how we manage and build InspireTree. The API has not changed aside from some additions, but how you instantiate the DOM has.
Most critically, the inspire-tree package is now only the core API. To use the official DOM renderer,
you'll also need the inspire-tree-dom
package. This allows us to keep the packages cleaner for those
using their own view layer/rendering framework.
Overall, InspireTree is lighter because we now use rollup for bundling, which saves us 20k worth of code versus webpack.
We've ported our DOM rendering to Inferno, and are seeing up to 60% faster rendering (initial render of 10k nodes with Chrome 57 on macOS Sierra: 2265ms average with virtual-dom, 963ms average with Inferno).
- Added a gzipped copy of distribution files.
- Added
Tree.pagination
,TreeNodes.pagination
,TreNode.pagination
. - Added/exposed
Tree.loadMore
,TreeNodes.loadMore
,TreNode.loadMore
, which loads additional paginated nodes. - Fixed
check
call failing to reset indeterminate state. - Overhauled and added tests for deferral-related pagination.
- Improved the efficiency of which uuid imports we're referencing.
Breaking Changes
- Moved DOM code into a new package, inspire-tree-dom.
- Rewrote the DOM engine with Inferno, replacing virtual-dom.
While there are no official API changes, the node.itree.ref.node
Element reference is now just node.itree.ref
.
-
We're no longer bundling lodash. If you're not using a bundler like Webpack, Browserify, or rollup, you'll need to include it as a dependency.
-
Removed native context menu support since the
node.contextmenu
event is passed through anyway. -
Renamed
node.paginate
event tonode.paginated
.
For 1.0 changelogs, see the 1.x branch: https://github.com/helion3/inspire-tree/tree/1.x