本文整理汇总了TypeScript中noml.ui类的典型用法代码示例。如果您正苦于以下问题:TypeScript ui类的具体用法?TypeScript ui怎么用?TypeScript ui使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ui类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: getMenuItem
getMenuItem(box: Mailbox) {
return ui.li()
.class('clickable')
.classIf(this.logic.isMailboxSelected(box.id), 'selected')
.onClick(_ => this.logic.gotoMailbox(box.id))
.child(ui.span(box.messages.length).class('count'), box.name);
}
开发者ID:adamduffy,项目名称:noml-examples,代码行数:7,代码来源:folders.ts
示例2: getBody
getBody(): ui.Element {
let box = this.logic.getSelectedMailbox();
if (!box) {
return ui.span('select a mailbox');
}
return ui.table().class('mailboxClass').child(
tableRowHeader('date', 'subject', 'from', 'to'),
this.getMessageRows(box)
);
}
开发者ID:adamduffy,项目名称:noml-examples,代码行数:10,代码来源:mailbox.ts
示例3: getBody
getBody() {
const input = ui.input('input').autocomplete(false).ref();
return ui.form(input, ui.button('submit')).onSubmit(() => {
const message = input.getValue();
input.setValue('');
input.focus();
if (message === '') {
return;
}
return this.logic.addEntry({message});
});
}
开发者ID:adamduffy,项目名称:noml-examples,代码行数:12,代码来源:addEntry.ts
示例4: getBody
getBody() {
const {logic} = this;
return ui.flexDown(
new AddEntry(logic),
ui.flexRight(
new ui.Tristate(logic.getEntries,
() => 'loading',
entries => new EntryList(logic).data(entries),
e => 'failed to load entries'
).refreshOn(logic.entriesChanged),
ui.flexDown(
ui.flexPad(),
ui.button('delete', () => logic.deleteEntry())
)
)
);
}
开发者ID:adamduffy,项目名称:noml-examples,代码行数:17,代码来源:todo.ts
示例5: getBody
getBody() {
const {folders, mailbox, message} = this.logic;
const messagePromise = ui.delayedPromise(message.getSelectedMessage).then(x => {
// throw new Error('failed to load message');
return x;
});
const hasMailbox = !!state.mailbox.selectedId;
const hasMessage = !!state.message.selectedId;
return ui.flexRight(
new Folders(folders, 'folders'),
ui.flexDown().class('mailContainer').child(
new Mailbox(mailbox, 'mailbox'),
new ui.Tristate(() => hasMailbox && hasMessage && messagePromise,
() => 'pending',
m => new MessageUi({getMessage: () => m}, 'message'),
e => ui.span(e.message).class('error')
)
)
);
}
开发者ID:adamduffy,项目名称:noml-examples,代码行数:23,代码来源:fullMailbox.ts
示例6:
e => ui.span(e.message).class('error')
开发者ID:adamduffy,项目名称:noml-examples,代码行数:1,代码来源:fullMailbox.ts
示例7: trThTd
function trThTd(th: string, td: string) {
return ui.tr(ui.th(th), ui.td(td));
}
开发者ID:adamduffy,项目名称:noml-examples,代码行数:3,代码来源:message.ts
示例8:
return ui.tr(Array.from(args, a => ui.td(a)));
开发者ID:adamduffy,项目名称:noml-examples,代码行数:1,代码来源:common.ts
示例9: tableRowData
export function tableRowData(...args): ui.Element {
return ui.tr(Array.from(args, a => ui.td(a)));
}
开发者ID:adamduffy,项目名称:noml-examples,代码行数:3,代码来源:common.ts
示例10: tableRowHeader
export function tableRowHeader(...args): ui.Element {
return ui.tr(Array.from(args, a => ui.th(a)));
}
开发者ID:adamduffy,项目名称:noml-examples,代码行数:3,代码来源:common.ts
注:本文中的noml.ui类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论