beyond-rails 0.0.269 → 0.0.274
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '019b06ed5825f1ea7d525d647ba1f118d676a311ebf6c5ff652074d43b2bcf75'
|
4
|
+
data.tar.gz: 24e79142445705b4ec67ef98f068b98b219bdfae0b0434e54d3e4bc100c95c9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbffbf93644151d9efb3ffa39adcf053234e78eeefaf441336e295adff02277239b6a6464993d2fa891b9ffb8acf6476eca915ebb550f033b77d67717d4dd5a8
|
7
|
+
data.tar.gz: 000f1dfd749a56f479de5765897cfa20edf97cae9320ffbee308e742d434e6c24ad72b62e2979cd2445250e6441de34299e808af99e170445998ba3c1841ca84
|
@@ -12,12 +12,13 @@ import {
|
|
12
12
|
getDaysInMonth,
|
13
13
|
getMonth,
|
14
14
|
getYear,
|
15
|
-
|
15
|
+
isFuture,
|
16
16
|
range,
|
17
17
|
set,
|
18
18
|
startOfDay,
|
19
19
|
startOfMonth,
|
20
20
|
subMonths,
|
21
|
+
throttle,
|
21
22
|
toPixel,
|
22
23
|
format
|
23
24
|
} from '../utils'
|
@@ -46,6 +47,7 @@ export default class DateMenu {
|
|
46
47
|
this.endDate = endDate
|
47
48
|
this.hoveredCellData = null
|
48
49
|
this.options = options
|
50
|
+
this.noFuture = options.noFuture || false
|
49
51
|
this.tz = options.tz || DEFAULT_TIMEZONE
|
50
52
|
this.locale = options.locale || DEFAULT_LOCALE
|
51
53
|
this.captionPattern = options.captionPattern || 'yyyy MMMM'
|
@@ -74,7 +76,7 @@ export default class DateMenu {
|
|
74
76
|
|
75
77
|
getTableRows(date) {
|
76
78
|
|
77
|
-
const { startDate, endDate } = this
|
79
|
+
const { noFuture, startDate, endDate } = this
|
78
80
|
|
79
81
|
const daysInMonth = getDaysInMonth(date)
|
80
82
|
const firstDateOfMonth = startOfMonth(date)
|
@@ -118,6 +120,7 @@ export default class DateMenu {
|
|
118
120
|
isStartDate: dateEq(initialStartDate, d),
|
119
121
|
isEndDate: dateEq(initialEndDate, d),
|
120
122
|
isSelected: (resCompareStart <= 0) && (resCompareEnd >= 0),
|
123
|
+
isDisabled: noFuture && isFuture(d),
|
121
124
|
isToday: (today === formatDate(d)),
|
122
125
|
day
|
123
126
|
}
|
@@ -191,6 +194,9 @@ export default class DateMenu {
|
|
191
194
|
if (row.type === CELL_TYPE_EMPTY) {
|
192
195
|
return '<td></td>'
|
193
196
|
}
|
197
|
+
if (row.isDisabled) {
|
198
|
+
return `<td class="cell js-disabled">${row.day}</td>`
|
199
|
+
}
|
194
200
|
if (row.isStartDate || row.isEndDate) {
|
195
201
|
return `<td class="cell selected-ex" data-date-table-cell>${row.day}</td>`
|
196
202
|
}
|
@@ -247,17 +247,10 @@ export default class SearchDropdown {
|
|
247
247
|
return Array.from(this.menuContent.querySelectorAll('[data-item]'))
|
248
248
|
}
|
249
249
|
|
250
|
-
findClickedItem(target
|
251
|
-
const
|
252
|
-
|
253
|
-
|
254
|
-
if ('item' in node.dataset) {
|
255
|
-
const index = rows.findIndex(row => row === node)
|
256
|
-
return this.items[index]
|
257
|
-
}
|
258
|
-
node = node.parentNode
|
259
|
-
}
|
260
|
-
return null
|
250
|
+
findClickedItem(target) {
|
251
|
+
const index = this.getMenuItemEls()
|
252
|
+
.findIndex(item => (target === item) || (item.contains(target)))
|
253
|
+
return this.items[index]
|
261
254
|
}
|
262
255
|
|
263
256
|
isInputFocused() {
|
@@ -170,6 +170,11 @@ export default class TagInput {
|
|
170
170
|
const { input, suggestInput } = this
|
171
171
|
const inputValue = suggestInput.value || input.value
|
172
172
|
const res = await this.validate(inputValue)
|
173
|
+
if (res.clear) {
|
174
|
+
input.value = ''
|
175
|
+
suggestInput.value = ''
|
176
|
+
return
|
177
|
+
}
|
173
178
|
if (! res.isTag) {
|
174
179
|
return this.shake()
|
175
180
|
}
|
@@ -243,7 +248,7 @@ export default class TagInput {
|
|
243
248
|
|
244
249
|
destroy() {
|
245
250
|
this.tags.forEach(tag => tag.remove())
|
246
|
-
this.inputDiv.remove()
|
251
|
+
this.inputDiv && this.inputDiv.remove()
|
247
252
|
this.canvas = null
|
248
253
|
this.input = null
|
249
254
|
this.suggestInput = null
|
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.
|
4
|
+
version: 0.0.274
|
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-12-
|
12
|
+
date: 2020-12-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sassc
|