tom-select-rails 2.3.1 → 2.4.5

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.
Files changed (259) 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/constants.js +16 -0
  4. data/vendor/assets/javascripts/tom-select-rails/cjs/constants.js.map +1 -0
  5. data/vendor/assets/javascripts/tom-select-rails/cjs/contrib/highlight.js +69 -0
  6. data/vendor/assets/javascripts/tom-select-rails/cjs/contrib/highlight.js.map +1 -0
  7. data/vendor/assets/javascripts/tom-select-rails/cjs/contrib/microevent.js +64 -0
  8. data/vendor/assets/javascripts/tom-select-rails/cjs/contrib/microevent.js.map +1 -0
  9. data/vendor/assets/javascripts/tom-select-rails/cjs/contrib/microplugin.js +112 -0
  10. data/vendor/assets/javascripts/tom-select-rails/cjs/contrib/microplugin.js.map +1 -0
  11. data/vendor/assets/javascripts/tom-select-rails/cjs/defaults.js +84 -0
  12. data/vendor/assets/javascripts/tom-select-rails/cjs/defaults.js.map +1 -0
  13. data/vendor/assets/javascripts/tom-select-rails/{types → cjs}/getSettings.d.ts +2 -2
  14. data/vendor/assets/javascripts/tom-select-rails/cjs/getSettings.js +146 -0
  15. data/vendor/assets/javascripts/tom-select-rails/cjs/getSettings.js.map +1 -0
  16. data/vendor/assets/javascripts/tom-select-rails/cjs/package.json +1 -0
  17. data/vendor/assets/javascripts/tom-select-rails/{types → cjs}/plugins/caret_position/plugin.d.ts +1 -1
  18. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/caret_position/plugin.js +66 -0
  19. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/caret_position/plugin.js.map +1 -0
  20. data/vendor/assets/javascripts/tom-select-rails/{types → cjs}/plugins/change_listener/plugin.d.ts +1 -1
  21. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/change_listener/plugin.js +25 -0
  22. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/change_listener/plugin.js.map +1 -0
  23. data/vendor/assets/javascripts/tom-select-rails/{types → cjs}/plugins/checkbox_options/plugin.d.ts +2 -2
  24. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/checkbox_options/plugin.js +108 -0
  25. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/checkbox_options/plugin.js.map +1 -0
  26. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/checkbox_options/types.js +3 -0
  27. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/checkbox_options/types.js.map +1 -0
  28. data/vendor/assets/javascripts/tom-select-rails/{types → cjs}/plugins/clear_button/plugin.d.ts +2 -2
  29. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/clear_button/plugin.js +46 -0
  30. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/clear_button/plugin.js.map +1 -0
  31. data/vendor/assets/javascripts/tom-select-rails/{types → cjs}/plugins/clear_button/types.d.ts +2 -0
  32. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/clear_button/types.js +3 -0
  33. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/clear_button/types.js.map +1 -0
  34. data/vendor/assets/javascripts/tom-select-rails/{types → cjs}/plugins/drag_drop/plugin.d.ts +1 -1
  35. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/drag_drop/plugin.js +117 -0
  36. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/drag_drop/plugin.js.map +1 -0
  37. data/vendor/assets/javascripts/tom-select-rails/{types → cjs}/plugins/dropdown_header/plugin.d.ts +2 -2
  38. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/dropdown_header/plugin.js +50 -0
  39. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/dropdown_header/plugin.js.map +1 -0
  40. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/dropdown_header/types.js +3 -0
  41. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/dropdown_header/types.js.map +1 -0
  42. data/vendor/assets/javascripts/tom-select-rails/{types → cjs}/plugins/dropdown_input/plugin.d.ts +1 -1
  43. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/dropdown_input/plugin.js +77 -0
  44. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/dropdown_input/plugin.js.map +1 -0
  45. data/vendor/assets/javascripts/tom-select-rails/{types/plugins/no_backspace_delete → cjs/plugins/input_autogrow}/plugin.d.ts +1 -1
  46. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/input_autogrow/plugin.js +47 -0
  47. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/input_autogrow/plugin.js.map +1 -0
  48. data/vendor/assets/javascripts/tom-select-rails/{types → cjs}/plugins/no_active_items/plugin.d.ts +1 -1
  49. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/no_active_items/plugin.js +22 -0
  50. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/no_active_items/plugin.js.map +1 -0
  51. data/vendor/assets/javascripts/tom-select-rails/{types/plugins/input_autogrow → cjs/plugins/no_backspace_delete}/plugin.d.ts +1 -1
  52. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/no_backspace_delete/plugin.js +28 -0
  53. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/no_backspace_delete/plugin.js.map +1 -0
  54. data/vendor/assets/javascripts/tom-select-rails/{types → cjs}/plugins/optgroup_columns/plugin.d.ts +1 -1
  55. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/optgroup_columns/plugin.js +51 -0
  56. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/optgroup_columns/plugin.js.map +1 -0
  57. data/vendor/assets/javascripts/tom-select-rails/{types → cjs}/plugins/remove_button/plugin.d.ts +2 -2
  58. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/remove_button/plugin.js +61 -0
  59. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/remove_button/plugin.js.map +1 -0
  60. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/remove_button/types.js +3 -0
  61. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/remove_button/types.js.map +1 -0
  62. data/vendor/assets/javascripts/tom-select-rails/{types → cjs}/plugins/restore_on_backspace/plugin.d.ts +2 -2
  63. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/restore_on_backspace/plugin.js +24 -0
  64. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/restore_on_backspace/plugin.js.map +1 -0
  65. data/vendor/assets/javascripts/tom-select-rails/{types → cjs}/plugins/virtual_scroll/plugin.d.ts +1 -1
  66. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/virtual_scroll/plugin.js +170 -0
  67. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/virtual_scroll/plugin.js.map +1 -0
  68. data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.complete.d.ts +2 -0
  69. data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.complete.js +33 -5291
  70. data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.complete.js.map +1 -1
  71. data/vendor/assets/javascripts/tom-select-rails/{types → cjs}/tom-select.d.ts +3 -3
  72. data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.js +2128 -4255
  73. data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.js.map +1 -1
  74. data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.popular.d.ts +2 -0
  75. data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.popular.js +15 -4665
  76. data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.popular.js.map +1 -1
  77. data/vendor/assets/javascripts/tom-select-rails/{types → cjs}/types/core.d.ts +2 -2
  78. data/vendor/assets/javascripts/tom-select-rails/cjs/types/core.js +3 -0
  79. data/vendor/assets/javascripts/tom-select-rails/cjs/types/core.js.map +1 -0
  80. data/vendor/assets/javascripts/tom-select-rails/cjs/types/index.d.ts +2 -0
  81. data/vendor/assets/javascripts/tom-select-rails/cjs/types/index.js +19 -0
  82. data/vendor/assets/javascripts/tom-select-rails/cjs/types/index.js.map +1 -0
  83. data/vendor/assets/javascripts/tom-select-rails/{types → cjs}/types/settings.d.ts +4 -4
  84. data/vendor/assets/javascripts/tom-select-rails/cjs/types/settings.js +3 -0
  85. data/vendor/assets/javascripts/tom-select-rails/cjs/types/settings.js.map +1 -0
  86. data/vendor/assets/javascripts/tom-select-rails/{types → cjs}/utils.d.ts +16 -4
  87. data/vendor/assets/javascripts/tom-select-rails/cjs/utils.js +124 -112
  88. data/vendor/assets/javascripts/tom-select-rails/cjs/utils.js.map +1 -1
  89. data/vendor/assets/javascripts/tom-select-rails/{types → cjs}/vanilla.d.ts +1 -1
  90. data/vendor/assets/javascripts/tom-select-rails/cjs/vanilla.js +190 -0
  91. data/vendor/assets/javascripts/tom-select-rails/cjs/vanilla.js.map +1 -0
  92. data/vendor/assets/javascripts/tom-select-rails/esm/constants.d.ts +12 -0
  93. data/vendor/assets/javascripts/tom-select-rails/esm/constants.js +13 -0
  94. data/vendor/assets/javascripts/tom-select-rails/esm/constants.js.map +1 -0
  95. data/vendor/assets/javascripts/tom-select-rails/esm/contrib/highlight.d.ts +13 -0
  96. data/vendor/assets/javascripts/tom-select-rails/esm/contrib/highlight.js +64 -0
  97. data/vendor/assets/javascripts/tom-select-rails/esm/contrib/highlight.js.map +1 -0
  98. data/vendor/assets/javascripts/tom-select-rails/esm/contrib/microevent.d.ts +20 -0
  99. data/vendor/assets/javascripts/tom-select-rails/esm/contrib/microevent.js +61 -0
  100. data/vendor/assets/javascripts/tom-select-rails/esm/contrib/microevent.js.map +1 -0
  101. data/vendor/assets/javascripts/tom-select-rails/esm/contrib/microplugin.d.ts +71 -0
  102. data/vendor/assets/javascripts/tom-select-rails/esm/contrib/microplugin.js +109 -0
  103. data/vendor/assets/javascripts/tom-select-rails/esm/contrib/microplugin.js.map +1 -0
  104. data/vendor/assets/javascripts/tom-select-rails/esm/defaults.d.ts +52 -0
  105. data/vendor/assets/javascripts/tom-select-rails/esm/defaults.js +82 -0
  106. data/vendor/assets/javascripts/tom-select-rails/esm/defaults.js.map +1 -0
  107. data/vendor/assets/javascripts/tom-select-rails/esm/getSettings.d.ts +3 -0
  108. data/vendor/assets/javascripts/tom-select-rails/esm/getSettings.js +143 -0
  109. data/vendor/assets/javascripts/tom-select-rails/esm/getSettings.js.map +1 -0
  110. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/caret_position/plugin.d.ts +16 -0
  111. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/caret_position/plugin.js +16 -63
  112. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/caret_position/plugin.js.map +1 -1
  113. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/change_listener/plugin.d.ts +16 -0
  114. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/change_listener/plugin.js +1 -1
  115. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/change_listener/plugin.js.map +1 -1
  116. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/checkbox_options/plugin.d.ts +17 -0
  117. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/checkbox_options/plugin.js +1 -63
  118. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/checkbox_options/plugin.js.map +1 -1
  119. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/checkbox_options/types.d.ts +14 -0
  120. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/checkbox_options/types.js +2 -0
  121. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/checkbox_options/types.js.map +1 -0
  122. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/clear_button/plugin.d.ts +17 -0
  123. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/clear_button/plugin.js +4 -64
  124. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/clear_button/plugin.js.map +1 -1
  125. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/clear_button/types.d.ts +7 -0
  126. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/clear_button/types.js +2 -0
  127. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/clear_button/types.js.map +1 -0
  128. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/drag_drop/plugin.d.ts +16 -0
  129. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/drag_drop/plugin.js +1 -63
  130. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/drag_drop/plugin.js.map +1 -1
  131. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_header/plugin.d.ts +17 -0
  132. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_header/plugin.js +26 -88
  133. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_header/plugin.js.map +1 -1
  134. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_header/types.d.ts +8 -0
  135. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_header/types.js +2 -0
  136. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_header/types.js.map +1 -0
  137. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_input/plugin.d.ts +16 -0
  138. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_input/plugin.js +34 -96
  139. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_input/plugin.js.map +1 -1
  140. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/input_autogrow/plugin.d.ts +15 -0
  141. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/input_autogrow/plugin.js +1 -1
  142. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/input_autogrow/plugin.js.map +1 -1
  143. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/no_active_items/plugin.d.ts +15 -0
  144. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/no_active_items/plugin.js +1 -1
  145. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/no_active_items/plugin.js.map +1 -1
  146. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/no_backspace_delete/plugin.d.ts +15 -0
  147. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/no_backspace_delete/plugin.js +1 -1
  148. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/no_backspace_delete/plugin.js.map +1 -1
  149. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/optgroup_columns/plugin.d.ts +16 -0
  150. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/optgroup_columns/plugin.js +1 -66
  151. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/optgroup_columns/plugin.js.map +1 -1
  152. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/remove_button/plugin.d.ts +17 -0
  153. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/remove_button/plugin.js +28 -90
  154. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/remove_button/plugin.js.map +1 -1
  155. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/remove_button/types.d.ts +6 -0
  156. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/remove_button/types.js +2 -0
  157. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/remove_button/types.js.map +1 -0
  158. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/restore_on_backspace/plugin.d.ts +21 -0
  159. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/restore_on_backspace/plugin.js +1 -1
  160. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/restore_on_backspace/plugin.js.map +1 -1
  161. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/virtual_scroll/plugin.d.ts +16 -0
  162. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/virtual_scroll/plugin.js +16 -63
  163. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/virtual_scroll/plugin.js.map +1 -1
  164. data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.complete.d.ts +2 -0
  165. data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.complete.js +17 -5275
  166. data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.complete.js.map +1 -1
  167. data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.d.ts +594 -0
  168. data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.js +2123 -4251
  169. data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.js.map +1 -1
  170. data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.popular.d.ts +2 -0
  171. data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.popular.js +8 -4658
  172. data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.popular.js.map +1 -1
  173. data/vendor/assets/javascripts/tom-select-rails/esm/types/core.d.ts +49 -0
  174. data/vendor/assets/javascripts/tom-select-rails/esm/types/core.js +2 -0
  175. data/vendor/assets/javascripts/tom-select-rails/esm/types/core.js.map +1 -0
  176. data/vendor/assets/javascripts/tom-select-rails/esm/types/index.d.ts +2 -0
  177. data/vendor/assets/javascripts/tom-select-rails/esm/types/index.js +3 -0
  178. data/vendor/assets/javascripts/tom-select-rails/esm/types/index.js.map +1 -0
  179. data/vendor/assets/javascripts/tom-select-rails/esm/types/settings.d.ts +79 -0
  180. data/vendor/assets/javascripts/tom-select-rails/esm/types/settings.js +2 -0
  181. data/vendor/assets/javascripts/tom-select-rails/esm/types/settings.js.map +1 -0
  182. data/vendor/assets/javascripts/tom-select-rails/esm/utils.d.ts +95 -0
  183. data/vendor/assets/javascripts/tom-select-rails/esm/utils.js +116 -107
  184. data/vendor/assets/javascripts/tom-select-rails/esm/utils.js.map +1 -1
  185. data/vendor/assets/javascripts/tom-select-rails/esm/vanilla.d.ts +76 -0
  186. data/vendor/assets/javascripts/tom-select-rails/esm/vanilla.js +172 -0
  187. data/vendor/assets/javascripts/tom-select-rails/esm/vanilla.js.map +1 -0
  188. data/vendor/assets/javascripts/tom-select-rails/js/package.json +1 -0
  189. data/vendor/assets/javascripts/tom-select-rails/js/plugins/caret_position.js +161 -208
  190. data/vendor/assets/javascripts/tom-select-rails/js/plugins/caret_position.js.map +1 -1
  191. data/vendor/assets/javascripts/tom-select-rails/js/plugins/change_listener.js +1 -1
  192. data/vendor/assets/javascripts/tom-select-rails/js/plugins/change_listener.js.map +1 -1
  193. data/vendor/assets/javascripts/tom-select-rails/js/plugins/checkbox_options.js +1 -63
  194. data/vendor/assets/javascripts/tom-select-rails/js/plugins/checkbox_options.js.map +1 -1
  195. data/vendor/assets/javascripts/tom-select-rails/js/plugins/clear_button.js +70 -130
  196. data/vendor/assets/javascripts/tom-select-rails/js/plugins/clear_button.js.map +1 -1
  197. data/vendor/assets/javascripts/tom-select-rails/js/plugins/drag_drop.js +1 -63
  198. data/vendor/assets/javascripts/tom-select-rails/js/plugins/drag_drop.js.map +1 -1
  199. data/vendor/assets/javascripts/tom-select-rails/js/plugins/dropdown_header.js +95 -157
  200. data/vendor/assets/javascripts/tom-select-rails/js/plugins/dropdown_header.js.map +1 -1
  201. data/vendor/assets/javascripts/tom-select-rails/js/plugins/dropdown_input.js +212 -274
  202. data/vendor/assets/javascripts/tom-select-rails/js/plugins/dropdown_input.js.map +1 -1
  203. data/vendor/assets/javascripts/tom-select-rails/js/plugins/input_autogrow.js +1 -1
  204. data/vendor/assets/javascripts/tom-select-rails/js/plugins/input_autogrow.js.map +1 -1
  205. data/vendor/assets/javascripts/tom-select-rails/js/plugins/no_active_items.js +1 -1
  206. data/vendor/assets/javascripts/tom-select-rails/js/plugins/no_active_items.js.map +1 -1
  207. data/vendor/assets/javascripts/tom-select-rails/js/plugins/no_backspace_delete.js +1 -1
  208. data/vendor/assets/javascripts/tom-select-rails/js/plugins/no_backspace_delete.js.map +1 -1
  209. data/vendor/assets/javascripts/tom-select-rails/js/plugins/optgroup_columns.js +79 -144
  210. data/vendor/assets/javascripts/tom-select-rails/js/plugins/optgroup_columns.js.map +1 -1
  211. data/vendor/assets/javascripts/tom-select-rails/js/plugins/remove_button.js +132 -194
  212. data/vendor/assets/javascripts/tom-select-rails/js/plugins/remove_button.js.map +1 -1
  213. data/vendor/assets/javascripts/tom-select-rails/js/plugins/restore_on_backspace.js +1 -1
  214. data/vendor/assets/javascripts/tom-select-rails/js/plugins/restore_on_backspace.js.map +1 -1
  215. data/vendor/assets/javascripts/tom-select-rails/js/plugins/virtual_scroll.js +248 -295
  216. data/vendor/assets/javascripts/tom-select-rails/js/plugins/virtual_scroll.js.map +1 -1
  217. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.base.js +835 -1106
  218. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.base.js.map +1 -1
  219. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.base.min.js +176 -173
  220. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.base.min.js.map +1 -1
  221. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.complete.js +838 -1107
  222. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.complete.js.map +1 -1
  223. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.complete.min.js +357 -354
  224. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.complete.min.js.map +1 -1
  225. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.popular.js +835 -1106
  226. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.popular.js.map +1 -1
  227. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.popular.min.js +336 -333
  228. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.popular.min.js.map +1 -1
  229. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap4.css +16 -13
  230. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap4.css.map +1 -1
  231. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap4.min.css +1 -1
  232. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap4.min.css.map +1 -1
  233. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap5.css +15 -12
  234. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap5.css.map +1 -1
  235. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap5.min.css +1 -1
  236. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap5.min.css.map +1 -1
  237. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.css +11 -10
  238. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.css.map +1 -1
  239. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.default.css +7 -6
  240. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.default.css.map +1 -1
  241. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.default.min.css +1 -1
  242. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.default.min.css.map +1 -1
  243. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.min.css +1 -1
  244. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.min.css.map +1 -1
  245. data/vendor/assets/stylesheets/tom-select-rails/scss/_items.scss +6 -4
  246. data/vendor/assets/stylesheets/tom-select-rails/scss/tom-select.default.scss +1 -1
  247. data/vendor/assets/stylesheets/tom-select-rails/scss/tom-select.scss +6 -6
  248. metadata +153 -39
  249. data/vendor/assets/javascripts/tom-select-rails/types/tom-select.complete.d.ts +0 -2
  250. data/vendor/assets/javascripts/tom-select-rails/types/tom-select.popular.d.ts +0 -2
  251. data/vendor/assets/javascripts/tom-select-rails/types/types/index.d.ts +0 -2
  252. /data/vendor/assets/javascripts/tom-select-rails/{types → cjs}/constants.d.ts +0 -0
  253. /data/vendor/assets/javascripts/tom-select-rails/{types → cjs}/contrib/highlight.d.ts +0 -0
  254. /data/vendor/assets/javascripts/tom-select-rails/{types → cjs}/contrib/microevent.d.ts +0 -0
  255. /data/vendor/assets/javascripts/tom-select-rails/{types → cjs}/contrib/microplugin.d.ts +0 -0
  256. /data/vendor/assets/javascripts/tom-select-rails/{types → cjs}/defaults.d.ts +0 -0
  257. /data/vendor/assets/javascripts/tom-select-rails/{types → cjs}/plugins/checkbox_options/types.d.ts +0 -0
  258. /data/vendor/assets/javascripts/tom-select-rails/{types → cjs}/plugins/dropdown_header/types.d.ts +0 -0
  259. /data/vendor/assets/javascripts/tom-select-rails/{types → cjs}/plugins/remove_button/types.d.ts +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../src/plugins/no_active_items/plugin.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;AAIH,4BAGC;AAHD;IACC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,eAAe,EAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAC9C,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,WAAW,EAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;AAC3C,CAAC;AAAA,CAAC"}
@@ -11,5 +11,5 @@
11
11
  * governing permissions and limitations under the License.
12
12
  *
13
13
  */
14
- import TomSelect from '../../tom-select';
14
+ import type TomSelect from '../../tom-select.ts';
15
15
  export default function (this: TomSelect): void;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ /**
3
+ * Plugin: "input_autogrow" (Tom Select)
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
6
+ * file except in compliance with the License. You may obtain a copy of the License at:
7
+ * http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software distributed under
10
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11
+ * ANY KIND, either express or implied. See the License for the specific language
12
+ * governing permissions and limitations under the License.
13
+ *
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.default = default_1;
17
+ function default_1() {
18
+ var self = this;
19
+ var orig_deleteSelection = self.deleteSelection;
20
+ this.hook('instead', 'deleteSelection', (evt) => {
21
+ if (self.activeItems.length) {
22
+ return orig_deleteSelection.call(self, evt);
23
+ }
24
+ return false;
25
+ });
26
+ }
27
+ ;
28
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../src/plugins/no_backspace_delete/plugin.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;AAIH,4BAaC;AAbD;IACC,IAAI,IAAI,GAAG,IAAI,CAAC;IAChB,IAAI,oBAAoB,GAAG,IAAI,CAAC,eAAe,CAAC;IAEhD,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,iBAAiB,EAAC,CAAC,GAAiB,EAAE,EAAE;QAE3D,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;YAC7B,OAAO,oBAAoB,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAC7C,CAAC;QAED,OAAO,KAAK,CAAC;IACd,CAAC,CAAC,CAAC;AAEJ,CAAC;AAAA,CAAC"}
@@ -12,5 +12,5 @@
12
12
  * governing permissions and limitations under the License.
13
13
  *
14
14
  */
15
- import TomSelect from '../../tom-select';
15
+ import type TomSelect from '../../tom-select.ts';
16
16
  export default function (this: TomSelect): void;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ /**
3
+ * Plugin: "optgroup_columns" (Tom Select.js)
4
+ * Copyright (c) contributors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
7
+ * file except in compliance with the License. You may obtain a copy of the License at:
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software distributed under
11
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
+ * ANY KIND, either express or implied. See the License for the specific language
13
+ * governing permissions and limitations under the License.
14
+ *
15
+ */
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.default = default_1;
18
+ const constants = require("../../constants.js");
19
+ const vanilla_ts_1 = require("../../vanilla.js");
20
+ function default_1() {
21
+ var self = this;
22
+ var orig_keydown = self.onKeyDown;
23
+ self.hook('instead', 'onKeyDown', (evt) => {
24
+ var index, option, options, optgroup;
25
+ if (!self.isOpen || !(evt.keyCode === constants.KEY_LEFT || evt.keyCode === constants.KEY_RIGHT)) {
26
+ return orig_keydown.call(self, evt);
27
+ }
28
+ self.ignoreHover = true;
29
+ optgroup = (0, vanilla_ts_1.parentMatch)(self.activeOption, '[data-group]');
30
+ index = (0, vanilla_ts_1.nodeIndex)(self.activeOption, '[data-selectable]');
31
+ if (!optgroup) {
32
+ return;
33
+ }
34
+ if (evt.keyCode === constants.KEY_LEFT) {
35
+ optgroup = optgroup.previousSibling;
36
+ }
37
+ else {
38
+ optgroup = optgroup.nextSibling;
39
+ }
40
+ if (!optgroup) {
41
+ return;
42
+ }
43
+ options = optgroup.querySelectorAll('[data-selectable]');
44
+ option = options[Math.min(options.length - 1, index)];
45
+ if (option) {
46
+ self.setActiveOption(option);
47
+ }
48
+ });
49
+ }
50
+ ;
51
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../src/plugins/optgroup_columns/plugin.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;AAMH,4BAuCC;AA1CD,gDAAgD;AAChD,iDAA0D;AAE1D;IACC,IAAI,IAAI,GAAG,IAAI,CAAC;IAEhB,IAAI,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC;IAElC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,WAAW,EAAC,CAAC,GAAiB,EAAC,EAAE;QACpD,IAAI,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC;QAErC,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,QAAQ,IAAI,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC;YAClG,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,EAAC,GAAG,CAAC,CAAC;QACpC,CAAC;QAED,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,QAAQ,GAAK,IAAA,wBAAW,EAAC,IAAI,CAAC,YAAY,EAAC,cAAc,CAAC,CAAC;QAC3D,KAAK,GAAM,IAAA,sBAAS,EAAC,IAAI,CAAC,YAAY,EAAC,mBAAmB,CAAC,CAAC;QAE5D,IAAI,CAAC,QAAQ,EAAE,CAAC;YACf,OAAO;QACR,CAAC;QAED,IAAI,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,QAAQ,EAAE,CAAC;YACxC,QAAQ,GAAG,QAAQ,CAAC,eAAe,CAAC;QACrC,CAAC;aAAM,CAAC;YACP,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC;QACjC,CAAC;QAED,IAAI,CAAC,QAAQ,EAAE,CAAC;YACf,OAAO;QACR,CAAC;QAED,OAAO,GAA4B,QAAS,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,CAAC;QACnF,MAAM,GAAM,OAAO,CAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,CAAC,CAAiB,CAAC;QAE1E,IAAI,MAAM,EAAE,CAAC;YACZ,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAC9B,CAAC;IAEF,CAAC,CAAC,CAAC;AAEJ,CAAC;AAAA,CAAC"}
@@ -12,6 +12,6 @@
12
12
  * governing permissions and limitations under the License.
13
13
  *
14
14
  */
15
- import TomSelect from '../../tom-select';
16
- import { RBOptions } from './types';
15
+ import type TomSelect from '../../tom-select.ts';
16
+ import { RBOptions } from './types.ts';
17
17
  export default function (this: TomSelect, userOptions: RBOptions): void;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ /**
3
+ * Plugin: "remove_button" (Tom Select)
4
+ * Copyright (c) contributors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
7
+ * file except in compliance with the License. You may obtain a copy of the License at:
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software distributed under
11
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
+ * ANY KIND, either express or implied. See the License for the specific language
13
+ * governing permissions and limitations under the License.
14
+ *
15
+ */
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.default = default_1;
18
+ const vanilla_ts_1 = require("../../vanilla.js");
19
+ const utils_ts_1 = require("../../utils.js");
20
+ function default_1(userOptions) {
21
+ const options = Object.assign({
22
+ label: '×',
23
+ title: 'Remove',
24
+ className: 'remove',
25
+ append: true
26
+ }, userOptions);
27
+ //options.className = 'remove-single';
28
+ var self = this;
29
+ // override the render method to add remove button to each item
30
+ if (!options.append) {
31
+ return;
32
+ }
33
+ var html = '<a href="javascript:void(0)" class="' + options.className + '" tabindex="-1" title="' + (0, utils_ts_1.escape_html)(options.title) + '">' + options.label + '</a>';
34
+ self.hook('after', 'setupTemplates', () => {
35
+ var orig_render_item = self.settings.render.item;
36
+ self.settings.render.item = (data, escape) => {
37
+ var item = (0, vanilla_ts_1.getDom)(orig_render_item.call(self, data, escape));
38
+ var close_button = (0, vanilla_ts_1.getDom)(html);
39
+ item.appendChild(close_button);
40
+ (0, utils_ts_1.addEvent)(close_button, 'mousedown', (evt) => {
41
+ (0, utils_ts_1.preventDefault)(evt, true);
42
+ });
43
+ (0, utils_ts_1.addEvent)(close_button, 'click', (evt) => {
44
+ if (self.isLocked)
45
+ return;
46
+ // propagating will trigger the dropdown to show for single mode
47
+ (0, utils_ts_1.preventDefault)(evt, true);
48
+ if (self.isLocked)
49
+ return;
50
+ if (!self.shouldDelete([item], evt))
51
+ return;
52
+ self.removeItem(item);
53
+ self.refreshOptions(false);
54
+ self.inputState();
55
+ });
56
+ return item;
57
+ };
58
+ });
59
+ }
60
+ ;
61
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../src/plugins/remove_button/plugin.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;AAQH,4BAwDC;AA7DD,iDAA0C;AAC1C,6CAA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IAAI,CAAC,QAAQ;oBAAG,OAAO;gBAE3B,gEAAgE;gBAChE,IAAA,yBAAc,EAAC,GAAG,EAAC,IAAI,CAAC,CAAC;gBAEzB,IAAI,IAAI,CAAC,QAAQ;oBAAG,OAAO;gBAC3B,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,EAAC,GAAiB,CAAC;oBAAG,OAAO;gBAE1D,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;gBACtB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;gBAC3B,IAAI,CAAC,UAAU,EAAE,CAAC;YACnB,CAAC,CAAC,CAAC;YAEH,OAAO,IAAI,CAAC;QACb,CAAC,CAAC;IAEH,CAAC,CAAC,CAAC;AAGJ,CAAC;AAAA,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/plugins/remove_button/types.ts"],"names":[],"mappings":""}
@@ -12,8 +12,8 @@
12
12
  * governing permissions and limitations under the License.
13
13
  *
14
14
  */
15
- import TomSelect from '../../tom-select';
16
- import { TomOption } from '../../types/index';
15
+ import type TomSelect from '../../tom-select.ts';
16
+ import { TomOption } from '../../types/index.ts';
17
17
  type TPluginOptions = {
18
18
  text?: (option: TomOption) => string;
19
19
  };
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = default_1;
4
+ function default_1(userOptions) {
5
+ const self = this;
6
+ const options = Object.assign({
7
+ text: (option) => {
8
+ return option[self.settings.labelField];
9
+ }
10
+ }, userOptions);
11
+ self.on('item_remove', function (value) {
12
+ if (!self.isFocused) {
13
+ return;
14
+ }
15
+ if (self.control_input.value.trim() === '') {
16
+ var option = self.options[value];
17
+ if (option) {
18
+ self.setTextboxValue(options.text.call(self, option));
19
+ }
20
+ }
21
+ });
22
+ }
23
+ ;
24
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../src/plugins/restore_on_backspace/plugin.ts"],"names":[],"mappings":";;AAqBA,4BAsBC;AAtBD,mBAAwC,WAA0B;IACjE,MAAM,IAAI,GAAG,IAAI,CAAC;IAElB,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC;QAC7B,IAAI,EAAE,CAAC,MAAgB,EAAE,EAAE;YAC1B,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;QACzC,CAAC;KACD,EAAC,WAAW,CAAC,CAAC;IAEf,IAAI,CAAC,EAAE,CAAC,aAAa,EAAC,UAAS,KAAY;QAC1C,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;YACrB,OAAO;QACR,CAAC;QAED,IAAI,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YAC5C,IAAI,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACjC,IAAI,MAAM,EAAE,CAAC;gBACZ,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;YACvD,CAAC;QACF,CAAC;IACF,CAAC,CAAC,CAAC;AAEJ,CAAC;AAAA,CAAC"}
@@ -12,5 +12,5 @@
12
12
  * governing permissions and limitations under the License.
13
13
  *
14
14
  */
15
- import TomSelect from '../../tom-select';
15
+ import type TomSelect from '../../tom-select.ts';
16
16
  export default function (this: TomSelect): void;
@@ -0,0 +1,170 @@
1
+ "use strict";
2
+ /**
3
+ * Plugin: "restore_on_backspace" (Tom Select)
4
+ * Copyright (c) contributors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
7
+ * file except in compliance with the License. You may obtain a copy of the License at:
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software distributed under
11
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
+ * ANY KIND, either express or implied. See the License for the specific language
13
+ * governing permissions and limitations under the License.
14
+ *
15
+ */
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.default = default_1;
18
+ const vanilla_ts_1 = require("../../vanilla.js");
19
+ function default_1() {
20
+ const self = this;
21
+ const orig_canLoad = self.canLoad;
22
+ const orig_clearActiveOption = self.clearActiveOption;
23
+ const orig_loadCallback = self.loadCallback;
24
+ var pagination = {};
25
+ var dropdown_content;
26
+ var loading_more = false;
27
+ var load_more_opt;
28
+ var default_values = [];
29
+ if (!self.settings.shouldLoadMore) {
30
+ // return true if additional results should be loaded
31
+ self.settings.shouldLoadMore = () => {
32
+ const scroll_percent = dropdown_content.clientHeight / (dropdown_content.scrollHeight - dropdown_content.scrollTop);
33
+ if (scroll_percent > 0.9) {
34
+ return true;
35
+ }
36
+ if (self.activeOption) {
37
+ var selectable = self.selectable();
38
+ var index = Array.from(selectable).indexOf(self.activeOption);
39
+ if (index >= (selectable.length - 2)) {
40
+ return true;
41
+ }
42
+ }
43
+ return false;
44
+ };
45
+ }
46
+ if (!self.settings.firstUrl) {
47
+ throw 'virtual_scroll plugin requires a firstUrl() method';
48
+ }
49
+ // in order for virtual scrolling to work,
50
+ // options need to be ordered the same way they're returned from the remote data source
51
+ self.settings.sortField = [{ field: '$order' }, { field: '$score' }];
52
+ // can we load more results for given query?
53
+ const canLoadMore = (query) => {
54
+ if (typeof self.settings.maxOptions === 'number' && dropdown_content.children.length >= self.settings.maxOptions) {
55
+ return false;
56
+ }
57
+ if ((query in pagination) && pagination[query]) {
58
+ return true;
59
+ }
60
+ return false;
61
+ };
62
+ const clearFilter = (option, value) => {
63
+ if (self.items.indexOf(value) >= 0 || default_values.indexOf(value) >= 0) {
64
+ return true;
65
+ }
66
+ return false;
67
+ };
68
+ // set the next url that will be
69
+ self.setNextUrl = (value, next_url) => {
70
+ pagination[value] = next_url;
71
+ };
72
+ // getUrl() to be used in settings.load()
73
+ self.getUrl = (query) => {
74
+ if (query in pagination) {
75
+ const next_url = pagination[query];
76
+ pagination[query] = false;
77
+ return next_url;
78
+ }
79
+ // if the user goes back to a previous query
80
+ // we need to load the first page again
81
+ self.clearPagination();
82
+ return self.settings.firstUrl.call(self, query);
83
+ };
84
+ // clear pagination
85
+ self.clearPagination = () => {
86
+ pagination = {};
87
+ };
88
+ // don't clear the active option (and cause unwanted dropdown scroll)
89
+ // while loading more results
90
+ self.hook('instead', 'clearActiveOption', () => {
91
+ if (loading_more) {
92
+ return;
93
+ }
94
+ return orig_clearActiveOption.call(self);
95
+ });
96
+ // override the canLoad method
97
+ self.hook('instead', 'canLoad', (query) => {
98
+ // first time the query has been seen
99
+ if (!(query in pagination)) {
100
+ return orig_canLoad.call(self, query);
101
+ }
102
+ return canLoadMore(query);
103
+ });
104
+ // wrap the load
105
+ self.hook('instead', 'loadCallback', (options, optgroups) => {
106
+ if (!loading_more) {
107
+ self.clearOptions(clearFilter);
108
+ }
109
+ else if (load_more_opt) {
110
+ const first_option = options[0];
111
+ if (first_option !== undefined) {
112
+ load_more_opt.dataset.value = first_option[self.settings.valueField];
113
+ }
114
+ }
115
+ orig_loadCallback.call(self, options, optgroups);
116
+ loading_more = false;
117
+ });
118
+ // add templates to dropdown
119
+ // loading_more if we have another url in the queue
120
+ // no_more_results if we don't have another url in the queue
121
+ self.hook('after', 'refreshOptions', () => {
122
+ const query = self.lastValue;
123
+ var option;
124
+ if (canLoadMore(query)) {
125
+ option = self.render('loading_more', { query: query });
126
+ if (option) {
127
+ option.setAttribute('data-selectable', ''); // so that navigating dropdown with [down] keypresses can navigate to this node
128
+ load_more_opt = option;
129
+ }
130
+ }
131
+ else if ((query in pagination) && !dropdown_content.querySelector('.no-results')) {
132
+ option = self.render('no_more_results', { query: query });
133
+ }
134
+ if (option) {
135
+ (0, vanilla_ts_1.addClasses)(option, self.settings.optionClass);
136
+ dropdown_content.append(option);
137
+ }
138
+ });
139
+ // add scroll listener and default templates
140
+ self.on('initialize', () => {
141
+ default_values = Object.keys(self.options);
142
+ dropdown_content = self.dropdown_content;
143
+ // default templates
144
+ self.settings.render = Object.assign({}, {
145
+ loading_more: () => {
146
+ return `<div class="loading-more-results">Loading more results ... </div>`;
147
+ },
148
+ no_more_results: () => {
149
+ return `<div class="no-more-results">No more results</div>`;
150
+ }
151
+ }, self.settings.render);
152
+ // watch dropdown content scroll position
153
+ dropdown_content.addEventListener('scroll', () => {
154
+ if (!self.settings.shouldLoadMore.call(self)) {
155
+ return;
156
+ }
157
+ // !important: this will get checked again in load() but we still need to check here otherwise loading_more will be set to true
158
+ if (!canLoadMore(self.lastValue)) {
159
+ return;
160
+ }
161
+ // don't call load() too much
162
+ if (loading_more)
163
+ return;
164
+ loading_more = true;
165
+ self.load.call(self, self.lastValue);
166
+ });
167
+ });
168
+ }
169
+ ;
170
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../src/plugins/virtual_scroll/plugin.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;AAMH,4BAuMC;AAzMD,iDAA8C;AAE9C;IACC,MAAM,IAAI,GAAS,IAAI,CAAC;IACxB,MAAM,YAAY,GAAO,IAAI,CAAC,OAAO,CAAC;IACtC,MAAM,sBAAsB,GAAI,IAAI,CAAC,iBAAiB,CAAC;IACvD,MAAM,iBAAiB,GAAM,IAAI,CAAC,YAAY,CAAC;IAE/C,IAAI,UAAU,GAAsB,EAAE,CAAC;IACvC,IAAI,gBAA4B,CAAC;IACjC,IAAI,YAAY,GAAO,KAAK,CAAC;IAC7B,IAAI,aAAyB,CAAC;IAC9B,IAAI,cAAc,GAAc,EAAE,CAAC;IAEnC,IAAI,CAAC,IAAI,CAAC,QAAQ,C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