@cashub/ui 0.47.0 → 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 +11 -18
- 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/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
|
@@ -18,16 +18,9 @@ var _Year = _interopRequireDefault(require("./accordion/Year"));
|
|
|
18
18
|
var _TimePicker = _interopRequireDefault(require("./TimePicker"));
|
|
19
19
|
var _GMTDate = _interopRequireDefault(require("./utils/GMTDate"));
|
|
20
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
|
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 DatetimePickerV2 = _ref => {
|
|
32
25
|
let {
|
|
33
26
|
selected,
|
|
@@ -50,7 +43,7 @@ const DatetimePickerV2 = _ref => {
|
|
|
50
43
|
const [time, setTime] = (0, _react.useState)(() => {
|
|
51
44
|
const date = new Date((0, _utils.datetimeTFormat)(selected ? selected : (0, _utils.formatDate)(new Date())));
|
|
52
45
|
if (!selected) date.setHours(0, 0, 0, 0);
|
|
53
|
-
return
|
|
46
|
+
return `${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
|
|
54
47
|
});
|
|
55
48
|
const [accordionCurrentDisplayType, setAccordionCurrentDisplayType] = (0, _react.useState)(null);
|
|
56
49
|
const {
|
|
@@ -142,7 +135,7 @@ const DatetimePickerV2 = _ref => {
|
|
|
142
135
|
return true;
|
|
143
136
|
}
|
|
144
137
|
let myDay = day.toString();
|
|
145
|
-
if (myDay.length === 1) myDay =
|
|
138
|
+
if (myDay.length === 1) myDay = `0${myDay}`;
|
|
146
139
|
if (fixedYear) {
|
|
147
140
|
if (month === '01' && dayIndex + 1 <= firstWeekOfMonth) {
|
|
148
141
|
// disabledDateInJan
|
|
@@ -163,12 +156,12 @@ const DatetimePickerV2 = _ref => {
|
|
|
163
156
|
} else if (month === 13) {
|
|
164
157
|
month = 1;
|
|
165
158
|
}
|
|
166
|
-
if (year.length === 1) year =
|
|
167
|
-
if (year.length === 2) year =
|
|
168
|
-
if (year.length === 3) year =
|
|
169
|
-
if (month.toString().length === 1) month =
|
|
170
|
-
const compareMinDateDate = (0, _utils.formatDate)((0, _utils.datetimeTFormat)(new Date((0, _GMTDate.default)((0, _utils.formatDate)(new Date(
|
|
171
|
-
const compareMaxDateDate = (0, _utils.formatDate)((0, _utils.datetimeTFormat)(new Date((0, _GMTDate.default)((0, _utils.formatDate)(new Date(
|
|
159
|
+
if (year.length === 1) year = `000${year}`;
|
|
160
|
+
if (year.length === 2) year = `00${year}`;
|
|
161
|
+
if (year.length === 3) year = `0${year}`;
|
|
162
|
+
if (month.toString().length === 1) month = `0${month}`;else month = month.toString();
|
|
163
|
+
const compareMinDateDate = (0, _utils.formatDate)((0, _utils.datetimeTFormat)(new Date((0, _GMTDate.default)((0, _utils.formatDate)(new Date(`${year}-${month}-${myDay}`)), 'date')).setHours(23, 59, 59, 59)));
|
|
164
|
+
const compareMaxDateDate = (0, _utils.formatDate)((0, _utils.datetimeTFormat)(new Date((0, _GMTDate.default)((0, _utils.formatDate)(new Date(`${year}-${month}-${myDay}`)), 'date')).setHours(0, 0, 0, 0)));
|
|
172
165
|
if (minDate && !maxDate && minDate > compareMinDateDate) {
|
|
173
166
|
return true;
|
|
174
167
|
}
|
|
@@ -257,7 +250,7 @@ const DatetimePickerV2 = _ref => {
|
|
|
257
250
|
(0, _react.useEffect)(() => {
|
|
258
251
|
if (!confirmDate) return;
|
|
259
252
|
const date = (0, _utils.formatDate)(confirmDate, 'date');
|
|
260
|
-
setInputValue(
|
|
253
|
+
setInputValue(`${date} ${time}`);
|
|
261
254
|
}, [confirmDate, time]);
|
|
262
255
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DateTimePickerContext.default.Provider, {
|
|
263
256
|
value: context,
|
|
@@ -269,7 +262,8 @@ const DatetimePickerV2 = _ref => {
|
|
|
269
262
|
onClick: handleToggle,
|
|
270
263
|
readOnly: true,
|
|
271
264
|
disabled: disabled
|
|
272
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Wrapper,
|
|
265
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Wrapper, {
|
|
266
|
+
...attributes.popper,
|
|
273
267
|
style: styles.popper,
|
|
274
268
|
placement: state && state.placement,
|
|
275
269
|
ref: setContentElement,
|
|
@@ -301,41 +295,101 @@ const DatetimePickerV2 = _ref => {
|
|
|
301
295
|
children: t('Confirm')
|
|
302
296
|
})
|
|
303
297
|
})]
|
|
304
|
-
})
|
|
298
|
+
})]
|
|
305
299
|
})
|
|
306
300
|
});
|
|
307
301
|
};
|
|
308
|
-
const Wrapper = _styledComponents.default.div
|
|
302
|
+
const Wrapper = _styledComponents.default.div`
|
|
303
|
+
padding-bottom: var(--spacing-s);
|
|
304
|
+
background: var(--color-background1);
|
|
305
|
+
border-radius: var(--border-radius);
|
|
306
|
+
border: var(--border-width) solid var(--border-color);
|
|
307
|
+
box-shadow: var(--box-shadow);
|
|
308
|
+
overflow: hidden;
|
|
309
|
+
width: 286px;
|
|
310
|
+
z-index: 1;
|
|
311
|
+
color: var(--font-on-background);
|
|
312
|
+
|
|
313
|
+
display: ${_ref2 => {
|
|
309
314
|
let {
|
|
310
315
|
displayPicker
|
|
311
316
|
} = _ref2;
|
|
312
317
|
return displayPicker ? 'block' : 'none';
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
const
|
|
318
|
+
}};
|
|
319
|
+
`;
|
|
320
|
+
const Week = _styledComponents.default.div`
|
|
321
|
+
height: 36px;
|
|
322
|
+
width: calc(100% / 7);
|
|
323
|
+
border-radius: var(--border-radius-s);
|
|
324
|
+
line-height: 36px;
|
|
325
|
+
text-align: center;
|
|
326
|
+
`;
|
|
327
|
+
const Body = _styledComponents.default.div`
|
|
328
|
+
${_ref3 => {
|
|
316
329
|
let {
|
|
317
330
|
accordionCurrentDisplayType
|
|
318
331
|
} = _ref3;
|
|
319
|
-
return accordionCurrentDisplayType && (0, _styledComponents.css)
|
|
320
|
-
|
|
332
|
+
return accordionCurrentDisplayType && (0, _styledComponents.css)`
|
|
333
|
+
height: 216px;
|
|
334
|
+
`;
|
|
335
|
+
}}
|
|
336
|
+
|
|
337
|
+
overflow: hidden;
|
|
338
|
+
padding: ${_ref4 => {
|
|
321
339
|
let {
|
|
322
340
|
accordionCurrentDisplayType
|
|
323
341
|
} = _ref4;
|
|
324
342
|
return accordionCurrentDisplayType === 'year' ? ' 0 4px var(--spacing-s) var(--spacing-s)' : '0 var(--spacing-s) 0 var(--spacing-s)';
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
const
|
|
328
|
-
|
|
343
|
+
}};
|
|
344
|
+
`;
|
|
345
|
+
const Footer = _styledComponents.default.div`
|
|
346
|
+
padding: 0 var(--spacing-s);
|
|
347
|
+
`;
|
|
348
|
+
const PickerInput = (0, _styledComponents.default)(_Input.default)`
|
|
349
|
+
&:disabled {
|
|
350
|
+
cursor: not-allowed;
|
|
351
|
+
opacity: 0.5;
|
|
352
|
+
}
|
|
353
|
+
`;
|
|
354
|
+
const Day = _styledComponents.default.button`
|
|
355
|
+
width: calc(100% / 7);
|
|
356
|
+
height: 36px;
|
|
357
|
+
border-radius: var(--border-radius-s);
|
|
358
|
+
line-height: 36px;
|
|
359
|
+
text-align: center;
|
|
360
|
+
padding: 0;
|
|
361
|
+
border: 0;
|
|
362
|
+
background: var(--color-background1);
|
|
363
|
+
color: var(--font-on-background);
|
|
364
|
+
&:hover {
|
|
365
|
+
background: var(--color-primary);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
${_ref5 => {
|
|
329
369
|
let {
|
|
330
370
|
selected
|
|
331
371
|
} = _ref5;
|
|
332
372
|
return selected && 'background: var(--color-hover);';
|
|
333
|
-
}
|
|
373
|
+
}}
|
|
374
|
+
|
|
375
|
+
${_ref6 => {
|
|
334
376
|
let {
|
|
335
377
|
disabled
|
|
336
378
|
} = _ref6;
|
|
337
|
-
return disabled && (0, _styledComponents.css)
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
379
|
+
return disabled && (0, _styledComponents.css)`
|
|
380
|
+
color: var(--font-on-mute);
|
|
381
|
+
background: none;
|
|
382
|
+
&:hover {
|
|
383
|
+
background: none;
|
|
384
|
+
}
|
|
385
|
+
`;
|
|
386
|
+
}}
|
|
387
|
+
`;
|
|
388
|
+
const ConfirmButton = (0, _styledComponents.default)(_Button.default)`
|
|
389
|
+
margin: 16px auto 0;
|
|
390
|
+
`;
|
|
391
|
+
const DateContent = _styledComponents.default.div`
|
|
392
|
+
display: flex;
|
|
393
|
+
flex-wrap: wrap;
|
|
394
|
+
`;
|
|
341
395
|
var _default = exports.default = DatetimePickerV2;
|
|
@@ -10,14 +10,7 @@ var _reactDatepicker = _interopRequireDefault(require("react-datepicker"));
|
|
|
10
10
|
require("react-datepicker/dist/react-datepicker.css");
|
|
11
11
|
var _TimePickerV = _interopRequireDefault(require("./TimePickerV2"));
|
|
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 DatetimePickerV3 = _ref => {
|
|
22
15
|
let {
|
|
23
16
|
selected = '',
|
|
@@ -78,15 +71,185 @@ const DatetimePickerV3 = _ref => {
|
|
|
78
71
|
}, [readOnly]);
|
|
79
72
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapper, {
|
|
80
73
|
disabled: disabled,
|
|
81
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactDatepicker.default,
|
|
74
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactDatepicker.default, {
|
|
75
|
+
...datePickerProps,
|
|
82
76
|
ref: datepickerRef
|
|
83
|
-
})
|
|
77
|
+
})
|
|
84
78
|
});
|
|
85
79
|
};
|
|
86
|
-
const Wrapper = _styledComponents.default.div
|
|
80
|
+
const Wrapper = _styledComponents.default.div`
|
|
81
|
+
.react-datepicker-wrapper,
|
|
82
|
+
.react-datepicker__input-container {
|
|
83
|
+
width: 100%;
|
|
84
|
+
|
|
85
|
+
> input {
|
|
86
|
+
width: 100%;
|
|
87
|
+
height: 36px;
|
|
88
|
+
color: var(--font-on-background);
|
|
89
|
+
background: transparent;
|
|
90
|
+
border-radius: var(--border-radius-l);
|
|
91
|
+
border: var(--border-width) solid var(--border-color);
|
|
92
|
+
padding: 0 var(--spacing-s);
|
|
93
|
+
outline: none;
|
|
94
|
+
|
|
95
|
+
${_ref2 => {
|
|
87
96
|
let {
|
|
88
97
|
disabled
|
|
89
98
|
} = _ref2;
|
|
90
99
|
return disabled ? 'cursor: not-allowed; opacity: 0.5;' : '';
|
|
91
|
-
}
|
|
100
|
+
}}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
> input + button {
|
|
104
|
+
padding: 0;
|
|
105
|
+
right: var(--spacing-s);
|
|
106
|
+
&::after {
|
|
107
|
+
color: var(--color-primary);
|
|
108
|
+
background-color: transparent;
|
|
109
|
+
font-size: 24px;
|
|
110
|
+
padding: 0;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.react-datepicker-popper {
|
|
116
|
+
z-index: 2;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.react-datepicker-popper[data-placement^='top'] {
|
|
120
|
+
padding-bottom: var(--spacing-xs);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.react-datepicker-popper[data-placement^='bottom'] {
|
|
124
|
+
padding-top: var(--spacing-xs);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.react-datepicker {
|
|
128
|
+
box-shadow: var(--box-shadow);
|
|
129
|
+
border-radius: var(--border-radius);
|
|
130
|
+
border: var(--border-width) solid var(--border-color);
|
|
131
|
+
padding: var(--spacing-s);
|
|
132
|
+
font-size: var(--font-body1);
|
|
133
|
+
color: var(--font-on-background);
|
|
134
|
+
background: var(--color-background1);
|
|
135
|
+
|
|
136
|
+
.react-datepicker__triangle {
|
|
137
|
+
&::before,
|
|
138
|
+
&::after {
|
|
139
|
+
display: none;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.react-datepicker__header {
|
|
144
|
+
border: none;
|
|
145
|
+
padding: 0;
|
|
146
|
+
background: var(--color-background1);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.react-datepicker__current-month {
|
|
150
|
+
line-height: 36px;
|
|
151
|
+
color: var(--font-on-background);
|
|
152
|
+
font-size: var(--font-body1);
|
|
153
|
+
font-weight: var(--font-normal);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.react-datepicker__day-names {
|
|
157
|
+
margin: 0;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.react-datepicker__day-name,
|
|
161
|
+
.react-datepicker__day {
|
|
162
|
+
width: 36px;
|
|
163
|
+
height: 36px;
|
|
164
|
+
line-height: 36px;
|
|
165
|
+
color: var(--font-on-background);
|
|
166
|
+
font-weight: var(--font-normal);
|
|
167
|
+
margin: 0;
|
|
168
|
+
border-radius: 4px;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.react-datepicker__day:hover {
|
|
172
|
+
background: var(--color-hover);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.react-datepicker__day--disabled {
|
|
176
|
+
color: var(--font-on-mute);
|
|
177
|
+
background: none !important;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.react-datepicker__month {
|
|
182
|
+
margin: 0;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.react-datepicker__navigation {
|
|
186
|
+
top: 0;
|
|
187
|
+
width: 36px;
|
|
188
|
+
height: 36px;
|
|
189
|
+
margin: var(--spacing-s) var(--spacing-s) 0 var(--spacing-s);
|
|
190
|
+
border-radius: 4px;
|
|
191
|
+
|
|
192
|
+
&.react-datepicker__navigation--previous {
|
|
193
|
+
left: 0;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
&.react-datepicker__navigation--next {
|
|
197
|
+
right: 0;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
&:hover {
|
|
201
|
+
background: var(--color-hover);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.react-datepicker__navigation-icon::before {
|
|
205
|
+
border-color: var(--font-on-background);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.react-datepicker__navigation-icon--previous::before {
|
|
209
|
+
right: -4px;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.react-datepicker__navigation-icon--next::before {
|
|
213
|
+
left: -4px;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.react-datepicker__day--selected,
|
|
218
|
+
.react-datepicker__day--in-selecting-range,
|
|
219
|
+
.react-datepicker__day--in-range,
|
|
220
|
+
.react-datepicker__month-text--selected,
|
|
221
|
+
.react-datepicker__month-text--in-selecting-range,
|
|
222
|
+
.react-datepicker__month-text--in-range,
|
|
223
|
+
.react-datepicker__quarter-text--selected,
|
|
224
|
+
.react-datepicker__quarter-text--in-selecting-range,
|
|
225
|
+
.react-datepicker__quarter-text--in-range,
|
|
226
|
+
.react-datepicker__year-text--selected,
|
|
227
|
+
.react-datepicker__year-text--in-selecting-range,
|
|
228
|
+
.react-datepicker__year-text--in-range {
|
|
229
|
+
background: var(--color-primary) !important;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.react-datepicker__day--keyboard-selected,
|
|
233
|
+
.react-datepicker__month-text--keyboard-selected,
|
|
234
|
+
.react-datepicker__quarter-text--keyboard-selected,
|
|
235
|
+
.react-datepicker__year-text--keyboard-selected {
|
|
236
|
+
background: none;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.react-datepicker__input-time-container {
|
|
240
|
+
margin: 0;
|
|
241
|
+
margin-top: var(--spacing-s);
|
|
242
|
+
margin-left: var(--spacing-xs);
|
|
243
|
+
|
|
244
|
+
.react-datepicker-time__input input {
|
|
245
|
+
height: 36px;
|
|
246
|
+
padding: 0 var(--spacing-xs);
|
|
247
|
+
border-radius: var(--border-radius);
|
|
248
|
+
border: var(--border-width) solid var(--border-color);
|
|
249
|
+
background: transparent;
|
|
250
|
+
color: var(--font-on-background);
|
|
251
|
+
outline: none;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
`;
|
|
92
255
|
var _default = exports.default = DatetimePickerV3;
|
|
@@ -8,24 +8,49 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
8
8
|
var _rcTimePicker = _interopRequireDefault(require("rc-time-picker"));
|
|
9
9
|
require("rc-time-picker/assets/index.css");
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
var _templateObject;
|
|
12
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
14
|
-
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; }
|
|
15
|
-
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; }
|
|
16
|
-
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; }
|
|
17
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
18
|
-
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); }
|
|
19
12
|
const TimeInput = props => {
|
|
20
13
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapper, {
|
|
21
14
|
disabled: props.disabled,
|
|
22
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_rcTimePicker.default,
|
|
15
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_rcTimePicker.default, {
|
|
16
|
+
...props
|
|
17
|
+
})
|
|
23
18
|
});
|
|
24
19
|
};
|
|
25
|
-
const Wrapper = _styledComponents.default.div
|
|
20
|
+
const Wrapper = _styledComponents.default.div`
|
|
21
|
+
.rc-time-picker {
|
|
22
|
+
width: 100%;
|
|
23
|
+
|
|
24
|
+
.rc-time-picker-input {
|
|
25
|
+
height: 36px;
|
|
26
|
+
border-radius: var(--border-radius);
|
|
27
|
+
border: var(--border-width) solid var(--border-color);
|
|
28
|
+
padding: 10px var(--spacing-s);
|
|
29
|
+
color: var(--font-on-background);
|
|
30
|
+
background: transparent;
|
|
31
|
+
font-size: var(--font-body1);
|
|
32
|
+
|
|
33
|
+
${_ref => {
|
|
26
34
|
let {
|
|
27
35
|
disabled
|
|
28
36
|
} = _ref;
|
|
29
37
|
return disabled && 'opacity: 0.5;';
|
|
30
|
-
}
|
|
38
|
+
}}
|
|
39
|
+
|
|
40
|
+
&:focus {
|
|
41
|
+
border: var(--border-width) solid var(--color-primary);
|
|
42
|
+
outline: none;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.rc-time-picker-clear {
|
|
47
|
+
top: 6px;
|
|
48
|
+
right: 8px;
|
|
49
|
+
|
|
50
|
+
i:after {
|
|
51
|
+
font-size: var(--font-body1);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
31
56
|
var _default = exports.default = TimeInput;
|
|
@@ -13,14 +13,7 @@ var _utils = require("@cashub/utils");
|
|
|
13
13
|
var _hooks = require("./hooks");
|
|
14
14
|
var _pad = _interopRequireDefault(require("./utils/pad"));
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
17
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
|
-
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
19
|
-
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; }
|
|
20
|
-
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; }
|
|
21
|
-
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; }
|
|
22
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
23
|
-
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); }
|
|
24
17
|
const LENGTH = 2;
|
|
25
18
|
const PAD_STRING = '0';
|
|
26
19
|
const TimePicker = _ref => {
|
|
@@ -46,7 +39,7 @@ const TimePicker = _ref => {
|
|
|
46
39
|
});
|
|
47
40
|
(0, _react.useEffect)(() => {
|
|
48
41
|
if (typeof onChange === 'function' && time.hour && time.minute && time.second) {
|
|
49
|
-
onChange(
|
|
42
|
+
onChange(`${time.hour}:${time.minute}:${time.second}`);
|
|
50
43
|
}
|
|
51
44
|
}, [onChange, time.hour, time.minute, time.second]);
|
|
52
45
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Container, {
|
|
@@ -99,7 +92,9 @@ const Hour = _ref2 => {
|
|
|
99
92
|
onKeyUp: handleKeyUp,
|
|
100
93
|
onBlur: event => {
|
|
101
94
|
setTime(previous => {
|
|
102
|
-
const newState =
|
|
95
|
+
const newState = {
|
|
96
|
+
...previous
|
|
97
|
+
};
|
|
103
98
|
newState[NAME] = (0, _pad.default)(event.target.value, LENGTH, PAD_STRING);
|
|
104
99
|
return newState;
|
|
105
100
|
});
|
|
@@ -123,7 +118,7 @@ const Minute = _ref3 => {
|
|
|
123
118
|
const NAME = 'minute';
|
|
124
119
|
const MIN = 0;
|
|
125
120
|
const MAX = 59;
|
|
126
|
-
const [minuteId] = (0, _react.useState)((0, _lodash.default)(
|
|
121
|
+
const [minuteId] = (0, _react.useState)((0, _lodash.default)(`${NAME}-`));
|
|
127
122
|
const increase = (0, _hooks.useIncrease)(MIN, MAX, setTime, {
|
|
128
123
|
name: NAME,
|
|
129
124
|
length: LENGTH,
|
|
@@ -151,7 +146,9 @@ const Minute = _ref3 => {
|
|
|
151
146
|
onKeyUp: handleKeyUp,
|
|
152
147
|
onBlur: event => {
|
|
153
148
|
setTime(previous => {
|
|
154
|
-
const newState =
|
|
149
|
+
const newState = {
|
|
150
|
+
...previous
|
|
151
|
+
};
|
|
155
152
|
newState[NAME] = (0, _pad.default)(event.target.value, LENGTH, PAD_STRING);
|
|
156
153
|
return newState;
|
|
157
154
|
});
|
|
@@ -176,7 +173,7 @@ const Second = _ref4 => {
|
|
|
176
173
|
const NAME = 'second';
|
|
177
174
|
const MIN = 0;
|
|
178
175
|
const MAX = 59;
|
|
179
|
-
const [secondId] = (0, _react.useState)((0, _lodash.default)(
|
|
176
|
+
const [secondId] = (0, _react.useState)((0, _lodash.default)(`${NAME}-`));
|
|
180
177
|
const increase = (0, _hooks.useIncrease)(MIN, MAX, setTime, {
|
|
181
178
|
name: NAME,
|
|
182
179
|
length: LENGTH,
|
|
@@ -204,7 +201,9 @@ const Second = _ref4 => {
|
|
|
204
201
|
onKeyUp: handleKeyUp,
|
|
205
202
|
onBlur: event => {
|
|
206
203
|
setTime(previous => {
|
|
207
|
-
const newState =
|
|
204
|
+
const newState = {
|
|
205
|
+
...previous
|
|
206
|
+
};
|
|
208
207
|
newState[NAME] = (0, _pad.default)(event.target.value, LENGTH, PAD_STRING);
|
|
209
208
|
return newState;
|
|
210
209
|
});
|
|
@@ -233,14 +232,18 @@ const useKeyUp = (increase, decrease, min, max, setState, name) => {
|
|
|
233
232
|
break;
|
|
234
233
|
case _utils.KEY_CODE.HOME:
|
|
235
234
|
setState(previous => {
|
|
236
|
-
const newState =
|
|
235
|
+
const newState = {
|
|
236
|
+
...previous
|
|
237
|
+
};
|
|
237
238
|
newState[name] = (0, _pad.default)(min, LENGTH, PAD_STRING);
|
|
238
239
|
return newState;
|
|
239
240
|
});
|
|
240
241
|
break;
|
|
241
242
|
case _utils.KEY_CODE.END:
|
|
242
243
|
setState(previous => {
|
|
243
|
-
const newState =
|
|
244
|
+
const newState = {
|
|
245
|
+
...previous
|
|
246
|
+
};
|
|
244
247
|
newState[name] = (0, _pad.default)(max, LENGTH, PAD_STRING);
|
|
245
248
|
return newState;
|
|
246
249
|
});
|
|
@@ -250,13 +253,65 @@ const useKeyUp = (increase, decrease, min, max, setState, name) => {
|
|
|
250
253
|
}
|
|
251
254
|
}, [increase, decrease, min, max, setState, name]);
|
|
252
255
|
};
|
|
253
|
-
const Container = _styledComponents.default.div
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
256
|
+
const Container = _styledComponents.default.div`
|
|
257
|
+
display: flex;
|
|
258
|
+
align-items: center;
|
|
259
|
+
justify-content: center;
|
|
260
|
+
`;
|
|
261
|
+
const Label = _styledComponents.default.label`
|
|
262
|
+
display: inline-block;
|
|
263
|
+
color: var(--font-on-background);
|
|
264
|
+
font-size: var(--font-body1);
|
|
265
|
+
margin-right: 12px;
|
|
266
|
+
`;
|
|
267
|
+
const Section = _styledComponents.default.div`
|
|
268
|
+
display: inline-flex;
|
|
269
|
+
height: 36px;
|
|
270
|
+
width: 56px;
|
|
271
|
+
padding: calc(var(--spacing-xs) / 2) var(--spacing-xs);
|
|
272
|
+
border: var(--border-width) solid var(--border-color);
|
|
273
|
+
border-radius: var(--border-radius-s);
|
|
274
|
+
background: transparent;
|
|
275
|
+
color: var(--font-on-background);
|
|
276
|
+
`;
|
|
277
|
+
const Input = _styledComponents.default.input`
|
|
278
|
+
width: calc(100% - 4px - 12px);
|
|
279
|
+
border: none;
|
|
280
|
+
background: transparent;
|
|
281
|
+
color: inherit;
|
|
282
|
+
|
|
283
|
+
&:focus {
|
|
284
|
+
outline: none;
|
|
285
|
+
}
|
|
286
|
+
`;
|
|
257
287
|
const StepperButton = _styledComponents.default.div.attrs(() => ({
|
|
258
288
|
role: 'button'
|
|
259
|
-
}))
|
|
260
|
-
|
|
261
|
-
|
|
289
|
+
}))`
|
|
290
|
+
width: 12px;
|
|
291
|
+
height: 12px;
|
|
292
|
+
|
|
293
|
+
> svg {
|
|
294
|
+
width: 100%;
|
|
295
|
+
height: 100%;
|
|
296
|
+
vertical-align: top;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
&:first-child {
|
|
300
|
+
margin-bottom: 2px;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
&:hover {
|
|
304
|
+
color: var(--color-primary);
|
|
305
|
+
}
|
|
306
|
+
`;
|
|
307
|
+
const Stepper = _styledComponents.default.div`
|
|
308
|
+
margin-left: calc(var(--spacing-xs) / 2);
|
|
309
|
+
`;
|
|
310
|
+
const Delimiter = _styledComponents.default.span`
|
|
311
|
+
display: inline-block;
|
|
312
|
+
color: var(--font-on-background);
|
|
313
|
+
font-size: var(--font-body1);
|
|
314
|
+
width: 12px;
|
|
315
|
+
text-align: center;
|
|
316
|
+
`;
|
|
262
317
|
var _default = exports.default = TimePicker;
|