polaris_view_components 2.4.0 → 2.5.0
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: 84f1b013b1c1b56632fecca163692825151171015df3b9edca221b21c12e87d2
|
4
|
+
data.tar.gz: 6ca879737c1a5e7730dc6299feb6101ec53cfe35bc929a632a8b1950157cd7f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ad985b0add0dd115eefb5e94a64d5c53c8e5966bdfee188eec8e93da1c23ee327cc0bd0d35f62b11b178c6588bbc76cfeefb06de06d7eef1ac3faf0ff4cb50f
|
7
|
+
data.tar.gz: 25f136409d1e0c9aec94f43fc403a040f7f357cf1c53f5d9a1fe5ea567d6543cd9e0168b4d7b913e92c7842e5ee9efcf3fcafe5e064b79f4e9d17e6d429e2b97
|
@@ -31,14 +31,14 @@ export default class extends Controller {
|
|
31
31
|
detail: { value: input.value, label, selected: input.checked }
|
32
32
|
})
|
33
33
|
|
34
|
-
this.element.dispatchEvent(changeEvent)
|
35
|
-
|
36
34
|
if (!this.multipleValue) {
|
37
35
|
this.popoverController.forceHide()
|
38
36
|
this.inputTarget.value = label
|
39
37
|
if (this.hasHiddenInputTarget)
|
40
38
|
this.hiddenInputTarget.value = input.value
|
41
39
|
}
|
40
|
+
|
41
|
+
this.element.dispatchEvent(changeEvent)
|
42
42
|
}
|
43
43
|
|
44
44
|
onInputChange = debounce(() => {
|
@@ -203,12 +203,12 @@ class Autocomplete extends Controller {
|
|
203
203
|
selected: input.checked
|
204
204
|
}
|
205
205
|
});
|
206
|
-
this.element.dispatchEvent(changeEvent);
|
207
206
|
if (!this.multipleValue) {
|
208
207
|
this.popoverController.forceHide();
|
209
208
|
this.inputTarget.value = label;
|
210
209
|
if (this.hasHiddenInputTarget) this.hiddenInputTarget.value = input.value;
|
211
210
|
}
|
211
|
+
this.element.dispatchEvent(changeEvent);
|
212
212
|
}
|
213
213
|
onInputChange=debounce((() => {
|
214
214
|
if (this.isRemote) {
|
@@ -50,18 +50,14 @@ module Polaris
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def polaris_text_field(method, **options, &block)
|
53
|
-
options
|
54
|
-
|
55
|
-
options[:error] = !!options[:error]
|
56
|
-
end
|
53
|
+
apply_error_options(options, method)
|
54
|
+
|
57
55
|
render Polaris::TextFieldComponent.new(form: self, attribute: method, **options), &block
|
58
56
|
end
|
59
57
|
|
60
58
|
def polaris_select(method, **options, &block)
|
61
|
-
options
|
62
|
-
|
63
|
-
options[:error] = !!options[:error]
|
64
|
-
end
|
59
|
+
apply_error_options(options, method)
|
60
|
+
|
65
61
|
value = object&.public_send(method)
|
66
62
|
if value.present?
|
67
63
|
options[:selected] = value
|
@@ -70,34 +66,25 @@ module Polaris
|
|
70
66
|
end
|
71
67
|
|
72
68
|
def polaris_check_box(method, **options, &block)
|
73
|
-
options
|
74
|
-
|
75
|
-
options[:error] = !!options[:error]
|
76
|
-
end
|
69
|
+
apply_error_options(options, method)
|
70
|
+
|
77
71
|
render Polaris::CheckboxComponent.new(form: self, attribute: method, **options, &block)
|
78
72
|
end
|
79
73
|
|
80
74
|
def polaris_radio_button(method, **options, &block)
|
81
|
-
options
|
82
|
-
|
83
|
-
options[:error] = !!options[:error]
|
84
|
-
end
|
75
|
+
apply_error_options(options, method)
|
76
|
+
|
85
77
|
render Polaris::RadioButtonComponent.new(form: self, attribute: method, **options, &block)
|
86
78
|
end
|
87
79
|
|
88
80
|
def polaris_dropzone(method, **options, &block)
|
89
|
-
options
|
90
|
-
|
91
|
-
options[:error] = !!options[:error]
|
92
|
-
end
|
81
|
+
apply_error_options(options, method)
|
82
|
+
|
93
83
|
render Polaris::DropzoneComponent.new(form: self, attribute: method, **options, &block)
|
94
84
|
end
|
95
85
|
|
96
86
|
def polaris_collection_check_boxes(method, collection, value_method, text_method, **options, &block)
|
97
|
-
options
|
98
|
-
if options[:error_hidden] && options[:error]
|
99
|
-
options[:error] = !!options[:error]
|
100
|
-
end
|
87
|
+
apply_error_options(options, method)
|
101
88
|
|
102
89
|
value = object&.public_send(method)
|
103
90
|
if value.present?
|
@@ -124,11 +111,19 @@ module Polaris
|
|
124
111
|
end
|
125
112
|
|
126
113
|
def polaris_autocomplete(method, **options, &block)
|
127
|
-
options
|
114
|
+
apply_error_options(options, method)
|
115
|
+
|
116
|
+
render Polaris::AutocompleteComponent.new(form: self, attribute: method, name: method, **options), &block
|
117
|
+
end
|
118
|
+
|
119
|
+
private
|
120
|
+
|
121
|
+
def apply_error_options(options, method)
|
122
|
+
options[:error] ||= error_for(method) unless options.has_key?(:error)
|
123
|
+
|
128
124
|
if options[:error_hidden] && options[:error]
|
129
125
|
options[:error] = !!options[:error]
|
130
126
|
end
|
131
|
-
render Polaris::AutocompleteComponent.new(form: self, attribute: method, name: method, **options), &block
|
132
127
|
end
|
133
128
|
end
|
134
129
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polaris_view_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Gamble
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2025-05-
|
12
|
+
date: 2025-05-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|