turbo_material 0.2.7 → 0.2.8

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: f904dd4488984f9f96e107e9e32b3809c0884b382ae82facb43261fce9cca428
4
- data.tar.gz: 80c47036d39ca75999474289f9ed6b88ccf0a238aece2b95a069b7bc7d2092ae
3
+ metadata.gz: 6acc440d7f51220ea594251511c1427dc12bfdfcd3089535a6f8c5865301348e
4
+ data.tar.gz: fd4bab6abf129e3bc7451a885bab1792fa9ef0bd1da1b94230926ab9a5850ff0
5
5
  SHA512:
6
- metadata.gz: 91e7c52c5476509122cc47e5ecb7ddc25d6082fa163f65aa02f03504de8da98adde45e5caebdcc1438ede30f85305462963952a70dd5e3792fe453aa4df1c9e5
7
- data.tar.gz: cb79432f223068b3f35a3a736a3e49213943e963dd9204c119f7dcb9c34b28eb5c0b6fff1ea4c217aec2277e3359c780231a14a86ba494e01a04d63307d96ec6
6
+ metadata.gz: a8bf8d52a2d46cbf0cbd50e980b75b2895fc0dfd63f7e8f1bed6d379a3f6708ec86f411ec2f48f8f3417526aa546b768d5f7a65d49d2e3d48610d729c6339262
7
+ data.tar.gz: 1460bdf2047d84584c08c870bf58570991c3142f42a726ceb3a779d4a765853eb5b1b2dafa5c22cd6f43d36920d34a23df9d2f5b11dc2b87c8274a1bbc488c1d
@@ -10,7 +10,9 @@ export default class extends Controller {
10
10
  static values = {
11
11
  url: String,
12
12
  suffix: String,
13
- name: String
13
+ name: String,
14
+ prefetch: Boolean,
15
+ additionalQueryParams: Object,
14
16
  }
15
17
 
16
18
  connect() {
@@ -18,6 +20,9 @@ export default class extends Controller {
18
20
  this.chipsetEl = this.element.querySelector(".mdc-chip-set");
19
21
  this.input = mdc.textField.MDCTextField.attachTo(this.inputEl);
20
22
  this.chips = mdc.chips.MDCChipSet.attachTo(this.chipsetEl);
23
+ if (this.prefetchValue) {
24
+ this.search();
25
+ }
21
26
  useClickOutside(this);
22
27
  }
23
28
 
@@ -133,6 +138,9 @@ export default class extends Controller {
133
138
  params.append("name", this.nameValue);
134
139
  params.append("opened", this.opened);
135
140
  params.append("exclude", this.hiddenTarget.value);
141
+ Object.keys(this.additionalQueryParamsValue).forEach((param) => {
142
+ params.append(param, this.additionalQueryParamsValue[param]);
143
+ });
136
144
  get(`${this.urlValue}?${params.toString()}`, {
137
145
  responseKind: "turbo-stream",
138
146
  });
@@ -1,9 +1,11 @@
1
- <%# locals: (form:, disabled: false, required: false, name:, label: nil, id:, frame: nil, suffix: nil, type: 'text', url: nil, selected: [], options: [], value: nil, fixed: false) %>
1
+ <%# locals: (form:, disabled: false, required: false, name:, label: nil, id:, frame: nil, suffix: nil, type: 'text', url: nil, selected: [], options: [], value: nil, fixed: false, prefetch: false, additional_query_params: {}) %>
2
2
  <%- id = [name, suffix].compact_blank.join('-') -%>
3
3
  <div data-controller="material-chips-input"
4
4
  data-material-chips-input-url-value="<%= url %>"
5
5
  data-material-chips-input-name-value="<%= name %>"
6
6
  data-material-chips-input-material-list-outlet="#<%= "#{id}-list" %>"
7
+ data-material-chips-input-prefetch-value="<%= prefetch.to_s %>"
8
+ data-material-chips-input-additional-query-params-value="<%= additional_query_params.to_json %>"
7
9
  <% if suffix.present? %>data-material-chips-input-suffix-value="<%= suffix %>"<% end %>
8
10
  data-action="keydown.esc->material-chips-input#close keydown.enter->prevent-default country-select-focus->material-chips-input#confirmSelection"
9
11
  >
@@ -1,3 +1,3 @@
1
1
  module TurboMaterial
2
- VERSION = "0.2.7"
2
+ VERSION = "0.2.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbo_material
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Moiseev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-21 00:00:00.000000000 Z
11
+ date: 2024-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -191,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
191
  - !ruby/object:Gem::Version
192
192
  version: '0'
193
193
  requirements: []
194
- rubygems_version: 3.4.12
194
+ rubygems_version: 3.5.3
195
195
  signing_key:
196
196
  specification_version: 4
197
197
  summary: Material Web Components for Hotwire Turbo.