Sha256: af17f774e63aa0ac1ccc301ae66f6f7729e40a9688dec4e9d4a2cfd7934b9218
Contents?: true
Size: 1.3 KB
Versions: 91
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 = 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
91 entries across 91 versions & 1 rubygems