views/mdc/components/select.erb in voom-presenters-0.2.0 vs views/mdc/components/select.erb in voom-presenters-2.0.0

- old
+ new

@@ -1,27 +1,43 @@ <% if comp float_label = comp.options.select{|o| o.selected }.any? %> - <div class="v-select mdc-select v-input" - <% if comp.tag %> - data-input-tag="<%= comp.tag %>" - <% end %> - <%= 'style="width: 100%;"' if comp.full_width %> <%= "#{comp.full_width}" %>> - <select id="<%= comp.id %>" - name="<%= comp.name%>" + <div class="mdc-select v-select v-input + <%= 'mdc-select--outlined' if comp.outlined %> + <% if comp.disabled %>mdc-select--disabled<% end %>" + <% if comp.tag %>data-input-tag="<%= comp.tag %>"<% end %> + <% if comp.dirtyable %>data-dirtyable<% end %> + <%= 'style="width: 100%;"' if comp.full_width %>> + <%= erb :"components/icon", :locals => {comp: comp.icon, class_name: 'mdc-select__icon', parent_id: "#{comp.id}-input", size_class: '', position: []} %> + <i class="mdc-select__dropdown-icon"></i> + <select id="<%= comp.id %>-input" + <% if comp.name %> name="<%= comp.name %>" <% end %> + <% if comp.required %>required<% end %> + <% if comp.disabled %>disabled<% end %> class="mdc-select__native-control" - <%= erb(:"components/event", locals: {events: comp.events, - parent_id: comp.id}) %>> + <%= erb(:"components/event", locals: {comp: comp, + events: comp.events, + parent_id: "#{comp.id}-input"}) %>> <% comp.options.each do |option| %> <option value="<%= option.value %>" <%= 'disabled' if option.disabled %> <%= 'selected' if option.selected %>> <%= option.text %> </option> <% end %> </select> - <label class="mdc-floating-label - <%= 'mdc-floating-label--float-above' if float_label%>"><%= comp.label %></label> - <div class="mdc-select__bottom-line"></div> + <% if comp.outlined %> + <div class="mdc-notched-outline"> + <div class="mdc-notched-outline__leading"></div> + <div class="mdc-notched-outline__notch"> + <label class="mdc-floating-label <%= 'mdc-floating-label--float-above' if float_label %>"><%= comp.label %></label> + </div> + <div class="mdc-notched-outline__trailing"></div> + </div> + <% else %> + <label class="mdc-floating-label <%= 'mdc-floating-label--float-above' if float_label %>"><%= comp.label %></label> + <div class="mdc-line-ripple"></div> + <% end %> </div> + <%= erb :"components/shared/hint_error_display", :locals => {comp: comp} %> <%= erb :"components/tooltip", :locals => {comp: comp.tooltip, parent_id: comp.id} %> <% end %>