Sha256: 0d487b950693d17821a719b83782503b2d87df9a7e12f6e8f6029c9047b832f6
Contents?: true
Size: 882 Bytes
Versions: 28
Compression:
Stored size: 882 Bytes
Contents
module Lookbook module Params class Editor::Component < Lookbook::BaseComponent renders_many :fields, ->(**attrs) do @field_count += 1 Lookbook::Params::Field::Component.new(**attrs, index: @field_count) end def initialize(**html_attrs) @field_count = -1 @@input_styles = {} super(**html_attrs) end def before_render fields end def param_styles @css_styles ||= @@input_styles.map do |input_name, styles| styles.map { |s| "[data-param-input=#{input_name}] #{s}" }.join("\n") end.join("\n") end def self.add_styles(input, styles) @@input_styles = {} unless defined?(@@input_styles) @@input_styles[input] ||= styles end protected def alpine_component "paramsEditorComponent" end end end end
Version data entries
28 entries across 28 versions & 1 rubygems