Sha256: c151482b792e63936a3b90e3cd4ba888d254c544aa055962dc9c2632bfdc0190

Contents?: true

Size: 1.31 KB

Versions: 1147

Compression:

Stored size: 1.31 KB

Contents

# frozen_string_literal: true

module Playbook
  module PbRichTextEditor
    class RichTextEditor < Playbook::KitBase
      prop :focus, type: Playbook::Props::Boolean,
                   default: false

      prop :inline, type: Playbook::Props::Boolean,
                    default: false

      prop :simple, type: Playbook::Props::Boolean,
                    default: false

      prop :sticky, type: Playbook::Props::Boolean,
                    default: false
      prop :toolbar_bottom, type: Playbook::Props::Boolean,
                            default: false

      prop :value
      prop :template
      prop :placeholder

      def classname
        generate_classname("pb_rich_text_editor_kit", simple_class, focus_class, sticky_class, separator: " ")
      end

      def focus_class
        focus ? "focus-editor-targets" : nil
      end

      def simple_class
        simple ? "simple" : nil
      end

      def sticky_class
        sticky ? "sticky" : nil
      end

      def rich_text_options
        {
          id: id,
          inline: inline,
          className: classname,
          focus: focus,
          simple: simple,
          sticky: sticky,
          toolbarBottom: toolbar_bottom,
          value: value,
          template: template,
          placeholder: placeholder,
        }
      end
    end
  end
end

Version data entries

1,147 entries across 1,147 versions & 1 rubygems

Version Path
playbook_ui-10.21.0.pre.alpha.lightbox.2 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-10.21.0 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-10.21.0.pre.alpha.lightbox app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-10.21.0.pre.alpha.rg1 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-10.21.0.pre.alpha.jg1 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-10.21.0.pre.alpha.na1 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-10.21.0.pre.alpha.jd1 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-10.20.0 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-10.19.0 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-10.19.0.pre.lightbox app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-10.18.2 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-10.19.0.pre.popover.alpha1 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-10.18.1 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-10.18.0 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-10.17.0 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-10.16.0 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-10.15.1 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-10.15.1.pre.alpha.rubocop.deps app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-10.15.0 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-10.14.1.pre.alpha2 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb