beyond-rails 0.0.247 → 0.0.252

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: fcbe08abfc45d21018c37466a9dd1c3583f3ba5c376cbd4dc919988f7c1a338c
4
- data.tar.gz: c4012a25deb051a425c0d380a547ddbf989d092a1467107adfc2a3e01b8723b9
3
+ metadata.gz: aeaaa8c47595bc3cfacda7f7db2589e616e00915caaa00e2e13bdbac8692a996
4
+ data.tar.gz: 383c3b183f28a4690f329bd9eccf27e61392bd86c68dbc5acb42b2ea1c37fa08
5
5
  SHA512:
6
- metadata.gz: fd2b572f785a0e80b74e35fd8a13482c35d074fd8a1f159d72983a0a6ae5e46425cf80e1ebc74fd8dec32a1f8a1f687e53e569a730a674cfdf411fe0ab9544d9
7
- data.tar.gz: 242efd5ef533dd73da585becb92d36a205923d6d80a54db6e75191c462141c13a6ba3aaf88a3882aab7952547df82c0e653fb8623fe0df35bc29a01a5117a8c9
6
+ metadata.gz: 93d1309fee7cdf8c3b7b12cb10d40ce5cac534d3a17d0e768371530392d7bdde0d959bd566d26e4c8018db2101bf7d256716e14d515552ca3164b150cf5af310
7
+ data.tar.gz: 892c06951f5f82361c8c6331a5781026562227d9fe93daca94580f4eddec5c1ede43f989f52923eed140974626b64658472e7f8e2d7e4eb5b7824a96218e851e
Binary file
@@ -142,4 +142,6 @@
142
142
  <glyph unicode="&#xe984;" 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="&#xe985;" 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="&#xe986;" 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="&#xe999;" 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="&#xe9b3;" 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>
Binary file
Binary file
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
- const classname = isCurrentMonth ? 'cell selected-ex' : 'cell'
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,30 @@ export default class TagInput {
74
75
  }, 500)
75
76
  }
76
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
+
77
102
  addTag(inputValue, res) {
78
103
  const classname = res.classname ? ` ${res.classname}` : ''
79
104
  const tag = document.createElement('div')
@@ -95,7 +120,8 @@ export default class TagInput {
95
120
  btn.addEventListener('click', handleBtnClick)
96
121
  tag.appendChild(btn)
97
122
 
98
- this.tags.push({ elem: tag, remove: handleBtnClick, res })
123
+ this.id += 1
124
+ this.tags.push({ id: this.id, elem: tag, remove: handleBtnClick, res })
99
125
  this.dom.insertBefore(tag, this.inputDiv)
100
126
  }
101
127
 
@@ -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
@@ -432,6 +432,12 @@
432
432
  .icon-youtube:before {
433
433
  content: "\e981";
434
434
  }
435
+ .icon-bug:before {
436
+ content: "\e999";
437
+ }
438
+ .icon-target1:before {
439
+ content: "\e9b3";
440
+ }
435
441
 
436
442
  @if $beyond-icon-font-name == 'beyond-full' {
437
443
 
@@ -60,6 +60,10 @@
60
60
  color: #fff;
61
61
  border-color: #6c8eef;
62
62
  }
63
+ &.cell.js-disabled {
64
+ opacity: .4;
65
+ cursor: not-allowed;
66
+ }
63
67
  &.cell.selected-ex {
64
68
  background-color: #5469d4;
65
69
  color: #fff;
@@ -71,10 +71,10 @@
71
71
  filter: brightness(95%);
72
72
  }
73
73
  &.striped {
74
- tr:nth-child(even) td {
74
+ tr:nth-child(odd) td {
75
75
  background-color: #f7fafc;
76
76
  }
77
- tr.disabled:nth-child(even) td {
77
+ tr.disabled:nth-child(odd) td {
78
78
  @extend %disabled-td;
79
79
  }
80
80
  }
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.247
4
+ version: 0.0.252
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-11 00:00:00.000000000 Z
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.6
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: []