@cashub/ui-elv 1.0.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/Tab/Tab.js +28 -0
- package/Tab/TabList.js +167 -0
- package/Tab/TabPanel.js +49 -0
- package/Tab/TabTab.js +105 -0
- package/Tab/index.js +30 -0
- package/Tab/subComponent/TabContext.js +9 -0
- package/Tab/subComponent/TabListV2.js +25 -0
- package/Tab/subComponent/TabPanelV2.js +52 -0
- package/Tab/subComponent/TabTabV2.js +63 -0
- package/VerticalTab/TabList.js +27 -0
- package/VerticalTab/TabPanel.js +52 -0
- package/VerticalTab/TabTab.js +70 -0
- package/VerticalTab/VerticalTab.js +41 -0
- package/VerticalTab/index.js +16 -0
- package/VerticalTab/subComponent/TabContext.js +9 -0
- package/alert/Alert.js +29 -0
- package/alert/index.js +13 -0
- package/animate/Collapse.js +71 -0
- package/animate/Loader.js +58 -0
- package/animate/NumberCounter.js +51 -0
- package/animate/PulseRing.js +35 -0
- package/animate/Spinner.js +18 -0
- package/animate/index.js +41 -0
- package/assets/css/autocomplete.css +16 -0
- package/assets/css/font.css +4 -0
- package/assets/css/global.css +2 -0
- package/assets/font/helvetica/Helvetica.ttf +0 -0
- package/assets/font/nanumGothic/NanumGothic-Bold.ttf +0 -0
- package/assets/font/nanumGothic/NanumGothic-ExtraBold.ttf +0 -0
- package/assets/font/nanumGothic/NanumGothic-Regular.ttf +0 -0
- package/assets/icons/app-management.png +0 -0
- package/assets/icons/burger-black.png +0 -0
- package/assets/icons/burger-white.png +0 -0
- package/assets/icons/burger.png +0 -0
- package/assets/icons/file.svg +1 -0
- package/assets/icons/map_icon1.png +0 -0
- package/assets/icons/map_icon4.png +0 -0
- package/assets/images/bg-aside.png +0 -0
- package/assets/images/bg-chart-circle.png +0 -0
- package/assets/images/bg-chart-triangle.png +0 -0
- package/assets/images/cashub-logo-only.png +0 -0
- package/assets/images/default-user.jpg +0 -0
- package/assets/images/logo-cashub.png +0 -0
- package/assets/images/map.png +0 -0
- package/assets/images/qrcode.png +0 -0
- package/backdrop/BaseBackdrop.js +18 -0
- package/backdrop/LoadingBackdrop.js +17 -0
- package/backdrop/ModalBackdrop.js +15 -0
- package/backdrop/index.js +27 -0
- package/badge/Badge.js +26 -0
- package/badge/BadgeDot.js +18 -0
- package/badge/BadgeFill.js +49 -0
- package/badge/BadgeFillTriangle.js +147 -0
- package/badge/BadgeWithText.js +31 -0
- package/badge/index.js +41 -0
- package/billing/BarChart.js +51 -0
- package/billing/Grid.js +45 -0
- package/billing/Header2.js +25 -0
- package/billing/Header3.js +37 -0
- package/billing/Paragraph.js +33 -0
- package/billing/ParagraphGroup.js +22 -0
- package/billing/ParagraphText.js +26 -0
- package/billing/Section.js +50 -0
- package/billing/SectionBody.js +17 -0
- package/billing/SectionHeader.js +26 -0
- package/billing/__stories__/BarChart.stories.js_bak +46 -0
- package/billing/__stories__/Grid.stories.js_bak +57 -0
- package/billing/__stories__/Header2.stories.js_bak +62 -0
- package/billing/__stories__/Header3.stories.js_bak +69 -0
- package/billing/__stories__/Paragraph.stories.js_bak +84 -0
- package/billing/__stories__/ParagraphGroup.stories.js_bak +68 -0
- package/billing/__stories__/ParagraphText.stories.js_bak +64 -0
- package/billing/__stories__/Section.stories.js_bak +115 -0
- package/billing/__stories__/SectionBody.stories.js_bak +62 -0
- package/billing/__stories__/SectionHeader.stories.js-bak +68 -0
- package/breadcrumb/Breadcrumb.js +78 -0
- package/breadcrumb/index.js +13 -0
- package/button/Button.js +154 -0
- package/button/ButtonGroup.js +61 -0
- package/button/IconButton.js +72 -0
- package/button/ScrollToTopButton.js +54 -0
- package/button/index.js +34 -0
- package/callout/Callout.js +52 -0
- package/callout/index.js +13 -0
- package/chart/BarChart.js +148 -0
- package/chart/DoughnutChart.js +118 -0
- package/chart/LineChart.js +146 -0
- package/chart/SingleBarChart.js +42 -0
- package/chart/index.js +52 -0
- package/chart/utils/centerTextPlugin.js +62 -0
- package/chart/utils/customTooltip.js +94 -0
- package/chart/utils/htmlLegendPlugin.js +89 -0
- package/chart/utils/index.js +27 -0
- package/chart/utils/padEmptyChartBar.js +53 -0
- package/chart/utils/yAxisTopTitlePlugin.js +49 -0
- package/container/FlexContainer.js +40 -0
- package/container/index.js +13 -0
- package/cropper/Cropper.js +54 -0
- package/cropper/CropperModalHandler.js +41 -0
- package/cropper/index.js +20 -0
- package/cropper/subComponent/CropImageModal.js +79 -0
- package/datetimePicker/DatePicker.js +363 -0
- package/datetimePicker/DatePickerV2.js +407 -0
- package/datetimePicker/DatetimePicker.js +240 -0
- package/datetimePicker/DatetimePickerV2.js +395 -0
- package/datetimePicker/DatetimePickerV3.js +279 -0
- package/datetimePicker/TimeInput.js +56 -0
- package/datetimePicker/TimePicker.js +317 -0
- package/datetimePicker/TimePickerStyle.js +64 -0
- package/datetimePicker/TimePickerV2.js +208 -0
- package/datetimePicker/accordion/Month.js +254 -0
- package/datetimePicker/accordion/Year.js +284 -0
- package/datetimePicker/hooks/index.js +27 -0
- package/datetimePicker/hooks/useChangeNumber.js +42 -0
- package/datetimePicker/hooks/useDecrease.js +38 -0
- package/datetimePicker/hooks/useIncrease.js +38 -0
- package/datetimePicker/index.js +69 -0
- package/datetimePicker/provider/constant.js +43 -0
- package/datetimePicker/subComponent/Accordion.js +373 -0
- package/datetimePicker/subComponent/CustomTimeInput.js +47 -0
- package/datetimePicker/subComponent/DateTimePickerContext.js +9 -0
- package/datetimePicker/utils/GMTDate.js +15 -0
- package/datetimePicker/utils/pad.js +13 -0
- package/datetimePicker/utils/toUTC0.js +13 -0
- package/descriptionList/DescriptionDetail.js +28 -0
- package/descriptionList/DescriptionList.js +25 -0
- package/descriptionList/DescriptionTerm.js +14 -0
- package/descriptionList/index.js +27 -0
- package/divider/Divider.js +31 -0
- package/divider/index.js +13 -0
- package/dropdown/Dropdown.js +55 -0
- package/dropdown/DropdownButtonOption.js +43 -0
- package/dropdown/DropdownContent.js +90 -0
- package/dropdown/DropdownDivOption.js +26 -0
- package/dropdown/DropdownItem.js +26 -0
- package/dropdown/DropdownLinkOption.js +24 -0
- package/dropdown/DropdownToggle.js +38 -0
- package/dropdown/index.js +42 -0
- package/dropdown/subComponent/DropdownContext.js +9 -0
- package/dropzone/FileDropzone.js +479 -0
- package/dropzone/ImageDropzone.js +334 -0
- package/dropzone/index.js +20 -0
- package/dropzone/subComponent/Message.js +26 -0
- package/figure/IconFigure.js +42 -0
- package/figure/ImageFigure.js +38 -0
- package/figure/index.js +20 -0
- package/file/HiddenFileInput.js +15 -0
- package/file/index.js +13 -0
- package/form/Checkbox.js +166 -0
- package/form/Fieldset.js +18 -0
- package/form/FormItem.js +22 -0
- package/form/Input.js +66 -0
- package/form/Label.js +61 -0
- package/form/MutedText.js +21 -0
- package/form/PasswordInput.js +47 -0
- package/form/RadioButton.js +103 -0
- package/form/SearchSelect.js +181 -0
- package/form/Searchbox.js +98 -0
- package/form/Slider.js +46 -0
- package/form/SwitchButton.js +105 -0
- package/form/Textarea.js +41 -0
- package/form/TreeView.js +73 -0
- package/form/index.js +104 -0
- package/grid/Column.js +46 -0
- package/grid/Grid.js +35 -0
- package/grid/index.js +20 -0
- package/heading/Heading1.js +21 -0
- package/heading/Heading2.js +28 -0
- package/heading/Heading3.js +49 -0
- package/heading/index.js +27 -0
- package/helmet/Helmet.js +23 -0
- package/helmet/index.js +20 -0
- package/iconbox/ApplicationIconBox.js +81 -0
- package/iconbox/IconBox.js +67 -0
- package/iconbox/IconBoxV2.js +72 -0
- package/iconbox/index.js +27 -0
- package/iconbox/subComponent/IconBoxFigure.js +50 -0
- package/iconbox/subComponent/IconBoxImage.js +42 -0
- package/image/ImageFluid.js +17 -0
- package/image/UploadImage.js +250 -0
- package/image/index.js +20 -0
- package/index.js +568 -0
- package/jsoneditor/JsonEditor.js +142 -0
- package/jsoneditor/index.js +13 -0
- package/keyframe/Pulse.js +21 -0
- package/keyframe/Spin.js +13 -0
- package/layout/Aside.js +48 -0
- package/layout/AsideHeader.jsx +27 -0
- package/layout/Backdrop.js +23 -0
- package/layout/Container.js +39 -0
- package/layout/Footer.js +45 -0
- package/layout/Header.jsx +55 -0
- package/layout/Layout.jsx +84 -0
- package/layout/Logo.jsx +17 -0
- package/layout/MenuIcon.jsx +27 -0
- package/layout/Sidebar.jsx +271 -0
- package/layout/index.js +13 -0
- package/link/LinkSpan.js +69 -0
- package/link/index.js +13 -0
- package/map/GoogleMap.js +448 -0
- package/map/GoogleReverseGeolocation.js +200 -0
- package/map/LeafletMap.js +231 -0
- package/map/LeafletReverseGeolocation.js +101 -0
- package/map/index.js +34 -0
- package/map/subComponent/BasicLeafletMap.js +34 -0
- package/map/subComponent/GoogleMapContainer.js +29 -0
- package/map/subComponent/GoogleMapPopup.js +109 -0
- package/map/subComponent/GoogleMapWrapper.js +40 -0
- package/map/subComponent/LeafletDrawControl.js +127 -0
- package/map/subComponent/LeafletMapContainer.js +173 -0
- package/map/subComponent/MapSearchBoxControl.js +54 -0
- package/modal/StateModal.js +178 -0
- package/modal/TitleModal.js +250 -0
- package/modal/index.js +20 -0
- package/package.json +54 -0
- package/page/Disclaimer.js +128 -0
- package/page/index.js +13 -0
- package/paginate/Paginate.js +137 -0
- package/paginate/index.js +13 -0
- package/popover/Popover.js +91 -0
- package/popover/index.js +13 -0
- package/qrcode/QRCode.js +58 -0
- package/qrcode/QRCodeContainter.js +34 -0
- package/qrcode/index.js +20 -0
- package/ribbon/Ribbon.js +42 -0
- package/ribbon/index.js +13 -0
- package/section/Section.js +133 -0
- package/section/SectionBody.js +52 -0
- package/section/SectionHeader.js +70 -0
- package/section/SectionToolbar.js +18 -0
- package/section/SectionToolbarItem.js +17 -0
- package/section/index.js +41 -0
- package/select/InputSelect.js +270 -0
- package/select/Select.js +818 -0
- package/select/index.js +20 -0
- package/select/subComponent/Checkbox.js +48 -0
- package/select/subComponent/Footer.js +13 -0
- package/select/subComponent/ListBox.js +30 -0
- package/select/subComponent/Option.js +45 -0
- package/select/subComponent/OptionGroup.js +23 -0
- package/select/subComponent/Options.js +32 -0
- package/select/subComponent/SearchBox.js +58 -0
- package/select/subComponent/SelectedMultipleCount.js +39 -0
- package/select/subComponent/SelectedMultipleTags.js +54 -0
- package/select/subComponent/SelectedMultipleText.js +70 -0
- package/select/subComponent/SelectedSingle.js +17 -0
- package/styles/GlobalStyle.js +334 -0
- package/styles/config/breakpoint.style.js +13 -0
- package/styles/config/header.style.js +10 -0
- package/styles/config/sidebar.style.js +17 -0
- package/styles/index.js +20 -0
- package/styles/mixin/backgroundColor.js +44 -0
- package/styles/mixin/borderColor.js +37 -0
- package/styles/mixin/color.js +37 -0
- package/styles/mixin/colorOnBackground.js +37 -0
- package/styles/mixin/inputPlaceholder.js +30 -0
- package/styles/mixin/media.js +21 -0
- package/styles/mixin/rounded.js +30 -0
- package/styles/mixin/scrollbar.js +32 -0
- package/styles/theme/dark.theme.js +97 -0
- package/styles/theme/light.theme.js +97 -0
- package/styles/theme/white.theme.js +97 -0
- package/styles/themes.js +16 -0
- package/table/GridTable.js +336 -0
- package/table/ImageBox.js +45 -0
- package/table/InfiniteGridTable.js +403 -0
- package/table/PermissionTable.js +64 -0
- package/table/SimpleGridTable.js +143 -0
- package/table/Table.js +568 -0
- package/table/__mock__/columns.js +70 -0
- package/table/__mock__/data.js +536 -0
- package/table/hooks/index.js +20 -0
- package/table/hooks/useCalculateDataRange.js +28 -0
- package/table/hooks/useGenerateSort.js +39 -0
- package/table/index.js +48 -0
- package/table/subComponent/BaseTableHeadCell.js +62 -0
- package/table/subComponent/GridTableFooter.js +24 -0
- package/table/subComponent/GridTableHeadCell.js +20 -0
- package/table/subComponent/Resizer.js +77 -0
- package/table/subComponent/TableFooter.js +31 -0
- package/table/subComponent/TableFooterInfo.js +13 -0
- package/table/subComponent/TableFooterPager.js +33 -0
- package/table/subComponent/TableHeadCell.js +19 -0
- package/table/subComponent/TableSort.js +38 -0
- package/tagify/TagifyStyle.js +60 -0
- package/tagify/Tags.js +56 -0
- package/tagify/index.js +27 -0
- package/tagify/templates/getCreateButtonTemplate.js +18 -0
- package/text/Paragraph.js +86 -0
- package/text/index.js +13 -0
- package/timeline/Timeline.js +139 -0
- package/timeline/index.js +13 -0
- package/toast/CustomToastContainer.js +45 -0
- package/toast/MessageContainer.js +51 -0
- package/toast/index.js +36 -0
- package/toast/show.js +39 -0
- package/toast/style.css +1 -0
- package/tooltip/Tooltip.js +140 -0
- package/tooltip/index.js +13 -0
- package/treeView/TreeViewV2.js +38 -0
- package/treeView/TreeflexStyle.js +49 -0
- package/treeView/index.js +20 -0
- package/wizard/Wizard.js +251 -0
- package/wizard/index.js +13 -0
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactI18next = require("react-i18next");
|
|
9
|
+
var _reactOutsideClickHandler = _interopRequireDefault(require("react-outside-click-handler"));
|
|
10
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
11
|
+
var _md = require("react-icons/md");
|
|
12
|
+
var _hooks = require("@cashub/hooks");
|
|
13
|
+
var _utils = require("@cashub/utils");
|
|
14
|
+
var _Button = _interopRequireDefault(require("../button/Button"));
|
|
15
|
+
var _Input = _interopRequireDefault(require("../form/Input"));
|
|
16
|
+
var _Month = _interopRequireDefault(require("./accordion/Month"));
|
|
17
|
+
var _Year = _interopRequireDefault(require("./accordion/Year"));
|
|
18
|
+
var _DateTimePickerContext = _interopRequireDefault(require("./subComponent/DateTimePickerContext"));
|
|
19
|
+
var _toUTC = _interopRequireDefault(require("./utils/toUTC0"));
|
|
20
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
22
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
23
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
24
|
+
const DEFAULT_TIME = '00:00:00';
|
|
25
|
+
const DatePickerV2 = _ref => {
|
|
26
|
+
let {
|
|
27
|
+
selected,
|
|
28
|
+
fixedYear,
|
|
29
|
+
allowClear,
|
|
30
|
+
minDate,
|
|
31
|
+
maxDate,
|
|
32
|
+
onConfirm,
|
|
33
|
+
disabled
|
|
34
|
+
} = _ref;
|
|
35
|
+
const {
|
|
36
|
+
t
|
|
37
|
+
} = (0, _reactI18next.useTranslation)();
|
|
38
|
+
const [toggleElement, setToggleElement] = (0, _react.useState)(null);
|
|
39
|
+
const [contentElement, setContentElement] = (0, _react.useState)(null);
|
|
40
|
+
const [selectedDate, setSelectedDate] = (0, _react.useState)(() => {
|
|
41
|
+
const defaultDate = selected ? new Date(selected) : new Date();
|
|
42
|
+
return `${(0, _utils.formatDate)((0, _toUTC.default)(defaultDate), 'date')} ${DEFAULT_TIME}`;
|
|
43
|
+
});
|
|
44
|
+
const [confirmDate, setConfirmDate] = (0, _react.useState)(selected ? (0, _utils.formatDate)((0, _toUTC.default)(selected), 'date') : '');
|
|
45
|
+
const [displayPicker, setDisplayPicker] = (0, _react.useState)(false);
|
|
46
|
+
const [accordionCurrentDisplayType, setAccordionCurrentDisplayType] = (0, _react.useState)(null);
|
|
47
|
+
const weeks = (0, _react.useMemo)(() => {
|
|
48
|
+
return ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'].map(week => /*#__PURE__*/(0, _jsxRuntime.jsx)(Week, {
|
|
49
|
+
children: week
|
|
50
|
+
}, week));
|
|
51
|
+
}, []);
|
|
52
|
+
const minDateWithTime = (0, _react.useMemo)(() => {
|
|
53
|
+
if (!minDate) return;
|
|
54
|
+
return `${minDate} 00:00:00`;
|
|
55
|
+
}, [minDate]);
|
|
56
|
+
const maxDateWithTime = (0, _react.useMemo)(() => {
|
|
57
|
+
if (!maxDate) return;
|
|
58
|
+
return `${maxDate} 00:00:00`;
|
|
59
|
+
}, [maxDate]);
|
|
60
|
+
const {
|
|
61
|
+
styles,
|
|
62
|
+
attributes,
|
|
63
|
+
state,
|
|
64
|
+
update
|
|
65
|
+
} = (0, _hooks.useCustomPopper)(toggleElement, contentElement, {
|
|
66
|
+
strategy: 'absolute',
|
|
67
|
+
placement: 'bottom-start'
|
|
68
|
+
});
|
|
69
|
+
const context = {
|
|
70
|
+
fixedYear,
|
|
71
|
+
minDate: minDateWithTime,
|
|
72
|
+
maxDate: maxDateWithTime,
|
|
73
|
+
selectedDate,
|
|
74
|
+
setSelectedDate,
|
|
75
|
+
setAccordionCurrentDisplayType
|
|
76
|
+
};
|
|
77
|
+
const handleToggle = () => {
|
|
78
|
+
setDisplayPicker(!displayPicker);
|
|
79
|
+
update();
|
|
80
|
+
};
|
|
81
|
+
const changeDisplayAccordion = (0, _react.useCallback)(type => {
|
|
82
|
+
if (accordionCurrentDisplayType === type) {
|
|
83
|
+
setAccordionCurrentDisplayType(null);
|
|
84
|
+
} else {
|
|
85
|
+
setAccordionCurrentDisplayType(type);
|
|
86
|
+
}
|
|
87
|
+
}, [accordionCurrentDisplayType]);
|
|
88
|
+
const handleConfirm = (0, _react.useCallback)(() => {
|
|
89
|
+
if (confirmDate) {
|
|
90
|
+
onConfirm(confirmDate);
|
|
91
|
+
}
|
|
92
|
+
setDisplayPicker(false);
|
|
93
|
+
setAccordionCurrentDisplayType(null);
|
|
94
|
+
}, [confirmDate, onConfirm]);
|
|
95
|
+
const handleChangeDate = (0, _react.useCallback)((daysOfMonthForSelectedDate, firstWeekOfMonth, dayIndex, day) => {
|
|
96
|
+
const date = new Date(selectedDate);
|
|
97
|
+
// 先把日期設定成所有月分都有的日期,設定月份時才不會設定到非預期的date
|
|
98
|
+
date.setDate(1);
|
|
99
|
+
const selectedYear = date.getFullYear();
|
|
100
|
+
const selectedMonth = date.getMonth();
|
|
101
|
+
if (!fixedYear) {
|
|
102
|
+
if (dayIndex < firstWeekOfMonth && selectedYear >= 1) {
|
|
103
|
+
if (selectedMonth === 0) {
|
|
104
|
+
date.setFullYear(selectedYear - 1);
|
|
105
|
+
date.setMonth(11);
|
|
106
|
+
} else {
|
|
107
|
+
date.setMonth(selectedMonth - 1);
|
|
108
|
+
}
|
|
109
|
+
} else if (dayIndex >= daysOfMonthForSelectedDate + firstWeekOfMonth) {
|
|
110
|
+
if (selectedMonth === 11) {
|
|
111
|
+
date.setFullYear(selectedYear + 1);
|
|
112
|
+
date.setMonth(0);
|
|
113
|
+
} else {
|
|
114
|
+
date.setMonth(selectedMonth + 1);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
date.setDate(day);
|
|
118
|
+
} else if (fixedYear) {
|
|
119
|
+
if (dayIndex < firstWeekOfMonth) {
|
|
120
|
+
if (selectedMonth === 0) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
date.setMonth(selectedMonth - 1);
|
|
124
|
+
} else if (dayIndex >= daysOfMonthForSelectedDate + firstWeekOfMonth) {
|
|
125
|
+
if (selectedMonth === 11) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
date.setMonth(selectedMonth + 1);
|
|
129
|
+
}
|
|
130
|
+
date.setDate(day);
|
|
131
|
+
}
|
|
132
|
+
const formattedDate = (0, _utils.formatDate)(date, 'date');
|
|
133
|
+
setSelectedDate(`${formattedDate} ${DEFAULT_TIME}`);
|
|
134
|
+
setConfirmDate(formattedDate);
|
|
135
|
+
}, [fixedYear, selectedDate]);
|
|
136
|
+
const handleDisabled = (0, _react.useCallback)((firstDayOfMonth, lastDayOfMonth, daysOfMonthForSelectedDate, dayIndex, day) => {
|
|
137
|
+
let [year, month] = selectedDate.split('-');
|
|
138
|
+
|
|
139
|
+
// disabled date before first month of first year
|
|
140
|
+
if (year === '0001' && month === '01' && dayIndex < firstDayOfMonth) {
|
|
141
|
+
return true;
|
|
142
|
+
}
|
|
143
|
+
let myDay = day.toString();
|
|
144
|
+
if (myDay.length === 1) myDay = `0${myDay}`;
|
|
145
|
+
if (fixedYear) {
|
|
146
|
+
if (month === '01') {
|
|
147
|
+
// disabled date before first month
|
|
148
|
+
return dayIndex < firstDayOfMonth;
|
|
149
|
+
} else if (month === '12') {
|
|
150
|
+
// disabled date in december
|
|
151
|
+
return dayIndex >= daysOfMonthForSelectedDate + firstDayOfMonth;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// previous year's date
|
|
156
|
+
if (month === '01' && firstDayOfMonth !== 0 && dayIndex + 1 <= firstDayOfMonth) {
|
|
157
|
+
year = +year - 1;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// next year's date
|
|
161
|
+
if (month === '12' && lastDayOfMonth !== 6 && day + firstDayOfMonth < dayIndex + 1) {
|
|
162
|
+
year = +year + 1;
|
|
163
|
+
}
|
|
164
|
+
month = firstDayOfMonth >= dayIndex + 1 ? +month - 1 : daysOfMonthForSelectedDate + firstDayOfMonth < dayIndex + 1 ? +month + 1 : +month;
|
|
165
|
+
if (month < 1) {
|
|
166
|
+
month = 12;
|
|
167
|
+
} else if (month > 12) {
|
|
168
|
+
month = 1;
|
|
169
|
+
}
|
|
170
|
+
month = month.toString();
|
|
171
|
+
if (month.length === 1) {
|
|
172
|
+
month = `0${month}`;
|
|
173
|
+
}
|
|
174
|
+
year = year.toString();
|
|
175
|
+
if (year.length === 1) year = `000${year}`;
|
|
176
|
+
if (year.length === 2) year = `00${year}`;
|
|
177
|
+
if (year.length === 3) year = `0${year}`;
|
|
178
|
+
const currentDate = `${year}-${month}-${myDay} ${DEFAULT_TIME}`;
|
|
179
|
+
if (minDateWithTime && currentDate < minDateWithTime) {
|
|
180
|
+
return true;
|
|
181
|
+
}
|
|
182
|
+
if (maxDateWithTime && currentDate > maxDateWithTime) {
|
|
183
|
+
return true;
|
|
184
|
+
}
|
|
185
|
+
return false;
|
|
186
|
+
}, [fixedYear, minDateWithTime, maxDateWithTime, selectedDate]);
|
|
187
|
+
const isSelectedDay = (0, _react.useCallback)((day, index, firstDayOfMonth, daysOfMonthForSelectedDate) => {
|
|
188
|
+
const selectedDateObj = new Date(selectedDate);
|
|
189
|
+
const confirmDateObj = (0, _toUTC.default)(new Date(confirmDate));
|
|
190
|
+
if (confirmDateObj.getFullYear() === selectedDateObj.getFullYear() && confirmDateObj.getMonth() === selectedDateObj.getMonth() && confirmDateObj.getDate() === day) {
|
|
191
|
+
if (index + 1 > firstDayOfMonth && index < daysOfMonthForSelectedDate + firstDayOfMonth) {
|
|
192
|
+
return true;
|
|
193
|
+
}
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
return false;
|
|
197
|
+
}, [selectedDate, confirmDate]);
|
|
198
|
+
const getLastDateOfMonth = selectedDate => {
|
|
199
|
+
const date = new Date(selectedDate);
|
|
200
|
+
|
|
201
|
+
// 先把日期設定成所有月分都有的日期,設定月份時才不會設定到非預期的date
|
|
202
|
+
date.setDate(1);
|
|
203
|
+
date.setMonth(date.getMonth() + 1);
|
|
204
|
+
date.setDate(0);
|
|
205
|
+
return date;
|
|
206
|
+
};
|
|
207
|
+
const days = (0, _react.useMemo)(() => {
|
|
208
|
+
const lastDateOfSelectedDate = getLastDateOfMonth(selectedDate);
|
|
209
|
+
const daysOfMonthForSelectedDate = lastDateOfSelectedDate.getDate();
|
|
210
|
+
const lastDayOfMonth = lastDateOfSelectedDate.getDay();
|
|
211
|
+
let date = new Date(selectedDate);
|
|
212
|
+
date.setMonth(date.getMonth() + 1 - 1);
|
|
213
|
+
date.setDate(0);
|
|
214
|
+
const daysOfPrevioueMonthForSelectedDate = date.getDate();
|
|
215
|
+
date = new Date(selectedDate);
|
|
216
|
+
// 先把日期設定成所有月分都有的日期,設定月份時才不會設定到非預期的date
|
|
217
|
+
date.setDate(1);
|
|
218
|
+
const firstDayOfMonth = date.getDay();
|
|
219
|
+
const days = [...Array(daysOfMonthForSelectedDate)].map((value, index) => {
|
|
220
|
+
return index + 1;
|
|
221
|
+
});
|
|
222
|
+
if (firstDayOfMonth !== 0) {
|
|
223
|
+
for (let index = daysOfPrevioueMonthForSelectedDate; index > daysOfPrevioueMonthForSelectedDate - firstDayOfMonth; index -= 1) {
|
|
224
|
+
if (date.getFullYear() === 1 && date.getMonth() === 0) {
|
|
225
|
+
days.unshift(null);
|
|
226
|
+
} else {
|
|
227
|
+
days.unshift(index);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
if (lastDayOfMonth !== 6) {
|
|
232
|
+
for (let index = 1; index <= 6 - lastDayOfMonth; index += 1) {
|
|
233
|
+
days.push(index);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return days.map((day, index) => {
|
|
237
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Day, {
|
|
238
|
+
disabled: handleDisabled(firstDayOfMonth, lastDayOfMonth, daysOfMonthForSelectedDate, index, day),
|
|
239
|
+
onClick: () => {
|
|
240
|
+
handleChangeDate(daysOfMonthForSelectedDate, firstDayOfMonth, index, day);
|
|
241
|
+
},
|
|
242
|
+
selected: isSelectedDay(day, index, firstDayOfMonth, daysOfMonthForSelectedDate),
|
|
243
|
+
children: day
|
|
244
|
+
}, index);
|
|
245
|
+
});
|
|
246
|
+
}, [selectedDate, handleChangeDate, isSelectedDay, handleDisabled]);
|
|
247
|
+
(0, _react.useEffect)(() => {
|
|
248
|
+
if (selected) {
|
|
249
|
+
const formattedDate = (0, _utils.formatDate)((0, _toUTC.default)(selected), 'date');
|
|
250
|
+
setSelectedDate(`${formattedDate} ${DEFAULT_TIME}`);
|
|
251
|
+
setConfirmDate(formattedDate);
|
|
252
|
+
} else {
|
|
253
|
+
setConfirmDate('');
|
|
254
|
+
}
|
|
255
|
+
}, [selected]);
|
|
256
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DateTimePickerContext.default.Provider, {
|
|
257
|
+
value: context,
|
|
258
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactOutsideClickHandler.default, {
|
|
259
|
+
onOutsideClick: handleConfirm,
|
|
260
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(Wrapper, {
|
|
261
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Input.default, {
|
|
262
|
+
disabled: disabled,
|
|
263
|
+
ref: setToggleElement,
|
|
264
|
+
value: confirmDate,
|
|
265
|
+
onClick: handleToggle,
|
|
266
|
+
readOnly: true
|
|
267
|
+
}), confirmDate && !disabled && allowClear && /*#__PURE__*/(0, _jsxRuntime.jsx)(CloseButton, {
|
|
268
|
+
onClick: () => {
|
|
269
|
+
setConfirmDate('');
|
|
270
|
+
onConfirm('');
|
|
271
|
+
}
|
|
272
|
+
})]
|
|
273
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Picker, {
|
|
274
|
+
...attributes.popper,
|
|
275
|
+
style: styles.popper,
|
|
276
|
+
placement: state && state.placement,
|
|
277
|
+
ref: setContentElement,
|
|
278
|
+
displayPicker: displayPicker,
|
|
279
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(Body, {
|
|
280
|
+
accordionCurrentDisplayType: accordionCurrentDisplayType,
|
|
281
|
+
children: [!fixedYear && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Year.default, {
|
|
282
|
+
expand: accordionCurrentDisplayType === 'year',
|
|
283
|
+
handleDisplayAccordionContent: () => {
|
|
284
|
+
changeDisplayAccordion('year');
|
|
285
|
+
}
|
|
286
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Month.default, {
|
|
287
|
+
expand: accordionCurrentDisplayType === 'month',
|
|
288
|
+
handleDisplayAccordionContent: () => {
|
|
289
|
+
changeDisplayAccordion('month');
|
|
290
|
+
},
|
|
291
|
+
confirmDate: confirmDate
|
|
292
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(DateContent, {
|
|
293
|
+
children: [weeks, days]
|
|
294
|
+
})]
|
|
295
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Footer, {
|
|
296
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ConfirmButton, {
|
|
297
|
+
fullWidth: true,
|
|
298
|
+
alignCenter: true,
|
|
299
|
+
onClick: handleConfirm,
|
|
300
|
+
children: t('Confirm')
|
|
301
|
+
})
|
|
302
|
+
})]
|
|
303
|
+
})]
|
|
304
|
+
})
|
|
305
|
+
});
|
|
306
|
+
};
|
|
307
|
+
const Wrapper = _styledComponents.default.div`
|
|
308
|
+
position: relative;
|
|
309
|
+
`;
|
|
310
|
+
const CloseButton = (0, _styledComponents.default)(_md.MdClose)`
|
|
311
|
+
position: absolute;
|
|
312
|
+
top: 50%;
|
|
313
|
+
transform: translateY(-50%);
|
|
314
|
+
color: var(--font-on-background);
|
|
315
|
+
font-size: var(--font-body1);
|
|
316
|
+
right: var(--spacing-s);
|
|
317
|
+
cursor: pointer;
|
|
318
|
+
`;
|
|
319
|
+
CloseButton.displayName = 'CloseButton';
|
|
320
|
+
const Picker = _styledComponents.default.div`
|
|
321
|
+
padding-bottom: var(--spacing-s);
|
|
322
|
+
background: var(--color-background1);
|
|
323
|
+
border-radius: var(--border-radius);
|
|
324
|
+
border: var(--border-width) solid var(--border-color);
|
|
325
|
+
box-shadow: var(--box-shadow);
|
|
326
|
+
overflow: hidden;
|
|
327
|
+
width: 286px;
|
|
328
|
+
z-index: 1;
|
|
329
|
+
color: var(--font-on-background);
|
|
330
|
+
|
|
331
|
+
display: ${_ref2 => {
|
|
332
|
+
let {
|
|
333
|
+
displayPicker
|
|
334
|
+
} = _ref2;
|
|
335
|
+
return displayPicker ? 'block' : 'none';
|
|
336
|
+
}};
|
|
337
|
+
`;
|
|
338
|
+
const Week = _styledComponents.default.div`
|
|
339
|
+
width: calc(100% / 7);
|
|
340
|
+
height: 36px;
|
|
341
|
+
border-radius: var(--border-radius-s);
|
|
342
|
+
line-height: 36px;
|
|
343
|
+
text-align: center;
|
|
344
|
+
`;
|
|
345
|
+
const Body = _styledComponents.default.div`
|
|
346
|
+
${_ref3 => {
|
|
347
|
+
let {
|
|
348
|
+
accordionCurrentDisplayType
|
|
349
|
+
} = _ref3;
|
|
350
|
+
return accordionCurrentDisplayType && (0, _styledComponents.css)`
|
|
351
|
+
height: 216px;
|
|
352
|
+
`;
|
|
353
|
+
}}
|
|
354
|
+
|
|
355
|
+
overflow: hidden;
|
|
356
|
+
padding: ${_ref4 => {
|
|
357
|
+
let {
|
|
358
|
+
accordionCurrentDisplayType
|
|
359
|
+
} = _ref4;
|
|
360
|
+
return accordionCurrentDisplayType === 'year' ? ' 0 4px var(--spacing-s) var(--spacing-s)' : '0 var(--spacing-s) 0 var(--spacing-s)';
|
|
361
|
+
}};
|
|
362
|
+
`;
|
|
363
|
+
const Footer = _styledComponents.default.div`
|
|
364
|
+
padding: 0 var(--spacing-s);
|
|
365
|
+
`;
|
|
366
|
+
const Day = _styledComponents.default.button`
|
|
367
|
+
width: calc(100% / 7);
|
|
368
|
+
height: 36px;
|
|
369
|
+
border-radius: var(--border-radius-s);
|
|
370
|
+
line-height: 36px;
|
|
371
|
+
text-align: center;
|
|
372
|
+
padding: 0;
|
|
373
|
+
border: 0;
|
|
374
|
+
background: var(--color-background1);
|
|
375
|
+
color: var(--font-on-background);
|
|
376
|
+
&:hover {
|
|
377
|
+
background: var(--color-primary);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
${_ref5 => {
|
|
381
|
+
let {
|
|
382
|
+
selected
|
|
383
|
+
} = _ref5;
|
|
384
|
+
return selected && 'background: var(--color-hover);';
|
|
385
|
+
}}
|
|
386
|
+
|
|
387
|
+
${_ref6 => {
|
|
388
|
+
let {
|
|
389
|
+
disabled
|
|
390
|
+
} = _ref6;
|
|
391
|
+
return disabled && (0, _styledComponents.css)`
|
|
392
|
+
color: var(--font-on-mute);
|
|
393
|
+
background: none;
|
|
394
|
+
&:hover {
|
|
395
|
+
background: none;
|
|
396
|
+
}
|
|
397
|
+
`;
|
|
398
|
+
}}
|
|
399
|
+
`;
|
|
400
|
+
const ConfirmButton = (0, _styledComponents.default)(_Button.default)`
|
|
401
|
+
margin: 16px auto 0;
|
|
402
|
+
`;
|
|
403
|
+
const DateContent = _styledComponents.default.div`
|
|
404
|
+
display: flex;
|
|
405
|
+
flex-wrap: wrap;
|
|
406
|
+
`;
|
|
407
|
+
var _default = exports.default = DatePickerV2;
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
+
var _reactDatepicker = _interopRequireDefault(require("react-datepicker"));
|
|
10
|
+
require("react-datepicker/dist/react-datepicker.css");
|
|
11
|
+
var _CustomTimeInput = _interopRequireDefault(require("./subComponent/CustomTimeInput"));
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
const DatetimePicker = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
selected = '',
|
|
17
|
+
onChange,
|
|
18
|
+
dateFormat = 'yyyy-MM-dd HH:mm:ss',
|
|
19
|
+
minDate,
|
|
20
|
+
maxDate,
|
|
21
|
+
showTimeInput,
|
|
22
|
+
readOnly,
|
|
23
|
+
disabled,
|
|
24
|
+
onBlur,
|
|
25
|
+
allowClear = false,
|
|
26
|
+
shouldCloseOnSelect = true
|
|
27
|
+
} = _ref;
|
|
28
|
+
const datepickerRef = (0, _react.useRef)(null);
|
|
29
|
+
const handleOnBlur = () => {
|
|
30
|
+
onBlur();
|
|
31
|
+
};
|
|
32
|
+
const datePickerProps = {
|
|
33
|
+
dateFormat,
|
|
34
|
+
disabled,
|
|
35
|
+
onChange,
|
|
36
|
+
selected: selected ? new Date(Date.parse(selected)) : '',
|
|
37
|
+
minDate: minDate ? new Date(Date.parse(minDate)) : '',
|
|
38
|
+
maxDate: maxDate ? new Date(Date.parse(maxDate)) : '',
|
|
39
|
+
isClearable: allowClear && selected && !disabled,
|
|
40
|
+
shouldCloseOnSelect
|
|
41
|
+
};
|
|
42
|
+
if (showTimeInput) {
|
|
43
|
+
datePickerProps.showTimeInput = true;
|
|
44
|
+
datePickerProps.customTimeInput = /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomTimeInput.default, {
|
|
45
|
+
onCustomChange: onChange
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
if (onBlur) {
|
|
49
|
+
datePickerProps.onCalendarClose = handleOnBlur;
|
|
50
|
+
}
|
|
51
|
+
(0, _react.useEffect)(() => {
|
|
52
|
+
// set input to readonly
|
|
53
|
+
if (datepickerRef && datepickerRef.current && readOnly) {
|
|
54
|
+
datepickerRef.current.input.readOnly = readOnly;
|
|
55
|
+
}
|
|
56
|
+
}, [readOnly]);
|
|
57
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapper, {
|
|
58
|
+
disabled: disabled,
|
|
59
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactDatepicker.default, {
|
|
60
|
+
...datePickerProps,
|
|
61
|
+
ref: datepickerRef
|
|
62
|
+
})
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
const Wrapper = _styledComponents.default.div`
|
|
66
|
+
.react-datepicker-wrapper,
|
|
67
|
+
.react-datepicker__input-container {
|
|
68
|
+
width: 100%;
|
|
69
|
+
|
|
70
|
+
> input {
|
|
71
|
+
width: 100%;
|
|
72
|
+
height: 36px;
|
|
73
|
+
color: var(--font-on-background);
|
|
74
|
+
background: transparent;
|
|
75
|
+
border-radius: var(--border-radius-l);
|
|
76
|
+
border: var(--border-width) solid var(--border-color);
|
|
77
|
+
padding: 0 var(--spacing-s);
|
|
78
|
+
outline: none;
|
|
79
|
+
|
|
80
|
+
${_ref2 => {
|
|
81
|
+
let {
|
|
82
|
+
disabled
|
|
83
|
+
} = _ref2;
|
|
84
|
+
return disabled ? 'cursor: not-allowed; opacity: 0.5;' : '';
|
|
85
|
+
}}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
> input + button {
|
|
89
|
+
padding: 0;
|
|
90
|
+
right: var(--spacing-s);
|
|
91
|
+
&::after {
|
|
92
|
+
color: var(--color-primary);
|
|
93
|
+
background-color: transparent;
|
|
94
|
+
font-size: 24px;
|
|
95
|
+
padding: 0;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.react-datepicker-popper {
|
|
101
|
+
z-index: 2;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.react-datepicker-popper[data-placement^='top'] {
|
|
105
|
+
padding-bottom: var(--spacing-xs);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.react-datepicker-popper[data-placement^='bottom'] {
|
|
109
|
+
padding-top: var(--spacing-xs);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.react-datepicker {
|
|
113
|
+
box-shadow: var(--box-shadow);
|
|
114
|
+
border-radius: var(--border-radius);
|
|
115
|
+
border: var(--border-width) solid var(--border-color);
|
|
116
|
+
padding: var(--spacing-s);
|
|
117
|
+
font-size: var(--font-body1);
|
|
118
|
+
color: var(--font-on-background);
|
|
119
|
+
background: var(--color-background1);
|
|
120
|
+
|
|
121
|
+
.react-datepicker__triangle {
|
|
122
|
+
&::before,
|
|
123
|
+
&::after {
|
|
124
|
+
display: none;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.react-datepicker__header {
|
|
129
|
+
border: none;
|
|
130
|
+
padding: 0;
|
|
131
|
+
background: var(--color-background1);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.react-datepicker__current-month {
|
|
135
|
+
line-height: 36px;
|
|
136
|
+
color: var(--font-on-background);
|
|
137
|
+
font-size: var(--font-body1);
|
|
138
|
+
font-weight: var(--font-normal);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.react-datepicker__day-names {
|
|
142
|
+
margin: 0;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.react-datepicker__day-name,
|
|
146
|
+
.react-datepicker__day {
|
|
147
|
+
width: 36px;
|
|
148
|
+
height: 36px;
|
|
149
|
+
line-height: 36px;
|
|
150
|
+
color: var(--font-on-background);
|
|
151
|
+
font-weight: var(--font-normal);
|
|
152
|
+
margin: 0;
|
|
153
|
+
border-radius: 4px;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.react-datepicker__day:hover {
|
|
157
|
+
background: var(--color-hover);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.react-datepicker__day--disabled {
|
|
161
|
+
color: var(--font-on-mute);
|
|
162
|
+
background: none !important;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.react-datepicker__month {
|
|
167
|
+
margin: 0;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.react-datepicker__navigation {
|
|
171
|
+
top: 0;
|
|
172
|
+
width: 36px;
|
|
173
|
+
height: 36px;
|
|
174
|
+
margin: var(--spacing-s) var(--spacing-s) 0 var(--spacing-s);
|
|
175
|
+
border-radius: 4px;
|
|
176
|
+
|
|
177
|
+
&.react-datepicker__navigation--previous {
|
|
178
|
+
left: 0;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
&.react-datepicker__navigation--next {
|
|
182
|
+
right: 0;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
&:hover {
|
|
186
|
+
background: var(--color-hover);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.react-datepicker__navigation-icon::before {
|
|
190
|
+
border-color: var(--font-on-background);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.react-datepicker__navigation-icon--previous::before {
|
|
194
|
+
right: -4px;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.react-datepicker__navigation-icon--next::before {
|
|
198
|
+
left: -4px;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.react-datepicker__day--selected,
|
|
203
|
+
.react-datepicker__day--in-selecting-range,
|
|
204
|
+
.react-datepicker__day--in-range,
|
|
205
|
+
.react-datepicker__month-text--selected,
|
|
206
|
+
.react-datepicker__month-text--in-selecting-range,
|
|
207
|
+
.react-datepicker__month-text--in-range,
|
|
208
|
+
.react-datepicker__quarter-text--selected,
|
|
209
|
+
.react-datepicker__quarter-text--in-selecting-range,
|
|
210
|
+
.react-datepicker__quarter-text--in-range,
|
|
211
|
+
.react-datepicker__year-text--selected,
|
|
212
|
+
.react-datepicker__year-text--in-selecting-range,
|
|
213
|
+
.react-datepicker__year-text--in-range {
|
|
214
|
+
background: var(--color-primary) !important;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.react-datepicker__day--keyboard-selected,
|
|
218
|
+
.react-datepicker__month-text--keyboard-selected,
|
|
219
|
+
.react-datepicker__quarter-text--keyboard-selected,
|
|
220
|
+
.react-datepicker__year-text--keyboard-selected {
|
|
221
|
+
background: none;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.react-datepicker__input-time-container {
|
|
225
|
+
margin: 0;
|
|
226
|
+
margin-top: var(--spacing-s);
|
|
227
|
+
margin-left: var(--spacing-xs);
|
|
228
|
+
|
|
229
|
+
.react-datepicker-time__input input {
|
|
230
|
+
height: 36px;
|
|
231
|
+
padding: 0 var(--spacing-xs);
|
|
232
|
+
border-radius: var(--border-radius);
|
|
233
|
+
border: var(--border-width) solid var(--border-color);
|
|
234
|
+
background: transparent;
|
|
235
|
+
color: var(--font-on-background);
|
|
236
|
+
outline: none;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
`;
|
|
240
|
+
var _default = exports.default = DatetimePicker;
|