beyond-rails 0.0.212 → 0.0.217
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/Modal.js +10 -0
- data/src/js/decorators/supportDom.js +0 -24
- data/src/js/utils/domEval.js +5 -0
- data/src/sass/components/_form.scss +8 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc8e595696f351d27825c440fc48825dc0360b4a0aeeb23d8ff88f51d70e7794
|
4
|
+
data.tar.gz: f65dc6990f6962438dc867f2eb6f29f50658f8ac474b52cb13765621ffbf358a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5b3863f1fd9a07e8ccc2c086c5ca2292e9c40a2e40fbd860935dbff10378f3421d7294be5557c894affae7a5f665a63b1bf4a11de0dfc5549174b9947a58a08
|
7
|
+
data.tar.gz: f5319191d5a32812c4a18ecd28e1bce0d56fa1f16c69f72c7db633d805d1a61edc6fad8b589658f61e8bd604882704ec1e6d589e6ea9faf11ceadf0469f11ddc
|
data/src/js/components/Modal.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import supportDom from '../decorators/supportDom'
|
2
2
|
import { noop } from '../utils'
|
3
|
+
import domEval from '../utils/domEval'
|
3
4
|
|
4
5
|
let globalModalId = 0
|
5
6
|
|
@@ -56,6 +57,9 @@ export default class Modal {
|
|
56
57
|
this.modal.style.display = 'block'
|
57
58
|
setTimeout(() => {
|
58
59
|
this.modal.classList.add('js-active')
|
60
|
+
if (typeof $ === 'function') {
|
61
|
+
$(this.dom).trigger('beyond.modal.show')
|
62
|
+
}
|
59
63
|
}, 50)
|
60
64
|
}
|
61
65
|
|
@@ -64,6 +68,9 @@ export default class Modal {
|
|
64
68
|
this.modal.classList.remove('js-active')
|
65
69
|
setTimeout(() => {
|
66
70
|
this.modal.style.display = 'none'
|
71
|
+
if (typeof $ === 'function') {
|
72
|
+
$(this.dom).trigger('beyond.modal.hide')
|
73
|
+
}
|
67
74
|
}, 300)
|
68
75
|
}
|
69
76
|
|
@@ -87,6 +94,9 @@ export default class Modal {
|
|
87
94
|
this.dom = dom
|
88
95
|
this.dom._modal = this
|
89
96
|
this.init()
|
97
|
+
|
98
|
+
Array.from(dom.querySelectorAll('script'))
|
99
|
+
.forEach(script => domEval(script.text))
|
90
100
|
}
|
91
101
|
|
92
102
|
visible() {
|
@@ -1,20 +1,11 @@
|
|
1
1
|
import { isFunction } from '../utils'
|
2
|
-
import isUndef from '../utils/isUndef'
|
3
2
|
import createdComponents from '../consts/createdComponents'
|
4
3
|
|
5
|
-
const domMap = new Map()
|
6
|
-
|
7
4
|
export default function supportDom(target) {
|
8
5
|
|
9
6
|
return class extends target {
|
10
7
|
|
11
8
|
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
|
-
|
18
9
|
this._listeners = []
|
19
10
|
this._externalListeners = []
|
20
11
|
if (isFunction(super.init)) {
|
@@ -23,20 +14,6 @@ export default function supportDom(target) {
|
|
23
14
|
createdComponents.push(this)
|
24
15
|
}
|
25
16
|
|
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
|
-
|
40
17
|
on(name, func) {
|
41
18
|
this._externalListeners.push({ name, func })
|
42
19
|
}
|
@@ -59,7 +36,6 @@ export default function supportDom(target) {
|
|
59
36
|
}
|
60
37
|
|
61
38
|
destroy() {
|
62
|
-
this.deleteDomFromMap()
|
63
39
|
this._externalListeners.length = 0
|
64
40
|
this.removeEvents()
|
65
41
|
if (isFunction(super.destroy)) {
|
@@ -368,7 +368,15 @@ input[type="file"] {
|
|
368
368
|
.input-group-prepend {
|
369
369
|
margin-right: -1px;
|
370
370
|
}
|
371
|
+
.input-group-append {
|
372
|
+
margin-left: -1px;
|
373
|
+
}
|
371
374
|
|
375
|
+
.input-group > .form-control:not(:last-child) {
|
376
|
+
border-top-right-radius: 0;
|
377
|
+
border-bottom-right-radius: 0;
|
378
|
+
z-index: 1;
|
379
|
+
}
|
372
380
|
.input-group > .form-control:not(:first-child) {
|
373
381
|
border-top-left-radius: 0;
|
374
382
|
border-bottom-left-radius: 0;
|
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.217
|
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-09-
|
12
|
+
date: 2020-09-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sassc
|
@@ -173,6 +173,7 @@ files:
|
|
173
173
|
- src/js/utils/dateGt.js
|
174
174
|
- src/js/utils/dateLt.js
|
175
175
|
- src/js/utils/docReady.js
|
176
|
+
- src/js/utils/domEval.js
|
176
177
|
- src/js/utils/getFloatedTargetPos.js
|
177
178
|
- src/js/utils/getKey.js
|
178
179
|
- src/js/utils/index.js
|