@tecsinapse/react-web-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/atoms/Button/styled.js +4 -4
- package/dist/cjs/components/atoms/Input/styled.js +2 -2
- package/dist/cjs/components/atoms/InputMask/styled.js +2 -2
- package/dist/cjs/components/atoms/Tooltip/styled.js +4 -1
- package/dist/cjs/components/molecules/DateTimePicker/DateTimePicker.js +8 -0
- package/dist/cjs/components/molecules/DateTimePickerSelector/DateTimePickerSelector.js +98 -0
- package/dist/cjs/components/molecules/DateTimePickerSelector/components/MemoizedTimeCard.js +22 -0
- package/dist/cjs/components/molecules/DateTimePickerSelector/components/ScrollableDigit.js +84 -0
- package/dist/cjs/components/molecules/DateTimePickerSelector/styled.js +54 -0
- package/dist/cjs/components/molecules/IconTextButton/styled.js +2 -2
- package/dist/cjs/components/molecules/LabeledSwitch/styled.js +4 -4
- package/dist/cjs/components/molecules/Menubar/MostUsed/styled.js +2 -2
- package/dist/cjs/components/molecules/Menubar/SearchResultItem/styled.js +2 -2
- package/dist/cjs/components/molecules/Menubar/styled.js +3 -3
- package/dist/cjs/components/molecules/ScrollableMonthYearPicker/ScrollableMonthYearPicker.js +86 -0
- package/dist/cjs/components/molecules/ScrollableMonthYearPicker/styled.js +18 -0
- package/dist/cjs/components/molecules/ScrollableTimePicker/ScrollableTimePicker.js +77 -0
- package/dist/cjs/components/molecules/ScrollableTimePicker/styled.js +18 -0
- package/dist/cjs/components/molecules/Select/Select.js +12 -1
- package/dist/cjs/components/molecules/Select/SelectItem/styled.js +1 -1
- package/dist/cjs/components/molecules/Snackbar/styled.js +5 -5
- package/dist/cjs/components/molecules/TextArea/styled.js +2 -2
- package/dist/cjs/components/organisms/DataGrid/Footer/styled.js +4 -4
- package/dist/esm/components/atoms/Accordion/Accordion.js +9 -9
- package/dist/esm/components/atoms/Badge/Badge.js +3 -3
- package/dist/esm/components/atoms/Button/Button.js +2 -2
- package/dist/esm/components/atoms/Button/styled.js +2 -2
- package/dist/esm/components/atoms/Dropdown/index.js +3 -3
- package/dist/esm/components/atoms/Input/Input.js +5 -5
- package/dist/esm/components/atoms/Input/styled.js +2 -2
- package/dist/esm/components/atoms/InputMask/InputMask.js +5 -5
- package/dist/esm/components/atoms/InputMask/styled.js +2 -2
- package/dist/esm/components/atoms/Modal/Modal.js +2 -2
- package/dist/esm/components/atoms/Overlay/Overlay.js +2 -2
- package/dist/esm/components/atoms/Skeleton/Skeleton.js +3 -3
- package/dist/esm/components/atoms/Switch/Switch.js +3 -3
- package/dist/esm/components/atoms/Table/Body/TBody.js +2 -2
- package/dist/esm/components/atoms/Table/Cell/Td.js +2 -2
- package/dist/esm/components/atoms/Table/Container/TableContainer.js +2 -2
- package/dist/esm/components/atoms/Table/Footer/TFoot.js +2 -2
- package/dist/esm/components/atoms/Table/Header/THead.js +2 -2
- package/dist/esm/components/atoms/Table/Header/Th.js +2 -2
- package/dist/esm/components/atoms/Table/Row/Tr.js +2 -2
- package/dist/esm/components/atoms/Table/Table.js +2 -2
- package/dist/esm/components/atoms/Table/Toolbar/TableToolbar.js +2 -2
- package/dist/esm/components/atoms/Tag/Tag.js +3 -3
- package/dist/esm/components/atoms/Tooltip/Tooltip.js +6 -6
- package/dist/esm/components/atoms/Tooltip/styled.js +4 -1
- package/dist/esm/components/molecules/Breadcrumbs/BreadcrumbItem/BreadcrumbItem.js +2 -2
- package/dist/esm/components/molecules/Breadcrumbs/Breadcrumbs.js +3 -3
- package/dist/esm/components/molecules/DatePicker/DatePicker.js +8 -8
- package/dist/esm/components/molecules/DateTimePicker/DateTimePicker.js +12 -4
- package/dist/esm/components/molecules/DateTimePickerSelector/DateTimePickerSelector.js +77 -0
- package/dist/esm/components/molecules/DateTimePickerSelector/components/MemoizedTimeCard.js +20 -0
- package/dist/esm/components/molecules/DateTimePickerSelector/components/ScrollableDigit.js +63 -0
- package/dist/esm/components/molecules/DateTimePickerSelector/styled.js +46 -0
- package/dist/esm/components/molecules/Drawer/Drawer.js +2 -2
- package/dist/esm/components/molecules/Grid/Grid.js +6 -6
- package/dist/esm/components/molecules/Grid/Item/Item.js +4 -4
- package/dist/esm/components/molecules/IconTextButton/IconTextButton.js +7 -7
- package/dist/esm/components/molecules/IconTextButton/TextComponent.js +4 -4
- package/dist/esm/components/molecules/IconTextButton/styled.js +2 -2
- package/dist/esm/components/molecules/InputPassword/InputPassword.js +4 -4
- package/dist/esm/components/molecules/LabeledSwitch/LabelComponent.js +3 -3
- package/dist/esm/components/molecules/LabeledSwitch/LabeledSwitch.js +5 -5
- package/dist/esm/components/molecules/LabeledSwitch/styled.js +2 -2
- package/dist/esm/components/molecules/Masonry/Masonry.js +6 -6
- package/dist/esm/components/molecules/Menubar/MenuBlock/MenuBlock.js +4 -4
- package/dist/esm/components/molecules/Menubar/MenuBlock/MenuItem/MenuItem.js +6 -6
- package/dist/esm/components/molecules/Menubar/MenuBlock/MenuItem/SubMenuBlock/SubMenuBlock.js +2 -2
- package/dist/esm/components/molecules/Menubar/Menubar.js +14 -14
- package/dist/esm/components/molecules/Menubar/MostUsed/MostUsed.js +5 -5
- package/dist/esm/components/molecules/Menubar/MostUsed/styled.js +2 -2
- package/dist/esm/components/molecules/Menubar/SearchResultItem/SearchResultItem.js +2 -2
- package/dist/esm/components/molecules/Menubar/SearchResultItem/styled.js +2 -2
- package/dist/esm/components/molecules/Menubar/SearchResultItem/utils.js +2 -2
- package/dist/esm/components/molecules/Menubar/styled.js +3 -3
- package/dist/esm/components/molecules/ScrollableMonthYearPicker/ScrollableMonthYearPicker.js +65 -0
- package/dist/esm/components/molecules/ScrollableMonthYearPicker/styled.js +15 -0
- package/dist/esm/components/molecules/ScrollableTimePicker/ScrollableTimePicker.js +56 -0
- package/dist/esm/components/molecules/ScrollableTimePicker/styled.js +15 -0
- package/dist/esm/components/molecules/Select/Dropdown/Dropdown.js +14 -14
- package/dist/esm/components/molecules/Select/Dropdown/components/SearchInput.js +4 -4
- package/dist/esm/components/molecules/Select/Select.js +22 -11
- package/dist/esm/components/molecules/Select/SelectItem/SelectItem.js +7 -7
- package/dist/esm/components/molecules/Select/SelectItem/styled.js +1 -1
- package/dist/esm/components/molecules/Select/styled.js +2 -2
- package/dist/esm/components/molecules/Snackbar/Snackbar.js +2 -2
- package/dist/esm/components/molecules/Snackbar/styled.js +2 -2
- package/dist/esm/components/molecules/TextArea/TextArea.js +3 -3
- package/dist/esm/components/molecules/TextArea/styled.js +2 -2
- package/dist/esm/components/organisms/DataGrid/DataGrid.js +9 -9
- package/dist/esm/components/organisms/DataGrid/Footer/Footer.js +12 -12
- package/dist/esm/components/organisms/DataGrid/Footer/styled.js +4 -4
- package/dist/esm/components/organisms/DataGrid/Header/Header.js +5 -5
- package/dist/esm/components/organisms/DataGrid/Row/Row.js +4 -4
- package/dist/esm/hooks/useClickAwayListener.js +2 -2
- package/dist/esm/hooks/useWindowSize.js +3 -3
- package/dist/types/components/molecules/DateTimePickerSelector/DateTimePickerSelector.d.ts +5 -0
- package/dist/types/components/molecules/DateTimePickerSelector/components/MemoizedTimeCard.d.ts +10 -0
- package/dist/types/components/molecules/DateTimePickerSelector/components/ScrollableDigit.d.ts +13 -0
- package/dist/types/components/molecules/DateTimePickerSelector/components/index.d.ts +2 -0
- package/dist/types/components/molecules/DateTimePickerSelector/index.d.ts +1 -0
- package/dist/types/components/molecules/DateTimePickerSelector/styled.d.ts +40 -0
- package/dist/types/components/molecules/ScrollableMonthYearPicker/ScrollableMonthYearPicker.d.ts +10 -0
- package/dist/types/components/molecules/ScrollableMonthYearPicker/index.d.ts +1 -0
- package/dist/types/components/molecules/ScrollableMonthYearPicker/styled.d.ts +9 -0
- package/dist/types/components/molecules/ScrollableTimePicker/ScrollableTimePicker.d.ts +10 -0
- package/dist/types/components/molecules/ScrollableTimePicker/index.d.ts +1 -0
- package/dist/types/components/molecules/ScrollableTimePicker/styled.d.ts +9 -0
- package/package.json +4 -4
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var styled = require('@emotion/native');
|
|
4
4
|
var reactCore = require('@tecsinapse/react-core');
|
|
5
5
|
|
|
6
6
|
const webStyles = () => {
|
|
7
|
-
return
|
|
7
|
+
return styled.css`
|
|
8
8
|
& * {
|
|
9
9
|
user-select: none;
|
|
10
10
|
}
|
|
@@ -21,11 +21,11 @@ const hoverStyles = ({
|
|
|
21
21
|
const variantColorGradation = reactCore.colorGradationVC[variant];
|
|
22
22
|
const variantBorderColor = reactCore.borderColorVC[variant];
|
|
23
23
|
const variantBorderColorGradation = reactCore.borderColorGradationVC[variant];
|
|
24
|
-
return mouseOver && !disabled && !pressed &&
|
|
24
|
+
return mouseOver && !disabled && !pressed && styled.css`
|
|
25
25
|
background-color: ${theme?.color[variantColor][variantColorGradation]};
|
|
26
26
|
border-color: ${theme?.color[variantBorderColor][variantBorderColorGradation]};
|
|
27
27
|
`;
|
|
28
28
|
};
|
|
29
|
-
const StyledWebButton =
|
|
29
|
+
const StyledWebButton = styled(reactCore.Button)(webStyles, hoverStyles);
|
|
30
30
|
|
|
31
31
|
exports.StyledWebButton = StyledWebButton;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var styled = require('@emotion/native');
|
|
4
4
|
var reactCore = require('@tecsinapse/react-core');
|
|
5
5
|
|
|
6
|
-
const StyledWebTextInput =
|
|
6
|
+
const StyledWebTextInput = styled(reactCore.InputElement)`
|
|
7
7
|
&:focus-visible {
|
|
8
8
|
outline-width: 0;
|
|
9
9
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var styled = require('@emotion/native');
|
|
4
4
|
var reactCore = require('@tecsinapse/react-core');
|
|
5
5
|
|
|
6
|
-
const StyledWebTextInputMask =
|
|
6
|
+
const StyledWebTextInputMask = styled(reactCore.InputMaskElement)`
|
|
7
7
|
&:focus-visible {
|
|
8
8
|
outline-width: 0;
|
|
9
9
|
}
|
|
@@ -71,7 +71,10 @@ const TooltipSpan = styled("span")(
|
|
|
71
71
|
border-radius: ${theme.borderRadius.mili};
|
|
72
72
|
opacity: 0;
|
|
73
73
|
visibility: hidden;
|
|
74
|
-
transition:
|
|
74
|
+
transition:
|
|
75
|
+
opacity 0.3s,
|
|
76
|
+
visibility 0.3s,
|
|
77
|
+
transform 0.3s;
|
|
75
78
|
background-color: ${theme.color.secondary.xdark};
|
|
76
79
|
z-index: ${theme.zIndex.absolute};
|
|
77
80
|
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var reactCore = require('@tecsinapse/react-core');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var index = require('../../atoms/Dropdown/index.js');
|
|
6
|
+
var DateTimePickerSelector = require('../DateTimePickerSelector/DateTimePickerSelector.js');
|
|
6
7
|
|
|
7
8
|
const DateTimePicker = ({ ...rest }) => {
|
|
8
9
|
const [visible, setVisible] = React.useState(false);
|
|
@@ -12,6 +13,13 @@ const DateTimePicker = ({ ...rest }) => {
|
|
|
12
13
|
reactCore.DateTimePicker,
|
|
13
14
|
{
|
|
14
15
|
...rest,
|
|
16
|
+
DateTimeSelectorComponent: (props) => /* @__PURE__ */ React.createElement(
|
|
17
|
+
reactCore.ControlledDateTimeSelector,
|
|
18
|
+
{
|
|
19
|
+
SelectorComponent: DateTimePickerSelector,
|
|
20
|
+
...props
|
|
21
|
+
}
|
|
22
|
+
),
|
|
15
23
|
requestShowSelector: show,
|
|
16
24
|
requestCloseSelector: close,
|
|
17
25
|
renderSelector: (selector) => /* @__PURE__ */ React.createElement(index.Dropdown, { visible, setVisible }, selector)
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var Button = require('../../atoms/Button/Button.js');
|
|
5
|
+
var reactCore = require('@tecsinapse/react-core');
|
|
6
|
+
var styled = require('./styled.js');
|
|
7
|
+
var ScrollableTimePicker = require('../ScrollableTimePicker/ScrollableTimePicker.js');
|
|
8
|
+
var ScrollableMonthYearPicker = require('../ScrollableMonthYearPicker/ScrollableMonthYearPicker.js');
|
|
9
|
+
|
|
10
|
+
function _interopNamespaceDefault(e) {
|
|
11
|
+
var n = Object.create(null);
|
|
12
|
+
if (e) {
|
|
13
|
+
Object.keys(e).forEach(function (k) {
|
|
14
|
+
if (k !== 'default') {
|
|
15
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return e[k]; }
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
n.default = e;
|
|
24
|
+
return Object.freeze(n);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
28
|
+
|
|
29
|
+
const DateTimePickerSelector = ({
|
|
30
|
+
TextComponent = reactCore.Text,
|
|
31
|
+
currentMode,
|
|
32
|
+
handlePressBack,
|
|
33
|
+
modalTitle,
|
|
34
|
+
isDate,
|
|
35
|
+
date,
|
|
36
|
+
handleCalendarChange,
|
|
37
|
+
isMonth,
|
|
38
|
+
setDate,
|
|
39
|
+
handlePressConfirm,
|
|
40
|
+
confirmButtonText,
|
|
41
|
+
locale,
|
|
42
|
+
yearLabel,
|
|
43
|
+
monthLabel,
|
|
44
|
+
hourLabel,
|
|
45
|
+
minuteLabel,
|
|
46
|
+
...rest
|
|
47
|
+
}) => {
|
|
48
|
+
return /* @__PURE__ */ React__namespace.createElement(styled.Root, { ...rest }, /* @__PURE__ */ React__namespace.createElement(styled.Header, null, currentMode === 1 && /* @__PURE__ */ React__namespace.createElement(styled.BackButton, { onPress: handlePressBack }, /* @__PURE__ */ React__namespace.createElement(
|
|
49
|
+
reactCore.Icon,
|
|
50
|
+
{
|
|
51
|
+
type: "material-community",
|
|
52
|
+
name: "chevron-left",
|
|
53
|
+
size: "mega",
|
|
54
|
+
colorVariant: "secondary"
|
|
55
|
+
}
|
|
56
|
+
)), /* @__PURE__ */ React__namespace.createElement(TextComponent, { typography: "base", colorVariant: "secondary" }, modalTitle)), isDate ? /* @__PURE__ */ React__namespace.createElement(
|
|
57
|
+
reactCore.Calendar,
|
|
58
|
+
{
|
|
59
|
+
type: "day",
|
|
60
|
+
value: date,
|
|
61
|
+
onChange: handleCalendarChange,
|
|
62
|
+
year: date.getFullYear(),
|
|
63
|
+
month: date.getMonth()
|
|
64
|
+
}
|
|
65
|
+
) : isMonth ? /* @__PURE__ */ React__namespace.createElement(styled.Content, { style: { flexDirection: "column" } }, /* @__PURE__ */ React__namespace.createElement(
|
|
66
|
+
styled.Content,
|
|
67
|
+
{
|
|
68
|
+
style: { width: "100%", flexDirection: "row", display: "flex" }
|
|
69
|
+
},
|
|
70
|
+
/* @__PURE__ */ React__namespace.createElement(
|
|
71
|
+
ScrollableMonthYearPicker,
|
|
72
|
+
{
|
|
73
|
+
setDate,
|
|
74
|
+
date,
|
|
75
|
+
locale,
|
|
76
|
+
yearLabel,
|
|
77
|
+
monthLabel
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
)) : /* @__PURE__ */ React__namespace.createElement(styled.Content, { style: { flexDirection: "column" } }, /* @__PURE__ */ React__namespace.createElement(
|
|
81
|
+
styled.Content,
|
|
82
|
+
{
|
|
83
|
+
style: { width: "100%", flexDirection: "row", display: "flex" }
|
|
84
|
+
},
|
|
85
|
+
/* @__PURE__ */ React__namespace.createElement(
|
|
86
|
+
ScrollableTimePicker,
|
|
87
|
+
{
|
|
88
|
+
setDate,
|
|
89
|
+
date,
|
|
90
|
+
locale,
|
|
91
|
+
hourLabel,
|
|
92
|
+
minuteLabel
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
)), /* @__PURE__ */ React__namespace.createElement(Button, { color: "primary", onPress: handlePressConfirm }, /* @__PURE__ */ React__namespace.createElement(TextComponent, { fontWeight: "bold", fontColor: "light" }, confirmButtonText || "OK")));
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
module.exports = DateTimePickerSelector;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var styled = require('../styled.js');
|
|
5
|
+
|
|
6
|
+
const MemoizedTimeCard = React.memo(
|
|
7
|
+
({
|
|
8
|
+
time,
|
|
9
|
+
isSelected,
|
|
10
|
+
onPress,
|
|
11
|
+
TextComponent
|
|
12
|
+
}) => /* @__PURE__ */ React.createElement(styled.TimeCard, { id: time, key: time, isSelected, onPress }, /* @__PURE__ */ React.createElement(
|
|
13
|
+
TextComponent,
|
|
14
|
+
{
|
|
15
|
+
colorVariant: isSelected ? "primary" : "secondary",
|
|
16
|
+
colorTone: "xdark"
|
|
17
|
+
},
|
|
18
|
+
time
|
|
19
|
+
))
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
module.exports = MemoizedTimeCard;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var Text = require('@tecsinapse/react-core/src/components/atoms/Text');
|
|
5
|
+
var reactCore = require('@tecsinapse/react-core');
|
|
6
|
+
var ResponsiveFontSize = require('@tecsinapse/react-core/src/utils/ResponsiveFontSize');
|
|
7
|
+
var styled = require('../styled.js');
|
|
8
|
+
var MemoizedTimeCard = require('./MemoizedTimeCard.js');
|
|
9
|
+
|
|
10
|
+
function _interopNamespaceDefault(e) {
|
|
11
|
+
var n = Object.create(null);
|
|
12
|
+
if (e) {
|
|
13
|
+
Object.keys(e).forEach(function (k) {
|
|
14
|
+
if (k !== 'default') {
|
|
15
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return e[k]; }
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
n.default = e;
|
|
24
|
+
return Object.freeze(n);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
28
|
+
|
|
29
|
+
const ScrollableDigit = ({
|
|
30
|
+
TextComponent = Text.Text,
|
|
31
|
+
data,
|
|
32
|
+
currentTime,
|
|
33
|
+
updateType,
|
|
34
|
+
timeLabel,
|
|
35
|
+
handleTimeChange,
|
|
36
|
+
initialScrollIndex
|
|
37
|
+
}) => {
|
|
38
|
+
const theme = reactCore.useTheme();
|
|
39
|
+
const digitCardHeight = ResponsiveFontSize.RFValue(Number(theme.typography.base.fontSize.slice(0, -2))) + 2 * ResponsiveFontSize.RFValue(Number(theme.spacing.deca.slice(0, -2)));
|
|
40
|
+
const getDisplayedValue = (value) => {
|
|
41
|
+
const isNumericValue = parseInt(value, 10);
|
|
42
|
+
if (!isNaN(isNumericValue)) {
|
|
43
|
+
return value.padStart(2, "0");
|
|
44
|
+
} else {
|
|
45
|
+
return value;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const timeCardsBuilder = React__namespace.useCallback(
|
|
49
|
+
({ item }) => /* @__PURE__ */ React__namespace.createElement(
|
|
50
|
+
MemoizedTimeCard,
|
|
51
|
+
{
|
|
52
|
+
time: getDisplayedValue(item),
|
|
53
|
+
isSelected: currentTime === item,
|
|
54
|
+
onPress: () => {
|
|
55
|
+
handleTimeChange(item, updateType);
|
|
56
|
+
},
|
|
57
|
+
TextComponent
|
|
58
|
+
}
|
|
59
|
+
),
|
|
60
|
+
[handleTimeChange, TextComponent]
|
|
61
|
+
);
|
|
62
|
+
return /* @__PURE__ */ React__namespace.createElement("div", { style: { display: "flex", flexDirection: "column" } }, /* @__PURE__ */ React__namespace.createElement(styled.StyledTextLabel, null, timeLabel), /* @__PURE__ */ React__namespace.createElement(
|
|
63
|
+
styled.TimeDigitContainer,
|
|
64
|
+
{
|
|
65
|
+
showsHorizontalScrollIndicator: true,
|
|
66
|
+
data,
|
|
67
|
+
renderItem: timeCardsBuilder,
|
|
68
|
+
keyExtractor: (item) => item,
|
|
69
|
+
contentContainerStyle: {
|
|
70
|
+
alignItems: "center"
|
|
71
|
+
},
|
|
72
|
+
numColumns: 1,
|
|
73
|
+
initialScrollIndex,
|
|
74
|
+
getItemLayout: (_, index) => ({
|
|
75
|
+
length: digitCardHeight,
|
|
76
|
+
offset: digitCardHeight * index,
|
|
77
|
+
index
|
|
78
|
+
}),
|
|
79
|
+
fadingEdgeLength: 200
|
|
80
|
+
}
|
|
81
|
+
));
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
module.exports = ScrollableDigit;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var styled = require('@emotion/native');
|
|
4
|
+
var reactCore = require('@tecsinapse/react-core');
|
|
5
|
+
var reactNativeWeb = require('react-native-web');
|
|
6
|
+
|
|
7
|
+
const StyledTextLabel = styled(reactCore.Text)`
|
|
8
|
+
text-align: center;
|
|
9
|
+
font-size: 12px;
|
|
10
|
+
font-weight: bold;
|
|
11
|
+
`;
|
|
12
|
+
const TimeDigitContainer = styled(reactNativeWeb.FlatList)`
|
|
13
|
+
max-height: 150px;
|
|
14
|
+
overflow-y: scroll;
|
|
15
|
+
`;
|
|
16
|
+
const TimeCard = styled(reactCore.PressableSurface)(
|
|
17
|
+
(props) => styled.css`
|
|
18
|
+
background-color: ${props.isSelected ? props.theme?.color.primary.light : void 0};
|
|
19
|
+
padding: ${props.theme?.spacing.centi};
|
|
20
|
+
border-radius: ${props.theme?.borderRadius.mili};
|
|
21
|
+
margin: ${props.theme?.spacing.mili};
|
|
22
|
+
padding: ${props.theme?.spacing.mili} ${props.theme?.spacing.deca};
|
|
23
|
+
`
|
|
24
|
+
);
|
|
25
|
+
const Root = styled.View`
|
|
26
|
+
position: relative;
|
|
27
|
+
background-color: ${({ theme }) => theme.miscellaneous.surfaceColor};
|
|
28
|
+
`;
|
|
29
|
+
const Content = styled.View`
|
|
30
|
+
flex-direction: row;
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
margin-top: ${({ theme }) => theme.spacing.deca};
|
|
33
|
+
margin-bottom: ${({ theme }) => theme.spacing.deca};
|
|
34
|
+
`;
|
|
35
|
+
const BackButton = styled(reactCore.PressableSurface)`
|
|
36
|
+
border-radius: ${({ theme }) => theme.borderRadius.mili};
|
|
37
|
+
padding: ${({ theme }) => theme.spacing.micro};
|
|
38
|
+
margin-right: ${({ theme }) => theme.spacing.mili};
|
|
39
|
+
aspect-ratio: 1;
|
|
40
|
+
`;
|
|
41
|
+
const Header = styled.View`
|
|
42
|
+
flex-direction: row;
|
|
43
|
+
align-items: center;
|
|
44
|
+
margin-top: ${({ theme }) => theme.spacing.mili};
|
|
45
|
+
margin-bottom: ${({ theme }) => theme.spacing.mili};
|
|
46
|
+
`;
|
|
47
|
+
|
|
48
|
+
exports.BackButton = BackButton;
|
|
49
|
+
exports.Content = Content;
|
|
50
|
+
exports.Header = Header;
|
|
51
|
+
exports.Root = Root;
|
|
52
|
+
exports.StyledTextLabel = StyledTextLabel;
|
|
53
|
+
exports.TimeCard = TimeCard;
|
|
54
|
+
exports.TimeDigitContainer = TimeDigitContainer;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var styled = require('@emotion/native');
|
|
4
4
|
var Button = require('../../atoms/Button/Button.js');
|
|
5
5
|
require('react');
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ const boxedStyle = ({ theme }) => `
|
|
|
8
8
|
padding: ${theme?.spacing.centi};
|
|
9
9
|
aspect-ratio: 1;
|
|
10
10
|
`;
|
|
11
|
-
const StyledIconTextButton =
|
|
11
|
+
const StyledIconTextButton = styled(Button)`
|
|
12
12
|
gap: ${({ theme }) => theme?.spacing.mili};
|
|
13
13
|
${({ boxed, theme }) => boxed && boxedStyle({ theme })};
|
|
14
14
|
`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var styled$1 = require('@emotion/native');
|
|
4
4
|
var styled = require('@emotion/styled');
|
|
5
5
|
var reactCore = require('@tecsinapse/react-core');
|
|
6
6
|
|
|
@@ -9,14 +9,14 @@ const StyledDiv = styled("div")`
|
|
|
9
9
|
flex-direction: row;
|
|
10
10
|
align-items: center;
|
|
11
11
|
`;
|
|
12
|
-
const StyledLabel =
|
|
12
|
+
const StyledLabel = styled$1(reactCore.Text)`
|
|
13
13
|
${({ theme, labelPosition }) => {
|
|
14
14
|
if (labelPosition === "right")
|
|
15
|
-
return
|
|
15
|
+
return styled$1.css`
|
|
16
16
|
margin-left: ${theme?.spacing.centi};
|
|
17
17
|
`;
|
|
18
18
|
else if (labelPosition === "left")
|
|
19
|
-
return
|
|
19
|
+
return styled$1.css`
|
|
20
20
|
margin-right: ${theme?.spacing.centi};
|
|
21
21
|
`;
|
|
22
22
|
}}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var styled = require('@emotion/styled');
|
|
4
4
|
var reactCore = require('@tecsinapse/react-core');
|
|
5
|
-
var
|
|
5
|
+
var styled$1 = require('@emotion/native');
|
|
6
6
|
|
|
7
7
|
const StyledCardContainer = styled("div")`
|
|
8
8
|
display: grid;
|
|
@@ -11,7 +11,7 @@ const StyledCardContainer = styled("div")`
|
|
|
11
11
|
margin-bottom: ${({ theme }) => theme.spacing.kilo};
|
|
12
12
|
margin-top: ${({ theme }) => theme.spacing.centi};
|
|
13
13
|
`;
|
|
14
|
-
const StyledCard =
|
|
14
|
+
const StyledCard = styled$1(reactCore.Card)`
|
|
15
15
|
padding-top: ${({ theme }) => theme.spacing.mili};
|
|
16
16
|
padding-bottom: ${({ theme }) => theme.spacing.mili};
|
|
17
17
|
padding-left: ${({ theme }) => theme.spacing.deca};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var styled = require('@emotion/styled');
|
|
4
|
-
var
|
|
4
|
+
var styled$1 = require('@emotion/native');
|
|
5
5
|
var reactCore = require('@tecsinapse/react-core');
|
|
6
6
|
|
|
7
7
|
const StyledSearchItemContainer = styled("div")`
|
|
@@ -13,7 +13,7 @@ const StyledSearchItemContainer = styled("div")`
|
|
|
13
13
|
0.05
|
|
14
14
|
)}`};
|
|
15
15
|
`;
|
|
16
|
-
const HighlightText =
|
|
16
|
+
const HighlightText = styled$1(reactCore.Text)`
|
|
17
17
|
text-decoration: underline;
|
|
18
18
|
text-decoration-color: ${({ theme }) => theme.font.color.orange};
|
|
19
19
|
`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var styled = require('@emotion/styled');
|
|
4
|
-
var
|
|
4
|
+
var styled$1 = require('@emotion/native');
|
|
5
5
|
var reactCore = require('@tecsinapse/react-core');
|
|
6
6
|
var Button = require('../../atoms/Button/Button.js');
|
|
7
7
|
require('react');
|
|
@@ -22,7 +22,7 @@ const StyledMenuBar = styled("div")`
|
|
|
22
22
|
padding: ${({ theme }) => `${theme.spacing.deca} ${theme.spacing.kilo}`};
|
|
23
23
|
box-shadow: 0px 2px 8px ${({ theme }) => reactCore.hex2rgba(theme.miscellaneous.shadow, 0.05)};
|
|
24
24
|
`;
|
|
25
|
-
const StyledMenuButton =
|
|
25
|
+
const StyledMenuButton = styled$1(Button)`
|
|
26
26
|
padding-top: calc(${({ theme }) => theme.spacing.centi} + 2px);
|
|
27
27
|
padding-right: calc(${({ theme }) => theme.spacing.centi} + 2px);
|
|
28
28
|
padding-bottom: calc(${({ theme }) => theme.spacing.centi} + 2px);
|
|
@@ -50,7 +50,7 @@ const StyledContainerOpenMenu = styled("div")`
|
|
|
50
50
|
width: -webkit-fill-available;
|
|
51
51
|
width: -moz-available;
|
|
52
52
|
`;
|
|
53
|
-
const StyledInput =
|
|
53
|
+
const StyledInput = styled$1(Input)`
|
|
54
54
|
width: 100%;
|
|
55
55
|
`;
|
|
56
56
|
const StyledInputContainer = styled("div")`
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var styled = require('./styled.js');
|
|
5
|
+
var ScrollableDigit = require('../DateTimePickerSelector/components/ScrollableDigit.js');
|
|
6
|
+
require('../DateTimePickerSelector/components/MemoizedTimeCard.js');
|
|
7
|
+
var dateFns = require('date-fns');
|
|
8
|
+
|
|
9
|
+
function _interopNamespaceDefault(e) {
|
|
10
|
+
var n = Object.create(null);
|
|
11
|
+
if (e) {
|
|
12
|
+
Object.keys(e).forEach(function (k) {
|
|
13
|
+
if (k !== 'default') {
|
|
14
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return e[k]; }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
n.default = e;
|
|
23
|
+
return Object.freeze(n);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
27
|
+
|
|
28
|
+
const ScrollableMonthYearPicker = ({
|
|
29
|
+
setDate,
|
|
30
|
+
date,
|
|
31
|
+
locale,
|
|
32
|
+
monthLabel,
|
|
33
|
+
yearLabel
|
|
34
|
+
}) => {
|
|
35
|
+
const handleMonthYearChange = (newTime, updateType) => {
|
|
36
|
+
const newDate = new Date(date);
|
|
37
|
+
if (updateType === "year") {
|
|
38
|
+
newDate.setFullYear(Number(newTime));
|
|
39
|
+
} else if (updateType === "month") {
|
|
40
|
+
newDate.setMonth(months.indexOf(newTime));
|
|
41
|
+
}
|
|
42
|
+
setDate(newDate);
|
|
43
|
+
};
|
|
44
|
+
const yearsToShow = 20;
|
|
45
|
+
const firstYear = (/* @__PURE__ */ new Date()).getFullYear() - 10;
|
|
46
|
+
const years = React__namespace.useMemo(
|
|
47
|
+
() => Array.from({ length: yearsToShow }, (_, i) => String(i + firstYear)),
|
|
48
|
+
[yearsToShow, firstYear]
|
|
49
|
+
);
|
|
50
|
+
const months = [...Array(12)].map(
|
|
51
|
+
(_, index) => dateFns.format((/* @__PURE__ */ new Date()).setMonth(index), "MMM", { locale }).slice(
|
|
52
|
+
0,
|
|
53
|
+
3
|
|
54
|
+
)
|
|
55
|
+
);
|
|
56
|
+
const getInitialScrollIndex = (value, data) => {
|
|
57
|
+
const selectedIndex = data.findIndex((item) => item === value);
|
|
58
|
+
return selectedIndex >= 0 ? selectedIndex : 0;
|
|
59
|
+
};
|
|
60
|
+
return /* @__PURE__ */ React__namespace.createElement(styled.DivStyledColumn, null, /* @__PURE__ */ React__namespace.createElement(styled.DivStyledRow, null, /* @__PURE__ */ React__namespace.createElement(
|
|
61
|
+
ScrollableDigit,
|
|
62
|
+
{
|
|
63
|
+
data: months,
|
|
64
|
+
timeLabel: monthLabel ?? "Month",
|
|
65
|
+
handleTimeChange: handleMonthYearChange,
|
|
66
|
+
initialScrollIndex: getInitialScrollIndex(
|
|
67
|
+
months[date.getMonth()],
|
|
68
|
+
months
|
|
69
|
+
),
|
|
70
|
+
updateType: "month",
|
|
71
|
+
currentTime: months[date.getMonth()]
|
|
72
|
+
}
|
|
73
|
+
), /* @__PURE__ */ React__namespace.createElement(
|
|
74
|
+
ScrollableDigit,
|
|
75
|
+
{
|
|
76
|
+
data: years,
|
|
77
|
+
timeLabel: yearLabel ?? "Year",
|
|
78
|
+
handleTimeChange: handleMonthYearChange,
|
|
79
|
+
initialScrollIndex: getInitialScrollIndex(date.getFullYear(), years),
|
|
80
|
+
updateType: "year",
|
|
81
|
+
currentTime: date?.getFullYear().toString()
|
|
82
|
+
}
|
|
83
|
+
)));
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
module.exports = ScrollableMonthYearPicker;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var styled = require('@emotion/styled');
|
|
4
|
+
|
|
5
|
+
const DivStyledColumn = styled("div")`
|
|
6
|
+
width: 100%;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
`;
|
|
10
|
+
const DivStyledRow = styled("div")`
|
|
11
|
+
width: 100%;
|
|
12
|
+
display: flex;
|
|
13
|
+
justify-content: space-between;
|
|
14
|
+
flex-direction: row;
|
|
15
|
+
`;
|
|
16
|
+
|
|
17
|
+
exports.DivStyledColumn = DivStyledColumn;
|
|
18
|
+
exports.DivStyledRow = DivStyledRow;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var ScrollableDigit = require('../DateTimePickerSelector/components/ScrollableDigit.js');
|
|
5
|
+
require('../DateTimePickerSelector/components/MemoizedTimeCard.js');
|
|
6
|
+
var styled = require('./styled.js');
|
|
7
|
+
|
|
8
|
+
function _interopNamespaceDefault(e) {
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n.default = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
26
|
+
|
|
27
|
+
const ScrollableTimePicker = ({
|
|
28
|
+
date,
|
|
29
|
+
setDate,
|
|
30
|
+
minuteLabel,
|
|
31
|
+
hourLabel
|
|
32
|
+
}) => {
|
|
33
|
+
const handleTimeChange = (newTime, updateType) => {
|
|
34
|
+
const newDate = new Date(date);
|
|
35
|
+
if (updateType === "hour") {
|
|
36
|
+
newDate.setHours(Number(newTime));
|
|
37
|
+
} else if (updateType === "minute") {
|
|
38
|
+
newDate.setMinutes(Number(newTime));
|
|
39
|
+
}
|
|
40
|
+
setDate(newDate);
|
|
41
|
+
};
|
|
42
|
+
const minutes = Array.from({ length: 60 }, (_, i) => String(i));
|
|
43
|
+
const hours = Array.from({ length: 24 }, (_, i) => String(i));
|
|
44
|
+
const getInitialScrollIndex = (value, data) => {
|
|
45
|
+
const selectedIndex = data.findIndex((item) => item === value);
|
|
46
|
+
return selectedIndex >= 0 ? selectedIndex : 0;
|
|
47
|
+
};
|
|
48
|
+
return /* @__PURE__ */ React__namespace.createElement(styled.DivStyledColumn, null, /* @__PURE__ */ React__namespace.createElement(styled.DivStyledRow, null, /* @__PURE__ */ React__namespace.createElement(
|
|
49
|
+
ScrollableDigit,
|
|
50
|
+
{
|
|
51
|
+
data: hours,
|
|
52
|
+
timeLabel: hourLabel ?? "Hour",
|
|
53
|
+
handleTimeChange,
|
|
54
|
+
currentTime: date?.getHours().toString(),
|
|
55
|
+
updateType: "hour",
|
|
56
|
+
initialScrollIndex: getInitialScrollIndex(
|
|
57
|
+
date.getHours().toString(),
|
|
58
|
+
hours
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
), /* @__PURE__ */ React__namespace.createElement(
|
|
62
|
+
ScrollableDigit,
|
|
63
|
+
{
|
|
64
|
+
data: minutes,
|
|
65
|
+
timeLabel: minuteLabel ?? "Minute",
|
|
66
|
+
updateType: "minute",
|
|
67
|
+
currentTime: date?.getMinutes().toString(),
|
|
68
|
+
handleTimeChange,
|
|
69
|
+
initialScrollIndex: getInitialScrollIndex(
|
|
70
|
+
date.getMinutes().toString(),
|
|
71
|
+
minutes
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
)));
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
module.exports = ScrollableTimePicker;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var styled = require('@emotion/styled');
|
|
4
|
+
|
|
5
|
+
const DivStyledColumn = styled("div")`
|
|
6
|
+
width: '100%';
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
`;
|
|
10
|
+
const DivStyledRow = styled("div")`
|
|
11
|
+
width: '100%';
|
|
12
|
+
display: flex;
|
|
13
|
+
justify-content: space-between;
|
|
14
|
+
flex-direction: row;
|
|
15
|
+
`;
|
|
16
|
+
|
|
17
|
+
exports.DivStyledColumn = DivStyledColumn;
|
|
18
|
+
exports.DivStyledRow = DivStyledRow;
|