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
|
|
|
@@ -331,8 +331,7 @@ const allSubstrings = input => {
|
|
|
331
331
|
/** @type {TCodePoints} */
|
|
332
332
|
|
|
333
333
|
const code_points = [[0, 65535]];
|
|
334
|
-
const accent_pat = '[\u0300-\u036F\u{b7}\u{2be}
|
|
335
|
-
|
|
334
|
+
const accent_pat = '[\u0300-\u036F\u{b7}\u{2be}\u{2bc}]';
|
|
336
335
|
/** @type {TUnicodeMap} */
|
|
337
336
|
|
|
338
337
|
let unicode_map;
|
|
@@ -342,13 +341,62 @@ let multi_char_reg;
|
|
|
342
341
|
const max_char_length = 3;
|
|
343
342
|
/** @type {TUnicodeMap} */
|
|
344
343
|
|
|
345
|
-
const latin_convert = {
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
'
|
|
350
|
-
'
|
|
344
|
+
const latin_convert = {};
|
|
345
|
+
/** @type {TUnicodeMap} */
|
|
346
|
+
|
|
347
|
+
const latin_condensed = {
|
|
348
|
+
'/': '⁄∕',
|
|
349
|
+
'0': '߀',
|
|
350
|
+
"a": "ⱥɐɑ",
|
|
351
|
+
"aa": "ꜳ",
|
|
352
|
+
"ae": "æǽǣ",
|
|
353
|
+
"ao": "ꜵ",
|
|
354
|
+
"au": "ꜷ",
|
|
355
|
+
"av": "ꜹꜻ",
|
|
356
|
+
"ay": "ꜽ",
|
|
357
|
+
"b": "ƀɓƃ",
|
|
358
|
+
"c": "ꜿƈȼↄ",
|
|
359
|
+
"d": "đɗɖᴅƌꮷԁɦ",
|
|
360
|
+
"e": "ɛǝᴇɇ",
|
|
361
|
+
"f": "ꝼƒ",
|
|
362
|
+
"g": "ǥɠꞡᵹꝿɢ",
|
|
363
|
+
"h": "ħⱨⱶɥ",
|
|
364
|
+
"i": "ɨı",
|
|
365
|
+
"j": "ɉȷ",
|
|
366
|
+
"k": "ƙⱪꝁꝃꝅꞣ",
|
|
367
|
+
"l": "łƚɫⱡꝉꝇꞁɭ",
|
|
368
|
+
"m": "ɱɯϻ",
|
|
369
|
+
"n": "ꞥƞɲꞑᴎлԉ",
|
|
370
|
+
"o": "øǿɔɵꝋꝍᴑ",
|
|
371
|
+
"oe": "œ",
|
|
372
|
+
"oi": "ƣ",
|
|
373
|
+
"oo": "ꝏ",
|
|
374
|
+
"ou": "ȣ",
|
|
375
|
+
"p": "ƥᵽꝑꝓꝕρ",
|
|
376
|
+
"q": "ꝗꝙɋ",
|
|
377
|
+
"r": "ɍɽꝛꞧꞃ",
|
|
378
|
+
"s": "ßȿꞩꞅʂ",
|
|
379
|
+
"t": "ŧƭʈⱦꞇ",
|
|
380
|
+
"th": "þ",
|
|
381
|
+
"tz": "ꜩ",
|
|
382
|
+
"u": "ʉ",
|
|
383
|
+
"v": "ʋꝟʌ",
|
|
384
|
+
"vy": "ꝡ",
|
|
385
|
+
"w": "ⱳ",
|
|
386
|
+
"y": "ƴɏỿ",
|
|
387
|
+
"z": "ƶȥɀⱬꝣ",
|
|
388
|
+
"hv": "ƕ"
|
|
351
389
|
};
|
|
390
|
+
|
|
391
|
+
for (let latin in latin_condensed) {
|
|
392
|
+
let unicode = latin_condensed[latin] || '';
|
|
393
|
+
|
|
394
|
+
for (let i = 0; i < unicode.length; i++) {
|
|
395
|
+
let char = unicode.substring(i, i + 1);
|
|
396
|
+
latin_convert[char] = latin;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
|
|
352
400
|
const convert_pat = new RegExp(Object.keys(latin_convert).join('|') + '|' + accent_pat, 'gu');
|
|
353
401
|
/**
|
|
354
402
|
* Initialize the unicode_map from the give code point ranges
|
|
@@ -369,38 +417,36 @@ const initialize = _code_points => {
|
|
|
369
417
|
|
|
370
418
|
const normalize = (str, form = 'NFKD') => str.normalize(form);
|
|
371
419
|
/**
|
|
372
|
-
*
|
|
420
|
+
* Remove accents without reordering string
|
|
373
421
|
* calling str.normalize('NFKD') on \u{594}\u{595}\u{596} becomes \u{596}\u{594}\u{595}
|
|
422
|
+
* via https://github.com/krisk/Fuse/issues/133#issuecomment-318692703
|
|
374
423
|
* @param {string} str
|
|
424
|
+
* @return {string}
|
|
375
425
|
*/
|
|
376
426
|
|
|
377
|
-
const
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
}, '');
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
return normalize(str);
|
|
427
|
+
const asciifold = str => {
|
|
428
|
+
return toArray(str).reduce(
|
|
429
|
+
/**
|
|
430
|
+
* @param {string} result
|
|
431
|
+
* @param {string} char
|
|
432
|
+
*/
|
|
433
|
+
(result, char) => {
|
|
434
|
+
return result + _asciifold(char);
|
|
435
|
+
}, '');
|
|
390
436
|
};
|
|
391
437
|
/**
|
|
392
|
-
* Remove accents
|
|
393
|
-
* via https://github.com/krisk/Fuse/issues/133#issuecomment-318692703
|
|
394
438
|
* @param {string} str
|
|
395
439
|
* @return {string}
|
|
396
440
|
*/
|
|
397
441
|
|
|
398
|
-
const
|
|
399
|
-
|
|
442
|
+
const _asciifold = str => {
|
|
443
|
+
str = normalize(str).toLowerCase().replace(convert_pat, (
|
|
400
444
|
/** @type {string} */
|
|
401
445
|
char) => {
|
|
402
446
|
return latin_convert[char] || '';
|
|
403
|
-
});
|
|
447
|
+
}); //return str;
|
|
448
|
+
|
|
449
|
+
return normalize(str, 'NFC');
|
|
404
450
|
};
|
|
405
451
|
/**
|
|
406
452
|
* Generate a list of unicode variants from the list of code points
|
|
@@ -431,13 +477,6 @@ function* generator(code_points) {
|
|
|
431
477
|
continue;
|
|
432
478
|
}
|
|
433
479
|
|
|
434
|
-
let decomposed = normalize(composed);
|
|
435
|
-
let recomposed = normalize(decomposed, 'NFC');
|
|
436
|
-
|
|
437
|
-
if (recomposed === composed && folded === decomposed) {
|
|
438
|
-
continue;
|
|
439
|
-
}
|
|
440
|
-
|
|
441
480
|
yield {
|
|
442
481
|
folded: folded,
|
|
443
482
|
composed: composed,
|
|
@@ -1758,7 +1797,7 @@ const preventDefault = (evt, stop = false) => {
|
|
|
1758
1797
|
}
|
|
1759
1798
|
};
|
|
1760
1799
|
/**
|
|
1761
|
-
*
|
|
1800
|
+
* Add event helper
|
|
1762
1801
|
*
|
|
1763
1802
|
*/
|
|
1764
1803
|
|
|
@@ -2236,7 +2275,6 @@ class TomSelect extends MicroPlugin(MicroEvent) {
|
|
|
2236
2275
|
|
|
2237
2276
|
addEvent(control_input, 'keypress', e => self.onKeyPress(e));
|
|
2238
2277
|
addEvent(control_input, 'input', e => self.onInput(e));
|
|
2239
|
-
addEvent(focus_node, 'resize', () => self.positionDropdown(), passive_event);
|
|
2240
2278
|
addEvent(focus_node, 'blur', e => self.onBlur(e));
|
|
2241
2279
|
addEvent(focus_node, 'focus', e => self.onFocus(e));
|
|
2242
2280
|
addEvent(control_input, 'paste', e => self.onPaste(e));
|
|
@@ -4495,8 +4533,8 @@ class TomSelect extends MicroPlugin(MicroEvent) {
|
|
|
4495
4533
|
|
|
4496
4534
|
html = self.settings.render[templateName].call(this, data, escape_html);
|
|
4497
4535
|
|
|
4498
|
-
if (html
|
|
4499
|
-
return
|
|
4536
|
+
if (!html) {
|
|
4537
|
+
return null;
|
|
4500
4538
|
}
|
|
4501
4539
|
|
|
4502
4540
|
html = getDom(html); // add mandatory attributes
|