Skip to content

added missing @tag_attributes #151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/concepts/matestack/ui/core/async/async.haml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
%div{"v-if": "showing"}
%div{@tag_attributes}
= yield
3 changes: 3 additions & 0 deletions app/concepts/matestack/ui/core/async/async.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ class Async < Matestack::Ui::Core::Component::Dynamic

def setup
@rerender = true
@tag_attributes.merge!({
"v-if": "showing"
})
end

end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def setup

def response
components {
div do
div @tag_attributes do
yield_components
end
}
Expand Down
2 changes: 1 addition & 1 deletion app/concepts/matestack/ui/core/collection/filter/filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def setup

def response
components {
div do
div @tag_attributes do
yield_components
end
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
- if [:text, :number, :email, :date, :password].include?(options[:type])
%input{"v-model#{'.number' if options[:type] == :number}": input_key,
type: options[:type],
class: options[:class],
id: component_id,
"@keyup.enter": "submitFilter()",
ref: "filter.#{attr_key}",
placeholder: options[:placeholder]}
%input{@tag_attributes}
12 changes: 12 additions & 0 deletions app/concepts/matestack/ui/core/collection/filter/input/input.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
module Matestack::Ui::Core::Collection::Filter::Input
class Input < Matestack::Ui::Core::Component::Static

def setup
@tag_attributes.merge!({
"v-model#{'.number' if options[:type] == :number}": input_key,
type: options[:type],
class: options[:class],
id: component_id,
"@keyup.enter": "submitFilter()",
ref: "filter.#{attr_key}",
placeholder: options[:placeholder]
})
end

def input_key
'filter["' + options[:key].to_s + '"]'
end
Expand Down
2 changes: 1 addition & 1 deletion app/concepts/matestack/ui/core/collection/order/order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def setup

def response
components {
div do
div @tag_attributes do
yield_components
end
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ class Indicator < Matestack::Ui::Core::Component::Static

def response
components {
plain "{{orderIndicator( '#{@component_config[:key]}', {asc: '#{@component_config[:asc]}', desc: '#{@component_config[:desc]}'} ) }}"
span @tag_attributes do
plain "{{orderIndicator( '#{@component_config[:key]}', {asc: '#{@component_config[:asc]}', desc: '#{@component_config[:desc]}'} ) }}"
end
}
end

Expand Down
10 changes: 4 additions & 6 deletions app/concepts/matestack/ui/core/form/input/input.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
%label=options[:label]

- if [:text, :number, :email, :date, :password].include?(options[:type])
%input{"v-model#{'.number' if options[:type] == :number}": input_key,
%input{@tag_attributes,
"v-model#{'.number' if options[:type] == :number}": input_key,
type: options[:type],
class: options[:class],
id: component_id,
"@change": "inputChanged(\"#{attr_key}\")",
ref: "input.#{attr_key}",
placeholder: options[:placeholder],
Expand All @@ -15,9 +14,8 @@
{{ error }}

- if options[:type] == :textarea
%textarea{"v-model": input_key,
class: options[:class],
id: component_id,
%textarea{@tag_attributes,
"v-model": input_key,
"@change": "inputChanged(\"#{attr_key}\")",
ref: "input.#{attr_key}",
placeholder: options[:placeholder],
Expand Down
17 changes: 10 additions & 7 deletions app/concepts/matestack/ui/core/form/select/select.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

- if options[:type] == :dropdown

%select{"#{model_binding}" => input_key,
id: component_id,
%select{@tag_attributes,
"#{model_binding}" => input_key,
ref: "select.#{attr_key}",
class: options[:class],
"@change": "inputChanged(\"#{attr_key}\")",
"init-value": init_value,
"value-type": options_type}
Expand All @@ -27,7 +26,8 @@
%div{id: component_id, ref: "select.multiple.#{attr_key}", "init-value": init_value}
- if options[:options].is_a?(Hash)
- options[:options].each do |key, value|
%input{type: :checkbox,
%input{@tag_attributes,
type: :checkbox,
"#{model_binding}": input_key,
"@change": "inputChanged(\"#{attr_key}\")",
"value-type": options_type,
Expand All @@ -36,7 +36,8 @@
%label=value
- if options[:options].is_a?(Array)
- options[:options].each do |value|
%input{type: :checkbox,
%input{@tag_attributes,
type: :checkbox,
"#{model_binding}": input_key,
"@change": "inputChanged(\"#{attr_key}\")",
"value-type": options_type,
Expand All @@ -52,7 +53,8 @@
%div{id: component_id, ref: "select.#{attr_key}", "init-value": init_value}
- if options[:options].is_a?(Hash)
- options[:options].each do |key, value|
%input{type: :radio,
%input{@tag_attributes,
type: :radio,
"#{model_binding}": input_key,
"@change": "inputChanged(\"#{attr_key}\")",
"value-type": options_type,
Expand All @@ -61,7 +63,8 @@
%label=value
- if options[:options].is_a?(Array)
- options[:options].each do |value|
%input{type: :radio,
%input{@tag_attributes,
type: :radio,
"#{model_binding}": input_key,
"@change": "inputChanged(\"#{attr_key}\")",
"value-type": options_type,
Expand Down
2 changes: 1 addition & 1 deletion app/concepts/matestack/ui/core/img/img.haml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
= image_tag(ActionController::Base.helpers.asset_path(options[:path]), height: options[:height], width: options[:width], alt: options[:alt], class: options[:class], id: options[:id])
= image_tag(@tag_attributes, ActionController::Base.helpers.asset_path(options[:path]), height: options[:height], width: options[:width], alt: options[:alt]])
2 changes: 1 addition & 1 deletion app/concepts/matestack/ui/core/onclick/onclick.haml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
%div{"@click": "perform"}
%div{@tag_attributes, "@click": "perform"}
= yield
2 changes: 1 addition & 1 deletion app/concepts/matestack/ui/core/video/video.haml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
= video_tag(ActionController::Base.helpers.asset_path(options[:path]), height: options[:height], width: options[:width], preload: options[:preload], autoplay: options[:autoplay], muted: options[:muted], playsinline: options[:playsinline], loop: options[:loop], class: options[:class], id: options[:id], controls: options[:controls])
= video_tag(@tag_attributes, ActionController::Base.helpers.asset_path(options[:path]), height: options[:height], width: options[:width], preload: options[:preload], autoplay: options[:autoplay], muted: options[:muted], playsinline: options[:playsinline], loop: options[:loop], controls: options[:controls])