Releases: konfirm/kontext
latest beta
v2.0.0-beta Updated beta destribution
To `each` his own
Besides fixes for a couple of minor issues (causing major pain for some), this release brings an overhaul of the each-extension mechanics.
The performance is greatly increased and as a bonus, it is now possible to use the element which invokes the each-extension to use itself as template.
There is - however - a catch, when using this feature, all other kontext extensions will not work on that element, this is due to the data-kontext attribute being removed from the element entirely (feel free to share your brilliant solution to the open issue for this).
Performance tweaks
Changes were made to put the forgiving nature of Array.concat to good use and removed all logic which detects the Array type whenever possible.
The each extension now has improved performance when updating large collections by letting it skip over unaffected items.
Bugfixes
Input-extension fixes
Fixed issues with input (<select>) default values
- fixed issue where the default value could no longer be a string value instead of a model property reference
- added
defaultto the update list so changing the value also updates the option label
Scoping consistency
The main focus of this release was to provide a more consistent approach to allow for variable scoping for all extensions.
release notes
Improvements
All extensions now fully support variable scoping and have their internal flow revised and updated (reducing the minified code slightly while adding flexibility).
The input extension has been refactored entirely to reduce the complexity and improve overall usability (checkbox/radio inputs now also support dynamic values, <select>-elements now support dynamic options.
Templates can now be dynamic, lots of internal improvements
Templates can now be dynamic
The template extension now excepts a value property in the object configuration syntax, where the value of the referenced model property is used to load the template. Whenever the property is changed on the model, the template will be updated.
Internal improvements
- fixed an issue where a NodeList could be mistaken for an options object if it was the last argument of
kontext.bind - added tests to ensure templates are properly cached and queue while loading files (so each path is only loaded once)
- fixed several minor issues pointed out by Codacy
- improved code coverage for tests
Abbreviated extension names, added template extension, binding element expansion
Abbreviated extension names
It is now made possible to shorten the extension names in the HTML attributes. Whenever the exact extension name is not present the available extensions will be compared to the extension name, if this matches it will be added to a shortlist and finally, if the shortlist contains a single extension it will be returned.
If there are multiple options, an error will be logged
Template extension
A new extension is made available which allows for 'templating', where the contents of the element may be populated (overwritten) by an internal or external template identified by a selector
Binding element expansion
The element(s) provided to context.bind(<model> [, <element> [, <element>]]) now also supports NodeLists, such as the result of document.querySelectorAll, element.childNodes, etc.
Fixes nested `each`
- fixed issue where nested
eachwould raise an error
Kontext 1.0.0
v1.0.0 Added 1.0.0 distribution