Sha256: ab916a20e02e5a9fbf2b747b5168db222018f88748dede171de7a1b5d5da5d87
Contents?: true
Size: 1.16 KB
Versions: 4
Compression:
Stored size: 1.16 KB
Contents
module Headmin module Filter class NumberView < ViewModel def base_options keys = %i[name label form] options = to_h.slice(*keys) default_base_options.merge(options) end def input_options keys = %i[form] options = to_h.slice(*keys) default_input_options.merge(options) end private def id "#{name}_value" end def name @name || attribute end def label @label || I18n.t("attributes.#{attribute}", default: name.to_s) end def default_base_options { label: label, name: attribute, filter: Headmin::Filter::Number.new(name, @params), allowed_operators: Headmin::Filter::Number::OPERATORS - %w[in not_in between not_between] } end def default_input_options { label: false, wrapper: false, id: id, data: { action: "change->filter#updateHiddenValue", filter_target: "value", filter_row_target: "original" }, class: "form-control" } end end end end
Version data entries
4 entries across 4 versions & 1 rubygems