beyond-rails 0.0.198 → 0.0.203
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/Dropdown.js +9 -0
- data/src/js/decorators/supportDom.js +24 -0
- data/src/sass/_main.scss +3 -3
- data/src/sass/components/_btn.scss +4 -1
- data/src/sass/components/_form.scss +1 -1
- 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: 1557e4122feedf316b6b9d3963f9467f834283229005e62f955cd4bb2b12d339
|
4
|
+
data.tar.gz: c67ea2ae6c26b37bbb97f5acf4286241c3267d7e03331edee4459f23684a8531
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da39afee87b75d9a43d8c1ad4c52ea7a16310354a93f7e90f02faad92fce0665cc8777d8f98da3d9166bb5e763cb21a3b4e70626acde486c4645cdfa1fd8b252
|
7
|
+
data.tar.gz: 73fc6222597d8ea5e21b5932199a28695c6c387bfd06ee629ee59caee39ec2e768d057154bbb35084cdbf62fd6009d105222d9d288929f2815ba70b2b65c9f36
|
@@ -34,8 +34,17 @@ export default class Dropdown {
|
|
34
34
|
}
|
35
35
|
|
36
36
|
init() {
|
37
|
+
|
38
|
+
if (! this.dom) {
|
39
|
+
throw new Error('dom is missing in Dropdown class')
|
40
|
+
}
|
41
|
+
|
37
42
|
this.id = this.dom.dataset.target
|
38
43
|
this.menu = document.querySelector(`[data-dropdown-menu="${this.id}"]`)
|
44
|
+
|
45
|
+
if (! this.menu) {
|
46
|
+
throw new Error(`menu ${this.id} is missing in Dropdown class`)
|
47
|
+
}
|
39
48
|
this.place = this.menu.dataset.place || 'bottom'
|
40
49
|
this.align = this.menu.dataset.align
|
41
50
|
this.menu.remove()
|
@@ -6,6 +6,10 @@ export default function supportDom(target) {
|
|
6
6
|
return class extends target {
|
7
7
|
|
8
8
|
init() {
|
9
|
+
if (this.beyondBound) {
|
10
|
+
return
|
11
|
+
}
|
12
|
+
this.markBound()
|
9
13
|
this._listeners = []
|
10
14
|
this._externalListeners = []
|
11
15
|
if (isFunction(super.init)) {
|
@@ -14,6 +18,25 @@ export default function supportDom(target) {
|
|
14
18
|
createdComponents.push(this)
|
15
19
|
}
|
16
20
|
|
21
|
+
get beyondBound() {
|
22
|
+
const { dom } = this
|
23
|
+
return dom && (dom.dataset.beyondBound === 'true')
|
24
|
+
}
|
25
|
+
|
26
|
+
markBound() {
|
27
|
+
const { dom } = this
|
28
|
+
if (dom) {
|
29
|
+
dom.dataset.beyondBound = true
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
33
|
+
markUnbind() {
|
34
|
+
const { dom } = this
|
35
|
+
if (dom) {
|
36
|
+
delete dom.dataset.beyondBound
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
17
40
|
on(name, func) {
|
18
41
|
this._externalListeners.push({ name, func })
|
19
42
|
}
|
@@ -38,6 +61,7 @@ export default function supportDom(target) {
|
|
38
61
|
destroy() {
|
39
62
|
this._externalListeners.length = 0
|
40
63
|
this.removeEvents()
|
64
|
+
this.markUnbind()
|
41
65
|
if (isFunction(super.destroy)) {
|
42
66
|
super.destroy()
|
43
67
|
}
|
data/src/sass/_main.scss
CHANGED
@@ -122,13 +122,13 @@ $color-active: #5469d4;
|
|
122
122
|
}
|
123
123
|
|
124
124
|
.align-left {
|
125
|
-
text-align: left;
|
125
|
+
text-align: left !important;
|
126
126
|
}
|
127
127
|
.align-right {
|
128
|
-
text-align: right;
|
128
|
+
text-align: right !important;
|
129
129
|
}
|
130
130
|
.align-center {
|
131
|
-
text-align: center;
|
131
|
+
text-align: center !important;
|
132
132
|
}
|
133
133
|
|
134
134
|
.sr-only {
|
@@ -67,7 +67,7 @@
|
|
67
67
|
cursor: not-allowed;
|
68
68
|
}
|
69
69
|
.icon {
|
70
|
-
margin-right: .
|
70
|
+
margin-right: .4em;
|
71
71
|
}
|
72
72
|
}
|
73
73
|
.btn-loader {
|
@@ -113,6 +113,9 @@
|
|
113
113
|
&:focus {
|
114
114
|
@include focus-outline;
|
115
115
|
}
|
116
|
+
&.active {
|
117
|
+
background-color: #f3f3f7;
|
118
|
+
}
|
116
119
|
}
|
117
120
|
|
118
121
|
.btn .badge {
|
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.203
|
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-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sassc
|