katalyst-tables 2.2.0 → 2.2.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 187059d630f338d5bcdd0ecc98eb3850fa7d4d01e6d37f0918143873c7a50033
|
4
|
+
data.tar.gz: ac469214c3cdcf72b97ec5e5ab973356307d4d218d13face3ed48a82f9c09035
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a134c643f8780ff95287de876492b356adaa0e822b4fd72afe68980135859813cc5e9a1ac0c391bb227b27bc597a32c79266c1c88afcd005cc3186c3c30e27c
|
7
|
+
data.tar.gz: 5eb871b2122d8edd2e95724f52d8a073ff4109e8281aadb1b7e8df231dd1f00d1096de80af370f8a3a6b42bfa8b9025254e29e2e16fb18ccc488c56222bee61e
|
@@ -16,10 +16,6 @@ module Katalyst
|
|
16
16
|
# Enhance a given table component class with orderable support.
|
17
17
|
# Supports extension via `included` and `extended` hooks.
|
18
18
|
def self.make_orderable(table_class)
|
19
|
-
# Add `orderable` columns to row components
|
20
|
-
table_class.header_row_component.include(HeaderRow)
|
21
|
-
table_class.body_row_component.include(BodyRow)
|
22
|
-
|
23
19
|
# Add `orderable` slot to table component
|
24
20
|
table_class.config_component :orderable, default: "FormComponent"
|
25
21
|
table_class.renders_one(:orderable, lambda do |**attrs|
|
@@ -37,6 +33,14 @@ module Katalyst
|
|
37
33
|
Orderable.make_orderable(table.class)
|
38
34
|
end
|
39
35
|
|
36
|
+
def initialize(**attributes)
|
37
|
+
super
|
38
|
+
|
39
|
+
# Add `orderable` columns to row components
|
40
|
+
header_row_component.include(HeaderRow)
|
41
|
+
body_row_component.include(BodyRow)
|
42
|
+
end
|
43
|
+
|
40
44
|
def tbody_attributes
|
41
45
|
return super unless orderable?
|
42
46
|
|
@@ -16,7 +16,7 @@ module Katalyst
|
|
16
16
|
included do
|
17
17
|
attr_accessor :items
|
18
18
|
|
19
|
-
delegate :model, :
|
19
|
+
delegate :model, :each, :count, :empty?, to: :items, allow_nil: true
|
20
20
|
delegate :model_name, to: :model, allow_nil: true
|
21
21
|
end
|
22
22
|
|