@cashub/ui 0.46.1 → 0.48.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/TabList.js +38 -26
- package/Tab/TabPanel.js +13 -20
- package/Tab/TabTab.js +36 -24
- package/Tab/index.js +15 -1
- 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 +13 -18
- package/VerticalTab/TabPanel.js +16 -20
- package/VerticalTab/TabTab.js +40 -21
- package/VerticalTab/VerticalTab.js +8 -4
- package/alert/Alert.js +12 -5
- package/animate/Collapse.js +5 -7
- package/animate/Loader.js +18 -7
- package/animate/PulseRing.js +18 -5
- package/animate/Spinner.js +8 -3
- package/backdrop/BaseBackdrop.js +9 -3
- package/backdrop/LoadingBackdrop.js +7 -3
- package/backdrop/ModalBackdrop.js +5 -3
- package/badge/Badge.js +15 -3
- package/badge/BadgeDot.js +8 -3
- package/badge/BadgeFill.js +24 -6
- package/badge/BadgeWithText.js +13 -3
- package/billing/BarChart.js +1 -1
- package/breadcrumb/Breadcrumb.js +42 -3
- package/button/Button.js +88 -20
- package/button/ButtonGroup.js +33 -9
- package/button/IconButton.js +37 -10
- package/button/ScrollToTopButton.js +12 -4
- package/callout/Callout.js +37 -8
- package/chart/BarChart.js +10 -17
- package/chart/DoughnutChart.js +34 -20
- package/chart/LineChart.js +14 -20
- package/chart/SingleBarChart.js +22 -5
- package/chart/utils/centerTextPlugin.js +2 -2
- package/chart/utils/customTooltip.js +7 -7
- package/chart/utils/htmlLegendPlugin.js +1 -1
- package/container/FlexContainer.js +15 -7
- package/cropper/Cropper.js +1 -2
- package/datetimePicker/DatePicker.js +80 -26
- package/datetimePicker/DatePickerV2.js +95 -36
- package/datetimePicker/DatetimePicker.js +174 -11
- package/datetimePicker/DatetimePickerV2.js +87 -33
- package/datetimePicker/DatetimePickerV3.js +174 -11
- package/datetimePicker/TimeInput.js +35 -10
- package/datetimePicker/TimePicker.js +77 -22
- package/datetimePicker/TimePickerStyle.js +53 -3
- package/datetimePicker/TimePickerV2.js +54 -21
- package/datetimePicker/accordion/Month.js +93 -16
- package/datetimePicker/accordion/Year.js +96 -18
- package/datetimePicker/hooks/useChangeNumber.js +3 -6
- package/datetimePicker/hooks/useDecrease.js +3 -6
- package/datetimePicker/hooks/useIncrease.js +3 -6
- package/datetimePicker/subComponent/Accordion.js +101 -20
- package/descriptionList/DescriptionDetail.js +15 -4
- package/descriptionList/DescriptionList.js +12 -4
- package/descriptionList/DescriptionTerm.js +5 -3
- package/divider/Divider.js +15 -6
- package/dropdown/DropdownButtonOption.js +22 -6
- package/dropdown/DropdownContent.js +29 -15
- package/dropdown/DropdownDivOption.js +17 -3
- package/dropdown/DropdownLinkOption.js +14 -3
- package/dropdown/DropdownToggle.js +7 -15
- package/dropzone/FileDropzone.js +121 -22
- package/dropzone/ImageDropzone.js +83 -14
- package/dropzone/subComponent/Message.js +11 -4
- package/figure/IconFigure.js +16 -7
- package/figure/ImageFigure.js +19 -6
- package/file/HiddenFileInput.js +3 -3
- package/form/Checkbox.js +74 -13
- package/form/Fieldset.js +9 -3
- package/form/FormItem.js +10 -5
- package/form/Input.js +40 -7
- package/form/Label.js +34 -10
- package/form/MutedText.js +8 -4
- package/form/PasswordInput.js +20 -13
- package/form/RadioButton.js +55 -8
- package/form/SearchSelect.js +64 -12
- package/form/Searchbox.js +45 -19
- package/form/Slider.js +28 -10
- package/form/SwitchButton.js +48 -14
- package/form/Textarea.js +30 -3
- package/form/TreeView.js +13 -6
- package/grid/Column.js +23 -10
- package/grid/Grid.js +14 -6
- package/heading/Heading1.js +8 -4
- package/heading/Heading2.js +11 -5
- package/heading/Heading3.js +20 -8
- package/iconbox/ApplicationIconBox.js +48 -12
- package/iconbox/IconBox.js +31 -7
- package/iconbox/IconBoxV2.js +33 -8
- package/iconbox/subComponent/IconBoxFigure.js +17 -9
- package/iconbox/subComponent/IconBoxImage.js +21 -8
- package/image/ImageFluid.js +7 -3
- package/image/UploadImage.js +66 -18
- package/index.js +8 -1
- package/jsoneditor/JsonEditor.js +121 -15
- package/keyframe/Pulse.js +13 -3
- package/keyframe/Spin.js +5 -3
- package/layout/Aside.js +30 -5
- package/layout/Backdrop.js +8 -4
- package/layout/Container.js +21 -5
- package/layout/Footer.js +26 -7
- package/layout/Sidebar.jsx +33 -3
- package/link/LinkSpan.js +37 -19
- package/map/GoogleMap.js +3 -7
- package/map/GoogleReverseGeolocation.js +6 -3
- package/map/LeafletMap.js +2 -2
- package/map/subComponent/GoogleMapContainer.js +16 -4
- package/map/subComponent/GoogleMapPopup.js +7 -10
- package/map/subComponent/GoogleMapWrapper.js +8 -15
- package/map/subComponent/LeafletDrawControl.js +9 -7
- package/map/subComponent/LeafletMapContainer.js +159 -4
- package/modal/StateModal.js +49 -28
- package/modal/TitleModal.js +70 -29
- package/package.json +1 -1
- package/page/Disclaimer.js +119 -3
- package/paginate/Paginate.js +54 -12
- package/popover/Popover.js +30 -25
- package/qrcode/QRCode.js +20 -6
- package/qrcode/QRCodeContainter.js +12 -4
- package/ribbon/Ribbon.js +29 -4
- package/section/Section.js +68 -20
- package/section/SectionBody.js +29 -8
- package/section/SectionHeader.js +36 -11
- package/section/SectionToolbar.js +9 -3
- package/section/SectionToolbarItem.js +8 -3
- package/select/InputSelect.js +16 -23
- package/select/Select.js +112 -43
- package/select/subComponent/Checkbox.js +24 -5
- package/select/subComponent/Footer.js +4 -3
- package/select/subComponent/ListBox.js +12 -5
- package/select/subComponent/Option.js +27 -7
- package/select/subComponent/OptionGroup.js +13 -3
- package/select/subComponent/Options.js +18 -5
- package/select/subComponent/SearchBox.js +34 -12
- package/select/subComponent/SelectedMultipleTags.js +21 -3
- package/select/subComponent/SelectedMultipleText.js +19 -4
- package/select/subComponent/SelectedSingle.js +7 -3
- package/styles/GlobalStyle.js +156 -45
- package/styles/mixin/backgroundColor.js +16 -8
- package/styles/mixin/borderColor.js +13 -7
- package/styles/mixin/color.js +13 -7
- package/styles/mixin/colorOnBackground.js +13 -7
- package/styles/mixin/inputPlaceholder.js +20 -3
- package/styles/mixin/media.js +5 -3
- package/styles/mixin/rounded.js +10 -6
- package/styles/mixin/scrollbar.js +13 -3
- package/styles/theme/dark.theme.js +15 -14
- package/styles/theme/light.theme.js +15 -14
- package/styles/theme/white.theme.js +15 -14
- package/table/GridTable.js +71 -33
- package/table/ImageBox.js +15 -5
- package/table/InfiniteGridTable.js +92 -46
- package/table/PermissionTable.js +32 -10
- package/table/SimpleGridTable.js +143 -0
- package/table/Table.js +198 -48
- package/table/__mock__/columns.js +1 -1
- package/table/index.js +7 -0
- package/table/subComponent/BaseTableHeadCell.js +37 -8
- package/table/subComponent/GridTableFooter.js +10 -4
- package/table/subComponent/GridTableHeadCell.js +6 -4
- package/table/subComponent/Resizer.js +19 -4
- package/table/subComponent/TableFooter.js +15 -6
- package/table/subComponent/TableFooterInfo.js +4 -3
- package/table/subComponent/TableFooterPager.js +19 -6
- package/table/subComponent/TableHeadCell.js +9 -3
- package/table/subComponent/TableSort.js +17 -7
- package/tagify/TagifyStyle.js +49 -3
- package/tagify/Tags.js +37 -21
- package/tagify/templates/getCreateButtonTemplate.js +5 -2
- package/text/Paragraph.js +50 -12
- package/timeline/Timeline.js +94 -17
- package/toast/CustomToastContainer.js +35 -3
- package/toast/MessageContainer.js +22 -4
- package/tooltip/Tooltip.js +47 -19
- package/treeView/TreeViewV2.js +1 -1
- package/treeView/TreeflexStyle.js +38 -3
- package/wizard/Wizard.js +115 -6
|
@@ -14,16 +14,9 @@ var _Button = _interopRequireDefault(require("../button/Button"));
|
|
|
14
14
|
var _Accordion = _interopRequireDefault(require("./subComponent/Accordion"));
|
|
15
15
|
var _Input = _interopRequireDefault(require("../form/Input"));
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
|
18
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
18
|
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); }
|
|
20
19
|
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; }
|
|
21
|
-
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
22
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
23
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
24
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
25
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
26
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
27
20
|
const DatePicker = _ref => {
|
|
28
21
|
let {
|
|
29
22
|
onConfirm,
|
|
@@ -164,8 +157,8 @@ const DatePicker = _ref => {
|
|
|
164
157
|
const handleDisplayDays = (0, _react.useMemo)(() => {
|
|
165
158
|
const daysOfMonthForSelectedDate = new Date(selectedYear, selectedMonth + 1, 0).getDate();
|
|
166
159
|
const daysOfPrevioueMonthForSelectedDate = new Date(selectedYear, selectedMonth + 1 - 1, 0).getDate();
|
|
167
|
-
const firstWeekOfMonth = new Date(
|
|
168
|
-
const lastWeekOfMonth = new Date(
|
|
160
|
+
const firstWeekOfMonth = new Date(`${selectedYear}/${selectedMonth + 1}/1`).getDay();
|
|
161
|
+
const lastWeekOfMonth = new Date(`${selectedYear}/${selectedMonth + 1}/${daysOfMonthForSelectedDate}`).getDay();
|
|
169
162
|
const days = [];
|
|
170
163
|
for (const day of [...Array(daysOfMonthForSelectedDate).keys()]) {
|
|
171
164
|
days.push(day + 1);
|
|
@@ -223,7 +216,8 @@ const DatePicker = _ref => {
|
|
|
223
216
|
onClick: handleToggle,
|
|
224
217
|
readOnly: true,
|
|
225
218
|
disabled: disabled
|
|
226
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Wrapper,
|
|
219
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Wrapper, {
|
|
220
|
+
...attributes.popper,
|
|
227
221
|
style: styles.popper,
|
|
228
222
|
placement: state && state.placement,
|
|
229
223
|
ref: setContentElement,
|
|
@@ -270,40 +264,100 @@ const DatePicker = _ref => {
|
|
|
270
264
|
children: t('Confirm')
|
|
271
265
|
})
|
|
272
266
|
})]
|
|
273
|
-
})
|
|
267
|
+
})]
|
|
274
268
|
});
|
|
275
269
|
};
|
|
276
|
-
const Wrapper = _styledComponents.default.div
|
|
270
|
+
const Wrapper = _styledComponents.default.div`
|
|
271
|
+
padding-bottom: var(--spacing-s);
|
|
272
|
+
background: var(--color-background1);
|
|
273
|
+
border-radius: var(--border-radius);
|
|
274
|
+
border: var(--border-width) solid var(--border-color);
|
|
275
|
+
box-shadow: var(--box-shadow);
|
|
276
|
+
overflow: hidden;
|
|
277
|
+
width: 286px;
|
|
278
|
+
z-index: 1;
|
|
279
|
+
color: var(--font-on-background);
|
|
280
|
+
|
|
281
|
+
display: ${_ref2 => {
|
|
277
282
|
let {
|
|
278
283
|
displayPicker
|
|
279
284
|
} = _ref2;
|
|
280
285
|
return displayPicker ? 'block' : 'none';
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
const
|
|
286
|
+
}};
|
|
287
|
+
`;
|
|
288
|
+
const Week = _styledComponents.default.div`
|
|
289
|
+
min-width: 36px;
|
|
290
|
+
height: 36px;
|
|
291
|
+
border-radius: var(--border-radius-s);
|
|
292
|
+
line-height: 36px;
|
|
293
|
+
text-align: center;
|
|
294
|
+
`;
|
|
295
|
+
const Day = _styledComponents.default.button`
|
|
296
|
+
min-width: 36px;
|
|
297
|
+
height: 36px;
|
|
298
|
+
border-radius: var(--border-radius-s);
|
|
299
|
+
line-height: 36px;
|
|
300
|
+
text-align: center;
|
|
301
|
+
padding: 0;
|
|
302
|
+
border: 0;
|
|
303
|
+
background: var(--color-background1);
|
|
304
|
+
color: var(--font-on-background);
|
|
305
|
+
&:hover {
|
|
306
|
+
background: var(--color-primary);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
${_ref3 => {
|
|
284
310
|
let {
|
|
285
311
|
selected
|
|
286
312
|
} = _ref3;
|
|
287
313
|
return selected && 'background: var(--color-hover);';
|
|
288
|
-
}
|
|
314
|
+
}}
|
|
315
|
+
|
|
316
|
+
${_ref4 => {
|
|
289
317
|
let {
|
|
290
318
|
disabled
|
|
291
319
|
} = _ref4;
|
|
292
|
-
return disabled && (0, _styledComponents.css)
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
320
|
+
return disabled && (0, _styledComponents.css)`
|
|
321
|
+
color: var(--font-on-mute);
|
|
322
|
+
background: none;
|
|
323
|
+
&:hover {
|
|
324
|
+
background: none;
|
|
325
|
+
}
|
|
326
|
+
`;
|
|
327
|
+
}}
|
|
328
|
+
`;
|
|
329
|
+
const DateContent = _styledComponents.default.div`
|
|
330
|
+
display: flex;
|
|
331
|
+
flex-wrap: wrap;
|
|
332
|
+
`;
|
|
333
|
+
const PickerInput = (0, _styledComponents.default)(_Input.default)`
|
|
334
|
+
&:disabled {
|
|
335
|
+
cursor: not-allowed;
|
|
336
|
+
opacity: 0.5;
|
|
337
|
+
}
|
|
338
|
+
`;
|
|
339
|
+
const ConfirmButton = (0, _styledComponents.default)(_Button.default)`
|
|
340
|
+
margin: 16px auto 0;
|
|
341
|
+
`;
|
|
342
|
+
const Body = _styledComponents.default.div`
|
|
343
|
+
${_ref5 => {
|
|
298
344
|
let {
|
|
299
345
|
displayType
|
|
300
346
|
} = _ref5;
|
|
301
|
-
return displayType && (0, _styledComponents.css)
|
|
302
|
-
|
|
347
|
+
return displayType && (0, _styledComponents.css)`
|
|
348
|
+
height: 216px;
|
|
349
|
+
`;
|
|
350
|
+
}}
|
|
351
|
+
|
|
352
|
+
overflow: hidden;
|
|
353
|
+
padding: ${_ref6 => {
|
|
303
354
|
let {
|
|
304
355
|
displayType
|
|
305
356
|
} = _ref6;
|
|
306
357
|
return displayType === 'year' ? ' 0 4px var(--spacing-s) var(--spacing-s)' : '0 var(--spacing-s) 0 var(--spacing-s)';
|
|
307
|
-
}
|
|
308
|
-
|
|
358
|
+
}};
|
|
359
|
+
`;
|
|
360
|
+
const Footer = _styledComponents.default.div`
|
|
361
|
+
padding: 0 var(--spacing-s);
|
|
362
|
+
`;
|
|
309
363
|
var _default = exports.default = DatePicker;
|
|
@@ -18,16 +18,9 @@ var _Year = _interopRequireDefault(require("./accordion/Year"));
|
|
|
18
18
|
var _DateTimePickerContext = _interopRequireDefault(require("./subComponent/DateTimePickerContext"));
|
|
19
19
|
var _toUTC = _interopRequireDefault(require("./utils/toUTC0"));
|
|
20
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
|
|
22
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); }
|
|
23
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; }
|
|
24
23
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
25
|
-
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
26
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
27
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
29
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
30
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
31
24
|
const DEFAULT_TIME = '00:00:00';
|
|
32
25
|
const DatePickerV2 = _ref => {
|
|
33
26
|
let {
|
|
@@ -46,7 +39,7 @@ const DatePickerV2 = _ref => {
|
|
|
46
39
|
const [contentElement, setContentElement] = (0, _react.useState)(null);
|
|
47
40
|
const [selectedDate, setSelectedDate] = (0, _react.useState)(() => {
|
|
48
41
|
const defaultDate = selected ? new Date(selected) : new Date();
|
|
49
|
-
return
|
|
42
|
+
return `${(0, _utils.formatDate)((0, _toUTC.default)(defaultDate), 'date')} ${DEFAULT_TIME}`;
|
|
50
43
|
});
|
|
51
44
|
const [confirmDate, setConfirmDate] = (0, _react.useState)(selected ? (0, _utils.formatDate)((0, _toUTC.default)(selected), 'date') : '');
|
|
52
45
|
const [displayPicker, setDisplayPicker] = (0, _react.useState)(false);
|
|
@@ -58,11 +51,11 @@ const DatePickerV2 = _ref => {
|
|
|
58
51
|
}, []);
|
|
59
52
|
const minDateWithTime = (0, _react.useMemo)(() => {
|
|
60
53
|
if (!minDate) return;
|
|
61
|
-
return
|
|
54
|
+
return `${minDate} 00:00:00`;
|
|
62
55
|
}, [minDate]);
|
|
63
56
|
const maxDateWithTime = (0, _react.useMemo)(() => {
|
|
64
57
|
if (!maxDate) return;
|
|
65
|
-
return
|
|
58
|
+
return `${maxDate} 00:00:00`;
|
|
66
59
|
}, [maxDate]);
|
|
67
60
|
const {
|
|
68
61
|
styles,
|
|
@@ -137,7 +130,7 @@ const DatePickerV2 = _ref => {
|
|
|
137
130
|
date.setDate(day);
|
|
138
131
|
}
|
|
139
132
|
const formattedDate = (0, _utils.formatDate)(date, 'date');
|
|
140
|
-
setSelectedDate(
|
|
133
|
+
setSelectedDate(`${formattedDate} ${DEFAULT_TIME}`);
|
|
141
134
|
setConfirmDate(formattedDate);
|
|
142
135
|
}, [fixedYear, selectedDate]);
|
|
143
136
|
const handleDisabled = (0, _react.useCallback)((firstDayOfMonth, lastDayOfMonth, daysOfMonthForSelectedDate, dayIndex, day) => {
|
|
@@ -148,7 +141,7 @@ const DatePickerV2 = _ref => {
|
|
|
148
141
|
return true;
|
|
149
142
|
}
|
|
150
143
|
let myDay = day.toString();
|
|
151
|
-
if (myDay.length === 1) myDay =
|
|
144
|
+
if (myDay.length === 1) myDay = `0${myDay}`;
|
|
152
145
|
if (fixedYear) {
|
|
153
146
|
if (month === '01') {
|
|
154
147
|
// disabled date before first month
|
|
@@ -176,13 +169,13 @@ const DatePickerV2 = _ref => {
|
|
|
176
169
|
}
|
|
177
170
|
month = month.toString();
|
|
178
171
|
if (month.length === 1) {
|
|
179
|
-
month =
|
|
172
|
+
month = `0${month}`;
|
|
180
173
|
}
|
|
181
174
|
year = year.toString();
|
|
182
|
-
if (year.length === 1) year =
|
|
183
|
-
if (year.length === 2) year =
|
|
184
|
-
if (year.length === 3) year =
|
|
185
|
-
const currentDate =
|
|
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}`;
|
|
186
179
|
if (minDateWithTime && currentDate < minDateWithTime) {
|
|
187
180
|
return true;
|
|
188
181
|
}
|
|
@@ -254,7 +247,7 @@ const DatePickerV2 = _ref => {
|
|
|
254
247
|
(0, _react.useEffect)(() => {
|
|
255
248
|
if (selected) {
|
|
256
249
|
const formattedDate = (0, _utils.formatDate)((0, _toUTC.default)(selected), 'date');
|
|
257
|
-
setSelectedDate(
|
|
250
|
+
setSelectedDate(`${formattedDate} ${DEFAULT_TIME}`);
|
|
258
251
|
setConfirmDate(formattedDate);
|
|
259
252
|
} else {
|
|
260
253
|
setConfirmDate('');
|
|
@@ -277,7 +270,8 @@ const DatePickerV2 = _ref => {
|
|
|
277
270
|
onConfirm('');
|
|
278
271
|
}
|
|
279
272
|
})]
|
|
280
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Picker,
|
|
273
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Picker, {
|
|
274
|
+
...attributes.popper,
|
|
281
275
|
style: styles.popper,
|
|
282
276
|
placement: state && state.placement,
|
|
283
277
|
ref: setContentElement,
|
|
@@ -306,43 +300,108 @@ const DatePickerV2 = _ref => {
|
|
|
306
300
|
children: t('Confirm')
|
|
307
301
|
})
|
|
308
302
|
})]
|
|
309
|
-
})
|
|
303
|
+
})]
|
|
310
304
|
})
|
|
311
305
|
});
|
|
312
306
|
};
|
|
313
|
-
const Wrapper = _styledComponents.default.div
|
|
314
|
-
|
|
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
|
+
`;
|
|
315
319
|
CloseButton.displayName = 'CloseButton';
|
|
316
|
-
const Picker = _styledComponents.default.div
|
|
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 => {
|
|
317
332
|
let {
|
|
318
333
|
displayPicker
|
|
319
334
|
} = _ref2;
|
|
320
335
|
return displayPicker ? 'block' : 'none';
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
const
|
|
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 => {
|
|
324
347
|
let {
|
|
325
348
|
accordionCurrentDisplayType
|
|
326
349
|
} = _ref3;
|
|
327
|
-
return accordionCurrentDisplayType && (0, _styledComponents.css)
|
|
328
|
-
|
|
350
|
+
return accordionCurrentDisplayType && (0, _styledComponents.css)`
|
|
351
|
+
height: 216px;
|
|
352
|
+
`;
|
|
353
|
+
}}
|
|
354
|
+
|
|
355
|
+
overflow: hidden;
|
|
356
|
+
padding: ${_ref4 => {
|
|
329
357
|
let {
|
|
330
358
|
accordionCurrentDisplayType
|
|
331
359
|
} = _ref4;
|
|
332
360
|
return accordionCurrentDisplayType === 'year' ? ' 0 4px var(--spacing-s) var(--spacing-s)' : '0 var(--spacing-s) 0 var(--spacing-s)';
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
const
|
|
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 => {
|
|
336
381
|
let {
|
|
337
382
|
selected
|
|
338
383
|
} = _ref5;
|
|
339
384
|
return selected && 'background: var(--color-hover);';
|
|
340
|
-
}
|
|
385
|
+
}}
|
|
386
|
+
|
|
387
|
+
${_ref6 => {
|
|
341
388
|
let {
|
|
342
389
|
disabled
|
|
343
390
|
} = _ref6;
|
|
344
|
-
return disabled && (0, _styledComponents.css)
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
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
|
+
`;
|
|
348
407
|
var _default = exports.default = DatePickerV2;
|
|
@@ -10,14 +10,7 @@ var _reactDatepicker = _interopRequireDefault(require("react-datepicker"));
|
|
|
10
10
|
require("react-datepicker/dist/react-datepicker.css");
|
|
11
11
|
var _CustomTimeInput = _interopRequireDefault(require("./subComponent/CustomTimeInput"));
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
var _templateObject;
|
|
14
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
-
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
16
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
19
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
20
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
21
14
|
const DatetimePicker = _ref => {
|
|
22
15
|
let {
|
|
23
16
|
selected = '',
|
|
@@ -63,15 +56,185 @@ const DatetimePicker = _ref => {
|
|
|
63
56
|
}, [readOnly]);
|
|
64
57
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapper, {
|
|
65
58
|
disabled: disabled,
|
|
66
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactDatepicker.default,
|
|
59
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactDatepicker.default, {
|
|
60
|
+
...datePickerProps,
|
|
67
61
|
ref: datepickerRef
|
|
68
|
-
})
|
|
62
|
+
})
|
|
69
63
|
});
|
|
70
64
|
};
|
|
71
|
-
const Wrapper = _styledComponents.default.div
|
|
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 => {
|
|
72
81
|
let {
|
|
73
82
|
disabled
|
|
74
83
|
} = _ref2;
|
|
75
84
|
return disabled ? 'cursor: not-allowed; opacity: 0.5;' : '';
|
|
76
|
-
}
|
|
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
|
+
`;
|
|
77
240
|
var _default = exports.default = DatetimePicker;
|