@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 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 = state.parent.parent.activeMonth === parseInt(key)
74
+ const isSelected = state.parent.parent.activeMonth === parseInt(key)
76
75
  if (isSelected) {
77
76
  window.requestAnimationFrame(() => {
78
- el.node.scrollIntoView()
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
@@ -81,6 +81,8 @@ export const DatePicker = {
81
81
  },
82
82
 
83
83
  props: {
84
+ width: 'fit-content',
85
+ margin: '0',
84
86
  maxHeight: 'G+B2'
85
87
  },
86
88
 
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 s.update({
63
- activeYear: activeYear - 1,
64
- activeMonth: 11
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.scrollLeft = el.node.offsetLeft
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 s.update({
135
- activeYear: activeYear + 1,
136
- activeMonth: 0
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.92",
3
+ "version": "2.11.94",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
- "gitHead": "8404ab11b0a8bfa4b56f8d63545c456cb4b0f23c",
6
+ "gitHead": "80354d405a3dd6085ee93472538ebef687c97764",
7
7
  "dependencies": {
8
8
  "@symbo.ls/atoms": "latest",
9
9
  "@symbo.ls/button": "latest",