beyond-rails 0.0.261 → 0.0.262

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: b12342b2961fe3455aa91cb6da5b19c7f6d68dd2c5f9559e7ba6f1be32710711
4
- data.tar.gz: '085f490c627a182572e411666a67f4a29e9bb0ff3fb869b42095cb7348bd4f9f'
3
+ metadata.gz: 1bd75f8f763821f105483e4945e1edb8236a972a55573ca1009e1d5fa0a3ae34
4
+ data.tar.gz: db80bcb3ff53b3fb8afe1b23c9de8958e7c0bb94fded145b655f7789cbba5fb2
5
5
  SHA512:
6
- metadata.gz: c069481c3a41f361b5cf291782ea0321098a2ea63218a05359ea085ebf7d501dd6c127231d0531ce5535f3ab9dc160bc3511318de4e788b6ae885f4f4fc91782
7
- data.tar.gz: 19b8018a6b008501250fc50132c9a5f4b83feb83d1f633e9bf75e3be5946f76cc59f94e3f08f37c79894a23116fe1912493bd715a5188eac1549f0e002ffb002
6
+ metadata.gz: 9f004f1c829cd3ba8b6f78b99840cc5ad684840d0e2b101103c864cc11fb7687f7b778bd897ad4109007cff292ad772fb7bdcdf20b2d8cedcfceef736188660d
7
+ data.tar.gz: a7bef7f76f4a6f535b3f4dd532bdeaf586452a2a319336a8cf4865a503fc4a1f002da2d34c8f5ef388c39021061b6e4a761243894d980b46d34e2a2187316f9d
@@ -12,6 +12,7 @@ export default class TagInput {
12
12
  this.validate = options.validate || (() => ({ isTag: true }))
13
13
  this.suggest = options.suggest || noop
14
14
  this.change = options.change || noop
15
+ this.remove = options.remove || noop
15
16
  this.isComposing = false
16
17
  this.raf = raf
17
18
  this.id = 0
@@ -109,6 +110,9 @@ export default class TagInput {
109
110
 
110
111
  getTag(inputValue, options = {}) {
111
112
 
113
+ this.id += 1
114
+
115
+ const id = this.id
112
116
  const classname = options.classname ? ` ${options.classname}` : ''
113
117
  const tag = document.createElement('div')
114
118
 
@@ -124,13 +128,13 @@ export default class TagInput {
124
128
  this.tags = this.tags.filter(row => row.elem !== tag)
125
129
  btn.removeEventListener('click', handleBtnClick)
126
130
  tag.remove()
131
+ this.remove(id)
127
132
  this.change(this.tags.slice())
128
133
  }
129
134
  btn.addEventListener('click', handleBtnClick)
130
135
  tag.appendChild(btn)
131
- this.id += 1
132
136
 
133
- return { id: this.id, elem: tag, remove: handleBtnClick, options }
137
+ return { id, elem: tag, remove: handleBtnClick, options }
134
138
  }
135
139
 
136
140
  setTags(rows) {
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: 0.0.261
4
+ version: 0.0.262
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: 2020-11-30 00:00:00.000000000 Z
12
+ date: 2020-12-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sassc