beyond-rails 0.0.199 → 0.0.204

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: cbb0db0d80e57e8bb4a91b58d77eeb12a06b694f5856f63da43da7cdd732f295
4
- data.tar.gz: 5aafc18db515eebfc63d8e79e13b8c0b5439bedb911f4468ef56cc8a511427a3
3
+ metadata.gz: fa60c67c216eccde72ced6069a3c049eb676961c057094a376b2085129514877
4
+ data.tar.gz: 1729e12c2cbd9b463b949ac3a11889feee14b029efe36035db53545c8c4dce9b
5
5
  SHA512:
6
- metadata.gz: 28fde13d8065e18ac84947ab68e6a34c8d41a6d9aa745d378a757033d335369e2ee5fae0e940db4d359c441f220c199b5b1cded5f7fa65b0da6286476fdfc63a
7
- data.tar.gz: 648d773be42c9f6243390d80aa53d26bbd46c297e7cb035c32ae98e76d4df514ce1c75fcd53a15ca898203cb2624187b5f9e3d4c1dad091c928552100bb7bdbc
6
+ metadata.gz: 23eb9462146fb4c46fe9500ff82dd8748da742922935641df7d83d3ac9e3a8ca4acc1550952aeb46139ea21c3aac760427c80f0f3c1b3b9cf434331713865b20
7
+ data.tar.gz: d59fb4b482bfe3045005cec6126279b2aa96437ebc9a69c3297dd3d3a1aae7d388ec166b8db26052921b9cb41bf96cb76e2b589adeaf3c428278290b88109517
@@ -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
  }
@@ -67,7 +67,7 @@
67
67
  cursor: not-allowed;
68
68
  }
69
69
  .icon {
70
- margin-right: .7em;
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 {
@@ -220,7 +220,7 @@ label {
220
220
  font-size: 80%;
221
221
  margin-top: .35rem;
222
222
  &:before {
223
- font-family: 'icomoon';
223
+ font-family: $beyond-icon-font-name;
224
224
  display: inline-block;
225
225
  }
226
226
  }
@@ -14,6 +14,7 @@
14
14
  -webkit-overflow-scrolling: touch;
15
15
  }
16
16
  .search-dropdown-menu-item {
17
+ display: flex;
17
18
  border: 3px solid transparent;
18
19
  &.selected {
19
20
  border: 3px solid $bg-outline;
@@ -23,6 +24,10 @@
23
24
  padding: 7px 11px;
24
25
  strong {
25
26
  color: #6772e5;
27
+ margin-right: .7em;
28
+ }
29
+ > span {
30
+ max-width: 420px;
26
31
  }
27
32
  }
28
33
  }
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.199
4
+ version: 0.0.204
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-21 00:00:00.000000000 Z
12
+ date: 2020-09-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sassc