beyond-rails 1.0.11 → 1.0.14

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/src/js/components/TagInput.js +10 -1
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 68fa26f3bfec394192a65a892260d63df967fa5888dea1f3e1aade82da23eaa6
4
- data.tar.gz: dd63392d9c253ecc24e0ef487c2437fc750e6c7bab3c19d768699959d3ed2a77
3
+ metadata.gz: c6abfc6e8b2e308528106dd0b5bbfb7305ae23035a323fccac661bc1b7c2cf46
4
+ data.tar.gz: 49e5bf41e1b4f1a705c288b2fc9a13aa3708c900282a152d3eb77a7471c6aa3d
5
5
  SHA512:
6
- metadata.gz: 18ff7d5eb8318c42899ada11c4de21d6a4e0d852c08f406eaa3f9404a28c5564d2b75133160e034bf26f273f9523cdc621af9aef58ac9565939a6d78a435b77a
7
- data.tar.gz: 8613747e90ceef8434937aa57c938b17734a0e672e19e949b1092f20d2d04dbc23096563aae3ec8a205c8ff2238b280169bfd5f21dee8189a19bd6d7b2959d21
6
+ metadata.gz: 313c84010ef897b581aa15f48ebbb85964aa984ce4fdf1056ca06d4c3f879dfcbf87fc62c420551bc55aa157aced8b129346defeb6a139a109996e5a0e04757a
7
+ data.tar.gz: 3c57dff44afb302dd230ef5f5ae24a7ff15849059296438dd129ac9c718ebae05fb1aca46140e595de4e8ed539c20a18df77b9fcbcfcd58102d44abe8705030c
@@ -1,6 +1,7 @@
1
1
  import getKey from '../utils/getKey'
2
2
  import noop from '../utils/noop'
3
3
  import raf from '../utils/raf'
4
+ import isDef from '../utils/isDef'
4
5
  import supportDom from '../decorators/supportDom'
5
6
 
6
7
  @supportDom
@@ -12,6 +13,7 @@ export default class TagInput {
12
13
  this.validate = options.validate || (() => ({ isTag: true }))
13
14
  this.suggest = options.suggest || noop
14
15
  this.change = options.change || noop
16
+ this.inputId = options.inputId
15
17
  this.isComposing = false
16
18
  this.raf = raf
17
19
  this.id = 0
@@ -25,7 +27,7 @@ export default class TagInput {
25
27
  }
26
28
 
27
29
  setup() {
28
- const { defaultInputWidth } = this
30
+ const { defaultInputWidth, inputId } = this
29
31
  const inputDiv = document.createElement('div')
30
32
  inputDiv.className = 'tag-input-box'
31
33
 
@@ -35,6 +37,9 @@ export default class TagInput {
35
37
  suggestInput.className = 'tag-suggest-input'
36
38
 
37
39
  const input = document.createElement('input')
40
+ if (inputId) {
41
+ input.id = inputId
42
+ }
38
43
  input.type = 'text'
39
44
  input.style.width = defaultInputWidth + 'px'
40
45
  input.className = 'tag-main-input'
@@ -181,6 +186,10 @@ export default class TagInput {
181
186
  input.value = ''
182
187
  suggestInput.value = ''
183
188
 
189
+ if (isDef(res.text)) {
190
+ this.addTag(res, 'input')
191
+ return
192
+ }
184
193
  const row = Object.assign({}, res, { text: inputValue })
185
194
  this.addTag(row, 'input')
186
195
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beyond-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.11
4
+ version: 1.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - kmsheng
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-03-04 00:00:00.000000000 Z
12
+ date: 2022-04-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sassc