Sha256: 0ab4e8e6ba009b83305759904e4b9ff5e313737538f11884b017b828a1f5bbec

Contents?: true

Size: 1.74 KB

Versions: 12

Compression:

Stored size: 1.74 KB

Contents

module Coprl
  module Presenters
    module DSL
      module Components
        module Lists
          class Actions < Base
            def initialize(actions, **attribs_, &block)
              @actions = actions
              super(type: :actions, **attribs_, &block)
              expand!
            end

            def icon(icon=nil, **attribs, &block)
              action = Lists::Action.new(parent: self)
              action.icon(icon, **attribs, &block)
              @actions << action
            end


            def menu(**attribs, &block)
              action = Lists::Action.new(parent: self)
              action.menu(**attribs, &block)
              @actions << action
            end

            def checkbox(**attribs, &block)
              action = Lists::Action.new(parent: self)
              action.checkbox(**attribs, &block)
              @actions << action
            end

            def radio_button(**attribs, &block)
              action = Lists::Action.new(parent: self)
              action.radio_button(**attribs, &block)
              @actions << action
            end

            def switch(**attribs, &block)
              action = Lists::Action.new(parent: self)
              action.switch(**attribs, &block)
              @actions << action
            end

            def icon_toggle(icon=nil, **attribs, &block)
              action = Lists::Action.new(parent: self)
              action.icon_toggle(icon, **attribs, &block)
              @actions << action
            end

            def button(text=nil, **attribs, &block)
              action = Lists::Action.new(parent: self)
              action.button(text, **attribs, &block)
              @actions << action
            end
          end
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
coprl-3.0.0.beta.12 lib/coprl/presenters/dsl/components/lists/actions.rb
coprl-3.0.0.beta.11 lib/coprl/presenters/dsl/components/lists/actions.rb
coprl-3.0.0.beta.10 lib/coprl/presenters/dsl/components/lists/actions.rb
coprl-3.0.0.beta.9 lib/coprl/presenters/dsl/components/lists/actions.rb
coprl-3.0.0.beta.8 lib/coprl/presenters/dsl/components/lists/actions.rb
coprl-3.0.0.beta.7 lib/coprl/presenters/dsl/components/lists/actions.rb
coprl-3.0.0.beta.6 lib/coprl/presenters/dsl/components/lists/actions.rb
coprl-3.0.0.beta.5 lib/coprl/presenters/dsl/components/lists/actions.rb
coprl-3.0.0.beta.4 lib/coprl/presenters/dsl/components/lists/actions.rb
coprl-3.0.0.beta.3 lib/coprl/presenters/dsl/components/lists/actions.rb
coprl-3.0.0.beta.2 lib/coprl/presenters/dsl/components/lists/actions.rb
coprl-3.0.0.beta.1 lib/coprl/presenters/dsl/components/lists/actions.rb