laravelio / laravel.io

The Laravel.io Community Portal.
https://laravel.io
MIT License
2.43k stars 643 forks source link

Bump choices.js from 10.2.0 to 11.0.0 #1120

Closed dependabot[bot] closed 2 weeks ago

dependabot[bot] commented 2 weeks ago

Bumps choices.js from 10.2.0 to 11.0.0.

Release notes

Sourced from choices.js's releases.

v11.0.0

⚠ BREAKING CHANGES (from v10.2.0)

  • allowHtml now defaults to false.
  • Update to using Fuse.js v7.0.0
  • Update choices.js package to be an ES module, and use 'subpath exports' to expose multiple versions (UMD, MTS bundles, can product CJS bundles but it is not enabled by default).
  • Provide "fuse full" (default choices.js, ~19.9KB), or "fuse basic" (choices.search-basic.js ~18.8KB) or "prefix filter" (choices.search-filter.js ~14.6KB) based on how much Fuse.js is included.
  • Templates/text functions now escape ' characters for display.
  • addItemText/uniqueItemText/customAddItemText are now called with the value argument already escaped.
  • For select-one and select-multiple, the placeholder value is pulled from config.placeholderValue="..." or <select data-placeholder="..."> before attempting to extract a placeholder from the options list. #912 #567 #843
  • enter key now consistently opens/closes the dropdown instead of the behavior varying depending on backing element or internal state of the highlighted choice
  • Mutation APIs setChoiceByValue/setChoices/setValue now throw an error if the Choices instance was not initialized or multiple choices instances where initialized on the same element. Prevents bad internal states from triggering unexpected errors #1129
  • Improve consistency of the choice event firing. choice event now occurs after the addItem event
  • Trigger a search event (with empty value and 0 resultCount) when search stops
  • Update polyfills to include Element.prototype.replaceChildren
  • A number of internal APIs have been extensively refactored, this includes typescript class names.
  • Typescript source mapping files .d.ts.map are no longer generated and various .test.d.ts files are no longer generated

🚀 Features

  • Improve performance of search/filtering with large number of choices.
  • Improve performance of rendering a large number of items or choices and adding/removing items.
    • Stopping a search or adding many items quickly may cause micro-stutters on lower end devices.
  • Add closeDropdownOnSelect option, controls how the dropdown is close after selection is made. #636 #973 #1012
  • Allow choices.js to be imported on nodejs, useful for tests and also server side rendering. As windows.document is by default not defined, the default template rendering will not function. The callbackOnCreateTemplates callback must be used. #861
  • config.classNames now accept arrays to support multiple classes. #1121 #1074 #907 #832
  • The original option list for the select is not destroyed, and all loaded choices are serialised to HTML for better compatibility with external javascript. #1053 #1023
  • New singleModeForMultiSelect feature to treat a select-single as if it was a select-multiple with a max item count of 1, and still auto-close the dropdown and swap the active item on selection.
  • Remove item text can be localized.
  • Allow user-created choices for selects. #1117 #1114
    • User input is escaped by default. At the risk of XSS attacks this can be disabled by allowHtmlUserInput.
  • Render options without a group even if groups are present. #615 #1110
  • Read data-labelclass/data-label-description from <option> HTML to drive adding a per-choice CSS label and description text when allowHtml: false.
  • Add removeItemButtonAlignLeft option, to control if the remove item button is at the start or the end of the item.
  • Add removeChoice method. Removes the choice from the choices.js object and any backing <option> HTML element
  • Add refresh method. Reloads choices from the backing <select>s options.
  • escapeForTemplate function is passed to the 2nd method of the callbackOnCreateTemplates callback.
  • When allowHtml is false, default templates now render escaped html to innerHtml writing to innerText.
    • This provides consistent rendering performance as innerText is quirky and slower than escaped html into innerHtml
  • Shadow DOM support #938
  • searchResultLimit can be set to -1 for no limit of search results to display.

🐛 Bug Fixes

  • HTML escaping of choice/item labels should no longer double escape depending on allowHTML mode.
  • Avoid pushing a search to fuse.js which is just additional whitespace to the existing search term
  • Replace malicious polyfill with cdnjs. #1161
  • Maintain groups in search mode. #1152
  • Fix various "first press" bugs on single select dropdowns. #1104
  • Fix 'esc' would close the dropdown and also apply to the container resulting in an overlay/modal unexpectedly closing. #1039
  • Fix form reset would clear the choices list, but not clear the search bar. #1023
  • Fix options would be disabled when choices.js was initialized on a disabled <select> element. #1025

... (truncated)

Changelog

Sourced from choices.js's changelog.

[11.0.0] (2024-08-28)

⚠ BREAKING CHANGES

  • Update polyfills to include Element.prototype.replaceChildren
  • Number of internal APIs have changed
Commits


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
dependabot[bot] commented 2 weeks ago

OK, I won't notify you again about this release, but will get in touch when a new version is available. If you'd rather skip all updates until the next major or minor version, let me know by commenting @dependabot ignore this major version or @dependabot ignore this minor version. You can also ignore all major, minor, or patch releases for a dependency by adding an ignore condition with the desired update_types to your config file.

If you change your mind, just re-open this PR and I'll resolve any conflicts on it.