beyond-rails 0.0.234 → 0.0.235
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 +4 -4
- data/src/js/components/TagInput.js +15 -10
- 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: e972bbd922678dfc2e96398e28bf7c0ca244e43888bc725b3ded68ca31eba1bc
|
4
|
+
data.tar.gz: 385681f6de17231ca6761d7a1432f005fd8b0a44fa1384e45e67864455004ac1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8b93b49eb4839c608d2d36b2b77b1b8e178b46a8af15d250a6d9aa6cae50dc35e900e42a7fb010bb4ed118d9a84b6f2b5604caceb3495ada627766b568bdc5f
|
7
|
+
data.tar.gz: e3771b1aff459ea89efe73b6dd7b62a4b6d3e8e7630f406b683f7b0d4e7e4c927bdcf18d19682d806875add00a0b9bfe0443dbace28874eff8f9459e330002d7
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import raf from '../utils/raf'
|
2
|
-
import supportDom from '../decorators/supportDom'
|
3
1
|
import getKey from '../utils/getKey'
|
4
2
|
import noop from '../utils/noop'
|
3
|
+
import raf from '../utils/raf'
|
4
|
+
import supportDom from '../decorators/supportDom'
|
5
5
|
|
6
6
|
@supportDom
|
7
7
|
export default class TagInput {
|
@@ -74,13 +74,7 @@ export default class TagInput {
|
|
74
74
|
}, 500)
|
75
75
|
}
|
76
76
|
|
77
|
-
|
78
|
-
const { input, suggestInput, inputDiv } = this
|
79
|
-
const inputValue = suggestInput.value || input.value
|
80
|
-
const res = await this.validate(inputValue)
|
81
|
-
if (! res.isTag) {
|
82
|
-
return this.shake()
|
83
|
-
}
|
77
|
+
addTag(inputValue, res) {
|
84
78
|
const classname = res.classname ? ` ${res.classname}` : ''
|
85
79
|
const tag = document.createElement('div')
|
86
80
|
|
@@ -102,7 +96,18 @@ export default class TagInput {
|
|
102
96
|
tag.appendChild(btn)
|
103
97
|
|
104
98
|
this.tags.push({ elem: tag, remove: handleBtnClick, res })
|
105
|
-
this.dom.insertBefore(tag, inputDiv)
|
99
|
+
this.dom.insertBefore(tag, this.inputDiv)
|
100
|
+
}
|
101
|
+
|
102
|
+
async addTagIfNeeded() {
|
103
|
+
const { input, suggestInput } = this
|
104
|
+
const inputValue = suggestInput.value || input.value
|
105
|
+
const res = await this.validate(inputValue)
|
106
|
+
if (! res.isTag) {
|
107
|
+
return this.shake()
|
108
|
+
}
|
109
|
+
this.addTag(inputValue, res)
|
110
|
+
|
106
111
|
input.value = ''
|
107
112
|
suggestInput.value = ''
|
108
113
|
|
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.235
|
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-
|
12
|
+
date: 2020-11-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sassc
|