Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 154 lines (131 sloc) 4.96 KB
//Auto-generated by UXL Compiler
//Source: web/views/app.uxl.xml
//2#
part of todoMVC;
/** Template, TodoMVCTemplate, for creating views. */
List<View> TodoMVCTemplate({View parent, list}) { //6#
List<View> _rv = new List(); View _this_;
final _c0 = new TodoAppControl(list);
final app = _c0;
List<View> _c0T({View parent, View beforeChild}) { //7#
List<View> _rva = new List(); View _this_;
//7# <View layout="type: linear; orient:...>
final _va0 = _this_ = (_c0.view == null ? _c0.view = new View(): new View())
..layout.text = '''type: linear; orient: vertical; spacing: 0'''
..width = 550
..profile.text = '''location: center top''';
if (parent != null)
parent.addChild(_va0, beforeChild);
_rva.add(_va0);
//9# <TextView class="h1" text="todos">
final _va0_0 = _this_ = new TextView()
..classes.add("h1")
..text = '''todos''';
_va0.addChild(_va0_0);
//10# <View id="todo-app" layout="type: li...>
final _va0_1 = _this_ = new View()
..id = '''todo-app'''
..layout.text = '''type: linear; orient: vertical; spacing: 0''';
_va0.addChild(_va0_1);
//11# <View id="header-bar">
final _va0_1_0 = _this_ = new View()
..id = '''header-bar''';
_va0_1.addChild(_va0_1_0);
//12# <View tag="section" id="header">
final _va0_1_1 = _this_ = new View.tag('section')
..id = '''header''';
_va0_1.addChild(_va0_1_1);
//13# <CheckBox id="toggle-all" value="${a...>
final _va0_1_1_0 = _this_ = new CheckBox()
..id = '''toggle-all'''
..value = app.activeCount == 0
..visible = !app.todos.isEmpty
..on.change.listen((_e){
_c0.selectAll(_e);});
_va0_1_1.addChild(_va0_1_1_0);
//15# <TextBox id="new-todo" placeholder="...>
final _va0_1_1_1 = _this_ = new TextBox()
..id = '''new-todo'''
..placeholder = '''What needs to be done?'''
..on.keyUp.listen((_e){
_c0.enterNewTodo(_e);});
_va0_1_1.addChild(_va0_1_1_1);
//17# <View tag="ul" id="todo-list" layout...>
final _va0_1_2 = _this_ = new View.tag('ul')
..id = '''todo-list'''
..layout.text = '''type: linear; orient: vertical; spacing: 0''';
_va0_1.addChild(_va0_1_2);
for (var t in app.todos) {
final _ca0 = new TodoItemControl(app, t);
List<View> _ca0T({View parent, View beforeChild}) { //19#
List<View> _rvb = new List(); View _this_;
//19# <View tag="li" class="${t.completed...>
final _vb0 = _this_ = (_ca0.view == null ? _ca0.view = new View.tag('li'): new View.tag('li'))
..classes.addAll('''${t.completed ? 'completed' : ''}'''.split(' '));
if (parent != null)
parent.addChild(_vb0, beforeChild);
_rvb.add(_vb0);
//20# <View class="show">
final _vb0_0 = _this_ = new View()
..classes.add("show");
_vb0.addChild(_vb0_0);
//21# <CheckBox class="toggle" value="${t....>
final _vb0_0_0 = _this_ = new CheckBox()
..classes.add("toggle")
..value = t.completed
..on.change.listen((_e){
_ca0.toggleCompleted(_e);});
_vb0_0.addChild(_vb0_0_0);
//22# <TextView class="title" text="${t.ti...>
final _vb0_0_1 = _this_ = new TextView()
..classes.add("title")
..text = t.title
..on.doubleClick.listen((_e){
_ca0.editTitle(_e);});
_vb0_0.addChild(_vb0_0_1);
//23# <Button class="destroy" on.click="de...>
final _vb0_0_2 = _this_ = new Button()
..classes.add("destroy")
..on.click.listen((_e){
_ca0.destroy(_e);});
_vb0_0.addChild(_vb0_0_2);
//25# <TextBox class="edit" profile="width...>
final _vb0_1 = _this_ = new TextBox()
..classes.add("edit")
..profile.text = '''width: ignore; height: ignore'''
..value = t.title
..on.blur.listen((_e){
_ca0.submitTitle(_e);})
..on.keyUp.listen((_e){
_ca0.enterTitle(_e);});
_vb0.addChild(_vb0_1);
return _rvb;
}
_ca0.template = _ca0T;
final _va0_1_2_0 = _ca0T(parent: _va0_1_2)[0];
_ca0.onRender();
}
//31# <View tag="footer" id="footer">
final _va0_2 = _this_ = new View.tag('footer')
..id = '''footer''';
_va0.addChild(_va0_2);
//32# <TextView id="todo-count" html="<str...>
final _va0_2_0 = _this_ = new TextView()
..id = '''todo-count'''
..html = '''<strong>${app.activeCount}</strong> item${app.activeCount!=1?'s':''} left''';
_va0_2.addChild(_va0_2_0);
//33# <Button id="clear-completed" text="C...>
final _va0_2_1 = _this_ = new Button()
..id = '''clear-completed'''
..text = '''Clear completed (${app.completedCount})'''
..on.click.listen((_e){
_c0.clearCompleted(_e);});
_va0_2.addChild(_va0_2_1);
return _rva;
}
_c0.template = _c0T;
final _v0 = _c0T(parent: parent)[0];
_rv.add(_v0);
_c0.onRender();
return _rv;
}