beyond-rails 0.0.254 → 0.0.259
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/src/js/components/LineChart.js +1 -0
- data/src/js/components/TagInput.js +15 -6
- data/src/sass/_main.scss +4 -0
- 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: e03fe184dcca8afa039c779b645835e3ab424f10e59719a18bfcf3ed2f8a1879
|
4
|
+
data.tar.gz: 405e4401b7199efcb2d60ff7f97c5a5944dfe728f7d13057b6a8a51dc618d09d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38c4fcc741eaaa7cfbee14504022533b83a0ec31bd9f53b4e8c3a0be101ce422b2fbfdb51fbf2e6630014636acad13a02ccfc6c5f7bd91243e5af286923e359f
|
7
|
+
data.tar.gz: 2557d50ab4980612f5e1c95dde716a82047c3f649a492be90340b8b873a4073489c1792191da9420f1763caa97f9a29be3388a2d24b25aecfe55d426a3568346
|
@@ -82,15 +82,23 @@ export default class TagInput {
|
|
82
82
|
}
|
83
83
|
const { elem } = tag
|
84
84
|
const { timeout } = options
|
85
|
-
|
85
|
+
|
86
|
+
if (this.timer) {
|
87
|
+
clearTimeout(this.timer)
|
88
|
+
this.timer = null
|
89
|
+
}
|
90
|
+
else {
|
91
|
+
this.oldAttrs = rows.map(row => elem.getAttribute(row.name))
|
92
|
+
}
|
86
93
|
|
87
94
|
rows.forEach(row => {
|
88
95
|
elem.setAttribute(row.name, row.value)
|
89
96
|
})
|
90
97
|
|
91
98
|
if (timeout) {
|
92
|
-
setTimeout(() => {
|
99
|
+
this.timer = setTimeout(() => {
|
93
100
|
if (document.body.contains(elem)) {
|
101
|
+
const { oldAttrs } = this
|
94
102
|
rows.forEach((row, i) => {
|
95
103
|
elem.setAttribute(row.name, oldAttrs[i])
|
96
104
|
})
|
@@ -138,6 +146,7 @@ export default class TagInput {
|
|
138
146
|
const tag = this.getTag(inputValue, options)
|
139
147
|
this.tags.push(tag)
|
140
148
|
this.dom.insertBefore(tag.elem, this.inputDiv)
|
149
|
+
this.change(this.tags.slice())
|
141
150
|
}
|
142
151
|
|
143
152
|
async addTagIfNeeded() {
|
@@ -147,12 +156,9 @@ export default class TagInput {
|
|
147
156
|
if (! res.isTag) {
|
148
157
|
return this.shake()
|
149
158
|
}
|
150
|
-
this.addTag(inputValue, res)
|
151
|
-
|
152
159
|
input.value = ''
|
153
160
|
suggestInput.value = ''
|
154
|
-
|
155
|
-
this.change(this.tags.slice())
|
161
|
+
this.addTag(inputValue, res)
|
156
162
|
}
|
157
163
|
|
158
164
|
removeTagIfNeeded() {
|
@@ -184,8 +190,11 @@ export default class TagInput {
|
|
184
190
|
let lastValue = ''
|
185
191
|
|
186
192
|
this.addEvent(input, 'keydown', async event => {
|
193
|
+
|
187
194
|
const key = getKey(event)
|
188
195
|
if ((key === 'enter') && (! this.isComposing)) {
|
196
|
+
event.preventDefault()
|
197
|
+
event.stopPropagation()
|
189
198
|
await this.addTagIfNeeded()
|
190
199
|
}
|
191
200
|
else if ((key === 'backspace') && (lastValue === '')) {
|
data/src/sass/_main.scss
CHANGED
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.
|
4
|
+
version: 0.0.259
|
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-
|
12
|
+
date: 2020-11-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sassc
|