beyond-rails 0.0.246 → 0.0.251
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/src/font/beyond.eot +0 -0
- data/src/font/beyond.svg +2 -0
- data/src/font/beyond.ttf +0 -0
- data/src/font/beyond.woff +0 -0
- data/src/font/beyond.woff2 +0 -0
- data/src/js/components/MonthMenu.js +16 -2
- data/src/js/components/Monthpicker.js +3 -1
- data/src/js/components/TagInput.js +21 -1
- data/src/js/utils/index.js +2 -0
- data/src/sass/components/_form.scss +1 -1
- data/src/sass/components/_icon.scss +6 -0
- data/src/sass/components/_month-menu.scss +4 -0
- data/src/sass/components/_table.scss +2 -2
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7c25c8becf8350b03ce7b3be5e10d7aa6a5e7c748609be8c6004066dfb1b4e2
|
4
|
+
data.tar.gz: 60db926a555eecbd5ab96f3d7018909eb071c35e5415da248c0b8265812fb6f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1d4b5d3497fb25c8fe860f73d8cc0428253d05621e110acbbe4a5099ecb96c17c96ba5628d31f272056c336d86db5fa28622efd2ca0d549cdf55509b271d4f1
|
7
|
+
data.tar.gz: d84d78e047382a8c69af7fa8f8826103ae1a3b4bc8705b5ca070015e0b90fbd408a61d2fc8e558bd4629bb36584f74e1d62352bd2bde6e4dd2ed78e776da3d48
|
data/src/font/beyond.eot
CHANGED
Binary file
|
data/src/font/beyond.svg
CHANGED
@@ -142,4 +142,6 @@
|
|
142
142
|
<glyph unicode="" glyph-name="expand" d="M511.868-65.382h-0.845c-14.249 0.040-27.086 6.057-36.136 15.676-0.801 0.713-1.585 1.457-2.35 2.231l-343.999 348.25c-19.309 19.548-19.115 51.047 0.432 70.356s51.047 19.115 70.356-0.432l262.305-265.547 1.213 575.831c0.058 27.476 22.379 49.703 49.855 49.645s49.703-22.379 49.645-49.855l-1.215-576.566 263.564 266.512c19.32 19.536 50.82 19.712 70.356 0.391s19.712-50.82 0.391-70.356l-347.473-351.359c-9.914-10.025-23.035-14.952-36.101-14.777v0zM143.131 880c-16.089 0-29.131 17.909-29.131 40s13.042 40 29.131 40h737.738c16.089 0 29.131-17.909 29.131-40s-13.042-40-29.131-40h-737.738z" />
|
143
143
|
<glyph unicode="" glyph-name="shrink" d="M511.868 733.382c13.066 0.174 26.187-4.752 36.101-14.777l347.473-351.359c19.32-19.536 19.145-51.036-0.391-70.356s-51.036-19.145-70.356 0.391l-263.564 266.512 1.215-576.566c0.058-27.476-22.169-49.797-49.645-49.855s-49.797 22.169-49.855 49.646l-1.213 575.831-262.305-265.547c-19.309-19.548-50.808-19.741-70.356-0.432s-19.741 50.808-0.432 70.356l343.999 348.25c0.765 0.774 1.548 1.518 2.35 2.231 9.050 9.619 21.887 15.636 36.136 15.676h0.845zM143.131 880c-16.089 0-29.131 17.909-29.131 40s13.042 40 29.131 40h737.738c16.089 0 29.131-17.909 29.131-40s-13.042-40-29.131-40h-737.738z" />
|
144
144
|
<glyph unicode="" glyph-name="brush-alt" d="M895.693 940.743c39.535 21.353 73.331 18.001 101.388-10.056s31.529-61.973 10.415-101.747c-143.315-175.012-239.296-288.064-287.944-339.154-72.972-76.635-157.854-139.003-163.736-133.121-6.569 6.569-118.875 118.875-132.999 132.999 0 0-26.317 11.172 133.364 163.493 106.454 101.547 219.625 197.409 339.512 287.586zM354.82 430.539c43.447-43.447 87.986-87.092 133.617-130.937 0.461-110.050-52.691-190.068-159.457-240.055s-216.426 4.111-328.98 162.293c77.634-4.996 125.092 4.308 142.375 27.91 26.195 35.773 7.996 84.241 73.273 146.441 36.047 34.348 107.648 34.348 139.172 34.348z" />
|
145
|
+
<glyph unicode="" glyph-name="bug" d="M1024 384v64h-193.29c-5.862 72.686-31.786 139.026-71.67 192.25h161.944l70.060 280.24-62.090 15.522-57.94-231.76h-174.68c-0.892 0.694-1.796 1.374-2.698 2.056 6.71 19.502 10.362 40.422 10.362 62.194 0.002 105.76-85.958 191.498-191.998 191.498s-192-85.738-192-191.5c0-21.772 3.65-42.692 10.362-62.194-0.9-0.684-1.804-1.362-2.698-2.056h-174.68l-57.94 231.76-62.090-15.522 70.060-280.24h161.944c-39.884-53.222-65.806-119.562-71.668-192.248h-193.29v-64h193.37c3.802-45.664 15.508-88.812 33.638-127.75h-123.992l-70.060-280.238 62.090-15.524 57.94 231.762h112.354c58.692-78.032 147.396-127.75 246.66-127.75s187.966 49.718 246.662 127.75h112.354l57.94-231.762 62.090 15.524-70.060 280.238h-123.992c18.13 38.938 29.836 82.086 33.636 127.75h193.37z" />
|
146
|
+
<glyph unicode="" glyph-name="target1" d="M1024 512h-100.924c-27.64 178.24-168.836 319.436-347.076 347.076v100.924h-128v-100.924c-178.24-27.64-319.436-168.836-347.076-347.076h-100.924v-128h100.924c27.64-178.24 168.836-319.436 347.076-347.076v-100.924h128v100.924c178.24 27.64 319.436 168.836 347.076 347.076h100.924v128zM792.822 512h-99.762c-19.284 54.55-62.51 97.778-117.060 117.060v99.762c107.514-24.49 192.332-109.31 216.822-216.822zM512 384c-35.346 0-64 28.654-64 64s28.654 64 64 64c35.346 0 64-28.654 64-64s-28.654-64-64-64zM448 728.822v-99.762c-54.55-19.282-97.778-62.51-117.060-117.060h-99.762c24.49 107.512 109.31 192.332 216.822 216.822zM231.178 384h99.762c19.282-54.55 62.51-97.778 117.060-117.060v-99.762c-107.512 24.49-192.332 109.308-216.822 216.822zM576 167.178v99.762c54.55 19.284 97.778 62.51 117.060 117.060h99.762c-24.49-107.514-109.308-192.332-216.822-216.822z" />
|
145
147
|
</font></defs></svg>
|
data/src/font/beyond.ttf
CHANGED
Binary file
|
data/src/font/beyond.woff
CHANGED
Binary file
|
data/src/font/beyond.woff2
CHANGED
Binary file
|
@@ -6,6 +6,7 @@ import {
|
|
6
6
|
chunk,
|
7
7
|
format,
|
8
8
|
range,
|
9
|
+
isFuture,
|
9
10
|
setYear,
|
10
11
|
setMonth,
|
11
12
|
getYear,
|
@@ -27,6 +28,7 @@ export default class MonthMenu {
|
|
27
28
|
this.options = options
|
28
29
|
this.tz = options.tz || DEFAULT_TIMEZONE
|
29
30
|
this.locale = options.locale || DEFAULT_LOCALE
|
31
|
+
this.noFuture = options.noFuture || true
|
30
32
|
this.change = options.change || noop
|
31
33
|
this.isVisible = false
|
32
34
|
this.loopIndex = 0
|
@@ -39,7 +41,7 @@ export default class MonthMenu {
|
|
39
41
|
}
|
40
42
|
|
41
43
|
renderTableContent() {
|
42
|
-
const { date, menuDate, locale } = this
|
44
|
+
const { date, menuDate, locale, noFuture } = this
|
43
45
|
|
44
46
|
const currentYear = date ? getYear(date) : null
|
45
47
|
const currentMonth = date ? getMonth(date) : null
|
@@ -52,7 +54,15 @@ export default class MonthMenu {
|
|
52
54
|
|
53
55
|
const isCurrentMonth = (currentYear === getYear(d)) && (currentMonth === getMonth(d))
|
54
56
|
|
55
|
-
|
57
|
+
let classname = 'cell'
|
58
|
+
|
59
|
+
if (isCurrentMonth) {
|
60
|
+
classname = 'cell selected-ex'
|
61
|
+
}
|
62
|
+
else if (noFuture && isFuture(d)) {
|
63
|
+
classname = 'cell js-disabled'
|
64
|
+
}
|
65
|
+
|
56
66
|
return `<td class="${classname}" data-month-td="${month}">${text}</td>`
|
57
67
|
}).join('')
|
58
68
|
return `<tr>${tds}</tr>`
|
@@ -201,6 +211,10 @@ export default class MonthMenu {
|
|
201
211
|
const year = getYear(this.menuDate)
|
202
212
|
const month = parseInt(target.dataset.monthTd, 10)
|
203
213
|
|
214
|
+
if (target.classList.contains('js-disabled')) {
|
215
|
+
return
|
216
|
+
}
|
217
|
+
|
204
218
|
if (! this.date) {
|
205
219
|
this.date = new Date(this.menuDate.getTime())
|
206
220
|
}
|
@@ -15,6 +15,7 @@ export default class Monthpicker {
|
|
15
15
|
|
16
16
|
this.options = options
|
17
17
|
this.backdropMode = options.backdropMode || 'auto'
|
18
|
+
this.noFuture = options.noFuture || true
|
18
19
|
this.change = options.change || noop
|
19
20
|
this.init()
|
20
21
|
}
|
@@ -32,7 +33,8 @@ export default class Monthpicker {
|
|
32
33
|
this.monthInput.setDate(date)
|
33
34
|
this.monthInput.clearStatus()
|
34
35
|
this.monthMenu.hide()
|
35
|
-
}
|
36
|
+
},
|
37
|
+
noFuture: this.noFuture
|
36
38
|
})
|
37
39
|
this.addEvents()
|
38
40
|
}
|
@@ -14,6 +14,7 @@ export default class TagInput {
|
|
14
14
|
this.change = options.change || noop
|
15
15
|
this.isComposing = false
|
16
16
|
this.raf = raf
|
17
|
+
this.id = 0
|
17
18
|
this.tags = []
|
18
19
|
this.init()
|
19
20
|
}
|
@@ -74,6 +75,24 @@ export default class TagInput {
|
|
74
75
|
}, 500)
|
75
76
|
}
|
76
77
|
|
78
|
+
setTag(id, options = {}) {
|
79
|
+
const tag = this.tags.find(tag => tag.id === id)
|
80
|
+
if (! tag) {
|
81
|
+
return
|
82
|
+
}
|
83
|
+
if (options.classname) {
|
84
|
+
const originalClassname = tag.elem.className
|
85
|
+
tag.elem.className = options.classname
|
86
|
+
if (options.classnameTimeout) {
|
87
|
+
setTimeout(() => {
|
88
|
+
if (document.body.contains(tag.elem)) {
|
89
|
+
tag.elem.className = originalClassname
|
90
|
+
}
|
91
|
+
}, options.classnameTimeout)
|
92
|
+
}
|
93
|
+
}
|
94
|
+
}
|
95
|
+
|
77
96
|
addTag(inputValue, res) {
|
78
97
|
const classname = res.classname ? ` ${res.classname}` : ''
|
79
98
|
const tag = document.createElement('div')
|
@@ -95,7 +114,8 @@ export default class TagInput {
|
|
95
114
|
btn.addEventListener('click', handleBtnClick)
|
96
115
|
tag.appendChild(btn)
|
97
116
|
|
98
|
-
this.
|
117
|
+
this.id += 1
|
118
|
+
this.tags.push({ id: this.id, elem: tag, remove: handleBtnClick, res })
|
99
119
|
this.dom.insertBefore(tag, this.inputDiv)
|
100
120
|
}
|
101
121
|
|
data/src/js/utils/index.js
CHANGED
@@ -29,6 +29,7 @@ import startOfDay from 'date-fns/startOfDay'
|
|
29
29
|
import startOfMonth from 'date-fns/startOfMonth'
|
30
30
|
import subMonths from 'date-fns/subMonths'
|
31
31
|
import toDate from 'date-fns/toDate'
|
32
|
+
import isFuture from 'date-fns/isFuture'
|
32
33
|
import { format } from 'date-fns-tz'
|
33
34
|
|
34
35
|
// lodash
|
@@ -75,6 +76,7 @@ export {
|
|
75
76
|
startOfMonth,
|
76
77
|
subMonths,
|
77
78
|
toDate,
|
79
|
+
isFuture,
|
78
80
|
format,
|
79
81
|
|
80
82
|
// lodash
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
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.251
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kmsheng
|
8
8
|
- Eddie Li
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-11-
|
12
|
+
date: 2020-11-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sassc
|
@@ -93,7 +93,7 @@ dependencies:
|
|
93
93
|
- - ">="
|
94
94
|
- !ruby/object:Gem::Version
|
95
95
|
version: 3.3.0
|
96
|
-
description:
|
96
|
+
description:
|
97
97
|
email: kmsh3ng@gmail.com
|
98
98
|
executables: []
|
99
99
|
extensions: []
|
@@ -273,7 +273,7 @@ homepage: https://superlanding.github.io/beyond/
|
|
273
273
|
licenses:
|
274
274
|
- MIT
|
275
275
|
metadata: {}
|
276
|
-
post_install_message:
|
276
|
+
post_install_message:
|
277
277
|
rdoc_options: []
|
278
278
|
require_paths:
|
279
279
|
- lib
|
@@ -288,8 +288,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
288
288
|
- !ruby/object:Gem::Version
|
289
289
|
version: '0'
|
290
290
|
requirements: []
|
291
|
-
rubygems_version: 3.0.
|
292
|
-
signing_key:
|
291
|
+
rubygems_version: 3.0.8
|
292
|
+
signing_key:
|
293
293
|
specification_version: 4
|
294
294
|
summary: beyond is a collection of frontend components which aims for admin website.
|
295
295
|
test_files: []
|