Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import PowerOptions from 'ember-power-select/components/power-select/options';
import layout from '../templates/components/paper-select-options';
export default PowerOptions.extend({
layout,
tagName: 'md-content',
init() {
if (this.get('role') === 'group') {
this.set('tagName', '');
this.set('attributeBindings', undefined);
}
this._super(...arguments);
},
didInsertElement() {
if (this.get('role') === 'group') {
return;
}
let findOptionAndPerform = (action, e) => {
let optionItem = e.target.closest('[data-option-index]');
if (!optionItem) {
import { get } from '@ember/object';
import PowerOptions from 'ember-power-select/components/power-select/options';
import layout from '../templates/components/paper-autocomplete-options';
export default PowerOptions.extend({
layout,
_optionFromIndex(index) {
let parts = index.split('.');
let options = this.get('options');
let option = options[parseInt(parts[0], 10)];
for (let i = 1; i < parts.length; i++) {
option = option.options[parseInt(parts[i], 10)];
}
return option !== undefined ? get(option, 'raw') : option;
}
});
//component/lazy-options.js
import Ember from 'ember';
import layout from './template';
import PSOptionsComponent from 'ember-power-select/components/power-select/options';
const {
$,
assert,
get,
} = Ember;
const OptionsComponent = PSOptionsComponent.extend({
layout,
canLoadMore: false,
init() {
this._super(...arguments);
assert(': You must provide a closure action name `loadMore`', get(this, 'loadMore') && typeof get(this, 'loadMore') === 'function');
},
didInsertElement() {
this._super(...arguments);
const checkVisibility = () => {
if ($(this.element).find('.ember-power-select-option--load-more').checkInView(true)) {
const loadMore = get(this, 'loadMore');
return loadMore();
}
};
$(this.element).on('scroll', () => checkVisibility());
},
import OptionsComponent from 'ember-power-select/components/power-select/options';
import layout from '../../templates/components/model-select/options';
import { computed } from '@ember/object';
export default OptionsComponent.extend({
layout,
showLoader: computed('infiniteScroll', 'infiniteModel', 'select.loading', function(){
return this.get('infiniteScroll') && this.get('infiniteModel') && !this.get('select.loading') ;
})
});