Class: BetterUi::Application::Main::Component
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- BetterUi::Application::Main::Component
- Defined in:
- app/components/better_ui/application/main/component.rb
Constant Summary collapse
- MAIN_ROUNDED =
Arrotondamento bordi con classi Tailwind dirette
{ none: "", small: "rounded-lg", medium: "rounded-xl", large: "rounded-2xl", full: "rounded-full" }.freeze
- MAIN_SHADOW =
Ombre con classi Tailwind dirette
{ none: "", small: "shadow-sm", medium: "shadow-md", large: "shadow-lg" }.freeze
- MAIN_PADDING =
Padding con classi Tailwind dirette
{ true: "p-6", false: "p-0" }.freeze
- MAIN_LAYOUT =
Classi layout per sidebar
{ sidebar: { sm: "pl-48", md: "pl-64", lg: "pl-72", xl: "pl-80" }, # Con Sidebar none: "" # Senza sidebar }.freeze
- MAIN_SIDEBAR_WIDTH =
Larghezza sidebar (deve corrispondere a SIDEBAR_WIDTHS del componente Sidebar)
{ sm: 48, md: 64, lg: 72, xl: 80 }.freeze
Instance Attribute Summary collapse
-
#classes ⇒ Object
readonly
Returns the value of attribute classes.
-
#inner_padding ⇒ Object
readonly
Returns the value of attribute inner_padding.
-
#padding ⇒ Object
readonly
Returns the value of attribute padding.
-
#rounded ⇒ Object
readonly
Returns the value of attribute rounded.
-
#shadow ⇒ Object
readonly
Returns the value of attribute shadow.
-
#sidebar_width ⇒ Object
readonly
Returns the value of attribute sidebar_width.
-
#with_sidebar ⇒ Object
readonly
Returns the value of attribute with_sidebar.
Instance Method Summary collapse
-
#initialize(padding: true, inner_padding: true, rounded: :small, shadow: :medium, with_sidebar: true, sidebar_width: :md, classes: nil) ⇒ Component
constructor
A new instance of Component.
Constructor Details
#initialize(padding: true, inner_padding: true, rounded: :small, shadow: :medium, with_sidebar: true, sidebar_width: :md, classes: nil) ⇒ Component
Returns a new instance of Component.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'app/components/better_ui/application/main/component.rb', line 53 def initialize( padding: true, inner_padding: true, rounded: :small, shadow: :medium, with_sidebar: true, sidebar_width: :md, classes: nil ) @padding = padding @inner_padding = inner_padding @rounded = rounded.to_sym @shadow = shadow.to_sym @with_sidebar = @sidebar_width = .to_sym @classes = classes validate_params end |
Instance Attribute Details
#classes ⇒ Object (readonly)
Returns the value of attribute classes.
7 8 9 |
# File 'app/components/better_ui/application/main/component.rb', line 7 def classes @classes end |
#inner_padding ⇒ Object (readonly)
Returns the value of attribute inner_padding.
7 8 9 |
# File 'app/components/better_ui/application/main/component.rb', line 7 def inner_padding @inner_padding end |
#padding ⇒ Object (readonly)
Returns the value of attribute padding.
7 8 9 |
# File 'app/components/better_ui/application/main/component.rb', line 7 def padding @padding end |
#rounded ⇒ Object (readonly)
Returns the value of attribute rounded.
7 8 9 |
# File 'app/components/better_ui/application/main/component.rb', line 7 def rounded @rounded end |
#shadow ⇒ Object (readonly)
Returns the value of attribute shadow.
7 8 9 |
# File 'app/components/better_ui/application/main/component.rb', line 7 def shadow @shadow end |
#sidebar_width ⇒ Object (readonly)
Returns the value of attribute sidebar_width.
7 8 9 |
# File 'app/components/better_ui/application/main/component.rb', line 7 def @sidebar_width end |
#with_sidebar ⇒ Object (readonly)
Returns the value of attribute with_sidebar.
7 8 9 |
# File 'app/components/better_ui/application/main/component.rb', line 7 def @with_sidebar end |