Sha256: 67c5b870057cc92b095d4b052d98cd4c11c8b8d594d7c48c16663f0c1d1e1d14

Contents?: true

Size: 552 Bytes

Versions: 1

Compression:

Stored size: 552 Bytes

Contents

require 'glimmer/opal/element_proxy'

module Glimmer
  module Opal
    class InputProxy < ElementProxy
      attr_reader :text
      
      def text=(value)
        @text = value
        redraw
      end

      def observation_request_to_event_mapping
        {
          'on_widget_selected' => {
            event: 'click'
          }
        }
      end
      
      def dom
        input_text = @text
        input_id = id
        @dom ||= DOM {
          input id: input_id, type: 'button', value: input_text
        }
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
glimmer-dsl-opal-0.0.2 lib/glimmer/opal/input_proxy.rb