@symbo.ls/timepicker 2.11.43
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/TimePickerItem.js +50 -0
- package/TimeSwithcher.js +63 -0
- package/index.js +64 -0
- package/package.json +13 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { Flex } from "@symbo.ls/atoms"
|
|
4
|
+
import { Input } from "@symbo.ls/input"
|
|
5
|
+
import { Button } from "@symbo.ls/button"
|
|
6
|
+
|
|
7
|
+
const props = {
|
|
8
|
+
align: 'center center',
|
|
9
|
+
flow: 'column',
|
|
10
|
+
gap: 'X',
|
|
11
|
+
style: {
|
|
12
|
+
'input[type=number]::-webkit-inner-spin-button': {
|
|
13
|
+
'-webkit-appearance': 'none',
|
|
14
|
+
margin: 0
|
|
15
|
+
},
|
|
16
|
+
'input[type=number]::-webkit-outer-spin-button': {
|
|
17
|
+
'-webkit-appearance': 'none',
|
|
18
|
+
margin: 0
|
|
19
|
+
},
|
|
20
|
+
'input[type=number]': { '-webkit-appearance': 'textfield' },
|
|
21
|
+
'input:focus < button': { border: '3px solid red'},
|
|
22
|
+
'> button': {
|
|
23
|
+
padding: '0',
|
|
24
|
+
background: 'transparent',
|
|
25
|
+
color: 'white',
|
|
26
|
+
fontSize: `${12 / 16}em`,
|
|
27
|
+
display: 'none'
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
input: {
|
|
32
|
+
boxSize: 'C C',
|
|
33
|
+
round: 'Z',
|
|
34
|
+
padding: '0',
|
|
35
|
+
align: 'center center',
|
|
36
|
+
textAlign: 'center',
|
|
37
|
+
background: 'transparent',
|
|
38
|
+
color: 'white',
|
|
39
|
+
background: 'rgba(255, 255, 255, .15)'
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const TimePickerItem = {
|
|
44
|
+
tag: 'label',
|
|
45
|
+
extend: Flex,
|
|
46
|
+
props,
|
|
47
|
+
upButton: { extend: Button, props: { icon: 'plus'} },
|
|
48
|
+
input: { extend: [Input, Flex], attr: { type: 'number', min: '1', max: '24', value: '1'} },
|
|
49
|
+
downButton: { extend: Button, props: { icon: 'minus'} }
|
|
50
|
+
}
|
package/TimeSwithcher.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { Flex } from "@symbo.ls/atoms"
|
|
4
|
+
import { Button } from "@symbo.ls/button"
|
|
5
|
+
|
|
6
|
+
const props = {
|
|
7
|
+
boxSize: `C ${34 / 16}em`,
|
|
8
|
+
flow: 'column',
|
|
9
|
+
overflow: 'hidden',
|
|
10
|
+
round: 'Z',
|
|
11
|
+
background: 'rgba(255, 255, 255, .15)',
|
|
12
|
+
childProps: {
|
|
13
|
+
padding: '0',
|
|
14
|
+
background: 'transparent',
|
|
15
|
+
color: 'white',
|
|
16
|
+
flex: '1',
|
|
17
|
+
width: '100%',
|
|
18
|
+
fontSize: 'Y',
|
|
19
|
+
textTransform: 'capitalize',
|
|
20
|
+
round: '0'
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const TimeSwitcher = {
|
|
25
|
+
props,
|
|
26
|
+
extend: Flex,
|
|
27
|
+
|
|
28
|
+
childExtend: Button,
|
|
29
|
+
...[
|
|
30
|
+
{
|
|
31
|
+
text: 'am',
|
|
32
|
+
on: {
|
|
33
|
+
click: (event, element, state) => {
|
|
34
|
+
state.update({ activeTime: true })
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
class: {
|
|
38
|
+
show: (element, state) => state.activeTime
|
|
39
|
+
? {
|
|
40
|
+
background: '#0079FD',
|
|
41
|
+
pointerEvents: 'none'
|
|
42
|
+
}
|
|
43
|
+
: {}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
text: 'pm',
|
|
48
|
+
on: {
|
|
49
|
+
click: (event, element, state) => {
|
|
50
|
+
state.update({ activeTime: false })
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
class: {
|
|
54
|
+
show: (element, state) => state.activeTime === false
|
|
55
|
+
? {
|
|
56
|
+
background: '#0079FD',
|
|
57
|
+
pointerEvents: 'none'
|
|
58
|
+
}
|
|
59
|
+
: {}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
}
|
package/index.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { Flex } from "@symbo.ls/atoms"
|
|
4
|
+
|
|
5
|
+
import { TimePickerItem } from "./TimePickerItem"
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
const props = {
|
|
9
|
+
flow: 'column',
|
|
10
|
+
width: 'fit-content',
|
|
11
|
+
background: 'rgba(255, 255, 255, .15)',
|
|
12
|
+
padding: 'A A B A',
|
|
13
|
+
round: 'Z',
|
|
14
|
+
|
|
15
|
+
title: {
|
|
16
|
+
fontSize: 'Z1',
|
|
17
|
+
textTransform: 'capitalize',
|
|
18
|
+
padding: '- - B -'
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
content: {
|
|
22
|
+
align: 'center center',
|
|
23
|
+
gap: 'A',
|
|
24
|
+
timePickers: {
|
|
25
|
+
align: 'center center',
|
|
26
|
+
gap: 'Y2'
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
footButtons: {
|
|
31
|
+
align: 'center flex-end',
|
|
32
|
+
gap: 'A1',
|
|
33
|
+
padding: 'B1 - - -',
|
|
34
|
+
childProps: {
|
|
35
|
+
background: 'transparent',
|
|
36
|
+
padding: '0',
|
|
37
|
+
color: '#0079FD'
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
export const TimePicker = {
|
|
44
|
+
extend: Flex,
|
|
45
|
+
props,
|
|
46
|
+
title: { text: 'enter time' },
|
|
47
|
+
content: {
|
|
48
|
+
extend: Flex,
|
|
49
|
+
timePickers: {
|
|
50
|
+
tag: 'label',
|
|
51
|
+
extend: Flex,
|
|
52
|
+
...[
|
|
53
|
+
{ extend: TimePickerItem },
|
|
54
|
+
':',
|
|
55
|
+
{ extend: TimePickerItem },
|
|
56
|
+
':',
|
|
57
|
+
{ extend: TimePickerItem },
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
TimeSwitcher: {}
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
DialogFooter: {}
|
|
64
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@symbo.ls/timepicker",
|
|
3
|
+
"version": "2.11.43",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"gitHead": "78ee60fa6fc31d7b603721fe0c397abb9859049d",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"@symbo.ls/button": "latest",
|
|
9
|
+
"@symbo.ls/dialog": "latest",
|
|
10
|
+
"@symbo.ls/atoms": "latest"
|
|
11
|
+
},
|
|
12
|
+
"source": "src/index.js"
|
|
13
|
+
}
|