Sha256: 7f97073b767acff4ade91f369d465821044b3c4da3f9c059d29f4b1de9560349

Contents?: true

Size: 486 Bytes

Versions: 7

Compression:

Stored size: 486 Bytes

Contents

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

export class List {
  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 `<ul ${htmlAttributes(this.attributes)}>${this.children.map(child => child.renderWrapper).join("")}</ul>`;
  }
}

Version data entries

7 entries across 7 versions & 1 rubygems

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