Skip to content

Commit 0d0651d

Browse files
author
Nils Henning
committed
[REFACTOR] migrate all components to 1.0.0 html attributes and properties implementation
1 parent 53fa8b7 commit 0d0651d

File tree

70 files changed

+211
-277
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+211
-277
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ end
502502

503503
- [ ] Please add an unique ID to each `async` component usage, even if matestack is currntly autogeneratin an ID if not applied. This will be removed in future releases
504504

505-
#### 12. New `toggle` component is replacing `async` shown_on, hide_on, hidef_afer...
505+
#### 12. New `toggle` component is replacing `async` shown_on, hide_on, hide_after...
506506

507507
We decided to move all pure clientside view state manipulation logic from the `async` component to a new component called `toggle`. `async` should now only take care of serverside rerendering based on events.
508508

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
%a{@tag_attributes, "@click.prevent": "perform", "href": action_path}
1+
%a{ html_attributes, "@click.prevent": "perform", "href": action_path }
22
- if block_given?
33
= yield

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ def initialize(*args)
1313
if @included_config.present? && @included_config[:isolated_parent_class].present?
1414
@component_config[:parent_class] = @included_config[:isolated_parent_class]
1515
end
16-
@tag_attributes.merge!({
16+
end
17+
18+
def children_wrapper_attributes
19+
html_attributes.merge({
1720
"v-if": "showing",
1821
id: @component_config[:component_key]
1922
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
%div{@tag_attributes.merge(class: "matestack-async-component-root")}
1+
%div{ children_wrapper_attributes.merge(class: "matestack-async-component-root") }
22
=yield
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
%bdo{@tag_attributes}
2-
- if options[:text].blank? && block_given?
1+
%bdo{ html_attributes }
2+
- if text.blank? && block_given?
33
= yield
44
- else
5-
= options[:text]
5+
= text
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
module Matestack::Ui::Core::Bdo
22
class Bdo < Matestack::Ui::Core::Component::Static
3-
requires :dir
4-
5-
def setup
6-
@tag_attributes.merge!({
7-
"dir": options[:dir]
8-
})
9-
end
3+
html_attributes :dir
4+
optional :text
105
end
116
end
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module Matestack::Ui::Core::Button
22
class Button < Matestack::Ui::Core::Component::Static
3-
html_attributes :disabled
3+
html_attributes :autofocus, :disabled, :form, :formaction, :formenctype, :formmethod,
4+
:formnovalidate, :formtarget, :name, :type, :value
45
optional :text
56
end
67
end

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ def setup
77
end
88

99
def response
10-
components {
11-
div @tag_attributes do
12-
yield_components
13-
end
14-
}
10+
div @tag_attributes do
11+
yield_components
12+
end
1513
end
1614

1715
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
%a{@tag_attributes, "@click": "next()"}
1+
%a{ html_attributes , "@click": "next()" }
22
- if block_given?
33
= yield
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
%a{@tag_attributes, "@click": "goToPage(#{@options[:page]})"}
1+
%a{ html_attributes, "@click": "goToPage(#{page})" }
22
- if block_given?
33
= yield

0 commit comments

Comments
 (0)