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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 469a1f5d652f10d810b7c6575e9aa591a33a89434e6e84a7ea12884fa2d0a039
4
- data.tar.gz: d16e57ce2b2891f61b7e76313ee595d1810ce15dfd802fcf1491fc9793242d52
3
+ metadata.gz: 0db9116ac128821f93d7e9db1a61ed9188dc8530c6898680c2f6801736f10060
4
+ data.tar.gz: 0e898067612eb1cae224e39199e1e480d6aa8d0ff63fe223b550229fb7c98c0c
5
5
  SHA512:
6
- metadata.gz: 40f79d566a84a068bdf3de167170290b7984b9d2164be04e43dcb3704cbbbe68c5380d8049aedc57012805a37c2ef6bfe8e9cbdc76f1d6fbb9902f02dffb16d4
7
- data.tar.gz: 12a54452faa90d2944388dcd728539c714a319cd073cd3268005631b32918b20bd01d656aea63ade762e5eaad0d0bf5b42c5e7d61a5aa8137515fe2f3aa0fbaf
6
+ metadata.gz: 57fc84e18786cfbc35a6655c2d0138220149b2d201de0bbcbee44ca2aa45ccce3d749a6453adcb5213663c2fe7fb81b491930b4d8ae1a0f730dd68763d443fce
7
+ data.tar.gz: 9fd66c2560112cb1ff4628969f9e8d85ed3ce36c9ce8d6459521ba75e7a3632bf2bdbe147faaeaa77dd261d3743dd7979ad78f75c6df249dbb191fd7b685412a
@@ -1,6 +1,6 @@
1
1
  import getFloatedTargetPos from '../utils/getFloatedTargetPos'
2
- import toPixel from '../utils/toPixel'
3
2
  import supportDom from '../utils/supportDom'
3
+ import { toPixel } from '../utils'
4
4
 
5
5
  @supportDom
6
6
  export default class AutocompleteMenu {
@@ -1,5 +1,5 @@
1
1
  import supportDom from '../utils/supportDom'
2
- import toPixel from '../utils/toPixel'
2
+ import { toPixel } from '../utils'
3
3
 
4
4
  @supportDom
5
5
  export default class Btn {
@@ -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 {
@@ -1,6 +1,6 @@
1
1
  import getFloatedTargetPos from '../utils/getFloatedTargetPos'
2
- import toPixel from '../utils/toPixel'
3
2
  import supportDom from '../utils/supportDom'
3
+ import { toPixel } from '../utils'
4
4
 
5
5
  const TOOLTIP_PLACEMENTS = ['top', 'bottom', 'left', 'right']
6
6
 
@@ -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.172
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
@@ -1,7 +0,0 @@
1
- export default function range(start, end) {
2
- const arr = []
3
- for (let i = start; i <= end; i++) {
4
- arr.push(i)
5
- }
6
- return arr
7
- }
@@ -1,3 +0,0 @@
1
- export default function toPixel(num) {
2
- return parseInt(num, 10) + 'px'
3
- }