@cashub/ui 0.21.0 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Tab/Tab.js +9 -13
- package/Tab/TabList.js +14 -32
- package/Tab/TabPanel.js +21 -58
- package/Tab/TabTab.js +20 -40
- package/Tab/index.js +2 -10
- package/Tab/subComponent/TabContext.js +2 -5
- package/animate/Collapse.js +26 -53
- package/animate/Loader.js +21 -26
- package/animate/NumberCounter.js +22 -44
- package/animate/PulseRing.js +9 -21
- package/animate/Spinner.js +2 -10
- package/animate/index.js +5 -11
- package/backdrop/BaseBackdrop.js +2 -9
- package/backdrop/LoadingBackdrop.js +2 -9
- package/backdrop/ModalBackdrop.js +2 -9
- package/backdrop/index.js +3 -7
- package/badge/Badge.js +2 -11
- package/badge/BadgeDot.js +2 -10
- package/badge/BadgeFill.js +15 -20
- package/badge/BadgeWithText.js +6 -13
- package/badge/index.js +4 -9
- package/billing/BarChart.js +10 -17
- package/billing/Grid.js +11 -15
- package/billing/Header2.js +6 -9
- package/billing/Header3.js +9 -16
- package/billing/Paragraph.js +8 -14
- package/billing/ParagraphGroup.js +6 -9
- package/billing/ParagraphText.js +7 -12
- package/billing/Section.js +13 -23
- package/billing/SectionBody.js +5 -8
- package/billing/SectionHeader.js +7 -12
- package/breadcrumb/Breadcrumb.js +11 -21
- package/breadcrumb/index.js +1 -3
- package/button/Button.js +41 -38
- package/button/ButtonGroup.js +21 -18
- package/button/IconButton.js +29 -29
- package/button/ScrollToTopButton.js +12 -39
- package/button/index.js +4 -9
- package/callout/Callout.js +13 -26
- package/callout/index.js +1 -3
- package/chart/BarChart.js +28 -53
- package/chart/DoughnutChart.js +23 -62
- package/chart/LineChart.js +33 -55
- package/chart/SingleBarChart.js +11 -17
- package/chart/index.js +5 -12
- package/chart/utils/customTooltip.js +26 -43
- package/chart/utils/htmlLegendPlugin.js +24 -30
- package/chart/utils/index.js +3 -7
- package/chart/utils/padEmptyChartBar.js +24 -22
- package/container/FlexContainer.js +9 -12
- package/container/index.js +1 -3
- package/cropper/Cropper.js +21 -34
- package/cropper/CropperModalHandler.js +15 -21
- package/cropper/index.js +2 -5
- package/cropper/subComponent/CropImageModal.js +23 -58
- package/datetimePicker/DatePicker.js +103 -217
- package/datetimePicker/DatePickerV2.js +116 -221
- package/datetimePicker/DatetimePicker.js +27 -48
- package/datetimePicker/DatetimePickerV2.js +115 -231
- package/datetimePicker/TimeInput.js +9 -22
- package/datetimePicker/TimePicker.js +94 -151
- package/datetimePicker/TimePickerStyle.js +2 -9
- package/datetimePicker/accordion/Month.js +70 -90
- package/datetimePicker/accordion/Year.js +91 -135
- package/datetimePicker/hooks/index.js +3 -7
- package/datetimePicker/hooks/useChangeNumber.js +14 -27
- package/datetimePicker/hooks/useDecrease.js +19 -35
- package/datetimePicker/hooks/useIncrease.js +19 -35
- package/datetimePicker/index.js +7 -15
- package/datetimePicker/provider/constant.js +2 -3
- package/datetimePicker/subComponent/Accordion.js +108 -158
- package/datetimePicker/subComponent/CustomTimeInput.js +18 -48
- package/datetimePicker/subComponent/DateTimePickerContext.js +2 -5
- package/datetimePicker/utils/GMTDate.js +3 -7
- package/datetimePicker/utils/pad.js +2 -6
- package/datetimePicker/utils/toUTC0.js +3 -6
- package/descriptionList/DescriptionDetail.js +5 -10
- package/descriptionList/DescriptionList.js +5 -10
- package/descriptionList/DescriptionTerm.js +2 -9
- package/descriptionList/index.js +3 -7
- package/divider/Divider.js +9 -12
- package/divider/index.js +1 -3
- package/dropdown/Dropdown.js +28 -65
- package/dropdown/DropdownButtonOption.js +2 -9
- package/dropdown/DropdownContent.js +33 -64
- package/dropdown/DropdownDivOption.js +2 -9
- package/dropdown/DropdownItem.js +10 -16
- package/dropdown/DropdownLinkOption.js +2 -9
- package/dropdown/DropdownToggle.js +18 -38
- package/dropdown/index.js +6 -17
- package/dropdown/subComponent/DropdownContext.js +2 -5
- package/dropzone/FileDropzone.js +148 -302
- package/dropzone/ImageDropzone.js +96 -171
- package/dropzone/index.js +2 -5
- package/dropzone/subComponent/Message.js +7 -14
- package/figure/IconFigure.js +9 -16
- package/figure/ImageFigure.js +11 -17
- package/figure/index.js +2 -5
- package/file/HiddenFileInput.js +5 -14
- package/file/index.js +1 -3
- package/form/Checkbox.js +34 -43
- package/form/FormItem.js +2 -9
- package/form/Input.js +13 -15
- package/form/Label.js +10 -13
- package/form/MutedText.js +5 -10
- package/form/RadioButton.js +20 -32
- package/form/Searchbox.js +21 -65
- package/form/Slider.js +14 -0
- package/form/SwitchButton.js +34 -39
- package/form/Textarea.js +2 -11
- package/form/index.js +9 -19
- package/grid/Column.js +17 -17
- package/grid/Grid.js +13 -14
- package/grid/index.js +2 -5
- package/heading/Heading1.js +5 -10
- package/heading/Heading2.js +9 -12
- package/heading/Heading3.js +21 -18
- package/heading/index.js +3 -7
- package/helmet/Helmet.js +6 -9
- package/helmet/index.js +2 -5
- package/iconbox/ApplicationIconBox.js +25 -31
- package/iconbox/IconBox.js +11 -24
- package/iconbox/IconBoxV2.js +14 -26
- package/iconbox/index.js +3 -7
- package/iconbox/subComponent/IconBoxFigure.js +25 -20
- package/iconbox/subComponent/IconBoxImage.js +15 -18
- package/image/ImageFluid.js +2 -10
- package/image/UploadImage.js +65 -113
- package/image/index.js +2 -5
- package/index.js +44 -130
- package/jsoneditor/JsonEditor.js +10 -32
- package/jsoneditor/index.js +1 -3
- package/keyframe/Pulse.js +2 -7
- package/keyframe/Spin.js +2 -7
- package/link/LinkSpan.js +22 -35
- package/link/index.js +1 -3
- package/map/GoogleMap.js +122 -175
- package/map/GoogleReverseGeolocation.js +79 -186
- package/map/LeafletMap.js +78 -132
- package/map/LeafletReverseGeolocation.js +49 -121
- package/map/index.js +4 -9
- package/map/subComponent/BasicLeafletMap.js +8 -14
- package/map/subComponent/GoogleMapContainer.js +5 -10
- package/map/subComponent/GoogleMapPopup.js +66 -123
- package/map/subComponent/GoogleMapWrapper.js +13 -32
- package/map/subComponent/GoogleMarkerSpiderfier.js +14 -24
- package/map/subComponent/LeafletDrawControl.js +47 -84
- package/map/subComponent/LeafletMapContainer.js +5 -10
- package/map/subComponent/MapSearchBoxControl.js +24 -70
- package/modal/StateModal.js +41 -100
- package/modal/TitleModal.js +89 -190
- package/modal/index.js +2 -5
- package/package.json +1 -1
- package/paginate/Paginate.js +40 -54
- package/paginate/index.js +1 -3
- package/popover/Popover.js +39 -87
- package/popover/index.js +1 -3
- package/qrcode/QRCode.js +10 -23
- package/qrcode/QRCodeContainter.js +8 -16
- package/qrcode/index.js +2 -5
- package/ribbon/Ribbon.js +4 -15
- package/ribbon/index.js +1 -3
- package/section/Section.js +57 -39
- package/section/SectionBody.js +15 -22
- package/section/SectionHeader.js +27 -27
- package/section/SectionToolbar.js +2 -9
- package/section/SectionToolbarItem.js +2 -9
- package/section/index.js +5 -11
- package/select/InputSelect.js +103 -215
- package/select/Select.js +204 -362
- package/select/index.js +2 -5
- package/select/subComponent/ListBox.js +9 -12
- package/select/subComponent/Option.js +8 -16
- package/select/subComponent/OptionGroup.js +2 -9
- package/select/subComponent/Options.js +5 -11
- package/select/subComponent/SearchBox.js +9 -29
- package/select/subComponent/SelectedMultiple.js +8 -16
- package/select/subComponent/SelectedSingle.js +2 -9
- package/styles/GlobalStyle.js +169 -91
- package/styles/config/breakpoint.style.js +2 -3
- package/styles/config/header.style.js +2 -3
- package/styles/config/sidebar.style.js +2 -3
- package/styles/index.js +2 -5
- package/styles/mixin/backgroundColor.js +17 -14
- package/styles/mixin/borderColor.js +17 -14
- package/styles/mixin/color.js +17 -14
- package/styles/mixin/colorOnBackground.js +17 -14
- package/styles/mixin/inputPlaceholder.js +3 -9
- package/styles/mixin/media.js +3 -11
- package/styles/mixin/rounded.js +13 -12
- package/styles/mixin/scrollbar.js +7 -13
- package/styles/theme/dark.theme.js +20 -20
- package/styles/theme/light.theme.js +20 -20
- package/styles/theme/white.theme.js +20 -20
- package/styles/themes.js +2 -8
- package/table/GridTable.js +105 -143
- package/table/ImageBox.js +8 -18
- package/table/PermissionTable.js +25 -25
- package/table/Table.js +137 -153
- package/table/__mock__/columns.js +2 -3
- package/table/__mock__/data.js +2 -3
- package/table/hooks/index.js +2 -5
- package/table/hooks/useCalculateDataRange.js +9 -36
- package/table/hooks/useGenerateSort.js +6 -17
- package/table/index.js +4 -9
- package/table/subComponent/BaseTableHeadCell.js +15 -21
- package/table/subComponent/GridTableFooter.js +5 -10
- package/table/subComponent/GridTableHeadCell.js +5 -10
- package/table/subComponent/Resizer.js +17 -44
- package/table/subComponent/TableFooter.js +5 -10
- package/table/subComponent/TableFooterInfo.js +2 -9
- package/table/subComponent/TableFooterPager.js +5 -12
- package/table/subComponent/TableHeadCell.js +2 -9
- package/table/subComponent/TableSort.js +13 -19
- package/tagify/TagifyStyle.js +2 -9
- package/tagify/Tags.js +15 -37
- package/tagify/index.js +2 -5
- package/text/Paragraph.js +25 -20
- package/text/index.js +1 -3
- package/timeline/Timeline.js +28 -37
- package/timeline/index.js +1 -3
- package/toast/CustomToastContainer.js +2 -9
- package/toast/MessageContainer.js +9 -18
- package/toast/index.js +3 -8
- package/toast/show.js +18 -28
- package/tooltip/Tooltip.js +48 -97
- package/tooltip/index.js +1 -3
- package/wizard/Wizard.js +63 -133
- package/wizard/index.js +1 -3
|
@@ -1,185 +1,100 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.default = void 0;
|
|
9
|
-
|
|
10
7
|
var _react = require("react");
|
|
11
|
-
|
|
12
8
|
var _reactI18next = require("react-i18next");
|
|
13
|
-
|
|
14
9
|
var _reactOutsideClickHandler = _interopRequireDefault(require("react-outside-click-handler"));
|
|
15
|
-
|
|
16
10
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
17
|
-
|
|
18
11
|
var _hooks = require("@cashub/hooks");
|
|
19
|
-
|
|
20
12
|
var _utils = require("@cashub/utils");
|
|
21
|
-
|
|
22
13
|
var _DateTimePickerContext = _interopRequireDefault(require("./subComponent/DateTimePickerContext"));
|
|
23
|
-
|
|
24
14
|
var _Button = _interopRequireDefault(require("../button/Button"));
|
|
25
|
-
|
|
26
15
|
var _Input = _interopRequireDefault(require("../form/Input"));
|
|
27
|
-
|
|
28
16
|
var _Month = _interopRequireDefault(require("./accordion/Month"));
|
|
29
|
-
|
|
30
17
|
var _Year = _interopRequireDefault(require("./accordion/Year"));
|
|
31
|
-
|
|
32
18
|
var _TimePicker = _interopRequireDefault(require("./TimePicker"));
|
|
33
|
-
|
|
34
19
|
var _GMTDate = _interopRequireDefault(require("./utils/GMTDate"));
|
|
35
|
-
|
|
36
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
37
|
-
|
|
38
21
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
|
39
|
-
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
43
|
-
|
|
22
|
+
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); }
|
|
23
|
+
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 && Object.prototype.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; }
|
|
44
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
45
|
-
|
|
46
25
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
69
|
-
|
|
70
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
71
|
-
|
|
72
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
73
|
-
|
|
74
|
-
var DatetimePickerV2 = function DatetimePickerV2(_ref) {
|
|
75
|
-
var selected = _ref.selected,
|
|
76
|
-
fixedYear = _ref.fixedYear,
|
|
77
|
-
minDate = _ref.minDate,
|
|
78
|
-
maxDate = _ref.maxDate,
|
|
79
|
-
onConfirm = _ref.onConfirm,
|
|
80
|
-
disabled = _ref.disabled,
|
|
81
|
-
onBlur = _ref.onBlur;
|
|
82
|
-
|
|
83
|
-
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
84
|
-
t = _useTranslation.t;
|
|
85
|
-
|
|
86
|
-
var _useState = (0, _react.useState)(null),
|
|
87
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
88
|
-
toggleElement = _useState2[0],
|
|
89
|
-
setToggleElement = _useState2[1];
|
|
90
|
-
|
|
91
|
-
var _useState3 = (0, _react.useState)(null),
|
|
92
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
93
|
-
contentElement = _useState4[0],
|
|
94
|
-
setContentElement = _useState4[1];
|
|
95
|
-
|
|
96
|
-
var _useState5 = (0, _react.useState)(selected ? (0, _utils.datetimeTFormat)(selected) : ''),
|
|
97
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
98
|
-
inputValue = _useState6[0],
|
|
99
|
-
setInputValue = _useState6[1];
|
|
100
|
-
|
|
101
|
-
var _useState7 = (0, _react.useState)(selected ? (0, _utils.datetimeTFormat)((0, _GMTDate.default)(selected)) : (0, _utils.datetimeTFormat)((0, _GMTDate.default)(new Date()))),
|
|
102
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
103
|
-
selectedDate = _useState8[0],
|
|
104
|
-
setSelectedDate = _useState8[1];
|
|
105
|
-
|
|
106
|
-
var _useState9 = (0, _react.useState)(selected ? (0, _utils.datetimeTFormat)(selected) : ''),
|
|
107
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
108
|
-
confirmDate = _useState10[0],
|
|
109
|
-
setConfirmDate = _useState10[1];
|
|
110
|
-
|
|
111
|
-
var _useState11 = (0, _react.useState)(false),
|
|
112
|
-
_useState12 = _slicedToArray(_useState11, 2),
|
|
113
|
-
displayPicker = _useState12[0],
|
|
114
|
-
setDisplayPicker = _useState12[1];
|
|
115
|
-
|
|
116
|
-
var _useState13 = (0, _react.useState)(function () {
|
|
117
|
-
var date = new Date((0, _utils.datetimeTFormat)(selected ? selected : (0, _utils.formatDate)(new Date())));
|
|
26
|
+
const DatetimePickerV2 = _ref => {
|
|
27
|
+
let {
|
|
28
|
+
selected,
|
|
29
|
+
fixedYear,
|
|
30
|
+
minDate,
|
|
31
|
+
maxDate,
|
|
32
|
+
onConfirm,
|
|
33
|
+
disabled,
|
|
34
|
+
onBlur
|
|
35
|
+
} = _ref;
|
|
36
|
+
const {
|
|
37
|
+
t
|
|
38
|
+
} = (0, _reactI18next.useTranslation)();
|
|
39
|
+
const [toggleElement, setToggleElement] = (0, _react.useState)(null);
|
|
40
|
+
const [contentElement, setContentElement] = (0, _react.useState)(null);
|
|
41
|
+
const [inputValue, setInputValue] = (0, _react.useState)(selected ? (0, _utils.datetimeTFormat)(selected) : '');
|
|
42
|
+
const [selectedDate, setSelectedDate] = (0, _react.useState)(selected ? (0, _utils.datetimeTFormat)((0, _GMTDate.default)(selected)) : (0, _utils.datetimeTFormat)((0, _GMTDate.default)(new Date())));
|
|
43
|
+
const [confirmDate, setConfirmDate] = (0, _react.useState)(selected ? (0, _utils.datetimeTFormat)(selected) : '');
|
|
44
|
+
const [displayPicker, setDisplayPicker] = (0, _react.useState)(false);
|
|
45
|
+
const [time, setTime] = (0, _react.useState)(() => {
|
|
46
|
+
const date = new Date((0, _utils.datetimeTFormat)(selected ? selected : (0, _utils.formatDate)(new Date())));
|
|
118
47
|
if (!selected) date.setHours(0, 0, 0, 0);
|
|
119
48
|
return "".concat(date.getHours(), ":").concat(date.getMinutes(), ":").concat(date.getSeconds());
|
|
120
|
-
})
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
setAccordionCurrentDisplayType = _useState16[1];
|
|
129
|
-
|
|
130
|
-
var _useCustomPopper = (0, _hooks.useCustomPopper)(toggleElement, contentElement, {
|
|
49
|
+
});
|
|
50
|
+
const [accordionCurrentDisplayType, setAccordionCurrentDisplayType] = (0, _react.useState)(null);
|
|
51
|
+
const {
|
|
52
|
+
styles,
|
|
53
|
+
attributes,
|
|
54
|
+
state,
|
|
55
|
+
update
|
|
56
|
+
} = (0, _hooks.useCustomPopper)(toggleElement, contentElement, {
|
|
131
57
|
strategy: 'absolute',
|
|
132
58
|
placement: 'bottom-start'
|
|
133
|
-
})
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
minDate: minDate,
|
|
142
|
-
maxDate: maxDate,
|
|
143
|
-
selectedDate: selectedDate,
|
|
144
|
-
setSelectedDate: setSelectedDate,
|
|
145
|
-
setAccordionCurrentDisplayType: setAccordionCurrentDisplayType
|
|
59
|
+
});
|
|
60
|
+
const context = {
|
|
61
|
+
fixedYear,
|
|
62
|
+
minDate,
|
|
63
|
+
maxDate,
|
|
64
|
+
selectedDate,
|
|
65
|
+
setSelectedDate,
|
|
66
|
+
setAccordionCurrentDisplayType
|
|
146
67
|
};
|
|
147
|
-
|
|
148
|
-
var handleToggle = function handleToggle() {
|
|
68
|
+
const handleToggle = () => {
|
|
149
69
|
if (displayPicker && onBlur) {
|
|
150
70
|
onBlur();
|
|
151
71
|
}
|
|
152
|
-
|
|
153
72
|
setDisplayPicker(!displayPicker);
|
|
154
73
|
update();
|
|
155
74
|
};
|
|
156
|
-
|
|
157
|
-
var _handleDisplayAccordionContent = (0, _react.useCallback)(function (type) {
|
|
75
|
+
const handleDisplayAccordionContent = (0, _react.useCallback)(type => {
|
|
158
76
|
if (accordionCurrentDisplayType === type) {
|
|
159
77
|
setAccordionCurrentDisplayType(null);
|
|
160
78
|
} else {
|
|
161
79
|
setAccordionCurrentDisplayType(type);
|
|
162
80
|
}
|
|
163
81
|
}, [accordionCurrentDisplayType]);
|
|
164
|
-
|
|
165
|
-
var handleConfirm = (0, _react.useCallback)(function () {
|
|
82
|
+
const handleConfirm = (0, _react.useCallback)(() => {
|
|
166
83
|
if (!confirmDate) return;
|
|
167
84
|
setSelectedDate(confirmDate);
|
|
168
85
|
onConfirm(inputValue);
|
|
169
86
|
setDisplayPicker(false);
|
|
170
87
|
setAccordionCurrentDisplayType(null);
|
|
171
|
-
|
|
172
88
|
if (displayPicker && onBlur) {
|
|
173
89
|
onBlur();
|
|
174
90
|
}
|
|
175
91
|
}, [confirmDate, inputValue, onConfirm, onBlur, displayPicker]);
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
92
|
+
const handleChangeDate = (0, _react.useCallback)((daysOfMonthForSelectedDate, firstWeekOfMonth, dayIndex, day) => {
|
|
93
|
+
const date = new Date(selectedDate);
|
|
94
|
+
// 先把日期設定成所有月分都有的日期,設定月份時才不會設定到非預期的date
|
|
179
95
|
date.setDate(1);
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
96
|
+
const selectedYear = date.getFullYear();
|
|
97
|
+
const selectedMonth = date.getMonth();
|
|
183
98
|
if (!fixedYear) {
|
|
184
99
|
if (dayIndex < firstWeekOfMonth && selectedYear >= 1) {
|
|
185
100
|
if (selectedMonth === 0) {
|
|
@@ -196,7 +111,6 @@ var DatetimePickerV2 = function DatetimePickerV2(_ref) {
|
|
|
196
111
|
date.setMonth(selectedMonth + 1);
|
|
197
112
|
}
|
|
198
113
|
}
|
|
199
|
-
|
|
200
114
|
date.setDate(day);
|
|
201
115
|
setSelectedDate((0, _utils.datetimeTFormat)(date));
|
|
202
116
|
setConfirmDate((0, _utils.datetimeTFormat)(date));
|
|
@@ -205,34 +119,25 @@ var DatetimePickerV2 = function DatetimePickerV2(_ref) {
|
|
|
205
119
|
if (selectedMonth === 0) {
|
|
206
120
|
return;
|
|
207
121
|
}
|
|
208
|
-
|
|
209
122
|
date.setMonth(selectedMonth - 1);
|
|
210
123
|
} else if (dayIndex >= daysOfMonthForSelectedDate + firstWeekOfMonth) {
|
|
211
124
|
if (selectedMonth === 11) {
|
|
212
125
|
return;
|
|
213
126
|
}
|
|
214
|
-
|
|
215
127
|
date.setMonth(selectedMonth + 1);
|
|
216
128
|
}
|
|
217
|
-
|
|
218
129
|
date.setDate(day);
|
|
219
130
|
setSelectedDate((0, _utils.datetimeTFormat)(date));
|
|
220
131
|
setConfirmDate((0, _utils.datetimeTFormat)(date));
|
|
221
132
|
}
|
|
222
133
|
}, [fixedYear, selectedDate]);
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
_selectedDate$split2 = _slicedToArray(_selectedDate$split, 2),
|
|
226
|
-
year = _selectedDate$split2[0],
|
|
227
|
-
month = _selectedDate$split2[1];
|
|
228
|
-
|
|
134
|
+
const handleDisabled = (0, _react.useCallback)((firstWeekOfMonth, lastWeekOfMonth, daysOfMonthForSelectedDate, dayIndex, day) => {
|
|
135
|
+
let [year, month] = selectedDate.split('-');
|
|
229
136
|
if (year === '0001' && month === '01' && firstWeekOfMonth >= dayIndex + 1) {
|
|
230
137
|
return true;
|
|
231
138
|
}
|
|
232
|
-
|
|
233
|
-
var myDay = day.toString();
|
|
139
|
+
let myDay = day.toString();
|
|
234
140
|
if (myDay.length === 1) myDay = "0".concat(myDay);
|
|
235
|
-
|
|
236
141
|
if (fixedYear) {
|
|
237
142
|
if (month === '01' && dayIndex + 1 <= firstWeekOfMonth) {
|
|
238
143
|
// disabledDateInJan
|
|
@@ -242,86 +147,72 @@ var DatetimePickerV2 = function DatetimePickerV2(_ref) {
|
|
|
242
147
|
return dayIndex >= daysOfMonthForSelectedDate + firstWeekOfMonth;
|
|
243
148
|
}
|
|
244
149
|
}
|
|
245
|
-
|
|
246
150
|
if (month === '01' && firstWeekOfMonth !== 0 && dayIndex + 1 <= firstWeekOfMonth) {
|
|
247
151
|
year = (+year - 1).toString();
|
|
248
152
|
} else if (month === '12' && lastWeekOfMonth !== 6 && day + firstWeekOfMonth < dayIndex + 1) {
|
|
249
153
|
year = (+year + 1).toString();
|
|
250
154
|
}
|
|
251
|
-
|
|
252
155
|
month = firstWeekOfMonth >= dayIndex + 1 ? +month - 1 : daysOfMonthForSelectedDate + firstWeekOfMonth < dayIndex + 1 ? +month + 1 : +month;
|
|
253
|
-
|
|
254
156
|
if (month === 0) {
|
|
255
157
|
month = 12;
|
|
256
158
|
} else if (month === 13) {
|
|
257
159
|
month = 1;
|
|
258
160
|
}
|
|
259
|
-
|
|
260
161
|
if (year.length === 1) year = "000".concat(year);
|
|
261
162
|
if (year.length === 2) year = "00".concat(year);
|
|
262
163
|
if (year.length === 3) year = "0".concat(year);
|
|
263
164
|
if (month.toString().length === 1) month = "0".concat(month);else month = month.toString();
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
165
|
+
const compareMinDateDate = (0, _utils.formatDate)((0, _utils.datetimeTFormat)(new Date((0, _GMTDate.default)((0, _utils.formatDate)(new Date("".concat(year, "-").concat(month, "-").concat(myDay))), 'date')).setHours(23, 59, 59, 59)));
|
|
166
|
+
const compareMaxDateDate = (0, _utils.formatDate)((0, _utils.datetimeTFormat)(new Date((0, _GMTDate.default)((0, _utils.formatDate)(new Date("".concat(year, "-").concat(month, "-").concat(myDay))), 'date')).setHours(0, 0, 0, 0)));
|
|
267
167
|
if (minDate && !maxDate && minDate > compareMinDateDate) {
|
|
268
168
|
return true;
|
|
269
169
|
}
|
|
270
|
-
|
|
271
170
|
if (maxDate && !minDate && maxDate < compareMaxDateDate) {
|
|
272
171
|
return true;
|
|
273
172
|
}
|
|
274
|
-
|
|
275
173
|
if (maxDate && minDate && (minDate > compareMinDateDate || maxDate < compareMaxDateDate)) {
|
|
276
174
|
return true;
|
|
277
175
|
}
|
|
278
|
-
|
|
279
176
|
return false;
|
|
280
177
|
}, [fixedYear, minDate, maxDate, selectedDate]);
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
178
|
+
const handleSelectedDay = (0, _react.useCallback)((day, index, firstWeekOfMonth, lastWeekOfMonth, totalDays) => {
|
|
179
|
+
const selectedDateObj = new Date(selectedDate);
|
|
180
|
+
const confirmDateObj = new Date(confirmDate);
|
|
285
181
|
if (confirmDateObj.getFullYear() === selectedDateObj.getFullYear() && confirmDateObj.getMonth() === selectedDateObj.getMonth() && confirmDateObj.getDate() === day) {
|
|
286
182
|
if (index + 1 > firstWeekOfMonth && index < totalDays - (6 - lastWeekOfMonth)) {
|
|
287
183
|
return true;
|
|
288
184
|
}
|
|
289
|
-
|
|
290
185
|
return false;
|
|
291
186
|
}
|
|
292
|
-
|
|
293
187
|
return false;
|
|
294
188
|
}, [selectedDate, confirmDate]);
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
189
|
+
const days = (0, _react.useMemo)(() => {
|
|
190
|
+
let date = new Date(selectedDate);
|
|
191
|
+
// 先把日期設定成所有月分都有的日期,設定月份時才不會設定到非預期的date
|
|
298
192
|
date.setDate(1);
|
|
299
193
|
date.setMonth(date.getMonth() + 1);
|
|
300
194
|
date.setDate(0);
|
|
301
|
-
|
|
195
|
+
const daysOfMonthForSelectedDate = date.getDate();
|
|
302
196
|
date = new Date(selectedDate);
|
|
303
197
|
date.setMonth(date.getMonth() + 1 - 1);
|
|
304
198
|
date.setDate(0);
|
|
305
|
-
|
|
306
|
-
date = new Date(selectedDate);
|
|
307
|
-
|
|
199
|
+
const daysOfPrevioueMonthForSelectedDate = date.getDate();
|
|
200
|
+
date = new Date(selectedDate);
|
|
201
|
+
// 先把日期設定成所有月分都有的日期,設定月份時才不會設定到非預期的date
|
|
308
202
|
date.setDate(1);
|
|
309
|
-
|
|
310
|
-
date = new Date(selectedDate);
|
|
311
|
-
|
|
203
|
+
const firstWeekOfMonth = date.getDay();
|
|
204
|
+
date = new Date(selectedDate);
|
|
205
|
+
// 先把日期設定成所有月分都有的日期,設定月份時才不會設定到非預期的date
|
|
312
206
|
date.setDate(1);
|
|
313
207
|
date.setMonth(date.getMonth() + 1);
|
|
314
208
|
date.setDate(0);
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
for (var _i2 = 0, _arr2 = _toConsumableArray(Array(daysOfMonthForSelectedDate).keys()); _i2 < _arr2.length; _i2++) {
|
|
319
|
-
var day = _arr2[_i2];
|
|
209
|
+
const lastWeekOfMonth = date.getDay();
|
|
210
|
+
const days = [];
|
|
211
|
+
for (const day of [...Array(daysOfMonthForSelectedDate).keys()]) {
|
|
320
212
|
days.push(day + 1);
|
|
321
213
|
}
|
|
322
|
-
|
|
323
214
|
if (firstWeekOfMonth !== 0) {
|
|
324
|
-
for (
|
|
215
|
+
for (let index = daysOfPrevioueMonthForSelectedDate; index > daysOfPrevioueMonthForSelectedDate - firstWeekOfMonth; index -= 1) {
|
|
325
216
|
if (date.getFullYear() === 1 && date.getMonth() === 0) {
|
|
326
217
|
days.unshift(null);
|
|
327
218
|
} else {
|
|
@@ -329,17 +220,15 @@ var DatetimePickerV2 = function DatetimePickerV2(_ref) {
|
|
|
329
220
|
}
|
|
330
221
|
}
|
|
331
222
|
}
|
|
332
|
-
|
|
333
223
|
if (lastWeekOfMonth !== 6) {
|
|
334
|
-
for (
|
|
335
|
-
days.push(
|
|
224
|
+
for (let index = 1; index <= 6 - lastWeekOfMonth; index += 1) {
|
|
225
|
+
days.push(index);
|
|
336
226
|
}
|
|
337
227
|
}
|
|
338
|
-
|
|
339
|
-
return days.map(function (day, index, arr) {
|
|
228
|
+
return days.map((day, index, arr) => {
|
|
340
229
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Day, {
|
|
341
230
|
disabled: handleDisabled(firstWeekOfMonth, lastWeekOfMonth, daysOfMonthForSelectedDate, index, day),
|
|
342
|
-
onClick:
|
|
231
|
+
onClick: () => {
|
|
343
232
|
handleChangeDate(daysOfMonthForSelectedDate, firstWeekOfMonth, index, day);
|
|
344
233
|
},
|
|
345
234
|
selected: handleSelectedDay(day, index, firstWeekOfMonth, lastWeekOfMonth, arr.length, daysOfMonthForSelectedDate),
|
|
@@ -347,28 +236,22 @@ var DatetimePickerV2 = function DatetimePickerV2(_ref) {
|
|
|
347
236
|
}, index);
|
|
348
237
|
});
|
|
349
238
|
}, [selectedDate, handleChangeDate, handleSelectedDay, handleDisabled]);
|
|
350
|
-
|
|
351
|
-
return ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'].map(
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
}, week);
|
|
355
|
-
});
|
|
239
|
+
const weeks = (0, _react.useMemo)(() => {
|
|
240
|
+
return ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'].map(week => /*#__PURE__*/(0, _jsxRuntime.jsx)(Week, {
|
|
241
|
+
children: week
|
|
242
|
+
}, week));
|
|
356
243
|
}, []);
|
|
357
|
-
(0, _react.useEffect)(
|
|
244
|
+
(0, _react.useEffect)(() => {
|
|
358
245
|
if (!selected) return;
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
var _date$split = date.split('T'),
|
|
362
|
-
_date$split2 = _slicedToArray(_date$split, 2),
|
|
363
|
-
time = _date$split2[1];
|
|
364
|
-
|
|
246
|
+
const date = (0, _utils.datetimeTFormat)(selected);
|
|
247
|
+
const [, time] = date.split('T');
|
|
365
248
|
setSelectedDate(date);
|
|
366
249
|
setConfirmDate(date);
|
|
367
250
|
setTime(time);
|
|
368
251
|
}, [selected]);
|
|
369
|
-
(0, _react.useEffect)(
|
|
252
|
+
(0, _react.useEffect)(() => {
|
|
370
253
|
if (!confirmDate) return;
|
|
371
|
-
|
|
254
|
+
const date = (0, _utils.formatDate)(confirmDate, 'date');
|
|
372
255
|
setInputValue("".concat(date, " ").concat(time));
|
|
373
256
|
}, [confirmDate, time]);
|
|
374
257
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DateTimePickerContext.default.Provider, {
|
|
@@ -381,7 +264,8 @@ var DatetimePickerV2 = function DatetimePickerV2(_ref) {
|
|
|
381
264
|
onClick: handleToggle,
|
|
382
265
|
readOnly: true,
|
|
383
266
|
disabled: disabled
|
|
384
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Wrapper,
|
|
267
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Wrapper, {
|
|
268
|
+
...attributes.popper,
|
|
385
269
|
style: styles.popper,
|
|
386
270
|
placement: state && state.placement,
|
|
387
271
|
ref: setContentElement,
|
|
@@ -390,13 +274,13 @@ var DatetimePickerV2 = function DatetimePickerV2(_ref) {
|
|
|
390
274
|
accordionCurrentDisplayType: accordionCurrentDisplayType,
|
|
391
275
|
children: [!fixedYear && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Year.default, {
|
|
392
276
|
expand: accordionCurrentDisplayType === 'year',
|
|
393
|
-
handleDisplayAccordionContent:
|
|
394
|
-
|
|
277
|
+
handleDisplayAccordionContent: () => {
|
|
278
|
+
handleDisplayAccordionContent('year');
|
|
395
279
|
}
|
|
396
280
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Month.default, {
|
|
397
281
|
expand: accordionCurrentDisplayType === 'month',
|
|
398
|
-
handleDisplayAccordionContent:
|
|
399
|
-
|
|
282
|
+
handleDisplayAccordionContent: () => {
|
|
283
|
+
handleDisplayAccordionContent('month');
|
|
400
284
|
},
|
|
401
285
|
confirmDate: confirmDate
|
|
402
286
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(DateContent, {
|
|
@@ -413,41 +297,41 @@ var DatetimePickerV2 = function DatetimePickerV2(_ref) {
|
|
|
413
297
|
children: t('Confirm')
|
|
414
298
|
})
|
|
415
299
|
})]
|
|
416
|
-
})
|
|
300
|
+
})]
|
|
417
301
|
})
|
|
418
302
|
});
|
|
419
303
|
};
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
304
|
+
const Wrapper = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding-bottom: var(--spacing-s);\n background: var(--color-background1);\n border-radius: var(--border-radius);\n border: var(--border-width) solid var(--border-color);\n box-shadow: var(--box-shadow);\n overflow: hidden;\n width: 286px;\n z-index: 1;\n color: var(--font-on-background);\n\n display: ", ";\n"])), _ref2 => {
|
|
305
|
+
let {
|
|
306
|
+
displayPicker
|
|
307
|
+
} = _ref2;
|
|
423
308
|
return displayPicker ? 'block' : 'none';
|
|
424
309
|
});
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
310
|
+
const Week = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n height: 36px;\n width: calc(100% / 7);\n border-radius: var(--border-radius-s);\n line-height: 36px;\n text-align: center;\n"])));
|
|
311
|
+
const Body = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", "\n\n overflow: hidden;\n padding: ", ";\n"])), _ref3 => {
|
|
312
|
+
let {
|
|
313
|
+
accordionCurrentDisplayType
|
|
314
|
+
} = _ref3;
|
|
430
315
|
return accordionCurrentDisplayType && (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n height: 216px;\n "])));
|
|
431
|
-
},
|
|
432
|
-
|
|
316
|
+
}, _ref4 => {
|
|
317
|
+
let {
|
|
318
|
+
accordionCurrentDisplayType
|
|
319
|
+
} = _ref4;
|
|
433
320
|
return accordionCurrentDisplayType === 'year' ? ' 0 4px var(--spacing-s) var(--spacing-s)' : '0 var(--spacing-s) 0 var(--spacing-s)';
|
|
434
321
|
});
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
var selected = _ref5.selected;
|
|
322
|
+
const Footer = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n padding: 0 var(--spacing-s);\n"])));
|
|
323
|
+
const PickerInput = (0, _styledComponents.default)(_Input.default)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n &:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n"])));
|
|
324
|
+
const Day = _styledComponents.default.button(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n width: calc(100% / 7);\n height: 36px;\n border-radius: var(--border-radius-s);\n line-height: 36px;\n text-align: center;\n padding: 0;\n border: 0;\n background: var(--color-background1);\n color: var(--font-on-background);\n &:hover {\n background: var(--color-primary);\n }\n\n ", "\n\n ", "\n"])), _ref5 => {
|
|
325
|
+
let {
|
|
326
|
+
selected
|
|
327
|
+
} = _ref5;
|
|
442
328
|
return selected && 'background: var(--color-hover);';
|
|
443
|
-
},
|
|
444
|
-
|
|
329
|
+
}, _ref6 => {
|
|
330
|
+
let {
|
|
331
|
+
disabled
|
|
332
|
+
} = _ref6;
|
|
445
333
|
return disabled && (0, _styledComponents.css)(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n color: var(--font-on-mute);\n background: none;\n &:hover {\n background: none;\n }\n "])));
|
|
446
334
|
});
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
var DateContent = _styledComponents.default.div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: wrap;\n"])));
|
|
451
|
-
|
|
452
|
-
var _default = DatetimePickerV2;
|
|
453
|
-
exports.default = _default;
|
|
335
|
+
const ConfirmButton = (0, _styledComponents.default)(_Button.default)(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n margin: 16px auto 0;\n"])));
|
|
336
|
+
const DateContent = _styledComponents.default.div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: wrap;\n"])));
|
|
337
|
+
var _default = exports.default = DatetimePickerV2;
|
|
@@ -4,38 +4,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
-
|
|
10
8
|
var _rcTimePicker = _interopRequireDefault(require("rc-time-picker"));
|
|
11
|
-
|
|
12
9
|
require("rc-time-picker/assets/index.css");
|
|
13
|
-
|
|
14
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
|
|
16
11
|
var _templateObject;
|
|
17
|
-
|
|
18
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
13
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
21
|
-
|
|
22
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
23
|
-
|
|
24
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
25
|
-
|
|
26
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
27
|
-
|
|
28
|
-
var TimeInput = function TimeInput(props) {
|
|
14
|
+
const TimeInput = props => {
|
|
29
15
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapper, {
|
|
30
16
|
disabled: props.disabled,
|
|
31
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_rcTimePicker.default,
|
|
17
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_rcTimePicker.default, {
|
|
18
|
+
...props
|
|
19
|
+
})
|
|
32
20
|
});
|
|
33
21
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
22
|
+
const Wrapper = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .rc-time-picker {\n width: 100%;\n\n .rc-time-picker-input {\n height: 36px;\n border-radius: var(--border-radius);\n border: var(--border-width) solid var(--border-color);\n padding: 10px var(--spacing-s);\n color: var(--font-on-background);\n background: transparent;\n font-size: var(--font-body1);\n\n ", "\n\n &:focus {\n border: var(--border-width) solid var(--color-primary);\n outline: none;\n }\n }\n\n .rc-time-picker-clear {\n top: 6px;\n right: 8px;\n\n i:after {\n font-size: var(--font-body1);\n }\n }\n }\n"])), _ref => {
|
|
23
|
+
let {
|
|
24
|
+
disabled
|
|
25
|
+
} = _ref;
|
|
37
26
|
return disabled && 'opacity: 0.5;';
|
|
38
27
|
});
|
|
39
|
-
|
|
40
|
-
var _default = TimeInput;
|
|
41
|
-
exports.default = _default;
|
|
28
|
+
var _default = exports.default = TimeInput;
|