Sha256: 6d41f82e2a377ae0dd6c256318fde8d25b10575838e6339ad9e0a23e7b7e8156

Contents?: true

Size: 993 Bytes

Versions: 1156

Compression:

Stored size: 993 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module Forms
    class Builder
      def date_picker(name, props: {})
        prefix = @object_name
        html_attribute_name = "#{prefix}[#{name}]"
        html_id = "#{prefix}_#{name}"

        props[:label] = @template.label(@object_name, name) if props[:label] == true
        props[:label] = "Date Picker" if props[:label].nil?

        props[:name] = html_attribute_name
        props[:picker_id] = html_id

        input = text_field(
          name,
          autocomplete: "off",
          disabled: props[:disable_input],
          data: props[:input_data],
          aria: props[:input_aria],
          props: {
            error: props[:error],
            label: props[:hide_label] ? nil : props[:label],
            placeholder: props[:placeholder],
            required: props[:required],
          }
        )

        @template.pb_rails("date_picker", props: props) do
          input
        end
      end
    end
  end
end

Version data entries

1,156 entries across 1,156 versions & 1 rubygems

Version Path
playbook_ui-14.11.1.pre.alpha.PLAY17445539 lib/playbook/forms/builder/date_picker_field.rb
playbook_ui-14.11.1.pre.alpha.PBNTR798datepickerturbo5537 lib/playbook/forms/builder/date_picker_field.rb
playbook_ui-14.11.1.pre.alpha.pbntr703collapsiblerowsrails5536 lib/playbook/forms/builder/date_picker_field.rb
playbook_ui-14.11.1.pre.alpha.PLAY1751pbcontenttagpt25529 lib/playbook/forms/builder/date_picker_field.rb
playbook_ui-14.11.1.pre.alpha.PBNTR7495495 lib/playbook/forms/builder/date_picker_field.rb
playbook_ui-14.12.0.pre.rc.11 lib/playbook/forms/builder/date_picker_field.rb
playbook_ui-14.12.0.pre.rc.10 lib/playbook/forms/builder/date_picker_field.rb
playbook_ui-14.12.0.pre.rc.9 lib/playbook/forms/builder/date_picker_field.rb
playbook_ui-14.12.0.pre.rc.8 lib/playbook/forms/builder/date_picker_field.rb
playbook_ui-14.12.0.pre.rc.7 lib/playbook/forms/builder/date_picker_field.rb
playbook_ui-14.11.1.pre.alpha.play1724darkmodeauditmap5437 lib/playbook/forms/builder/date_picker_field.rb
playbook_ui-14.11.1.pre.alpha.PBNTR719listdraggablesimple5432 lib/playbook/forms/builder/date_picker_field.rb
playbook_ui-14.11.1.pre.alpha.PBNTR768stickyrightcolumn5431 lib/playbook/forms/builder/date_picker_field.rb
playbook_ui-14.12.0.pre.rc.6 lib/playbook/forms/builder/date_picker_field.rb
playbook_ui-14.11.1.pre.alpha.PBNTR718simiplifieddraggablereact5415 lib/playbook/forms/builder/date_picker_field.rb
playbook_ui-14.11.1.pre.alpha.play1724darkmodeauditmap5413 lib/playbook/forms/builder/date_picker_field.rb
playbook_ui-14.12.0.pre.rc.5 lib/playbook/forms/builder/date_picker_field.rb
playbook_ui-14.11.1.pre.alpha.play1724darkmodeauditmap5409 lib/playbook/forms/builder/date_picker_field.rb
playbook_ui-14.11.1.pre.alpha.PBNTR718simiplifieddraggablereact5400 lib/playbook/forms/builder/date_picker_field.rb
playbook_ui-14.11.1.pre.alpha.PBNTR718simiplifieddraggablereact5392 lib/playbook/forms/builder/date_picker_field.rb