ui_bibz 2.3.2 → 2.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f23d2e21aaf908e81c6352e44b1514fa0c246de87daa580b293b6369a9fed54d
4
- data.tar.gz: fd181dff7011dd315c8d705348d7beb30d4a1c1734036067f8006e4463b7b25d
3
+ metadata.gz: 7abead1ee77c880302afa08b5a3bc9f4242528ce569382c5eca9e5f803a8178c
4
+ data.tar.gz: 1cbd5bd4eeba8c2eef04ac1d76d44afb3bacdb6bd06200473f869d543a69d9c8
5
5
  SHA512:
6
- metadata.gz: 3014f68569378b7897cc87412640e82c1a8d7402b1ef8c7289f5a523eb5801b364d68a256eac6941f0da264bfeabaf62fb13469c1ea291f51d2339cdfcc21f30
7
- data.tar.gz: 6ea5553d97fe5b5610d4c4b0a4057a4096174c60dd5062e27f3d5b99a7f7e79b36004aa5decdd316f68a154b2f37bdd83f5e18b9e18f79243bacb4a7b1459e47
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.2)
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.7)
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-group-btn
35
- .input-refresh-button
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
- .bootstrap-select .dropdown-toggle:after
76
- margin-top: 0.44rem
77
- margin-bottom: 0.44rem
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
- margin: 0.25rem
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
- key_name = attribute.keys.first.to_s.pluralize
124
- sql_subquery << "lower(#{ key_name }.#{ attribute.values.first }) LIKE :#{ key_name }_#{ attribute.values.first }_#{ i }"
125
- sql_attributes = sql_attributes.merge(Hash["#{ key_name }_#{ attribute.values.first }_#{ i }".to_sym, "%#{ pattern }%"])
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.2"
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
- "bg-#{ options[:status] }" unless options[:status].nil?
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
@@ -35,7 +35,7 @@ module UiBibz::Ui::Ux::Tables
35
35
  end
36
36
 
37
37
  def progress_render
38
- UiBibz::Ui::Core::Progress.new(@content, status: (@col.status || :primary)).render
38
+ UiBibz::Ui::Core::Notifications::ProgressBar.new(@content, @col.progress_options).render
39
39
  end
40
40
 
41
41
  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, :status, :name, :input_options, :class, :as, :data_index, :date_format, :sort, :format, :date_format, :count, :custom_sort, :parent, :id
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
- @status = @options[:status]
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.2
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-15 00:00:00.000000000 Z
11
+ date: 2019-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails