@symbo.ls/datepicker 2.11.523 → 3.0.1

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
@@ -1,7 +1,7 @@
1
1
  'use strict'
2
2
 
3
3
  export const DatePickerDay = {
4
- extend: 'Button',
4
+ extends: 'Button',
5
5
  state: true,
6
6
 
7
7
  props: ({ state, key }) => {
package/grid.js CHANGED
@@ -20,7 +20,7 @@ const extractMonthDays = (data) => {
20
20
  }
21
21
 
22
22
  export const DatePickerGrid = {
23
- extend: 'Grid',
23
+ extends: 'Grid',
24
24
 
25
25
  props: {
26
26
  columns: 'repeat(7, 1fr)',
@@ -30,8 +30,9 @@ export const DatePickerGrid = {
30
30
  style: { scrollSnapAlign: 'center' }
31
31
  },
32
32
 
33
- childExtend: DatePickerDay,
34
- $stateCollection: ({ state }) => state.days
33
+ childExtends: DatePickerDay,
34
+ childrenAs: 'state',
35
+ children: ({ state }) => state.days
35
36
  }
36
37
 
37
38
  export const DatePickerGridContainer = {
@@ -84,24 +85,23 @@ export const DatePickerGridContainer = {
84
85
  },
85
86
 
86
87
  Flex: {
87
- childExtend: {
88
- extend: DatePickerGrid,
89
- on: {
90
- render: (el, state) => {
91
- const { key } = el
92
- const isSelected = state.parent.parent.activeMonth === parseInt(key)
93
- if (isSelected) {
94
- window.requestAnimationFrame(() => {
95
- el.parent.parent.node.scrollTo({
96
- left: el.node.offsetLeft,
97
- behavior: state.initialized ? 'smooth' : 'instant'
98
- })
88
+ childProps: {
89
+ onRender: (el, state) => {
90
+ const { key } = el
91
+ const isSelected = state.parent.parent.activeMonth === parseInt(key)
92
+ if (isSelected) {
93
+ window.requestAnimationFrame(() => {
94
+ el.parent.parent.node.scrollTo({
95
+ left: el.node.offsetLeft,
96
+ behavior: state.initialized ? 'smooth' : 'instant'
99
97
  })
100
- // if (!state.initialized) state.update({ initialized: true }, { preventUpdate: true, isHoisted: true })
101
- }
98
+ })
99
+ // if (!state.initialized) state.update({ initialized: true }, { preventUpdate: true, isHoisted: true })
102
100
  }
103
101
  }
104
102
  },
105
- $stateCollection: ({ state }) => state.parse()
103
+ childExtends: 'DatePickerGrid',
104
+ childrenAs: 'state',
105
+ children: ({ state }) => state.parse()
106
106
  }
107
107
  }
package/index.js CHANGED
@@ -10,7 +10,7 @@ export * from './years'
10
10
  export * from './grid'
11
11
 
12
12
  export const DatePicker = {
13
- extend: [Dialog, Flex],
13
+ extends: [Dialog, Flex],
14
14
 
15
15
  state: ({ props }) => {
16
16
  const date = new Date()
@@ -53,7 +53,7 @@ export const DatePicker = {
53
53
  }
54
54
 
55
55
  export const DatePickerTwoColumns = {
56
- extend: DatePicker,
56
+ extends: DatePicker,
57
57
  DatePickerYears: {},
58
58
  Flex: {
59
59
  DatePickerMonthsSlider: {
package/months.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict'
2
2
 
3
3
  export const DatePickerMonthsSlider = {
4
- extend: 'Flex',
4
+ extends: 'Flex',
5
5
  props: {
6
6
  position: 'relative',
7
7
  overflow: 'hidden',
@@ -76,7 +76,7 @@ export const DatePickerMonthsSlider = {
76
76
  '::-webkit-scrollbar': { display: 'none' }
77
77
  },
78
78
 
79
- childExtend: {
79
+ childExtends: {
80
80
  tag: 'h6',
81
81
  props: ({ state, key }) => ({
82
82
  fontSize: 'Z1',
@@ -106,7 +106,7 @@ export const DatePickerMonthsSlider = {
106
106
  }
107
107
  },
108
108
 
109
- $propsCollection: ({ state, parent }) => {
109
+ children: ({ state, parent }) => {
110
110
  return [
111
111
  { text: 'January' },
112
112
  { text: 'February' },
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@symbo.ls/datepicker",
3
- "version": "2.11.523",
3
+ "version": "3.0.1",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
- "gitHead": "08e5b257605d1475f4628529f8e35373d87eb369",
6
+ "gitHead": "a4e7f586f7e4f60bd7b6a8388bdacc3ae1879433",
7
7
  "dependencies": {
8
- "@symbo.ls/atoms": "^2.11.523",
9
- "@symbo.ls/button": "^2.11.523",
10
- "@symbo.ls/dialog": "^2.11.523",
8
+ "@symbo.ls/atoms": "^3.0.1",
9
+ "@symbo.ls/button": "^3.0.1",
10
+ "@symbo.ls/dialog": "^3.0.1",
11
11
  "headless-datepicker": "^1.0.1"
12
12
  },
13
13
  "source": "src/index.js"
package/weekdays.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict'
2
2
 
3
3
  export const DatePickerWeekDays = {
4
- extend: 'Grid',
4
+ extends: 'Grid',
5
5
  props: {
6
6
  overflow: 'hidden',
7
7
  padding: '- Z A',
@@ -14,9 +14,9 @@ export const DatePickerWeekDays = {
14
14
  }
15
15
  }
16
16
  },
17
- childExtend: {
17
+ childExtends: {
18
18
  tag: 'span',
19
- extend: 'Flex',
19
+ extends: 'Flex',
20
20
  props: {
21
21
  fontSize: 'Y1',
22
22
  textTransform: 'capitalize',
package/years.js CHANGED
@@ -43,8 +43,8 @@ export const DatePickerYears = {
43
43
  '::-webkit-scrollbar': { display: 'none' }
44
44
  },
45
45
 
46
- childExtend: {
47
- extend: 'Button',
46
+ childExtends: {
47
+ extends: 'Button',
48
48
  props: ({ state, text }) => ({
49
49
  fontSize: 'Y1',
50
50
  opacity: '.4',
@@ -69,7 +69,7 @@ export const DatePickerYears = {
69
69
  }
70
70
  },
71
71
 
72
- $propsCollection: (element) => {
72
+ children: (element) => {
73
73
  const { yearRange } = element.state
74
74
  if (!yearRange) return
75
75