trestle-search 0.5.0 → 0.5.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: 1df45597ebe609e810ac3abfb19ea0355ce6f3e5257abe234d0db52520612fc2
4
- data.tar.gz: 7a0bf19efeabfa9e717c8d070936608c7dc02e9155a7211af4383adc91701b2f
3
+ metadata.gz: c1ba3963b3be70834383be75f9ea8b4babd68c0555cb0757dc4bbc100ae27bb3
4
+ data.tar.gz: d267ebc746d46782983543e656959cd2f34a060fdd15fac1d26e544c567e0cbd
5
5
  SHA512:
6
- metadata.gz: ceebae083e563dc093dfc04b157b9976d9d87b7382f1e2d5189bc4f669a2cd07d6d897018a9e0a354bdac3dbf8799282a57dcda6a6c8bd8b02f57f2bb028f8b7
7
- data.tar.gz: 01fa168282d6041a9cf6f3d6f7de2c3ea5ba9f1ab7511d4e6b1af51ea7d0e438dddc5e1ffbafc11f6f5cd7dcee8c05b1c2386a23c19a92f5258cac9dee54a752
6
+ metadata.gz: 4520214c2670c705604957686d9261234189e4cdea69e2e34d6e0f742d84f4dae74d5c99b2496dc5fd20607971f4ec6aabe998c027c68e2e8666421a71aab15b
7
+ data.tar.gz: 4e96a03daf68830169aa0a4ca005e81529fdd886361ca774289e2f493a26ec1861e944395b50e17966d28d0231c4da381a42a97a4ccac7ae03f9d17c99df9bba
@@ -1 +1 @@
1
- .searchbox{margin-right:auto;max-width:30em;width:100%}.searchbox .input-group{background:#fff;border:1px solid #ccc;border-radius:50rem}.searchbox .form-control,.searchbox .input-group-text{background:transparent;border:0}.searchbox .form-control{box-shadow:none;padding-left:0}.searchbox .form-control::-webkit-search-cancel-button{display:none}.searchbox .clear-search{color:#555;font-size:1.2rem;padding:.35rem;position:absolute;right:.75rem;z-index:5}.searchbox .clear-search:focus,.searchbox .clear-search:hover{color:#333}
1
+ .searchbox{margin-right:auto;max-width:30em;width:100%}.searchbox .input-group{background:#fff;border:1px solid #ccc;border-radius:50rem}.searchbox .form-control,.searchbox .input-group-text{background:transparent;border:0}.searchbox .form-control{box-shadow:none;padding-left:0}.searchbox .form-control::-webkit-search-cancel-button{display:none}.searchbox .btn-clear-search{--bs-btn-padding-y:0;--bs-btn-font-size:1.325rem;--bs-btn-color:#555;--bs-btn-hover-color:#333}@media(min-width:576px){.searchbox .btn-clear-search{--bs-btn-font-size:1.25rem}}
@@ -1,9 +1,13 @@
1
1
  <div class="searchbox">
2
- <%= form_tag admin.path, method: :get do %>
2
+ <%= form_tag admin.path, method: :get, data: { turbo_frame: "main" } do %>
3
+ <%= serialize_persistent_params except: :q %>
4
+
3
5
  <div class="input-group">
4
- <span class="input-group-text"><icon class="fa fa-search"></icon></span>
5
- <%= link_to icon("fa fa-times"), admin.path, class: "clear-search" if params[:q].present? %>
6
+ <%= label_tag :q, icon("fas fa-search"), class: "input-group-text" %>
7
+
6
8
  <%= search_field_tag :q, params[:q], class: "form-control", autocomplete: "off", placeholder: admin.t("search.placeholder", default: "Search") %>
9
+
10
+ <%= link_to icon("fas fa-times"), persistent_params.except(:q), class: "btn btn-clear-search", data: { turbo_frame: "main" } if params[:q].present? %>
7
11
  </div>
8
12
  <% end %>
9
13
  </div>
data/frontend/index.scss CHANGED
@@ -1,3 +1,5 @@
1
+ @import "~trestle/frontend/css/support";
2
+
1
3
  .searchbox {
2
4
  width: 100%;
3
5
  max-width: 30em;
@@ -27,16 +29,14 @@
27
29
  }
28
30
  }
29
31
 
30
- .clear-search {
31
- position: absolute;
32
- right: 0.75rem;
33
- z-index: 5;
34
- color: #555;
35
- font-size: 1.2rem;
36
- padding: 0.35rem;
32
+ .btn-clear-search {
33
+ --bs-btn-padding-y: 0;
34
+ --bs-btn-font-size: 1.325rem;
35
+ --bs-btn-color: #555;
36
+ --bs-btn-hover-color: #333;
37
37
 
38
- &:hover, &:focus {
39
- color: #333;
38
+ @include media-breakpoint-up(sm) {
39
+ --bs-btn-font-size: 1.25rem;
40
40
  }
41
41
  }
42
42
  }
@@ -1,5 +1,5 @@
1
1
  module Trestle
2
2
  module Search
3
- VERSION = "0.5.0"
3
+ VERSION = "0.5.1"
4
4
  end
5
5
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trestle-search",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Search plugin for the Trestle admin framework",
5
5
  "main": "index.scss",
6
6
  "repository": "https://github.com/TrestleAdmin/trestle-search.git",
@@ -13,16 +13,16 @@
13
13
  "watch": "webpack --mode development --watch"
14
14
  },
15
15
  "devDependencies": {
16
- "autoprefixer": "^10.2.6",
17
- "css-loader": "^5.2.6",
18
- "css-minimizer-webpack-plugin": "^3.0.2",
19
- "mini-css-extract-plugin": "^2.0.0",
20
- "node-sass": "^7.0.0",
21
- "postcss-loader": "^6.1.1",
22
- "sass-loader": "^12.1.0",
23
- "webpack": "^5.42.0",
24
- "webpack-cli": "^4.7.2",
25
- "webpack-remove-empty-scripts": "^0.7.1"
16
+ "autoprefixer": "^10.4.20",
17
+ "css-loader": "^7.1.2",
18
+ "css-minimizer-webpack-plugin": "^7.0.0",
19
+ "mini-css-extract-plugin": "^2.9.1",
20
+ "postcss-loader": "^8.1.1",
21
+ "sass": "^1.79.1",
22
+ "sass-loader": "^16.0.1",
23
+ "webpack": "^5.94.0",
24
+ "webpack-cli": "^5.1.4",
25
+ "webpack-remove-empty-scripts": "^1.0.4"
26
26
  },
27
27
  "dependencies": {
28
28
  "trestle": "https://github.com/TrestleAdmin/trestle.git"
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.metadata["homepage_uri"] = spec.homepage
23
23
  spec.metadata["source_code_uri"] = "https://github.com/TrestleAdmin/trestle-search"
24
24
 
25
- spec.add_dependency "trestle", "~> 0.10.0"
25
+ spec.add_dependency "trestle", "~> 0.10.1"
26
26
 
27
27
  spec.add_development_dependency "rspec-rails"
28
28
  end