本文整理匯總了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);
}
示例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)
);
}
示例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});
});
}
示例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())
)
)
);
}
示例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')
)
)
);
}
示例6:
e => ui.span(e.message).class('error')
示例7: trThTd
function trThTd(th: string, td: string) {
return ui.tr(ui.th(th), ui.td(td));
}
示例8:
return ui.tr(Array.from(args, a => ui.td(a)));
示例9: tableRowData
export function tableRowData(...args): ui.Element {
return ui.tr(Array.from(args, a => ui.td(a)));
}
示例10: tableRowHeader
export function tableRowHeader(...args): ui.Element {
return ui.tr(Array.from(args, a => ui.th(a)));
}