beyond-rails 0.0.257 → 0.0.262

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 878355b9e7a2f59f8ab506c681088d7eae160f0f73440a4352a64da64e44f484
4
- data.tar.gz: effed2b5389dc1e2859f99f86dc900ced79aa347cc0db2c9e126d0313dba5a6e
3
+ metadata.gz: 1bd75f8f763821f105483e4945e1edb8236a972a55573ca1009e1d5fa0a3ae34
4
+ data.tar.gz: db80bcb3ff53b3fb8afe1b23c9de8958e7c0bb94fded145b655f7789cbba5fb2
5
5
  SHA512:
6
- metadata.gz: ea0dc3ec729df8ac0bca7d89828dd89fd932da5d809376503eb59f115c8113f89d165e22aa38c71bbcbf97c36bcbb3f088a38c3fee1d77eea9090ae68964875f
7
- data.tar.gz: f48ff5af5ca71be4b4a2409581514142bcaadb0fb8135f54c8080f9f0cd66041dcace5e33ce181980369d29be35570279b53e59e0dbf171c5e1cde3b5cb40501
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) {
@@ -140,6 +144,7 @@ export default class TagInput {
140
144
  dom.insertBefore(tag.elem, inputDiv)
141
145
  })
142
146
  this.tags = tags
147
+ this.change(this.tags.slice())
143
148
  }
144
149
 
145
150
  addTag(inputValue, options = {}) {
@@ -190,8 +195,11 @@ export default class TagInput {
190
195
  let lastValue = ''
191
196
 
192
197
  this.addEvent(input, 'keydown', async event => {
198
+
193
199
  const key = getKey(event)
194
200
  if ((key === 'enter') && (! this.isComposing)) {
201
+ event.preventDefault()
202
+ event.stopPropagation()
195
203
  await this.addTagIfNeeded()
196
204
  }
197
205
  else if ((key === 'backspace') && (lastValue === '')) {
@@ -170,3 +170,7 @@ input[type=file], /* FF, IE7+, chrome (except button) */
170
170
  input[type=file]::-webkit-file-upload-button { /* chromes and blink button */
171
171
  cursor: pointer;
172
172
  }
173
+
174
+ .nowrap {
175
+ white-space: nowrap !important;
176
+ }
@@ -33,19 +33,19 @@ h6 {
33
33
  }
34
34
 
35
35
  .txt-primary {
36
- color: $txt-color-primary;
36
+ color: $txt-color-primary !important;
37
37
  }
38
38
  .txt-secondary {
39
- color: $txt-color-secondary;
39
+ color: $txt-color-secondary !important;
40
40
  }
41
41
  .txt-success {
42
- color: $txt-color-success;
42
+ color: $txt-color-success !important;
43
43
  }
44
44
  .txt-warn {
45
- color: $txt-color-warn;
45
+ color: $txt-color-warn !important;
46
46
  }
47
47
  .txt-danger {
48
- color: $txt-color-danger;
48
+ color: $txt-color-danger !important;
49
49
  }
50
50
 
51
51
  .txt-white {
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.257
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-25 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