Skip to content

Commit 43237d6

Browse files
Merge pull request #151 from basemate/resolving_issue_136
added missing @tag_attributes
2 parents 59f0e62 + 674051f commit 43237d6

File tree

13 files changed

+40
-28
lines changed

13 files changed

+40
-28
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
%div{"v-if": "showing"}
1+
%div{@tag_attributes}
22
= yield

app/concepts/matestack/ui/core/async/async.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ class Async < Matestack::Ui::Core::Component::Dynamic
33

44
def setup
55
@rerender = true
6+
@tag_attributes.merge!({
7+
"v-if": "showing"
8+
})
69
end
710

811
end

app/concepts/matestack/ui/core/collection/content/content.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def setup
88

99
def response
1010
components {
11-
div do
11+
div @tag_attributes do
1212
yield_components
1313
end
1414
}

app/concepts/matestack/ui/core/collection/filter/filter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def setup
77

88
def response
99
components {
10-
div do
10+
div @tag_attributes do
1111
yield_components
1212
end
1313
}
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,2 @@
11
- if [:text, :number, :email, :date, :password].include?(options[:type])
2-
%input{"v-model#{'.number' if options[:type] == :number}": input_key,
3-
type: options[:type],
4-
class: options[:class],
5-
id: component_id,
6-
"@keyup.enter": "submitFilter()",
7-
ref: "filter.#{attr_key}",
8-
placeholder: options[:placeholder]}
2+
%input{@tag_attributes}

app/concepts/matestack/ui/core/collection/filter/input/input.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
module Matestack::Ui::Core::Collection::Filter::Input
22
class Input < Matestack::Ui::Core::Component::Static
33

4+
def setup
5+
@tag_attributes.merge!({
6+
"v-model#{'.number' if options[:type] == :number}": input_key,
7+
type: options[:type],
8+
class: options[:class],
9+
id: component_id,
10+
"@keyup.enter": "submitFilter()",
11+
ref: "filter.#{attr_key}",
12+
placeholder: options[:placeholder]
13+
})
14+
end
15+
416
def input_key
517
'filter["' + options[:key].to_s + '"]'
618
end

app/concepts/matestack/ui/core/collection/order/order.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def setup
77

88
def response
99
components {
10-
div do
10+
div @tag_attributes do
1111
yield_components
1212
end
1313
}

app/concepts/matestack/ui/core/collection/order/toggle/indicator/indicator.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ class Indicator < Matestack::Ui::Core::Component::Static
33

44
def response
55
components {
6-
plain "{{orderIndicator( '#{@component_config[:key]}', {asc: '#{@component_config[:asc]}', desc: '#{@component_config[:desc]}'} ) }}"
6+
span @tag_attributes do
7+
plain "{{orderIndicator( '#{@component_config[:key]}', {asc: '#{@component_config[:asc]}', desc: '#{@component_config[:desc]}'} ) }}"
8+
end
79
}
810
end
911

app/concepts/matestack/ui/core/form/input/input.haml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
%label=options[:label]
33

44
- if [:text, :number, :email, :date, :password].include?(options[:type])
5-
%input{"v-model#{'.number' if options[:type] == :number}": input_key,
5+
%input{@tag_attributes,
6+
"v-model#{'.number' if options[:type] == :number}": input_key,
67
type: options[:type],
7-
class: options[:class],
8-
id: component_id,
98
"@change": "inputChanged(\"#{attr_key}\")",
109
ref: "input.#{attr_key}",
1110
placeholder: options[:placeholder],
@@ -15,9 +14,8 @@
1514
{{ error }}
1615

1716
- if options[:type] == :textarea
18-
%textarea{"v-model": input_key,
19-
class: options[:class],
20-
id: component_id,
17+
%textarea{@tag_attributes,
18+
"v-model": input_key,
2119
"@change": "inputChanged(\"#{attr_key}\")",
2220
ref: "input.#{attr_key}",
2321
placeholder: options[:placeholder],

app/concepts/matestack/ui/core/form/select/select.haml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44

55
- if options[:type] == :dropdown
66

7-
%select{"#{model_binding}" => input_key,
8-
id: component_id,
7+
%select{@tag_attributes,
8+
"#{model_binding}" => input_key,
99
ref: "select.#{attr_key}",
10-
class: options[:class],
1110
"@change": "inputChanged(\"#{attr_key}\")",
1211
"init-value": init_value,
1312
"value-type": options_type}
@@ -27,7 +26,8 @@
2726
%div{id: component_id, ref: "select.multiple.#{attr_key}", "init-value": init_value}
2827
- if options[:options].is_a?(Hash)
2928
- options[:options].each do |key, value|
30-
%input{type: :checkbox,
29+
%input{@tag_attributes,
30+
type: :checkbox,
3131
"#{model_binding}": input_key,
3232
"@change": "inputChanged(\"#{attr_key}\")",
3333
"value-type": options_type,
@@ -36,7 +36,8 @@
3636
%label=value
3737
- if options[:options].is_a?(Array)
3838
- options[:options].each do |value|
39-
%input{type: :checkbox,
39+
%input{@tag_attributes,
40+
type: :checkbox,
4041
"#{model_binding}": input_key,
4142
"@change": "inputChanged(\"#{attr_key}\")",
4243
"value-type": options_type,
@@ -52,7 +53,8 @@
5253
%div{id: component_id, ref: "select.#{attr_key}", "init-value": init_value}
5354
- if options[:options].is_a?(Hash)
5455
- options[:options].each do |key, value|
55-
%input{type: :radio,
56+
%input{@tag_attributes,
57+
type: :radio,
5658
"#{model_binding}": input_key,
5759
"@change": "inputChanged(\"#{attr_key}\")",
5860
"value-type": options_type,
@@ -61,7 +63,8 @@
6163
%label=value
6264
- if options[:options].is_a?(Array)
6365
- options[:options].each do |value|
64-
%input{type: :radio,
66+
%input{@tag_attributes,
67+
type: :radio,
6568
"#{model_binding}": input_key,
6669
"@change": "inputChanged(\"#{attr_key}\")",
6770
"value-type": options_type,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +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])
1+
= image_tag(@tag_attributes, ActionController::Base.helpers.asset_path(options[:path]), height: options[:height], width: options[:width], alt: options[:alt]])
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
%div{"@click": "perform"}
1+
%div{@tag_attributes, "@click": "perform"}
22
= yield
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +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])
1+
= 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])

0 commit comments

Comments
 (0)