@symbo.ls/datepicker 3.2.3 → 3.3.4
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.
- package/package.json +13 -5
- package/LICENSE +0 -21
- package/days.js +0 -47
- package/grid.js +0 -104
- package/index.js +0 -61
- package/months.js +0 -134
- package/weekdays.js +0 -32
- package/years.js +0 -85
package/package.json
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/datepicker",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.4",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"gitHead": "9fc1b79b41cdc725ca6b24aec64920a599634681",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@symbo.ls/atoms": "^3.
|
|
9
|
-
"@symbo.ls/button": "^3.
|
|
10
|
-
"@symbo.ls/dialog": "^3.
|
|
8
|
+
"@symbo.ls/atoms": "^3.3.4",
|
|
9
|
+
"@symbo.ls/button": "^3.3.4",
|
|
10
|
+
"@symbo.ls/dialog": "^3.3.4",
|
|
11
11
|
"headless-datepicker": "^1.0.1"
|
|
12
12
|
},
|
|
13
|
-
"source": "
|
|
13
|
+
"source": "index.js",
|
|
14
|
+
"type": "module",
|
|
15
|
+
"module": "index.js",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"import": "./index.js",
|
|
19
|
+
"default": "./index.js"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
14
22
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2023 symbo.ls
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/days.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
export const DatePickerDay = {
|
|
4
|
-
extends: 'Button',
|
|
5
|
-
state: true,
|
|
6
|
-
|
|
7
|
-
props: ({ state, key }) => {
|
|
8
|
-
const rootState = state.parent.parent.parent
|
|
9
|
-
const date = new Date(state._d)
|
|
10
|
-
const isSelected = rootState.activeDay === date.toString()
|
|
11
|
-
const gridColumnStart = 7 - state.parent.weekItems.weeks[0].dates.length
|
|
12
|
-
const { moment } = state
|
|
13
|
-
moment._d = date
|
|
14
|
-
const isWeekend = moment.day() === 0 || moment.day() === 6
|
|
15
|
-
// const isWeekend = state.moment.day() === 0 || state.moment.day() === 6
|
|
16
|
-
// const isWeekend = state.moment.isWeekend
|
|
17
|
-
|
|
18
|
-
return {
|
|
19
|
-
isSelected,
|
|
20
|
-
isWeekend,
|
|
21
|
-
date: date.toString(),
|
|
22
|
-
textAlign: 'center',
|
|
23
|
-
fontSize: 'Z1',
|
|
24
|
-
round: '100%',
|
|
25
|
-
height: 'B1',
|
|
26
|
-
aspectRatio: '1/1',
|
|
27
|
-
lineHeight: '.9',
|
|
28
|
-
background: 'transparent',
|
|
29
|
-
theme: 'field @dark .color',
|
|
30
|
-
text: parseInt(key) + 1,
|
|
31
|
-
':first-child': {
|
|
32
|
-
style: { gridColumnStart }
|
|
33
|
-
},
|
|
34
|
-
'.isSelected': { theme: 'primary' },
|
|
35
|
-
'!isSelected': {
|
|
36
|
-
'.isWeekend': { opacity: '.5' },
|
|
37
|
-
':hover': { theme: 'field' }
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
onClick: (event, element, state) => {
|
|
43
|
-
state.parent.parent.parent.update({
|
|
44
|
-
activeDay: element.props.date
|
|
45
|
-
})
|
|
46
|
-
}
|
|
47
|
-
}
|
package/grid.js
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import { DatePickerDay } from './days'
|
|
4
|
-
import { HeadlessDatepicker } from 'headless-datepicker'
|
|
5
|
-
|
|
6
|
-
export const calendar = new HeadlessDatepicker.Calendar({
|
|
7
|
-
calendarMode: 'exact'
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
const extractMonthDays = data => {
|
|
11
|
-
const result = []
|
|
12
|
-
|
|
13
|
-
data.weeks.forEach(week => {
|
|
14
|
-
week.dates.forEach(date => {
|
|
15
|
-
result.push({ ...date, _d: date.moment._d.toString() })
|
|
16
|
-
})
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
return result
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export const DatePickerGrid = {
|
|
23
|
-
display: 'grid',
|
|
24
|
-
|
|
25
|
-
columns: 'repeat(7, 1fr)',
|
|
26
|
-
minWidth: '100%',
|
|
27
|
-
gap: 'W2',
|
|
28
|
-
padding: '- Z',
|
|
29
|
-
scrollSnapAlign: 'center',
|
|
30
|
-
childExtends: DatePickerDay,
|
|
31
|
-
childrenAs: 'state',
|
|
32
|
-
children: ({ state }) => state.days
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export const DatePickerGridContainer = {
|
|
36
|
-
maxWidth: 'F3+B',
|
|
37
|
-
position: 'relative',
|
|
38
|
-
content: {
|
|
39
|
-
overflow: 'hidden',
|
|
40
|
-
style: { scrollSnapType: 'x mandatory' }
|
|
41
|
-
},
|
|
42
|
-
style: {
|
|
43
|
-
button: {
|
|
44
|
-
padding: '0'
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
':before': {
|
|
48
|
-
content: '""',
|
|
49
|
-
position: 'absolute',
|
|
50
|
-
boxSize: '100% 12px',
|
|
51
|
-
background:
|
|
52
|
-
'linear-gradient(to right, var(--theme-tertiary-dark-background) 0%, transparent 100%)',
|
|
53
|
-
left: '0',
|
|
54
|
-
top: '0',
|
|
55
|
-
zIndex: '30'
|
|
56
|
-
},
|
|
57
|
-
':after': {
|
|
58
|
-
content: '""',
|
|
59
|
-
position: 'absolute',
|
|
60
|
-
boxSize: '100% 12px',
|
|
61
|
-
background:
|
|
62
|
-
'linear-gradient(to left, var(--theme-tertiary-dark-background) 0%, transparent 100%)',
|
|
63
|
-
right: '0',
|
|
64
|
-
top: '0',
|
|
65
|
-
zIndex: '30'
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
state: ({ parent }) => {
|
|
69
|
-
const state = parent.state
|
|
70
|
-
if (!state.activeYear) return
|
|
71
|
-
return new Array(12).fill(undefined).map((v, k) => {
|
|
72
|
-
const year = state.activeYear
|
|
73
|
-
const month = k + 1
|
|
74
|
-
const weekItems = calendar.getMonth({ year, month })
|
|
75
|
-
return {
|
|
76
|
-
year,
|
|
77
|
-
month,
|
|
78
|
-
weekItems,
|
|
79
|
-
days: extractMonthDays(weekItems)
|
|
80
|
-
}
|
|
81
|
-
})
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
Flex: {
|
|
85
|
-
childProps: {
|
|
86
|
-
onRender: (el, state) => {
|
|
87
|
-
const { key } = el
|
|
88
|
-
const isSelected = state.parent.parent.activeMonth === parseInt(key)
|
|
89
|
-
if (isSelected) {
|
|
90
|
-
window.requestAnimationFrame(() => {
|
|
91
|
-
el.parent.parent.node.scrollTo({
|
|
92
|
-
left: el.node.offsetLeft,
|
|
93
|
-
behavior: state.initialized ? 'smooth' : 'instant'
|
|
94
|
-
})
|
|
95
|
-
})
|
|
96
|
-
// if (!state.initialized) state.update({ initialized: true }, { preventUpdate: true, isHoisted: true })
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
childExtends: 'DatePickerGrid',
|
|
101
|
-
childrenAs: 'state',
|
|
102
|
-
children: ({ state }) => state.parse()
|
|
103
|
-
}
|
|
104
|
-
}
|
package/index.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
export * from './days'
|
|
4
|
-
export * from './weekdays'
|
|
5
|
-
export * from './months'
|
|
6
|
-
export * from './years'
|
|
7
|
-
export * from './grid'
|
|
8
|
-
|
|
9
|
-
export const DatePicker = {
|
|
10
|
-
extends: ['Dialog'],
|
|
11
|
-
|
|
12
|
-
state: ({ props }) => {
|
|
13
|
-
const date = new Date()
|
|
14
|
-
const activeYear = date.getFullYear()
|
|
15
|
-
const activeMonth = date.getMonth()
|
|
16
|
-
const activeDay = date.getDate()
|
|
17
|
-
return {
|
|
18
|
-
yearRange: props.yearRange || [activeYear - 30, activeYear],
|
|
19
|
-
activeYear: props.activeYear || activeYear,
|
|
20
|
-
activeMonth: props.activeMonth || activeMonth,
|
|
21
|
-
activeDay: props.activeDay || activeDay,
|
|
22
|
-
selectedDay: props.selectedDay || null
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
width: 'fit-content',
|
|
27
|
-
margin: '0',
|
|
28
|
-
userSelect: 'none',
|
|
29
|
-
maxHeight: 'G+B2',
|
|
30
|
-
|
|
31
|
-
DatePickerYears: {},
|
|
32
|
-
|
|
33
|
-
Flex: {
|
|
34
|
-
flow: 'column',
|
|
35
|
-
padding: 'A1 - - -',
|
|
36
|
-
position: 'relative',
|
|
37
|
-
DatePickerMonthsSlider: {},
|
|
38
|
-
|
|
39
|
-
DatePickerWeekDays: {},
|
|
40
|
-
|
|
41
|
-
DatePickerGridContainer: {},
|
|
42
|
-
|
|
43
|
-
DialogFooter: {}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export const DatePickerTwoColumns = {
|
|
48
|
-
extends: DatePicker,
|
|
49
|
-
DatePickerYears: {},
|
|
50
|
-
Flex: {
|
|
51
|
-
DatePickerMonthsSlider: {
|
|
52
|
-
maxWidth: `${544 / 16}em`
|
|
53
|
-
},
|
|
54
|
-
DatePickerWeekDays: {
|
|
55
|
-
maxWidth: `${544 / 16}em`
|
|
56
|
-
},
|
|
57
|
-
MonthNumbersContainer: {
|
|
58
|
-
maxWidth: `${544 / 16}em`
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
package/months.js
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
export const DatePickerMonthsSlider = {
|
|
4
|
-
display: 'flex',
|
|
5
|
-
position: 'relative',
|
|
6
|
-
overflow: 'hidden',
|
|
7
|
-
alignItems: 'center',
|
|
8
|
-
padding: '- - A2 -',
|
|
9
|
-
maxWidth: `${272 / 16}em`,
|
|
10
|
-
boxSizing: 'border-box',
|
|
11
|
-
':before': {
|
|
12
|
-
content: '""',
|
|
13
|
-
position: 'absolute',
|
|
14
|
-
boxSize: '100% 100px',
|
|
15
|
-
background:
|
|
16
|
-
'linear-gradient(to right, var(--theme-tertiary-dark-background) 0%, transparent 100%)',
|
|
17
|
-
left: '0',
|
|
18
|
-
top: '0',
|
|
19
|
-
zIndex: '30',
|
|
20
|
-
pointerEvents: 'none'
|
|
21
|
-
},
|
|
22
|
-
':after': {
|
|
23
|
-
content: '""',
|
|
24
|
-
position: 'absolute',
|
|
25
|
-
boxSize: '100% 100px',
|
|
26
|
-
background:
|
|
27
|
-
'linear-gradient(to left, var(--theme-tertiary-dark-background) 0%, transparent 100%)',
|
|
28
|
-
right: '0',
|
|
29
|
-
top: '0',
|
|
30
|
-
zIndex: '30',
|
|
31
|
-
pointerEvents: 'none'
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
'> button': {
|
|
35
|
-
padding: '0',
|
|
36
|
-
width: 'A',
|
|
37
|
-
height: 'A',
|
|
38
|
-
position: 'absolute',
|
|
39
|
-
zIndex: '35',
|
|
40
|
-
background: 'transparent',
|
|
41
|
-
':first-child': { left: '18px' },
|
|
42
|
-
':last-child': { right: '18px' }
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
Button_left: {
|
|
46
|
-
icon: 'arrowLeft',
|
|
47
|
-
'@dark': {
|
|
48
|
-
theme: 'primary @dark .color-only'
|
|
49
|
-
},
|
|
50
|
-
'@light': {
|
|
51
|
-
theme: 'primary @light .color-only'
|
|
52
|
-
},
|
|
53
|
-
onClick: (ev, el, s) => {
|
|
54
|
-
const { activeMonth, activeYear } = s
|
|
55
|
-
if (activeMonth > 0) s.update({ activeMonth: activeMonth - 1 })
|
|
56
|
-
else {
|
|
57
|
-
s.update({
|
|
58
|
-
activeYear: activeYear - 1,
|
|
59
|
-
activeMonth: 11
|
|
60
|
-
})
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
Flex: {
|
|
66
|
-
flex: '1',
|
|
67
|
-
overflow: 'hidden',
|
|
68
|
-
style: { scrollSnapType: 'x mandatory' },
|
|
69
|
-
'::-webkit-scrollbar': { display: 'none' },
|
|
70
|
-
childExtends: {
|
|
71
|
-
tag: 'h6',
|
|
72
|
-
fontSize: 'Z1',
|
|
73
|
-
textAlign: 'center',
|
|
74
|
-
boxSizing: 'content-box',
|
|
75
|
-
minWidth: '272px',
|
|
76
|
-
scrollSnapAlign: 'center',
|
|
77
|
-
|
|
78
|
-
isSelected: ({ state, key }) => state.activeMonth === parseInt(key),
|
|
79
|
-
'.isSelected': { opacity: '1' },
|
|
80
|
-
|
|
81
|
-
onUpdate: (el, state) => {
|
|
82
|
-
const { props } = el
|
|
83
|
-
const { isSelected } = props
|
|
84
|
-
if (isSelected) {
|
|
85
|
-
window.requestAnimationFrame(() => {
|
|
86
|
-
el.parent.parent.node.scrollTo({
|
|
87
|
-
left: el.node.offsetLeft,
|
|
88
|
-
behavior: state.initialized ? 'smooth' : 'instant'
|
|
89
|
-
})
|
|
90
|
-
})
|
|
91
|
-
// if (!state.initialized) state.update({ initialized: true }, { preventUpdate: true, isHoisted: true })
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
children: ({ state, parent }) => {
|
|
97
|
-
return [
|
|
98
|
-
{ text: 'January' },
|
|
99
|
-
{ text: 'February' },
|
|
100
|
-
{ text: 'March' },
|
|
101
|
-
{ text: 'April' },
|
|
102
|
-
{ text: 'May' },
|
|
103
|
-
{ text: 'June' },
|
|
104
|
-
{ text: 'July' },
|
|
105
|
-
{ text: 'August' },
|
|
106
|
-
{ text: 'September' },
|
|
107
|
-
{ text: 'October' },
|
|
108
|
-
{ text: 'November' },
|
|
109
|
-
{ text: 'December' }
|
|
110
|
-
]
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
|
|
114
|
-
Button_right: {
|
|
115
|
-
icon: 'arrowRight',
|
|
116
|
-
'@dark': {
|
|
117
|
-
theme: 'primary @dark .color-only'
|
|
118
|
-
},
|
|
119
|
-
'@light': {
|
|
120
|
-
theme: 'primary @light .color-only'
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
onClick: (ev, el, s) => {
|
|
124
|
-
const { activeMonth, activeYear } = s
|
|
125
|
-
if (activeMonth < 11) s.update({ activeMonth: activeMonth + 1 })
|
|
126
|
-
else {
|
|
127
|
-
s.update({
|
|
128
|
-
activeYear: activeYear + 1,
|
|
129
|
-
activeMonth: 0
|
|
130
|
-
})
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
package/weekdays.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
export const DatePickerWeekDays = {
|
|
4
|
-
display: 'grid',
|
|
5
|
-
overflow: 'hidden',
|
|
6
|
-
padding: '- Z A',
|
|
7
|
-
width: '100%',
|
|
8
|
-
columns: 'repeat(7, 1fr)',
|
|
9
|
-
gap: 'W2',
|
|
10
|
-
style: {
|
|
11
|
-
button: {
|
|
12
|
-
padding: '0'
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
childExtends: {
|
|
16
|
-
tag: 'span',
|
|
17
|
-
display: 'flex',
|
|
18
|
-
fontSize: 'Y1',
|
|
19
|
-
textTransform: 'capitalize',
|
|
20
|
-
align: 'center center',
|
|
21
|
-
':nth-child(7n-1), &:nth-child(7n)': { opacity: '.5' }
|
|
22
|
-
},
|
|
23
|
-
...[
|
|
24
|
-
{ text: 'Mo' },
|
|
25
|
-
{ text: 'Tu' },
|
|
26
|
-
{ text: 'We' },
|
|
27
|
-
{ text: 'Th' },
|
|
28
|
-
{ text: 'Fr' },
|
|
29
|
-
{ text: 'Sa' },
|
|
30
|
-
{ text: 'Su' }
|
|
31
|
-
]
|
|
32
|
-
}
|
package/years.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
export const DatePickerYears = {
|
|
4
|
-
tag: 'aside',
|
|
5
|
-
overflow: 'hidden',
|
|
6
|
-
position: 'relative',
|
|
7
|
-
|
|
8
|
-
style: {
|
|
9
|
-
button: {
|
|
10
|
-
padding: '0'
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
':before': {
|
|
15
|
-
content: '""',
|
|
16
|
-
boxSize: 'A1 100%',
|
|
17
|
-
position: 'absolute',
|
|
18
|
-
top: '0',
|
|
19
|
-
left: '0',
|
|
20
|
-
background:
|
|
21
|
-
'linear-gradient(to bottom, var(--theme-tertiary-dark-background) 0%, transparent 100%)',
|
|
22
|
-
zIndex: '10'
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
':after': {
|
|
26
|
-
content: '""',
|
|
27
|
-
boxSize: 'B 100%',
|
|
28
|
-
position: 'absolute',
|
|
29
|
-
bottom: '0',
|
|
30
|
-
left: '0',
|
|
31
|
-
background:
|
|
32
|
-
'linear-gradient(to top, var(--theme-tertiary-dark-background) 0%, transparent 100%)'
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
if: ({ state }) => state.yearRange,
|
|
36
|
-
|
|
37
|
-
Flex: {
|
|
38
|
-
flow: 'column',
|
|
39
|
-
gap: 'B',
|
|
40
|
-
padding: 'A Z A1 B',
|
|
41
|
-
maxHeight: '100%',
|
|
42
|
-
overflow: 'hidden auto',
|
|
43
|
-
'::-webkit-scrollbar': { display: 'none' },
|
|
44
|
-
childExtends: {
|
|
45
|
-
extends: 'Button',
|
|
46
|
-
|
|
47
|
-
fontSize: 'Y1',
|
|
48
|
-
opacity: '.4',
|
|
49
|
-
background: 'transparent',
|
|
50
|
-
transition: 'opacity .25s ease',
|
|
51
|
-
isSelected: ({ state, text }) => state.activeYear === text,
|
|
52
|
-
'.isSelected': { opacity: '1' },
|
|
53
|
-
':hover': { opacity: '1' },
|
|
54
|
-
onClick: (event, element, state) =>
|
|
55
|
-
state.update(
|
|
56
|
-
{
|
|
57
|
-
activeYear: element.text
|
|
58
|
-
},
|
|
59
|
-
{ isHoisted: true }
|
|
60
|
-
),
|
|
61
|
-
onRender: (el, state) => {
|
|
62
|
-
const { props } = el
|
|
63
|
-
const { isSelected } = props
|
|
64
|
-
if (!isSelected) return
|
|
65
|
-
window.requestAnimationFrame(() => {
|
|
66
|
-
el.parent.parent.node.scrollTop = el.node.offsetTop - 100
|
|
67
|
-
})
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
children: element => {
|
|
72
|
-
const { yearRange } = element.state
|
|
73
|
-
if (!yearRange) return
|
|
74
|
-
|
|
75
|
-
const [start, end] = yearRange
|
|
76
|
-
const yearsArray = new Array(end + 1 - start)
|
|
77
|
-
.fill(undefined)
|
|
78
|
-
.map((v, k) => {
|
|
79
|
-
return { text: start + k }
|
|
80
|
-
})
|
|
81
|
-
.reverse()
|
|
82
|
-
return yearsArray
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|