tom-select-rails 2.2.0 → 2.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tom-select-rails/version.rb +1 -1
  3. data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.complete.js +77 -39
  4. data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.complete.js.map +1 -1
  5. data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.js +77 -39
  6. data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.js.map +1 -1
  7. data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.popular.js +77 -39
  8. data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.popular.js.map +1 -1
  9. data/vendor/assets/javascripts/tom-select-rails/cjs/utils.js +2 -2
  10. data/vendor/assets/javascripts/tom-select-rails/cjs/utils.js.map +1 -1
  11. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/caret_position/plugin.js +57 -8
  12. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/caret_position/plugin.js.map +1 -1
  13. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/change_listener/plugin.js +2 -2
  14. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/change_listener/plugin.js.map +1 -1
  15. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/checkbox_options/plugin.js +57 -8
  16. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/checkbox_options/plugin.js.map +1 -1
  17. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/clear_button/plugin.js +57 -8
  18. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/clear_button/plugin.js.map +1 -1
  19. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/drag_drop/plugin.js +1 -1
  20. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_header/plugin.js +57 -8
  21. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_header/plugin.js.map +1 -1
  22. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_input/plugin.js +58 -9
  23. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_input/plugin.js.map +1 -1
  24. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/input_autogrow/plugin.js +2 -2
  25. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/input_autogrow/plugin.js.map +1 -1
  26. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/no_active_items/plugin.js +1 -1
  27. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/no_backspace_delete/plugin.js +1 -1
  28. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/optgroup_columns/plugin.js +57 -8
  29. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/optgroup_columns/plugin.js.map +1 -1
  30. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/remove_button/plugin.js +58 -9
  31. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/remove_button/plugin.js.map +1 -1
  32. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/restore_on_backspace/plugin.js +1 -1
  33. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/virtual_scroll/plugin.js +57 -8
  34. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/virtual_scroll/plugin.js.map +1 -1
  35. data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.complete.js +77 -39
  36. data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.complete.js.map +1 -1
  37. data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.js +77 -39
  38. data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.js.map +1 -1
  39. data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.popular.js +77 -39
  40. data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.popular.js.map +1 -1
  41. data/vendor/assets/javascripts/tom-select-rails/esm/utils.js +2 -2
  42. data/vendor/assets/javascripts/tom-select-rails/esm/utils.js.map +1 -1
  43. data/vendor/assets/javascripts/tom-select-rails/js/plugins/caret_position.js +57 -8
  44. data/vendor/assets/javascripts/tom-select-rails/js/plugins/caret_position.js.map +1 -1
  45. data/vendor/assets/javascripts/tom-select-rails/js/plugins/change_listener.js +2 -2
  46. data/vendor/assets/javascripts/tom-select-rails/js/plugins/change_listener.js.map +1 -1
  47. data/vendor/assets/javascripts/tom-select-rails/js/plugins/checkbox_options.js +57 -8
  48. data/vendor/assets/javascripts/tom-select-rails/js/plugins/checkbox_options.js.map +1 -1
  49. data/vendor/assets/javascripts/tom-select-rails/js/plugins/clear_button.js +57 -8
  50. data/vendor/assets/javascripts/tom-select-rails/js/plugins/clear_button.js.map +1 -1
  51. data/vendor/assets/javascripts/tom-select-rails/js/plugins/drag_drop.js +1 -1
  52. data/vendor/assets/javascripts/tom-select-rails/js/plugins/dropdown_header.js +57 -8
  53. data/vendor/assets/javascripts/tom-select-rails/js/plugins/dropdown_header.js.map +1 -1
  54. data/vendor/assets/javascripts/tom-select-rails/js/plugins/dropdown_input.js +58 -9
  55. data/vendor/assets/javascripts/tom-select-rails/js/plugins/dropdown_input.js.map +1 -1
  56. data/vendor/assets/javascripts/tom-select-rails/js/plugins/input_autogrow.js +2 -2
  57. data/vendor/assets/javascripts/tom-select-rails/js/plugins/input_autogrow.js.map +1 -1
  58. data/vendor/assets/javascripts/tom-select-rails/js/plugins/no_active_items.js +1 -1
  59. data/vendor/assets/javascripts/tom-select-rails/js/plugins/no_backspace_delete.js +1 -1
  60. data/vendor/assets/javascripts/tom-select-rails/js/plugins/optgroup_columns.js +57 -8
  61. data/vendor/assets/javascripts/tom-select-rails/js/plugins/optgroup_columns.js.map +1 -1
  62. data/vendor/assets/javascripts/tom-select-rails/js/plugins/remove_button.js +58 -9
  63. data/vendor/assets/javascripts/tom-select-rails/js/plugins/remove_button.js.map +1 -1
  64. data/vendor/assets/javascripts/tom-select-rails/js/plugins/restore_on_backspace.js +1 -1
  65. data/vendor/assets/javascripts/tom-select-rails/js/plugins/virtual_scroll.js +57 -8
  66. data/vendor/assets/javascripts/tom-select-rails/js/plugins/virtual_scroll.js.map +1 -1
  67. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.base.js +77 -39
  68. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.base.js.map +1 -1
  69. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.base.min.js +132 -133
  70. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.base.min.js.map +1 -1
  71. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.complete.js +77 -39
  72. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.complete.js.map +1 -1
  73. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.complete.min.js +157 -158
  74. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.complete.min.js.map +1 -1
  75. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.popular.js +77 -39
  76. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.popular.js.map +1 -1
  77. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.popular.min.js +144 -145
  78. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.popular.min.js.map +1 -1
  79. data/vendor/assets/javascripts/tom-select-rails/types/getSettings.d.ts +2 -2
  80. data/vendor/assets/javascripts/tom-select-rails/types/tom-select.d.ts +2 -2
  81. data/vendor/assets/javascripts/tom-select-rails/types/types/core.d.ts +3 -0
  82. data/vendor/assets/javascripts/tom-select-rails/types/utils.d.ts +1 -1
  83. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap4.css +1 -1
  84. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap5.css +1 -1
  85. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.css +1 -1
  86. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.default.css +1 -1
  87. data/vendor/assets/stylesheets/tom-select-rails/scss/plugins/clear_button.scss +2 -8
  88. data/vendor/assets/stylesheets/tom-select-rails/scss/tom-select.scss +2 -2
  89. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7ea932475ddc79c98e9c351bc8d53b7f258c70952a671685d15e5b5b8bbef750
4
- data.tar.gz: c7ba100d8829d40c8b1dc7e9575d185e0308abd5a182383f474091b93b282634
3
+ metadata.gz: a6c09beaeec761364f1e4074ce010a867fc7d2f6affdbc9a0e7e053f8118e465
4
+ data.tar.gz: 322afb97f564f1f81ce277b5ee1c95d10b8d2cc35476e79c54fa016e1471da28
5
5
  SHA512:
6
- metadata.gz: 0db23a99e957215a06619dd8080cbcba1a42bdefdca7c763da016ccad8f2d089976a24845cf81e7e9fcc79a211433554a5d61436941b646d457720b618e0dd0d
7
- data.tar.gz: 18fe81b57a356131c8ed9733c55d0b947bb0ea5dbe818ee09a1b000f93d3b94c96143ebdc65e8d1fef1a1bb052115de3568cb969bb7b00bd0476b25f851b7b79
6
+ metadata.gz: 9c4248c6412dfaa71259b71afad067e698a0ebb0e2c90b69e040c137c80d555ad95a9984499494e08eee3cf0a9a4140257ec2fc35b6da94662dcc8679dd48d18
7
+ data.tar.gz: daafe212af8ee704cd176d345c5ad6a32be4dfbf5e2f9d60d94edf7c41667123b72863ddbc6d1263651fc68e34f74268d170ae6acedc656bfe8bff383fbc460c
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TomSelect
4
- VERSION = "2.2.0"
4
+ VERSION = "2.2.2"
5
5
  end
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Tom Select v2.2.0
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}]'; // \u{2bc}
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
- 'æ': 'ae',
349
- 'ⱥ': 'a',
350
- 'ø': 'o',
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
- * Compatibility Decomposition without reordering string
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 decompose = str => {
380
- if (str.match(/[\u0f71-\u0f81]/)) {
381
- return toArray(str).reduce(
382
- /**
383
- * @param {string} result
384
- * @param {string} char
385
- */
386
- (result, char) => {
387
- return result + normalize(char);
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 asciifold = str => {
401
- return decompose(str).toLowerCase().replace(convert_pat, (
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
- * Prevent default
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 == null) {
4501
- return html;
4538
+ if (!html) {
4539
+ return null;
4502
4540
  }
4503
4541
 
4504
4542
  html = getDom(html); // add mandatory attributes