beyond-rails 0.0.204 → 0.0.210

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fa60c67c216eccde72ced6069a3c049eb676961c057094a376b2085129514877
4
- data.tar.gz: 1729e12c2cbd9b463b949ac3a11889feee14b029efe36035db53545c8c4dce9b
3
+ metadata.gz: ec514dd926ca28093516f6a80efb90be67b6f0f4ff68d4f887499e2edcecf994
4
+ data.tar.gz: 760f05e94459b3d3ab0144beea55152c9cea9da5322683893f2199b28bdff3dc
5
5
  SHA512:
6
- metadata.gz: 23eb9462146fb4c46fe9500ff82dd8748da742922935641df7d83d3ac9e3a8ca4acc1550952aeb46139ea21c3aac760427c80f0f3c1b3b9cf434331713865b20
7
- data.tar.gz: d59fb4b482bfe3045005cec6126279b2aa96437ebc9a69c3297dd3d3a1aae7d388ec166b8db26052921b9cb41bf96cb76e2b589adeaf3c428278290b88109517
6
+ metadata.gz: be536b16af09e0b1e4651d1b52ca571e0fa653d8b34b9b3d2408a47a26f94a594ac2328142729fd5cb0e707e24d092bd58072048435f7f23e5078c72b5163756
7
+ data.tar.gz: fc650a64605dd22e174d6b8ce396aa6e6087c43016126a39c9da62bc1b67f634db22558dfeec5038e6e13088c250dfa6b1aa0da7686562aa754b157b2c9d35bc
@@ -14,6 +14,7 @@ export default class TimeInput {
14
14
  this.options = options
15
15
  this.tz = options.tz || DEFAULT_TIMEZONE
16
16
  this.timePattern = options.timePattern || 'HH:mm'
17
+ this._skipDomChecking = true
17
18
 
18
19
  this.init()
19
20
  }
@@ -1,15 +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() {
9
- if (this.beyondBound) {
12
+ if (domMap.has(this.dom) && isUndef(this._skipDomChecking)) {
13
+ console.warn('This dom has already been initialized.', this.dom)
10
14
  return
11
15
  }
12
- this.markBound()
16
+ this.setDomToMap()
17
+
13
18
  this._listeners = []
14
19
  this._externalListeners = []
15
20
  if (isFunction(super.init)) {
@@ -18,22 +23,17 @@ export default function supportDom(target) {
18
23
  createdComponents.push(this)
19
24
  }
20
25
 
21
- get beyondBound() {
22
- const { dom } = this
23
- return dom && (dom.dataset.beyondBound === 'true')
24
- }
25
-
26
- markBound() {
26
+ setDomToMap() {
27
27
  const { dom } = this
28
28
  if (dom) {
29
- dom.dataset.beyondBound = true
29
+ domMap.set(dom, true)
30
30
  }
31
31
  }
32
32
 
33
- markUnbind() {
33
+ deleteDomFromMap() {
34
34
  const { dom } = this
35
35
  if (dom) {
36
- delete dom.dataset.beyondBound
36
+ domMap.delete(dom)
37
37
  }
38
38
  }
39
39
 
@@ -59,9 +59,9 @@ export default function supportDom(target) {
59
59
  }
60
60
 
61
61
  destroy() {
62
+ this.deleteDomFromMap()
62
63
  this._externalListeners.length = 0
63
64
  this.removeEvents()
64
- this.markUnbind()
65
65
  if (isFunction(super.destroy)) {
66
66
  super.destroy()
67
67
  }
@@ -2,10 +2,8 @@
2
2
  [class^="icon-"] {
3
3
  font-size: 11px;
4
4
  color: #4f566b;
5
- margin-left: 4px;
5
+ margin-left: .7em;
6
6
  display: inline-block;
7
- vertical-align: middle;
8
- transform: translateY(-1px);
9
7
  }
10
8
  [class^="icon-"].no-text {
11
9
  margin-left: 0;
@@ -75,6 +75,17 @@ fieldset {
75
75
  }
76
76
  }
77
77
 
78
+ label.required {
79
+ &:after {
80
+ display: inline-block;
81
+ margin-left: 4px;
82
+ content: '*';
83
+ color: #6772e5;
84
+ font-size: 16px;
85
+ transform: translateY(-2px);
86
+ }
87
+ }
88
+
78
89
  .form-inline {
79
90
  display: flex;
80
91
  align-items: center;
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.204
4
+ version: 0.0.210
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-22 00:00:00.000000000 Z
12
+ date: 2020-09-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sassc