How to use the lit-html/directives/until.until function in lit-html

To help you get started, we’ve selected a few lit-html examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github motss / app-datepicker / src / demo / app-datepicker-configurator.ts View on Github external
if (key === 'locale') {
        const fetchLocales = async () => {
          const r = await fetch('/src/demo/locales.json');
          const d: Locale[] = await r.json();
          return d.map(n =&gt; html`<option value="${n.code}">${n.name}</option>`);
        };

        // tslint:disable: max-line-length
        return html`<div class="container__prop">
          <label>
            <span>${key}</span>
            <select value="${value}">${until(fetchLocales(), nothing)}</select>
          </label>
        </div>`;
        // tslint:enable: max-line-length
      }

      return html`<div class="container__prop">
        <label>
          <span>${key}</span>
          <input value="${value}" type="${inputType}">
        </label>
      </div>`;
    });
github padloc / padloc / packages / app / src / elements / item-dialog.ts View on Github external
<div>${$l("Attachment")}</div>
                    

                    <button class="icon tap">
                        
                        <div>${$l("Move")}</div>
                    </button>

                    <button class="icon tap negative">
                        
                        <div>${$l("Delete")}</div>
                    </button>
                

                <div class="updated">
                    ${until(formatDateFromNow(updated!))}
                    ${updatedByMember &amp;&amp; " " + $l("by {0}", updatedByMember.email)}
                </div>
            

            <div class="fabs">
                <div class="flex"></div>

                 this.edit()} ?disabled=${readonly}&gt; 
            </div>

            <div class="fabs">
                <button class="primary icon fab tap save-button">
                    
                    <div>${$l("Save")}</div>
                </button>
</div>
github home-assistant / home-assistant-polymer / src / panels / config / users / ha-user-editor.ts View on Github external
${user.group_ids[0] === SYSTEM_GROUP_ID_USER
              ? html`
                  <table class="card-content">
            <tbody><tr>
              <td>${hass.localize("ui.panel.config.users.editor.id")}</td>
              <td>${user.id}</td>
            </tr>
            <tr>
              <td>${hass.localize("ui.panel.config.users.editor.owner")}</td>
              <td>${user.is_owner}</td>
            </tr>
            <tr>
              <td>${hass.localize("ui.panel.config.users.editor.group")}</td>
              <td>
                <select> user.group_ids[0])
                  )}
                &gt;
                  ${GROUPS.map(
                    (groupId) =&gt; html`
                      <option value="${groupId}">
                        ${hass.localize(`groups.${groupId}`)}
                      </option>
                    `
                  )}
                </select>
              </td>
            </tr><tr></tr></tbody></table>
github edbzn / reactive-blog / src / client / app / home / twitter-feed.component.ts View on Github external
padding-top: 40px;
        margin-top: 40px;
        border-top: 2px solid #f8f8f8;
      }

      article {
        padding: 1.4rem;
        margin-bottom: 4px;
        background: #f8f8f8;
        border-radius: 2px;
        color: #585858;
      }
    
    <section class="twitter-feed">
      <h4>TWEETS</h4>
      ${until(getTweets().then(resp =&gt; showTweets(resp)), showPlaceholder())}
    </section>
  `;
};
github padloc / padloc / packages / app / src / elements / invite-item.ts View on Github external
${$l("Confirm")}
            

            <div class="invite-code">
                <div class="invite-code-label">${$l("Confirmation Code:")}</div>

                <div class="invite-code-value">${until(secret)}</div>
            </div>
        `;
    }
}
github zazuko / openlayers-elements / elements / ol-swiss-cantons.ts View on Github external
render() {
        return html`
<style>
    :host {
        --canton-loading-control-bottom: 20px;
        --canton-loading-control-left: 10px;
    }

    #canton-loading { color: red }
</style>

    
    ${this.noMap ? '' : html``}
    ${until(this.cantonLayers, html`Loading cantons...`)}
`
    }
}
github padloc / padloc / packages / app / src / elements / invite-item.ts View on Github external
await inv.unlock(org.invitesKey);
                return inv.secret;
            })();
        }

        return html`
            

            <div class="invite-info">
                <div class="invite-email ellipsis">${inv.email}</div>

                <div class="tags small">
                    <div class="tag ${status.class}">
                        

                        <div>${until(status.text)}</div>
                    </div>
                </div>
            </div>

            
                ${$l("Confirm")}
            

            <div class="invite-code">
                <div class="invite-code-label">${$l("Confirmation Code:")}</div>

                <div class="invite-code-value">${until(secret)}</div></div>
github padloc / padloc / packages / app / src / elements / randomart.ts View on Github external
render() {
        return html`
            ${until(this._grid())}
        `;
    }
}
github google / skia-buildbot / am / modules / incident-sk / incident-sk.js View on Github external
${notes(ele)}
    <section class="addNote">
      <textarea cols="80" rows="2"></textarea>
      <button>Submit</button>
    </section>
    <section class="matchingSilences">
      <span class="matchingSilencesHeaders">
        <h3>Matching Silences</h3>
        
        
      </span>
      ${matchingSilences(ele)}
    </section>
    <section class="history">
      <h3>History</h3>
      ${until(history(ele), html`<div class="loading">Loading...</div>`)}
    </section>
  
`;
github LarsDenBakker / lit-html-examples / src / 3-advanced / 03-until-directive.js View on Github external
render() {
    return html`
      <div>
        
        ${until(this.messageRequest, html`Loading...`)}

        <button>
          Fetch message
        </button>
      </div>
    `;
  }