tom-select-rails 2.2.1 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/tom-select-rails/version.rb +1 -1
- data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.complete.js +77 -39
- data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.complete.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.js +77 -39
- data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.popular.js +77 -39
- data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.popular.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/cjs/utils.js +2 -2
- data/vendor/assets/javascripts/tom-select-rails/cjs/utils.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/caret_position/plugin.js +57 -8
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/caret_position/plugin.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/change_listener/plugin.js +2 -2
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/change_listener/plugin.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/checkbox_options/plugin.js +57 -8
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/checkbox_options/plugin.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/clear_button/plugin.js +57 -8
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/clear_button/plugin.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/drag_drop/plugin.js +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_header/plugin.js +57 -8
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_header/plugin.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_input/plugin.js +58 -9
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_input/plugin.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/input_autogrow/plugin.js +2 -2
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/input_autogrow/plugin.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/no_active_items/plugin.js +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/no_backspace_delete/plugin.js +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/optgroup_columns/plugin.js +57 -8
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/optgroup_columns/plugin.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/remove_button/plugin.js +58 -9
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/remove_button/plugin.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/restore_on_backspace/plugin.js +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/virtual_scroll/plugin.js +57 -8
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/virtual_scroll/plugin.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.complete.js +77 -39
- data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.complete.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.js +77 -39
- data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.popular.js +77 -39
- data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.popular.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/utils.js +2 -2
- data/vendor/assets/javascripts/tom-select-rails/esm/utils.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/caret_position.js +57 -8
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/caret_position.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/change_listener.js +2 -2
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/change_listener.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/checkbox_options.js +57 -8
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/checkbox_options.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/clear_button.js +57 -8
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/clear_button.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/drag_drop.js +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/dropdown_header.js +57 -8
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/dropdown_header.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/dropdown_input.js +58 -9
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/dropdown_input.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/input_autogrow.js +2 -2
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/input_autogrow.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/no_active_items.js +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/no_backspace_delete.js +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/optgroup_columns.js +57 -8
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/optgroup_columns.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/remove_button.js +58 -9
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/remove_button.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/restore_on_backspace.js +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/virtual_scroll.js +57 -8
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/virtual_scroll.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/tom-select.base.js +77 -39
- data/vendor/assets/javascripts/tom-select-rails/js/tom-select.base.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/tom-select.base.min.js +132 -133
- data/vendor/assets/javascripts/tom-select-rails/js/tom-select.base.min.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/tom-select.complete.js +77 -39
- data/vendor/assets/javascripts/tom-select-rails/js/tom-select.complete.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/tom-select.complete.min.js +157 -158
- data/vendor/assets/javascripts/tom-select-rails/js/tom-select.complete.min.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/tom-select.popular.js +77 -39
- data/vendor/assets/javascripts/tom-select-rails/js/tom-select.popular.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/tom-select.popular.min.js +144 -145
- data/vendor/assets/javascripts/tom-select-rails/js/tom-select.popular.min.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/types/getSettings.d.ts +2 -2
- data/vendor/assets/javascripts/tom-select-rails/types/tom-select.d.ts +2 -2
- data/vendor/assets/javascripts/tom-select-rails/types/types/core.d.ts +3 -0
- data/vendor/assets/javascripts/tom-select-rails/types/utils.d.ts +1 -1
- data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap4.css +1 -1
- data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap5.css +1 -1
- data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.css +1 -1
- data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.default.css +1 -1
- data/vendor/assets/stylesheets/tom-select-rails/scss/tom-select.scss +1 -1
- metadata +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Tom Select v2.2.
|
|
2
|
+
* Tom Select v2.2.2
|
|
3
3
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -333,8 +333,7 @@ const allSubstrings = input => {
|
|
|
333
333
|
/** @type {TCodePoints} */
|
|
334
334
|
|
|
335
335
|
const code_points = [[0, 65535]];
|
|
336
|
-
const accent_pat = '[\u0300-\u036F\u{b7}\u{2be}
|
|
337
|
-
|
|
336
|
+
const accent_pat = '[\u0300-\u036F\u{b7}\u{2be}\u{2bc}]';
|
|
338
337
|
/** @type {TUnicodeMap} */
|
|
339
338
|
|
|
340
339
|
let unicode_map;
|
|
@@ -344,13 +343,62 @@ let multi_char_reg;
|
|
|
344
343
|
const max_char_length = 3;
|
|
345
344
|
/** @type {TUnicodeMap} */
|
|
346
345
|
|
|
347
|
-
const latin_convert = {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
'
|
|
352
|
-
'
|
|
346
|
+
const latin_convert = {};
|
|
347
|
+
/** @type {TUnicodeMap} */
|
|
348
|
+
|
|
349
|
+
const latin_condensed = {
|
|
350
|
+
'/': '⁄∕',
|
|
351
|
+
'0': '߀',
|
|
352
|
+
"a": "ⱥɐɑ",
|
|
353
|
+
"aa": "ꜳ",
|
|
354
|
+
"ae": "æǽǣ",
|
|
355
|
+
"ao": "ꜵ",
|
|
356
|
+
"au": "ꜷ",
|
|
357
|
+
"av": "ꜹꜻ",
|
|
358
|
+
"ay": "ꜽ",
|
|
359
|
+
"b": "ƀɓƃ",
|
|
360
|
+
"c": "ꜿƈȼↄ",
|
|
361
|
+
"d": "đɗɖᴅƌꮷԁɦ",
|
|
362
|
+
"e": "ɛǝᴇɇ",
|
|
363
|
+
"f": "ꝼƒ",
|
|
364
|
+
"g": "ǥɠꞡᵹꝿɢ",
|
|
365
|
+
"h": "ħⱨⱶɥ",
|
|
366
|
+
"i": "ɨı",
|
|
367
|
+
"j": "ɉȷ",
|
|
368
|
+
"k": "ƙⱪꝁꝃꝅꞣ",
|
|
369
|
+
"l": "łƚɫⱡꝉꝇꞁɭ",
|
|
370
|
+
"m": "ɱɯϻ",
|
|
371
|
+
"n": "ꞥƞɲꞑᴎлԉ",
|
|
372
|
+
"o": "øǿɔɵꝋꝍᴑ",
|
|
373
|
+
"oe": "œ",
|
|
374
|
+
"oi": "ƣ",
|
|
375
|
+
"oo": "ꝏ",
|
|
376
|
+
"ou": "ȣ",
|
|
377
|
+
"p": "ƥᵽꝑꝓꝕρ",
|
|
378
|
+
"q": "ꝗꝙɋ",
|
|
379
|
+
"r": "ɍɽꝛꞧꞃ",
|
|
380
|
+
"s": "ßȿꞩꞅʂ",
|
|
381
|
+
"t": "ŧƭʈⱦꞇ",
|
|
382
|
+
"th": "þ",
|
|
383
|
+
"tz": "ꜩ",
|
|
384
|
+
"u": "ʉ",
|
|
385
|
+
"v": "ʋꝟʌ",
|
|
386
|
+
"vy": "ꝡ",
|
|
387
|
+
"w": "ⱳ",
|
|
388
|
+
"y": "ƴɏỿ",
|
|
389
|
+
"z": "ƶȥɀⱬꝣ",
|
|
390
|
+
"hv": "ƕ"
|
|
353
391
|
};
|
|
392
|
+
|
|
393
|
+
for (let latin in latin_condensed) {
|
|
394
|
+
let unicode = latin_condensed[latin] || '';
|
|
395
|
+
|
|
396
|
+
for (let i = 0; i < unicode.length; i++) {
|
|
397
|
+
let char = unicode.substring(i, i + 1);
|
|
398
|
+
latin_convert[char] = latin;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
354
402
|
const convert_pat = new RegExp(Object.keys(latin_convert).join('|') + '|' + accent_pat, 'gu');
|
|
355
403
|
/**
|
|
356
404
|
* Initialize the unicode_map from the give code point ranges
|
|
@@ -371,38 +419,36 @@ const initialize = _code_points => {
|
|
|
371
419
|
|
|
372
420
|
const normalize = (str, form = 'NFKD') => str.normalize(form);
|
|
373
421
|
/**
|
|
374
|
-
*
|
|
422
|
+
* Remove accents without reordering string
|
|
375
423
|
* calling str.normalize('NFKD') on \u{594}\u{595}\u{596} becomes \u{596}\u{594}\u{595}
|
|
424
|
+
* via https://github.com/krisk/Fuse/issues/133#issuecomment-318692703
|
|
376
425
|
* @param {string} str
|
|
426
|
+
* @return {string}
|
|
377
427
|
*/
|
|
378
428
|
|
|
379
|
-
const
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
}, '');
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
return normalize(str);
|
|
429
|
+
const asciifold = str => {
|
|
430
|
+
return toArray(str).reduce(
|
|
431
|
+
/**
|
|
432
|
+
* @param {string} result
|
|
433
|
+
* @param {string} char
|
|
434
|
+
*/
|
|
435
|
+
(result, char) => {
|
|
436
|
+
return result + _asciifold(char);
|
|
437
|
+
}, '');
|
|
392
438
|
};
|
|
393
439
|
/**
|
|
394
|
-
* Remove accents
|
|
395
|
-
* via https://github.com/krisk/Fuse/issues/133#issuecomment-318692703
|
|
396
440
|
* @param {string} str
|
|
397
441
|
* @return {string}
|
|
398
442
|
*/
|
|
399
443
|
|
|
400
|
-
const
|
|
401
|
-
|
|
444
|
+
const _asciifold = str => {
|
|
445
|
+
str = normalize(str).toLowerCase().replace(convert_pat, (
|
|
402
446
|
/** @type {string} */
|
|
403
447
|
char) => {
|
|
404
448
|
return latin_convert[char] || '';
|
|
405
|
-
});
|
|
449
|
+
}); //return str;
|
|
450
|
+
|
|
451
|
+
return normalize(str, 'NFC');
|
|
406
452
|
};
|
|
407
453
|
/**
|
|
408
454
|
* Generate a list of unicode variants from the list of code points
|
|
@@ -433,13 +479,6 @@ function* generator(code_points) {
|
|
|
433
479
|
continue;
|
|
434
480
|
}
|
|
435
481
|
|
|
436
|
-
let decomposed = normalize(composed);
|
|
437
|
-
let recomposed = normalize(decomposed, 'NFC');
|
|
438
|
-
|
|
439
|
-
if (recomposed === composed && folded === decomposed) {
|
|
440
|
-
continue;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
482
|
yield {
|
|
444
483
|
folded: folded,
|
|
445
484
|
composed: composed,
|
|
@@ -1760,7 +1799,7 @@ const preventDefault = (evt, stop = false) => {
|
|
|
1760
1799
|
}
|
|
1761
1800
|
};
|
|
1762
1801
|
/**
|
|
1763
|
-
*
|
|
1802
|
+
* Add event helper
|
|
1764
1803
|
*
|
|
1765
1804
|
*/
|
|
1766
1805
|
|
|
@@ -2238,7 +2277,6 @@ class TomSelect extends MicroPlugin(MicroEvent) {
|
|
|
2238
2277
|
|
|
2239
2278
|
addEvent(control_input, 'keypress', e => self.onKeyPress(e));
|
|
2240
2279
|
addEvent(control_input, 'input', e => self.onInput(e));
|
|
2241
|
-
addEvent(focus_node, 'resize', () => self.positionDropdown(), passive_event);
|
|
2242
2280
|
addEvent(focus_node, 'blur', e => self.onBlur(e));
|
|
2243
2281
|
addEvent(focus_node, 'focus', e => self.onFocus(e));
|
|
2244
2282
|
addEvent(control_input, 'paste', e => self.onPaste(e));
|
|
@@ -4497,8 +4535,8 @@ class TomSelect extends MicroPlugin(MicroEvent) {
|
|
|
4497
4535
|
|
|
4498
4536
|
html = self.settings.render[templateName].call(this, data, escape_html);
|
|
4499
4537
|
|
|
4500
|
-
if (html
|
|
4501
|
-
return
|
|
4538
|
+
if (!html) {
|
|
4539
|
+
return null;
|
|
4502
4540
|
}
|
|
4503
4541
|
|
|
4504
4542
|
html = getDom(html); // add mandatory attributes
|