Sha256: 9f2db605d82c35579b1bdcf7120d7814a5dd0115276351d4d2eb6d36a086f3c7

Contents?: true

Size: 476 Bytes

Versions: 17

Compression:

Stored size: 476 Bytes

Contents

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

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

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

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

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

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
clapton-0.0.17 lib/clapton/javascripts/src/components/form.ts
clapton-0.0.16 lib/clapton/javascripts/src/components/form.ts
clapton-0.0.15 lib/clapton/javascripts/src/components/form.ts
clapton-0.0.14 lib/clapton/javascripts/src/components/form.ts
clapton-0.0.13 lib/clapton/javascripts/src/components/form.ts
clapton-0.0.12 lib/clapton/javascripts/src/components/form.ts
clapton-0.0.11 lib/clapton/javascripts/src/components/form.ts
clapton-0.0.10 lib/clapton/javascripts/src/components/form.ts
clapton-0.0.9 lib/clapton/javascripts/src/components/form.ts
clapton-0.0.8 lib/clapton/javascripts/src/components/form.ts
clapton-0.0.7 lib/clapton/javascripts/src/components/form.ts
clapton-0.0.6 lib/clapton/javascripts/src/components/form.ts
clapton-0.0.5 lib/clapton/javascripts/src/components/form.ts
clapton-0.0.4 lib/clapton/javascripts/src/components/form.ts
clapton-0.0.3 lib/clapton/javascripts/src/components/form.ts
clapton-0.0.2 lib/clapton/javascripts/src/components/form.ts
clapton-0.0.1 lib/clapton/javascripts/src/components/form.ts