katalyst-tables 3.4.5 → 3.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/katalyst/tables/collection/type.rb +0 -26
- data/lib/katalyst/tables/config.rb +13 -0
- data/lib/katalyst/tables/engine.rb +13 -1
- data/lib/katalyst/tables.rb +3 -7
- 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: f333ba93cb729a1f41be52b7e5c63dc94e96f4bef109b0c3dfc45b341ba50455
|
4
|
+
data.tar.gz: a7269053206d9f707a4e8d9ab27f26c86f6ee09c1b72701a2bdcae74cf2ba4cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a43742d78a0b82297ad3e09eddfae8de56b3a2a4ecb41ed44eec2b6d73ada2f29b0cec888781e0f16c35a91a71614303ab05711c243692e9b413de9a2298931
|
7
|
+
data.tar.gz: de6edd608168b5e78c4fbf9708565af15c7a80c3bc155b2191d2ab9c257ce5312ea0ebd61a101e08b5662b07e120190f6a46af73f7db94c6ac092b670af88d99
|
@@ -2,23 +2,6 @@
|
|
2
2
|
|
3
3
|
require "active_model/type"
|
4
4
|
|
5
|
-
require "katalyst/tables/collection/type/helpers/delegate"
|
6
|
-
require "katalyst/tables/collection/type/helpers/extensions"
|
7
|
-
require "katalyst/tables/collection/type/helpers/multiple"
|
8
|
-
require "katalyst/tables/collection/type/helpers/range"
|
9
|
-
|
10
|
-
require "katalyst/tables/collection/type/example"
|
11
|
-
require "katalyst/tables/collection/type/value"
|
12
|
-
|
13
|
-
require "katalyst/tables/collection/type/boolean"
|
14
|
-
require "katalyst/tables/collection/type/date"
|
15
|
-
require "katalyst/tables/collection/type/enum"
|
16
|
-
require "katalyst/tables/collection/type/float"
|
17
|
-
require "katalyst/tables/collection/type/integer"
|
18
|
-
require "katalyst/tables/collection/type/query"
|
19
|
-
require "katalyst/tables/collection/type/search"
|
20
|
-
require "katalyst/tables/collection/type/string"
|
21
|
-
|
22
5
|
module Katalyst
|
23
6
|
module Tables
|
24
7
|
module Collection
|
@@ -41,15 +24,6 @@ module Katalyst
|
|
41
24
|
@default_value ||= Value.new
|
42
25
|
end
|
43
26
|
end
|
44
|
-
|
45
|
-
register(:boolean, Type::Boolean)
|
46
|
-
register(:date, Type::Date)
|
47
|
-
register(:enum, Type::Enum)
|
48
|
-
register(:float, Type::Float)
|
49
|
-
register(:integer, Type::Integer)
|
50
|
-
register(:string, Type::String)
|
51
|
-
register(:query, Type::Query)
|
52
|
-
register(:search, Type::Search)
|
53
27
|
end
|
54
28
|
end
|
55
29
|
end
|
@@ -18,6 +18,19 @@ module Katalyst
|
|
18
18
|
|
19
19
|
config_accessor(:date_format) { :default }
|
20
20
|
config_accessor(:datetime_format) { :default }
|
21
|
+
|
22
|
+
config_accessor(:collection_types) do
|
23
|
+
{
|
24
|
+
boolean: "Katalyst::Tables::Collection::Type::Boolean",
|
25
|
+
date: "Katalyst::Tables::Collection::Type::Date",
|
26
|
+
enum: "Katalyst::Tables::Collection::Type::Enum",
|
27
|
+
float: "Katalyst::Tables::Collection::Type::Float",
|
28
|
+
integer: "Katalyst::Tables::Collection::Type::Integer",
|
29
|
+
string: "Katalyst::Tables::Collection::Type::String",
|
30
|
+
query: "Katalyst::Tables::Collection::Type::Query",
|
31
|
+
search: "Katalyst::Tables::Collection::Type::Search",
|
32
|
+
}
|
33
|
+
end
|
21
34
|
end
|
22
35
|
end
|
23
36
|
end
|
@@ -1,11 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "
|
3
|
+
require "katalyst/html_attributes"
|
4
|
+
require "rails/engine"
|
5
|
+
require "view_component"
|
4
6
|
|
5
7
|
module Katalyst
|
6
8
|
module Tables
|
7
9
|
class Engine < ::Rails::Engine # :nodoc:
|
8
10
|
isolate_namespace Katalyst::Tables
|
11
|
+
config.eager_load_namespaces << Katalyst::Tables
|
12
|
+
config.paths.add("lib", autoload: true)
|
9
13
|
|
10
14
|
initializer "katalyst-tables.asset" do
|
11
15
|
config.after_initialize do |app|
|
@@ -21,6 +25,14 @@ module Katalyst
|
|
21
25
|
app.config.importmap.cache_sweepers << root.join("app/assets/builds")
|
22
26
|
end
|
23
27
|
end
|
28
|
+
|
29
|
+
initializer "katalyst-tables.collection-types" do |app|
|
30
|
+
app.reloader.to_prepare do
|
31
|
+
Tables.config.collection_types.each do |key, type|
|
32
|
+
Collection::Type.register(key, type.constantize)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
24
36
|
end
|
25
37
|
end
|
26
38
|
end
|
data/lib/katalyst/tables.rb
CHANGED
@@ -1,18 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "active_support"
|
4
|
-
require "active_support/rails"
|
5
|
-
require "view_component"
|
6
|
-
require "katalyst/html_attributes"
|
7
|
-
|
8
|
-
require_relative "tables/config"
|
9
|
-
require_relative "tables/engine"
|
10
4
|
|
11
5
|
module Katalyst
|
12
6
|
module Tables
|
13
7
|
extend ActiveSupport::Autoload
|
14
8
|
|
15
|
-
autoload :
|
9
|
+
autoload :Config
|
16
10
|
|
17
11
|
class Error < StandardError; end
|
18
12
|
|
@@ -25,3 +19,5 @@ module Katalyst
|
|
25
19
|
end
|
26
20
|
end
|
27
21
|
end
|
22
|
+
|
23
|
+
require "katalyst/tables/engine"
|
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: 3.4.
|
4
|
+
version: 3.4.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: 2024-07-
|
11
|
+
date: 2024-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: katalyst-html-attributes
|