Sha256: 26f9f547db13135a7c3c0d70e5d280c8d11bba787d713ce1ca6d95fefbf556b3
Contents?: true
Size: 1.19 KB
Versions: 48
Compression:
Stored size: 1.19 KB
Contents
# frozen_string_literal: true module KlassExtension def join_classes(*classes) UiBibz::Utils::Screwdriver.join_classes classes end def exclude_classes(arr, *classes) UiBibz::Utils::Screwdriver.exclude_classes arr, classes end # Override this method to add a status class def status; end def exclude_classes_in_html_options(*classes) html_options[:class] = exclude_classes html_options[:class], classes end private def initialize_component_html_classes cls = [ original_html_options, state, status, effect, options_classes, connect, component_html_classes ] html_options[:class] = join_classes(cls) end def original_html_options transform_classes_to_array(html_options[:class]) end def effect options[:effect] end def options_classes transform_classes_to_array(options[:class]) end def state options[:state] unless options[:state].nil? end def connect 'ui-bibz-connect' unless options[:connect].nil? end def transform_classes_to_array(classes) UiBibz::Utils::Screwdriver.uniq_word_in_string(classes.is_a?(String) ? classes : classes.join(' ')) unless classes.nil? end end
Version data entries
48 entries across 48 versions & 1 rubygems