Added autocomplete for fields that expect variable names
This commit is contained in:
@@ -56,21 +56,16 @@
|
||||
watch: {
|
||||
'value': {
|
||||
immediate: true,
|
||||
handler(newValue, oldValue){
|
||||
handler(newValue){
|
||||
let newIcon = proficiencyIcon(newValue);
|
||||
if (!oldValue){
|
||||
// Skip animation
|
||||
this.iconClass='leaving';
|
||||
setTimeout(() => {
|
||||
this.displayedIcon = newIcon;
|
||||
} else {
|
||||
this.iconClass='leaving';
|
||||
setTimeout(() => {
|
||||
this.displayedIcon = newIcon;
|
||||
this.iconClass='arriving';
|
||||
requestAnimationFrame(() => {
|
||||
this.iconClass='';
|
||||
});
|
||||
}, ICON_SPIN_DURATION / 2);
|
||||
}
|
||||
this.iconClass='arriving';
|
||||
requestAnimationFrame(() => {
|
||||
this.iconClass='';
|
||||
});
|
||||
}, ICON_SPIN_DURATION / 2);
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import createListOfProperties from '/imports/ui/properties/forms/shared/lists/createListOfProperties.js';
|
||||
|
||||
const attributeListMixin = {
|
||||
meteor: {
|
||||
attributeList(){
|
||||
return createListOfProperties({type: 'attribute'});
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default attributeListMixin;
|
||||
@@ -0,0 +1,21 @@
|
||||
import CreatureProperties from '/imports/api/creature/CreatureProperties.js';
|
||||
import LibraryNodes from '/imports/api/library/LibraryNodes.js';
|
||||
|
||||
export default function createListOfProperties(filter = {}){
|
||||
filter.removed = {$ne: true};
|
||||
let propertyList = [];
|
||||
let variableNames = new Set();
|
||||
function addUniquePropertys(property){
|
||||
if (property.variableName && !variableNames.has(property.variableName)){
|
||||
variableNames.add(property.variableName);
|
||||
propertyList.push({
|
||||
text: property.name || property.variableName,
|
||||
value: property.variableName,
|
||||
propertyType: property.propertyType,
|
||||
});
|
||||
}
|
||||
}
|
||||
CreatureProperties.find(filter).forEach(addUniquePropertys);
|
||||
LibraryNodes.find(filter).forEach(addUniquePropertys);
|
||||
return Array.from(variableNames);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import createListOfProperties from '/imports/ui/properties/forms/shared/lists/createListOfProperties.js'
|
||||
|
||||
const skillListMixin = {
|
||||
meteor: {
|
||||
skillList(){
|
||||
return createListOfProperties({type: 'skill'});
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default skillListMixin;
|
||||
Reference in New Issue
Block a user