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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 66767efb242ab578214d8635453980ed11de8f8b7a726e44bd3637c5fb258b20
4
- data.tar.gz: a87bb51ac683959f961452da0bb269903277681ea398639f7799ec03a447db8f
3
+ metadata.gz: dc8e595696f351d27825c440fc48825dc0360b4a0aeeb23d8ff88f51d70e7794
4
+ data.tar.gz: f65dc6990f6962438dc867f2eb6f29f50658f8ac474b52cb13765621ffbf358a
5
5
  SHA512:
6
- metadata.gz: '08ecb52a279b63b7563b609d1e85dc0239de376005e9fe0339dd4d766916e930ffea6e3c8295400f54d07672f15e7a2cd632e499c820239a2296d02cab0c7e05'
7
- data.tar.gz: 8212aa99a1ff83d5af31a9ac7ae1478d47e30b65341fa84e26aa0993a79a8388ac4d2005c87b4d9142b802b7118e66eb3935d2256329309ee725756c5f1bd7b4
6
+ metadata.gz: d5b3863f1fd9a07e8ccc2c086c5ca2292e9c40a2e40fbd860935dbff10378f3421d7294be5557c894affae7a5f665a63b1bf4a11de0dfc5549174b9947a58a08
7
+ data.tar.gz: f5319191d5a32812c4a18ecd28e1bce0d56fa1f16c69f72c7db633d805d1a61edc6fad8b589658f61e8bd604882704ec1e6d589e6ea9faf11ceadf0469f11ddc
@@ -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)) {
@@ -0,0 +1,5 @@
1
+ export default function domEval(code) {
2
+ const script = document.createElement('script')
3
+ script.text = code
4
+ document.head.appendChild(script).parentNode.removeChild(script)
5
+ }
@@ -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.212
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-25 00:00:00.000000000 Z
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