beyond-rails 0.0.205 → 0.0.206
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/TimeInput.js +1 -0
- data/src/js/decorators/supportDom.js +24 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33ea08dc8bf98acf8465442ae93d6ed62dc980c078bbe5bf80feb75113ba0154
|
4
|
+
data.tar.gz: f75502fb24fba0b328661979431a0141a58b505fad9e4e640e6b1bc3167f9c89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d460950281c2df848623313dcaa112e12bf043f587f6dead55463e067a972b9caba3bb86c2e82527ee28c6e43436d6db5003e9fe6c91d85c8c2c654c2a9dca7
|
7
|
+
data.tar.gz: b5c04888cd17d6ccc9ff02e06bc087f62c0cfcd5d746df450de6483cf0d502641788d1a6b45125e95d452d04735b00417325a39ac0dc75e000307a02e570e08d
|
@@ -1,11 +1,20 @@
|
|
1
1
|
import { isFunction } from '../utils'
|
2
|
+
import isUndef from '../utils/isUndef'
|
2
3
|
import createdComponents from '../consts/createdComponents'
|
3
4
|
|
5
|
+
const domMap = new Map()
|
6
|
+
|
4
7
|
export default function supportDom(target) {
|
5
8
|
|
6
9
|
return class extends target {
|
7
10
|
|
8
11
|
init() {
|
12
|
+
if (domMap.has(this.dom) && isUndef(this._skipDomChecking)) {
|
13
|
+
console.warn('This dom has already been initialized.', this.dom)
|
14
|
+
return
|
15
|
+
}
|
16
|
+
this.setDomToMap()
|
17
|
+
|
9
18
|
this._listeners = []
|
10
19
|
this._externalListeners = []
|
11
20
|
if (isFunction(super.init)) {
|
@@ -14,6 +23,20 @@ export default function supportDom(target) {
|
|
14
23
|
createdComponents.push(this)
|
15
24
|
}
|
16
25
|
|
26
|
+
setDomToMap() {
|
27
|
+
const { dom } = this
|
28
|
+
if (dom) {
|
29
|
+
domMap.set(dom, true)
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
33
|
+
deleteDomFromMap() {
|
34
|
+
const { dom } = this
|
35
|
+
if (dom) {
|
36
|
+
domMap.delete(dom)
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
17
40
|
on(name, func) {
|
18
41
|
this._externalListeners.push({ name, func })
|
19
42
|
}
|
@@ -36,6 +59,7 @@ export default function supportDom(target) {
|
|
36
59
|
}
|
37
60
|
|
38
61
|
destroy() {
|
62
|
+
this.deleteDomFromMap()
|
39
63
|
this._externalListeners.length = 0
|
40
64
|
this.removeEvents()
|
41
65
|
if (isFunction(super.destroy)) {
|