# See the Pagy documentation: https://ddnexus.github.io/pagy/docs/extras/uikit # frozen_string_literal: true require 'pagy/extras/frontend_helpers' class Pagy # :nodoc: # Frontend modules are specially optimized for performance. # The resulting code may not look very elegant, but produces the best benchmarks module UikitExtra # Pagination for uikit: it returns the html with the series of links to the pages def pagy_uikit_nav(pagy, pagy_id: nil, link_extra: '', nav_aria_label: nil, nav_i18n_key: nil, **vars) p_id = %( id="#{pagy_id}") if pagy_id link = pagy_link_proc(pagy, link_extra:) html = +%(
) end # Javascript pagination for uikit: it returns a nav and a JSON tag used by the pagy.js file def pagy_uikit_nav_js(pagy, pagy_id: nil, link_extra: '', nav_aria_label: nil, nav_i18n_key: nil, **vars) sequels = pagy.sequels(**vars) p_id = %( id="#{pagy_id}") if pagy_id link = pagy_link_proc(pagy, link_extra:) tags = { 'before' => uikit_prev_html(pagy, link), 'link' => %(