@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.
Files changed (229) hide show
  1. package/Tab/Tab.js +9 -13
  2. package/Tab/TabList.js +14 -32
  3. package/Tab/TabPanel.js +21 -58
  4. package/Tab/TabTab.js +20 -40
  5. package/Tab/index.js +2 -10
  6. package/Tab/subComponent/TabContext.js +2 -5
  7. package/animate/Collapse.js +26 -53
  8. package/animate/Loader.js +21 -26
  9. package/animate/NumberCounter.js +22 -44
  10. package/animate/PulseRing.js +9 -21
  11. package/animate/Spinner.js +2 -10
  12. package/animate/index.js +5 -11
  13. package/backdrop/BaseBackdrop.js +2 -9
  14. package/backdrop/LoadingBackdrop.js +2 -9
  15. package/backdrop/ModalBackdrop.js +2 -9
  16. package/backdrop/index.js +3 -7
  17. package/badge/Badge.js +2 -11
  18. package/badge/BadgeDot.js +2 -10
  19. package/badge/BadgeFill.js +15 -20
  20. package/badge/BadgeWithText.js +6 -13
  21. package/badge/index.js +4 -9
  22. package/billing/BarChart.js +10 -17
  23. package/billing/Grid.js +11 -15
  24. package/billing/Header2.js +6 -9
  25. package/billing/Header3.js +9 -16
  26. package/billing/Paragraph.js +8 -14
  27. package/billing/ParagraphGroup.js +6 -9
  28. package/billing/ParagraphText.js +7 -12
  29. package/billing/Section.js +13 -23
  30. package/billing/SectionBody.js +5 -8
  31. package/billing/SectionHeader.js +7 -12
  32. package/breadcrumb/Breadcrumb.js +11 -21
  33. package/breadcrumb/index.js +1 -3
  34. package/button/Button.js +41 -38
  35. package/button/ButtonGroup.js +21 -18
  36. package/button/IconButton.js +29 -29
  37. package/button/ScrollToTopButton.js +12 -39
  38. package/button/index.js +4 -9
  39. package/callout/Callout.js +13 -26
  40. package/callout/index.js +1 -3
  41. package/chart/BarChart.js +28 -53
  42. package/chart/DoughnutChart.js +23 -62
  43. package/chart/LineChart.js +33 -55
  44. package/chart/SingleBarChart.js +11 -17
  45. package/chart/index.js +5 -12
  46. package/chart/utils/customTooltip.js +26 -43
  47. package/chart/utils/htmlLegendPlugin.js +24 -30
  48. package/chart/utils/index.js +3 -7
  49. package/chart/utils/padEmptyChartBar.js +24 -22
  50. package/container/FlexContainer.js +9 -12
  51. package/container/index.js +1 -3
  52. package/cropper/Cropper.js +21 -34
  53. package/cropper/CropperModalHandler.js +15 -21
  54. package/cropper/index.js +2 -5
  55. package/cropper/subComponent/CropImageModal.js +23 -58
  56. package/datetimePicker/DatePicker.js +103 -217
  57. package/datetimePicker/DatePickerV2.js +116 -221
  58. package/datetimePicker/DatetimePicker.js +27 -48
  59. package/datetimePicker/DatetimePickerV2.js +115 -231
  60. package/datetimePicker/TimeInput.js +9 -22
  61. package/datetimePicker/TimePicker.js +94 -151
  62. package/datetimePicker/TimePickerStyle.js +2 -9
  63. package/datetimePicker/accordion/Month.js +70 -90
  64. package/datetimePicker/accordion/Year.js +91 -135
  65. package/datetimePicker/hooks/index.js +3 -7
  66. package/datetimePicker/hooks/useChangeNumber.js +14 -27
  67. package/datetimePicker/hooks/useDecrease.js +19 -35
  68. package/datetimePicker/hooks/useIncrease.js +19 -35
  69. package/datetimePicker/index.js +7 -15
  70. package/datetimePicker/provider/constant.js +2 -3
  71. package/datetimePicker/subComponent/Accordion.js +108 -158
  72. package/datetimePicker/subComponent/CustomTimeInput.js +18 -48
  73. package/datetimePicker/subComponent/DateTimePickerContext.js +2 -5
  74. package/datetimePicker/utils/GMTDate.js +3 -7
  75. package/datetimePicker/utils/pad.js +2 -6
  76. package/datetimePicker/utils/toUTC0.js +3 -6
  77. package/descriptionList/DescriptionDetail.js +5 -10
  78. package/descriptionList/DescriptionList.js +5 -10
  79. package/descriptionList/DescriptionTerm.js +2 -9
  80. package/descriptionList/index.js +3 -7
  81. package/divider/Divider.js +9 -12
  82. package/divider/index.js +1 -3
  83. package/dropdown/Dropdown.js +28 -65
  84. package/dropdown/DropdownButtonOption.js +2 -9
  85. package/dropdown/DropdownContent.js +33 -64
  86. package/dropdown/DropdownDivOption.js +2 -9
  87. package/dropdown/DropdownItem.js +10 -16
  88. package/dropdown/DropdownLinkOption.js +2 -9
  89. package/dropdown/DropdownToggle.js +18 -38
  90. package/dropdown/index.js +6 -17
  91. package/dropdown/subComponent/DropdownContext.js +2 -5
  92. package/dropzone/FileDropzone.js +148 -302
  93. package/dropzone/ImageDropzone.js +96 -171
  94. package/dropzone/index.js +2 -5
  95. package/dropzone/subComponent/Message.js +7 -14
  96. package/figure/IconFigure.js +9 -16
  97. package/figure/ImageFigure.js +11 -17
  98. package/figure/index.js +2 -5
  99. package/file/HiddenFileInput.js +5 -14
  100. package/file/index.js +1 -3
  101. package/form/Checkbox.js +34 -43
  102. package/form/FormItem.js +2 -9
  103. package/form/Input.js +13 -15
  104. package/form/Label.js +10 -13
  105. package/form/MutedText.js +5 -10
  106. package/form/RadioButton.js +20 -32
  107. package/form/Searchbox.js +21 -65
  108. package/form/Slider.js +14 -0
  109. package/form/SwitchButton.js +34 -39
  110. package/form/Textarea.js +2 -11
  111. package/form/index.js +9 -19
  112. package/grid/Column.js +17 -17
  113. package/grid/Grid.js +13 -14
  114. package/grid/index.js +2 -5
  115. package/heading/Heading1.js +5 -10
  116. package/heading/Heading2.js +9 -12
  117. package/heading/Heading3.js +21 -18
  118. package/heading/index.js +3 -7
  119. package/helmet/Helmet.js +6 -9
  120. package/helmet/index.js +2 -5
  121. package/iconbox/ApplicationIconBox.js +25 -31
  122. package/iconbox/IconBox.js +11 -24
  123. package/iconbox/IconBoxV2.js +14 -26
  124. package/iconbox/index.js +3 -7
  125. package/iconbox/subComponent/IconBoxFigure.js +25 -20
  126. package/iconbox/subComponent/IconBoxImage.js +15 -18
  127. package/image/ImageFluid.js +2 -10
  128. package/image/UploadImage.js +65 -113
  129. package/image/index.js +2 -5
  130. package/index.js +44 -130
  131. package/jsoneditor/JsonEditor.js +10 -32
  132. package/jsoneditor/index.js +1 -3
  133. package/keyframe/Pulse.js +2 -7
  134. package/keyframe/Spin.js +2 -7
  135. package/link/LinkSpan.js +22 -35
  136. package/link/index.js +1 -3
  137. package/map/GoogleMap.js +122 -175
  138. package/map/GoogleReverseGeolocation.js +79 -186
  139. package/map/LeafletMap.js +78 -132
  140. package/map/LeafletReverseGeolocation.js +49 -121
  141. package/map/index.js +4 -9
  142. package/map/subComponent/BasicLeafletMap.js +8 -14
  143. package/map/subComponent/GoogleMapContainer.js +5 -10
  144. package/map/subComponent/GoogleMapPopup.js +66 -123
  145. package/map/subComponent/GoogleMapWrapper.js +13 -32
  146. package/map/subComponent/GoogleMarkerSpiderfier.js +14 -24
  147. package/map/subComponent/LeafletDrawControl.js +47 -84
  148. package/map/subComponent/LeafletMapContainer.js +5 -10
  149. package/map/subComponent/MapSearchBoxControl.js +24 -70
  150. package/modal/StateModal.js +41 -100
  151. package/modal/TitleModal.js +89 -190
  152. package/modal/index.js +2 -5
  153. package/package.json +1 -1
  154. package/paginate/Paginate.js +40 -54
  155. package/paginate/index.js +1 -3
  156. package/popover/Popover.js +39 -87
  157. package/popover/index.js +1 -3
  158. package/qrcode/QRCode.js +10 -23
  159. package/qrcode/QRCodeContainter.js +8 -16
  160. package/qrcode/index.js +2 -5
  161. package/ribbon/Ribbon.js +4 -15
  162. package/ribbon/index.js +1 -3
  163. package/section/Section.js +57 -39
  164. package/section/SectionBody.js +15 -22
  165. package/section/SectionHeader.js +27 -27
  166. package/section/SectionToolbar.js +2 -9
  167. package/section/SectionToolbarItem.js +2 -9
  168. package/section/index.js +5 -11
  169. package/select/InputSelect.js +103 -215
  170. package/select/Select.js +204 -362
  171. package/select/index.js +2 -5
  172. package/select/subComponent/ListBox.js +9 -12
  173. package/select/subComponent/Option.js +8 -16
  174. package/select/subComponent/OptionGroup.js +2 -9
  175. package/select/subComponent/Options.js +5 -11
  176. package/select/subComponent/SearchBox.js +9 -29
  177. package/select/subComponent/SelectedMultiple.js +8 -16
  178. package/select/subComponent/SelectedSingle.js +2 -9
  179. package/styles/GlobalStyle.js +169 -91
  180. package/styles/config/breakpoint.style.js +2 -3
  181. package/styles/config/header.style.js +2 -3
  182. package/styles/config/sidebar.style.js +2 -3
  183. package/styles/index.js +2 -5
  184. package/styles/mixin/backgroundColor.js +17 -14
  185. package/styles/mixin/borderColor.js +17 -14
  186. package/styles/mixin/color.js +17 -14
  187. package/styles/mixin/colorOnBackground.js +17 -14
  188. package/styles/mixin/inputPlaceholder.js +3 -9
  189. package/styles/mixin/media.js +3 -11
  190. package/styles/mixin/rounded.js +13 -12
  191. package/styles/mixin/scrollbar.js +7 -13
  192. package/styles/theme/dark.theme.js +20 -20
  193. package/styles/theme/light.theme.js +20 -20
  194. package/styles/theme/white.theme.js +20 -20
  195. package/styles/themes.js +2 -8
  196. package/table/GridTable.js +105 -143
  197. package/table/ImageBox.js +8 -18
  198. package/table/PermissionTable.js +25 -25
  199. package/table/Table.js +137 -153
  200. package/table/__mock__/columns.js +2 -3
  201. package/table/__mock__/data.js +2 -3
  202. package/table/hooks/index.js +2 -5
  203. package/table/hooks/useCalculateDataRange.js +9 -36
  204. package/table/hooks/useGenerateSort.js +6 -17
  205. package/table/index.js +4 -9
  206. package/table/subComponent/BaseTableHeadCell.js +15 -21
  207. package/table/subComponent/GridTableFooter.js +5 -10
  208. package/table/subComponent/GridTableHeadCell.js +5 -10
  209. package/table/subComponent/Resizer.js +17 -44
  210. package/table/subComponent/TableFooter.js +5 -10
  211. package/table/subComponent/TableFooterInfo.js +2 -9
  212. package/table/subComponent/TableFooterPager.js +5 -12
  213. package/table/subComponent/TableHeadCell.js +2 -9
  214. package/table/subComponent/TableSort.js +13 -19
  215. package/tagify/TagifyStyle.js +2 -9
  216. package/tagify/Tags.js +15 -37
  217. package/tagify/index.js +2 -5
  218. package/text/Paragraph.js +25 -20
  219. package/text/index.js +1 -3
  220. package/timeline/Timeline.js +28 -37
  221. package/timeline/index.js +1 -3
  222. package/toast/CustomToastContainer.js +2 -9
  223. package/toast/MessageContainer.js +9 -18
  224. package/toast/index.js +3 -8
  225. package/toast/show.js +18 -28
  226. package/tooltip/Tooltip.js +48 -97
  227. package/tooltip/index.js +1 -3
  228. package/wizard/Wizard.js +63 -133
  229. 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 _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
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
- 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; }
49
-
50
- 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; }
51
-
52
- 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; }
53
-
54
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
55
-
56
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
57
-
58
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
59
-
60
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
61
-
62
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
63
-
64
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
65
-
66
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
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
- _useState14 = _slicedToArray(_useState13, 2),
122
- time = _useState14[0],
123
- setTime = _useState14[1];
124
-
125
- var _useState15 = (0, _react.useState)(null),
126
- _useState16 = _slicedToArray(_useState15, 2),
127
- accordionCurrentDisplayType = _useState16[0],
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
- styles = _useCustomPopper.styles,
135
- attributes = _useCustomPopper.attributes,
136
- state = _useCustomPopper.state,
137
- update = _useCustomPopper.update;
138
-
139
- var context = {
140
- fixedYear: fixedYear,
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
- var handleChangeDate = (0, _react.useCallback)(function (daysOfMonthForSelectedDate, firstWeekOfMonth, dayIndex, day) {
177
- var date = new Date(selectedDate); // 先把日期設定成所有月分都有的日期,設定月份時才不會設定到非預期的date
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
- var selectedYear = date.getFullYear();
181
- var selectedMonth = date.getMonth();
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
- var handleDisabled = (0, _react.useCallback)(function (firstWeekOfMonth, lastWeekOfMonth, daysOfMonthForSelectedDate, dayIndex, day) {
224
- var _selectedDate$split = selectedDate.split('-'),
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
- var 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)));
265
- var 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)));
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
- var handleSelectedDay = (0, _react.useCallback)(function (day, index, firstWeekOfMonth, lastWeekOfMonth, totalDays) {
282
- var selectedDateObj = new Date(selectedDate);
283
- var confirmDateObj = new Date(confirmDate);
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
- var days = (0, _react.useMemo)(function () {
296
- var date = new Date(selectedDate); // 先把日期設定成所有月分都有的日期,設定月份時才不會設定到非預期的date
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
- var daysOfMonthForSelectedDate = date.getDate();
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
- var daysOfPrevioueMonthForSelectedDate = date.getDate();
306
- date = new Date(selectedDate); // 先把日期設定成所有月分都有的日期,設定月份時才不會設定到非預期的date
307
-
199
+ const daysOfPrevioueMonthForSelectedDate = date.getDate();
200
+ date = new Date(selectedDate);
201
+ // 先把日期設定成所有月分都有的日期,設定月份時才不會設定到非預期的date
308
202
  date.setDate(1);
309
- var firstWeekOfMonth = date.getDay();
310
- date = new Date(selectedDate); // 先把日期設定成所有月分都有的日期,設定月份時才不會設定到非預期的date
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
- var lastWeekOfMonth = date.getDay();
316
- var days = [];
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 (var index = daysOfPrevioueMonthForSelectedDate; index > daysOfPrevioueMonthForSelectedDate - firstWeekOfMonth; index -= 1) {
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 (var _index = 1; _index <= 6 - lastWeekOfMonth; _index += 1) {
335
- days.push(_index);
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: function 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
- var weeks = (0, _react.useMemo)(function () {
351
- return ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'].map(function (week) {
352
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(Week, {
353
- children: week
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)(function () {
244
+ (0, _react.useEffect)(() => {
358
245
  if (!selected) return;
359
- var date = (0, _utils.datetimeTFormat)(selected);
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)(function () {
252
+ (0, _react.useEffect)(() => {
370
253
  if (!confirmDate) return;
371
- var date = (0, _utils.formatDate)(confirmDate, 'date');
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, _objectSpread(_objectSpread({}, attributes.popper), {}, {
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: function handleDisplayAccordionContent() {
394
- _handleDisplayAccordionContent('year');
277
+ handleDisplayAccordionContent: () => {
278
+ handleDisplayAccordionContent('year');
395
279
  }
396
280
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Month.default, {
397
281
  expand: accordionCurrentDisplayType === 'month',
398
- handleDisplayAccordionContent: function handleDisplayAccordionContent() {
399
- _handleDisplayAccordionContent('month');
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
- var 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"])), function (_ref2) {
422
- var displayPicker = _ref2.displayPicker;
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
- var 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"])));
427
-
428
- var Body = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", "\n\n overflow: hidden;\n padding: ", ";\n"])), function (_ref3) {
429
- var accordionCurrentDisplayType = _ref3.accordionCurrentDisplayType;
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
- }, function (_ref4) {
432
- var accordionCurrentDisplayType = _ref4.accordionCurrentDisplayType;
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
- var Footer = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n padding: 0 var(--spacing-s);\n"])));
437
-
438
- var PickerInput = (0, _styledComponents.default)(_Input.default)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n &:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n"])));
439
-
440
- var 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"])), function (_ref5) {
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
- }, function (_ref6) {
444
- var disabled = _ref6.disabled;
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
- var ConfirmButton = (0, _styledComponents.default)(_Button.default)(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n margin: 16px auto 0;\n"])));
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, _objectSpread({}, props))
17
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_rcTimePicker.default, {
18
+ ...props
19
+ })
32
20
  });
33
21
  };
34
-
35
- var 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"])), function (_ref) {
36
- var disabled = _ref.disabled;
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;