Class: ShadcnPhlexcomponents::Pagination

Inherits:
Base
  • Object
show all
Defined in:
lib/shadcn_phlexcomponents/components/pagination.rb

Constant Summary

Constants inherited from Base

Base::SANITIZER_ALLOWED_ATTRIBUTES, Base::SANITIZER_ALLOWED_TAGS, Base::TAILWIND_MERGER

Instance Method Summary collapse

Methods inherited from Base

#before_template, #convert_collection_hash_to_struct, #find_as_child, #icon, #initialize, #item_disabled?, #merge_default_attributes, #merged_as_child_attributes, #nokogiri_attributes_to_hash, #overlay, #sanitize_as_child

Constructor Details

This class inherits a constructor from ShadcnPhlexcomponents::Base

Instance Method Details

#default_attributes ⇒ Object



34
35
36
37
38
39
40
41
# File 'lib/shadcn_phlexcomponents/components/pagination.rb', line 34

def default_attributes
  {
    role: "navigation",
    aria: {
      label: "navigation",
    },
  }
end

#ellipsis(**attributes) ⇒ Object



30
31
32
# File 'lib/shadcn_phlexcomponents/components/pagination.rb', line 30

def ellipsis(**attributes, &)
  PaginationEllipsis(**attributes, &)
end

#item(**attributes) ⇒ Object



14
15
16
# File 'lib/shadcn_phlexcomponents/components/pagination.rb', line 14

def item(**attributes, &)
  PaginationItem(**attributes, &)
end


18
19
20
# File 'lib/shadcn_phlexcomponents/components/pagination.rb', line 18

def link(name = nil, options = nil, html_options = nil, &)
  PaginationLink(name, options, html_options, &)
end

#next(options = nil, html_options = nil) ⇒ Object



26
27
28
# File 'lib/shadcn_phlexcomponents/components/pagination.rb', line 26

def next(options = nil, html_options = nil)
  PaginationNext(options, html_options)
end

#previous(options = nil, html_options = nil) ⇒ Object



22
23
24
# File 'lib/shadcn_phlexcomponents/components/pagination.rb', line 22

def previous(options = nil, html_options = nil)
  PaginationPrevious(options, html_options)
end

#view_template ⇒ Object



43
44
45
46
47
# File 'lib/shadcn_phlexcomponents/components/pagination.rb', line 43

def view_template(&)
  div(**@attributes) do
    ul(class: "flex flex-row items-center gap-1", &)
  end
end