katalyst-tables 2.2.4 → 2.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/components/concerns/katalyst/tables/has_html_attributes.rb +23 -1
- data/app/components/katalyst/turbo/table_component.rb +1 -1
- data/app/models/concerns/katalyst/tables/collection/core.rb +7 -1
- data/app/models/concerns/katalyst/tables/collection/pagination.rb +2 -2
- data/lib/katalyst/tables/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b574c64df2689986e01f6b7a51709f80806790abf22a6b1134ab0e82ee0d058
|
4
|
+
data.tar.gz: 6127e32f529378ee36b923edbe0db1021b16c233edca12255150810b2cd69e92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f76db646ae34a587dcb466841729dcc404f4edffeabf9476b381b651f4757a198e088e9d643f9eb94acd19429438b73eb09565cd452af7ca4009fbf9577f6106
|
7
|
+
data.tar.gz: 54b9ad471e692a069ed04eebe2db54a52cc35eb9e54c3842e35e7ae58b70930c5a6361e0c22ee47001b7ecc118ed4c29ef11503a69c0f97b4649dbaef3c70b9c
|
@@ -21,9 +21,31 @@ module Katalyst
|
|
21
21
|
%i[data action],
|
22
22
|
].freeze
|
23
23
|
|
24
|
+
FLATTENABLE_ATTRIBUTES = [
|
25
|
+
%i[data controller],
|
26
|
+
%i[data action],
|
27
|
+
].freeze
|
28
|
+
|
29
|
+
refine NilClass do
|
30
|
+
def flatten_html(*)
|
31
|
+
self
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
24
35
|
refine Hash do
|
25
36
|
def merge_html(attributes)
|
26
|
-
deep_merge_html_attributes(attributes, mergeable_attributes: MERGEABLE_ATTRIBUTES)
|
37
|
+
result = deep_merge_html_attributes(attributes, mergeable_attributes: MERGEABLE_ATTRIBUTES)
|
38
|
+
FLATTENABLE_ATTRIBUTES.each_with_object(result) do |path, flattened|
|
39
|
+
flattened.flatten_html(*path)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def flatten_html(key, *path)
|
44
|
+
if path.empty?
|
45
|
+
self[key] = self[key].join(" ") if self[key].is_a?(Array)
|
46
|
+
else
|
47
|
+
self[key].flatten_html(*path)
|
48
|
+
end
|
27
49
|
end
|
28
50
|
end
|
29
51
|
|
@@ -13,6 +13,12 @@ module Katalyst
|
|
13
13
|
|
14
14
|
include Reducers
|
15
15
|
|
16
|
+
class_methods do
|
17
|
+
def permitted_params
|
18
|
+
attribute_names
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
16
22
|
included do
|
17
23
|
attr_accessor :items
|
18
24
|
|
@@ -48,7 +54,7 @@ module Katalyst
|
|
48
54
|
end
|
49
55
|
|
50
56
|
def with_params(params)
|
51
|
-
self.attributes = params.permit(self.class.
|
57
|
+
self.attributes = params.permit(self.class.permitted_params)
|
52
58
|
|
53
59
|
self
|
54
60
|
end
|
@@ -27,7 +27,7 @@ module Katalyst
|
|
27
27
|
def initialize(paginate: config.paginate, **options)
|
28
28
|
super(**options)
|
29
29
|
|
30
|
-
@paginate = paginate
|
30
|
+
@paginate = paginate.freeze
|
31
31
|
end
|
32
32
|
|
33
33
|
def paginate?
|
@@ -50,7 +50,7 @@ module Katalyst
|
|
50
50
|
def call(collection)
|
51
51
|
@collection = @app.call(collection)
|
52
52
|
if collection.paginate?
|
53
|
-
@collection.pagination, @collection.items = pagy(@collection.items, collection.paginate_options)
|
53
|
+
@collection.pagination, @collection.items = pagy(@collection.items, collection.paginate_options.dup)
|
54
54
|
end
|
55
55
|
@collection
|
56
56
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: katalyst-tables
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Katalyst Interactive
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: html-attributes-utils
|
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
requirements: []
|
112
|
-
rubygems_version: 3.4.
|
112
|
+
rubygems_version: 3.4.20
|
113
113
|
signing_key:
|
114
114
|
specification_version: 4
|
115
115
|
summary: HTML table generator for Rails views
|