katalyst-tables 2.2.8 → 2.2.10
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3e58b95b2dc1f01bdd97fd36a31b2f340d93928d939a7501b58e7fd96150571
|
4
|
+
data.tar.gz: a72ece66c7770865d2b5892b83d114a9fa90afc5d1f81751ea37be6c34406077
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e353837d14ec65ca9391a5190615c8696d39a0b46a4099f5c4563b28963b0cd338eaf70d48187a485fbf2a747ed64d11d296da8805f3c4008ae4e02bbeacc768
|
7
|
+
data.tar.gz: 0d3837526230b4f95f9a1c235d6377c112b5d2edb820b0b56ca9f621c72a0019b735d206f9d39002340b1ce93c7efd3674013dbb1c96073d306c785562b4ad7c
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import { Controller } from "@hotwired/stimulus";
|
2
|
-
import { Turbo } from "@hotwired/turbo";
|
2
|
+
import { Turbo } from "@hotwired/turbo-rails";
|
3
3
|
|
4
4
|
export default class TurboCollectionController extends Controller {
|
5
5
|
static values = {
|
6
|
-
|
6
|
+
query: String,
|
7
7
|
sort: String,
|
8
8
|
};
|
9
9
|
|
10
|
-
|
11
|
-
Turbo.navigator.history.replace(this.#url(
|
10
|
+
queryValueChanged(query) {
|
11
|
+
Turbo.navigator.history.replace(this.#url(query));
|
12
12
|
}
|
13
13
|
|
14
14
|
sortValueChanged(sort) {
|
@@ -21,13 +21,18 @@ export default class TurboCollectionController extends Controller {
|
|
21
21
|
return "input[name='sort']";
|
22
22
|
}
|
23
23
|
|
24
|
-
#url(
|
24
|
+
#url(query) {
|
25
25
|
const frame = this.element.closest("turbo-frame");
|
26
|
+
let url;
|
26
27
|
|
27
28
|
if (frame) {
|
28
|
-
|
29
|
+
url = new URL(frame.baseURI);
|
29
30
|
} else {
|
30
|
-
|
31
|
+
url = new URL(window.location.href);
|
31
32
|
}
|
33
|
+
|
34
|
+
url.search = query;
|
35
|
+
|
36
|
+
return url;
|
32
37
|
}
|
33
38
|
}
|
@@ -26,16 +26,15 @@ module Katalyst
|
|
26
26
|
def default_html_attributes
|
27
27
|
{
|
28
28
|
data: {
|
29
|
-
controller:
|
30
|
-
|
31
|
-
tables__turbo_collection_sort_value:
|
29
|
+
controller: "tables--turbo-collection",
|
30
|
+
tables__turbo_collection_query_value: current_query,
|
31
|
+
tables__turbo_collection_sort_value: collection.sort,
|
32
32
|
},
|
33
33
|
}
|
34
34
|
end
|
35
35
|
|
36
|
-
def
|
37
|
-
|
38
|
-
params.empty? ? "" : "?#{Rack::Utils.build_nested_query(params)}"
|
36
|
+
def current_query
|
37
|
+
Rack::Utils.build_nested_query(collection.to_params)
|
39
38
|
end
|
40
39
|
|
41
40
|
def default_header_options
|
data/config/importmap.rb
CHANGED
@@ -1,8 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
pin "@hotwired/stimulus", to: "stimulus.min.js", preload: true
|
4
|
-
pin "@hotwired/turbo", to: "turbo.min.js", preload: true
|
5
|
-
|
6
3
|
pin_all_from Katalyst::Tables::Engine.root.join("app/assets/javascripts"),
|
7
4
|
# preload in tests so that we don't start clicking before controllers load
|
8
5
|
preload: Rails.env.test?
|
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.10
|
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-
|
11
|
+
date: 2023-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: html-attributes-utils
|