Sha256: 07d4aa8280e7edd364de6c34d9add1e0f86aa5c63d747cd4982ca81b31457002

Contents?: true

Size: 494 Bytes

Versions: 7

Compression:

Stored size: 494 Bytes

Contents

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

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

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

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

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

Version data entries

7 entries across 7 versions & 1 rubygems

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