coprl 3.0.0.beta.4 → 3.0.0.beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.circleci/config.yml +11 -16
- data/.ruby-version +1 -1
- data/CHANGELOG.md +37 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +43 -47
- data/README.md +3 -3
- data/app/demo/components/dialogs.pom +1 -1
- data/app/demo/components/snackbar.pom +9 -3
- data/app/demo/events/content_as_form.pom +3 -3
- data/app/demo/events/halted.pom +23 -0
- data/app/demo/events/nav/drawer.pom +1 -1
- data/app/demo/events/tagged_input.pom +2 -2
- data/app/demo/patterns/search_select.pom +1 -1
- data/coprl.gemspec +1 -2
- data/lib/coprl/presenters/dsl/components/actions/base.rb +5 -1
- data/lib/coprl/presenters/dsl/components/base.rb +6 -4
- data/lib/coprl/presenters/dsl/components/multi_select.rb +3 -3
- data/lib/coprl/presenters/dsl/components/table.rb +2 -2
- data/lib/coprl/presenters/dsl/definition.rb +2 -2
- data/lib/coprl/presenters/dsl/user_interface.rb +2 -2
- data/lib/coprl/presenters/helpers/rails/routes.rb +14 -0
- data/lib/coprl/presenters/helpers/rails.rb +8 -6
- data/lib/coprl/presenters/rails/concerns/coprl_partial.rb +51 -0
- data/lib/coprl/presenters/rails/engine.rb +5 -0
- data/lib/coprl/presenters/rails/railtie.rb +6 -14
- data/lib/coprl/presenters/rails/reloader.rb +15 -0
- data/lib/coprl/presenters/version.rb +1 -1
- data/lib/coprl/presenters/web_client/helpers/headers.rb +8 -6
- data/lib/coprl/presenters/web_client/helpers/rails/template_helper.rb +10 -0
- data/lib/coprl/presenters/web_client/helpers/rails.rb +1 -0
- data/lib/coprl/presenters/web_client/helpers/sinatra/template_helper.rb +20 -0
- data/lib/coprl/presenters/web_client/helpers/sinatra.rb +1 -0
- data/lib/coprl/presenters/web_client/plugin_views_path.rb +5 -5
- data/public/bundle.js +10 -4
- data/public/wc.js +10 -4
- data/rails-engine/app/controllers/coprl_controller.rb +0 -17
- data/rails-engine/app/views/layouts/coprl.html.erb +4 -4
- data/rails-engine/config/initializers/presenters.rb +4 -2
- data/rails-engine/config/initializers/routes.rb +5 -0
- data/views/mdc/assets/js/components/events/posts.js +10 -6
- data/views/mdc/body/{_preamble.erb → _wrapper.erb} +16 -5
- data/views/mdc/components/_card.erb +2 -2
- data/views/mdc/components/_checkbox.erb +1 -1
- data/views/mdc/components/_chip.erb +2 -2
- data/views/mdc/components/_content.erb +2 -2
- data/views/mdc/components/_datetime.erb +1 -1
- data/views/mdc/components/_dialog.erb +2 -2
- data/views/mdc/components/_form.erb +2 -2
- data/views/mdc/components/_grid.erb +2 -2
- data/views/mdc/components/_hidden_field.erb +1 -1
- data/views/mdc/components/_multi_select.erb +1 -1
- data/views/mdc/components/_number_field.erb +1 -1
- data/views/mdc/components/_radio_button.erb +1 -1
- data/views/mdc/components/_rich_text_area.erb +1 -1
- data/views/mdc/components/_select.erb +1 -1
- data/views/mdc/components/_slider.erb +2 -2
- data/views/mdc/components/_stepper.erb +4 -4
- data/views/mdc/components/_switch.erb +1 -1
- data/views/mdc/components/_text_area.erb +1 -1
- data/views/mdc/components/_text_field.erb +1 -1
- data/views/mdc/components/buttons/_image.erb +1 -1
- data/views/mdc/layout.erb +4 -4
- metadata +17 -26
- data/app/demo/components/snackbar_attached.pom +0 -6
- data/views/mdc/body/_postamble.erb +0 -17
| @@ -0,0 +1,51 @@ | |
| 1 | 
            +
            module Coprl
         | 
| 2 | 
            +
              module Presenters
         | 
| 3 | 
            +
                module Rails
         | 
| 4 | 
            +
                  module Concerns
         | 
| 5 | 
            +
                    module CoprlPartial
         | 
| 6 | 
            +
                      extend ActiveSupport::Concern
         | 
| 7 | 
            +
             | 
| 8 | 
            +
                      included do
         | 
| 9 | 
            +
                        before_action :set_view_path
         | 
| 10 | 
            +
                      end
         | 
| 11 | 
            +
                      
         | 
| 12 | 
            +
                      module ClassMethods
         | 
| 13 | 
            +
                        @plugins = []
         | 
| 14 | 
            +
                        def presenter_plugin(*plugins)
         | 
| 15 | 
            +
                          @plugins += Array(plugins)
         | 
| 16 | 
            +
                        end
         | 
| 17 | 
            +
             | 
| 18 | 
            +
                        def plugins
         | 
| 19 | 
            +
                          @plugins
         | 
| 20 | 
            +
                        end
         | 
| 21 | 
            +
                      end
         | 
| 22 | 
            +
             | 
| 23 | 
            +
                      def set_view_path
         | 
| 24 | 
            +
                        paths = Coprl::Presenters::WebClient::PluginViewsPath.new(pom: nil, plugins: self.class.plugins).render
         | 
| 25 | 
            +
                        paths.each do |path|
         | 
| 26 | 
            +
                          prepend_view_path path
         | 
| 27 | 
            +
                        end
         | 
| 28 | 
            +
                      end
         | 
| 29 | 
            +
             | 
| 30 | 
            +
                      def prepare_context(base_params = params)
         | 
| 31 | 
            +
                        prepare_context = Coprl::Presenters::Settings.config.presenters.web_client.prepare_context.dup
         | 
| 32 | 
            +
                        prepare_context.push(method(:scrub_context))
         | 
| 33 | 
            +
                        context = base_params.dup.to_unsafe_hash
         | 
| 34 | 
            +
                        prepare_context.reduce(context) do |params, context_proc|
         | 
| 35 | 
            +
                          context = context_proc.call(params, session, request.env)
         | 
| 36 | 
            +
                        end
         | 
| 37 | 
            +
                        context
         | 
| 38 | 
            +
                      end
         | 
| 39 | 
            +
             | 
| 40 | 
            +
                      def scrub_context(params, _session, _env)
         | 
| 41 | 
            +
                        %i(grid_nesting input_tag).each do |key|
         | 
| 42 | 
            +
                          params.delete(key) {params.delete(key.to_s)}
         | 
| 43 | 
            +
                        end
         | 
| 44 | 
            +
                        params
         | 
| 45 | 
            +
                      end
         | 
| 46 | 
            +
             | 
| 47 | 
            +
                    end
         | 
| 48 | 
            +
                  end
         | 
| 49 | 
            +
                end
         | 
| 50 | 
            +
              end
         | 
| 51 | 
            +
            end
         | 
| @@ -12,6 +12,11 @@ module Coprl | |
| 12 12 | 
             
                      # TODO: should rename these since they are common names that are likely going to collide
         | 
| 13 13 | 
             
                      app.middleware.use ::ActionDispatch::Static, File.join(root, '..', 'public')
         | 
| 14 14 | 
             
                    end
         | 
| 15 | 
            +
             | 
| 16 | 
            +
                    ActiveSupport.on_load(:action_controller) do
         | 
| 17 | 
            +
                      include Concerns::CoprlPartial
         | 
| 18 | 
            +
                    end
         | 
| 19 | 
            +
             | 
| 15 20 | 
             
                  end
         | 
| 16 21 | 
             
                end
         | 
| 17 22 | 
             
              end
         | 
| @@ -1,5 +1,3 @@ | |
| 1 | 
            -
            require 'filewatcher'
         | 
| 2 | 
            -
             | 
| 3 1 | 
             
            module Coprl
         | 
| 4 2 | 
             
              module Presenters
         | 
| 5 3 | 
             
                module Rails
         | 
| @@ -15,20 +13,14 @@ module Coprl | |
| 15 13 |  | 
| 16 14 | 
             
                    WATCH = -> {
         | 
| 17 15 | 
             
                      return unless ::Rails.env.development?
         | 
| 16 | 
            +
             | 
| 18 17 | 
             
                      path = ::Rails.root.join('app', '**', '*.pom')
         | 
| 19 | 
            -
                       | 
| 20 | 
            -
             | 
| 21 | 
            -
                      Thread.new(filewatcher) do |fw|
         | 
| 22 | 
            -
                        fw.watch do |f|
         | 
| 23 | 
            -
                          puts "Detected updated POM file: #{f}"
         | 
| 24 | 
            -
                          begin
         | 
| 25 | 
            -
                            BOOT.call
         | 
| 26 | 
            -
                          rescue Exception => exc
         | 
| 27 | 
            -
                            puts exc.backtrace
         | 
| 28 | 
            -
                            puts exc.message
         | 
| 29 | 
            -
                          end
         | 
| 30 | 
            -
                        end
         | 
| 18 | 
            +
                      file_watcher = ActiveSupport::FileUpdateChecker.new(Dir[path]) do
         | 
| 19 | 
            +
                        BOOT.call
         | 
| 31 20 | 
             
                      end
         | 
| 21 | 
            +
             | 
| 22 | 
            +
                      ::Rails.application.reloaders << Reloader.new(file_watcher)
         | 
| 23 | 
            +
             | 
| 32 24 | 
             
                    } unless defined?(WATCH)
         | 
| 33 25 |  | 
| 34 26 | 
             
                    config.after_initialize do
         | 
| @@ -2,16 +2,18 @@ module Coprl::Presenters::WebClient::Helpers | |
| 2 2 | 
             
              module Headers
         | 
| 3 3 | 
             
                include Coprl::Presenters::WebClient::Helpers::HtmlSafe
         | 
| 4 4 |  | 
| 5 | 
            -
                def coprl_headers | 
| 5 | 
            +
                def coprl_headers
         | 
| 6 | 
            +
                  return unless @pom
         | 
| 7 | 
            +
             | 
| 6 8 | 
             
                  html_safe (<<~HEADERS)
         | 
| 7 9 | 
             
                    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" type="text/css">
         | 
| 8 10 | 
             
                    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
         | 
| 9 11 | 
             
                    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css" integrity="sha384-5sAR7xN1Nv6T6+dT2mhtzEpVJvfS3NScPQTrOxhwjIuvcA67KV2R5Jz6kr4abQsz" crossorigin="anonymous">
         | 
| 10 | 
            -
                    <link rel="stylesheet" href="#{ base_url }/#{ request.env['SCRIPT_NAME'] }bundle.css">
         | 
| 11 | 
            -
                    <script defer src="#{ base_url }/#{ request.env['SCRIPT_NAME'] }bundle.js"></script>
         | 
| 12 | 
            -
                    #{plugin_headers(pom)}
         | 
| 13 | 
            -
                    #{custom_css(request.env['REQUEST_PATH'], base_url)}
         | 
| 14 | 
            -
                    #{pom.csrf_meta_tags}
         | 
| 12 | 
            +
                    <link rel="stylesheet" href="#{ @base_url }/#{ request.env['SCRIPT_NAME'] }bundle.css">
         | 
| 13 | 
            +
                    <script defer src="#{ @base_url }/#{ request.env['SCRIPT_NAME'] }bundle.js"></script>
         | 
| 14 | 
            +
                    #{plugin_headers(@pom)}
         | 
| 15 | 
            +
                    #{custom_css(request.env['REQUEST_PATH'], @base_url)}
         | 
| 16 | 
            +
                    #{@pom.csrf_meta_tags}
         | 
| 15 17 | 
             
                  HEADERS
         | 
| 16 18 | 
             
                end
         | 
| 17 19 |  | 
| @@ -0,0 +1,10 @@ | |
| 1 | 
            +
            module Coprl::Presenters::WebClient::Helpers::Rails
         | 
| 2 | 
            +
              module TemplateHelper
         | 
| 3 | 
            +
                def with_presenters_wrapper(&block)
         | 
| 4 | 
            +
                  render partial: 'body/wrapper', locals: {
         | 
| 5 | 
            +
                    body_content: capture(&block), header: @pom&.header, drawer: @pom&.drawer,
         | 
| 6 | 
            +
                    footer: @pom&.footer
         | 
| 7 | 
            +
                  }
         | 
| 8 | 
            +
                end
         | 
| 9 | 
            +
              end
         | 
| 10 | 
            +
            end
         | 
| @@ -0,0 +1,20 @@ | |
| 1 | 
            +
            module Coprl::Presenters::WebClient::Helpers::Sinatra
         | 
| 2 | 
            +
              module TemplateHelper
         | 
| 3 | 
            +
                def with_presenters_wrapper(&block)
         | 
| 4 | 
            +
                  buffer << partial("body/wrapper", locals: {
         | 
| 5 | 
            +
                    body_content: capture(buffer, &block), header: @pom&.header, drawer: @pom&.drawer,
         | 
| 6 | 
            +
                    footer: @pom&.footer
         | 
| 7 | 
            +
                  })
         | 
| 8 | 
            +
                end
         | 
| 9 | 
            +
             | 
| 10 | 
            +
                def buffer()
         | 
| 11 | 
            +
                  @_out_buf
         | 
| 12 | 
            +
                end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                def capture(buffer)
         | 
| 15 | 
            +
                  pos = buffer.size
         | 
| 16 | 
            +
                  yield
         | 
| 17 | 
            +
                  buffer.slice!(pos..buffer.size)
         | 
| 18 | 
            +
                end
         | 
| 19 | 
            +
              end
         | 
| 20 | 
            +
            end
         | 
| @@ -8,17 +8,17 @@ module Coprl | |
| 8 8 | 
             
                    extend Pluggable
         | 
| 9 9 | 
             
                    include_plugins(:WebClientComponents)
         | 
| 10 10 |  | 
| 11 | 
            -
                    def initialize(pom:)
         | 
| 11 | 
            +
                    def initialize(pom: nil, plugins: nil)
         | 
| 12 12 | 
             
                      @pom = pom
         | 
| 13 | 
            +
                      @plugins = plugins || []
         | 
| 13 14 | 
             
                      initialize_plugins
         | 
| 14 15 | 
             
                    end
         | 
| 15 16 |  | 
| 16 17 | 
             
                    def render
         | 
| 17 18 | 
             
                      results = []
         | 
| 18 | 
            -
                      ( | 
| 19 | 
            +
                      (@plugins + Coprl::Presenters::Settings.config.presenters.plugins).each do |plugin|
         | 
| 19 20 | 
             
                        view_dir_method = :"view_dir_#{plugin}"
         | 
| 20 | 
            -
                        results << send(view_dir_method,
         | 
| 21 | 
            -
                             @pom) if respond_to?(view_dir_method)
         | 
| 21 | 
            +
                        results << send(view_dir_method, @pom) if respond_to?(view_dir_method)
         | 
| 22 22 | 
             
                      end
         | 
| 23 23 | 
             
                      results
         | 
| 24 24 | 
             
                    end
         | 
| @@ -26,7 +26,7 @@ module Coprl | |
| 26 26 | 
             
                    private
         | 
| 27 27 |  | 
| 28 28 | 
             
                    def initialize_plugins
         | 
| 29 | 
            -
                      @plugins  | 
| 29 | 
            +
                      @plugins += @pom.send(:plugins) if @pom
         | 
| 30 30 | 
             
                      self.class.include_plugins(:WebClientComponents, plugins: @plugins)
         | 
| 31 31 | 
             
                    end
         | 
| 32 32 | 
             
                  end
         | 
    
        data/public/bundle.js
    CHANGED
    
    | @@ -48739,9 +48739,7 @@ var VPosts = function (_VBase) { | |
| 48739 48739 | 
             
                            }
         | 
| 48740 48740 | 
             
                        }
         | 
| 48741 48741 |  | 
| 48742 | 
            -
                         | 
| 48743 | 
            -
             | 
| 48744 | 
            -
                        if (paramCount < 1) {
         | 
| 48742 | 
            +
                        if (this.paramCount(formData) < 1) {
         | 
| 48745 48743 | 
             
                            console.warn('Creating request with no data!' + ' Are you sure you\'ve hooked everything up correctly?');
         | 
| 48746 48744 | 
             
                        }
         | 
| 48747 48745 |  | 
| @@ -48910,9 +48908,17 @@ var VPosts = function (_VBase) { | |
| 48910 48908 | 
             
                            }
         | 
| 48911 48909 |  | 
| 48912 48910 | 
             
                            // Send our FormData object; HTTP headers are set automatically
         | 
| 48913 | 
            -
                             | 
| 48911 | 
            +
                            // Rack 2.2 will throw an exception https://github.com/rack/rack/issues/1603
         | 
| 48912 | 
            +
                            // if we set the header as multi-part form data with no data in the body
         | 
| 48913 | 
            +
                            // So we set the body to null in this case.
         | 
| 48914 | 
            +
                            httpRequest.send(_this2.paramCount(formData) < 1 ? null : formData);
         | 
| 48914 48915 | 
             
                        });
         | 
| 48915 48916 | 
             
                    }
         | 
| 48917 | 
            +
                }, {
         | 
| 48918 | 
            +
                    key: 'paramCount',
         | 
| 48919 | 
            +
                    value: function paramCount(formData) {
         | 
| 48920 | 
            +
                        return Array.from(formData).length;
         | 
| 48921 | 
            +
                    }
         | 
| 48916 48922 | 
             
                }, {
         | 
| 48917 48923 | 
             
                    key: 'isForm',
         | 
| 48918 48924 | 
             
                    value: function isForm() {
         | 
    
        data/public/wc.js
    CHANGED
    
    | @@ -34213,9 +34213,7 @@ var VPosts = function (_VBase) { | |
| 34213 34213 | 
             
                            }
         | 
| 34214 34214 | 
             
                        }
         | 
| 34215 34215 |  | 
| 34216 | 
            -
                         | 
| 34217 | 
            -
             | 
| 34218 | 
            -
                        if (paramCount < 1) {
         | 
| 34216 | 
            +
                        if (this.paramCount(formData) < 1) {
         | 
| 34219 34217 | 
             
                            console.warn('Creating request with no data!' + ' Are you sure you\'ve hooked everything up correctly?');
         | 
| 34220 34218 | 
             
                        }
         | 
| 34221 34219 |  | 
| @@ -34384,9 +34382,17 @@ var VPosts = function (_VBase) { | |
| 34384 34382 | 
             
                            }
         | 
| 34385 34383 |  | 
| 34386 34384 | 
             
                            // Send our FormData object; HTTP headers are set automatically
         | 
| 34387 | 
            -
                             | 
| 34385 | 
            +
                            // Rack 2.2 will throw an exception https://github.com/rack/rack/issues/1603
         | 
| 34386 | 
            +
                            // if we set the header as multi-part form data with no data in the body
         | 
| 34387 | 
            +
                            // So we set the body to null in this case.
         | 
| 34388 | 
            +
                            httpRequest.send(_this2.paramCount(formData) < 1 ? null : formData);
         | 
| 34388 34389 | 
             
                        });
         | 
| 34389 34390 | 
             
                    }
         | 
| 34391 | 
            +
                }, {
         | 
| 34392 | 
            +
                    key: 'paramCount',
         | 
| 34393 | 
            +
                    value: function paramCount(formData) {
         | 
| 34394 | 
            +
                        return Array.from(formData).length;
         | 
| 34395 | 
            +
                    }
         | 
| 34390 34396 | 
             
                }, {
         | 
| 34391 34397 | 
             
                    key: 'isForm',
         | 
| 34392 34398 | 
             
                    value: function isForm() {
         | 
| @@ -23,21 +23,4 @@ class CoprlController < ApplicationController | |
| 23 23 | 
             
                  prepend_view_path path
         | 
| 24 24 | 
             
                end
         | 
| 25 25 | 
             
              end
         | 
| 26 | 
            -
             | 
| 27 | 
            -
              def prepare_context(base_params = params)
         | 
| 28 | 
            -
                prepare_context = Coprl::Presenters::Settings.config.presenters.web_client.prepare_context.dup
         | 
| 29 | 
            -
                prepare_context.push(method(:scrub_context))
         | 
| 30 | 
            -
                context = base_params.dup.to_unsafe_hash
         | 
| 31 | 
            -
                prepare_context.reduce(context) do |params, context_proc|
         | 
| 32 | 
            -
                  context = context_proc.call(params, session, request.env)
         | 
| 33 | 
            -
                end
         | 
| 34 | 
            -
                context
         | 
| 35 | 
            -
              end
         | 
| 36 | 
            -
             | 
| 37 | 
            -
              def scrub_context(params, _session, _env)
         | 
| 38 | 
            -
                %i(grid_nesting input_tag).each do |key|
         | 
| 39 | 
            -
                  params.delete(key) {params.delete(key.to_s)}
         | 
| 40 | 
            -
                end
         | 
| 41 | 
            -
                params
         | 
| 42 | 
            -
              end
         | 
| 43 26 | 
             
            end
         | 
| @@ -7,14 +7,14 @@ | |
| 7 7 | 
             
              <title><%= @pom.page.title if @pom.page %></title>
         | 
| 8 8 | 
             
              <meta name="description" content="">
         | 
| 9 9 | 
             
              <meta name="viewport" content="width=device-width, initial-scale=1">
         | 
| 10 | 
            -
              <%= coprl_headers | 
| 10 | 
            +
              <%= coprl_headers %>
         | 
| 11 11 | 
             
              <%= csrf_meta_tags %>
         | 
| 12 12 | 
             
              <%= csp_meta_tag if defined?(csp_meta_tag) %>
         | 
| 13 13 | 
             
            </head>
         | 
| 14 14 | 
             
            <body>
         | 
| 15 | 
            -
            <%=  | 
| 16 | 
            -
            <%= yield %>
         | 
| 17 | 
            -
             | 
| 15 | 
            +
            <%= with_presenters_wrapper do %>
         | 
| 16 | 
            +
              <%= yield %>
         | 
| 17 | 
            +
            <% end %>
         | 
| 18 18 | 
             
            <noscript><p>JavaScript must be enabled to continue.</p></noscript>
         | 
| 19 19 | 
             
            </body>
         | 
| 20 20 | 
             
            </html>
         | 
| @@ -28,9 +28,11 @@ class CoprlTemplateHandler | |
| 28 28 | 
             
                    # otherwise we need to get the presenter name built from params
         | 
| 29 29 | 
             
                    presenter_name = local_assigns[:presenter] ? presenter : namespaced_presenter(params)
         | 
| 30 30 | 
             
                    presenter = Coprl::Presenters::App[presenter_name].call
         | 
| 31 | 
            -
                    context =  | 
| 31 | 
            +
                    context = self.controller.prepare_context(params)
         | 
| 32 32 | 
             
                    router = Coprl::Presenters::WebClient::Router.new(base_url: request.base_url)
         | 
| 33 | 
            -
                     | 
| 33 | 
            +
                    plugins = self.controller.class.plugins
         | 
| 34 | 
            +
                  
         | 
| 35 | 
            +
                    @pom = presenter.expand(router: router, context: context, plugins: plugins)
         | 
| 34 36 | 
             
                  end
         | 
| 35 37 | 
             
                  #{source}
         | 
| 36 38 | 
             
                  end
         | 
| @@ -59,13 +59,10 @@ export class VPosts extends VBase { | |
| 59 59 | 
             
                        formData.append(name, encode(value));
         | 
| 60 60 | 
             
                    }
         | 
| 61 61 |  | 
| 62 | 
            -
                     | 
| 63 | 
            -
             | 
| 64 | 
            -
                    if (paramCount < 1) {
         | 
| 62 | 
            +
                    if (this.paramCount(formData) < 1) {
         | 
| 65 63 | 
             
                        console.warn(
         | 
| 66 64 | 
             
                            'Creating request with no data!'
         | 
| 67 | 
            -
                            + ' Are you sure you\'ve hooked everything up correctly?' | 
| 68 | 
            -
                        );
         | 
| 65 | 
            +
                            + ' Are you sure you\'ve hooked everything up correctly?');
         | 
| 69 66 | 
             
                    }
         | 
| 70 67 |  | 
| 71 68 | 
             
                    let errors = this.validate(formData);
         | 
| @@ -185,10 +182,17 @@ export class VPosts extends VBase { | |
| 185 182 | 
             
                        }
         | 
| 186 183 |  | 
| 187 184 | 
             
                        // Send our FormData object; HTTP headers are set automatically
         | 
| 188 | 
            -
                         | 
| 185 | 
            +
                        // Rack 2.2 will throw an exception https://github.com/rack/rack/issues/1603
         | 
| 186 | 
            +
                        // if we set the header as multi-part form data with no data in the body
         | 
| 187 | 
            +
                        // So we set the body to null in this case.
         | 
| 188 | 
            +
                        httpRequest.send(this.paramCount(formData) < 1 ? null : formData);
         | 
| 189 189 | 
             
                    });
         | 
| 190 190 | 
             
                }
         | 
| 191 191 |  | 
| 192 | 
            +
                paramCount(formData){
         | 
| 193 | 
            +
                    return Array.from(formData).length;
         | 
| 194 | 
            +
                }
         | 
| 195 | 
            +
             | 
| 192 196 | 
             
                isForm() {
         | 
| 193 197 | 
             
                    var parentElement = this.parentElement();
         | 
| 194 198 | 
             
                    return parentElement && parentElement.elements;
         | 
| @@ -1,15 +1,10 @@ | |
| 1 1 | 
             
            <%
         | 
| 2 | 
            -
              header = pom.header
         | 
| 3 | 
            -
              drawer = pom.drawer
         | 
| 4 | 
            -
              footer = pom.footer
         | 
| 5 | 
            -
             | 
| 6 2 | 
             
              root_classes = []
         | 
| 7 3 | 
             
              root_classes << 'v-root--header-present' if header
         | 
| 8 4 | 
             
              root_classes << 'v-root--drawer-present' if drawer
         | 
| 9 5 | 
             
              root_classes << 'v-root--footer-present' if footer
         | 
| 10 6 | 
             
            %>
         | 
| 11 7 | 
             
            <div class="v-root compatibility-wrapper mdc-typography <%= root_classes.join(' ') %>">
         | 
| 12 | 
            -
             | 
| 13 8 | 
             
              <% if drawer %>
         | 
| 14 9 | 
             
                <div class="drawer-frame-root">
         | 
| 15 10 | 
             
                  <%= partial "body/dismissable-drawer", :locals => {drawer: drawer} %>
         | 
| @@ -22,5 +17,21 @@ | |
| 22 17 | 
             
                <div class="drawer-main-content">
         | 
| 23 18 | 
             
                  <%= partial "body/modal-drawer", :locals => {drawer: drawer} %>
         | 
| 24 19 | 
             
              <% end %>
         | 
| 20 | 
            +
             | 
| 21 | 
            +
              <%= body_content %>
         | 
| 22 | 
            +
             | 
| 25 23 | 
             
              <div class="v-page-content page-content">
         | 
| 26 24 | 
             
                <div class="v-errors">
         | 
| 25 | 
            +
                </div>
         | 
| 26 | 
            +
              </div>
         | 
| 27 | 
            +
              <% if drawer %>
         | 
| 28 | 
            +
                </div>
         | 
| 29 | 
            +
                </div>
         | 
| 30 | 
            +
                </div>
         | 
| 31 | 
            +
              <% end %>
         | 
| 32 | 
            +
             | 
| 33 | 
            +
              <%= partial "body/snackbar" %>
         | 
| 34 | 
            +
              <% if footer %>
         | 
| 35 | 
            +
                <%= partial "body/footer", :locals => {:footer => footer} %>
         | 
| 36 | 
            +
              <% end %>
         | 
| 37 | 
            +
            </div>
         | 
| @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            <div id="<%= comp.id %>" class="<%= 'v-hidden' if comp.hidden %>">
         | 
| 2 2 | 
             
              <div
         | 
| 3 | 
            -
              <% if comp. | 
| 4 | 
            -
              data-input-tag="<%= comp. | 
| 3 | 
            +
              <% if comp.input_tag %>
         | 
| 4 | 
            +
              data-input-tag="<%= comp.input_tag %>"
         | 
| 5 5 | 
             
              <% end %>
         | 
| 6 6 | 
             
              <%= draggable_attributes(comp) %>
         | 
| 7 7 | 
             
              <%= drop_zone_attributes(comp) %>
         | 
| @@ -3,7 +3,7 @@ | |
| 3 3 | 
             
            %>
         | 
| 4 4 | 
             
            <div class="v-form-field mdc-form-field">
         | 
| 5 5 | 
             
              <div id="<%= comp.id %>"
         | 
| 6 | 
            -
                   <% if comp. | 
| 6 | 
            +
                   <% if comp.input_tag %>data-input-tag="<%= comp.input_tag %>"<% end %>
         | 
| 7 7 | 
             
                   <% if comp.dirtyable %>data-dirtyable<% end %>
         | 
| 8 8 | 
             
                   class="v-checkbox mdc-checkbox v-input
         | 
| 9 9 | 
             
                          <%= data_table_class_name %>">
         | 
| @@ -3,8 +3,8 @@ | |
| 3 3 | 
             
                 position_classes = comp.position.map {|p| "v-content-position-#{p}"}.join(' ')
         | 
| 4 4 | 
             
            %>
         | 
| 5 5 | 
             
              <div id="<%= comp.id %>"
         | 
| 6 | 
            -
                   <% if comp. | 
| 7 | 
            -
                   data-input-tag="<%= comp. | 
| 6 | 
            +
                   <% if comp.input_tag %>
         | 
| 7 | 
            +
                   data-input-tag="<%= comp.input_tag %>"
         | 
| 8 8 | 
             
                   <% end %>
         | 
| 9 9 | 
             
                   <%= draggable_attributes(comp) %>
         | 
| 10 10 | 
             
                   <%= drop_zone_attributes(comp) %>
         | 
| @@ -3,7 +3,7 @@ | |
| 3 3 | 
             
              type_class = comp.picker ? 'v-datetime' : 'v-date-text'
         | 
| 4 4 | 
             
            %>
         | 
| 5 5 | 
             
            <div id="<%= comp.id %>"
         | 
| 6 | 
            -
                 <% if comp. | 
| 6 | 
            +
                 <% if comp.input_tag %>data-input-tag="<%= comp.input_tag %>"<% end %>
         | 
| 7 7 | 
             
                 <% if comp.dirtyable %>data-dirtyable<% end %>
         | 
| 8 8 | 
             
                 class="v-input <%= type_class %> mdc-text-field mdc-text-field--outlined
         | 
| 9 9 | 
             
                        <%= 'mdc-text-field--with-trailing-icon' if comp.clear_icon %>
         | 
| @@ -2,8 +2,8 @@ | |
| 2 2 | 
             
              dialog_action_buttons = Array(comp&.actions&.buttons)
         | 
| 3 3 | 
             
            %>
         | 
| 4 4 | 
             
            <div id="<%= comp.id %>"
         | 
| 5 | 
            -
                 <% if comp. | 
| 6 | 
            -
                 data-input-tag="<%= comp. | 
| 5 | 
            +
                 <% if comp.input_tag %>
         | 
| 6 | 
            +
                 data-input-tag="<%= comp.input_tag %>"
         | 
| 7 7 | 
             
                 <% end %>
         | 
| 8 8 | 
             
                 class="v-dialog mdc-dialog"
         | 
| 9 9 | 
             
                 role="alertdialog"
         | 
| @@ -6,8 +6,8 @@ | |
| 6 6 | 
             
               @gutters.push comp.gutter.nil? ? @gutters.last : comp.gutter
         | 
| 7 7 | 
             
            %>
         | 
| 8 8 | 
             
            <div id="<%= comp.id %>"
         | 
| 9 | 
            -
                 <% if comp. | 
| 10 | 
            -
                 data-input-tag="<%= comp. | 
| 9 | 
            +
                 <% if comp.input_tag %>
         | 
| 10 | 
            +
                 data-input-tag="<%= comp.input_tag %>"
         | 
| 11 11 | 
             
                 <% end %>
         | 
| 12 12 | 
             
                 class="v-grid mdc-layout-grid
         | 
| 13 13 | 
             
                        <%= _padding_classes_(comp.padding, @grid_nesting) %>
         | 
| @@ -1,5 +1,5 @@ | |
| 1 1 | 
             
            <input class="v-input v-hidden-field"
         | 
| 2 2 | 
             
                   type="hidden"
         | 
| 3 | 
            -
                   <% if comp. | 
| 3 | 
            +
                   <% if comp.input_tag %>data-input-tag="<%= comp.input_tag %>"<% end %>
         | 
| 4 4 | 
             
                   <% if comp.dirtyable %>data-dirtyable<% end %>
         | 
| 5 5 | 
             
                   id="<%= comp.id %>" name="<%= comp.name %>" value="<%= comp.value %>"/>
         | 
| @@ -2,7 +2,7 @@ | |
| 2 2 | 
             
                 float_label = comp.options.select{|o| o.selected }.any?
         | 
| 3 3 | 
             
            %>
         | 
| 4 4 | 
             
              <div class="v-multi-select-container"
         | 
| 5 | 
            -
                   <% if comp. | 
| 5 | 
            +
                   <% if comp.input_tag %>data-input-tag="<%= comp.input_tag %>"<% end %>
         | 
| 6 6 | 
             
                   <% if comp.dirtyable %>data-dirtyable<% end %>>
         | 
| 7 7 | 
             
                <div class="v-multi-select--options-list v-hidden">
         | 
| 8 8 | 
             
                  <% comp.options.each do |option| %>
         | 
| @@ -4,7 +4,7 @@ | |
| 4 4 | 
             
                 auto_complete = comp.auto_complete&.to_sym == :off ? 'extra-off' : comp.auto_complete
         | 
| 5 5 | 
             
            %>
         | 
| 6 6 | 
             
              <div id="<%= comp.id %>"
         | 
| 7 | 
            -
                   <%= "data-input-tag='#{comp. | 
| 7 | 
            +
                   <%= "data-input-tag='#{comp.input_tag}'" if comp.input_tag %>
         | 
| 8 8 | 
             
                   <%= 'data-dirtyable' if comp.dirtyable %>
         | 
| 9 9 | 
             
                   class="v-input v-text-field v-focusable mdc-text-field mdc-text-field--outlined
         | 
| 10 10 | 
             
                        <%= 'mdc-text-field--with-leading-icon' if leading_icon %>
         | 
| @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            <div class="v-form-field mdc-form-field">
         | 
| 2 2 | 
             
              <div id="<%= comp.id %>"
         | 
| 3 | 
            -
                   <% if comp. | 
| 3 | 
            +
                   <% if comp.input_tag %>data-input-tag="<%= comp.input_tag %>"<% end %>
         | 
| 4 4 | 
             
                   <% if comp.dirtyable %>data-dirtyable<% end %>
         | 
| 5 5 | 
             
                   class="v-radio mdc-radio v-input">
         | 
| 6 6 | 
             
                <input class="mdc-radio__native-control"
         | 
| @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            <div class="v-rich-text-area-container v-input"
         | 
| 2 2 | 
             
                 id="<%= comp.id %>"
         | 
| 3 | 
            -
                 <% if comp. | 
| 3 | 
            +
                 <% if comp.input_tag %>data-input-tag="<%= comp.input_tag %>"<% end %>
         | 
| 4 4 | 
             
                 <% if comp.dirtyable %>data-dirtyable<% end %>
         | 
| 5 5 | 
             
                 <% if comp.height %>data-initial-height="<%= comp.height %>"<% end %>
         | 
| 6 6 | 
             
                 <% if comp.resizable %>data-resizable<% end %>
         | 
| @@ -4,7 +4,7 @@ | |
| 4 4 | 
             
              <div class="mdc-select v-select v-input
         | 
| 5 5 | 
             
                          <%= 'mdc-select--outlined' if comp.outlined %>
         | 
| 6 6 | 
             
                          <% if comp.disabled %>mdc-select--disabled<% end %>"
         | 
| 7 | 
            -
                   <% if comp. | 
| 7 | 
            +
                   <% if comp.input_tag %>data-input-tag="<%= comp.input_tag %>"<% end %>
         | 
| 8 8 | 
             
                   <% if comp.dirtyable %>data-dirtyable<% end %>
         | 
| 9 9 | 
             
                   <%= 'style="width: 100%;"' if comp.full_width %>>
         | 
| 10 10 | 
             
                <%= partial "components/icon", :locals => {comp: comp.icon, class_name: 'mdc-select__icon', parent_id: "#{comp.id}-input", size_class: '', position: []} if comp.icon %>
         | 
| @@ -3,8 +3,8 @@ | |
| 3 3 | 
             
            %>
         | 
| 4 4 | 
             
            <div class="v-errors">
         | 
| 5 5 | 
             
              <ul id="<%= comp.id %>"
         | 
| 6 | 
            -
                  <% if comp. | 
| 7 | 
            -
                  data-input-tag="<%= comp. | 
| 6 | 
            +
                  <% if comp.input_tag %>
         | 
| 7 | 
            +
                  data-input-tag="<%= comp.input_tag %>"
         | 
| 8 8 | 
             
                  <% end %>
         | 
| 9 9 | 
             
                  class="mdl-stepper v-stepper
         | 
| 10 10 | 
             
                        <%= ' mdl-stepper--horizontal' if horizontal %>
         | 
| @@ -18,8 +18,8 @@ | |
| 18 18 | 
             
              <div id="<%= comp.id %>-content">
         | 
| 19 19 | 
             
                <% for step in comp.steps %>
         | 
| 20 20 | 
             
                  <div id="<%= step.id %>-content"
         | 
| 21 | 
            -
                       <% if step. | 
| 22 | 
            -
                       data-input-tag="<%= step. | 
| 21 | 
            +
                       <% if step.input_tag %>
         | 
| 22 | 
            +
                       data-input-tag="<%= step.input_tag %>"
         | 
| 23 23 | 
             
                       <% end %>
         | 
| 24 24 | 
             
                       class="v-content v-step__content v-step__content-<%= step.id %>
         | 
| 25 25 | 
             
                        <%= ' is-active' if step.selected %>
         | 
| @@ -3,7 +3,7 @@ | |
| 3 3 |  | 
| 4 4 | 
             
            <div class="v-form-field mdc-form-field">
         | 
| 5 5 | 
             
              <div id="<%= comp.id %>"
         | 
| 6 | 
            -
                   <% if comp. | 
| 6 | 
            +
                   <% if comp.input_tag %>data-input-tag="<%= comp.input_tag %>"<% end %>
         | 
| 7 7 | 
             
                   <% if comp.dirtyable %>data-dirtyable<% end %>
         | 
| 8 8 | 
             
                   class="v-switch v-input mdc-switch
         | 
| 9 9 | 
             
                  <%= 'mdc-switch--disabled' if comp.disabled %>
         | 
| @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            <div id="<%= comp.id %>" class="v-input v-text-field mdc-text-field mdc-text-field--textarea
         | 
| 2 2 | 
             
                        <% if comp.disabled %>mdc-text-field--disabled<% end %>"
         | 
| 3 | 
            -
                 <% if comp. | 
| 3 | 
            +
                 <% if comp.input_tag %>data-input-tag="<%= comp.input_tag %>"<% end %>
         | 
| 4 4 | 
             
                 <% if comp.dirtyable %>data-dirtyable<% end %>
         | 
| 5 5 | 
             
                 style="<%= 'width:100%' if comp.full_width %>">
         | 
| 6 6 | 
             
              <textarea id="<%= comp.id %>-input"
         | 
| @@ -5,7 +5,7 @@ | |
| 5 5 | 
             
                 behavior = comp.behavior || 'text'
         | 
| 6 6 | 
             
            %>
         | 
| 7 7 | 
             
              <div id="<%= comp.id %>"
         | 
| 8 | 
            -
                   <% if comp. | 
| 8 | 
            +
                   <% if comp.input_tag %>data-input-tag="<%= comp.input_tag %>"<% end %>
         | 
| 9 9 | 
             
                   <% if comp.dirtyable %>data-dirtyable<% end %>
         | 
| 10 10 | 
             
                   class="v-input v-text-field v-focusable mdc-text-field mdc-text-field--outlined
         | 
| 11 11 | 
             
                        <%= 'mdc-text-field--with-leading-icon' if leading_icon %>
         |