Sha256: 1748a2eef987355cc32e28b2f124b24e883af87bfddd46f30eb0a9a8c71f53a0
Contents?: true
Size: 1.3 KB
Versions: 110
Compression:
Stored size: 1.3 KB
Contents
# frozen_string_literal: true module Ariadne # Add a general description of component here # Add additional usage considerations or best practices that may aid the user to use the component correctly. # @accessibility Add any accessibility considerations class RichTextAreaComponent < Ariadne::Component DEFAULT_TAG = :div DEFAULT_CLASSES = "" # @example Default # # <%= render(Ariadne::RichTextAreaComponent.new(name: "bodytext", sr_label: "Enter message contents")) { "Example" } %> # # @param name [Symbol] Identifies the form/param name for this rich text area. # @param sr_label [String] A label to introduce these tabs for screen readers. # @param has_form [Boolean] Indicates whether this component is wrapped in a form. # @param classes [String] <%= link_to_classes_docs %> # @param attributes [Hash] <%= link_to_attributes_docs %> def initialize(name:, sr_label:, has_form: true, classes: "", attributes: {}) @tag = DEFAULT_TAG @name = name @sr_label = sr_label @has_form = has_form @classes = merge_class_names( DEFAULT_CLASSES, classes, ) @attributes = attributes @attributes[:"data-controller"] = "rich-text-area-component" @attributes[:"data-has-form"] = true if @has_form end end end
Version data entries
110 entries across 110 versions & 1 rubygems