beyond-rails 0.0.248 → 0.0.253
Sign up to get free protection for your applications and to get access to all the features.
- 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 +44 -3
- data/src/js/utils/index.js +2 -0
- data/src/sass/components/_icon.scss +6 -0
- data/src/sass/components/_month-menu.scss +4 -0
- 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: 03b03c2d04ee16bcfa672bcba9fb50cef0984d90b7269c50eae9cf12a7da092e
|
4
|
+
data.tar.gz: f63820f652d27f0a426ada80703966c6891f7f94e3551f1d393fe5527310d1fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f48f3c0d1d3ca9e3d4377cab79b72cb88260fa8b41e78d470c35b94a65c7f5c39bc84b839b809fc2023e1f0d6890167643cc3f16cc0740225548616144e4cca
|
7
|
+
data.tar.gz: 174f888a6d5fdc5b9b97b95a0afe55c754373eea237988fb43328122fce91fe207a2c93d196ee308bbf7c3597e27211c2a6cc727c8299363a0cc69c8844a87a1
|
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,7 +75,32 @@ export default class TagInput {
|
|
74
75
|
}, 500)
|
75
76
|
}
|
76
77
|
|
77
|
-
|
78
|
+
setTagAttrs(id, rows = [], options = {}) {
|
79
|
+
const tag = this.tags.find(tag => tag.id === id)
|
80
|
+
if (! tag) {
|
81
|
+
return
|
82
|
+
}
|
83
|
+
const { elem } = tag
|
84
|
+
const { timeout } = options
|
85
|
+
const oldAttrs = rows.map(row => elem.getAttribute(row.name))
|
86
|
+
|
87
|
+
rows.forEach(row => {
|
88
|
+
elem.setAttribute(row.name, row.value)
|
89
|
+
})
|
90
|
+
|
91
|
+
if (timeout) {
|
92
|
+
setTimeout(() => {
|
93
|
+
if (document.body.contains(elem)) {
|
94
|
+
rows.forEach((row, i) => {
|
95
|
+
elem.setAttribute(row.name, oldAttrs[i])
|
96
|
+
})
|
97
|
+
}
|
98
|
+
}, timeout)
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
102
|
+
getTag(inputValue, res) {
|
103
|
+
|
78
104
|
const classname = res.classname ? ` ${res.classname}` : ''
|
79
105
|
const tag = document.createElement('div')
|
80
106
|
|
@@ -94,9 +120,24 @@ export default class TagInput {
|
|
94
120
|
}
|
95
121
|
btn.addEventListener('click', handleBtnClick)
|
96
122
|
tag.appendChild(btn)
|
123
|
+
this.id += 1
|
124
|
+
|
125
|
+
return { id: this.id, elem: tag, remove: handleBtnClick, res }
|
126
|
+
}
|
97
127
|
|
98
|
-
|
99
|
-
|
128
|
+
setTags(rows) {
|
129
|
+
const { dom, inputDiv } = this
|
130
|
+
const tags = rows.map(row => this.getTag(row.text, row))
|
131
|
+
tags.forEach(tag => {
|
132
|
+
dom.insertBefore(tag.elem, inputDiv)
|
133
|
+
})
|
134
|
+
this.tags = tags
|
135
|
+
}
|
136
|
+
|
137
|
+
addTag(inputValue, res) {
|
138
|
+
const tag = this.getTag(inputValue, res)
|
139
|
+
this.tags.push(tag)
|
140
|
+
this.dom.insertBefore(tag.elem, this.inputDiv)
|
100
141
|
}
|
101
142
|
|
102
143
|
async addTagIfNeeded() {
|
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.253
|
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-25 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: []
|