Sha256: ae74c2a5246f6e562dad0aa1630885e7490cb667dcefece63eb907e9b4d2a3fc

Contents?: true

Size: 1.08 KB

Versions: 32

Compression:

Stored size: 1.08 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, &block|
        Primer::OpenProject::BorderGrid::Cell.new(**system_arguments, &block)
      }

      # @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

32 entries across 32 versions & 1 rubygems

Version Path
openproject-primer_view_components-0.52.2 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.52.1 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.52.0 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.51.0 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.50.1 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.50.0 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.49.2 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.49.1 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.49.0 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.48.2 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.48.1 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.48.0 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.47.1 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.47.0 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.46.1 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.46.0 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.45.0 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.44.3 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.44.2 app/components/primer/open_project/border_grid.rb
openproject-primer_view_components-0.44.1 app/components/primer/open_project/border_grid.rb