Sha256: 2c4550bd9fd9411c663d41cb1dc831256ea23f6f57fc90d80f5c3df766c7b6e8
Contents?: true
Size: 695 Bytes
Versions: 20
Compression:
Stored size: 695 Bytes
Contents
# typed: false # frozen_string_literal: true module Ariadne module UI module Pagination class Component < Ariadne::BaseComponent option :label option :goto_label option :current_page option :pages_count option :callback_page_url option :page_size_options, default: proc { [10, 25, 50, 100] } def page_links (1..pages_count).each_with_object([]) do |page, list| if [1, pages_count].include?(page) || page.between?(current_page - 2, current_page + 2) list << page elsif list.last list << nil end end end end end end end
Version data entries
20 entries across 20 versions & 1 rubygems