1import {Controller} from '@hotwired/stimulus'; 2import $ from 'jquery'; 3import select2 from 'select2'; 4import 'select2/dist/css/select2.min.css'; 5 6export default class Select2 extends Controller { 7 static values = { 8 options: Object 9 } 10 11 initialize() { 12 // hack to boot select2 plugin with good instance of jquery 13 select2($); 14 } 15 16 connect() { 17 $(this.element).select2({ 18 ...this.defaultOptions, 19 ...this.optionsValue, 20 }); 21 } 22 23 disconnect() { 24 $(this.element).select2('destroy'); 25 } 26 27 defaultOptions() { 28 return {} 29 } 30}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.