Sha256: b3be8a6acca11b5365a4776216c660ac686d8219bbcd2dfd5f4ecaef25b58e86

Contents?: true

Size: 1.66 KB

Versions: 378

Compression:

Stored size: 1.66 KB

Contents

# frozen_string_literal: true

module Playbook
  module PbDialog
    class Dialog < Playbook::KitBase
      prop :size, type: Playbook::Props::Enum,
                  values: %w[sm md lg xl status_size content],
                  default: "md"
      prop :full_height, type: Playbook::Props::Boolean, default: false
      prop :placement, type: Playbook::Props::Enum,
                       values: %w[left right center],
                       default: "center"
      prop :should_close_on_overlay_click, type: Playbook::Props::Boolean, default: true
      prop :title
      prop :text
      prop :loading
      prop :confirm_button
      prop :confirm_button_id
      prop :cancel_button
      prop :cancel_button_id
      prop :status, type: Playbook::Props::Enum,
                    values: ["info", "caution", "delete", "error", "success", "default", ""],
                    default: ""

      def classname
        generate_classname("pb_dialog pb_dialog_rails pb_dialog_#{size}_#{placement}")
      end

      def full_height_style
        if full_height && size === "xl"
          "full_height_center"
        elsif full_height && size != "xl"
          "full_height_#{placement}"
        end
      end

      def overlay_close
        !should_close_on_overlay_click ? "overlay_close" : ""
      end

      def status_alerts
        alerts = {
          "info" => %w[info-circle default],
          "default" => %w[exclamation-circle default],
          "caution" => %w[exclamation-triangle yellow],
          "delete" => %w[trash-alt red],
          "error" => %w[times-circle red],
          "success" => %w[check-circle green],
        }
        alerts[status]
      end
    end
  end
end

Version data entries

378 entries across 378 versions & 1 rubygems

Version Path
playbook_ui-14.11.1.pre.alpha.PLAY1720phonenumberinputformatAsYouType5377 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.11.1.pre.alpha.play17725374 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.11.1.pre.alpha.play17725372 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.12.0.pre.rc.4 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.11.1.pre.alpha.hfhbrakemanplaybook5370 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.11.1.pre.alpha.responsivetablerails5364 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.11.1.pre.alpha.responsivetablerails5362 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.11.1.pre.alpha.PBNTR769sticky5359 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.11.1.pre.alpha.PBNTR573datepickerinvestigation5355 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.11.1.pre.alpha.PLAY1750pbcontenttagkitbutton5341 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.11.1.pre.alpha.PLAY1750pbcontenttagkitbutton5340 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.11.1.pre.alpha.PLAY1750pbcontenttagkitbutton5339 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.12.0.pre.rc.3 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.12.0.pre.rc.2 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.12.0.pre.rc.1 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.12.0.pre.rc.0 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.10.0.pre.alpha.PLAY1774timelinelabelstepspacing5315 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.10.0.pre.alpha.PLAY1774timelinelabelstepspacing5314 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.10.0.pre.alpha.PLAY1750pbcontenttagkitbutton5308 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.11.1 app/pb_kits/playbook/pb_dialog/dialog.rb