ui_bibz 2.0.0.alpha10 → 2.0.0.alpha11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +9 -7
- data/app/assets/stylesheets/table.sass +2 -0
- data/app/assets/stylesheets/ui_bibz.sass +0 -2
- data/lib/ui_bibz/ui/core/alert.rb +4 -4
- data/lib/ui_bibz/ui/core/breadcrumb/breadcrumb.rb +2 -2
- data/lib/ui_bibz/ui/core/breadcrumb/components/breadcrumb_link.rb +2 -2
- data/lib/ui_bibz/ui/core/button/button.rb +10 -10
- data/lib/ui_bibz/ui/core/button/button_choice.rb +5 -5
- data/lib/ui_bibz/ui/core/button/button_dropdown.rb +3 -3
- data/lib/ui_bibz/ui/core/button/button_group.rb +5 -1
- data/lib/ui_bibz/ui/core/button/button_link.rb +2 -2
- data/lib/ui_bibz/ui/core/button/button_split_dropdown.rb +5 -5
- data/lib/ui_bibz/ui/core/card/card.rb +4 -4
- data/lib/ui_bibz/ui/core/card/components/block/card_block_text.rb +1 -1
- data/lib/ui_bibz/ui/core/component.rb +7 -7
- data/lib/ui_bibz/ui/core/dropdown/components/dropdown_link.rb +2 -2
- data/lib/ui_bibz/ui/core/dropdown/dropdown.rb +6 -6
- data/lib/ui_bibz/ui/core/glyph.rb +3 -3
- data/lib/ui_bibz/ui/core/input/autocomplete_field.rb +7 -1
- data/lib/ui_bibz/ui/core/input/dropdown_select_field.rb +2 -2
- data/lib/ui_bibz/ui/core/input/formula_field.rb +1 -1
- data/lib/ui_bibz/ui/core/input/multi_select_field.rb +2 -2
- data/lib/ui_bibz/ui/core/input/surround_field.rb +9 -1
- data/lib/ui_bibz/ui/core/input/switch_field.rb +4 -4
- data/lib/ui_bibz/ui/core/label.rb +4 -4
- data/lib/ui_bibz/ui/core/list/components/list.rb +7 -7
- data/lib/ui_bibz/ui/core/list/list_group.rb +5 -5
- data/lib/ui_bibz/ui/core/nav/components/nav_dropdown.rb +2 -2
- data/lib/ui_bibz/ui/core/nav/components/nav_link.rb +3 -3
- data/lib/ui_bibz/ui/core/nav/components/nav_link_link.rb +1 -1
- data/lib/ui_bibz/ui/core/nav/components/navbar_nav.rb +1 -1
- data/lib/ui_bibz/ui/core/nav/nav.rb +1 -1
- data/lib/ui_bibz/ui/core/nav/navbar.rb +3 -3
- data/lib/ui_bibz/ui/core/progress.rb +5 -5
- data/lib/ui_bibz/ui/core/stars.rb +3 -3
- data/lib/ui_bibz/ui/ux/table/components/actions.rb +4 -0
- data/lib/ui_bibz/ui/ux/table/components/as.rb +8 -4
- data/lib/ui_bibz/ui/ux/table/components/column.rb +17 -16
- data/lib/ui_bibz/ui/ux/table/components/thead.rb +4 -4
- data/lib/ui_bibz/ui/ux/table/table.rb +8 -8
- data/lib/ui_bibz/ui/ux/table/table_card.rb +4 -4
- data/lib/ui_bibz/version.rb +1 -1
- data/test/dummy/db/schema.rb +1 -1
- data/test/ui/breadcrumb_test.rb +2 -2
- data/test/ui/button_test.rb +24 -24
- data/test/ui/card_test.rb +5 -5
- data/test/ui/component_test.rb +2 -2
- data/test/ui/dropdown_test.rb +1 -1
- data/test/ui/input_switch_field_test.rb +3 -3
- data/test/ui/inputs_test.rb +5 -5
- data/test/ui/list_group_test.rb +5 -5
- data/test/ui/nav_test.rb +3 -3
- data/test/ui/stars_test.rb +2 -2
- data/test/ui/table_test.rb +7 -7
- data/test/ui_helper_test.rb +16 -16
- data/ui_bibz.gemspec +2 -2
- metadata +5 -109
- data/doc/UiBibz.html +0 -129
- data/doc/UiBibz/Concerns.html +0 -115
- data/doc/UiBibz/Concerns/Models.html +0 -115
- data/doc/UiBibz/Concerns/Models/Searchable.html +0 -120
- data/doc/UiBibz/Concerns/Models/Searchable/ClassMethods.html +0 -174
- data/doc/UiBibz/Helpers.html +0 -115
- data/doc/UiBibz/Helpers/MetaHelper.html +0 -273
- data/doc/UiBibz/Helpers/UiCoreHelper.html +0 -1234
- data/doc/UiBibz/Helpers/UiUxHelper.html +0 -463
- data/doc/UiBibz/Helpers/UtilsHelper.html +0 -187
- data/doc/UiBibz/Rails.html +0 -115
- data/doc/UiBibz/Rails/Engine.html +0 -123
- data/doc/UiBibz/Ui.html +0 -119
- data/doc/UiBibz/Ui/Base.html +0 -304
- data/doc/UiBibz/Ui/Core.html +0 -128
- data/doc/UiBibz/Ui/Core/Alert.html +0 -383
- data/doc/UiBibz/Ui/Core/Bar.html +0 -372
- data/doc/UiBibz/Ui/Core/Breadcrumb.html +0 -442
- data/doc/UiBibz/Ui/Core/BreadcrumbLink.html +0 -369
- data/doc/UiBibz/Ui/Core/Button.html +0 -380
- data/doc/UiBibz/Ui/Core/ButtonDropdown.html +0 -401
- data/doc/UiBibz/Ui/Core/ButtonGroup.html +0 -372
- data/doc/UiBibz/Ui/Core/ButtonLink.html +0 -382
- data/doc/UiBibz/Ui/Core/ButtonSplitDropdown.html +0 -403
- data/doc/UiBibz/Ui/Core/Col.html +0 -373
- data/doc/UiBibz/Ui/Core/Component.html +0 -1087
- data/doc/UiBibz/Ui/Core/Dropdown.html +0 -663
- data/doc/UiBibz/Ui/Core/DropdownDivider.html +0 -301
- data/doc/UiBibz/Ui/Core/DropdownHeader.html +0 -355
- data/doc/UiBibz/Ui/Core/DropdownLink.html +0 -376
- data/doc/UiBibz/Ui/Core/DropdownList.html +0 -382
- data/doc/UiBibz/Ui/Core/Glyph.html +0 -385
- data/doc/UiBibz/Ui/Core/Jumbotron.html +0 -379
- data/doc/UiBibz/Ui/Core/Label.html +0 -379
- data/doc/UiBibz/Ui/Core/List.html +0 -528
- data/doc/UiBibz/Ui/Core/ListGroup.html +0 -474
- data/doc/UiBibz/Ui/Core/Modal.html +0 -543
- data/doc/UiBibz/Ui/Core/ModalBody.html +0 -353
- data/doc/UiBibz/Ui/Core/ModalFooter.html +0 -353
- data/doc/UiBibz/Ui/Core/ModalHeader.html +0 -359
- data/doc/UiBibz/Ui/Core/Nav.html +0 -515
- data/doc/UiBibz/Ui/Core/NavDropdown.html +0 -391
- data/doc/UiBibz/Ui/Core/NavLink.html +0 -364
- data/doc/UiBibz/Ui/Core/Navbar.html +0 -646
- data/doc/UiBibz/Ui/Core/NavbarForm.html +0 -364
- data/doc/UiBibz/Ui/Core/NavbarNav.html +0 -302
- data/doc/UiBibz/Ui/Core/NavbarText.html +0 -355
- data/doc/UiBibz/Ui/Core/Panel.html +0 -617
- data/doc/UiBibz/Ui/Core/ProgressBar.html +0 -462
- data/doc/UiBibz/Ui/Core/Row.html +0 -350
- data/doc/UiBibz/Ui/Core/Stars.html +0 -371
- data/doc/UiBibz/Ui/Ux.html +0 -128
- data/doc/UiBibz/Ui/Ux/Actionable.html +0 -478
- data/doc/UiBibz/Ui/Ux/Actions.html +0 -602
- data/doc/UiBibz/Ui/Ux/Column.html +0 -1249
- data/doc/UiBibz/Ui/Ux/Columns.html +0 -338
- data/doc/UiBibz/Ui/Ux/Grid.html +0 -485
- data/doc/UiBibz/Ui/Ux/Paginable.html +0 -381
- data/doc/UiBibz/Ui/Ux/Searchable.html +0 -376
- data/doc/UiBibz/Ui/Ux/Sortable.html +0 -300
- data/doc/UiBibz/Ui/Ux/Store.html +0 -1176
- data/doc/UiBibz/Ui/Ux/Table.html +0 -694
- data/doc/UiBibz/Ui/Ux/TableAction.html +0 -309
- data/doc/UiBibz/Ui/Ux/TablePagination.html +0 -342
- data/doc/UiBibz/Ui/Ux/TablePaginationPerPage.html +0 -348
- data/doc/UiBibz/Ui/Ux/TablePanel.html +0 -680
- data/doc/UiBibz/Ui/Ux/TableSearchField.html +0 -304
- data/doc/UiBibz/Utils.html +0 -115
- data/doc/UiBibz/Utils/Internationalization.html +0 -262
- data/doc/_index.html +0 -706
- data/doc/class_list.html +0 -58
- data/doc/css/common.css +0 -1
- data/doc/css/full_list.css +0 -57
- data/doc/css/style.css +0 -339
- data/doc/file.README.html +0 -1261
- data/doc/file_list.html +0 -60
- data/doc/frames.html +0 -26
- data/doc/images/alert.png +0 -0
- data/doc/images/breadcrumb.png +0 -0
- data/doc/images/button.png +0 -0
- data/doc/images/button_dropdown.png +0 -0
- data/doc/images/button_group.png +0 -0
- data/doc/images/button_link.png +0 -0
- data/doc/images/button_split_dropdown.png +0 -0
- data/doc/images/etiquette.png +0 -0
- data/doc/images/glyph.png +0 -0
- data/doc/images/list.png +0 -0
- data/doc/images/modal.png +0 -0
- data/doc/images/nav.png +0 -0
- data/doc/images/navbar.png +0 -0
- data/doc/images/panel.png +0 -0
- data/doc/images/progress_bar.png +0 -0
- data/doc/images/stars.png +0 -0
- data/doc/images/table.png +0 -0
- data/doc/images/table_pagination_per_page.png +0 -0
- data/doc/images/table_panel.png +0 -0
- data/doc/images/table_search_field.png +0 -0
- data/doc/images/ui-bibz-logo-without-border.gif +0 -0
- data/doc/images/ui-bibz-logo.gif +0 -0
- data/doc/index.html +0 -1261
- data/doc/js/app.js +0 -219
- data/doc/js/full_list.js +0 -181
- data/doc/js/jquery.js +0 -4
- data/doc/method_list.html +0 -1329
- data/doc/top-level-namespace.html +0 -112
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fa135177f9f3c62b1e509bd24aa4519c55d34b5
|
4
|
+
data.tar.gz: 32fbf70278b20464d0685bc19cd024b8d48fc3f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19a161dfa48babb9b7464ff51a8fa6ff8979e35acb69ab46c48188e10101c20ce6fec2c3c1eb1a45ff1f443dac1ca44e50f5385f34ce725cffac7295226cefa0
|
7
|
+
data.tar.gz: 72ddddbff681482f9079d1d8465233289bb1fa9618a88607cef1b0cc60f62ff8e24c164e2b3fc55d0a52596b448b732b3a6205b36daa9e08edd0261ac33c12a3
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ui_bibz (2.0.0.
|
4
|
+
ui_bibz (2.0.0.alpha11)
|
5
5
|
bootstrap (< 4.0.0.alpha3)
|
6
6
|
bundler (>= 1.8.4)
|
7
7
|
font-awesome-sass
|
@@ -54,12 +54,12 @@ GEM
|
|
54
54
|
arel (6.0.3)
|
55
55
|
autoprefixer-rails (6.3.6.2)
|
56
56
|
execjs
|
57
|
-
awesome_print (1.
|
57
|
+
awesome_print (1.7.0)
|
58
58
|
bootstrap (4.0.0.alpha2)
|
59
59
|
autoprefixer-rails (>= 6.0.3)
|
60
60
|
sass (>= 3.4.19)
|
61
61
|
builder (3.2.2)
|
62
|
-
codeclimate-test-reporter (0.5.
|
62
|
+
codeclimate-test-reporter (0.5.2)
|
63
63
|
simplecov (>= 0.7.1, < 1.0.0)
|
64
64
|
concurrent-ruby (1.0.2)
|
65
65
|
docile (1.1.5)
|
@@ -96,10 +96,12 @@ GEM
|
|
96
96
|
mime-types (3.1)
|
97
97
|
mime-types-data (~> 3.2015)
|
98
98
|
mime-types-data (3.2016.0521)
|
99
|
-
mini_portile2 (2.
|
99
|
+
mini_portile2 (2.1.0)
|
100
100
|
minitest (5.9.0)
|
101
|
-
nokogiri (1.6.
|
102
|
-
mini_portile2 (~> 2.
|
101
|
+
nokogiri (1.6.8)
|
102
|
+
mini_portile2 (~> 2.1.0)
|
103
|
+
pkg-config (~> 1.1.7)
|
104
|
+
pkg-config (1.1.7)
|
103
105
|
rack (1.6.4)
|
104
106
|
rack-test (0.6.3)
|
105
107
|
rack (>= 1.0)
|
@@ -127,7 +129,7 @@ GEM
|
|
127
129
|
activesupport (= 4.2.6)
|
128
130
|
rake (>= 0.8.7)
|
129
131
|
thor (>= 0.18.1, < 2.0)
|
130
|
-
rake (11.
|
132
|
+
rake (11.2.2)
|
131
133
|
rdoc (4.2.2)
|
132
134
|
json (~> 1.4)
|
133
135
|
ruby_parser (3.8.2)
|
@@ -29,11 +29,9 @@ $states_colors: (success: $brand-success, primary: $brand-primary, secondary: $b
|
|
29
29
|
@import fix-bootstrap-4
|
30
30
|
@import fix-dropdown-select
|
31
31
|
|
32
|
-
|
33
32
|
// Components
|
34
33
|
@import table
|
35
34
|
|
36
|
-
|
37
35
|
// Custom css
|
38
36
|
@each $key, $value in $states_colors
|
39
37
|
.card-#{$key}
|
@@ -14,7 +14,7 @@ module UiBibz::Ui::Core
|
|
14
14
|
#
|
15
15
|
# You can add HTML attributes using the +html_options+.
|
16
16
|
# You can pass arguments in options attribute:
|
17
|
-
# * +
|
17
|
+
# * +status+ - status of élement with symbol value:
|
18
18
|
# (+:default+, +:primary+, +:info+, +:warning+, +:danger+)
|
19
19
|
# * +glyph+ - Add glyph with name or hash options
|
20
20
|
# * +name+ - String
|
@@ -31,7 +31,7 @@ module UiBibz::Ui::Core
|
|
31
31
|
#
|
32
32
|
# ==== Examples
|
33
33
|
#
|
34
|
-
# UiBibz::Ui::Core::Alert.new(content, {
|
34
|
+
# UiBibz::Ui::Core::Alert.new(content, { status: :success, glyph: 'eye' },{ class: 'test' }).render
|
35
35
|
#
|
36
36
|
# UiBibz::Ui::Core::Alert.new({glyph: { name: 'eye', size: 3}, { class: 'test' }) do
|
37
37
|
# content
|
@@ -77,8 +77,8 @@ module UiBibz::Ui::Core
|
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
|
-
def
|
81
|
-
sym = options[:
|
80
|
+
def status
|
81
|
+
sym = options[:status] || :info
|
82
82
|
"alert-#{ sym }"
|
83
83
|
end
|
84
84
|
|
@@ -39,7 +39,7 @@ module UiBibz::Ui::Core
|
|
39
39
|
# b.link url: '#level-1' do
|
40
40
|
# 'Level 1'
|
41
41
|
# end
|
42
|
-
# b.link 'Level 2',
|
42
|
+
# b.link 'Level 2', state: :active
|
43
43
|
# end.render
|
44
44
|
#
|
45
45
|
# ==== Helper
|
@@ -98,7 +98,7 @@ module UiBibz::Ui::Core
|
|
98
98
|
def generate_links
|
99
99
|
@options[:store].each do |item|
|
100
100
|
if item == @options[:store].last
|
101
|
-
@links << BreadcrumbLink.new(item.send(link_label),
|
101
|
+
@links << BreadcrumbLink.new(item.send(link_label), status: :disabled).render
|
102
102
|
else
|
103
103
|
@links << BreadcrumbLink.new(item.send(link_label), url: inject_url(link_url, item)).render
|
104
104
|
end
|
@@ -14,7 +14,7 @@ module UiBibz::Ui::Core
|
|
14
14
|
#
|
15
15
|
# You can add HTML attributes using the +html_options+.
|
16
16
|
# You can pass arguments in options attribute:
|
17
|
-
# * +
|
17
|
+
# * +state+ - status of élement with symbol value:
|
18
18
|
# (+:active+)
|
19
19
|
# * +url+ - String
|
20
20
|
# * +glyph+ - Add glyph with name or hash options
|
@@ -32,7 +32,7 @@ module UiBibz::Ui::Core
|
|
32
32
|
#
|
33
33
|
# ==== Examples
|
34
34
|
#
|
35
|
-
# UiBibz::Ui::Core::BreadcrumbLink.new('Home', { glyph: 'home',
|
35
|
+
# UiBibz::Ui::Core::BreadcrumbLink.new('Home', { glyph: 'home', state: :active },{ class: 'test' }).render
|
36
36
|
#
|
37
37
|
# UiBibz::Ui::Core::BreadcrumbLink.new({glyph: { name: 'eye', size: 3}, { class: 'test' }) do
|
38
38
|
# 'Home'
|
@@ -14,12 +14,12 @@ module UiBibz::Ui::Core
|
|
14
14
|
#
|
15
15
|
# You can add HTML attributes using the +html_options+.
|
16
16
|
# You can pass arguments in options attribute:
|
17
|
-
# * +
|
17
|
+
# * +status+ - status of élement with symbol value:
|
18
18
|
# (+:primary+, +:secondary+, +:info+, +:warning+, +:danger+, +:link+)
|
19
19
|
# * +size+
|
20
20
|
# (+:xs+, +:sm+, +:lg+)
|
21
21
|
# * +outline+ - Boolean
|
22
|
-
# * +
|
22
|
+
# * +state+ - Symbol (+:active+, +:disabled)
|
23
23
|
# * +type+ - Symbol (+:outline)
|
24
24
|
# * +glyph+ - Add glyph with name or hash options
|
25
25
|
# * +name+ - String
|
@@ -71,8 +71,8 @@ module UiBibz::Ui::Core
|
|
71
71
|
options[:toggle].nil? ? {} : { "data-toggle" => 'button', "aria-pressed" => false, "autocomplete" => "off" }
|
72
72
|
end
|
73
73
|
|
74
|
-
def
|
75
|
-
s = options[:
|
74
|
+
def status
|
75
|
+
s = options[:status] || :primary
|
76
76
|
"btn-#{ s }#{ outline }"
|
77
77
|
end
|
78
78
|
|
@@ -92,15 +92,15 @@ module UiBibz::Ui::Core
|
|
92
92
|
"btn-#{ options[:size] }" if options[:size]
|
93
93
|
end
|
94
94
|
|
95
|
-
#def
|
96
|
-
#if @
|
97
|
-
#
|
95
|
+
#def statuss
|
96
|
+
#if @statuss.nil?
|
97
|
+
#statuss = {}
|
98
98
|
#%w(success primary secondary info warning danger link).each do |s|
|
99
|
-
#
|
99
|
+
#statuss = statuss.merge(Hash[s.to_sym, s])
|
100
100
|
#end
|
101
|
-
#@
|
101
|
+
#@statuss = statuss
|
102
102
|
#end
|
103
|
-
#@
|
103
|
+
#@statuss
|
104
104
|
#end
|
105
105
|
|
106
106
|
end
|
@@ -15,13 +15,13 @@ module UiBibz::Ui::Core
|
|
15
15
|
# You can add HTML attributes using the +html_options+.
|
16
16
|
# You can pass arguments in options attribute:
|
17
17
|
# * +type+ - Symbol (+:checkbox+, +:radio+)
|
18
|
-
# * +
|
18
|
+
# * +status+ - status of élement with symbol value:
|
19
19
|
# (+:primary+, +:secondary+, +:info+, +:warning+, +:danger+)
|
20
20
|
# * +size+
|
21
21
|
# (+:xs+, +:sm+, +:lg+)
|
22
22
|
# * +url+ - String url
|
23
23
|
# * +outline+ - Boolean
|
24
|
-
# * +
|
24
|
+
# * +state+ - Symbol (+:active+, +:disabled)
|
25
25
|
# * +type+ - Symbol (+:block)
|
26
26
|
# * +name+ - String name of input checkbox
|
27
27
|
# * +id+ - String id of input checkbox
|
@@ -41,9 +41,9 @@ module UiBibz::Ui::Core
|
|
41
41
|
#
|
42
42
|
# ==== Examples
|
43
43
|
#
|
44
|
-
# UiBibz::Ui::Core::ButtonChoice.new('test',
|
44
|
+
# UiBibz::Ui::Core::ButtonChoice.new('test', state: :active)
|
45
45
|
#
|
46
|
-
# UiBibz::Ui::Core::ButtonChoice.new({id: '
|
46
|
+
# UiBibz::Ui::Core::ButtonChoice.new({id: 'state', input_html_options: { class: 'state'}}, { class: 'lable-class'}) do
|
47
47
|
# test
|
48
48
|
# end.render
|
49
49
|
#
|
@@ -81,7 +81,7 @@ module UiBibz::Ui::Core
|
|
81
81
|
end
|
82
82
|
|
83
83
|
def checked
|
84
|
-
@options[:
|
84
|
+
@options[:state] == :active ? { checked: :checked } : {}
|
85
85
|
end
|
86
86
|
|
87
87
|
def name
|
@@ -14,12 +14,12 @@ module UiBibz::Ui::Core
|
|
14
14
|
#
|
15
15
|
# You can add HTML attributes using the +html_options+.
|
16
16
|
# You can pass arguments in options attribute:
|
17
|
-
# * +
|
17
|
+
# * +status+ - status of élement with symbol value:
|
18
18
|
# (+:primary+, +:secondary+, +:info+, +:warning+, +:danger+)
|
19
19
|
# * +size+
|
20
20
|
# (+:xs+, +:sm+, +:lg+)
|
21
21
|
# * +outline+ - Boolean
|
22
|
-
# * +
|
22
|
+
# * +state+ - Symbol (+:active+, +:disabled)
|
23
23
|
# * +type+ - Symbol (+:block)
|
24
24
|
# * +glyph+ - Add glyph with name or hash options
|
25
25
|
# * +name+ - String
|
@@ -37,7 +37,7 @@ module UiBibz::Ui::Core
|
|
37
37
|
#
|
38
38
|
# ==== Examples
|
39
39
|
#
|
40
|
-
# UiBibz::Ui::Core::ButtonDropdown.new(name,
|
40
|
+
# UiBibz::Ui::Core::ButtonDropdown.new(name, status: :success).tap do |d|
|
41
41
|
# d.link 'test', { url: '#Test1' }
|
42
42
|
# d.list('---')
|
43
43
|
# d.list('Header 1', { type: :header })
|
@@ -14,7 +14,7 @@ module UiBibz::Ui::Core
|
|
14
14
|
#
|
15
15
|
# You can add HTML attributes using the +html_options+.
|
16
16
|
# You can pass arguments in options attribute:
|
17
|
-
# * +
|
17
|
+
# * +status+ - status of element with +symbol+ value:
|
18
18
|
# (+:primary+, +:secondary+, +:info+, +:warning+, +:danger+)
|
19
19
|
# * +size+ - Size of element with +symbol+ value:
|
20
20
|
# (+:xs+, +:sm+, +:lg+)
|
@@ -68,6 +68,10 @@ module UiBibz::Ui::Core
|
|
68
68
|
options[:type] || :group
|
69
69
|
end
|
70
70
|
|
71
|
+
def component_html_data
|
72
|
+
add_html_data "toggle", "buttons"
|
73
|
+
end
|
74
|
+
|
71
75
|
def size
|
72
76
|
"btn-group-#{ options[:size] }" if options[:size]
|
73
77
|
end
|
@@ -14,13 +14,13 @@ module UiBibz::Ui::Core
|
|
14
14
|
#
|
15
15
|
# You can add HTML attributes using the +html_options+.
|
16
16
|
# You can pass arguments in options attribute:
|
17
|
-
# * +
|
17
|
+
# * +status+ - status of élement with symbol value:
|
18
18
|
# (+:primary+, +:secondary+, +:info+, +:warning+, +:danger+)
|
19
19
|
# * +size+
|
20
20
|
# (+:xs+, +:sm+, +:lg+)
|
21
21
|
# * +url+ - String url
|
22
22
|
# * +outline+ - Boolean
|
23
|
-
# * +
|
23
|
+
# * +state+ - Symbol (+:active+, +:disabled)
|
24
24
|
# * +type+ - Symbol (+:block)
|
25
25
|
# * +glyph+ - Add glyph with name or hash options
|
26
26
|
# * +name+ - String
|
@@ -14,12 +14,12 @@ module UiBibz::Ui::Core
|
|
14
14
|
#
|
15
15
|
# You can add HTML attributes using the +html_options+.
|
16
16
|
# You can pass arguments in options attribute:
|
17
|
-
# * +
|
17
|
+
# * +status+ - status of élement with symbol value:
|
18
18
|
# (+:primary+, +:secondary+, +:info+, +:warning+, +:danger+)
|
19
19
|
# * +size+
|
20
20
|
# (+:xs+, +:sm+, +:lg+)
|
21
21
|
# * +outline+ - Boolean
|
22
|
-
# * +
|
22
|
+
# * +state+ - Symbol (+:active+, +:disabled)
|
23
23
|
# * +type+ - Symbol (+:block)
|
24
24
|
# * +glyph+ - Add glyph with name or hash options
|
25
25
|
# * +name+ - String
|
@@ -37,7 +37,7 @@ module UiBibz::Ui::Core
|
|
37
37
|
#
|
38
38
|
# ==== Examples
|
39
39
|
#
|
40
|
-
# UiBibz::Ui::Core::ButtonSplitDropdown.new(name,
|
40
|
+
# UiBibz::Ui::Core::ButtonSplitDropdown.new(name, status: :success).tap do |d|
|
41
41
|
# d.list link_to('test', '#')
|
42
42
|
# d.list('---')
|
43
43
|
# d.list('Header 1', { type: :header })
|
@@ -80,11 +80,11 @@ module UiBibz::Ui::Core
|
|
80
80
|
end
|
81
81
|
|
82
82
|
def button_html
|
83
|
-
content_tag :button, button_content, class: join_classes("btn",
|
83
|
+
content_tag :button, button_content, class: join_classes("btn", button_status, size)
|
84
84
|
end
|
85
85
|
|
86
86
|
def split_html
|
87
|
-
content_tag :button, split_content, class: join_classes("btn",
|
87
|
+
content_tag :button, split_content, class: join_classes("btn", button_status, size, "dropdown-toggle"), type: 'button', "data-toggle" => 'dropdown', "aria-haspopup" => true, "aria-expanded" => false
|
88
88
|
end
|
89
89
|
|
90
90
|
def split_content
|
@@ -20,7 +20,7 @@ module UiBibz::Ui::Core
|
|
20
20
|
#
|
21
21
|
# You can add HTML attributes using the +html_options+.
|
22
22
|
# You can pass arguments in options attribute:
|
23
|
-
# * +
|
23
|
+
# * +status+ - status of élement with symbol value:
|
24
24
|
# (+:primary+, +:secondary+, +:info+, +:warning+, +:danger+)
|
25
25
|
# * text_position - Symbole
|
26
26
|
# (+:left+, +:right+, +:center+)
|
@@ -46,7 +46,7 @@ module UiBibz::Ui::Core
|
|
46
46
|
#
|
47
47
|
# UiBibz::Ui::Core::Card('test').render
|
48
48
|
#
|
49
|
-
# UiBibz::Ui::Core::Card(
|
49
|
+
# UiBibz::Ui::Core::Card(status: :primary) do |d|
|
50
50
|
# 'test'
|
51
51
|
# end.render
|
52
52
|
#
|
@@ -134,8 +134,8 @@ module UiBibz::Ui::Core
|
|
134
134
|
["card", text_position, card_block, type, tab_pane]
|
135
135
|
end
|
136
136
|
|
137
|
-
def
|
138
|
-
"card-#{ @options[:
|
137
|
+
def status
|
138
|
+
"card-#{ @options[:status] }" unless @options[:status].nil?
|
139
139
|
end
|
140
140
|
|
141
141
|
def text_position
|
@@ -13,7 +13,7 @@ module UiBibz::Ui::Core
|
|
13
13
|
#
|
14
14
|
# You can add HTML attributes using the +html_options+.
|
15
15
|
# You can pass arguments in options attribute:
|
16
|
-
# * +
|
16
|
+
# * +status+ - status of élement with symbol value:
|
17
17
|
# (+:default+, +:primary+, +:info+, +:warning+, +:danger+)
|
18
18
|
# * +glyph+ - Add glyph with name or hash options
|
19
19
|
# * +name+ - String
|
@@ -85,7 +85,7 @@ module UiBibz::Ui::Core
|
|
85
85
|
end
|
86
86
|
|
87
87
|
def label_html
|
88
|
-
UiBibz::Ui::Core::Label.new(options[:label], class: 'pull-right', type: :pill,
|
88
|
+
UiBibz::Ui::Core::Label.new(options[:label], class: 'pull-right', type: :pill, status: (options[:label_status] || :default)).render
|
89
89
|
end
|
90
90
|
|
91
91
|
# Know if component is tapped or not
|
@@ -116,8 +116,8 @@ module UiBibz::Ui::Core
|
|
116
116
|
{}
|
117
117
|
end
|
118
118
|
|
119
|
-
# Override this method to add a
|
120
|
-
def
|
119
|
+
# Override this method to add a status class
|
120
|
+
def status
|
121
121
|
end
|
122
122
|
|
123
123
|
# Join classes
|
@@ -138,8 +138,8 @@ module UiBibz::Ui::Core
|
|
138
138
|
def initialize_component_html_classes
|
139
139
|
cls = [
|
140
140
|
html_options[:class],
|
141
|
-
status,
|
142
141
|
state,
|
142
|
+
status,
|
143
143
|
effect,
|
144
144
|
options_classes,
|
145
145
|
component_html_classes
|
@@ -174,8 +174,8 @@ module UiBibz::Ui::Core
|
|
174
174
|
initialize_component_html_options
|
175
175
|
end
|
176
176
|
|
177
|
-
def
|
178
|
-
options[:
|
177
|
+
def state
|
178
|
+
options[:state] unless options[:state].nil?
|
179
179
|
end
|
180
180
|
|
181
181
|
end
|
@@ -14,7 +14,7 @@ module UiBibz::Ui::Core
|
|
14
14
|
#
|
15
15
|
# You can add HTML attributes using the +html_options+.
|
16
16
|
# You can pass arguments in options attribute:
|
17
|
-
# * +
|
17
|
+
# * +state+ - status of élement with symbol value:
|
18
18
|
# (+:active+)
|
19
19
|
# * +url+ - String
|
20
20
|
# * +glyph+ - Add glyph with name or hash options
|
@@ -33,7 +33,7 @@ module UiBibz::Ui::Core
|
|
33
33
|
#
|
34
34
|
# ==== Examples
|
35
35
|
#
|
36
|
-
# UiBibz::Ui::Core::DropdownLink.new('Home', { glyph: 'home',
|
36
|
+
# UiBibz::Ui::Core::DropdownLink.new('Home', { glyph: 'home', state: :active, url: '#home', link_html_options: { class: 'link1' }},{ class: 'test' }).render
|
37
37
|
#
|
38
38
|
# UiBibz::Ui::Core::DropdownLink.new({ glyph: { name: 'eye', size: 3 }, url: '#home' }, { class: 'test' }) do
|
39
39
|
# 'Home'
|
@@ -18,7 +18,7 @@ module UiBibz::Ui::Core
|
|
18
18
|
#
|
19
19
|
# You can add HTML attributes using the +html_options+.
|
20
20
|
# You can pass arguments in options attribute:
|
21
|
-
# * +
|
21
|
+
# * +status+ - status of élement with symbol value:
|
22
22
|
# (+:primary+, +:secondary+, +:info+, +:warning+, +:danger+)
|
23
23
|
# * +size+
|
24
24
|
# (+:xs+, +:sm+, +:lg+)
|
@@ -39,7 +39,7 @@ module UiBibz::Ui::Core
|
|
39
39
|
#
|
40
40
|
# ==== Examples
|
41
41
|
#
|
42
|
-
# UiBibz::Ui::Core::Dropdown.new(name,
|
42
|
+
# UiBibz::Ui::Core::Dropdown.new(name, status: :success).tap do |d|
|
43
43
|
# d.link 'test', { url: '#' }
|
44
44
|
# d.divider
|
45
45
|
# d.header 'Header 1'
|
@@ -65,7 +65,7 @@ module UiBibz::Ui::Core
|
|
65
65
|
def initialize content, options = nil, html_options = nil, &block
|
66
66
|
super
|
67
67
|
@items = []
|
68
|
-
@
|
68
|
+
@status = @options.delete(:status)
|
69
69
|
end
|
70
70
|
|
71
71
|
# Render html tag
|
@@ -110,7 +110,7 @@ module UiBibz::Ui::Core
|
|
110
110
|
end
|
111
111
|
|
112
112
|
def button_html
|
113
|
-
content_tag :button, button_content, class: join_classes("btn",
|
113
|
+
content_tag :button, button_content, class: join_classes("btn", button_status, size, "dropdown-toggle"), type: 'button', "data-toggle" => 'dropdown', "aria-haspopup" => true, "aria-expanded" => false
|
114
114
|
end
|
115
115
|
|
116
116
|
def ul_html
|
@@ -133,8 +133,8 @@ module UiBibz::Ui::Core
|
|
133
133
|
"open" if @options[:open]
|
134
134
|
end
|
135
135
|
|
136
|
-
def
|
137
|
-
sym = @
|
136
|
+
def button_status
|
137
|
+
sym = @status || :primary
|
138
138
|
"btn-#{ sym }"
|
139
139
|
end
|
140
140
|
|