Class: Shoelace::Components::SlColorPicker

Inherits:
ActionView::Helpers::Tags::ColorField
  • Object
show all
Includes:
ErrorWrappable
Defined in:
app/helpers/shoelace/components/sl_color_picker.rb

Overview

:nodoc:

Constant Summary collapse

RGB_VALUE_REGEX =
/#[0-9a-fA-F]{6}/.freeze

Instance Method Summary collapse

Methods included from ErrorWrappable

#error_wrapping

Instance Method Details

#field_typeObject



12
# File 'app/helpers/shoelace/components/sl_color_picker.rb', line 12

def field_type; nil; end

#renderObject



18
19
20
21
# File 'app/helpers/shoelace/components/sl_color_picker.rb', line 18

def render
  @options["invalid"] = @options["data-invalid"] = "" if object_has_errors?
  super
end

#tag(tag_name, *args, &block) ⇒ Object



14
15
16
# File 'app/helpers/shoelace/components/sl_color_picker.rb', line 14

def tag(tag_name, *args, &block)
  tag_name.to_s == 'input' ? ('sl-color-picker', '', *args, &block) : super
end