tom-select-rails 2.2.2 → 2.4.3

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 (297) 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.d.ts +12 -0
  4. data/vendor/assets/javascripts/tom-select-rails/cjs/constants.js +16 -0
  5. data/vendor/assets/javascripts/tom-select-rails/cjs/constants.js.map +1 -0
  6. data/vendor/assets/javascripts/tom-select-rails/cjs/contrib/highlight.d.ts +13 -0
  7. data/vendor/assets/javascripts/tom-select-rails/cjs/contrib/highlight.js +69 -0
  8. data/vendor/assets/javascripts/tom-select-rails/cjs/contrib/highlight.js.map +1 -0
  9. data/vendor/assets/javascripts/tom-select-rails/cjs/contrib/microevent.d.ts +20 -0
  10. data/vendor/assets/javascripts/tom-select-rails/cjs/contrib/microevent.js +64 -0
  11. data/vendor/assets/javascripts/tom-select-rails/cjs/contrib/microevent.js.map +1 -0
  12. data/vendor/assets/javascripts/tom-select-rails/cjs/contrib/microplugin.d.ts +71 -0
  13. data/vendor/assets/javascripts/tom-select-rails/cjs/contrib/microplugin.js +112 -0
  14. data/vendor/assets/javascripts/tom-select-rails/cjs/contrib/microplugin.js.map +1 -0
  15. data/vendor/assets/javascripts/tom-select-rails/cjs/defaults.d.ts +52 -0
  16. data/vendor/assets/javascripts/tom-select-rails/cjs/defaults.js +84 -0
  17. data/vendor/assets/javascripts/tom-select-rails/cjs/defaults.js.map +1 -0
  18. data/vendor/assets/javascripts/tom-select-rails/cjs/getSettings.d.ts +3 -0
  19. data/vendor/assets/javascripts/tom-select-rails/cjs/getSettings.js +146 -0
  20. data/vendor/assets/javascripts/tom-select-rails/cjs/getSettings.js.map +1 -0
  21. data/vendor/assets/javascripts/tom-select-rails/cjs/package.json +1 -0
  22. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/caret_position/plugin.d.ts +16 -0
  23. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/caret_position/plugin.js +66 -0
  24. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/caret_position/plugin.js.map +1 -0
  25. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/change_listener/plugin.d.ts +16 -0
  26. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/change_listener/plugin.js +25 -0
  27. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/change_listener/plugin.js.map +1 -0
  28. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/checkbox_options/plugin.d.ts +17 -0
  29. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/checkbox_options/plugin.js +108 -0
  30. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/checkbox_options/plugin.js.map +1 -0
  31. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/checkbox_options/types.d.ts +14 -0
  32. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/checkbox_options/types.js +3 -0
  33. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/checkbox_options/types.js.map +1 -0
  34. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/clear_button/plugin.d.ts +17 -0
  35. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/clear_button/plugin.js +44 -0
  36. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/clear_button/plugin.js.map +1 -0
  37. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/clear_button/types.d.ts +5 -0
  38. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/clear_button/types.js +3 -0
  39. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/clear_button/types.js.map +1 -0
  40. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/drag_drop/plugin.d.ts +16 -0
  41. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/drag_drop/plugin.js +117 -0
  42. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/drag_drop/plugin.js.map +1 -0
  43. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/dropdown_header/plugin.d.ts +17 -0
  44. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/dropdown_header/plugin.js +50 -0
  45. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/dropdown_header/plugin.js.map +1 -0
  46. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/dropdown_header/types.d.ts +8 -0
  47. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/dropdown_header/types.js +3 -0
  48. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/dropdown_header/types.js.map +1 -0
  49. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/dropdown_input/plugin.d.ts +16 -0
  50. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/dropdown_input/plugin.js +77 -0
  51. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/dropdown_input/plugin.js.map +1 -0
  52. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/input_autogrow/plugin.d.ts +15 -0
  53. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/input_autogrow/plugin.js +47 -0
  54. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/input_autogrow/plugin.js.map +1 -0
  55. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/no_active_items/plugin.d.ts +15 -0
  56. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/no_active_items/plugin.js +22 -0
  57. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/no_active_items/plugin.js.map +1 -0
  58. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/no_backspace_delete/plugin.d.ts +15 -0
  59. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/no_backspace_delete/plugin.js +28 -0
  60. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/no_backspace_delete/plugin.js.map +1 -0
  61. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/optgroup_columns/plugin.d.ts +16 -0
  62. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/optgroup_columns/plugin.js +51 -0
  63. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/optgroup_columns/plugin.js.map +1 -0
  64. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/remove_button/plugin.d.ts +17 -0
  65. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/remove_button/plugin.js +61 -0
  66. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/remove_button/plugin.js.map +1 -0
  67. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/remove_button/types.d.ts +6 -0
  68. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/remove_button/types.js +3 -0
  69. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/remove_button/types.js.map +1 -0
  70. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/restore_on_backspace/plugin.d.ts +21 -0
  71. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/restore_on_backspace/plugin.js +24 -0
  72. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/restore_on_backspace/plugin.js.map +1 -0
  73. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/virtual_scroll/plugin.d.ts +16 -0
  74. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/virtual_scroll/plugin.js +170 -0
  75. data/vendor/assets/javascripts/tom-select-rails/cjs/plugins/virtual_scroll/plugin.js.map +1 -0
  76. data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.complete.d.ts +2 -0
  77. data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.complete.js +33 -5497
  78. data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.complete.js.map +1 -1
  79. data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.d.ts +594 -0
  80. data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.js +2147 -4555
  81. data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.js.map +1 -1
  82. data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.popular.d.ts +2 -0
  83. data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.popular.js +15 -4934
  84. data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.popular.js.map +1 -1
  85. data/vendor/assets/javascripts/tom-select-rails/cjs/types/core.d.ts +49 -0
  86. data/vendor/assets/javascripts/tom-select-rails/cjs/types/core.js +3 -0
  87. data/vendor/assets/javascripts/tom-select-rails/cjs/types/core.js.map +1 -0
  88. data/vendor/assets/javascripts/tom-select-rails/cjs/types/index.d.ts +2 -0
  89. data/vendor/assets/javascripts/tom-select-rails/cjs/types/index.js +19 -0
  90. data/vendor/assets/javascripts/tom-select-rails/cjs/types/index.js.map +1 -0
  91. data/vendor/assets/javascripts/tom-select-rails/cjs/types/settings.d.ts +79 -0
  92. data/vendor/assets/javascripts/tom-select-rails/cjs/types/settings.js +3 -0
  93. data/vendor/assets/javascripts/tom-select-rails/cjs/types/settings.js.map +1 -0
  94. data/vendor/assets/javascripts/tom-select-rails/cjs/utils.d.ts +95 -0
  95. data/vendor/assets/javascripts/tom-select-rails/cjs/utils.js +130 -114
  96. data/vendor/assets/javascripts/tom-select-rails/cjs/utils.js.map +1 -1
  97. data/vendor/assets/javascripts/tom-select-rails/cjs/vanilla.d.ts +76 -0
  98. data/vendor/assets/javascripts/tom-select-rails/cjs/vanilla.js +190 -0
  99. data/vendor/assets/javascripts/tom-select-rails/cjs/vanilla.js.map +1 -0
  100. data/vendor/assets/javascripts/tom-select-rails/esm/constants.d.ts +12 -0
  101. data/vendor/assets/javascripts/tom-select-rails/esm/constants.js +13 -0
  102. data/vendor/assets/javascripts/tom-select-rails/esm/constants.js.map +1 -0
  103. data/vendor/assets/javascripts/tom-select-rails/esm/contrib/highlight.d.ts +13 -0
  104. data/vendor/assets/javascripts/tom-select-rails/esm/contrib/highlight.js +64 -0
  105. data/vendor/assets/javascripts/tom-select-rails/esm/contrib/highlight.js.map +1 -0
  106. data/vendor/assets/javascripts/tom-select-rails/esm/contrib/microevent.d.ts +20 -0
  107. data/vendor/assets/javascripts/tom-select-rails/esm/contrib/microevent.js +61 -0
  108. data/vendor/assets/javascripts/tom-select-rails/esm/contrib/microevent.js.map +1 -0
  109. data/vendor/assets/javascripts/tom-select-rails/esm/contrib/microplugin.d.ts +71 -0
  110. data/vendor/assets/javascripts/tom-select-rails/esm/contrib/microplugin.js +109 -0
  111. data/vendor/assets/javascripts/tom-select-rails/esm/contrib/microplugin.js.map +1 -0
  112. data/vendor/assets/javascripts/tom-select-rails/esm/defaults.d.ts +52 -0
  113. data/vendor/assets/javascripts/tom-select-rails/esm/defaults.js +82 -0
  114. data/vendor/assets/javascripts/tom-select-rails/esm/defaults.js.map +1 -0
  115. data/vendor/assets/javascripts/tom-select-rails/esm/getSettings.d.ts +3 -0
  116. data/vendor/assets/javascripts/tom-select-rails/esm/getSettings.js +143 -0
  117. data/vendor/assets/javascripts/tom-select-rails/esm/getSettings.js.map +1 -0
  118. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/caret_position/plugin.d.ts +16 -0
  119. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/caret_position/plugin.js +26 -78
  120. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/caret_position/plugin.js.map +1 -1
  121. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/change_listener/plugin.d.ts +16 -0
  122. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/change_listener/plugin.js +3 -2
  123. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/change_listener/plugin.js.map +1 -1
  124. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/checkbox_options/plugin.d.ts +17 -0
  125. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/checkbox_options/plugin.js +47 -96
  126. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/checkbox_options/plugin.js.map +1 -1
  127. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/checkbox_options/types.d.ts +14 -0
  128. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/checkbox_options/types.js +2 -0
  129. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/checkbox_options/types.js.map +1 -0
  130. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/clear_button/plugin.d.ts +17 -0
  131. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/clear_button/plugin.js +3 -75
  132. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/clear_button/plugin.js.map +1 -1
  133. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/clear_button/types.d.ts +5 -0
  134. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/clear_button/types.js +2 -0
  135. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/clear_button/types.js.map +1 -0
  136. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/drag_drop/plugin.d.ts +16 -0
  137. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/drag_drop/plugin.js +187 -29
  138. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/drag_drop/plugin.js.map +1 -1
  139. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_header/plugin.d.ts +17 -0
  140. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_header/plugin.js +27 -97
  141. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_header/plugin.js.map +1 -1
  142. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_header/types.d.ts +8 -0
  143. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_header/types.js +2 -0
  144. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_header/types.js.map +1 -0
  145. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_input/plugin.d.ts +16 -0
  146. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_input/plugin.js +46 -117
  147. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_input/plugin.js.map +1 -1
  148. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/input_autogrow/plugin.d.ts +15 -0
  149. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/input_autogrow/plugin.js +4 -6
  150. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/input_autogrow/plugin.js.map +1 -1
  151. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/no_active_items/plugin.d.ts +15 -0
  152. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/no_active_items/plugin.js +2 -1
  153. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/no_active_items/plugin.js.map +1 -1
  154. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/no_backspace_delete/plugin.d.ts +15 -0
  155. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/no_backspace_delete/plugin.js +2 -2
  156. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/no_backspace_delete/plugin.js.map +1 -1
  157. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/optgroup_columns/plugin.d.ts +16 -0
  158. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/optgroup_columns/plugin.js +3 -80
  159. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/optgroup_columns/plugin.js.map +1 -1
  160. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/remove_button/plugin.d.ts +17 -0
  161. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/remove_button/plugin.js +38 -104
  162. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/remove_button/plugin.js.map +1 -1
  163. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/remove_button/types.d.ts +6 -0
  164. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/remove_button/types.js +2 -0
  165. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/remove_button/types.js.map +1 -0
  166. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/restore_on_backspace/plugin.d.ts +21 -0
  167. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/restore_on_backspace/plugin.js +2 -3
  168. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/restore_on_backspace/plugin.js.map +1 -1
  169. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/virtual_scroll/plugin.d.ts +16 -0
  170. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/virtual_scroll/plugin.js +56 -112
  171. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/virtual_scroll/plugin.js.map +1 -1
  172. data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.complete.d.ts +2 -0
  173. data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.complete.js +17 -5481
  174. data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.complete.js.map +1 -1
  175. data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.d.ts +594 -0
  176. data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.js +2127 -4536
  177. data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.js.map +1 -1
  178. data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.popular.d.ts +2 -0
  179. data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.popular.js +8 -4927
  180. data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.popular.js.map +1 -1
  181. data/vendor/assets/javascripts/tom-select-rails/esm/types/core.d.ts +49 -0
  182. data/vendor/assets/javascripts/tom-select-rails/esm/types/core.js +2 -0
  183. data/vendor/assets/javascripts/tom-select-rails/esm/types/core.js.map +1 -0
  184. data/vendor/assets/javascripts/tom-select-rails/esm/types/index.d.ts +2 -0
  185. data/vendor/assets/javascripts/tom-select-rails/esm/types/index.js +3 -0
  186. data/vendor/assets/javascripts/tom-select-rails/esm/types/index.js.map +1 -0
  187. data/vendor/assets/javascripts/tom-select-rails/esm/types/settings.d.ts +79 -0
  188. data/vendor/assets/javascripts/tom-select-rails/esm/types/settings.js +2 -0
  189. data/vendor/assets/javascripts/tom-select-rails/esm/types/settings.js.map +1 -0
  190. data/vendor/assets/javascripts/tom-select-rails/esm/utils.d.ts +95 -0
  191. data/vendor/assets/javascripts/tom-select-rails/esm/utils.js +121 -107
  192. data/vendor/assets/javascripts/tom-select-rails/esm/utils.js.map +1 -1
  193. data/vendor/assets/javascripts/tom-select-rails/esm/vanilla.d.ts +76 -0
  194. data/vendor/assets/javascripts/tom-select-rails/esm/vanilla.js +172 -0
  195. data/vendor/assets/javascripts/tom-select-rails/esm/vanilla.js.map +1 -0
  196. data/vendor/assets/javascripts/tom-select-rails/js/package.json +1 -0
  197. data/vendor/assets/javascripts/tom-select-rails/js/plugins/caret_position.js +161 -213
  198. data/vendor/assets/javascripts/tom-select-rails/js/plugins/caret_position.js.map +1 -1
  199. data/vendor/assets/javascripts/tom-select-rails/js/plugins/change_listener.js +3 -2
  200. data/vendor/assets/javascripts/tom-select-rails/js/plugins/change_listener.js.map +1 -1
  201. data/vendor/assets/javascripts/tom-select-rails/js/plugins/checkbox_options.js +47 -96
  202. data/vendor/assets/javascripts/tom-select-rails/js/plugins/checkbox_options.js.map +1 -1
  203. data/vendor/assets/javascripts/tom-select-rails/js/plugins/clear_button.js +71 -143
  204. data/vendor/assets/javascripts/tom-select-rails/js/plugins/clear_button.js.map +1 -1
  205. data/vendor/assets/javascripts/tom-select-rails/js/plugins/drag_drop.js +187 -29
  206. data/vendor/assets/javascripts/tom-select-rails/js/plugins/drag_drop.js.map +1 -1
  207. data/vendor/assets/javascripts/tom-select-rails/js/plugins/dropdown_header.js +100 -170
  208. data/vendor/assets/javascripts/tom-select-rails/js/plugins/dropdown_header.js.map +1 -1
  209. data/vendor/assets/javascripts/tom-select-rails/js/plugins/dropdown_input.js +212 -283
  210. data/vendor/assets/javascripts/tom-select-rails/js/plugins/dropdown_input.js.map +1 -1
  211. data/vendor/assets/javascripts/tom-select-rails/js/plugins/input_autogrow.js +4 -6
  212. data/vendor/assets/javascripts/tom-select-rails/js/plugins/input_autogrow.js.map +1 -1
  213. data/vendor/assets/javascripts/tom-select-rails/js/plugins/no_active_items.js +2 -1
  214. data/vendor/assets/javascripts/tom-select-rails/js/plugins/no_active_items.js.map +1 -1
  215. data/vendor/assets/javascripts/tom-select-rails/js/plugins/no_backspace_delete.js +2 -2
  216. data/vendor/assets/javascripts/tom-select-rails/js/plugins/no_backspace_delete.js.map +1 -1
  217. data/vendor/assets/javascripts/tom-select-rails/js/plugins/optgroup_columns.js +84 -161
  218. data/vendor/assets/javascripts/tom-select-rails/js/plugins/optgroup_columns.js.map +1 -1
  219. data/vendor/assets/javascripts/tom-select-rails/js/plugins/remove_button.js +132 -198
  220. data/vendor/assets/javascripts/tom-select-rails/js/plugins/remove_button.js.map +1 -1
  221. data/vendor/assets/javascripts/tom-select-rails/js/plugins/restore_on_backspace.js +2 -3
  222. data/vendor/assets/javascripts/tom-select-rails/js/plugins/restore_on_backspace.js.map +1 -1
  223. data/vendor/assets/javascripts/tom-select-rails/js/plugins/virtual_scroll.js +270 -326
  224. data/vendor/assets/javascripts/tom-select-rails/js/plugins/virtual_scroll.js.map +1 -1
  225. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.base.js +1367 -1918
  226. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.base.js.map +1 -1
  227. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.base.min.js +186 -173
  228. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.base.min.js.map +1 -1
  229. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.complete.js +1400 -1883
  230. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.complete.js.map +1 -1
  231. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.complete.min.js +366 -343
  232. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.complete.min.js.map +1 -1
  233. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.popular.js +1369 -1915
  234. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.popular.js.map +1 -1
  235. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.popular.min.js +339 -326
  236. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.popular.min.js.map +1 -1
  237. data/vendor/assets/javascripts/tom-select-rails/types/contrib/microevent.d.ts +1 -1
  238. data/vendor/assets/javascripts/tom-select-rails/types/contrib/microplugin.d.ts +4 -4
  239. data/vendor/assets/javascripts/tom-select-rails/types/defaults.d.ts +1 -0
  240. data/vendor/assets/javascripts/tom-select-rails/types/getSettings.d.ts +2 -2
  241. data/vendor/assets/javascripts/tom-select-rails/types/plugins/caret_position/plugin.d.ts +1 -1
  242. data/vendor/assets/javascripts/tom-select-rails/types/plugins/change_listener/plugin.d.ts +1 -1
  243. data/vendor/assets/javascripts/tom-select-rails/types/plugins/checkbox_options/plugin.d.ts +4 -3
  244. data/vendor/assets/javascripts/tom-select-rails/types/plugins/checkbox_options/types.d.ts +14 -0
  245. data/vendor/assets/javascripts/tom-select-rails/types/plugins/clear_button/plugin.d.ts +2 -2
  246. data/vendor/assets/javascripts/tom-select-rails/types/plugins/clear_button/types.d.ts +1 -1
  247. data/vendor/assets/javascripts/tom-select-rails/types/plugins/drag_drop/plugin.d.ts +1 -1
  248. data/vendor/assets/javascripts/tom-select-rails/types/plugins/dropdown_header/plugin.d.ts +2 -2
  249. data/vendor/assets/javascripts/tom-select-rails/types/plugins/dropdown_header/types.d.ts +1 -1
  250. data/vendor/assets/javascripts/tom-select-rails/types/plugins/dropdown_input/plugin.d.ts +1 -1
  251. data/vendor/assets/javascripts/tom-select-rails/types/plugins/input_autogrow/plugin.d.ts +1 -1
  252. data/vendor/assets/javascripts/tom-select-rails/types/plugins/no_active_items/plugin.d.ts +1 -1
  253. data/vendor/assets/javascripts/tom-select-rails/types/plugins/no_backspace_delete/plugin.d.ts +1 -1
  254. data/vendor/assets/javascripts/tom-select-rails/types/plugins/optgroup_columns/plugin.d.ts +1 -1
  255. data/vendor/assets/javascripts/tom-select-rails/types/plugins/remove_button/plugin.d.ts +2 -2
  256. data/vendor/assets/javascripts/tom-select-rails/types/plugins/remove_button/types.d.ts +1 -1
  257. data/vendor/assets/javascripts/tom-select-rails/types/plugins/restore_on_backspace/plugin.d.ts +3 -3
  258. data/vendor/assets/javascripts/tom-select-rails/types/plugins/virtual_scroll/plugin.d.ts +1 -1
  259. data/vendor/assets/javascripts/tom-select-rails/types/tom-select.complete.d.ts +1 -1
  260. data/vendor/assets/javascripts/tom-select-rails/types/tom-select.d.ts +12 -14
  261. data/vendor/assets/javascripts/tom-select-rails/types/tom-select.popular.d.ts +1 -1
  262. data/vendor/assets/javascripts/tom-select-rails/types/types/core.d.ts +17 -16
  263. data/vendor/assets/javascripts/tom-select-rails/types/types/index.d.ts +2 -2
  264. data/vendor/assets/javascripts/tom-select-rails/types/types/settings.d.ts +6 -5
  265. data/vendor/assets/javascripts/tom-select-rails/types/utils.d.ts +21 -2
  266. data/vendor/assets/javascripts/tom-select-rails/types/vanilla.d.ts +1 -1
  267. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap4.css +227 -219
  268. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap4.css.map +1 -1
  269. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap4.min.css +1 -1
  270. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap4.min.css.map +1 -1
  271. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap5.css +247 -254
  272. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap5.css.map +1 -1
  273. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap5.min.css +1 -1
  274. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap5.min.css.map +1 -1
  275. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.css +213 -210
  276. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.css.map +1 -1
  277. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.default.css +223 -215
  278. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.default.css.map +1 -1
  279. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.default.min.css +1 -1
  280. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.default.min.css.map +1 -1
  281. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.min.css +1 -1
  282. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.min.css.map +1 -1
  283. data/vendor/assets/stylesheets/tom-select-rails/scss/_dropdown.scss +7 -10
  284. data/vendor/assets/stylesheets/tom-select-rails/scss/_items.scss +7 -9
  285. data/vendor/assets/stylesheets/tom-select-rails/scss/plugins/checkbox_options.scss +8 -2
  286. data/vendor/assets/stylesheets/tom-select-rails/scss/plugins/clear_button.scss +16 -14
  287. data/vendor/assets/stylesheets/tom-select-rails/scss/plugins/drag_drop.scss +6 -12
  288. data/vendor/assets/stylesheets/tom-select-rails/scss/plugins/dropdown_header.scss +3 -2
  289. data/vendor/assets/stylesheets/tom-select-rails/scss/plugins/dropdown_input.scss +7 -11
  290. data/vendor/assets/stylesheets/tom-select-rails/scss/plugins/input_autogrow.scss +0 -3
  291. data/vendor/assets/stylesheets/tom-select-rails/scss/plugins/optgroup_columns.scss +7 -5
  292. data/vendor/assets/stylesheets/tom-select-rails/scss/plugins/remove_button.scss +20 -20
  293. data/vendor/assets/stylesheets/tom-select-rails/scss/tom-select.bootstrap4.scss +33 -39
  294. data/vendor/assets/stylesheets/tom-select-rails/scss/tom-select.bootstrap5.scss +54 -80
  295. data/vendor/assets/stylesheets/tom-select-rails/scss/tom-select.default.scss +16 -14
  296. data/vendor/assets/stylesheets/tom-select-rails/scss/tom-select.scss +52 -57
  297. metadata +154 -7
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ /**
3
+ * Plugin: "drag_drop" (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 utils_ts_1 = require("../../utils.js");
19
+ const vanilla_ts_1 = require("../../vanilla.js");
20
+ const insertAfter = (referenceNode, newNode) => {
21
+ var _a;
22
+ (_a = referenceNode.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(newNode, referenceNode.nextSibling);
23
+ };
24
+ const insertBefore = (referenceNode, newNode) => {
25
+ var _a;
26
+ (_a = referenceNode.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(newNode, referenceNode);
27
+ };
28
+ const isBefore = (referenceNode, newNode) => {
29
+ do {
30
+ newNode = newNode === null || newNode === void 0 ? void 0 : newNode.previousElementSibling;
31
+ if (referenceNode == newNode) {
32
+ return true;
33
+ }
34
+ } while (newNode && newNode.previousElementSibling);
35
+ return false;
36
+ };
37
+ function default_1() {
38
+ var self = this;
39
+ if (self.settings.mode !== 'multi')
40
+ return;
41
+ var orig_lock = self.lock;
42
+ var orig_unlock = self.unlock;
43
+ let sortable = true;
44
+ let drag_item;
45
+ /**
46
+ * Add draggable attribute to item
47
+ */
48
+ self.hook('after', 'setupTemplates', () => {
49
+ var orig_render_item = self.settings.render.item;
50
+ self.settings.render.item = (data, escape) => {
51
+ const item = (0, vanilla_ts_1.getDom)(orig_render_item.call(self, data, escape));
52
+ (0, vanilla_ts_1.setAttr)(item, { 'draggable': 'true' });
53
+ // prevent doc_mousedown (see tom-select.ts)
54
+ const mousedown = (evt) => {
55
+ if (!sortable)
56
+ (0, utils_ts_1.preventDefault)(evt);
57
+ evt.stopPropagation();
58
+ };
59
+ const dragStart = (evt) => {
60
+ drag_item = item;
61
+ setTimeout(() => {
62
+ item.classList.add('ts-dragging');
63
+ }, 0);
64
+ };
65
+ const dragOver = (evt) => {
66
+ evt.preventDefault();
67
+ item.classList.add('ts-drag-over');
68
+ moveitem(item, drag_item);
69
+ };
70
+ const dragLeave = () => {
71
+ item.classList.remove('ts-drag-over');
72
+ };
73
+ const moveitem = (targetitem, dragitem) => {
74
+ if (dragitem === undefined)
75
+ return;
76
+ if (isBefore(dragitem, item)) {
77
+ insertAfter(targetitem, dragitem);
78
+ }
79
+ else {
80
+ insertBefore(targetitem, dragitem);
81
+ }
82
+ };
83
+ const dragend = () => {
84
+ document.querySelectorAll('.ts-drag-over').forEach(el => el.classList.remove('ts-drag-over'));
85
+ drag_item === null || drag_item === void 0 ? void 0 : drag_item.classList.remove('ts-dragging');
86
+ drag_item = undefined;
87
+ var values = [];
88
+ self.control.querySelectorAll(`[data-value]`).forEach((el) => {
89
+ if (el.dataset.value) {
90
+ let value = el.dataset.value;
91
+ if (value) {
92
+ values.push(value);
93
+ }
94
+ }
95
+ });
96
+ self.setValue(values);
97
+ };
98
+ (0, utils_ts_1.addEvent)(item, 'mousedown', mousedown);
99
+ (0, utils_ts_1.addEvent)(item, 'dragstart', dragStart);
100
+ (0, utils_ts_1.addEvent)(item, 'dragenter', dragOver);
101
+ (0, utils_ts_1.addEvent)(item, 'dragover', dragOver);
102
+ (0, utils_ts_1.addEvent)(item, 'dragleave', dragLeave);
103
+ (0, utils_ts_1.addEvent)(item, 'dragend', dragend);
104
+ return item;
105
+ };
106
+ });
107
+ self.hook('instead', 'lock', () => {
108
+ sortable = false;
109
+ return orig_lock.call(self);
110
+ });
111
+ self.hook('instead', 'unlock', () => {
112
+ sortable = true;
113
+ return orig_unlock.call(self);
114
+ });
115
+ }
116
+ ;
117
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../src/plugins/drag_drop/plugin.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;AA8BH,4BAmGC;AA7HD,6CAAuE;AACvE,iDAAmD;AAGnD,MAAM,WAAW,GAAG,CAAC,aAAqB,EAAE,OAAe,EAAE,EAAE;;IAC9D,MAAA,aAAa,CAAC,UAAU,0CAAE,YAAY,CAAC,OAAO,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;AAC5E,CAAC,CAAA;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CAAC,CAAC;IAEH,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,QAAQ,EAAC,GAAE,EAAE;QAChC,QAAQ,GAAG,IAAI,CAAC;QAChB,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;AAEJ,CAAC;AAAA,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Plugin: "dropdown_header" (Tom Select)
3
+ * Copyright (c) contributors
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
+ import type TomSelect from '../../tom-select.ts';
16
+ import { DHOptions } from './types.ts';
17
+ export default function (this: TomSelect, userOptions: DHOptions): void;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ /**
3
+ * Plugin: "dropdown_header" (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 self = this;
22
+ const options = Object.assign({
23
+ title: 'Untitled',
24
+ headerClass: 'dropdown-header',
25
+ titleRowClass: 'dropdown-header-title',
26
+ labelClass: 'dropdown-header-label',
27
+ closeClass: 'dropdown-header-close',
28
+ html: (data) => {
29
+ return ('<div class="' + data.headerClass + '">' +
30
+ '<div class="' + data.titleRowClass + '">' +
31
+ '<span class="' + data.labelClass + '">' + data.title + '</span>' +
32
+ '<a class="' + data.closeClass + '">&times;</a>' +
33
+ '</div>' +
34
+ '</div>');
35
+ }
36
+ }, userOptions);
37
+ self.on('initialize', () => {
38
+ var header = (0, vanilla_ts_1.getDom)(options.html(options));
39
+ var close_link = header.querySelector('.' + options.closeClass);
40
+ if (close_link) {
41
+ close_link.addEventListener('click', (evt) => {
42
+ (0, utils_ts_1.preventDefault)(evt, true);
43
+ self.close();
44
+ });
45
+ }
46
+ self.dropdown.insertBefore(header, self.dropdown.firstChild);
47
+ });
48
+ }
49
+ ;
50
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../src/plugins/dropdown_header/plugin.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;AAOH,4BAoCC;AAxCD,iDAA0C;AAC1C,6CAAgD;AAGhD,mBAAwC,WAAqB;IAC5D,MAAM,IAAI,GAAG,IAAI,CAAC;IAElB,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC;QAC7B,KAAK,EAAW,UAAU;QAC1B,WAAW,EAAK,iBAAiB;QACjC,aAAa,EAAG,uBAAuB;QACvC,UAAU,EAAM,uBAAuB;QACvC,UAAU,EAAM,uBAAuB;QAEvC,IAAI,EAAE,CAAC,IAAc,EAAE,EAAE;YACxB,OAAO,CACN,cAAc,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI;gBACvC,cAAc,GAAG,IAAI,CAAC,aAAa,GAAG,IAAI;gBACzC,eAAe,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,GAAG,IAAI,CAAC,KAAK,GAAG,SAAS;gBACjE,YAAY,GAAG,IAAI,CAAC,UAAU,GAAG,eAAe;gBACjD,QAAQ;gBACT,QAAQ,CACR,CAAC;QACH,CAAC;KACD,EAAE,WAAW,CAAC,CAAC;IAEhB,IAAI,CAAC,EAAE,CAAC,YAAY,EAAC,GAAE,EAAE;QACxB,IAAI,MAAM,GAAG,IAAA,mBAAM,EAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAE3C,IAAI,UAAU,GAAG,MAAM,CAAC,aAAa,CAAC,GAAG,GAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC9D,IAAI,UAAU,EAAE,CAAC;YAChB,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAC,CAAC,GAAG,EAAC,EAAE;gBAC1C,IAAA,yBAAc,EAAC,GAAG,EAAC,IAAI,CAAC,CAAC;gBACzB,IAAI,CAAC,KAAK,EAAE,CAAC;YACd,CAAC,CAAC,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AAEJ,CAAC;AAAA,CAAC"}
@@ -0,0 +1,8 @@
1
+ export type DHOptions = {
2
+ title?: string;
3
+ headerClass?: string;
4
+ titleRowClass?: string;
5
+ labelClass?: string;
6
+ closeClass?: string;
7
+ html?: (data: DHOptions) => string;
8
+ };
@@ -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/dropdown_header/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Plugin: "dropdown_input" (Tom Select)
3
+ * Copyright (c) contributors
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
+ import type TomSelect from '../../tom-select.ts';
16
+ export default function (this: TomSelect): void;
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ /**
3
+ * Plugin: "dropdown_input" (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 constants = require("../../constants.js");
19
+ const vanilla_ts_1 = require("../../vanilla.js");
20
+ const utils_ts_1 = require("../../utils.js");
21
+ function default_1() {
22
+ const self = this;
23
+ self.settings.shouldOpen = true; // make sure the input is shown even if there are no options to display in the dropdown
24
+ self.hook('before', 'setup', () => {
25
+ self.focus_node = self.control;
26
+ (0, vanilla_ts_1.addClasses)(self.control_input, 'dropdown-input');
27
+ const div = (0, vanilla_ts_1.getDom)('<div class="dropdown-input-wrap">');
28
+ div.append(self.control_input);
29
+ self.dropdown.insertBefore(div, self.dropdown.firstChild);
30
+ // set a placeholder in the select control
31
+ const placeholder = (0, vanilla_ts_1.getDom)('<input class="items-placeholder" tabindex="-1" />');
32
+ placeholder.placeholder = self.settings.placeholder || '';
33
+ self.control.append(placeholder);
34
+ });
35
+ self.on('initialize', () => {
36
+ // set tabIndex on control to -1, otherwise [shift+tab] will put focus right back on control_input
37
+ self.control_input.addEventListener('keydown', (evt) => {
38
+ //addEvent(self.control_input,'keydown' as const,(evt:KeyboardEvent) =>{
39
+ switch (evt.keyCode) {
40
+ case constants.KEY_ESC:
41
+ if (self.isOpen) {
42
+ (0, utils_ts_1.preventDefault)(evt, true);
43
+ self.close();
44
+ }
45
+ self.clearActiveItems();
46
+ return;
47
+ case constants.KEY_TAB:
48
+ self.focus_node.tabIndex = -1;
49
+ break;
50
+ }
51
+ return self.onKeyDown.call(self, evt);
52
+ });
53
+ self.on('blur', () => {
54
+ self.focus_node.tabIndex = self.isDisabled ? -1 : self.tabIndex;
55
+ });
56
+ // give the control_input focus when the dropdown is open
57
+ self.on('dropdown_open', () => {
58
+ self.control_input.focus();
59
+ });
60
+ // prevent onBlur from closing when focus is on the control_input
61
+ const orig_onBlur = self.onBlur;
62
+ self.hook('instead', 'onBlur', (evt) => {
63
+ if (evt && evt.relatedTarget == self.control_input)
64
+ return;
65
+ return orig_onBlur.call(self);
66
+ });
67
+ (0, utils_ts_1.addEvent)(self.control_input, 'blur', () => self.onBlur());
68
+ // return focus to control to allow further keyboard input
69
+ self.hook('before', 'close', () => {
70
+ if (!self.isOpen)
71
+ return;
72
+ self.focus_node.focus({ preventScroll: true });
73
+ });
74
+ });
75
+ }
76
+ ;
77
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../src/plugins/dropdown_input/plugin.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;AAQH,4BAsEC;AA3ED,gDAAgD;AAChD,iDAAsD;AACtD,6CAA0D;AAG1D;IACC,MAAM,IAAI,GAAG,IAAI,CAAC;IAElB,IAAI,CAAC,QAAQ,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC,uFAAuF;IAExH,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAC,OAAO,EAAC,GAAE,EAAE;QAC9B,IAAI,CAAC,UAA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;QAEH,IAAI,CAAC,EAAE,CAAC,MAAM,EAAC,GAAE,EAAE;YAClB,IAAI,CAAC,UAAU,CAAC,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC;QACjE,CAAC,CAAC,CAAC;QAGH,yDAAyD;QACzD,IAAI,CAAC,EAAE,CAAC,eAAe,EAAC,GAAG,EAAE;YAC5B,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;QAC5B,CAAC,CAAC,CAAC;QAEH,iEAAiE;QACjE,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC;QAChC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,QAAQ,EAAC,CAAC,GAAe,EAAC,EAAE;YAC/C,IAAI,GAAG,IAAI,GAAG,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa;gBAAG,OAAO;YAC5D,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;QAEH,IAAA,mBAAQ,EAAC,IAAI,CAAC,aAAa,EAAC,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAE,CAAC;QAE1D,0DAA0D;QAC1D,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAC,OAAO,EAAC,GAAG,EAAE;YAE/B,IAAI,CAAC,IAAI,CAAC,MAAM;gBAAG,OAAO;YAC1B,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAC,aAAa,EAAE,IAAI,EAAC,CAAC,CAAC;QAC9C,CAAC,CAAC,CAAC;IAEJ,CAAC,CAAC,CAAC;AAEJ,CAAC;AAAA,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Plugin: "input_autogrow" (Tom Select)
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
5
+ * file except in compliance with the License. You may obtain a copy of the License at:
6
+ * http://www.apache.org/licenses/LICENSE-2.0
7
+ *
8
+ * Unless required by applicable law or agreed to in writing, software distributed under
9
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
10
+ * ANY KIND, either express or implied. See the License for the specific language
11
+ * governing permissions and limitations under the License.
12
+ *
13
+ */
14
+ import type TomSelect from '../../tom-select.ts';
15
+ export default function (this: TomSelect): void;
@@ -0,0 +1,47 @@
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
+ const utils_ts_1 = require("../../utils.js");
18
+ function default_1() {
19
+ var self = this;
20
+ self.on('initialize', () => {
21
+ var test_input = document.createElement('span');
22
+ var control = self.control_input;
23
+ test_input.style.cssText = 'position:absolute; top:-99999px; left:-99999px; width:auto; padding:0; white-space:pre; ';
24
+ self.wrapper.appendChild(test_input);
25
+ var transfer_styles = ['letterSpacing', 'fontSize', 'fontFamily', 'fontWeight', 'textTransform'];
26
+ for (const style_name of transfer_styles) {
27
+ // @ts-ignore TS7015 https://stackoverflow.com/a/50506154/697576
28
+ test_input.style[style_name] = control.style[style_name];
29
+ }
30
+ /**
31
+ * Set the control width
32
+ *
33
+ */
34
+ var resize = () => {
35
+ test_input.textContent = control.value;
36
+ control.style.width = test_input.clientWidth + 'px';
37
+ };
38
+ resize();
39
+ self.on('update item_add item_remove', resize);
40
+ (0, utils_ts_1.addEvent)(control, 'input', resize);
41
+ (0, utils_ts_1.addEvent)(control, 'keyup', resize);
42
+ (0, utils_ts_1.addEvent)(control, 'blur', resize);
43
+ (0, utils_ts_1.addEvent)(control, 'update', resize);
44
+ });
45
+ }
46
+ ;
47
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../src/plugins/input_autogrow/plugin.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;AAKH,4BAsCC;AAxCD,6CAA0C;AAE1C;IACC,IAAI,IAAI,GAAO,IAAI,CAAC;IAEpB,IAAI,CAAC,EAAE,CAAC,YAAY,EAAC,GAAE,EAAE;QAGxB,IAAI,UAAU,GAAM,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QACnD,IAAI,OAAO,GAAO,IAAI,CAAC,aAAa,CAAC;QACrC,UAAU,CAAC,KAAK,CAAC,OAAO,GAAG,0FAA0F,CAAC;QAEtH,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAGrC,IAAI,eAAe,GAAK,CAAE,eAAe,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,CAAE,CAAC;QAErG,KAAK,MAAM,UAAU,IAAI,eAAe,EAAE,CAAC;YAC1C,gEAAgE;YAChE,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAC1D,CAAC;QAGD;;;WAGG;QACH,IAAI,MAAM,GAAG,GAAE,EAAE;YAChB,UAAU,CAAC,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC;YACvC,OAAO,CAAC,KAAK,CAAC,KAAK,GAAI,UAAU,CAAC,WAAW,GAAC,IAAI,CAAC;QACpD,CAAC,CAAC;QAEF,MAAM,EAAE,CAAC;QACT,IAAI,CAAC,EAAE,CAAC,6BAA6B,EAAC,MAAM,CAAC,CAAC;QAC9C,IAAA,mBAAQ,EAAC,OAAO,EAAC,OAAO,EAAE,MAAM,CAAE,CAAC;QACnC,IAAA,mBAAQ,EAAC,OAAO,EAAC,OAAO,EAAE,MAAM,CAAE,CAAC;QACnC,IAAA,mBAAQ,EAAC,OAAO,EAAC,MAAM,EAAE,MAAM,CAAE,CAAC;QAClC,IAAA,mBAAQ,EAAC,OAAO,EAAC,QAAQ,EAAE,MAAM,CAAE,CAAC;IACrC,CAAC,CAAC,CAAC;AAEJ,CAAC;AAAA,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Plugin: "no_active_items" (Tom Select)
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
5
+ * file except in compliance with the License. You may obtain a copy of the License at:
6
+ * http://www.apache.org/licenses/LICENSE-2.0
7
+ *
8
+ * Unless required by applicable law or agreed to in writing, software distributed under
9
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
10
+ * ANY KIND, either express or implied. See the License for the specific language
11
+ * governing permissions and limitations under the License.
12
+ *
13
+ */
14
+ import type TomSelect from '../../tom-select.ts';
15
+ export default function (this: TomSelect): void;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ /**
3
+ * Plugin: "no_active_items" (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
+ this.hook('instead', 'setActiveItem', () => { });
19
+ this.hook('instead', 'selectAll', () => { });
20
+ }
21
+ ;
22
+ //# sourceMappingURL=plugin.js.map
@@ -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"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Plugin: "input_autogrow" (Tom Select)
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
5
+ * file except in compliance with the License. You may obtain a copy of the License at:
6
+ * http://www.apache.org/licenses/LICENSE-2.0
7
+ *
8
+ * Unless required by applicable law or agreed to in writing, software distributed under
9
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
10
+ * ANY KIND, either express or implied. See the License for the specific language
11
+ * governing permissions and limitations under the License.
12
+ *
13
+ */
14
+ import type TomSelect from '../../tom-select.ts';
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"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Plugin: "optgroup_columns" (Tom Select.js)
3
+ * Copyright (c) contributors
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
+ import type TomSelect from '../../tom-select.ts';
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;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,17 @@
1
+ /**
2
+ * Plugin: "remove_button" (Tom Select)
3
+ * Copyright (c) contributors
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
+ import type TomSelect from '../../tom-select.ts';
16
+ import { RBOptions } from './types.ts';
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: '&times;',
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,6CAAuE;AAIvE,mBAAwC,WAAqB;IAE5D,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,KAAK,EAAO,SAAS;QACrB,KAAK,EAAO,QAAQ;QACpB,SAAS,EAAG,QAAQ;QACpB,MAAM,EAAM,IAAI;KAChB,EAAE,WAAW,CAAC,CAAC;IAGjB,sCAAsC;IACtC,IAAI,IAAI,GAAK,IAAI,CAAC;IAElB,+DAA+D;IAC/D,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QACrB,OAAO;IACR,CAAC;IAED,IAAI,IAAI,GAAG,sCAAsC,GAAG,OAAO,CAAC,SAAS,GAAG,yBAAyB,GAAG,IAAA,sBAAW,EAAC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,OAAO,CA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