beyond-rails 0.0.194 → 0.0.195
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/src/js/components/DateMenu.js +24 -5
- data/src/js/index.js +2 -0
- data/src/sass/components/_date-menu.scss +3 -0
- 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: 789ec155be6f8c0964f3eeb815206dd41071ce22a9c51ee90b855b51ef53f1d7
|
4
|
+
data.tar.gz: f2529da5850fddc43bd4a4ceb8a3b27e6497e9e6e408cc881725edcd9613448a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b7ac625f3d7e9a6ee4308c624f1540ca79cd0610db86dc37e7dd8ce4e574d57c3718d22ab97a3406679cff17dd3dac023c4ea9e843d51bac0a725debdae21a6
|
7
|
+
data.tar.gz: bda148369234a2e81bfc04e91be587ece36dd9f92308a677a36d420563207312dd53fa20d4b310dd7a8434a95da74a775e7fd4a095508f34dc62dc646537427f
|
@@ -60,7 +60,8 @@ export default class DateMenu {
|
|
60
60
|
}
|
61
61
|
|
62
62
|
useSingleMenu() {
|
63
|
-
|
63
|
+
const { useSingleMenu, isStatic } = this.options
|
64
|
+
return isTouchDevice() || isStatic || useSingleMenu
|
64
65
|
}
|
65
66
|
|
66
67
|
setHoveredCell(data) {
|
@@ -204,7 +205,8 @@ export default class DateMenu {
|
|
204
205
|
|
205
206
|
addMenu() {
|
206
207
|
const dom = document.createElement('div')
|
207
|
-
|
208
|
+
const className = this.options.isStatic ? 'date-menu static' : 'date-menu'
|
209
|
+
dom.className = className
|
208
210
|
|
209
211
|
if (this.useSingleMenu()) {
|
210
212
|
dom.innerHTML = `
|
@@ -257,7 +259,15 @@ export default class DateMenu {
|
|
257
259
|
this.btnPrev = dom.querySelector('[data-btn-prev]')
|
258
260
|
this.btnNext = dom.querySelector('[data-btn-next]')
|
259
261
|
}
|
260
|
-
|
262
|
+
|
263
|
+
const container = this.options.dom
|
264
|
+
|
265
|
+
if (container) {
|
266
|
+
container.appendChild(dom)
|
267
|
+
}
|
268
|
+
else {
|
269
|
+
document.body.appendChild(dom)
|
270
|
+
}
|
261
271
|
this.dom = dom
|
262
272
|
}
|
263
273
|
|
@@ -350,8 +360,17 @@ export default class DateMenu {
|
|
350
360
|
show(src) {
|
351
361
|
const { dom } = this
|
352
362
|
dom.style.opacity = 0
|
353
|
-
|
354
|
-
this.
|
363
|
+
|
364
|
+
if (this.options.isStatic) {
|
365
|
+
dom.style.display = 'inline-block'
|
366
|
+
}
|
367
|
+
else {
|
368
|
+
dom.style.display = 'block'
|
369
|
+
}
|
370
|
+
|
371
|
+
if (src) {
|
372
|
+
this.pos(src)
|
373
|
+
}
|
355
374
|
dom.style.opacity = 1
|
356
375
|
this.isVisible = true
|
357
376
|
}
|
data/src/js/index.js
CHANGED
@@ -9,6 +9,7 @@ import Autocomplete from './components/Autocomplete'
|
|
9
9
|
import BarChart from './components/BarChart'
|
10
10
|
import Btn from './components/Btn'
|
11
11
|
import Checkbox from './components/Checkbox'
|
12
|
+
import DateMenu from './components/DateMenu'
|
12
13
|
import DateTimeRanger from './components/DateTimeRanger'
|
13
14
|
import Datepicker from './components/Datepicker'
|
14
15
|
import Dropdown from './components/Dropdown'
|
@@ -33,6 +34,7 @@ export {
|
|
33
34
|
BarChart,
|
34
35
|
Btn,
|
35
36
|
Checkbox,
|
37
|
+
DateMenu,
|
36
38
|
DateTimeRanger,
|
37
39
|
Datepicker,
|
38
40
|
Dropdown,
|
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.195
|
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-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sassc
|