beyond-rails 0.0.172 → 0.0.173
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/AutocompleteMenu.js +1 -1
- data/src/js/components/Btn.js +1 -1
- data/src/js/components/DateMenu.js +5 -5
- data/src/js/components/Dropdown.js +1 -2
- data/src/js/components/SearchDropdown.js +1 -2
- data/src/js/components/TimeMenu.js +1 -2
- data/src/js/components/Tooltip.js +1 -1
- data/src/js/utils/index.js +2 -0
- metadata +1 -3
- data/src/js/utils/range.js +0 -7
- data/src/js/utils/toPixel.js +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0db9116ac128821f93d7e9db1a61ed9188dc8530c6898680c2f6801736f10060
|
4
|
+
data.tar.gz: 0e898067612eb1cae224e39199e1e480d6aa8d0ff63fe223b550229fb7c98c0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57fc84e18786cfbc35a6655c2d0138220149b2d201de0bbcbee44ca2aa45ccce3d749a6453adcb5213663c2fe7fb81b491930b4d8ae1a0f730dd68763d443fce
|
7
|
+
data.tar.gz: 9fd66c2560112cb1ff4628969f9e8d85ed3ce36c9ce8d6459521ba75e7a3632bf2bdbe147faaeaa77dd261d3743dd7979ad78f75c6df249dbb191fd7b685412a
|
data/src/js/components/Btn.js
CHANGED
@@ -1,6 +1,4 @@
|
|
1
1
|
import getFloatedTargetPos from '../utils/getFloatedTargetPos'
|
2
|
-
import range from '../utils/range'
|
3
|
-
import toPixel from '../utils/toPixel'
|
4
2
|
import isTouchDevice from '../utils/isTouchDevice'
|
5
3
|
import dateLt from '../utils/dateLt'
|
6
4
|
import dateEq from '../utils/dateEq'
|
@@ -15,10 +13,12 @@ import {
|
|
15
13
|
getMonth,
|
16
14
|
getYear,
|
17
15
|
throttle,
|
16
|
+
range,
|
18
17
|
set,
|
19
18
|
startOfDay,
|
20
19
|
startOfMonth,
|
21
20
|
subMonths,
|
21
|
+
toPixel,
|
22
22
|
format
|
23
23
|
} from '../utils'
|
24
24
|
import { DEFAULT_TIMEZONE, DEFAULT_LOCALE } from '../consts'
|
@@ -81,7 +81,7 @@ export default class DateMenu {
|
|
81
81
|
|
82
82
|
const firstWeekday = getDay(startOfMonth(date))
|
83
83
|
const beforeWeekday = ((firstWeekday - 1) === -1) ? 6 : (firstWeekday - 1)
|
84
|
-
const emptyHeadRows = range(1, beforeWeekday).map(toEmptyCell)
|
84
|
+
const emptyHeadRows = range(1, beforeWeekday + 1).map(toEmptyCell)
|
85
85
|
|
86
86
|
const initialStartDate = startOfDay(startDate)
|
87
87
|
const initialEndDate = startOfDay(endDate)
|
@@ -106,7 +106,7 @@ export default class DateMenu {
|
|
106
106
|
}
|
107
107
|
const today = formatDate(new Date())
|
108
108
|
|
109
|
-
const rows = range(1, daysInMonth).map(day => {
|
109
|
+
const rows = range(1, daysInMonth + 1).map(day => {
|
110
110
|
|
111
111
|
const d = addDays(firstDateOfMonth, day - 1)
|
112
112
|
const resCompareStart = compareAsc(startOfStartDate, d)
|
@@ -124,7 +124,7 @@ export default class DateMenu {
|
|
124
124
|
|
125
125
|
const lastWeekday = getDay(endOfMonth(date))
|
126
126
|
const emptyDays = ((7 - lastWeekday) % 7)
|
127
|
-
const emptyTailRows = range(1, emptyDays).map(toEmptyCell)
|
127
|
+
const emptyTailRows = range(1, emptyDays + 1).map(toEmptyCell)
|
128
128
|
|
129
129
|
return emptyHeadRows.concat(rows).concat(emptyTailRows)
|
130
130
|
}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import getFloatedTargetPos from '../utils/getFloatedTargetPos'
|
2
|
-
import toPixel from '../utils/toPixel'
|
3
2
|
import supportDom from '../utils/supportDom'
|
4
|
-
import { isFunction, throttle } from '../utils'
|
3
|
+
import { isFunction, toPixel, throttle } from '../utils'
|
5
4
|
|
6
5
|
@supportDom
|
7
6
|
export default class Dropdown {
|
@@ -1,8 +1,7 @@
|
|
1
1
|
import getFloatedTargetPos from '../utils/getFloatedTargetPos'
|
2
|
-
import toPixel from '../utils/toPixel'
|
3
2
|
import supportDom from '../utils/supportDom'
|
4
3
|
import getKey from '../utils/getKey'
|
5
|
-
import { debounce, noop, throttle } from '../utils'
|
4
|
+
import { debounce, noop, toPixel, throttle } from '../utils'
|
6
5
|
|
7
6
|
const renderMenu = row => {
|
8
7
|
return `<div class="search-dropdown-menu-item" data-item>${JSON.stringify(row)}</div>`
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import getFloatedTargetPos from '../utils/getFloatedTargetPos'
|
2
|
-
import toPixel from '../utils/toPixel'
|
3
2
|
import supportDom from '../utils/supportDom'
|
4
|
-
import { getHours, getMinutes, range } from '../utils'
|
3
|
+
import { getHours, getMinutes, range, toPixel } from '../utils'
|
5
4
|
|
6
5
|
@supportDom
|
7
6
|
export default class TimeMenu {
|
data/src/js/utils/index.js
CHANGED
@@ -4,6 +4,7 @@ import getDomPos from '@superlanding/getdompos'
|
|
4
4
|
import getScrollLeft from '@superlanding/getscrollleft'
|
5
5
|
import getScrollTop from '@superlanding/getscrolltop'
|
6
6
|
import timestampToDate from '@superlanding/timestamptodate'
|
7
|
+
import toPixel from '@superlanding/toPixel'
|
7
8
|
|
8
9
|
// date-fns
|
9
10
|
import addDays from 'date-fns/addDays'
|
@@ -40,6 +41,7 @@ export {
|
|
40
41
|
getScrollLeft,
|
41
42
|
getScrollTop,
|
42
43
|
timestampToDate,
|
44
|
+
toPixel,
|
43
45
|
|
44
46
|
// date-fns
|
45
47
|
addDays,
|
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.173
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kmsheng
|
@@ -152,9 +152,7 @@ files:
|
|
152
152
|
- src/js/utils/isTouchDevice.js
|
153
153
|
- src/js/utils/msToS.js
|
154
154
|
- src/js/utils/promisify.js
|
155
|
-
- src/js/utils/range.js
|
156
155
|
- src/js/utils/supportDom.js
|
157
|
-
- src/js/utils/toPixel.js
|
158
156
|
- src/js/utils/unbindAll.js
|
159
157
|
- src/sass/_beyond-sprockets.scss
|
160
158
|
- src/sass/_beyond.scss
|
data/src/js/utils/range.js
DELETED
data/src/js/utils/toPixel.js
DELETED