@symbo.ls/datepicker 2.11.92 → 2.11.94
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/days.js +5 -3
- package/index.js +2 -0
- package/months.js +16 -9
- package/package.json +2 -2
package/days.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
import { Grid } from '@symbo.ls/atoms'
|
|
4
4
|
import { Button } from '@symbo.ls/button'
|
|
5
|
-
import { calendar } from '.'
|
|
6
5
|
|
|
7
6
|
export const DatePickerDay = {
|
|
8
7
|
extend: Button,
|
|
@@ -72,10 +71,13 @@ export const DatePickerGrid = {
|
|
|
72
71
|
on: {
|
|
73
72
|
render: (el, state) => {
|
|
74
73
|
const { key } = el
|
|
75
|
-
const isSelected =
|
|
74
|
+
const isSelected = state.parent.parent.activeMonth === parseInt(key)
|
|
76
75
|
if (isSelected) {
|
|
77
76
|
window.requestAnimationFrame(() => {
|
|
78
|
-
el.node.
|
|
77
|
+
el.parent.parent.node.scrollTo({
|
|
78
|
+
left: el.node.offsetLeft,
|
|
79
|
+
behavior: 'smooth'
|
|
80
|
+
})
|
|
79
81
|
})
|
|
80
82
|
}
|
|
81
83
|
}
|
package/index.js
CHANGED
package/months.js
CHANGED
|
@@ -59,10 +59,12 @@ export const DatePickerMonthsSlider = {
|
|
|
59
59
|
click: (ev, el, s) => {
|
|
60
60
|
const { activeMonth, activeYear } = s
|
|
61
61
|
if (activeMonth > 0) s.update({ activeMonth: activeMonth - 1 })
|
|
62
|
-
else
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
else {
|
|
63
|
+
s.update({
|
|
64
|
+
activeYear: activeYear - 1,
|
|
65
|
+
activeMonth: 11
|
|
66
|
+
})
|
|
67
|
+
}
|
|
66
68
|
}
|
|
67
69
|
}
|
|
68
70
|
},
|
|
@@ -92,7 +94,10 @@ export const DatePickerMonthsSlider = {
|
|
|
92
94
|
const { isSelected } = props
|
|
93
95
|
if (isSelected) {
|
|
94
96
|
window.requestAnimationFrame(() => {
|
|
95
|
-
el.parent.parent.node.
|
|
97
|
+
el.parent.parent.node.scrollTo({
|
|
98
|
+
left: el.node.offsetLeft,
|
|
99
|
+
behavior: 'smooth'
|
|
100
|
+
})
|
|
96
101
|
})
|
|
97
102
|
}
|
|
98
103
|
}
|
|
@@ -131,10 +136,12 @@ export const DatePickerMonthsSlider = {
|
|
|
131
136
|
click: (ev, el, s) => {
|
|
132
137
|
const { activeMonth, activeYear } = s
|
|
133
138
|
if (activeMonth < 11) s.update({ activeMonth: activeMonth + 1 })
|
|
134
|
-
else
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
139
|
+
else {
|
|
140
|
+
s.update({
|
|
141
|
+
activeYear: activeYear + 1,
|
|
142
|
+
activeMonth: 0
|
|
143
|
+
})
|
|
144
|
+
}
|
|
138
145
|
}
|
|
139
146
|
}
|
|
140
147
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/datepicker",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.94",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"gitHead": "
|
|
6
|
+
"gitHead": "80354d405a3dd6085ee93472538ebef687c97764",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@symbo.ls/atoms": "latest",
|
|
9
9
|
"@symbo.ls/button": "latest",
|