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