當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript noml.ui類代碼示例

本文整理匯總了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;未經允許,請勿轉載。