tom-select-rails 2.2.2 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tom-select-rails/version.rb +1 -1
  3. data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.complete.js +614 -820
  4. data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.complete.js.map +1 -1
  5. data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.js +411 -685
  6. data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.js.map +1 -1
  7. data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.popular.js +436 -705
  8. data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.popular.js.map +1 -1
  9. data/vendor/assets/javascripts/tom-select-rails/cjs/utils.js +31 -27
  10. data/vendor/assets/javascripts/tom-select-rails/cjs/utils.js.map +1 -1
  11. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/caret_position/plugin.js +11 -16
  12. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/caret_position/plugin.js.map +1 -1
  13. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/change_listener/plugin.js +3 -2
  14. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/change_listener/plugin.js.map +1 -1
  15. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/checkbox_options/plugin.js +47 -34
  16. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/checkbox_options/plugin.js.map +1 -1
  17. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/clear_button/plugin.js +3 -13
  18. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/clear_button/plugin.js.map +1 -1
  19. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/drag_drop/plugin.js +249 -29
  20. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/drag_drop/plugin.js.map +1 -1
  21. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_header/plugin.js +3 -11
  22. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_header/plugin.js.map +1 -1
  23. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_input/plugin.js +15 -24
  24. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_input/plugin.js.map +1 -1
  25. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/input_autogrow/plugin.js +4 -6
  26. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/input_autogrow/plugin.js.map +1 -1
  27. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/no_active_items/plugin.js +2 -1
  28. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/no_active_items/plugin.js.map +1 -1
  29. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/no_backspace_delete/plugin.js +2 -2
  30. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/no_backspace_delete/plugin.js.map +1 -1
  31. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/optgroup_columns/plugin.js +3 -15
  32. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/optgroup_columns/plugin.js.map +1 -1
  33. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/remove_button/plugin.js +11 -15
  34. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/remove_button/plugin.js.map +1 -1
  35. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/restore_on_backspace/plugin.js +2 -3
  36. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/restore_on_backspace/plugin.js.map +1 -1
  37. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/virtual_scroll/plugin.js +41 -50
  38. data/vendor/assets/javascripts/tom-select-rails/esm/plugins/virtual_scroll/plugin.js.map +1 -1
  39. data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.complete.js +614 -820
  40. data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.complete.js.map +1 -1
  41. data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.js +411 -685
  42. data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.js.map +1 -1
  43. data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.popular.js +436 -705
  44. data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.popular.js.map +1 -1
  45. data/vendor/assets/javascripts/tom-select-rails/esm/utils.js +31 -26
  46. data/vendor/assets/javascripts/tom-select-rails/esm/utils.js.map +1 -1
  47. data/vendor/assets/javascripts/tom-select-rails/js/plugins/caret_position.js +11 -16
  48. data/vendor/assets/javascripts/tom-select-rails/js/plugins/caret_position.js.map +1 -1
  49. data/vendor/assets/javascripts/tom-select-rails/js/plugins/change_listener.js +3 -2
  50. data/vendor/assets/javascripts/tom-select-rails/js/plugins/change_listener.js.map +1 -1
  51. data/vendor/assets/javascripts/tom-select-rails/js/plugins/checkbox_options.js +47 -34
  52. data/vendor/assets/javascripts/tom-select-rails/js/plugins/checkbox_options.js.map +1 -1
  53. data/vendor/assets/javascripts/tom-select-rails/js/plugins/clear_button.js +3 -13
  54. data/vendor/assets/javascripts/tom-select-rails/js/plugins/clear_button.js.map +1 -1
  55. data/vendor/assets/javascripts/tom-select-rails/js/plugins/drag_drop.js +249 -29
  56. data/vendor/assets/javascripts/tom-select-rails/js/plugins/drag_drop.js.map +1 -1
  57. data/vendor/assets/javascripts/tom-select-rails/js/plugins/dropdown_header.js +3 -11
  58. data/vendor/assets/javascripts/tom-select-rails/js/plugins/dropdown_header.js.map +1 -1
  59. data/vendor/assets/javascripts/tom-select-rails/js/plugins/dropdown_input.js +15 -24
  60. data/vendor/assets/javascripts/tom-select-rails/js/plugins/dropdown_input.js.map +1 -1
  61. data/vendor/assets/javascripts/tom-select-rails/js/plugins/input_autogrow.js +4 -6
  62. data/vendor/assets/javascripts/tom-select-rails/js/plugins/input_autogrow.js.map +1 -1
  63. data/vendor/assets/javascripts/tom-select-rails/js/plugins/no_active_items.js +2 -1
  64. data/vendor/assets/javascripts/tom-select-rails/js/plugins/no_active_items.js.map +1 -1
  65. data/vendor/assets/javascripts/tom-select-rails/js/plugins/no_backspace_delete.js +2 -2
  66. data/vendor/assets/javascripts/tom-select-rails/js/plugins/no_backspace_delete.js.map +1 -1
  67. data/vendor/assets/javascripts/tom-select-rails/js/plugins/optgroup_columns.js +3 -15
  68. data/vendor/assets/javascripts/tom-select-rails/js/plugins/optgroup_columns.js.map +1 -1
  69. data/vendor/assets/javascripts/tom-select-rails/js/plugins/remove_button.js +11 -15
  70. data/vendor/assets/javascripts/tom-select-rails/js/plugins/remove_button.js.map +1 -1
  71. data/vendor/assets/javascripts/tom-select-rails/js/plugins/restore_on_backspace.js +2 -3
  72. data/vendor/assets/javascripts/tom-select-rails/js/plugins/restore_on_backspace.js.map +1 -1
  73. data/vendor/assets/javascripts/tom-select-rails/js/plugins/virtual_scroll.js +41 -50
  74. data/vendor/assets/javascripts/tom-select-rails/js/plugins/virtual_scroll.js.map +1 -1
  75. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.base.js +411 -685
  76. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.base.js.map +1 -1
  77. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.base.min.js +87 -78
  78. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.base.min.js.map +1 -1
  79. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.complete.js +614 -820
  80. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.complete.js.map +1 -1
  81. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.complete.min.js +195 -176
  82. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.complete.min.js.map +1 -1
  83. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.popular.js +436 -705
  84. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.popular.js.map +1 -1
  85. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.popular.min.js +87 -78
  86. data/vendor/assets/javascripts/tom-select-rails/js/tom-select.popular.min.js.map +1 -1
  87. data/vendor/assets/javascripts/tom-select-rails/types/contrib/microevent.d.ts +1 -1
  88. data/vendor/assets/javascripts/tom-select-rails/types/contrib/microplugin.d.ts +4 -4
  89. data/vendor/assets/javascripts/tom-select-rails/types/defaults.d.ts +1 -0
  90. data/vendor/assets/javascripts/tom-select-rails/types/plugins/checkbox_options/plugin.d.ts +3 -2
  91. data/vendor/assets/javascripts/tom-select-rails/types/plugins/checkbox_options/types.d.ts +14 -0
  92. data/vendor/assets/javascripts/tom-select-rails/types/plugins/clear_button/types.d.ts +1 -1
  93. data/vendor/assets/javascripts/tom-select-rails/types/plugins/dropdown_header/types.d.ts +1 -1
  94. data/vendor/assets/javascripts/tom-select-rails/types/plugins/remove_button/types.d.ts +1 -1
  95. data/vendor/assets/javascripts/tom-select-rails/types/plugins/restore_on_backspace/plugin.d.ts +1 -1
  96. data/vendor/assets/javascripts/tom-select-rails/types/tom-select.d.ts +10 -12
  97. data/vendor/assets/javascripts/tom-select-rails/types/types/core.d.ts +15 -14
  98. data/vendor/assets/javascripts/tom-select-rails/types/types/settings.d.ts +3 -2
  99. data/vendor/assets/javascripts/tom-select-rails/types/utils.d.ts +7 -0
  100. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap4.css +224 -216
  101. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap4.css.map +1 -1
  102. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap4.min.css +1 -1
  103. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap4.min.css.map +1 -1
  104. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap5.css +245 -252
  105. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap5.css.map +1 -1
  106. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap5.min.css +1 -1
  107. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap5.min.css.map +1 -1
  108. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.css +213 -210
  109. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.css.map +1 -1
  110. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.default.css +223 -215
  111. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.default.css.map +1 -1
  112. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.default.min.css +1 -1
  113. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.default.min.css.map +1 -1
  114. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.min.css +1 -1
  115. data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.min.css.map +1 -1
  116. data/vendor/assets/stylesheets/tom-select-rails/scss/_dropdown.scss +7 -10
  117. data/vendor/assets/stylesheets/tom-select-rails/scss/_items.scss +2 -5
  118. data/vendor/assets/stylesheets/tom-select-rails/scss/plugins/checkbox_options.scss +8 -2
  119. data/vendor/assets/stylesheets/tom-select-rails/scss/plugins/clear_button.scss +16 -14
  120. data/vendor/assets/stylesheets/tom-select-rails/scss/plugins/drag_drop.scss +6 -12
  121. data/vendor/assets/stylesheets/tom-select-rails/scss/plugins/dropdown_header.scss +3 -2
  122. data/vendor/assets/stylesheets/tom-select-rails/scss/plugins/dropdown_input.scss +7 -11
  123. data/vendor/assets/stylesheets/tom-select-rails/scss/plugins/input_autogrow.scss +0 -3
  124. data/vendor/assets/stylesheets/tom-select-rails/scss/plugins/optgroup_columns.scss +7 -5
  125. data/vendor/assets/stylesheets/tom-select-rails/scss/plugins/remove_button.scss +20 -20
  126. data/vendor/assets/stylesheets/tom-select-rails/scss/tom-select.bootstrap4.scss +33 -39
  127. data/vendor/assets/stylesheets/tom-select-rails/scss/tom-select.bootstrap5.scss +54 -80
  128. data/vendor/assets/stylesheets/tom-select-rails/scss/tom-select.default.scss +16 -14
  129. data/vendor/assets/stylesheets/tom-select-rails/scss/tom-select.scss +52 -57
  130. metadata +8 -7
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * @author Jerome Etienne (https://github.com/jeromeetienne)
9
9
  */
10
- declare type TCallback = (...args: any) => any;
10
+ type TCallback = (...args: any) => any;
11
11
  export default class MicroEvent {
12
12
  _events: {
13
13
  [key: string]: TCallback[];
@@ -13,10 +13,10 @@
13
13
  *
14
14
  * @author Brian Reavis <brian@thirdroute.com>
15
15
  */
16
- declare type TSettings = {
16
+ type TSettings = {
17
17
  [key: string]: any;
18
18
  };
19
- declare type TPlugins = {
19
+ type TPlugins = {
20
20
  names: string[];
21
21
  settings: TSettings;
22
22
  requested: {
@@ -26,11 +26,11 @@ declare type TPlugins = {
26
26
  [key: string]: any;
27
27
  };
28
28
  };
29
- export declare type TPluginItem = {
29
+ export type TPluginItem = {
30
30
  name: string;
31
31
  options: {};
32
32
  };
33
- export declare type TPluginHash = {
33
+ export type TPluginHash = {
34
34
  [key: string]: {};
35
35
  };
36
36
  export default function MicroPlugin(Interface: any): {
@@ -20,6 +20,7 @@ declare const _default: {
20
20
  selectOnTab: boolean;
21
21
  preload: null;
22
22
  allowEmptyOption: boolean;
23
+ refreshThrottle: number;
23
24
  loadThrottle: number;
24
25
  loadingClass: string;
25
26
  dataAttr: null;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Plugin: "restore_on_backspace" (Tom Select)
2
+ * Plugin: "checkbox_options" (Tom Select)
3
3
  * Copyright (c) contributors
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
@@ -13,4 +13,5 @@
13
13
  *
14
14
  */
15
15
  import TomSelect from '../../tom-select';
16
- export default function (this: TomSelect): void;
16
+ import { CBOptions } from './types';
17
+ export default function (this: TomSelect, userOptions: CBOptions): void;
@@ -0,0 +1,14 @@
1
+ export type CBOptions = {
2
+ /**
3
+ * a unique class name for the checkbox to find the input
4
+ */
5
+ className?: string;
6
+ /**
7
+ * class name to add if checkbox is checked and remove otherwise
8
+ */
9
+ checkedClassNames?: string[];
10
+ /**
11
+ * class name to add if checkbox was not checked and remove otherwise
12
+ */
13
+ uncheckedClassNames?: string[];
14
+ };
@@ -1,4 +1,4 @@
1
- export declare type CBOptions = {
1
+ export type CBOptions = {
2
2
  className?: string;
3
3
  title?: string;
4
4
  html?: (data: CBOptions) => string;
@@ -1,4 +1,4 @@
1
- export declare type DHOptions = {
1
+ export type DHOptions = {
2
2
  title?: string;
3
3
  headerClass?: string;
4
4
  titleRowClass?: string;
@@ -1,4 +1,4 @@
1
- export declare type RBOptions = {
1
+ export type RBOptions = {
2
2
  label?: string;
3
3
  title?: string;
4
4
  className?: string;
@@ -14,7 +14,7 @@
14
14
  */
15
15
  import TomSelect from '../../tom-select';
16
16
  import { TomOption } from '../../types/index';
17
- declare type TPluginOptions = {
17
+ type TPluginOptions = {
18
18
  text?: (option: TomOption) => string;
19
19
  };
20
20
  export default function (this: TomSelect, userOptions: TPluginOptions): void;
@@ -42,6 +42,7 @@ export default class TomSelect extends TomSelect_base {
42
42
  sifter: Sifter;
43
43
  isOpen: boolean;
44
44
  isDisabled: boolean;
45
+ isReadOnly: boolean;
45
46
  isRequired: boolean;
46
47
  isInvalid: boolean;
47
48
  isValid: boolean;
@@ -67,6 +68,7 @@ export default class TomSelect extends TomSelect_base {
67
68
  [key: string]: boolean;
68
69
  };
69
70
  items: string[];
71
+ private refreshTimeout;
70
72
  constructor(input_arg: string | TomInput, user_settings: RecursivePartial<TomSettings>);
71
73
  /**
72
74
  * set up event bindings.
@@ -129,6 +131,7 @@ export default class TomSelect extends TomSelect_base {
129
131
  *
130
132
  */
131
133
  onInput(e: MouseEvent | KeyboardEvent): void;
134
+ _onInput(): void;
132
135
  /**
133
136
  * Triggered when the user rolls over
134
137
  * an option in the autocomplete dropdown menu.
@@ -263,17 +266,6 @@ export default class TomSelect extends TomSelect_base {
263
266
  *
264
267
  */
265
268
  inputState(): void;
266
- /**
267
- * Hides the input element out of view, while
268
- * retaining its focus.
269
- * @deprecated 1.3
270
- */
271
- hideInput(): void;
272
- /**
273
- * Restores input visibility.
274
- * @deprecated 1.3
275
- */
276
- showInput(): void;
277
269
  /**
278
270
  * Get the input value
279
271
  */
@@ -305,7 +297,7 @@ export default class TomSelect extends TomSelect_base {
305
297
  getSearchOptions(): {
306
298
  fields: string[];
307
299
  conjunction: string;
308
- sort: string | import("@orchidjs/sifter/lib/types").SortFn | import("@orchidjs/sifter/lib/types").Sort[];
300
+ sort: string | import("@orchidjs/sifter/dist/types/types").SortFn | import("@orchidjs/sifter/dist/types/types").Sort[];
309
301
  nesting: boolean;
310
302
  };
311
303
  /**
@@ -539,6 +531,10 @@ export default class TomSelect extends TomSelect_base {
539
531
  * Re-enables user input on the control.
540
532
  */
541
533
  unlock(): void;
534
+ /**
535
+ * Disable or enable user input on the control
536
+ */
537
+ setLocked(lock?: boolean): void;
542
538
  /**
543
539
  * Disables user input on the control completely.
544
540
  * While disabled, it cannot receive focus.
@@ -549,6 +545,8 @@ export default class TomSelect extends TomSelect_base {
549
545
  * to focus and user input.
550
546
  */
551
547
  enable(): void;
548
+ setDisabled(disabled: boolean): void;
549
+ setReadOnly(isReadOnly: boolean): void;
552
550
  /**
553
551
  * Completely destroys the control and
554
552
  * unbinds all event listeners so that it can
@@ -3,32 +3,33 @@ import { escape_html } from '../utils';
3
3
  export interface TomInput extends HTMLElement {
4
4
  tomselect?: TomSelect;
5
5
  disabled: boolean;
6
+ readOnly?: boolean;
6
7
  required: boolean;
7
8
  value: string;
8
9
  type: string;
9
10
  validity: ValidityState;
10
11
  }
11
- export declare type TomArgObject = {
12
+ export type TomArgObject = {
12
13
  silent?: boolean;
13
14
  };
14
- export declare type TomOption = {
15
+ export type TomOption = {
15
16
  [key: string]: any;
16
17
  };
17
- export declare type TomOptions = {
18
+ export type TomOptions = {
18
19
  [key: string]: TomOption;
19
20
  };
20
- export declare type TomCreateFilter = (input: string) => boolean;
21
- export declare type TomCreateCallback = (data?: TomOption) => void;
22
- export declare type TomCreate = (input: string, create: TomCreateCallback) => boolean;
21
+ export type TomCreateFilter = (input: string) => boolean;
22
+ export type TomCreateCallback = (data?: TomOption) => void;
23
+ export type TomCreate = (input: string, create: TomCreateCallback) => boolean;
23
24
  export interface TomItem extends HTMLElement {
24
25
  dataset: {
25
26
  value: string;
26
27
  };
27
28
  }
28
- export declare type TomLoadCallback = TomSelect['loadCallback'];
29
- export declare type TomTemplate = (data: TomOption, escape: typeof escape_html) => string | HTMLElement;
30
- export declare type TomTemplateNull = (data: TomOption, escape: typeof escape_html) => null | string | HTMLElement;
31
- export declare type TomTemplates = {
29
+ export type TomLoadCallback = TomSelect['loadCallback'];
30
+ export type TomTemplate = (data: TomOption, escape: typeof escape_html) => string | HTMLElement;
31
+ export type TomTemplateNull = (data: TomOption, escape: typeof escape_html) => null | string | HTMLElement;
32
+ export type TomTemplates = {
32
33
  'dropdown': TomTemplate;
33
34
  'optgroup': TomTemplate;
34
35
  'optgroup_header': TomTemplate;
@@ -41,8 +42,8 @@ export declare type TomTemplates = {
41
42
  'loading_more': TomTemplateNull;
42
43
  'no_more_results': TomTemplateNull;
43
44
  };
44
- export declare type TomTemplateNames = keyof TomTemplates;
45
- export declare type TomClearFilter = (option: TomOption, value: string) => boolean;
46
- export declare type RecursivePartial<T> = {
47
- [P in keyof T]?: RecursivePartial<T[P]>;
45
+ export type TomTemplateNames = keyof TomTemplates;
46
+ export type TomClearFilter = (option: TomOption, value: string) => boolean;
47
+ export type RecursivePartial<T> = {
48
+ [P in keyof T]?: T[P] extends (infer U)[] ? RecursivePartial<U>[] : T[P] extends object | undefined ? RecursivePartial<T[P]> : T[P];
48
49
  };
@@ -1,7 +1,7 @@
1
1
  import { TomCreateFilter, TomCreate, TomLoadCallback, TomTemplates, TomOption } from './index';
2
2
  import { TPluginItem, TPluginHash } from '../contrib/microplugin';
3
- import * as SifterTypes from '@orchidjs/sifter/lib/types';
4
- export declare type TomSettings = {
3
+ import * as SifterTypes from '@orchidjs/sifter/dist/types/types';
4
+ export type TomSettings = {
5
5
  options?: any[];
6
6
  optgroups?: any[];
7
7
  items?: string[];
@@ -25,6 +25,7 @@ export declare type TomSettings = {
25
25
  preload: boolean | string;
26
26
  allowEmptyOption: boolean;
27
27
  closeAfterSelect: boolean;
28
+ refreshThrottle: number;
28
29
  loadThrottle: number;
29
30
  loadingClass: string;
30
31
  dataAttr: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  import TomSelect from './tom-select';
2
3
  import { TomLoadCallback } from './types/index';
3
4
  /**
@@ -21,6 +22,10 @@ export declare const get_hash: (value: boolean | string | number) => string;
21
22
  *
22
23
  */
23
24
  export declare const escape_html: (str: string) => string;
25
+ /**
26
+ * use setTimeout if timeout > 0
27
+ */
28
+ export declare const timeout: (fn: () => void, timeout: number) => NodeJS.Timeout | null;
24
29
  /**
25
30
  * Debounce the user provided load function
26
31
  *
@@ -38,6 +43,8 @@ export declare const debounce_events: (self: TomSelect, types: string[], fn: ()
38
43
  * - start
39
44
  * - length
40
45
  *
46
+ * Note: "selectionStart, selectionEnd ... apply only to inputs of types text, search, URL, tel and password"
47
+ * - https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange
41
48
  */
42
49
  export declare const getSelection: (input: HTMLInputElement) => {
43
50
  start: number;