Sha256: 8e2cb0be1fecc29407824c33468b5786e25b8c904dbd34d1fac3916a458e72e9

Contents?: true

Size: 759 Bytes

Versions: 83

Compression:

Stored size: 759 Bytes

Contents

module LucidComponent
  class StylesWrapper
    include ::Native::Wrapper

    def is_wrapped_style
      true
    end

    def fade_in
      'fadeIn'
    end

    def fade_out
      'fadeOut'
    end

    def [](prop)
      method_missing(prop)
    end

    def method_missing(prop, *args, &block)
      %x{
        let value;
        value = #@native[prop];
        if (value) { return value; }
        else {
          console.warn("Style/Theme key '" + prop + "' returning nil!");
          return #{nil};
        }
      }
    end

    def to_h
      %x{
        if (#@props_prop) { return Opal.Hash.$new(#@native.props[#@props_prop]); }
        else { return Opal.Hash.$new(#@native); }
      }
    end
  end
end

Version data entries

83 entries across 83 versions & 1 rubygems

Version Path
isomorfeus-preact-10.9.0 lib/isomorfeus_preact/lucid_component/styles_wrapper.rb
isomorfeus-preact-10.8.2 lib/isomorfeus_preact/lucid_component/styles_wrapper.rb
isomorfeus-preact-10.8.1 lib/isomorfeus_preact/lucid_component/styles_wrapper.rb
isomorfeus-preact-10.8.0 lib/isomorfeus_preact/lucid_component/styles_wrapper.rb
isomorfeus-preact-10.7.3 lib/isomorfeus_preact/lucid_component/styles_wrapper.rb
isomorfeus-preact-10.7.2 lib/isomorfeus_preact/lucid_component/styles_wrapper.rb
isomorfeus-preact-10.7.1 lib/isomorfeus_preact/lucid_component/styles_wrapper.rb
isomorfeus-preact-10.7.0 lib/isomorfeus_preact/lucid_component/styles_wrapper.rb
isomorfeus-preact-10.6.62 lib/isomorfeus_preact/lucid_component/styles_wrapper.rb
isomorfeus-preact-10.6.61 lib/isomorfeus_preact/lucid_component/styles_wrapper.rb
isomorfeus-preact-10.6.60 lib/isomorfeus_preact/lucid_component/styles_wrapper.rb
isomorfeus-preact-10.6.59 lib/isomorfeus_preact/lucid_component/styles_wrapper.rb
isomorfeus-preact-10.6.58 lib/isomorfeus_preact/lucid_component/styles_wrapper.rb
isomorfeus-preact-10.6.57 lib/isomorfeus_preact/lucid_component/styles_wrapper.rb
isomorfeus-preact-10.6.56 lib/isomorfeus_preact/lucid_component/styles_wrapper.rb
isomorfeus-preact-10.6.55 lib/isomorfeus_preact/lucid_component/styles_wrapper.rb
isomorfeus-preact-10.6.54 lib/isomorfeus_preact/lucid_component/styles_wrapper.rb
isomorfeus-preact-10.6.53 lib/isomorfeus_preact/lucid_component/styles_wrapper.rb
isomorfeus-preact-10.6.52 lib/isomorfeus_preact/lucid_component/styles_wrapper.rb
isomorfeus-preact-10.6.51 lib/isomorfeus_preact/lucid_component/styles_wrapper.rb