ui_bibz 2.3.11 → 2.3.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/assets/javascripts/input-connected.coffee +26 -18
- data/lib/ui_bibz/infos.rb +1 -1
- data/lib/ui_bibz/rails/engine.rb +5 -1
- data/lib/ui_bibz/ui/ux/tables/extensions/sortable.rb +11 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10cd9ab9b647ff28c979bfeb508fea49c78547a3efd216a585cfd131da3c5d10
|
4
|
+
data.tar.gz: f95eacbe232aa7ffc032cc45e7b0e5b80f816f23be04991b87d2f0fbe2f2a234
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f48645facb46cd7043564db494fd82075c85397e5e5ed1469d7548622f8b8b31adbc112d1ff9911a40c83346643ebef0aa8c9c0804698a5965833b152a3ca560
|
7
|
+
data.tar.gz: 5b88aee7f088609fcc0ee7aba8e5dcbfa4ecee5ddf66c8b165cda864b1bf625ff64cd96d36ac5aa3c9d2d0afd3c103dcb9946fcaa5f547844f96c7219fe3d3f0
|
data/Gemfile.lock
CHANGED
@@ -56,17 +56,20 @@
|
|
56
56
|
return this.each ->
|
57
57
|
component = $(this)
|
58
58
|
connect = component.data().connect
|
59
|
-
|
59
|
+
|
60
|
+
if ! connect.targets?
|
61
|
+
connect.target = connect.target || {}
|
62
|
+
connect.target.url = connect.target.url || settings.target.url
|
63
|
+
connect.target.data = connect.target.data || settings.target.data
|
64
|
+
connect.target.selector = connect.target.selector || settings.target.selector
|
65
|
+
|
66
|
+
connect.targets = connect.targets || []
|
67
|
+
connect.targets.push(connect.target) if connect.target?
|
68
|
+
|
60
69
|
return unless connect?
|
61
70
|
|
62
|
-
|
71
|
+
connectMode = connect.mode || settings.mode
|
63
72
|
events = connect.events || settings.events
|
64
|
-
target =
|
65
|
-
url: connect.target.url || settings.target.url
|
66
|
-
data: connect.target.data || settings.target.data
|
67
|
-
selector: connect.target.selector || settings.target.selector
|
68
|
-
|
69
|
-
componentTarget = $("#{ target.selector }")
|
70
73
|
|
71
74
|
component.on events, (e) ->
|
72
75
|
e.preventDefault()
|
@@ -77,17 +80,22 @@
|
|
77
80
|
name = if name? then name else "id"
|
78
81
|
#name = if Array.isArray(values) then "#{ name }s" else name
|
79
82
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
83
|
+
connect.targets.forEach (target) ->
|
84
|
+
componentTarget = $("#{ target.selector }")
|
85
|
+
|
86
|
+
mode = target.mode || connectMode
|
84
87
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
return values.includes(String(value.connect_option_id))
|
88
|
+
if mode == "remote"
|
89
|
+
params = { "#{ name }": values }
|
90
|
+
$.ajax({ url: target.url, data: params }).done (data) ->
|
91
|
+
updateTargetComponent(data, componentTarget, component)
|
90
92
|
|
91
|
-
|
93
|
+
if mode == "local"
|
94
|
+
data = target.data || settings.target.data
|
95
|
+
data = data.filter (value) ->
|
96
|
+
values = [].concat.apply([], [values]) # flatten
|
97
|
+
return values.includes(String(value.connect_option_id))
|
98
|
+
|
99
|
+
updateTargetComponent(data, componentTarget, component)
|
92
100
|
|
93
101
|
)(jQuery)
|
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.12"
|
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"
|
data/lib/ui_bibz/rails/engine.rb
CHANGED
@@ -25,7 +25,11 @@ module UiBibz
|
|
25
25
|
end
|
26
26
|
|
27
27
|
initializer 'font-awesome-sass.assets.precompile', group: :all do |app|
|
28
|
-
|
28
|
+
%w[eot svg ttf woff woff2].each do |ext|
|
29
|
+
app.config.assets.precompile << "fonts/fa-brands-400.#{ext}"
|
30
|
+
app.config.assets.precompile << "fonts/fa-regular-400.#{ext}"
|
31
|
+
app.config.assets.precompile << "fonts/fa-solid-900.#{ext}"
|
32
|
+
end
|
29
33
|
end
|
30
34
|
|
31
35
|
config.after_initialize do
|
@@ -9,7 +9,13 @@ module UiBibz::Ui::Ux::Tables
|
|
9
9
|
# header use i18n
|
10
10
|
def header column, name = nil
|
11
11
|
@column = column
|
12
|
-
defaults = [
|
12
|
+
defaults = [
|
13
|
+
header_name(name),
|
14
|
+
translate_headers_by_defaults,
|
15
|
+
translate_headers_by_defaults_active_record,
|
16
|
+
translate_headers_by_active_record,
|
17
|
+
default_header_name(name)
|
18
|
+
].compact
|
13
19
|
@name = UiBibz::Utils::Internationalization.new(translate_headers_by_model, default: defaults).translate
|
14
20
|
sortable? ? sortable_link : title
|
15
21
|
end
|
@@ -21,7 +27,10 @@ module UiBibz::Ui::Ux::Tables
|
|
21
27
|
end
|
22
28
|
|
23
29
|
def header_name name
|
24
|
-
name
|
30
|
+
name || @column.name
|
31
|
+
end
|
32
|
+
|
33
|
+
def default_header_name name
|
25
34
|
name || @column.data_index.to_s.try('titleize')
|
26
35
|
end
|
27
36
|
|