beyond-rails 0.0.168 → 0.0.173

This diff has not been reviewed by any users.
Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/src/js/components/Alert.js +1 -1
  3. data/src/js/components/Autocomplete.js +3 -4
  4. data/src/js/components/AutocompleteMenu.js +3 -3
  5. data/src/js/components/Btn.js +2 -2
  6. data/src/js/components/Checkbox.js +1 -1
  7. data/src/js/components/DateInput.js +3 -3
  8. data/src/js/components/DateMenu.js +26 -24
  9. data/src/js/components/DateTimeRanger.js +15 -13
  10. data/src/js/components/Datepicker.js +9 -7
  11. data/src/js/components/DatepickerBtnArrow.js +1 -1
  12. data/src/js/components/Dropdown.js +3 -5
  13. data/src/js/components/Menu.js +1 -1
  14. data/src/js/components/Modal.js +2 -2
  15. data/src/js/components/Navbar.js +1 -1
  16. data/src/js/components/Radio.js +1 -1
  17. data/src/js/components/SearchDropdown.js +4 -7
  18. data/src/js/components/Sidebar.js +1 -1
  19. data/src/js/components/Tabbox.js +2 -2
  20. data/src/js/components/TimeInput.js +3 -3
  21. data/src/js/components/TimeMenu.js +3 -6
  22. data/src/js/components/Timepicker.js +133 -0
  23. data/src/js/components/Toast.js +1 -1
  24. data/src/js/components/ToastItem.js +1 -1
  25. data/src/js/components/Tooltip.js +3 -3
  26. data/src/js/index.js +5 -3
  27. data/src/js/{helpers → utils}/bind.js +0 -0
  28. data/src/js/{helpers → utils}/dateEq.js +1 -1
  29. data/src/js/{helpers → utils}/dateGt.js +1 -1
  30. data/src/js/{helpers → utils}/dateLt.js +1 -1
  31. data/src/js/{helpers → utils}/docReady.js +0 -0
  32. data/src/js/{helpers → utils}/getFloatedTargetPos.js +4 -6
  33. data/src/js/{helpers → utils}/getKey.js +0 -0
  34. data/src/js/utils/index.js +73 -0
  35. data/src/js/{helpers → utils}/isTouchDevice.js +0 -0
  36. data/src/js/{helpers → utils}/msToS.js +0 -0
  37. data/src/js/{helpers → utils}/promisify.js +0 -0
  38. data/src/js/{helpers → utils}/supportDom.js +1 -1
  39. data/src/js/{helpers → utils}/unbindAll.js +0 -0
  40. data/src/sass/_main.scss +5 -0
  41. data/src/sass/components/_form.scss +3 -0
  42. data/src/sass/components/_input.scss +1 -1
  43. metadata +16 -16
  44. data/src/js/helpers/range.js +0 -7
  45. data/src/js/helpers/toPixel.js +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 703ebdb0a1c1eb6e9455b1d5fd7fb59f213fc05982b9e28e88118355a8ebea4c
4
- data.tar.gz: 9762c05edd97cfeae03c7b463002ffc279e032fc25754b9f614ae73ce35b507e
3
+ metadata.gz: 0db9116ac128821f93d7e9db1a61ed9188dc8530c6898680c2f6801736f10060
4
+ data.tar.gz: 0e898067612eb1cae224e39199e1e480d6aa8d0ff63fe223b550229fb7c98c0c
5
5
  SHA512:
6
- metadata.gz: c74193e9a1ddc3f99ff63b277722f542af50d84e9097caeb4ea23f449f0472356654d355285807fec523c28fb3c01a5532654313d0a46eb694e76972ebe924bb
7
- data.tar.gz: 1a03b4780d221cbd8d57e6d132bfded963ae81c0d902ffe72645d1a1867ba2f867b539da84d02b95a03a23d6e5d84a8c337c3210d5d713704248f3b1d5dbbd83
6
+ metadata.gz: 57fc84e18786cfbc35a6655c2d0138220149b2d201de0bbcbee44ca2aa45ccce3d749a6453adcb5213663c2fe7fb81b491930b4d8ae1a0f730dd68763d443fce
7
+ data.tar.gz: 9fd66c2560112cb1ff4628969f9e8d85ed3ce36c9ce8d6459521ba75e7a3632bf2bdbe147faaeaa77dd261d3743dd7979ad78f75c6df249dbb191fd7b685412a
@@ -1,4 +1,4 @@
1
- import supportDom from '../helpers/supportDom'
1
+ import supportDom from '../utils/supportDom'
2
2
 
3
3
  @supportDom
4
4
  export default class Alert {
@@ -1,8 +1,7 @@
1
- import debounce from 'lodash.debounce'
2
1
  import AutocompleteMenu from './AutocompleteMenu'
3
- import promisify from '../helpers/promisify'
4
- import supportDom from '../helpers/supportDom'
5
- import noop from 'lodash.noop'
2
+ import promisify from '../utils/promisify'
3
+ import supportDom from '../utils/supportDom'
4
+ import { debounce, noop } from '../utils'
6
5
 
7
6
  const defaultRenderMenuItem = row => {
8
7
  return `
@@ -1,6 +1,6 @@
1
- import getFloatedTargetPos from '../helpers/getFloatedTargetPos'
2
- import toPixel from '../helpers/toPixel'
3
- import supportDom from '../helpers/supportDom'
1
+ import getFloatedTargetPos from '../utils/getFloatedTargetPos'
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
- import supportDom from '../helpers/supportDom'
2
- import toPixel from '../helpers/toPixel'
1
+ import supportDom from '../utils/supportDom'
2
+ import { toPixel } from '../utils'
3
3
 
4
4
  @supportDom
5
5
  export default class Btn {
@@ -1,4 +1,4 @@
1
- import supportDom from '../helpers/supportDom'
1
+ import supportDom from '../utils/supportDom'
2
2
 
3
3
  @supportDom
4
4
  export default class Checkbox {
@@ -1,7 +1,7 @@
1
- import { format } from 'date-fns-tz'
2
1
  import { DEFAULT_TIMEZONE } from '../consts'
3
- import supportDom from '../helpers/supportDom'
4
- import isTouchDevice from '../helpers/isTouchDevice'
2
+ import supportDom from '../utils/supportDom'
3
+ import isTouchDevice from '../utils/isTouchDevice'
4
+ import { format } from '../utils'
5
5
 
6
6
  @supportDom
7
7
  export default class DateInput {
@@ -1,25 +1,27 @@
1
- import { format } from 'date-fns-tz'
2
- import addDays from 'date-fns/addDays'
3
- import set from 'date-fns/set'
4
- import addMonths from 'date-fns/addMonths'
5
- import compareAsc from 'date-fns/compareAsc'
6
- import endOfMonth from 'date-fns/endOfMonth'
7
- import getDay from 'date-fns/getDay'
8
- import getDaysInMonth from 'date-fns/getDaysInMonth'
9
- import getMonth from 'date-fns/getMonth'
10
- import getYear from 'date-fns/getYear'
11
- import startOfDay from 'date-fns/startOfDay'
12
- import startOfMonth from 'date-fns/startOfMonth'
13
- import subMonths from 'date-fns/subMonths'
14
- import getFloatedTargetPos from '../helpers/getFloatedTargetPos'
15
- import range from '../helpers/range'
16
- import toPixel from '../helpers/toPixel'
17
- import isTouchDevice from '../helpers/isTouchDevice'
18
- import dateLt from '../helpers/dateLt'
19
- import dateEq from '../helpers/dateEq'
1
+ import getFloatedTargetPos from '../utils/getFloatedTargetPos'
2
+ import isTouchDevice from '../utils/isTouchDevice'
3
+ import dateLt from '../utils/dateLt'
4
+ import dateEq from '../utils/dateEq'
5
+ import supportDom from '../utils/supportDom'
6
+ import {
7
+ addDays,
8
+ addMonths,
9
+ compareAsc,
10
+ endOfMonth,
11
+ getDay,
12
+ getDaysInMonth,
13
+ getMonth,
14
+ getYear,
15
+ throttle,
16
+ range,
17
+ set,
18
+ startOfDay,
19
+ startOfMonth,
20
+ subMonths,
21
+ toPixel,
22
+ format
23
+ } from '../utils'
20
24
  import { DEFAULT_TIMEZONE, DEFAULT_LOCALE } from '../consts'
21
- import supportDom from '../helpers/supportDom'
22
- import throttle from 'lodash.throttle'
23
25
 
24
26
  const DEFAULT_WEEK_HEADER_ITEMS = [
25
27
  { id: 'monday', text: '一' },
@@ -79,7 +81,7 @@ export default class DateMenu {
79
81
 
80
82
  const firstWeekday = getDay(startOfMonth(date))
81
83
  const beforeWeekday = ((firstWeekday - 1) === -1) ? 6 : (firstWeekday - 1)
82
- const emptyHeadRows = range(1, beforeWeekday).map(toEmptyCell)
84
+ const emptyHeadRows = range(1, beforeWeekday + 1).map(toEmptyCell)
83
85
 
84
86
  const initialStartDate = startOfDay(startDate)
85
87
  const initialEndDate = startOfDay(endDate)
@@ -104,7 +106,7 @@ export default class DateMenu {
104
106
  }
105
107
  const today = formatDate(new Date())
106
108
 
107
- const rows = range(1, daysInMonth).map(day => {
109
+ const rows = range(1, daysInMonth + 1).map(day => {
108
110
 
109
111
  const d = addDays(firstDateOfMonth, day - 1)
110
112
  const resCompareStart = compareAsc(startOfStartDate, d)
@@ -122,7 +124,7 @@ export default class DateMenu {
122
124
 
123
125
  const lastWeekday = getDay(endOfMonth(date))
124
126
  const emptyDays = ((7 - lastWeekday) % 7)
125
- const emptyTailRows = range(1, emptyDays).map(toEmptyCell)
127
+ const emptyTailRows = range(1, emptyDays + 1).map(toEmptyCell)
126
128
 
127
129
  return emptyHeadRows.concat(rows).concat(emptyTailRows)
128
130
  }
@@ -1,21 +1,23 @@
1
- import endOfDay from 'date-fns/endOfDay'
2
- import parse from 'date-fns/parse'
3
- import set from 'date-fns/set'
4
- import noop from 'lodash.noop'
5
- import startOfDay from 'date-fns/startOfDay'
6
- import getHours from 'date-fns/getHours'
7
- import getMinutes from 'date-fns/getMinutes'
8
- import getSeconds from 'date-fns/getSeconds'
9
1
  import DateInput from './DateInput'
10
2
  import TimeInput from './TimeInput'
11
3
  import DateMenu from './DateMenu'
12
4
  import TimeMenu from './TimeMenu'
13
5
  import DatepickerBtnArrow from './DatepickerBtnArrow'
14
- import dateGt from '../helpers/dateGt'
15
- import dateLt from '../helpers/dateLt'
16
- import supportDom from '../helpers/supportDom'
17
- import dateToTimestamp from '@superlanding/datetotimestamp'
18
- import timestampToDate from '@superlanding/timestamptodate'
6
+ import dateGt from '../utils/dateGt'
7
+ import dateLt from '../utils/dateLt'
8
+ import supportDom from '../utils/supportDom'
9
+ import {
10
+ endOfDay,
11
+ dateToTimestamp,
12
+ getHours,
13
+ getMinutes,
14
+ getSeconds,
15
+ noop,
16
+ parse,
17
+ set,
18
+ startOfDay,
19
+ timestampToDate
20
+ } from '../utils'
19
21
 
20
22
  @supportDom
21
23
  export default class DateTimeRanger {
@@ -1,15 +1,17 @@
1
- import parse from 'date-fns/parse'
2
- import set from 'date-fns/set'
3
- import noop from 'lodash.noop'
4
- import toDate from 'date-fns/toDate'
5
1
  import DateInput from './DateInput'
6
2
  import TimeInput from './TimeInput'
7
3
  import DateMenu from './DateMenu'
8
4
  import TimeMenu from './TimeMenu'
9
- import supportDom from '../helpers/supportDom'
5
+ import supportDom from '../utils/supportDom'
10
6
  import { DEFAULT_TIMEZONE } from '../consts'
11
- import dateToTimestamp from '@superlanding/datetotimestamp'
12
- import timestampToDate from '@superlanding/timestamptodate'
7
+ import {
8
+ dateToTimestamp,
9
+ noop,
10
+ parse,
11
+ set,
12
+ timestampToDate,
13
+ toDate
14
+ } from '../utils'
13
15
 
14
16
  @supportDom
15
17
  export default class Datepicker {
@@ -1,4 +1,4 @@
1
- import supportDom from '../helpers/supportDom'
1
+ import supportDom from '../utils/supportDom'
2
2
 
3
3
  @supportDom
4
4
  export default class DatepickerBtnArrow {
@@ -1,8 +1,6 @@
1
- import throttle from 'lodash.throttle'
2
- import isFunction from 'lodash.isfunction'
3
- import getFloatedTargetPos from '../helpers/getFloatedTargetPos'
4
- import toPixel from '../helpers/toPixel'
5
- import supportDom from '../helpers/supportDom'
1
+ import getFloatedTargetPos from '../utils/getFloatedTargetPos'
2
+ import supportDom from '../utils/supportDom'
3
+ import { isFunction, toPixel, throttle } from '../utils'
6
4
 
7
5
  @supportDom
8
6
  export default class Dropdown {
@@ -1,4 +1,4 @@
1
- import supportDom from '../helpers/supportDom'
1
+ import supportDom from '../utils/supportDom'
2
2
 
3
3
  @supportDom
4
4
  export default class Menu {
@@ -1,5 +1,5 @@
1
- import noop from 'lodash.noop'
2
- import supportDom from '../helpers/supportDom'
1
+ import supportDom from '../utils/supportDom'
2
+ import { noop } from '../utils'
3
3
 
4
4
  @supportDom
5
5
  export default class Modal {
@@ -1,4 +1,4 @@
1
- import supportDom from '../helpers/supportDom'
1
+ import supportDom from '../utils/supportDom'
2
2
 
3
3
  @supportDom
4
4
  export default class Navbar {
@@ -1,4 +1,4 @@
1
- import supportDom from '../helpers/supportDom'
1
+ import supportDom from '../utils/supportDom'
2
2
 
3
3
  @supportDom
4
4
  export default class Radio {
@@ -1,10 +1,7 @@
1
- import noop from 'lodash.noop'
2
- import throttle from 'lodash.throttle'
3
- import debounce from 'lodash.debounce'
4
- import getFloatedTargetPos from '../helpers/getFloatedTargetPos'
5
- import toPixel from '../helpers/toPixel'
6
- import supportDom from '../helpers/supportDom'
7
- import getKey from '../helpers/getKey'
1
+ import getFloatedTargetPos from '../utils/getFloatedTargetPos'
2
+ import supportDom from '../utils/supportDom'
3
+ import getKey from '../utils/getKey'
4
+ import { debounce, noop, toPixel, throttle } from '../utils'
8
5
 
9
6
  const renderMenu = row => {
10
7
  return `<div class="search-dropdown-menu-item" data-item>${JSON.stringify(row)}</div>`
@@ -1,4 +1,4 @@
1
- import supportDom from '../helpers/supportDom'
1
+ import supportDom from '../utils/supportDom'
2
2
 
3
3
  @supportDom
4
4
  export default class Sidebar {
@@ -1,6 +1,6 @@
1
- import noop from 'lodash.noop'
2
- import supportDom from '../helpers/supportDom'
1
+ import supportDom from '../utils/supportDom'
3
2
  import Dropdown from './Dropdown'
3
+ import { noop } from '../utils'
4
4
 
5
5
  @supportDom
6
6
  export default class Tabbox {
@@ -1,7 +1,7 @@
1
- import { format } from 'date-fns-tz'
2
1
  import { DEFAULT_TIMEZONE } from '../consts'
3
- import supportDom from '../helpers/supportDom'
4
- import isTouchDevice from '../helpers/isTouchDevice'
2
+ import supportDom from '../utils/supportDom'
3
+ import isTouchDevice from '../utils/isTouchDevice'
4
+ import { format } from '../utils'
5
5
 
6
6
  @supportDom
7
7
  export default class TimeInput {
@@ -1,9 +1,6 @@
1
- import getHours from 'date-fns/getHours'
2
- import getMinutes from 'date-fns/getMinutes'
3
- import getFloatedTargetPos from '../helpers/getFloatedTargetPos'
4
- import toPixel from '../helpers/toPixel'
5
- import range from 'lodash.range'
6
- import supportDom from '../helpers/supportDom'
1
+ import getFloatedTargetPos from '../utils/getFloatedTargetPos'
2
+ import supportDom from '../utils/supportDom'
3
+ import { getHours, getMinutes, range, toPixel } from '../utils'
7
4
 
8
5
  @supportDom
9
6
  export default class TimeMenu {
@@ -0,0 +1,133 @@
1
+ import TimeInput from './TimeInput'
2
+ import TimeMenu from './TimeMenu'
3
+ import { DEFAULT_TIMEZONE } from '../consts'
4
+ import supportDom from '../utils/supportDom'
5
+ import {
6
+ dateToTimestamp,
7
+ noop,
8
+ parse,
9
+ set,
10
+ timestampToDate
11
+ } from '../utils'
12
+
13
+ @supportDom
14
+ export default class Timepicker {
15
+
16
+ constructor(dom, timestamp, options = {}) {
17
+ this.dom = dom
18
+ this.options = options
19
+ this.options.change = options.change || noop
20
+ this.tz = options.tz || DEFAULT_TIMEZONE
21
+
22
+ this.date = (timestamp === null) ? null : timestampToDate(timestamp)
23
+ this.focused = false
24
+ this.backdropMode = options.backdropMode || 'auto'
25
+ this.init()
26
+ }
27
+
28
+ init() {
29
+ this.timeInput = new TimeInput(
30
+ this.dom,
31
+ this.date,
32
+ this.options
33
+ )
34
+ this.timeMenu = new TimeMenu()
35
+ this.addEvents()
36
+ }
37
+
38
+ clearInputStatus() {
39
+ this.timeInput.clearStatus()
40
+ }
41
+
42
+ handleTimeInputFocus() {
43
+ const { timeInput } = this
44
+ this.focused = true
45
+ this.clearInputStatus()
46
+ timeInput.setActive(true)
47
+ this.timeMenu.show({ src: this.dom, date: timeInput.date })
48
+ }
49
+
50
+ handleTimeInputKeyUp(event) {
51
+ const { date, timeInput } = this
52
+ const { value } = event.target
53
+
54
+ if ((! timeInput.required) && (value === '')) {
55
+ this.nextDate = null
56
+ return
57
+ }
58
+ const res = parse(event.target.value, timeInput.timePattern, date)
59
+ this.nextDate = null
60
+
61
+ if (res.toString() === 'Invalid Date') {
62
+ return timeInput.setDanger(true)
63
+ }
64
+ timeInput.setDanger(false)
65
+ this.nextDate = res
66
+ }
67
+
68
+ handleTimeInputBlur() {
69
+ const { nextDate, date, timeInput } = this
70
+
71
+ if (nextDate) {
72
+ this.date = nextDate
73
+ timeInput.setDate(nextDate)
74
+ this.nextDate = null
75
+ }
76
+ else if (date) {
77
+ timeInput.setDate(date)
78
+ }
79
+ }
80
+
81
+ emitChange() {
82
+ const { date } = this
83
+ this.options.change({
84
+ date,
85
+ timestamp: dateToTimestamp(date)
86
+ })
87
+ }
88
+
89
+ hide() {
90
+ this.focused = false
91
+ this.clearInputStatus()
92
+ this.timeMenu.hide()
93
+ }
94
+
95
+ addEvents() {
96
+
97
+ this.timeInput.on('focus', () => this.handleTimeInputFocus())
98
+ this.timeInput.on('keyup', event => this.handleTimeInputKeyUp(event))
99
+ this.timeInput.on('blur', () => this.handleTimeInputBlur())
100
+
101
+ this.timeMenu.on('click', (event, res) => {
102
+ if (this.date === null) {
103
+ this.date = set(new Date(), { hours: res.hour, minutes: res.minute })
104
+ }
105
+ else {
106
+ this.date = set(this.date, { hours: res.hour, minutes: res.minute })
107
+ }
108
+ this.timeInput.setDate(this.date)
109
+ this.timeMenu.hide()
110
+ this.clearInputStatus()
111
+ this.emitChange()
112
+ })
113
+
114
+ this.addEvent(document, 'click', event => {
115
+ if (this.focused) {
116
+ this.focused = false
117
+ return
118
+ }
119
+ if (this.backdropMode === 'manual') {
120
+ return
121
+ }
122
+ if (event.target === this.dom) {
123
+ return
124
+ }
125
+ this.hide()
126
+ })
127
+ }
128
+
129
+ destroy() {
130
+ this.timeInput.destroy()
131
+ this.timeMenu.destroy()
132
+ }
133
+ }
@@ -1,4 +1,4 @@
1
- import supportDom from '../helpers/supportDom'
1
+ import supportDom from '../utils/supportDom'
2
2
  import ToastItem from './ToastItem'
3
3
 
4
4
  @supportDom
@@ -1,4 +1,4 @@
1
- import supportDom from '../helpers/supportDom'
1
+ import supportDom from '../utils/supportDom'
2
2
 
3
3
  @supportDom
4
4
  export default class ToastItem {
@@ -1,6 +1,6 @@
1
- import getFloatedTargetPos from '../helpers/getFloatedTargetPos'
2
- import toPixel from '../helpers/toPixel'
3
- import supportDom from '../helpers/supportDom'
1
+ import getFloatedTargetPos from '../utils/getFloatedTargetPos'
2
+ import supportDom from '../utils/supportDom'
3
+ import { toPixel } from '../utils'
4
4
 
5
5
  const TOOLTIP_PLACEMENTS = ['top', 'bottom', 'left', 'right']
6
6
 
@@ -17,12 +17,13 @@ import Navbar from './components/Navbar'
17
17
  import Radio from './components/Radio'
18
18
  import SearchDropdown from './components/SearchDropdown'
19
19
  import Sidebar from './components/Sidebar'
20
+ import Timepicker from './components/Timepicker'
20
21
  import Tabbox from './components/Tabbox'
21
22
  import Toast from './components/Toast'
22
23
  import Tooltip from './components/Tooltip'
23
- import bind from './helpers/bind'
24
- import docReady from './helpers/docReady'
25
- import unbindAll from './helpers/unbindAll'
24
+ import bind from './utils/bind'
25
+ import docReady from './utils/docReady'
26
+ import unbindAll from './utils/unbindAll'
26
27
 
27
28
  export {
28
29
  Alert,
@@ -38,6 +39,7 @@ export {
38
39
  Radio,
39
40
  SearchDropdown,
40
41
  Sidebar,
42
+ Timepicker,
41
43
  Tabbox,
42
44
  Toast,
43
45
  Tooltip,
File without changes
@@ -1,4 +1,4 @@
1
- import compareAsc from 'date-fns/compareAsc'
1
+ import { compareAsc } from './index'
2
2
 
3
3
  export default function dateEq(date1, date2) {
4
4
  return compareAsc(date1, date2) === 0
@@ -1,4 +1,4 @@
1
- import compareAsc from 'date-fns/compareAsc'
1
+ import { compareAsc } from './index'
2
2
 
3
3
  export default function dateLt(date1, date2) {
4
4
  return compareAsc(date1, date2) === 1
@@ -1,4 +1,4 @@
1
- import compareAsc from 'date-fns/compareAsc'
1
+ import { compareAsc } from './index'
2
2
 
3
3
  export default function dateLt(date1, date2) {
4
4
  return compareAsc(date1, date2) === -1
File without changes
@@ -1,11 +1,9 @@
1
- import getDomPos from '@superlanding/getdompos'
2
- import getScrollTop from '@superlanding/getscrolltop'
3
- import getScrollLeft from '@superlanding/getscrollleft'
1
+ import { getDomPos, getScrollTop, getScrollLeft } from './index'
4
2
 
5
3
  // Calculate floated target position for tooltip and dropdown
6
4
  export default function getFloatedTargetPos(options) {
7
5
 
8
- const { src, target, place, align, offset = 0, offsetLeft, offsetTop } = options
6
+ const { src, target, place, align, offset = 0, offsetLeft = 0, offsetTop = 0 } = options
9
7
 
10
8
  const { x: x1, y: y1 } = getDomPos(src)
11
9
 
@@ -228,13 +226,13 @@ function adjustToBoundary({ pos, w1, w2, h1, h2 }) {
228
226
  let left = pos.left
229
227
  let top = pos.top
230
228
  if (touchedLeft) {
231
- left = 0
229
+ left = 0 + getScrollLeft()
232
230
  }
233
231
  if (touchedRight) {
234
232
  left = window.innerWidth - w2 + w1;
235
233
  }
236
234
  if (touchedTop) {
237
- top = 0
235
+ top = 0 + getScrollTop()
238
236
  }
239
237
  if (touchedBottom) {
240
238
  top = window.innerHeight - h2 + h1
File without changes
@@ -0,0 +1,73 @@
1
+ // @superlanding
2
+ import dateToTimestamp from '@superlanding/datetotimestamp'
3
+ import getDomPos from '@superlanding/getdompos'
4
+ import getScrollLeft from '@superlanding/getscrollleft'
5
+ import getScrollTop from '@superlanding/getscrolltop'
6
+ import timestampToDate from '@superlanding/timestamptodate'
7
+ import toPixel from '@superlanding/toPixel'
8
+
9
+ // date-fns
10
+ import addDays from 'date-fns/addDays'
11
+ import addMonths from 'date-fns/addMonths'
12
+ import compareAsc from 'date-fns/compareAsc'
13
+ import endOfDay from 'date-fns/endOfDay'
14
+ import endOfMonth from 'date-fns/endOfMonth'
15
+ import getDay from 'date-fns/getDay'
16
+ import getDaysInMonth from 'date-fns/getDaysInMonth'
17
+ import getHours from 'date-fns/getHours'
18
+ import getMinutes from 'date-fns/getMinutes'
19
+ import getMonth from 'date-fns/getMonth'
20
+ import getSeconds from 'date-fns/getSeconds'
21
+ import getYear from 'date-fns/getYear'
22
+ import parse from 'date-fns/parse'
23
+ import set from 'date-fns/set'
24
+ import startOfDay from 'date-fns/startOfDay'
25
+ import startOfMonth from 'date-fns/startOfMonth'
26
+ import subMonths from 'date-fns/subMonths'
27
+ import toDate from 'date-fns/toDate'
28
+ import { format } from 'date-fns-tz'
29
+
30
+ // lodash
31
+ import debounce from 'lodash.debounce'
32
+ import isFunction from 'lodash.isfunction'
33
+ import noop from 'lodash.noop'
34
+ import range from 'lodash.range'
35
+ import throttle from 'lodash.throttle'
36
+
37
+ export {
38
+ // @superlanding
39
+ dateToTimestamp,
40
+ getDomPos,
41
+ getScrollLeft,
42
+ getScrollTop,
43
+ timestampToDate,
44
+ toPixel,
45
+
46
+ // date-fns
47
+ addDays,
48
+ addMonths,
49
+ compareAsc,
50
+ endOfDay,
51
+ endOfMonth,
52
+ getDay,
53
+ getDaysInMonth,
54
+ getHours,
55
+ getMinutes,
56
+ getMonth,
57
+ getSeconds,
58
+ getYear,
59
+ parse,
60
+ set,
61
+ startOfDay,
62
+ startOfMonth,
63
+ subMonths,
64
+ toDate,
65
+ format,
66
+
67
+ // lodash
68
+ debounce,
69
+ isFunction,
70
+ noop,
71
+ range,
72
+ throttle
73
+ }
File without changes
File without changes
@@ -1,4 +1,4 @@
1
- import isFunction from 'lodash.isfunction'
1
+ import { isFunction } from './index'
2
2
  import createdComponents from '../consts/createdComponents'
3
3
 
4
4
  export default function supportDom(target) {
File without changes
@@ -143,3 +143,8 @@ $color-active: #5469d4;
143
143
  clip-path: inset(50%);
144
144
  border: 0;
145
145
  }
146
+
147
+ input[type=file], /* FF, IE7+, chrome (except button) */
148
+ input[type=file]::-webkit-file-upload-button { /* chromes and blink button */
149
+ cursor: pointer;
150
+ }
@@ -125,6 +125,9 @@ label {
125
125
 
126
126
  .form-control {
127
127
  @extend %form-control;
128
+ &::placeholder {
129
+ color: #a9aebf;
130
+ }
128
131
  padding: 5px 7px 6px;
129
132
  background-color: #fff;
130
133
  background-clip: padding-box;
@@ -42,7 +42,7 @@
42
42
  border: 0;
43
43
  box-shadow: none;
44
44
  &::placeholder {
45
- color: #697396;
45
+ color: #a9aebf;
46
46
  }
47
47
  }
48
48
  }
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.168
4
+ version: 0.0.173
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-05-15 00:00:00.000000000 Z
12
+ date: 2020-06-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sassc
@@ -112,25 +112,12 @@ files:
112
112
  - src/js/components/Tabbox.js
113
113
  - src/js/components/TimeInput.js
114
114
  - src/js/components/TimeMenu.js
115
+ - src/js/components/Timepicker.js
115
116
  - src/js/components/Toast.js
116
117
  - src/js/components/ToastItem.js
117
118
  - src/js/components/Tooltip.js
118
119
  - src/js/consts/createdComponents.js
119
120
  - src/js/consts/index.js
120
- - src/js/helpers/bind.js
121
- - src/js/helpers/dateEq.js
122
- - src/js/helpers/dateGt.js
123
- - src/js/helpers/dateLt.js
124
- - src/js/helpers/docReady.js
125
- - src/js/helpers/getFloatedTargetPos.js
126
- - src/js/helpers/getKey.js
127
- - src/js/helpers/isTouchDevice.js
128
- - src/js/helpers/msToS.js
129
- - src/js/helpers/promisify.js
130
- - src/js/helpers/range.js
131
- - src/js/helpers/supportDom.js
132
- - src/js/helpers/toPixel.js
133
- - src/js/helpers/unbindAll.js
134
121
  - src/js/index.js
135
122
  - src/js/jquery/bindAlertFn.js
136
123
  - src/js/jquery/bindAutocompleteFn.js
@@ -154,6 +141,19 @@ files:
154
141
  - src/js/polyfills/nodeContains.js
155
142
  - src/js/polyfills/nodeHasAttribute.js
156
143
  - src/js/polyfills/nodeRemove.js
144
+ - src/js/utils/bind.js
145
+ - src/js/utils/dateEq.js
146
+ - src/js/utils/dateGt.js
147
+ - src/js/utils/dateLt.js
148
+ - src/js/utils/docReady.js
149
+ - src/js/utils/getFloatedTargetPos.js
150
+ - src/js/utils/getKey.js
151
+ - src/js/utils/index.js
152
+ - src/js/utils/isTouchDevice.js
153
+ - src/js/utils/msToS.js
154
+ - src/js/utils/promisify.js
155
+ - src/js/utils/supportDom.js
156
+ - src/js/utils/unbindAll.js
157
157
  - src/sass/_beyond-sprockets.scss
158
158
  - src/sass/_beyond.scss
159
159
  - src/sass/_main.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
- }