Prep for moving droplab to npm
This commit is contained in:
parent
06df12e999
commit
8db88bdf20
12 changed files with 537 additions and 2050 deletions
1
.babelrc
1
.babelrc
|
@ -8,7 +8,6 @@
|
|||
"plugins": [
|
||||
["istanbul", {
|
||||
"exclude": [
|
||||
"app/assets/javascripts/droplab/**/*",
|
||||
"spec/javascripts/**/*"
|
||||
]
|
||||
}],
|
||||
|
|
|
@ -5,6 +5,5 @@
|
|||
/public/
|
||||
/tmp/
|
||||
/vendor/
|
||||
/app/assets/javascripts/droplab
|
||||
karma.config.js
|
||||
webpack.config.js
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,4 +1,4 @@
|
|||
import droplabFilter from '../droplab/plugins/filter';
|
||||
import Filter from '@gitlab-org/droplab/dist/plugins/Filter';
|
||||
|
||||
require('./filtered_search_dropdown');
|
||||
|
||||
|
@ -7,7 +7,7 @@ require('./filtered_search_dropdown');
|
|||
constructor(droplab, dropdown, input, filter) {
|
||||
super(droplab, dropdown, input, filter);
|
||||
this.config = {
|
||||
droplabFilter: {
|
||||
Filter: {
|
||||
template: 'hint',
|
||||
filterFunction: gl.DropdownUtils.filterHint.bind(null, input),
|
||||
},
|
||||
|
@ -68,12 +68,12 @@ require('./filtered_search_dropdown');
|
|||
}
|
||||
});
|
||||
|
||||
this.droplab.changeHookList(this.hookId, this.dropdown, [droplabFilter], this.config);
|
||||
this.droplab.changeHookList(this.hookId, this.dropdown, [Filter], this.config);
|
||||
this.droplab.setData(this.hookId, dropdownData);
|
||||
}
|
||||
|
||||
init() {
|
||||
this.droplab.addHook(this.input, this.dropdown, [droplabFilter], this.config).init();
|
||||
this.droplab.addHook(this.input, this.dropdown, [Filter], this.config).init();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import droplabAjax from '../droplab/plugins/ajax';
|
||||
import droplabFilter from '../droplab/plugins/filter';
|
||||
import Ajax from '@gitlab-org/droplab/dist/plugins/Ajax';
|
||||
import Filter from '@gitlab-org/droplab/dist/plugins/Filter';
|
||||
|
||||
require('./filtered_search_dropdown');
|
||||
|
||||
|
@ -9,12 +9,12 @@ require('./filtered_search_dropdown');
|
|||
super(droplab, dropdown, input, filter);
|
||||
this.symbol = symbol;
|
||||
this.config = {
|
||||
droplabAjax: {
|
||||
Ajax: {
|
||||
endpoint,
|
||||
method: 'setData',
|
||||
loadingTemplate: this.loadingTemplate,
|
||||
},
|
||||
droplabFilter: {
|
||||
Filter: {
|
||||
filterFunction: gl.DropdownUtils.filterWithSymbol.bind(null, this.symbol, input),
|
||||
template: 'title',
|
||||
},
|
||||
|
@ -30,13 +30,13 @@ require('./filtered_search_dropdown');
|
|||
|
||||
renderContent(forceShowList = false) {
|
||||
this.droplab
|
||||
.changeHookList(this.hookId, this.dropdown, [droplabAjax, droplabFilter], this.config);
|
||||
.changeHookList(this.hookId, this.dropdown, [Ajax, Filter], this.config);
|
||||
super.renderContent(forceShowList);
|
||||
}
|
||||
|
||||
init() {
|
||||
this.droplab
|
||||
.addHook(this.input, this.dropdown, [droplabAjax, droplabFilter], this.config).init();
|
||||
.addHook(this.input, this.dropdown, [Ajax, Filter], this.config).init();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import droplabAjaxFilter from '../droplab/plugins/ajax_filter';
|
||||
import AjaxFilter from '@gitlab-org/droplab/dist/plugins/AjaxFilter';
|
||||
|
||||
require('./filtered_search_dropdown');
|
||||
|
||||
|
@ -7,7 +7,7 @@ require('./filtered_search_dropdown');
|
|||
constructor(droplab, dropdown, input, filter) {
|
||||
super(droplab, dropdown, input, filter);
|
||||
this.config = {
|
||||
droplabAjaxFilter: {
|
||||
AjaxFilter: {
|
||||
endpoint: `${gon.relative_url_root || ''}/autocomplete/users.json`,
|
||||
searchKey: 'search',
|
||||
params: {
|
||||
|
@ -28,7 +28,7 @@ require('./filtered_search_dropdown');
|
|||
}
|
||||
|
||||
renderContent(forceShowList = false) {
|
||||
this.droplab.changeHookList(this.hookId, this.dropdown, [droplabAjaxFilter], this.config);
|
||||
this.droplab.changeHookList(this.hookId, this.dropdown, [AjaxFilter], this.config);
|
||||
super.renderContent(forceShowList);
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ require('./filtered_search_dropdown');
|
|||
}
|
||||
|
||||
init() {
|
||||
this.droplab.addHook(this.input, this.dropdown, [droplabAjaxFilter], this.config).init();
|
||||
this.droplab.addHook(this.input, this.dropdown, [AjaxFilter], this.config).init();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import DropLab from '../droplab/droplab';
|
||||
import DropLab from '@gitlab-org/droplab';
|
||||
import FilteredSearchContainer from './container';
|
||||
|
||||
(() => {
|
||||
|
|
Loading…
Reference in a new issue