Sha256: 712e5c0978292723cd1baf57f7aafaf2f5b3b6ae67eac6af8b9eafccd3a2361d

Contents?: true

Size: 490 Bytes

Versions: 7

Compression:

Stored size: 490 Bytes

Contents

import { htmlAttributes } from "../html/html-attributes";

export class ListItem {
  attributes: Record<string, any>;
  children: any[];

  constructor(attributes: Record<string, any> = {}) {
    this.children = [];
    this.attributes = attributes;
  }

  add(child: any): this {
    this.children.push(child);
    return this;
  }

  get renderWrapper(): string {
    return `<li ${htmlAttributes(this.attributes)}>${this.children.map(child => child.renderWrapper).join("")}</li>`;
  }
}

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
clapton-0.0.24 lib/clapton/javascripts/src/components/list-item.ts
clapton-0.0.23 lib/clapton/javascripts/src/components/list-item.ts
clapton-0.0.22 lib/clapton/javascripts/src/components/list-item.ts
clapton-0.0.21 lib/clapton/javascripts/src/components/list-item.ts
clapton-0.0.20 lib/clapton/javascripts/src/components/list-item.ts
clapton-0.0.19 lib/clapton/javascripts/src/components/list-item.ts
clapton-0.0.18 lib/clapton/javascripts/src/components/list-item.ts