salix/modules/order/front/catalog-search-panel/index.js

43 lines
825 B
JavaScript
Raw Normal View History

import ngModule from '../module';
2018-12-27 11:54:16 +00:00
import SearchPanel from 'core/components/searchbar/search-panel';
2020-09-08 08:11:22 +00:00
class Controller extends SearchPanel {
constructor($element, $) {
super($element, $);
this.filter = {};
}
get filter() {
return this.$.filter;
}
set filter(value) {
if (!value)
value = {};
2020-09-14 05:42:43 +00:00
if (!value.values)
value.values = [{}];
2020-09-08 08:11:22 +00:00
this.$.filter = value;
}
2020-09-14 05:42:43 +00:00
addValue() {
this.filter.values.push({});
2023-06-08 08:25:25 +00:00
setTimeout(() => this.parentPopover.relocate());
2020-09-14 05:42:43 +00:00
}
changeTag() {
2020-09-08 08:11:22 +00:00
}
}
ngModule.vnComponent('vnOrderCatalogSearchPanel', {
template: require('./index.html'),
2020-09-08 08:11:22 +00:00
controller: Controller,
bindings: {
2020-09-08 08:11:22 +00:00
onSubmit: '&?',
2023-06-08 08:25:25 +00:00
parentPopover: '<?',
2020-09-16 07:54:04 +00:00
resultTags: '<?'
}
});