@@ -22,11 +22,11 @@ function __classPrivateFieldGet(receiver, state, kind, f) {
22
22
return kind === "m" ? f : kind === "a" ? f . call ( receiver ) : f ? f . value : state . get ( receiver ) ;
23
23
}
24
24
25
- var _instances , _getCommonConfig , _createAutocomplete , _createAutocompleteWithHtmlContents , _createAutocompleteWithRemoteData , _stripTags , _mergeObjects , _createTomSelect , _dispatchEvent ;
25
+ var _default_1_instances , _default_1_getCommonConfig , _default_1_createAutocomplete , _default_1_createAutocompleteWithHtmlContents , _default_1_createAutocompleteWithRemoteData , _default_1_stripTags , _default_1_mergeObjects , _default_1_createTomSelect , _default_1_dispatchEvent ;
26
26
class default_1 extends Controller {
27
27
constructor ( ) {
28
28
super ( ...arguments ) ;
29
- _instances . add ( this ) ;
29
+ _default_1_instances . add ( this ) ;
30
30
}
31
31
initialize ( ) {
32
32
this . element . setAttribute ( 'data-live-ignore' , '' ) ;
@@ -39,14 +39,14 @@ class default_1 extends Controller {
39
39
}
40
40
connect ( ) {
41
41
if ( this . urlValue ) {
42
- this . tomSelect = __classPrivateFieldGet ( this , _instances , "m" , _createAutocompleteWithRemoteData ) . call ( this , this . urlValue , this . minCharactersValue ) ;
42
+ this . tomSelect = __classPrivateFieldGet ( this , _default_1_instances , "m" , _default_1_createAutocompleteWithRemoteData ) . call ( this , this . urlValue , this . minCharactersValue ) ;
43
43
return ;
44
44
}
45
45
if ( this . optionsAsHtmlValue ) {
46
- this . tomSelect = __classPrivateFieldGet ( this , _instances , "m" , _createAutocompleteWithHtmlContents ) . call ( this ) ;
46
+ this . tomSelect = __classPrivateFieldGet ( this , _default_1_instances , "m" , _default_1_createAutocompleteWithHtmlContents ) . call ( this ) ;
47
47
return ;
48
48
}
49
- this . tomSelect = __classPrivateFieldGet ( this , _instances , "m" , _createAutocomplete ) . call ( this ) ;
49
+ this . tomSelect = __classPrivateFieldGet ( this , _default_1_instances , "m" , _default_1_createAutocomplete ) . call ( this ) ;
50
50
}
51
51
disconnect ( ) {
52
52
this . tomSelect . revertSettings . innerHTML = this . element . innerHTML ;
@@ -77,7 +77,7 @@ class default_1 extends Controller {
77
77
return this . preloadValue ;
78
78
}
79
79
}
80
- _instances = new WeakSet ( ) , _getCommonConfig = function _getCommonConfig ( ) {
80
+ _default_1_instances = new WeakSet ( ) , _default_1_getCommonConfig = function _default_1_getCommonConfig ( ) {
81
81
const plugins = { } ;
82
82
const isMultiple = ! this . selectElement || this . selectElement . multiple ;
83
83
if ( ! this . formElement . disabled && ! isMultiple ) {
@@ -109,19 +109,19 @@ _instances = new WeakSet(), _getCommonConfig = function _getCommonConfig() {
109
109
if ( ! this . selectElement && ! this . urlValue ) {
110
110
config . shouldLoad = ( ) => false ;
111
111
}
112
- return __classPrivateFieldGet ( this , _instances , "m" , _mergeObjects ) . call ( this , config , this . tomSelectOptionsValue ) ;
113
- } , _createAutocomplete = function _createAutocomplete ( ) {
114
- const config = __classPrivateFieldGet ( this , _instances , "m" , _mergeObjects ) . call ( this , __classPrivateFieldGet ( this , _instances , "m" , _getCommonConfig ) . call ( this ) , {
112
+ return __classPrivateFieldGet ( this , _default_1_instances , "m" , _default_1_mergeObjects ) . call ( this , config , this . tomSelectOptionsValue ) ;
113
+ } , _default_1_createAutocomplete = function _default_1_createAutocomplete ( ) {
114
+ const config = __classPrivateFieldGet ( this , _default_1_instances , "m" , _default_1_mergeObjects ) . call ( this , __classPrivateFieldGet ( this , _default_1_instances , "m" , _default_1_getCommonConfig ) . call ( this ) , {
115
115
maxOptions : this . selectElement ? this . selectElement . options . length : 50 ,
116
116
} ) ;
117
- return __classPrivateFieldGet ( this , _instances , "m" , _createTomSelect ) . call ( this , config ) ;
118
- } , _createAutocompleteWithHtmlContents = function _createAutocompleteWithHtmlContents ( ) {
119
- const config = __classPrivateFieldGet ( this , _instances , "m" , _mergeObjects ) . call ( this , __classPrivateFieldGet ( this , _instances , "m" , _getCommonConfig ) . call ( this ) , {
117
+ return __classPrivateFieldGet ( this , _default_1_instances , "m" , _default_1_createTomSelect ) . call ( this , config ) ;
118
+ } , _default_1_createAutocompleteWithHtmlContents = function _default_1_createAutocompleteWithHtmlContents ( ) {
119
+ const config = __classPrivateFieldGet ( this , _default_1_instances , "m" , _default_1_mergeObjects ) . call ( this , __classPrivateFieldGet ( this , _default_1_instances , "m" , _default_1_getCommonConfig ) . call ( this ) , {
120
120
maxOptions : this . selectElement ? this . selectElement . options . length : 50 ,
121
121
score : ( search ) => {
122
122
const scoringFunction = this . tomSelect . getScoreFunction ( search ) ;
123
123
return ( item ) => {
124
- return scoringFunction ( Object . assign ( Object . assign ( { } , item ) , { text : __classPrivateFieldGet ( this , _instances , "m" , _stripTags ) . call ( this , item . text ) } ) ) ;
124
+ return scoringFunction ( Object . assign ( Object . assign ( { } , item ) , { text : __classPrivateFieldGet ( this , _default_1_instances , "m" , _default_1_stripTags ) . call ( this , item . text ) } ) ) ;
125
125
} ;
126
126
} ,
127
127
render : {
@@ -133,9 +133,9 @@ _instances = new WeakSet(), _getCommonConfig = function _getCommonConfig() {
133
133
} ,
134
134
} ,
135
135
} ) ;
136
- return __classPrivateFieldGet ( this , _instances , "m" , _createTomSelect ) . call ( this , config ) ;
137
- } , _createAutocompleteWithRemoteData = function _createAutocompleteWithRemoteData ( autocompleteEndpointUrl , minCharacterLength ) {
138
- const config = __classPrivateFieldGet ( this , _instances , "m" , _mergeObjects ) . call ( this , __classPrivateFieldGet ( this , _instances , "m" , _getCommonConfig ) . call ( this ) , {
136
+ return __classPrivateFieldGet ( this , _default_1_instances , "m" , _default_1_createTomSelect ) . call ( this , config ) ;
137
+ } , _default_1_createAutocompleteWithRemoteData = function _default_1_createAutocompleteWithRemoteData ( autocompleteEndpointUrl , minCharacterLength ) {
138
+ const config = __classPrivateFieldGet ( this , _default_1_instances , "m" , _default_1_mergeObjects ) . call ( this , __classPrivateFieldGet ( this , _default_1_instances , "m" , _default_1_getCommonConfig ) . call ( this ) , {
139
139
firstUrl : ( query ) => {
140
140
const separator = autocompleteEndpointUrl . includes ( '?' ) ? '&' : '?' ;
141
141
return `${ autocompleteEndpointUrl } ${ separator } query=${ encodeURIComponent ( query ) } ` ;
@@ -174,17 +174,17 @@ _instances = new WeakSet(), _getCommonConfig = function _getCommonConfig() {
174
174
} ,
175
175
preload : this . preload ,
176
176
} ) ;
177
- return __classPrivateFieldGet ( this , _instances , "m" , _createTomSelect ) . call ( this , config ) ;
178
- } , _stripTags = function _stripTags ( string ) {
177
+ return __classPrivateFieldGet ( this , _default_1_instances , "m" , _default_1_createTomSelect ) . call ( this , config ) ;
178
+ } , _default_1_stripTags = function _default_1_stripTags ( string ) {
179
179
return string . replace ( / ( < ( [ ^ > ] + ) > ) / gi, '' ) ;
180
- } , _mergeObjects = function _mergeObjects ( object1 , object2 ) {
180
+ } , _default_1_mergeObjects = function _default_1_mergeObjects ( object1 , object2 ) {
181
181
return Object . assign ( Object . assign ( { } , object1 ) , object2 ) ;
182
- } , _createTomSelect = function _createTomSelect ( options ) {
183
- __classPrivateFieldGet ( this , _instances , "m" , _dispatchEvent ) . call ( this , 'autocomplete:pre-connect' , { options } ) ;
182
+ } , _default_1_createTomSelect = function _default_1_createTomSelect ( options ) {
183
+ __classPrivateFieldGet ( this , _default_1_instances , "m" , _default_1_dispatchEvent ) . call ( this , 'autocomplete:pre-connect' , { options } ) ;
184
184
const tomSelect = new TomSelect ( this . formElement , options ) ;
185
- __classPrivateFieldGet ( this , _instances , "m" , _dispatchEvent ) . call ( this , 'autocomplete:connect' , { tomSelect, options } ) ;
185
+ __classPrivateFieldGet ( this , _default_1_instances , "m" , _default_1_dispatchEvent ) . call ( this , 'autocomplete:connect' , { tomSelect, options } ) ;
186
186
return tomSelect ;
187
- } , _dispatchEvent = function _dispatchEvent ( name , payload ) {
187
+ } , _default_1_dispatchEvent = function _default_1_dispatchEvent ( name , payload ) {
188
188
this . element . dispatchEvent ( new CustomEvent ( name , { detail : payload , bubbles : true } ) ) ;
189
189
} ;
190
190
default_1 . values = {
0 commit comments