This log documents significant changes for each release. This project follows Semantic Versioning.
- Upgraded to nodejs version 22.
- Filter without highlighting for Prefetch autocomplete with isListHTML true.
- new Prefetch option: isListHTML. Defaults to false. When set to true, display the list as HTML.
- Announce that the search is in progress if it takes more than 1.5 seconds.
- ajax() takes relative url path, mimicking jQuery ajax().
- Reposition the answer list under the autocomplete-lhc control when the window is resized.
- Cypress/xpath dependency.
- "showLoadingIndicator" option to show loading indicator on a Search autocomplete, defaults to true.
- An issue where the search list items are not clickable after switching out browser tab/window and coming back.
- Changed event handlers in Def.Autocompleter.Event to return a function whose invocation removes the handler from the list of registered handlers.
- Issue of double encoding in URLs.
- Remove classes added by autocomplete-lhc when destroying the autocomplete instance.
- Removed jQuery dependency. Some changes use APIs that are not supported by IE.
- autocomplete-lhc search field should cancel the previous ajax request on next keystroke.
- Port scriptaculous unit tests into Cypress.
- We were setting a variable on the external jQuery object.
- If jQuery were redefined after autocomplete-lhc intialized, some parts of the code would start using the new jQuery object.
- If user switches to another window and clicks back on the page where there was an autocomplete list, it could select the item without user seeing the list.
- Wrong position of the result list if the page is scrolled and a modal dialog is opened with an autocomplete-lhc control on it.
- Wrong height calculation of the result list on a modal dialog which caused the list to go out of the bottom of the viewport.
- New option caseInsenstiveSelection (defaults to true). If set to false, the autocomplete control will only do a case-sensitive match when user changes the field but leaves without picking an item.
- Don't show list on focus if preventListFromShowing is set to true.
- Reading text to the item remove button.
- New Prefetch option formattedListItems. When provided, the HTML list from this option will be appended for display in the UI list. Filtering will only work on the original list, not considering formattedListItems.
- clearStoredSelection()- clears the internal data model for selected items
- Prefetched lists now call the base onFocus method even when there is no list to show.
- When the prefetch autoFill is disabled, lists of length 1 are now shown.
- Added commments clarifying that autoFill and setListAndField() should not be used when maxList is set to something other than 1.
- For the search autocompleter, added request for extra items when some are selected to keep the number of dropdown items.
- Selected item data should be cleared when user types non-matching value.
- Added options.search for specifying a function to return results.
- An option "showListOnFocusIfEmpty" in Search autocomplete. If set to true, it will cause a list to be shown when the empty field receives focus.
- Display "unknown total" at the bottom of the dropdown list, if null is passed in for total count.
- An issue with the destroy() method on multi-select lists. It was not removing the div containing the list of selected items from the page.
- An issue with search lists using the fhir.search parameter sharing a common results cache.
- Added support for search lists that get input from FHIR ValueSet expansions.
- Updated dependencies to get patches for vulnerabilities. The vulnerabilities were all in development dependencies, and so should not affect anyone.
- The peer dependency of the npm jquery package has been relaxed to accept any 3.. version.
- Changed the npm package so that when it is required, it does not set the "Def" variable on window, but just exports that variable. The browser-ready JavaScript file is built to still set window.Def, so this is only a breaking change for anyone using the npm package.
- Removed the postinstall script, which was causing installations in other packages to fail.
- Forgot to update the version in package.json, as our build system now requires.
- Added the package name back to the directory inside the zip distribution file.
- No longer includes jQuery in the distribution file. It assumed that users will link that in with a separate script tag.
- No longer includes pieces of jQuery-UI.
- No longer includes "suggestion" dialogs in response to field entries that do not match an item on the list. Instead, the way to handle suggestions is now to register an event listener with Def.Autocompleter.Event.observeSuggesions. It is now up to the external program to decide how to show the suggestions to the user, and when one is selected, the acceptSuggestion function on the autocompleter instance should be called with the index of the selected suggestion. This is some additional work for the program using the autocompleter, but 1) it did not seem right that the autocompleter was opening a dialog, and 2) as far as we know, the suggestion dialog feature was not being used outside NLM.
- Replace the observeSuggestionsShown event listener registration with observeSuggestions. See note above about the removal of "suggestion" dialogs.
- The search autocompleter now has an option "sort" which controls whether the list is sorted after being returned by the server. Note that if you want the list to be exacatly as returned by the server, you should set the suggestionMode parameter to Def.Autocompleter.NO_COMPLETION_SUGGESTIONS so that a suggestion is not moved to the top of the list.
- Fixed an issue with selection of a list item that differs from another only by case, when the user types the item exactly and leaves the field without picking it.
- Various timeouts were adjusted from 1 ms to 0 ms, to introduce more predictability.
- List selection events are now sent for cases where matchListValue was set to true (requiring a list value) and an invalid value was entered. In such cases, the autocompleter refocuses the field to the let user correct the error, and because the user was still working with the field, previously no event was sent. However, it turned out that our AngularJS directive needed that event even for an invalid entry so it could update the data model. On receiving such an event, you can check the value of "on_list" in the event's data object to determine whether the entry was valid or not.
- The above change means that we also now need to send a list selection event in the case where the field is cleared by the autocompleter after a second attempt to enter the same invalid value, even when the field started out blank.
- Corrected an issue in which if a list that requires a matching value is left with a non-matching value by clicking in a second autocompleting field, the second field's list was left visible and active when the focus was returned the first first field.
- Revised the bower specification to make a file of helper functions available (basePage.js) that are useful for other applications when writing Protractor tests that interact with the autocompleter.
- A new function, getSelectedItemData(), is now available for retrieving all information about the selected list items.
- The expected data format for search autocompleters has changed slightly. In particular, the optional fourth element of the the JSON data returned by the AJAX call is now an array of code system names declaring the code system for each of the codes in the codes array in position 1 of the JSON data. Previously, the optional fourth parameter was a boolean indicating that the display string data (position 3) might have span tags for formatting. However, it has been some time since the code used this parameter. Span tags are still permitted in display strings, but it is no longer important that the autocompleter be aware of that.
- The parameter "tokens" has been renamed to "wordBoundaryChars", though for now the older parameter name will still work as well.
- The AngularJS directive for search lists now places the "extra data" fields for a selected list item in a sub-object of the data model object, under property name "data". This breaking change is to avoid potential collisions between the field names of the extra data fields and the keys "text" and "code" which are set by the autocompleter. If you are not using the AngularJS directive, this change will not affect you.
- Missed checking in a file in 13.0.1 (causing a test to fail).
- Fixed an accessibility issue with search lists by adding code to suggest on field focus that users start typing to see a list of matching results.
- For AngularJS directive single-select lists, clearing a single-select list now results in the model being set to null (instead of {"text": ""}.) This is essentially a bug-fix, but it is potentially a breaking change of long-standing behavior, so we've increased the major version number. If you are not using the AngularJS directive, this change won't affect you.
- For AngularJS directive lists, the new "_notOnList" model attribute no longer gets set when the list field is cleared.
- The AngularJS directive now includes an attribute "_notOnList" when constructing model objects from user entered values which did not match a list item. This change won't affect you if you are not using the AngularJS directive.
- Fixed a problem with AngularJS directive's handling of incorrect model assignments that have a null "text" attribute.
- Several accessibility issues for screen reader users.
- Issues with the result counts for prefetch (non-AJAX) lists.
- The "return to field" link in the suggestion dialog.
- For the angular directive, corrected the handling of a default value for prefetch lists.
- The search (AJAX) autocompleter now begins autocompleting with just one character in the field instead of two. This behavior is configurable with the minChars option at construction.
- The AngularJS directive now cleans up old formatters and parsers when the autocompleter is reinitialized.
- Replaced the search field "list" icon with a magnifying glass icon.
- A minor issue in which lists created using the Angular directive would highlight an item configured as a default, even though that value was already present in the field.
- Lists created using the Angular directive now use the model objects provided by the caller rather than making a copy.
- Support for autocompletion based on partial field values, separated by token characters. To enable, set the "tokens" option (in the constructor's options hash) to an array of the desired token characters.
- There was a problem with leading or trailing whitespace in search autocompletion fields preventing the display of the results list.
- The internal cache for search autocompleters is now entirely based on the URL instead of on the field ID. This makes it easy to have two fields with the same URL share the on-page cache, and also avoids the need to clear the cache if a field's autocompleter or URL are changed.
- The AngularJS directive for the case where prefetched lists have padded values.
- Lists created by the AngularJS directive were leaving list selection observers behind when they were destroyed and recreated.
- The directive now permits the search autocompleter to be constructed with an empty URL. This is useful for cases in which the URL is not yet known.
- The "autocomp" parameter in URLs for search lists has been replaced with the "maxList" parameter, so that without either parameter specified the default return size is expected to be small. When maxList is present, the URL is expected to return are large number of items (e.g., 500) if possible. In other words, the expected effect of maxList is opposite that of autocomp.
- The default for the nonMatchSuggestions option is now false.
- Added a needed polyfill for IE (Object.assign). Versions 9.2.0-9.2.2 were broken for IE.
- If the list is too wide for the page, the left edge of the list will be at the left edge of the page, rather than a negative position.
- A problem was introduced in 9.2.0 that allowed the input field to be scrolled under a top navigation bar.
- The ability for the left edge of the list to be positioned left of the field if needed to avoid the list extending past the right edge of the window.
- A positioning problem which occured if the positioning process changed whether the scrollbar was showing.
- Missing padding around column headers
- The ability to specify column headers for search lists
- The color scheme, as a part of selecting the color for the heading.
- The field separator character is now removed from search strings before querying. This solves a problem in which a selected list item could look invalid if a query was sent for the combined field value of a multi-field list.
- The AngularJS directive now clears a search field's result cache if its URL changes.
- Removed the field's background image for print media.
- Removed "!important" from the CSS. It is this change that triggered the major version bump, since it is impossible to be sure whether this will mess up the CSS for someone using this package.
- Updated package tests to use Node.js 4 and changed the protractor tests to run Chrome, to work around an issue with Selenium webdriver or Firefox (see angular/protractor#3200).
- Search autocompleters now have a "setURL" method for updating the URL which also takes care of clearing the cached autocompletion results (from the previous URL), as well as a clearCachedResults method for clearing the cache (called by setURL).