Sha256: 2b0e4450a22765073703bef8a76d381422f9f511ef17c035824188ef37622292
Contents?: true
Size: 655 Bytes
Versions: 18
Compression:
Stored size: 655 Bytes
Contents
require_relative 'text_field' module Avo module Fields class NumberField < TextField def initialize(name, **args, &block) @defaults = { sortable: true, component: 'number-field', computable: true, } super(name, **args, &block) @min = args[:min].present? ? args[:min].to_i : nil @max = args[:max].present? ? args[:max].to_i : nil @step = args[:step].present? ? args[:step].to_i : nil end def hydrate_field(fields, model, resource, view) { min: @min, max: @max, step: @step, } end end end end
Version data entries
18 entries across 18 versions & 1 rubygems