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": [
|
"plugins": [
|
||||||
["istanbul", {
|
["istanbul", {
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"app/assets/javascripts/droplab/**/*",
|
|
||||||
"spec/javascripts/**/*"
|
"spec/javascripts/**/*"
|
||||||
]
|
]
|
||||||
}],
|
}],
|
||||||
|
|
|
@ -5,6 +5,5 @@
|
||||||
/public/
|
/public/
|
||||||
/tmp/
|
/tmp/
|
||||||
/vendor/
|
/vendor/
|
||||||
/app/assets/javascripts/droplab
|
|
||||||
karma.config.js
|
karma.config.js
|
||||||
webpack.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');
|
require('./filtered_search_dropdown');
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ require('./filtered_search_dropdown');
|
||||||
constructor(droplab, dropdown, input, filter) {
|
constructor(droplab, dropdown, input, filter) {
|
||||||
super(droplab, dropdown, input, filter);
|
super(droplab, dropdown, input, filter);
|
||||||
this.config = {
|
this.config = {
|
||||||
droplabFilter: {
|
Filter: {
|
||||||
template: 'hint',
|
template: 'hint',
|
||||||
filterFunction: gl.DropdownUtils.filterHint.bind(null, input),
|
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);
|
this.droplab.setData(this.hookId, dropdownData);
|
||||||
}
|
}
|
||||||
|
|
||||||
init() {
|
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 Ajax from '@gitlab-org/droplab/dist/plugins/Ajax';
|
||||||
import droplabFilter from '../droplab/plugins/filter';
|
import Filter from '@gitlab-org/droplab/dist/plugins/Filter';
|
||||||
|
|
||||||
require('./filtered_search_dropdown');
|
require('./filtered_search_dropdown');
|
||||||
|
|
||||||
|
@ -9,12 +9,12 @@ require('./filtered_search_dropdown');
|
||||||
super(droplab, dropdown, input, filter);
|
super(droplab, dropdown, input, filter);
|
||||||
this.symbol = symbol;
|
this.symbol = symbol;
|
||||||
this.config = {
|
this.config = {
|
||||||
droplabAjax: {
|
Ajax: {
|
||||||
endpoint,
|
endpoint,
|
||||||
method: 'setData',
|
method: 'setData',
|
||||||
loadingTemplate: this.loadingTemplate,
|
loadingTemplate: this.loadingTemplate,
|
||||||
},
|
},
|
||||||
droplabFilter: {
|
Filter: {
|
||||||
filterFunction: gl.DropdownUtils.filterWithSymbol.bind(null, this.symbol, input),
|
filterFunction: gl.DropdownUtils.filterWithSymbol.bind(null, this.symbol, input),
|
||||||
template: 'title',
|
template: 'title',
|
||||||
},
|
},
|
||||||
|
@ -30,13 +30,13 @@ require('./filtered_search_dropdown');
|
||||||
|
|
||||||
renderContent(forceShowList = false) {
|
renderContent(forceShowList = false) {
|
||||||
this.droplab
|
this.droplab
|
||||||
.changeHookList(this.hookId, this.dropdown, [droplabAjax, droplabFilter], this.config);
|
.changeHookList(this.hookId, this.dropdown, [Ajax, Filter], this.config);
|
||||||
super.renderContent(forceShowList);
|
super.renderContent(forceShowList);
|
||||||
}
|
}
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
this.droplab
|
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');
|
require('./filtered_search_dropdown');
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ require('./filtered_search_dropdown');
|
||||||
constructor(droplab, dropdown, input, filter) {
|
constructor(droplab, dropdown, input, filter) {
|
||||||
super(droplab, dropdown, input, filter);
|
super(droplab, dropdown, input, filter);
|
||||||
this.config = {
|
this.config = {
|
||||||
droplabAjaxFilter: {
|
AjaxFilter: {
|
||||||
endpoint: `${gon.relative_url_root || ''}/autocomplete/users.json`,
|
endpoint: `${gon.relative_url_root || ''}/autocomplete/users.json`,
|
||||||
searchKey: 'search',
|
searchKey: 'search',
|
||||||
params: {
|
params: {
|
||||||
|
@ -28,7 +28,7 @@ require('./filtered_search_dropdown');
|
||||||
}
|
}
|
||||||
|
|
||||||
renderContent(forceShowList = false) {
|
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);
|
super.renderContent(forceShowList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ require('./filtered_search_dropdown');
|
||||||
}
|
}
|
||||||
|
|
||||||
init() {
|
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';
|
import FilteredSearchContainer from './container';
|
||||||
|
|
||||||
(() => {
|
(() => {
|
||||||
|
|
Loading…
Reference in a new issue