Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
arr() {
if (!this.datas && !this.dict) {
console.error('[HeyUI Error] Switchlist Component: Datas or dict parameters need to be defined at least.');
return [];
}
let datas = this.datas;
if (this.dict) {
datas = config.getDict(this.dict);
}
return config.initOptions(datas, this);
}
}
arr() {
if (!this.datas && !this.dict) {
console.error('[HeyUI Error] Steps Component: Datas or dict parameters need to be defined at least.');
return [];
}
let datas = this.datas;
if (this.dict) {
datas = config.getDict(this.dict);
}
return config.initOptions(datas, this);
}
}
options() {
if (!this.datas && !this.dict) {
console.error('[HeyUI Error] Dropdownmenu Component: Datas or dict parameters need to be defined at least.');
return [];
}
let datas = this.datas;
if (this.dict) {
datas = config.getDict(this.dict);
}
datas = config.initOptions(datas, this);
return datas;
}
},
options() {
if (!this.datas && !this.dict) {
console.error('[HeyUI Error] Select Component: Datas or dict parameters need to be defined at least.');
return [];
}
let datas = this.datas;
if (this.dict) {
datas = config.getDict(this.dict);
}
datas = config.initOptions(datas, this);
if (!this.multiple && this.hasNullOption) {
datas.unshift({
[`${this.keyName}`]: null,
[`${this.titleName}`]: this.showNullOptionText,
[`${this.html}`]: this.showNullOptionText
});
}
return datas;
}
}
arr() {
if (!this.datas && !this.dict) {
console.error('[HeyUI Error] Tabs Component: Datas or dict parameters need to be defined at least.');
return [];
}
let datas = this.datas;
if (this.dict) {
datas = config.getDict(this.dict);
}
return config.initOptions(datas, this);
}
}
arr() {
if (!this.datas && !this.dict) {
return [];
}
let datas = this.datas;
if (this.dict) {
datas = config.getDict(this.dict);
}
return config.initOptions(datas, this);
}
}
results() {
let datas = this.datas;
if (this.dict) {
datas = config.getDict(this.dict);
}
if (utils.isNull(datas)) {
datas = this.loadDatas;
} else {
datas = config.initOptions(datas, this);
if (this.searchValue) {
let searchValue = this.searchValue.toLowerCase();
datas = datas.filter(item => {
return ((item.html || item[this.param.titleName] || '').toLowerCase().indexOf(searchValue) != -1);
});
}
}
if (this.objects.length > 0) {
let keyArray = utils
.getArray(this.objects, 'key')
.filter(item => !utils.isNull(item));
datas = datas.filter(item => {
return keyArray.indexOf(item[this.param.keyName]) == -1;
});
}
let results = [];