bard-tag_field 0.3.0 → 0.4.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: 6f2e7769c2bbc3f424922811fb57fe48207c029af24b926b543550bcbdc525b5
4
- data.tar.gz: 0f33799fff29c82c007553aa13df5f50ab4c96f271c689726d851e4e2d9b592e
3
+ metadata.gz: fbfde3758dcf03243548db95eb9901f43cbcccbe5eac3a2dc1d64ecee31aaa60
4
+ data.tar.gz: d7f453d7ad5f9ac62b3a41ae5d8304c8bb01d230059ad630641440b6949622a3
5
5
  SHA512:
6
- metadata.gz: ec37d61083dd7f262bf358ed179b2a53d51df0e82cd0606746c5da0f1b2e77ee89a62222f27777de24b4308ee3b4f6924799f1238bf68b0402692105070487bf
7
- data.tar.gz: c2856f864d7674102f7d679399959e19af91b96c44c933f24995332241ca2b70c0e84a426a5ecdcf593fd22aee374d8d40d802699c8f2b892a8871da84dd3863
6
+ metadata.gz: c30cc6a3b8d25fc4a3c9ca0a17c548ae13c785ac437ffbdae5bddfdd3e1f96d95fee9987e2096888cf561e1c9d64ab555124118d24fc35b50afea0e549295d8b
7
+ data.tar.gz: f521b1e6907f65230310c1a17890a07519da7756efc9ad3b6f2f1047c5d9ec2874b597e2aaf9dc066c6bb4a77104416694593935b096d1e788a67bd5c0675083
@@ -1015,7 +1015,7 @@ class TagOption extends HTMLElement {
1015
1015
  display: inline-flex;
1016
1016
  align-items: center;
1017
1017
  float: none;
1018
- font-size: 1.25em;
1018
+ font-size: 14px;
1019
1019
  line-height: 1;
1020
1020
  min-height: 32px;
1021
1021
  color: #fff;
@@ -1028,7 +1028,7 @@ class TagOption extends HTMLElement {
1028
1028
  z-index: 1;
1029
1029
  border: none;
1030
1030
  background: none;
1031
- font-size: 1.4em;
1031
+ font-size: 20px;
1032
1032
  display: inline-block;
1033
1033
  color: rgba(255, 255, 255, 0.6);
1034
1034
  right: 10px;
@@ -1147,10 +1147,25 @@ class InputTag extends HTMLElement {
1147
1147
  }
1148
1148
 
1149
1149
  get value() {
1150
- return this._internals.value;
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(values) {
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
 
@@ -1266,14 +1281,14 @@ class InputTag extends HTMLElement {
1266
1281
  }
1267
1282
  input {
1268
1283
  display: block;
1269
- height: 32px;
1284
+ height: 38px;
1270
1285
  float: none;
1271
1286
  margin: 0;
1272
1287
  padding-left: 10px !important;
1273
1288
  padding-right: 30px !important;
1274
1289
  width: auto !important;
1275
1290
  min-width: 70px;
1276
- font-size: 1.25em;
1291
+ font-size: 14px;
1277
1292
  width: 100%;
1278
1293
  line-height: 2;
1279
1294
  padding: 0 0 0 10px;
@@ -1286,11 +1301,11 @@ class InputTag extends HTMLElement {
1286
1301
  color: #333;
1287
1302
  }
1288
1303
  button {
1289
- width: 30px;
1304
+ width: 38px;
1290
1305
  text-align: center;
1291
- line-height: 30px;
1306
+ line-height: 36px;
1292
1307
  border: 1px solid #e0e0e0;
1293
- font-size: 2em;
1308
+ font-size: 20px;
1294
1309
  color: #666;
1295
1310
  position: absolute !important;
1296
1311
  z-index: 10;
@@ -1322,7 +1337,7 @@ class InputTag extends HTMLElement {
1322
1337
  flex-wrap: wrap;
1323
1338
  background: #fff;
1324
1339
  list-style: none;
1325
- font-size: 1.25em;
1340
+ font-size: 14px;
1326
1341
  min-width: 200px;
1327
1342
  }
1328
1343
  .ui-menu .ui-menu-item{
@@ -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|
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Bard
4
4
  module TagField
5
- VERSION = "0.3.0"
5
+ VERSION = "0.4.1"
6
6
  end
7
7
  end
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.3.0
4
+ version: 0.4.1
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-22 00:00:00.000000000 Z
11
+ date: 2025-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails