Sha256: 86f25d551468ff4169777dcf0dff0d2ce07c6ebf0fff24edd647470a1b377a27

Contents?: true

Size: 1.06 KB

Versions: 38

Compression:

Stored size: 1.06 KB

Contents

# frozen_string_literal: true

module Primer
  module OpenProject
    # A set of blocks that are shown below each other with separator lines in between
    class BorderGrid < Primer::Component
      status :open_project

      # Use to render a block inside the grid
      #
      # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
      renders_many :rows, lambda { |**system_arguments|
        Primer::OpenProject::BorderGrid::Cell.new(**system_arguments)
      }

      # @param spacious [Boolean] Whether to add margin to the bottom of the component.
      # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
      def initialize(spacious: false, **system_arguments)
        @system_arguments = system_arguments
        @system_arguments[:tag] = "div"
        @spacious = spacious

        @system_arguments[:classes] =
          class_names(
            @system_arguments[:classes],
            "BorderGrid",
            "BorderGrid--spacious" => @spacious
          )
      end

      def render?
        rows.any?
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
openproject-primer_view_components-0.36.2 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.36.1 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.36.0 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.35.2 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.35.1 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.35.0 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.34.0 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.33.2 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.33.1 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.33.0 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.32.1 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.32.0 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.29.1 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.29.0 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.28.1 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.28.0 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.27.0 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.26.0 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.25.1 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.25.0 app/components/primer/open_project/border_grid.rb