Sha256: 6b3ac924cfcc9134ff9d3df2f42fd16b354fe79c9645423f3641f57c4cba64e1

Contents?: true

Size: 1.06 KB

Versions: 66

Compression:

Stored size: 1.06 KB

Contents

# frozen_string_literal: true

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

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

      prop :sticky, 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,
          className: classname,
          focus: focus,
          simple: simple,
          sticky: sticky,
          value: value,
          template: template,
          placeholder: placeholder
        }
      end
    end
  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
playbook_ui-9.10.0 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-9.10.0.pre.date.time.stacked.1 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-9.9.0 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-9.8.0 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-9.7.0.pre.alphawidth1 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-9.7.0.pre.alpha.a11y.btn app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-9.7.0 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-9.6.1 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-9.6.1.pre.deps1 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-9.6.0 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-9.5.0.alpha.rs.downgrade app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-9.5.0 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-9.4.0.alpha.sisense app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-9.4.0.alpha.user.kit.bug app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-9.4.0 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-9.3.1.pre.alpha2 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-9.4.0.pre.alpha2 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-9.4.0.pre.alpha1 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-9.3.1.pre.alpha1 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
playbook_ui-9.3.0.alpha.inline3 app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb