Sha256: 3c48f16cb864242ee0a61f22f6a085acedc91863a2b177eed5515405e8ceb915

Contents?: true

Size: 946 Bytes

Versions: 96

Compression:

Stored size: 946 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module PbProgressPills
    class ProgressPills
      include Playbook::Props

      partial "pb_progress_pills/progress_pills"

      prop :active, type: Playbook::Props::Number,
                    default: 0
      prop :value
      prop :dark, type: Playbook::Props::Boolean,
                  default: false
      prop :steps, type: Playbook::Props::Number,
                   default: 3
      prop :title

      def classname
        generate_classname("pb_progress_pills_kit", dark_class)
      end



      def with_status
        yield title if title.present?
      end

      def each_step(&block)
        1.upto(steps, &block)
      end

      def active_step(step)
         step <= active ? "_active" : "_inactive"
      end

      def dark_pill
          dark ? "_dark" : nil
      end

      private
      
      def dark_class
        dark ? "dark" : nil
      end

    end
  end
end

Version data entries

96 entries across 96 versions & 1 rubygems

Version Path
playbook_ui-6.2.1 app/pb_kits/playbook/pb_progress_pills/progress_pills.rb
playbook_ui-6.2.0 app/pb_kits/playbook/pb_progress_pills/progress_pills.rb
playbook_ui-7.0.0.pre.alpha1 app/pb_kits/playbook/pb_progress_pills/progress_pills.rb
playbook_ui-6.1.0.pre.alpha5 app/pb_kits/playbook/pb_progress_pills/progress_pills.rb
playbook_ui-6.1.0.pre.alpha4 app/pb_kits/playbook/pb_progress_pills/progress_pills.rb
playbook_ui-6.1.0.pre.alpha3 app/pb_kits/playbook/pb_progress_pills/progress_pills.rb
playbook_ui-6.1.0.pre.alpha2 app/pb_kits/playbook/pb_progress_pills/progress_pills.rb
playbook_ui-6.1.0.pre.alpha1 app/pb_kits/playbook/pb_progress_pills/progress_pills.rb
playbook_ui-6.1.0 app/pb_kits/playbook/pb_progress_pills/progress_pills.rb
playbook_ui-6.0.1.pre.alpha6 app/pb_kits/playbook/pb_progress_pills/progress_pills.rb
playbook_ui-6.0.1.pre.alpha5 app/pb_kits/playbook/pb_progress_pills/progress_pills.rb
playbook_ui-6.0.1.pre.alpha4 app/pb_kits/playbook/pb_progress_pills/progress_pills.rb
playbook_ui-6.0.1.pre.alpha3 app/pb_kits/playbook/pb_progress_pills/progress_pills.rb
playbook_ui-6.0.1.pre.alpha2 app/pb_kits/playbook/pb_progress_pills/progress_pills.rb
playbook_ui-5.2.0.pre.alpha15 app/pb_kits/playbook/pb_progress_pills/progress_pills.rb
playbook_ui-5.2.0.pre.alpha14 app/pb_kits/playbook/pb_progress_pills/progress_pills.rb
playbook_ui-5.2.0.pre.alpha13 app/pb_kits/playbook/pb_progress_pills/progress_pills.rb
playbook_ui-6.0.1 app/pb_kits/playbook/pb_progress_pills/progress_pills.rb
playbook_ui-5.2.0.pre.alpha12 app/pb_kits/playbook/pb_progress_pills/progress_pills.rb
playbook_ui-6.0.0 app/pb_kits/playbook/pb_progress_pills/progress_pills.rb