@tecsinapse/react-native-kit 3.0.0 → 3.3.0
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/dist/cjs/components/molecules/DatePicker/DatePicker.js +30 -2
- package/dist/cjs/components/molecules/DateTimePicker/DateTimePicker.js +10 -4
- package/dist/cjs/components/molecules/DateTimePickerSelector/DateTimePickerSelector.js +90 -0
- package/dist/cjs/components/molecules/DateTimePickerSelector/styled.js +32 -0
- package/dist/cjs/components/molecules/ScrollableSelector/ScrollableSelector.js +143 -0
- package/dist/cjs/components/molecules/ScrollableSelector/components/DateBlock.js +99 -0
- package/dist/cjs/components/molecules/ScrollableSelector/styled.js +49 -0
- package/dist/cjs/components/molecules/Select/styled.js +4 -19
- package/dist/cjs/index.js +2 -2
- package/dist/esm/components/molecules/DatePicker/DatePicker.js +31 -3
- package/dist/esm/components/molecules/DateTimePicker/DateTimePicker.js +11 -5
- package/dist/esm/components/molecules/DateTimePickerSelector/DateTimePickerSelector.js +69 -0
- package/dist/esm/components/molecules/DateTimePickerSelector/styled.js +27 -0
- package/dist/esm/components/molecules/ScrollableSelector/ScrollableSelector.js +141 -0
- package/dist/esm/components/molecules/ScrollableSelector/components/DateBlock.js +97 -0
- package/dist/esm/components/molecules/ScrollableSelector/styled.js +44 -0
- package/dist/esm/components/molecules/Select/styled.js +5 -20
- package/dist/esm/index.js +1 -1
- package/dist/types/components/atoms/Modal/useLazyModalManager.d.ts +2 -2
- package/dist/types/components/molecules/DatePicker/DatePicker.d.ts +1 -1
- package/dist/types/components/molecules/DateTimePickerSelector/DateTimePickerSelector.d.ts +5 -0
- package/dist/types/components/molecules/DateTimePickerSelector/index.d.ts +1 -0
- package/dist/types/components/molecules/DateTimePickerSelector/styled.d.ts +23 -0
- package/dist/types/components/molecules/ScrollableSelector/ScrollableSelector.d.ts +15 -0
- package/dist/types/components/molecules/ScrollableSelector/components/DateBlock.d.ts +19 -0
- package/dist/types/components/molecules/ScrollableSelector/components/index.d.ts +1 -0
- package/dist/types/components/molecules/ScrollableSelector/index.d.ts +1 -0
- package/dist/types/components/molecules/ScrollableSelector/styled.d.ts +57 -0
- package/dist/types/components/molecules/Select/styled.d.ts +1 -20
- package/dist/types/index.d.ts +1 -1
- package/package.json +4 -4
- package/dist/cjs/components/molecules/DateTimeSelector/DateTimeSelector.js +0 -22
- package/dist/esm/components/molecules/DateTimeSelector/DateTimeSelector.js +0 -20
- package/dist/types/components/molecules/DateTimeSelector/DateTimeSelector.d.ts +0 -3
- package/dist/types/components/molecules/DateTimeSelector/index.d.ts +0 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Button } from '../../atoms/Button/Button.js';
|
|
3
|
+
import { Icon } from '@tecsinapse/react-core';
|
|
4
|
+
import Text from '../../atoms/Text/Text.js';
|
|
5
|
+
import ScrollableSelector from '../ScrollableSelector/ScrollableSelector.js';
|
|
6
|
+
import { Calendar } from '../Calendar/Calendar.js';
|
|
7
|
+
import { Root, Header, BackButton, Content } from './styled.js';
|
|
8
|
+
import { getLocale } from '../../../utils/date.js';
|
|
9
|
+
|
|
10
|
+
const DateTimePickerSelector = ({
|
|
11
|
+
TextComponent = Text,
|
|
12
|
+
currentMode,
|
|
13
|
+
handlePressBack,
|
|
14
|
+
modalTitle,
|
|
15
|
+
isDate,
|
|
16
|
+
date,
|
|
17
|
+
handleCalendarChange,
|
|
18
|
+
isMonth,
|
|
19
|
+
setDate,
|
|
20
|
+
handlePressConfirm,
|
|
21
|
+
confirmButtonText,
|
|
22
|
+
locale,
|
|
23
|
+
yearLabel,
|
|
24
|
+
monthLabel,
|
|
25
|
+
hourLabel,
|
|
26
|
+
minuteLabel,
|
|
27
|
+
...rest
|
|
28
|
+
}) => {
|
|
29
|
+
return /* @__PURE__ */ React.createElement(Root, { ...rest }, /* @__PURE__ */ React.createElement(Header, null, currentMode === 1 && /* @__PURE__ */ React.createElement(BackButton, { onPress: handlePressBack }, /* @__PURE__ */ React.createElement(
|
|
30
|
+
Icon,
|
|
31
|
+
{
|
|
32
|
+
type: "material-community",
|
|
33
|
+
name: "chevron-left",
|
|
34
|
+
size: "mega",
|
|
35
|
+
colorVariant: "secondary"
|
|
36
|
+
}
|
|
37
|
+
)), /* @__PURE__ */ React.createElement(TextComponent, { typography: "base", colorVariant: "secondary" }, modalTitle)), isDate ? /* @__PURE__ */ React.createElement(
|
|
38
|
+
Calendar,
|
|
39
|
+
{
|
|
40
|
+
type: "day",
|
|
41
|
+
value: date,
|
|
42
|
+
onChange: handleCalendarChange,
|
|
43
|
+
year: date.getFullYear(),
|
|
44
|
+
month: date.getMonth()
|
|
45
|
+
}
|
|
46
|
+
) : isMonth ? /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(
|
|
47
|
+
ScrollableSelector,
|
|
48
|
+
{
|
|
49
|
+
onChange: setDate,
|
|
50
|
+
value: date,
|
|
51
|
+
yearLabel,
|
|
52
|
+
monthLabel,
|
|
53
|
+
format: "MM-yyyy",
|
|
54
|
+
locale: locale ?? getLocale()
|
|
55
|
+
}
|
|
56
|
+
)) : /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(
|
|
57
|
+
ScrollableSelector,
|
|
58
|
+
{
|
|
59
|
+
onChange: setDate,
|
|
60
|
+
value: date,
|
|
61
|
+
hourLabel,
|
|
62
|
+
minuteLabel,
|
|
63
|
+
format: "HH-mm",
|
|
64
|
+
locale: locale ?? getLocale()
|
|
65
|
+
}
|
|
66
|
+
)), /* @__PURE__ */ React.createElement(Button, { color: "primary", onPress: handlePressConfirm }, /* @__PURE__ */ React.createElement(TextComponent, { fontWeight: "bold", fontColor: "light" }, confirmButtonText || "OK")));
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export { DateTimePickerSelector as default };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import styled from '@emotion/native';
|
|
2
|
+
import { PressableSurface } from '@tecsinapse/react-core';
|
|
3
|
+
|
|
4
|
+
const Root = styled.View`
|
|
5
|
+
position: relative;
|
|
6
|
+
background-color: ${({ theme }) => theme.miscellaneous.surfaceColor};
|
|
7
|
+
`;
|
|
8
|
+
const Content = styled.View`
|
|
9
|
+
flex-direction: row;
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
margin-top: ${({ theme }) => theme.spacing.deca};
|
|
12
|
+
margin-bottom: ${({ theme }) => theme.spacing.deca};
|
|
13
|
+
`;
|
|
14
|
+
const BackButton = styled(PressableSurface)`
|
|
15
|
+
border-radius: ${({ theme }) => theme.borderRadius.mili};
|
|
16
|
+
padding: ${({ theme }) => theme.spacing.micro};
|
|
17
|
+
margin-right: ${({ theme }) => theme.spacing.mili};
|
|
18
|
+
aspect-ratio: 1;
|
|
19
|
+
`;
|
|
20
|
+
const Header = styled.View`
|
|
21
|
+
flex-direction: row;
|
|
22
|
+
align-items: center;
|
|
23
|
+
margin-top: ${({ theme }) => theme.spacing.mili};
|
|
24
|
+
margin-bottom: ${({ theme }) => theme.spacing.mili};
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
export { BackButton, Content, Header, Root };
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import React__default, { useMemo, useState, useEffect, useCallback } from 'react';
|
|
2
|
+
import { StyleSheet, Dimensions, View } from 'react-native';
|
|
3
|
+
import Text from '../../atoms/Text/Text.js';
|
|
4
|
+
import { BlockLabels } from './styled.js';
|
|
5
|
+
import DateBlock from './components/DateBlock.js';
|
|
6
|
+
|
|
7
|
+
const ScrollableSelector = ({
|
|
8
|
+
value,
|
|
9
|
+
onChange,
|
|
10
|
+
height,
|
|
11
|
+
width,
|
|
12
|
+
fontSize,
|
|
13
|
+
textColor,
|
|
14
|
+
startYear,
|
|
15
|
+
endYear,
|
|
16
|
+
markColor,
|
|
17
|
+
markHeight,
|
|
18
|
+
markWidth,
|
|
19
|
+
format,
|
|
20
|
+
monthLabel,
|
|
21
|
+
yearLabel,
|
|
22
|
+
hourLabel,
|
|
23
|
+
minuteLabel,
|
|
24
|
+
TextComponent = Text
|
|
25
|
+
}) => {
|
|
26
|
+
const date = useMemo(() => value ?? /* @__PURE__ */ new Date(), [value]);
|
|
27
|
+
const [months, setMonths] = useState([]);
|
|
28
|
+
const [years, setYears] = useState([]);
|
|
29
|
+
const [hour, setHour] = useState([]);
|
|
30
|
+
const [minutes, setMinutes] = useState([]);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
const end = endYear || (/* @__PURE__ */ new Date()).getFullYear();
|
|
33
|
+
const start = !startYear || startYear > end ? end - 100 : startYear;
|
|
34
|
+
const _months = [...Array(12)].map((_, index) => index + 1);
|
|
35
|
+
const _years = [...Array(end - start + 1)].map((_, index) => start + index);
|
|
36
|
+
const _hour = [...Array(24)].map((_, index) => index);
|
|
37
|
+
const _minutes = [...Array(60)].map((_, index) => index);
|
|
38
|
+
setMonths(_months);
|
|
39
|
+
setYears(_years);
|
|
40
|
+
setHour(_hour);
|
|
41
|
+
setMinutes(_minutes);
|
|
42
|
+
}, []);
|
|
43
|
+
const pickerHeight = Math.round(
|
|
44
|
+
height ?? Dimensions.get("window").height / 3.5
|
|
45
|
+
);
|
|
46
|
+
const pickerWidth = width ?? "100%";
|
|
47
|
+
const changeHandle = useCallback(
|
|
48
|
+
(type, digit) => {
|
|
49
|
+
switch (type) {
|
|
50
|
+
case "month":
|
|
51
|
+
date.setMonth(digit - 1);
|
|
52
|
+
break;
|
|
53
|
+
case "year":
|
|
54
|
+
date.setFullYear(digit);
|
|
55
|
+
break;
|
|
56
|
+
case "hour":
|
|
57
|
+
date.setHours(digit);
|
|
58
|
+
break;
|
|
59
|
+
case "minutes":
|
|
60
|
+
date.setMinutes(digit);
|
|
61
|
+
}
|
|
62
|
+
onChange?.(date);
|
|
63
|
+
},
|
|
64
|
+
[date]
|
|
65
|
+
);
|
|
66
|
+
const getOrder = useCallback(() => {
|
|
67
|
+
return (format || "dd-MM-yyyy").split("-").map((type, index) => {
|
|
68
|
+
switch (type) {
|
|
69
|
+
case "MM":
|
|
70
|
+
return {
|
|
71
|
+
name: "month",
|
|
72
|
+
digits: months,
|
|
73
|
+
value: date.getMonth() + 1
|
|
74
|
+
};
|
|
75
|
+
case "yyyy":
|
|
76
|
+
return { name: "year", digits: years, value: date.getFullYear() };
|
|
77
|
+
case "HH":
|
|
78
|
+
return { name: "hour", digits: hour, value: date.getHours() };
|
|
79
|
+
case "mm":
|
|
80
|
+
return {
|
|
81
|
+
name: "minutes",
|
|
82
|
+
digits: minutes,
|
|
83
|
+
value: date.getMinutes()
|
|
84
|
+
};
|
|
85
|
+
default:
|
|
86
|
+
return {
|
|
87
|
+
name: ["day", "month", "year", "hour", "minutes"][index],
|
|
88
|
+
digits: [months, years, hour, minutes][index],
|
|
89
|
+
value: [
|
|
90
|
+
date.getDate(),
|
|
91
|
+
date.getMonth() + 1,
|
|
92
|
+
date.getFullYear(),
|
|
93
|
+
date.getHours(),
|
|
94
|
+
date.getMinutes()
|
|
95
|
+
][index]
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}, [format, date, months, years, hour, minutes]);
|
|
100
|
+
return /* @__PURE__ */ React__default.createElement(View, { style: { flexDirection: "column", width: "100%" } }, /* @__PURE__ */ React__default.createElement(BlockLabels, null, format === "MM-yyyy" ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(TextComponent, null, monthLabel), /* @__PURE__ */ React__default.createElement(TextComponent, null, yearLabel)) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(TextComponent, null, hourLabel), /* @__PURE__ */ React__default.createElement(TextComponent, null, minuteLabel))), /* @__PURE__ */ React__default.createElement(
|
|
101
|
+
View,
|
|
102
|
+
{
|
|
103
|
+
style: [styles.picker, { height: pickerHeight, width: pickerWidth }]
|
|
104
|
+
},
|
|
105
|
+
getOrder().map((el, index) => {
|
|
106
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
107
|
+
DateBlock,
|
|
108
|
+
{
|
|
109
|
+
date: value ?? /* @__PURE__ */ new Date(),
|
|
110
|
+
digits: el.digits,
|
|
111
|
+
value: el.value,
|
|
112
|
+
onChange: changeHandle,
|
|
113
|
+
height: pickerHeight,
|
|
114
|
+
fontSize: fontSize ?? 22,
|
|
115
|
+
textColor,
|
|
116
|
+
markColor,
|
|
117
|
+
markHeight,
|
|
118
|
+
markWidth: markWidth ?? 70,
|
|
119
|
+
type: el.name,
|
|
120
|
+
key: index
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
})
|
|
124
|
+
));
|
|
125
|
+
};
|
|
126
|
+
const styles = StyleSheet.create({
|
|
127
|
+
picker: {
|
|
128
|
+
flexDirection: "row",
|
|
129
|
+
width: "100%"
|
|
130
|
+
},
|
|
131
|
+
digit: {
|
|
132
|
+
fontSize: 20,
|
|
133
|
+
textAlign: "center"
|
|
134
|
+
},
|
|
135
|
+
gradient: {
|
|
136
|
+
position: "absolute",
|
|
137
|
+
width: "100%"
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
export { ScrollableSelector as default };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import React__default, { useRef, useEffect } from 'react';
|
|
2
|
+
import { TouchableOpacity, Text } from 'react-native';
|
|
3
|
+
import { Block, Mark, StyledScrollView } from '../styled.js';
|
|
4
|
+
import { format } from 'date-fns';
|
|
5
|
+
|
|
6
|
+
const DateBlock = ({
|
|
7
|
+
value,
|
|
8
|
+
digits,
|
|
9
|
+
type,
|
|
10
|
+
onChange,
|
|
11
|
+
height = 170,
|
|
12
|
+
fontSize,
|
|
13
|
+
textColor,
|
|
14
|
+
markColor,
|
|
15
|
+
markHeight,
|
|
16
|
+
markWidth,
|
|
17
|
+
TextComponent = Text,
|
|
18
|
+
locale
|
|
19
|
+
}) => {
|
|
20
|
+
const months = [...Array(12)].map(
|
|
21
|
+
(_, index) => format((/* @__PURE__ */ new Date()).setMonth(index), "MMM", { locale }).slice(
|
|
22
|
+
0,
|
|
23
|
+
3
|
|
24
|
+
)
|
|
25
|
+
);
|
|
26
|
+
const dHeight = Math.round(height / 4);
|
|
27
|
+
const mHeight = markHeight ?? Math.min(dHeight, 65);
|
|
28
|
+
const mWidth = markWidth ?? 70;
|
|
29
|
+
const offsets = digits.map((_, index) => index * dHeight);
|
|
30
|
+
const scrollRef = useRef(null);
|
|
31
|
+
const snapScrollToIndex = (index) => {
|
|
32
|
+
scrollRef?.current?.scrollTo({ y: dHeight * index, animated: true });
|
|
33
|
+
};
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
snapScrollToIndex(value - digits[0]);
|
|
36
|
+
}, [scrollRef.current]);
|
|
37
|
+
const handleMomentumScrollEnd = ({ nativeEvent }) => {
|
|
38
|
+
const digit = Math.round(nativeEvent.contentOffset.y / dHeight + digits[0]);
|
|
39
|
+
onChange(type, digit);
|
|
40
|
+
};
|
|
41
|
+
const getDisplayedValue = (granularity) => (value2) => {
|
|
42
|
+
if (granularity === "month") {
|
|
43
|
+
return months[value2 - 1];
|
|
44
|
+
} else {
|
|
45
|
+
return value2.toString().padStart(2, "0");
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
return /* @__PURE__ */ React__default.createElement(Block, null, /* @__PURE__ */ React__default.createElement(
|
|
49
|
+
Mark,
|
|
50
|
+
{
|
|
51
|
+
markTop: (height - mHeight) / 2,
|
|
52
|
+
markColor: markColor ?? "rgba(0, 0, 0, 0.05)",
|
|
53
|
+
markHeight: 24,
|
|
54
|
+
markWidth: mWidth
|
|
55
|
+
}
|
|
56
|
+
), /* @__PURE__ */ React__default.createElement(
|
|
57
|
+
StyledScrollView,
|
|
58
|
+
{
|
|
59
|
+
ref: scrollRef,
|
|
60
|
+
snapToOffsets: offsets,
|
|
61
|
+
decelerationRate: "fast",
|
|
62
|
+
showsVerticalScrollIndicator: false,
|
|
63
|
+
scrollEventThrottle: 0,
|
|
64
|
+
onMomentumScrollEnd: handleMomentumScrollEnd,
|
|
65
|
+
fadingEdgeLength: 300
|
|
66
|
+
},
|
|
67
|
+
digits.map((value2, index) => {
|
|
68
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
69
|
+
TouchableOpacity,
|
|
70
|
+
{
|
|
71
|
+
key: index,
|
|
72
|
+
onPress: () => {
|
|
73
|
+
onChange(type, digits[index]);
|
|
74
|
+
snapScrollToIndex(index);
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
/* @__PURE__ */ React__default.createElement(
|
|
78
|
+
TextComponent,
|
|
79
|
+
{
|
|
80
|
+
style: {
|
|
81
|
+
textAlign: "center",
|
|
82
|
+
fontSize: fontSize || 22,
|
|
83
|
+
color: textColor || "#000000",
|
|
84
|
+
marginBottom: index === digits.length - 1 ? height / 2 - dHeight / 2 : 0,
|
|
85
|
+
marginTop: index === 0 ? height / 2 - dHeight / 2 : 0,
|
|
86
|
+
lineHeight: dHeight,
|
|
87
|
+
height: dHeight
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
getDisplayedValue(type)(value2)
|
|
91
|
+
)
|
|
92
|
+
);
|
|
93
|
+
})
|
|
94
|
+
));
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export { DateBlock as default };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import styled from '@emotion/native';
|
|
2
|
+
import { ScrollView } from 'react-native';
|
|
3
|
+
|
|
4
|
+
styled.View`
|
|
5
|
+
flex-direction: row;
|
|
6
|
+
width: 100%;
|
|
7
|
+
`;
|
|
8
|
+
const Block = styled.View`
|
|
9
|
+
flex: 1;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
flex-direction: row;
|
|
13
|
+
height: 100%;
|
|
14
|
+
`;
|
|
15
|
+
const BlockLabels = styled.View`
|
|
16
|
+
flex-direction: row;
|
|
17
|
+
width: 100%;
|
|
18
|
+
justify-content: space-around;
|
|
19
|
+
margin-bottom: 10px;
|
|
20
|
+
`;
|
|
21
|
+
styled.ScrollView`
|
|
22
|
+
width: 100%;
|
|
23
|
+
`;
|
|
24
|
+
styled.Text`
|
|
25
|
+
font-size: ${({ fontSize }) => `${fontSize}px`};
|
|
26
|
+
text-align: center;
|
|
27
|
+
color: #000000;
|
|
28
|
+
margin-bottom: ${({ marginBottom }) => `${marginBottom}px`};
|
|
29
|
+
margin-top: ${({ marginTop }) => `${marginTop}px`};
|
|
30
|
+
line-height: ${({ lineHeight }) => `${lineHeight}px`};
|
|
31
|
+
height: ${({ height }) => `${height}px`};
|
|
32
|
+
`;
|
|
33
|
+
const Mark = styled.View`
|
|
34
|
+
position: absolute;
|
|
35
|
+
border-radius: 10px;
|
|
36
|
+
background-color: ${({ theme }) => theme.color.primary.light};
|
|
37
|
+
height: ${({ markHeight }) => `${markHeight}px`};
|
|
38
|
+
width: ${({ markWidth }) => `${markWidth}px`};
|
|
39
|
+
`;
|
|
40
|
+
const StyledScrollView = styled(ScrollView)`
|
|
41
|
+
width: 100%;
|
|
42
|
+
`;
|
|
43
|
+
|
|
44
|
+
export { Block, BlockLabels, Mark, StyledScrollView };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import styled, { css } from '@emotion/native';
|
|
2
|
-
import { disabledInputStyles,
|
|
2
|
+
import { disabledInputStyles, RFValueStr, PressableSurface, Icon, RFValue } from '@tecsinapse/react-core';
|
|
3
3
|
import { View, ActivityIndicator } from 'react-native';
|
|
4
|
-
import Input from '../../atoms/Input/Input.js';
|
|
5
4
|
import Text from '../../atoms/Text/Text.js';
|
|
6
5
|
|
|
7
6
|
const getStyledModal = (safeTop = 0) => {
|
|
@@ -17,15 +16,6 @@ const StyledSelectionText = styled(Text)(
|
|
|
17
16
|
${disabledInputStyles(props)};
|
|
18
17
|
`
|
|
19
18
|
);
|
|
20
|
-
styled(View)`
|
|
21
|
-
aspect-ratio: 1;
|
|
22
|
-
height: 100%;
|
|
23
|
-
`;
|
|
24
|
-
styled(
|
|
25
|
-
PressableSurface
|
|
26
|
-
)`
|
|
27
|
-
width: 100%;
|
|
28
|
-
`;
|
|
29
19
|
styled(View)`
|
|
30
20
|
position: relative;
|
|
31
21
|
width: 100%;
|
|
@@ -36,22 +26,17 @@ styled(View)`
|
|
|
36
26
|
padding: ${({ theme }) => theme.spacing.deca};
|
|
37
27
|
height: ${RFValueStr("75px")};
|
|
38
28
|
`;
|
|
39
|
-
styled(Button)`
|
|
40
|
-
aspect-ratio: 1;
|
|
41
|
-
height: 100%;
|
|
42
|
-
`;
|
|
43
29
|
const SearchBarContainer = styled(View)`
|
|
44
30
|
padding: ${({ theme }) => theme.spacing.deca};
|
|
45
31
|
position: relative;
|
|
46
32
|
`;
|
|
47
|
-
styled(Input)`
|
|
48
|
-
margin-bottom: ${({ theme }) => theme.spacing.deca};
|
|
49
|
-
`;
|
|
50
33
|
const ListItem = styled(PressableSurface)`
|
|
51
34
|
border-bottom-width: ${RFValueStr("1px")};
|
|
52
35
|
border-color: ${({ theme }) => theme.color.secondary.light};
|
|
53
|
-
padding-
|
|
54
|
-
padding-
|
|
36
|
+
padding-top: ${({ theme }) => theme.spacing.mili};
|
|
37
|
+
padding-bottom: ${({ theme }) => theme.spacing.mili};
|
|
38
|
+
padding-left: ${({ theme }) => theme.spacing.deca};
|
|
39
|
+
padding-right: ${({ theme }) => theme.spacing.deca};
|
|
55
40
|
`;
|
|
56
41
|
const ModalFooter = styled(View)`
|
|
57
42
|
width: 100%;
|
package/dist/esm/index.js
CHANGED
|
@@ -24,7 +24,7 @@ export { default as TextArea } from './components/atoms/TextArea/TextArea.js';
|
|
|
24
24
|
export { Calendar } from './components/molecules/Calendar/Calendar.js';
|
|
25
25
|
export { DatePicker } from './components/molecules/DatePicker/DatePicker.js';
|
|
26
26
|
export { DateTimePicker } from './components/molecules/DateTimePicker/DateTimePicker.js';
|
|
27
|
-
export {
|
|
27
|
+
export { default as DateTimePickerSelector } from './components/molecules/DateTimePickerSelector/DateTimePickerSelector.js';
|
|
28
28
|
export { default as IconTextButton } from './components/molecules/IconTextButton/IconTextButton.js';
|
|
29
29
|
export { default as InputPassword } from './components/molecules/InputPassword/InputPassword.js';
|
|
30
30
|
export { default as LabeledSwitch } from './components/molecules/LabeledSwitch/LabeledSwitch.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactElement } from
|
|
2
|
-
import { IBaseModal } from
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { IBaseModal } from './ui/types';
|
|
3
3
|
export declare const useLazyModalManager: (modalId?: string) => {
|
|
4
4
|
requestUpdate: () => void;
|
|
5
5
|
sync: (modal: ReactElement<IBaseModal>) => null;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DatePickerProps, SelectionType } from '@tecsinapse/react-core';
|
|
2
2
|
export type NativeDatePickerProps<T extends SelectionType> = Omit<DatePickerProps<T>, 'CalendarComponent' | 'renderCalendar' | 'requestCloseCalendar' | 'requestShowCalendar'>;
|
|
3
|
-
export declare const DatePicker: <T extends SelectionType>({ locale, onChange, ...rest }: NativeDatePickerProps<T>) => JSX.Element;
|
|
3
|
+
export declare const DatePicker: <T extends SelectionType>({ locale, onChange, value, type, ...rest }: NativeDatePickerProps<T>) => JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ControlledSelectorComponentProps, DateTimeSelectorProps } from '@tecsinapse/react-core';
|
|
3
|
+
type DateTimePickerSelectorProps = ControlledSelectorComponentProps & DateTimeSelectorProps;
|
|
4
|
+
declare const DateTimePickerSelector: React.FC<DateTimePickerSelectorProps>;
|
|
5
|
+
export default DateTimePickerSelector;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DateTimePickerSelector } from './DateTimePickerSelector';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Root: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
|
+
} & Partial<import("@tecsinapse/react-core").ThemeProviderProps>, {}, {
|
|
6
|
+
ref?: import("react").Ref<import("react-native").View> | undefined;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const Content: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
9
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
10
|
+
as?: import("react").ElementType<any> | undefined;
|
|
11
|
+
} & Partial<import("@tecsinapse/react-core").ThemeProviderProps>, {}, {
|
|
12
|
+
ref?: import("react").Ref<import("react-native").View> | undefined;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const BackButton: import("@emotion/native").StyledComponent<import("@tecsinapse/react-core").PressableSurfaceProps & {
|
|
15
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
16
|
+
as?: import("react").ElementType<any> | undefined;
|
|
17
|
+
} & Partial<import("@tecsinapse/react-core").ThemeProviderProps>, {}, {}>;
|
|
18
|
+
export declare const Header: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
19
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
20
|
+
as?: import("react").ElementType<any> | undefined;
|
|
21
|
+
} & Partial<import("@tecsinapse/react-core").ThemeProviderProps>, {}, {
|
|
22
|
+
ref?: import("react").Ref<import("react-native").View> | undefined;
|
|
23
|
+
}>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DateTimeSelectorProps } from '@tecsinapse/react-core';
|
|
3
|
+
export interface ScrollableSelectorProps extends DateTimeSelectorProps {
|
|
4
|
+
height?: number;
|
|
5
|
+
width?: number;
|
|
6
|
+
fontSize?: number;
|
|
7
|
+
textColor?: string;
|
|
8
|
+
startYear?: number;
|
|
9
|
+
endYear?: number;
|
|
10
|
+
markColor?: string;
|
|
11
|
+
markHeight?: number;
|
|
12
|
+
markWidth?: number;
|
|
13
|
+
}
|
|
14
|
+
declare const ScrollableSelector: React.FC<ScrollableSelectorProps>;
|
|
15
|
+
export default ScrollableSelector;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TextProps } from '@tecsinapse/react-core';
|
|
3
|
+
export interface DateBlockProps {
|
|
4
|
+
digits: number[];
|
|
5
|
+
locale?: Locale;
|
|
6
|
+
value: number;
|
|
7
|
+
date: Date;
|
|
8
|
+
type: string;
|
|
9
|
+
height: number;
|
|
10
|
+
fontSize?: number;
|
|
11
|
+
textColor?: string;
|
|
12
|
+
markColor?: string;
|
|
13
|
+
markHeight?: number;
|
|
14
|
+
markWidth?: number;
|
|
15
|
+
TextComponent?: React.FC<TextProps>;
|
|
16
|
+
onChange(type: string, digit: number): void;
|
|
17
|
+
}
|
|
18
|
+
declare const DateBlock: React.FC<DateBlockProps>;
|
|
19
|
+
export default DateBlock;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DateBlock } from './DateBlock';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ScrollableSelector } from './ScrollableSelector';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ScrollView } from 'react-native';
|
|
3
|
+
interface MarkProps {
|
|
4
|
+
markTop: number;
|
|
5
|
+
markColor: string;
|
|
6
|
+
markHeight: number;
|
|
7
|
+
markWidth: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const PickerContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
10
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
11
|
+
as?: import("react").ElementType<any> | undefined;
|
|
12
|
+
}, {}, {
|
|
13
|
+
ref?: import("react").Ref<import("react-native").View> | undefined;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const Block: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
16
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
17
|
+
as?: import("react").ElementType<any> | undefined;
|
|
18
|
+
}, {}, {
|
|
19
|
+
ref?: import("react").Ref<import("react-native").View> | undefined;
|
|
20
|
+
}>;
|
|
21
|
+
export declare const BlockLabels: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
22
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
23
|
+
as?: import("react").ElementType<any> | undefined;
|
|
24
|
+
}, {}, {
|
|
25
|
+
ref?: import("react").Ref<import("react-native").View> | undefined;
|
|
26
|
+
}>;
|
|
27
|
+
export declare const Scroll: import("@emotion/native").StyledComponent<import("react-native").ScrollViewProps & {
|
|
28
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
29
|
+
as?: import("react").ElementType<any> | undefined;
|
|
30
|
+
}, {}, {
|
|
31
|
+
ref?: import("react").Ref<ScrollView> | undefined;
|
|
32
|
+
}>;
|
|
33
|
+
export declare const DigitText: import("@emotion/native").StyledComponent<import("react-native").TextProps & {
|
|
34
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
35
|
+
as?: import("react").ElementType<any> | undefined;
|
|
36
|
+
} & {
|
|
37
|
+
fontSize: number;
|
|
38
|
+
marginBottom: number;
|
|
39
|
+
marginTop: number;
|
|
40
|
+
lineHeight: number;
|
|
41
|
+
height: number;
|
|
42
|
+
}, {}, {
|
|
43
|
+
ref?: import("react").Ref<import("react-native").Text> | undefined;
|
|
44
|
+
}>;
|
|
45
|
+
export declare const Mark: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
46
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
47
|
+
as?: import("react").ElementType<any> | undefined;
|
|
48
|
+
} & MarkProps & Partial<import("@tecsinapse/react-core").ThemeProviderProps>, {}, {
|
|
49
|
+
ref?: import("react").Ref<import("react-native").View> | undefined;
|
|
50
|
+
}>;
|
|
51
|
+
export declare const StyledScrollView: import("@emotion/native").StyledComponent<import("react-native").ScrollViewProps & {
|
|
52
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
53
|
+
as?: import("react").ElementType<any> | undefined;
|
|
54
|
+
}, {}, {
|
|
55
|
+
ref?: import("react").Ref<ScrollView> | undefined;
|
|
56
|
+
}>;
|
|
57
|
+
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { InputContainerProps, PressableSurfaceProps } from '@tecsinapse/react-core';
|
|
3
3
|
import { ActivityIndicator, View, ViewProps } from 'react-native';
|
|
4
|
-
import { InputNativeProps } from '../../atoms/Input';
|
|
5
4
|
export declare const getStyledModal: (safeTop?: number) => import("@emotion/native").StyledComponent<ViewProps & {
|
|
6
5
|
theme?: import("@emotion/react").Theme | undefined;
|
|
7
6
|
as?: import("react").ElementType<any> | undefined;
|
|
@@ -12,36 +11,18 @@ export declare const StyledSelectionText: import("@emotion/native").StyledCompon
|
|
|
12
11
|
theme?: import("@emotion/react").Theme | undefined;
|
|
13
12
|
as?: import("react").ElementType<any> | undefined;
|
|
14
13
|
} & Partial<InputContainerProps> & Partial<import("@tecsinapse/react-core").ThemeProviderProps>, {}, {}>;
|
|
15
|
-
export declare const Dummy: import("@emotion/native").StyledComponent<ViewProps & {
|
|
16
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
17
|
-
as?: import("react").ElementType<any> | undefined;
|
|
18
|
-
}, {}, {
|
|
19
|
-
ref?: import("react").Ref<View> | undefined;
|
|
20
|
-
}>;
|
|
21
|
-
export declare const StyledPressableSurface: import("@emotion/native").StyledComponent<PressableSurfaceProps & {
|
|
22
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
23
|
-
as?: import("react").ElementType<any> | undefined;
|
|
24
|
-
}, {}, {}>;
|
|
25
14
|
export declare const Header: import("@emotion/native").StyledComponent<ViewProps & {
|
|
26
15
|
theme?: import("@emotion/react").Theme | undefined;
|
|
27
16
|
as?: import("react").ElementType<any> | undefined;
|
|
28
17
|
} & Partial<import("@tecsinapse/react-core").ThemeProviderProps>, {}, {
|
|
29
18
|
ref?: import("react").Ref<View> | undefined;
|
|
30
19
|
}>;
|
|
31
|
-
export declare const CloseButton: import("@emotion/native").StyledComponent<ButtonProps & {
|
|
32
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
33
|
-
as?: import("react").ElementType<any> | undefined;
|
|
34
|
-
} & Partial<import("@tecsinapse/react-core").ThemeProviderProps>, {}, {}>;
|
|
35
20
|
export declare const SearchBarContainer: import("@emotion/native").StyledComponent<ViewProps & {
|
|
36
21
|
theme?: import("@emotion/react").Theme | undefined;
|
|
37
22
|
as?: import("react").ElementType<any> | undefined;
|
|
38
23
|
} & Partial<import("@tecsinapse/react-core").ThemeProviderProps>, {}, {
|
|
39
24
|
ref?: import("react").Ref<View> | undefined;
|
|
40
25
|
}>;
|
|
41
|
-
export declare const SearchBar: import("@emotion/native").StyledComponent<InputNativeProps & import("react").RefAttributes<import("react-native").TextInput> & {
|
|
42
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
43
|
-
as?: import("react").ElementType<any> | undefined;
|
|
44
|
-
} & Partial<import("@tecsinapse/react-core").ThemeProviderProps>, {}, {}>;
|
|
45
26
|
export declare const ListItem: import("@emotion/native").StyledComponent<PressableSurfaceProps & {
|
|
46
27
|
theme?: import("@emotion/react").Theme | undefined;
|
|
47
28
|
as?: import("react").ElementType<any> | undefined;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export { DatePicker } from './components/molecules/DatePicker';
|
|
|
30
30
|
export type { NativeDatePickerProps } from './components/molecules/DatePicker';
|
|
31
31
|
export { DateTimePicker } from './components/molecules/DateTimePicker';
|
|
32
32
|
export type { NativeDateTimePickerProps } from './components/molecules/DateTimePicker';
|
|
33
|
-
export {
|
|
33
|
+
export { DateTimePickerSelector } from './components/molecules/DateTimePickerSelector';
|
|
34
34
|
export { IconTextButton } from './components/molecules/IconTextButton';
|
|
35
35
|
export type { NativeIconTextButtonProps } from './components/molecules/IconTextButton';
|
|
36
36
|
export { InputPassword } from './components/molecules/InputPassword';
|