$ show wenzhixin/multiple-select
Multiple Select is a mature jQuery plugin that transforms native HTML `<select>` elements into feature-rich dropdowns with checkboxes, supporting single and multiple selection, optgroups, filtering, virtual scrolling for large datasets, localization, and full keyboard accessibility. The library is architecturally structured as a monolith jQuery-fn extension with a core class (`MultipleSelect.js`), separate utilities (`utils/index.js`), constants, virtual scroll implementation, and a Bootstrap 5 theme. It also provides Vue 2/3 wrappers (`src/vue/`) and is distributed as UMD modules via npm and CDN. The codebase demonstrates solid engineering practices: ES6+ modules, Rollup/Vite build system, comprehensive linting (ESLint, Stylelint, cspell), and a configurable options/events/methods API. While tightly coupled to jQuery, the utility functions and virtual scroll component are potentially reusable standalone. The plugin is actively maintained with recent releases and a responsive issue tracker.
The LLM identified 2 files worth highlighting for reuse:
A collection of generic utility functions including a complete reimplementation of jQuery's `extend()` (deep merging), `compareObjects`, `findByParam`, `getDocumentClickEvent`, `removeDiacritics` (with an extensive Unicode mapping table), `removeUndefined`, `setDataKeys`, and `toRaw`. The `removeDiacritics` function is particularly noteworthy for its comprehensive character mapping, enabling accent-insensitive filtering. These utilities are self-contained and could be extracted into a standalone npm package for any JavaScript project requiring deep object merging, diacritics removal, or parameterized object search.
A lightweight virtual scroll implementation that renders only a visible cluster of rows (configurable block size) within a scrollable container, significantly improving performance for large datasets. It calculates item heights, manages a cache of rendered HTML, and handles scroll events to dynamically swap clusters. The class is self-contained except for importing `BLOCK_ROWS` and `CLUSTER_BLOCKS` constants; it could be extracted with minimal changes for any project needing efficient rendering of long lists (e.g., dropdowns, tables, chat logs).