Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getChildrenNodes: function(this: TodoFooter): (DNode | null)[] {
const { activeCount, activeFilter, completedCount } = this.properties;
const countLabel = activeCount === 1 ? 'item' : 'items';
return [
v('span', { 'class': 'todo-count' }, [
v('strong', [activeCount + ' ']),
v('span', [countLabel + ' left'])
]),
w(createTodoFilter, {
classes: [ 'filters' ],
activeFilter
}),
completedCount ? w(createButton, {
onClick: clearCompleted,
label: 'Clear completed',
classes: [ 'clear-completed' ]
}) : null
];
}
}
return filters.map((filterItem) => {
const label = filterItem[0].toUpperCase() + filterItem.substring(1);
return v('li', {}, [
v('a', {
innerHTML: label,
href: `#${filterItem}`,
classes: {
selected: activeFilter === filterItem
}
})
]);
});
}
getChildrenNodes: function(this: TodoFooter): (DNode | null)[] {
const { activeCount, activeFilter, completedCount } = this.properties;
const countLabel = activeCount === 1 ? 'item' : 'items';
return [
v('span', { 'class': 'todo-count' }, [
v('strong', [activeCount + ' ']),
v('span', [countLabel + ' left'])
]),
w(createTodoFilter, {
classes: [ 'filters' ],
activeFilter
}),
completedCount ? w(createButton, {
onClick: clearCompleted,
label: 'Clear completed',
classes: [ 'clear-completed' ]
}) : null
];
}
}
return filters.map((filterItem) => {
const label = filterItem[0].toUpperCase() + filterItem.substring(1);
return v('li', {}, [
v('a', {
innerHTML: label,
href: `#${filterItem}`,
classes: {
selected: activeFilter === filterItem
}
})
]);
});
}
getChildrenNodes: function(this: TodoItem): (DNode | null)[] {
const { properties: { id: todoId, completed: checked, label, editing: focused = false } } = this;
return [
v('div.view', [
w(createCheckboxInput, { classes: [ 'toggle' ], checked, onChange: bind(todoToggleComplete, this) }),
w(createLabel, { label, onDblclick: bind(todoEdit, this), onKeypress: bind(todoEdit, this) }),
w(createButton, { classes: [ 'destroy' ], onClick: bind(todoRemove, this) })
]),
focused ? w(createFocusableTextInput, {
value: label,
id: todoId,
focused, classes: [ 'edit' ],
onBlur: bind(todoSave, this),
onKeyUp: bind(todoEditInput, this)
}) : null
];
}
}