Skip to content

Commit e54f05e

Browse files
Merge branch 'develop' into document_link_param_option
2 parents 87b0c87 + 5b2a975 commit e54f05e

File tree

45 files changed

+608
-289
lines changed

Some content is hidden

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

45 files changed

+608
-289
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ group :development, :test do
3232
gem 'simplecov', require: false, group: :test
3333
gem 'byebug'
3434
gem 'webmock'
35+
gem 'webdrivers', '~> 4.1'
3536
end
3637

3738
group :test do

Gemfile.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,10 @@ GEM
231231
tzinfo (1.2.5)
232232
thread_safe (~> 0.1)
233233
uber (0.1.0)
234+
webdrivers (4.1.2)
235+
nokogiri (~> 1.6)
236+
rubyzip (~> 1.0)
237+
selenium-webdriver (>= 3.0, < 4.0)
234238
webmock (3.5.1)
235239
addressable (>= 2.3.6)
236240
crack (>= 0.3.2)
@@ -264,6 +268,7 @@ DEPENDENCIES
264268
trailblazer
265269
trailblazer-cells
266270
trailblazer-rails
271+
webdrivers (~> 4.1)
267272
webmock
268273
webpacker (~> 3.5)
269274

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
%output{@tag_attributes}
2+
- if options[:text].blank? && block_given?
3+
= yield
4+
- else
5+
= options[:text]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module Matestack::Ui::Core::Output
2+
class Output < Matestack::Ui::Core::Component::Static
3+
def setup
4+
@tag_attributes.merge!(
5+
name: options[:name],
6+
for: options[:for],
7+
form: options[:form]
8+
)
9+
end
10+
end
11+
end
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
%param{@tag_attributes}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module Matestack::Ui::Core::Param
2+
class Param < Matestack::Ui::Core::Component::Static
3+
def setup
4+
@tag_attributes.merge!({
5+
name: options[:name],
6+
value: options[:value]
7+
})
8+
end
9+
end
10+
end
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
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])
1+
%video{@tag_attributes}
2+
%source{:src => @source, :type => @type}
3+
Your browser does not support the video tag.
Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
11
module Matestack::Ui::Core::Video
22
class Video < Matestack::Ui::Core::Component::Static
33

4-
REQUIRED_KEYS = [:path]
4+
REQUIRED_KEYS = [:path, :type]
5+
6+
def setup
7+
@tag_attributes.merge!({
8+
autoplay: options[:autoplay],
9+
controls: options[:controls],
10+
height: options[:height],
11+
loop: options[:loop],
12+
muted: options[:muted],
13+
playsinline: options[:playsinline],
14+
preload: options[:preload],
15+
width: options[:width]
16+
})
17+
18+
@source = ActionController::Base.helpers.asset_path(options[:path])
19+
@type = "video/#{@options[:type]}"
20+
end
521

622
end
723
end

docs/components/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,15 @@ You can build your [own components](/docs/extend/custom_components.md) as well,
3434
- [button](/docs/components/button.md)
3535
- [link](/docs/components/link.md)
3636
- [label](/docs/components/label.md)
37+
- [param](/docs/components/param.md)
3738
- [progress](/docs/components/progress.md)
3839
- [ruby](/docs/components/ruby.md)
3940
- [rt](/docs/components/rb.md)
4041
- [rp](/docs/components/rt.md)
4142
- [legend](/docs/components/legend.md)
4243
- [mark](/docs/components/mark.md)
4344
- [noscript](/docs/components/noscript.md)
45+
- [output](/docs/components/output.md)
4446
- [sup](/docs/components/sup.md)
4547
- [sub](/docs/components/sub.md)
4648
- [var](/docs/components/var.md)

docs/components/output.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# matestack core component: Output
2+
3+
Show [specs](/spec/usage/components/output_spec.rb)
4+
5+
The HTML `<output>` tag implemented in ruby.
6+
7+
## Parameters
8+
9+
This component can take up to 5 optional configuration params and either yield content or display what gets passed to the `text` configuration param.
10+
11+
#### # id (optional)
12+
Expects a string with all ids the `<output>` should have.
13+
14+
#### # class (optional)
15+
Expects a string with all classes the `<output>` should have.
16+
17+
#### # name (optional)
18+
Specifies a name for the `<output>` element
19+
20+
#### # for (optional)
21+
Specifies the relationship between the result of the calculation, and the elements used in the calculation
22+
23+
#### # form (optional)
24+
Specifies one or more forms the `<output>` element belongs to
25+
26+
## Example 1:
27+
28+
```ruby
29+
output name: 'x', for: 'a b', text: ''
30+
```
31+
32+
returns
33+
34+
```html
35+
<output for="a b" name="x"></output>
36+
```
37+
38+
## Example 2:
39+
40+
```ruby
41+
output id: 'my-id', class: 'my-class', name: 'x', for: 'a b', form: 'form_id' do
42+
plain 'All attributes'
43+
end
44+
```
45+
46+
returns
47+
48+
```html
49+
<output for="a b" form="form_id" id="my-id" name="x" class="my-class">
50+
All attributes
51+
</output>
52+
```

0 commit comments

Comments
 (0)