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.PLAY17445539 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.11.1.pre.alpha.PBNTR798datepickerturbo5537 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.11.1.pre.alpha.pbntr703collapsiblerowsrails5536 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.11.1.pre.alpha.PLAY1751pbcontenttagpt25529 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.11.1.pre.alpha.PBNTR7495495 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.12.0.pre.rc.11 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.12.0.pre.rc.10 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.12.0.pre.rc.9 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.12.0.pre.rc.8 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.12.0.pre.rc.7 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.11.1.pre.alpha.play1724darkmodeauditmap5437 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.11.1.pre.alpha.PBNTR719listdraggablesimple5432 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.11.1.pre.alpha.PBNTR768stickyrightcolumn5431 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.12.0.pre.rc.6 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.11.1.pre.alpha.PBNTR718simiplifieddraggablereact5415 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.11.1.pre.alpha.play1724darkmodeauditmap5413 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.12.0.pre.rc.5 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.11.1.pre.alpha.play1724darkmodeauditmap5409 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.11.1.pre.alpha.PBNTR718simiplifieddraggablereact5400 app/pb_kits/playbook/pb_dialog/dialog.rb
playbook_ui-14.11.1.pre.alpha.PBNTR718simiplifieddraggablereact5392 app/pb_kits/playbook/pb_dialog/dialog.rb