bard-tag_field 0.3.0 → 0.4.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 +4 -4
- data/app/assets/javascripts/input-tag.js +17 -2
- data/lib/bard/tag_field/cucumber.rb +12 -0
- data/lib/bard/tag_field/version.rb +1 -1
- 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: 2710ff20fb473cf6eef8319d72f88cf59b0f3c24cca66badbad936f644df368b
|
4
|
+
data.tar.gz: e16029c932fc9329796d05b587dd8a5697d59a99a0db9692f15c8b37bfaa04c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5694eb901dd9ce23e13b1685da503150c3adbf7fb102124b7c9c3f7114dfffaeb56e6f8d000606e96172f2ae21193a8d8eb47c7e2c1cb625f4579c38271321a3
|
7
|
+
data.tar.gz: b812a1d58f7280aca270133b0b6ff372b0d406c9122fd7b42a5ec17073104baf6a0242000cedc9075f5f8a9a9f29c24ff30f2f5dc060a0b20c17e2445a655099
|
@@ -1147,10 +1147,25 @@ class InputTag extends HTMLElement {
|
|
1147
1147
|
}
|
1148
1148
|
|
1149
1149
|
get value() {
|
1150
|
-
|
1150
|
+
const internalValue = this._internals.value;
|
1151
|
+
if (this.hasAttribute('multiple')) {
|
1152
|
+
return internalValue; // Return array for multiple mode
|
1153
|
+
} else {
|
1154
|
+
return internalValue.length > 0 ? internalValue[0] : ''; // Return string for single mode
|
1155
|
+
}
|
1151
1156
|
}
|
1152
1157
|
|
1153
|
-
set value(
|
1158
|
+
set value(input) {
|
1159
|
+
// Convert input to array format for internal storage
|
1160
|
+
let values;
|
1161
|
+
if (Array.isArray(input)) {
|
1162
|
+
values = input;
|
1163
|
+
} else if (typeof input === 'string') {
|
1164
|
+
values = input === '' ? [] : [input];
|
1165
|
+
} else {
|
1166
|
+
values = [];
|
1167
|
+
}
|
1168
|
+
|
1154
1169
|
const oldValues = this._internals.value;
|
1155
1170
|
this._internals.value = values;
|
1156
1171
|
|
@@ -14,6 +14,18 @@ class Chop::Form::TagField < Chop::Form::Field
|
|
14
14
|
def diff_value
|
15
15
|
get_value.join(", ")
|
16
16
|
end
|
17
|
+
|
18
|
+
def set_value
|
19
|
+
if field[:multiple]
|
20
|
+
value.to_s.split(", ").map(&:strip)
|
21
|
+
else
|
22
|
+
value.to_s.strip
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def fill_in!
|
27
|
+
session.execute_script("document.getElementById('#{field[:id]}').value = #{set_value.to_json}")
|
28
|
+
end
|
17
29
|
end
|
18
30
|
|
19
31
|
When "I fill in the {string} tag field with {string}" do |field, value|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bard-tag_field
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Micah Geisel
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-08-
|
11
|
+
date: 2025-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|