ui_bibz 2.3.2 → 2.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/app/assets/stylesheets/fix_addon.sass +17 -0
- data/app/assets/stylesheets/forms.sass +17 -6
- data/app/assets/stylesheets/notifications.sass +8 -2
- data/lib/ui_bibz/concerns/models/searchable.rb +21 -3
- data/lib/ui_bibz/infos.rb +1 -1
- data/lib/ui_bibz/ui/core/notifications/components/bar.rb +10 -2
- data/lib/ui_bibz/ui/ux/tables/components/as.rb +1 -1
- data/lib/ui_bibz/ui/ux/tables/components/column.rb +2 -2
- data/test/ui/core/notifications/progress_bar_test.rb +21 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7abead1ee77c880302afa08b5a3bc9f4242528ce569382c5eca9e5f803a8178c
|
4
|
+
data.tar.gz: 1cbd5bd4eeba8c2eef04ac1d76d44afb3bacdb6bd06200473f869d543a69d9c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c3a56b199df127a44dd65898fa4a30d0ce584bc5c75e92aa8e5819df1626a9fafa854bd5e8c2eae52e98fe218a6c25c80c3ba3a4159a5ba86153eee26a08382
|
7
|
+
data.tar.gz: 4d2a53a411dff110be62589a26a973a06ca05c42c2c777af42f172e88570d937ee7133c24a97235dc4d62a0661ced34ff2d7a2d29d63bbeb7baa6aaf02c81951
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ui_bibz (2.3.
|
4
|
+
ui_bibz (2.3.3)
|
5
5
|
bootstrap (= 4.3.1)
|
6
6
|
haml
|
7
7
|
haml-rails
|
@@ -58,7 +58,7 @@ GEM
|
|
58
58
|
minitest (~> 5.1)
|
59
59
|
tzinfo (~> 1.1)
|
60
60
|
arel (9.0.0)
|
61
|
-
autoprefixer-rails (9.4.
|
61
|
+
autoprefixer-rails (9.4.8)
|
62
62
|
execjs
|
63
63
|
awesome_print (1.8.0)
|
64
64
|
bootstrap (4.3.1)
|
@@ -70,6 +70,16 @@ $input-group-btn-border-color: $input-border-color
|
|
70
70
|
.input-group-sm > .input-group-btn > .btn
|
71
71
|
@extend .form-control-sm
|
72
72
|
|
73
|
+
.input-group > .form-control,
|
74
|
+
.input-group > .input-group-addon,
|
75
|
+
.input-group > .input-group-btn > .btn
|
76
|
+
padding: $input-btn-padding-y $input-btn-padding-x
|
77
|
+
@include border-radius($input-border-radius)
|
78
|
+
|
79
|
+
svg
|
80
|
+
//font-size: 1.4em
|
81
|
+
margin-top: 0.1rem
|
82
|
+
|
73
83
|
|
74
84
|
//
|
75
85
|
// Text input groups
|
@@ -104,8 +114,13 @@ $input-group-btn-border-color: $input-border-color
|
|
104
114
|
font-size: $font-size-lg
|
105
115
|
@include border-radius($input-border-radius-lg)
|
106
116
|
|
117
|
+
svg
|
118
|
+
font-size: 1.5rem
|
119
|
+
margin-top: 0.1rem
|
120
|
+
|
107
121
|
svg
|
108
122
|
font-size: 1.3rem
|
123
|
+
margin-top: 0.1rem
|
109
124
|
|
110
125
|
|
111
126
|
// scss-lint:disable QualifyingElement
|
@@ -127,6 +142,7 @@ $input-group-btn-border-color: $input-border-color
|
|
127
142
|
.input-group-btn:not(:last-child) > .btn,
|
128
143
|
.input-group-btn:not(:last-child) > .btn-group > .btn,
|
129
144
|
.input-group-btn:not(:last-child) > .dropdown-toggle,
|
145
|
+
.input-group .bootstrap-select:not(:last-child) > .dropdown-toggle,
|
130
146
|
.input-group-btn:not(:first-child) > .btn:not(:last-child):not(.dropdown-toggle),
|
131
147
|
.input-group-btn:not(:first-child) > .btn-group:not(:last-child) > .btn
|
132
148
|
@include border-right-radius(0)
|
@@ -139,6 +155,7 @@ $input-group-btn-border-color: $input-border-color
|
|
139
155
|
.input-group-btn:not(:first-child) > .btn,
|
140
156
|
.input-group-btn:not(:first-child) > .btn-group > .btn,
|
141
157
|
.input-group-btn:not(:first-child) > .dropdown-toggle,
|
158
|
+
.input-group .bootstrap-select:not(:first-child) > .dropdown-toggle,
|
142
159
|
.input-group-btn:not(:last-child) > .btn:not(:first-child),
|
143
160
|
.input-group-btn:not(:last-child) > .btn-group:not(:first-child) > .btn
|
144
161
|
@include border-left-radius(0)
|
@@ -31,8 +31,11 @@
|
|
31
31
|
display: inline-block
|
32
32
|
margin-right: 10px
|
33
33
|
|
34
|
-
.input-
|
35
|
-
|
34
|
+
.input-refresh-button
|
35
|
+
border-width: 0px !important
|
36
|
+
min-height: 40px
|
37
|
+
svg
|
38
|
+
margin: 0.28rem 0.25rem !important
|
36
39
|
//padding: 10px 16px
|
37
40
|
|
38
41
|
.input-group-btn
|
@@ -46,12 +49,20 @@
|
|
46
49
|
min-width: 104px
|
47
50
|
|
48
51
|
.ui_surround_field
|
52
|
+
.custom-control
|
53
|
+
.custom-control-label
|
54
|
+
margin-left: 0px !important
|
55
|
+
padding-right: 10px
|
56
|
+
margin-right: 0
|
57
|
+
.custom-control-label:after, .custom-control-label:before
|
58
|
+
right: 0
|
59
|
+
left: 0
|
60
|
+
|
49
61
|
flex-wrap: nowrap
|
50
62
|
.mr-sm-2
|
51
63
|
margin-right: 0px !important
|
52
64
|
input:not(:first-child):not(:last-child)
|
53
65
|
border-radius: 0px
|
54
|
-
.abc-radio.input-group-addon, .abc-checkbox.input-group-addon
|
55
66
|
input
|
56
67
|
margin-left: 0.5rem
|
57
68
|
select:not(:first-child):not(:last-child)
|
@@ -72,9 +83,9 @@
|
|
72
83
|
content: none
|
73
84
|
|
74
85
|
// fix button bug
|
75
|
-
|
76
|
-
|
77
|
-
|
86
|
+
|
87
|
+
.bootstrap-select button
|
88
|
+
min-height: 40px
|
78
89
|
|
79
90
|
.bootstrap-select .dropdown-menu li a
|
80
91
|
min-height: 32px
|
@@ -12,6 +12,12 @@
|
|
12
12
|
.glyph
|
13
13
|
vertical-align: middle
|
14
14
|
|
15
|
+
.btn
|
16
|
+
svg
|
17
|
+
margin: 0.25rem 0.25rem
|
18
|
+
.input-group-btn button svg
|
19
|
+
margin: 0.4rem 0.25rem
|
20
|
+
|
15
21
|
.dropdown-item
|
16
22
|
.glyph
|
17
23
|
margin-right: 1rem
|
@@ -26,8 +32,8 @@
|
|
26
32
|
span:not(.input-group-addon, .btn) .glyph
|
27
33
|
margin-top: -0.1rem
|
28
34
|
|
29
|
-
.input-group-btn span svg
|
30
|
-
|
35
|
+
// .input-group-btn span svg
|
36
|
+
// margin: 0.25rem
|
31
37
|
|
32
38
|
.toast .toast-header img
|
33
39
|
width: 20px
|
@@ -120,9 +120,18 @@ module UiBibz::Concerns::Models::Searchable
|
|
120
120
|
sql_subquery = []
|
121
121
|
@searchable_attributes.each do |attribute|
|
122
122
|
if attribute.kind_of?(Hash)
|
123
|
-
|
124
|
-
|
125
|
-
|
123
|
+
if attribute == :as
|
124
|
+
attribute.values.each do |value|
|
125
|
+
sql_subquery << "lower(#{ value }) LIKE :#{ value }_#{ i }"
|
126
|
+
sql_attributes = sql_attributes.merge(Hash["#{ value }_#{ i }".to_sym, "%#{ pattern }%"])
|
127
|
+
end
|
128
|
+
else
|
129
|
+
key_name = attribute.keys.first.to_s.pluralize
|
130
|
+
attribute.values.each do |value|
|
131
|
+
sql_subquery << "lower(#{ key_name }.#{ value }) LIKE :#{ key_name }_#{ value }_#{ i }"
|
132
|
+
sql_attributes = sql_attributes.merge(Hash["#{ key_name }_#{ value }_#{ i }".to_sym, "%#{ pattern }%"])
|
133
|
+
end
|
134
|
+
end
|
126
135
|
else
|
127
136
|
sql_subquery << "lower(#{ self.to_s.underscore.pluralize.split('/').last }.#{ attribute }) LIKE :#{ attribute }_#{ i }"
|
128
137
|
sql_attributes = sql_attributes.merge(Hash["#{ attribute }_#{ i }".to_sym, "%#{ pattern }%"])
|
@@ -154,6 +163,15 @@ module UiBibz::Concerns::Models::Searchable
|
|
154
163
|
end
|
155
164
|
|
156
165
|
module ClassMethods
|
166
|
+
|
167
|
+
# => searchable_attributes :name, :address
|
168
|
+
# or
|
169
|
+
# => searchable_attributes user: :name
|
170
|
+
# or
|
171
|
+
# => searchable_attributes user: [:name, :address]
|
172
|
+
# or
|
173
|
+
# => search_attributes :name, as: [:mybuildcolumn1, :mybuild_column2]
|
174
|
+
#
|
157
175
|
def searchable_attributes *args
|
158
176
|
@searchable_attributes ||= args
|
159
177
|
end
|
data/lib/ui_bibz/infos.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module UiBibz
|
2
2
|
NAME = "Ui Bibz"
|
3
|
-
VERSION = "2.3.
|
3
|
+
VERSION = "2.3.3"
|
4
4
|
DESCRIPTION = "A Rails Interface Framework using Bootstrap."
|
5
5
|
SUMMARY = "Create your project with Ui Bibz. Over a thirty reusable components built to provide iconography, dropdowns, input groups, navigation, alerts, and much more."
|
6
6
|
LICENSE = "MIT"
|
@@ -55,7 +55,7 @@ module UiBibz::Ui::Core::Notifications::Components
|
|
55
55
|
private
|
56
56
|
|
57
57
|
def component_html_classes
|
58
|
-
['progress-bar', striped, animated]
|
58
|
+
['progress-bar', striped, animated, status]
|
59
59
|
end
|
60
60
|
|
61
61
|
def component_html_options
|
@@ -83,7 +83,11 @@ module UiBibz::Ui::Core::Notifications::Components
|
|
83
83
|
end
|
84
84
|
|
85
85
|
def status
|
86
|
-
|
86
|
+
if options[:statuses]
|
87
|
+
"bg-#{ statuses.fetch(statuses.size*value/100, statuses.last) }"
|
88
|
+
else
|
89
|
+
"bg-#{ options[:status] }" unless options[:status].nil?
|
90
|
+
end
|
87
91
|
end
|
88
92
|
|
89
93
|
def text
|
@@ -96,5 +100,9 @@ module UiBibz::Ui::Core::Notifications::Components
|
|
96
100
|
end
|
97
101
|
end
|
98
102
|
|
103
|
+
def statuses
|
104
|
+
options[:statuses] == true ? %i(success primary info warning danger) : options[:statuses]
|
105
|
+
end
|
106
|
+
|
99
107
|
end
|
100
108
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module UiBibz::Ui::Ux::Tables
|
2
2
|
class Column < UiBibz::Ui::Core::Component
|
3
3
|
|
4
|
-
attr_accessor :hidden, :link, :
|
4
|
+
attr_accessor :hidden, :link, :name, :input_options, :class, :as, :data_index, :date_format, :sort, :format, :date_format, :count, :custom_sort, :parent, :id, :progress_options
|
5
5
|
|
6
6
|
def initialize content = nil, options = nil, html_options = nil, &block
|
7
7
|
super
|
@@ -20,7 +20,7 @@ module UiBibz::Ui::Ux::Tables
|
|
20
20
|
@class = @options[:class]
|
21
21
|
@hidden = @options[:hidden]
|
22
22
|
@input_options = @options[:input_options]
|
23
|
-
@
|
23
|
+
@progress_options = @options[:progress_options] || {}
|
24
24
|
end
|
25
25
|
|
26
26
|
def linkable?
|
@@ -49,4 +49,25 @@ class ProgressBarTest < ActionView::TestCase
|
|
49
49
|
assert_equal expected, actual
|
50
50
|
end
|
51
51
|
|
52
|
+
test 'progress bar with statuses and 20%' do
|
53
|
+
actual = ui_progress_bar 20, statuses: true
|
54
|
+
expected = "<div class=\"progress\"><div class=\"bg-primary progress-bar\" aria-valuenow=\"20.0\" aria-valuemin=\"0\" aria-valuemax=\"100\" style=\"width: 20.0%\" role=\"progressbar\">20.0%</div></div>"
|
55
|
+
|
56
|
+
assert_equal expected, actual
|
57
|
+
end
|
58
|
+
|
59
|
+
test 'progress bar with statuses and 80%' do
|
60
|
+
actual = ui_progress_bar 80, statuses: true
|
61
|
+
expected = "<div class=\"progress\"><div class=\"bg-danger progress-bar\" aria-valuenow=\"80.0\" aria-valuemin=\"0\" aria-valuemax=\"100\" style=\"width: 80.0%\" role=\"progressbar\">80.0%</div></div>"
|
62
|
+
|
63
|
+
assert_equal expected, actual
|
64
|
+
end
|
65
|
+
|
66
|
+
test 'progress bar with custom statuses' do
|
67
|
+
actual = ui_progress_bar 80, statuses: [:info, :warning]
|
68
|
+
expected = "<div class=\"progress\"><div class=\"bg-warning progress-bar\" aria-valuenow=\"80.0\" aria-valuemin=\"0\" aria-valuemax=\"100\" style=\"width: 80.0%\" role=\"progressbar\">80.0%</div></div>"
|
69
|
+
|
70
|
+
assert_equal expected, actual
|
71
|
+
end
|
72
|
+
|
52
73
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ui_bibz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thooams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|