How to use the lit-html/lib/repeat.js.repeat 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 notwaldorf / flash-cards / src / components / stats-page.js View on Github external
${repeat(Object.keys(_cards), kind =>
        html`
        <div class="column">
          <h3>${kind}</h3>
          <div class="list">
            ${repeat(Object.keys(_cards[kind]), entry =&gt; html`
              <div>
                <div title="${_cards[kind][entry].jp}" class="jp ellipsis">${_cards[kind][entry].jp}</div>
                <div title="${_cards[kind][entry].en}" class="en ellipsis">${_cards[kind][entry].en}</div>
              </div>
            `)}
          </div>
        </div>
        `
      )}
github e-xtrategy / frameworkless-frontend-development-workshop / toolkit / rendering / lit-html / src / list / components / team-selection / team-selection.js View on Github external
export default (value, teams = []) =&gt; html`
<div class="select full-width">
    <select role="select-team">
        <option value="-1">Select...</option>
        ${repeat(teams, (team) =&gt; html`<option value="${team}">${team}</option>`)}
    </select>
    <i class="fa fa-angle-down fa-2"></i>
</div>
`
github notwaldorf / flash-cards / src / components / play-page.js View on Github external
a-card, #settings {
        box-sizing: border-box;
        max-width: 400px;
        width: 100%;
      }
      h4 {
        line-height: 1;
      }
      

      <div id="settings">
        
        

        <h4>Pick from</h4>
        ${repeat(Object.keys(_cards), kind =&gt;
          kind &amp;&amp;
          html`
            
          `

        )}

        <h4>Ask me...</h4>
        
        <br>
        
        <br></div>
github e-xtrategy / frameworkless-frontend-development-workshop / toolkit / rendering / lit-html / src / list / components / user-table / user-table.js View on Github external
export default data =&gt; {
  const teams = extractTeams(data)

  const table = html`
  
      ${repeat(data, user =&gt; createRow(user, teams))}
    <table>
    <thead>
        <tr>
            <th>Photo</th>
            <th>Name</th>
            <th>Email</th>
            <th>Team</th>
        </tr>
    </thead>
    <tbody></tbody>
  </table>
  `
  return table
}
github e-xtrategy / frameworkless-frontend-development-workshop / toolkit / rendering / lit-html / src / list / components / dashboard / dashboard.js View on Github external
export default data =&gt; {
  const teamData = extractTeamData(data)

  const dashboard = html`
    <div>
      ${repeat(Object.keys(teamData), teamName =&gt; createTeamWidget(teamName, teamData[teamName]))}
    </div>
  `

  return dashboard
}
github notwaldorf / flash-cards / src / components / stats-page.js View on Github external
font-size: 20px;
          font-weight: bold;
        }
        .en {
          font-size: 12px;
          font-weight: normal;
        }
        .ellipsis {
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
        }
      

      <div class="columns">
      ${repeat(Object.keys(_cards), kind =&gt;
        html`
        <div class="column">
          <h3>${kind}</h3>
          <div class="list">
            ${repeat(Object.keys(_cards[kind]), entry =&gt; html`
              <div>
                <div title="${_cards[kind][entry].jp}" class="jp ellipsis">${_cards[kind][entry].jp}</div>
                <div title="${_cards[kind][entry].en}" class="en ellipsis">${_cards[kind][entry].en}</div>
              </div>
            `)}
          </div>
        </div>
        `
      )}
      </div>
    `;