tom-select-rails 2.2.1 → 2.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tom-select-rails/version.rb +1 -1
- data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.complete.js +691 -859
- data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.complete.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.js +487 -723
- data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.popular.js +512 -743
- data/vendor/assets/javascripts/tom-select-rails/cjs/tom-select.popular.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/cjs/utils.js +32 -28
- data/vendor/assets/javascripts/tom-select-rails/cjs/utils.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/caret_position/plugin.js +67 -23
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/caret_position/plugin.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/change_listener/plugin.js +4 -3
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/change_listener/plugin.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/checkbox_options/plugin.js +103 -41
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/checkbox_options/plugin.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/clear_button/plugin.js +59 -20
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/clear_button/plugin.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/drag_drop/plugin.js +249 -29
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/drag_drop/plugin.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_header/plugin.js +59 -18
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_header/plugin.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_input/plugin.js +72 -32
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/dropdown_input/plugin.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/input_autogrow/plugin.js +5 -7
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/input_autogrow/plugin.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/no_active_items/plugin.js +2 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/no_active_items/plugin.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/no_backspace_delete/plugin.js +2 -2
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/no_backspace_delete/plugin.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/optgroup_columns/plugin.js +59 -22
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/optgroup_columns/plugin.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/remove_button/plugin.js +68 -23
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/remove_button/plugin.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/restore_on_backspace/plugin.js +2 -3
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/restore_on_backspace/plugin.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/virtual_scroll/plugin.js +97 -57
- data/vendor/assets/javascripts/tom-select-rails/esm/plugins/virtual_scroll/plugin.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.complete.js +691 -859
- data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.complete.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.js +487 -723
- data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.popular.js +512 -743
- data/vendor/assets/javascripts/tom-select-rails/esm/tom-select.popular.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/esm/utils.js +32 -27
- data/vendor/assets/javascripts/tom-select-rails/esm/utils.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/caret_position.js +67 -23
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/caret_position.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/change_listener.js +4 -3
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/change_listener.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/checkbox_options.js +103 -41
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/checkbox_options.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/clear_button.js +59 -20
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/clear_button.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/drag_drop.js +249 -29
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/drag_drop.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/dropdown_header.js +59 -18
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/dropdown_header.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/dropdown_input.js +72 -32
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/dropdown_input.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/input_autogrow.js +5 -7
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/input_autogrow.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/no_active_items.js +2 -1
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/no_active_items.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/no_backspace_delete.js +2 -2
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/no_backspace_delete.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/optgroup_columns.js +59 -22
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/optgroup_columns.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/remove_button.js +68 -23
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/remove_button.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/restore_on_backspace.js +2 -3
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/restore_on_backspace.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/virtual_scroll.js +97 -57
- data/vendor/assets/javascripts/tom-select-rails/js/plugins/virtual_scroll.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/tom-select.base.js +487 -723
- data/vendor/assets/javascripts/tom-select-rails/js/tom-select.base.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/tom-select.base.min.js +168 -160
- data/vendor/assets/javascripts/tom-select-rails/js/tom-select.base.min.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/tom-select.complete.js +691 -859
- data/vendor/assets/javascripts/tom-select-rails/js/tom-select.complete.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/tom-select.complete.min.js +208 -190
- data/vendor/assets/javascripts/tom-select-rails/js/tom-select.complete.min.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/tom-select.popular.js +512 -743
- data/vendor/assets/javascripts/tom-select-rails/js/tom-select.popular.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/js/tom-select.popular.min.js +180 -172
- data/vendor/assets/javascripts/tom-select-rails/js/tom-select.popular.min.js.map +1 -1
- data/vendor/assets/javascripts/tom-select-rails/types/contrib/microevent.d.ts +1 -1
- data/vendor/assets/javascripts/tom-select-rails/types/contrib/microplugin.d.ts +4 -4
- data/vendor/assets/javascripts/tom-select-rails/types/defaults.d.ts +1 -0
- data/vendor/assets/javascripts/tom-select-rails/types/getSettings.d.ts +2 -2
- data/vendor/assets/javascripts/tom-select-rails/types/plugins/checkbox_options/plugin.d.ts +3 -2
- data/vendor/assets/javascripts/tom-select-rails/types/plugins/checkbox_options/types.d.ts +14 -0
- data/vendor/assets/javascripts/tom-select-rails/types/plugins/clear_button/types.d.ts +1 -1
- data/vendor/assets/javascripts/tom-select-rails/types/plugins/dropdown_header/types.d.ts +1 -1
- data/vendor/assets/javascripts/tom-select-rails/types/plugins/remove_button/types.d.ts +1 -1
- data/vendor/assets/javascripts/tom-select-rails/types/plugins/restore_on_backspace/plugin.d.ts +1 -1
- data/vendor/assets/javascripts/tom-select-rails/types/tom-select.d.ts +12 -14
- data/vendor/assets/javascripts/tom-select-rails/types/types/core.d.ts +16 -12
- data/vendor/assets/javascripts/tom-select-rails/types/types/settings.d.ts +3 -2
- data/vendor/assets/javascripts/tom-select-rails/types/utils.d.ts +8 -1
- data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap4.css +224 -216
- data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap4.css.map +1 -1
- data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap4.min.css +1 -1
- data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap4.min.css.map +1 -1
- data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap5.css +245 -252
- data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap5.css.map +1 -1
- data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap5.min.css +1 -1
- data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.bootstrap5.min.css.map +1 -1
- data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.css +213 -210
- data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.css.map +1 -1
- data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.default.css +223 -215
- data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.default.css.map +1 -1
- data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.default.min.css +1 -1
- data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.default.min.css.map +1 -1
- data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.min.css +1 -1
- data/vendor/assets/stylesheets/tom-select-rails/css/tom-select.min.css.map +1 -1
- data/vendor/assets/stylesheets/tom-select-rails/scss/_dropdown.scss +7 -10
- data/vendor/assets/stylesheets/tom-select-rails/scss/_items.scss +2 -5
- data/vendor/assets/stylesheets/tom-select-rails/scss/plugins/checkbox_options.scss +8 -2
- data/vendor/assets/stylesheets/tom-select-rails/scss/plugins/clear_button.scss +16 -14
- data/vendor/assets/stylesheets/tom-select-rails/scss/plugins/drag_drop.scss +6 -12
- data/vendor/assets/stylesheets/tom-select-rails/scss/plugins/dropdown_header.scss +3 -2
- data/vendor/assets/stylesheets/tom-select-rails/scss/plugins/dropdown_input.scss +7 -11
- data/vendor/assets/stylesheets/tom-select-rails/scss/plugins/input_autogrow.scss +0 -3
- data/vendor/assets/stylesheets/tom-select-rails/scss/plugins/optgroup_columns.scss +7 -5
- data/vendor/assets/stylesheets/tom-select-rails/scss/plugins/remove_button.scss +20 -20
- data/vendor/assets/stylesheets/tom-select-rails/scss/tom-select.bootstrap4.scss +33 -39
- data/vendor/assets/stylesheets/tom-select-rails/scss/tom-select.bootstrap5.scss +54 -80
- data/vendor/assets/stylesheets/tom-select-rails/scss/tom-select.default.scss +16 -14
- data/vendor/assets/stylesheets/tom-select-rails/scss/tom-select.scss +52 -57
- metadata +8 -7
@@ -13,10 +13,10 @@
|
|
13
13
|
*
|
14
14
|
* @author Brian Reavis <brian@thirdroute.com>
|
15
15
|
*/
|
16
|
-
|
16
|
+
type TSettings = {
|
17
17
|
[key: string]: any;
|
18
18
|
};
|
19
|
-
|
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
|
29
|
+
export type TPluginItem = {
|
30
30
|
name: string;
|
31
31
|
options: {};
|
32
32
|
};
|
33
|
-
export
|
33
|
+
export type TPluginHash = {
|
34
34
|
[key: string]: {};
|
35
35
|
};
|
36
36
|
export default function MicroPlugin(Interface: any): {
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import { TomSettings } from './types/index';
|
1
|
+
import { TomSettings, RecursivePartial } from './types/index';
|
2
2
|
import { TomInput } from './types/index';
|
3
|
-
export default function getSettings(input: TomInput, settings_user:
|
3
|
+
export default function getSettings(input: TomInput, settings_user: RecursivePartial<TomSettings>): TomSettings;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* Plugin: "
|
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
|
-
|
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
|
+
};
|
data/vendor/assets/javascripts/tom-select-rails/types/plugins/restore_on_backspace/plugin.d.ts
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
*/
|
15
15
|
import TomSelect from '../../tom-select';
|
16
16
|
import { TomOption } from '../../types/index';
|
17
|
-
|
17
|
+
type TPluginOptions = {
|
18
18
|
text?: (option: TomOption) => string;
|
19
19
|
};
|
20
20
|
export default function (this: TomSelect, userOptions: TPluginOptions): void;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Sifter } from '@orchidjs/sifter';
|
2
|
-
import { TomInput, TomArgObject, TomOption, TomOptions, TomCreateCallback, TomItem, TomSettings, TomTemplateNames, TomClearFilter } from './types/index';
|
2
|
+
import { TomInput, TomArgObject, TomOption, TomOptions, TomCreateCallback, TomItem, TomSettings, TomTemplateNames, TomClearFilter, RecursivePartial } from './types/index';
|
3
3
|
declare const TomSelect_base: {
|
4
4
|
new (): {
|
5
5
|
[x: string]: any;
|
@@ -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,7 +68,8 @@ export default class TomSelect extends TomSelect_base {
|
|
67
68
|
[key: string]: boolean;
|
68
69
|
};
|
69
70
|
items: string[];
|
70
|
-
|
71
|
+
private refreshTimeout;
|
72
|
+
constructor(input_arg: string | TomInput, user_settings: RecursivePartial<TomSettings>);
|
71
73
|
/**
|
72
74
|
* set up event bindings.
|
73
75
|
*
|
@@ -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/
|
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
|
12
|
+
export type TomArgObject = {
|
12
13
|
silent?: boolean;
|
13
14
|
};
|
14
|
-
export
|
15
|
+
export type TomOption = {
|
15
16
|
[key: string]: any;
|
16
17
|
};
|
17
|
-
export
|
18
|
+
export type TomOptions = {
|
18
19
|
[key: string]: TomOption;
|
19
20
|
};
|
20
|
-
export
|
21
|
-
export
|
22
|
-
export
|
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
|
29
|
-
export
|
30
|
-
export
|
31
|
-
export
|
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,5 +42,8 @@ export declare type TomTemplates = {
|
|
41
42
|
'loading_more': TomTemplateNull;
|
42
43
|
'no_more_results': TomTemplateNull;
|
43
44
|
};
|
44
|
-
export
|
45
|
-
export
|
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];
|
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/
|
4
|
-
export
|
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;
|
@@ -49,7 +56,7 @@ export declare const getSelection: (input: HTMLInputElement) => {
|
|
49
56
|
*/
|
50
57
|
export declare const preventDefault: (evt?: Event, stop?: boolean) => void;
|
51
58
|
/**
|
52
|
-
*
|
59
|
+
* Add event helper
|
53
60
|
*
|
54
61
|
*/
|
55
62
|
export declare const addEvent: (target: EventTarget, type: string, callback: EventListenerOrEventListenerObject, options?: object) => void;
|