@cashub/ui-elv 1.0.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/Tab.js +28 -0
- package/Tab/TabList.js +167 -0
- package/Tab/TabPanel.js +49 -0
- package/Tab/TabTab.js +105 -0
- package/Tab/index.js +30 -0
- package/Tab/subComponent/TabContext.js +9 -0
- 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 +27 -0
- package/VerticalTab/TabPanel.js +52 -0
- package/VerticalTab/TabTab.js +70 -0
- package/VerticalTab/VerticalTab.js +41 -0
- package/VerticalTab/index.js +16 -0
- package/VerticalTab/subComponent/TabContext.js +9 -0
- package/alert/Alert.js +29 -0
- package/alert/index.js +13 -0
- package/animate/Collapse.js +71 -0
- package/animate/Loader.js +58 -0
- package/animate/NumberCounter.js +51 -0
- package/animate/PulseRing.js +35 -0
- package/animate/Spinner.js +18 -0
- package/animate/index.js +41 -0
- package/assets/css/autocomplete.css +16 -0
- package/assets/css/font.css +4 -0
- package/assets/css/global.css +2 -0
- package/assets/font/helvetica/Helvetica.ttf +0 -0
- package/assets/font/nanumGothic/NanumGothic-Bold.ttf +0 -0
- package/assets/font/nanumGothic/NanumGothic-ExtraBold.ttf +0 -0
- package/assets/font/nanumGothic/NanumGothic-Regular.ttf +0 -0
- package/assets/icons/app-management.png +0 -0
- package/assets/icons/burger-black.png +0 -0
- package/assets/icons/burger-white.png +0 -0
- package/assets/icons/burger.png +0 -0
- package/assets/icons/file.svg +1 -0
- package/assets/icons/map_icon1.png +0 -0
- package/assets/icons/map_icon4.png +0 -0
- package/assets/images/bg-aside.png +0 -0
- package/assets/images/bg-chart-circle.png +0 -0
- package/assets/images/bg-chart-triangle.png +0 -0
- package/assets/images/cashub-logo-only.png +0 -0
- package/assets/images/default-user.jpg +0 -0
- package/assets/images/logo-cashub.png +0 -0
- package/assets/images/map.png +0 -0
- package/assets/images/qrcode.png +0 -0
- package/backdrop/BaseBackdrop.js +18 -0
- package/backdrop/LoadingBackdrop.js +17 -0
- package/backdrop/ModalBackdrop.js +15 -0
- package/backdrop/index.js +27 -0
- package/badge/Badge.js +26 -0
- package/badge/BadgeDot.js +18 -0
- package/badge/BadgeFill.js +49 -0
- package/badge/BadgeFillTriangle.js +147 -0
- package/badge/BadgeWithText.js +31 -0
- package/badge/index.js +41 -0
- package/billing/BarChart.js +51 -0
- package/billing/Grid.js +45 -0
- package/billing/Header2.js +25 -0
- package/billing/Header3.js +37 -0
- package/billing/Paragraph.js +33 -0
- package/billing/ParagraphGroup.js +22 -0
- package/billing/ParagraphText.js +26 -0
- package/billing/Section.js +50 -0
- package/billing/SectionBody.js +17 -0
- package/billing/SectionHeader.js +26 -0
- package/billing/__stories__/BarChart.stories.js_bak +46 -0
- package/billing/__stories__/Grid.stories.js_bak +57 -0
- package/billing/__stories__/Header2.stories.js_bak +62 -0
- package/billing/__stories__/Header3.stories.js_bak +69 -0
- package/billing/__stories__/Paragraph.stories.js_bak +84 -0
- package/billing/__stories__/ParagraphGroup.stories.js_bak +68 -0
- package/billing/__stories__/ParagraphText.stories.js_bak +64 -0
- package/billing/__stories__/Section.stories.js_bak +115 -0
- package/billing/__stories__/SectionBody.stories.js_bak +62 -0
- package/billing/__stories__/SectionHeader.stories.js-bak +68 -0
- package/breadcrumb/Breadcrumb.js +78 -0
- package/breadcrumb/index.js +13 -0
- package/button/Button.js +154 -0
- package/button/ButtonGroup.js +61 -0
- package/button/IconButton.js +72 -0
- package/button/ScrollToTopButton.js +54 -0
- package/button/index.js +34 -0
- package/callout/Callout.js +52 -0
- package/callout/index.js +13 -0
- package/chart/BarChart.js +148 -0
- package/chart/DoughnutChart.js +118 -0
- package/chart/LineChart.js +146 -0
- package/chart/SingleBarChart.js +42 -0
- package/chart/index.js +52 -0
- package/chart/utils/centerTextPlugin.js +62 -0
- package/chart/utils/customTooltip.js +94 -0
- package/chart/utils/htmlLegendPlugin.js +89 -0
- package/chart/utils/index.js +27 -0
- package/chart/utils/padEmptyChartBar.js +53 -0
- package/chart/utils/yAxisTopTitlePlugin.js +49 -0
- package/container/FlexContainer.js +40 -0
- package/container/index.js +13 -0
- package/cropper/Cropper.js +54 -0
- package/cropper/CropperModalHandler.js +41 -0
- package/cropper/index.js +20 -0
- package/cropper/subComponent/CropImageModal.js +79 -0
- package/datetimePicker/DatePicker.js +363 -0
- package/datetimePicker/DatePickerV2.js +407 -0
- package/datetimePicker/DatetimePicker.js +240 -0
- package/datetimePicker/DatetimePickerV2.js +395 -0
- package/datetimePicker/DatetimePickerV3.js +279 -0
- package/datetimePicker/TimeInput.js +56 -0
- package/datetimePicker/TimePicker.js +317 -0
- package/datetimePicker/TimePickerStyle.js +64 -0
- package/datetimePicker/TimePickerV2.js +208 -0
- package/datetimePicker/accordion/Month.js +254 -0
- package/datetimePicker/accordion/Year.js +284 -0
- package/datetimePicker/hooks/index.js +27 -0
- package/datetimePicker/hooks/useChangeNumber.js +42 -0
- package/datetimePicker/hooks/useDecrease.js +38 -0
- package/datetimePicker/hooks/useIncrease.js +38 -0
- package/datetimePicker/index.js +69 -0
- package/datetimePicker/provider/constant.js +43 -0
- package/datetimePicker/subComponent/Accordion.js +373 -0
- package/datetimePicker/subComponent/CustomTimeInput.js +47 -0
- package/datetimePicker/subComponent/DateTimePickerContext.js +9 -0
- package/datetimePicker/utils/GMTDate.js +15 -0
- package/datetimePicker/utils/pad.js +13 -0
- package/datetimePicker/utils/toUTC0.js +13 -0
- package/descriptionList/DescriptionDetail.js +28 -0
- package/descriptionList/DescriptionList.js +25 -0
- package/descriptionList/DescriptionTerm.js +14 -0
- package/descriptionList/index.js +27 -0
- package/divider/Divider.js +31 -0
- package/divider/index.js +13 -0
- package/dropdown/Dropdown.js +55 -0
- package/dropdown/DropdownButtonOption.js +43 -0
- package/dropdown/DropdownContent.js +90 -0
- package/dropdown/DropdownDivOption.js +26 -0
- package/dropdown/DropdownItem.js +26 -0
- package/dropdown/DropdownLinkOption.js +24 -0
- package/dropdown/DropdownToggle.js +38 -0
- package/dropdown/index.js +42 -0
- package/dropdown/subComponent/DropdownContext.js +9 -0
- package/dropzone/FileDropzone.js +479 -0
- package/dropzone/ImageDropzone.js +334 -0
- package/dropzone/index.js +20 -0
- package/dropzone/subComponent/Message.js +26 -0
- package/figure/IconFigure.js +42 -0
- package/figure/ImageFigure.js +38 -0
- package/figure/index.js +20 -0
- package/file/HiddenFileInput.js +15 -0
- package/file/index.js +13 -0
- package/form/Checkbox.js +166 -0
- package/form/Fieldset.js +18 -0
- package/form/FormItem.js +22 -0
- package/form/Input.js +66 -0
- package/form/Label.js +61 -0
- package/form/MutedText.js +21 -0
- package/form/PasswordInput.js +47 -0
- package/form/RadioButton.js +103 -0
- package/form/SearchSelect.js +181 -0
- package/form/Searchbox.js +98 -0
- package/form/Slider.js +46 -0
- package/form/SwitchButton.js +105 -0
- package/form/Textarea.js +41 -0
- package/form/TreeView.js +73 -0
- package/form/index.js +104 -0
- package/grid/Column.js +46 -0
- package/grid/Grid.js +35 -0
- package/grid/index.js +20 -0
- package/heading/Heading1.js +21 -0
- package/heading/Heading2.js +28 -0
- package/heading/Heading3.js +49 -0
- package/heading/index.js +27 -0
- package/helmet/Helmet.js +23 -0
- package/helmet/index.js +20 -0
- package/iconbox/ApplicationIconBox.js +81 -0
- package/iconbox/IconBox.js +67 -0
- package/iconbox/IconBoxV2.js +72 -0
- package/iconbox/index.js +27 -0
- package/iconbox/subComponent/IconBoxFigure.js +50 -0
- package/iconbox/subComponent/IconBoxImage.js +42 -0
- package/image/ImageFluid.js +17 -0
- package/image/UploadImage.js +250 -0
- package/image/index.js +20 -0
- package/index.js +568 -0
- package/jsoneditor/JsonEditor.js +142 -0
- package/jsoneditor/index.js +13 -0
- package/keyframe/Pulse.js +21 -0
- package/keyframe/Spin.js +13 -0
- package/layout/Aside.js +48 -0
- package/layout/AsideHeader.jsx +27 -0
- package/layout/Backdrop.js +23 -0
- package/layout/Container.js +39 -0
- package/layout/Footer.js +45 -0
- package/layout/Header.jsx +55 -0
- package/layout/Layout.jsx +84 -0
- package/layout/Logo.jsx +17 -0
- package/layout/MenuIcon.jsx +27 -0
- package/layout/Sidebar.jsx +271 -0
- package/layout/index.js +13 -0
- package/link/LinkSpan.js +69 -0
- package/link/index.js +13 -0
- package/map/GoogleMap.js +448 -0
- package/map/GoogleReverseGeolocation.js +200 -0
- package/map/LeafletMap.js +231 -0
- package/map/LeafletReverseGeolocation.js +101 -0
- package/map/index.js +34 -0
- package/map/subComponent/BasicLeafletMap.js +34 -0
- package/map/subComponent/GoogleMapContainer.js +29 -0
- package/map/subComponent/GoogleMapPopup.js +109 -0
- package/map/subComponent/GoogleMapWrapper.js +40 -0
- package/map/subComponent/LeafletDrawControl.js +127 -0
- package/map/subComponent/LeafletMapContainer.js +173 -0
- package/map/subComponent/MapSearchBoxControl.js +54 -0
- package/modal/StateModal.js +178 -0
- package/modal/TitleModal.js +250 -0
- package/modal/index.js +20 -0
- package/package.json +54 -0
- package/page/Disclaimer.js +128 -0
- package/page/index.js +13 -0
- package/paginate/Paginate.js +137 -0
- package/paginate/index.js +13 -0
- package/popover/Popover.js +91 -0
- package/popover/index.js +13 -0
- package/qrcode/QRCode.js +58 -0
- package/qrcode/QRCodeContainter.js +34 -0
- package/qrcode/index.js +20 -0
- package/ribbon/Ribbon.js +42 -0
- package/ribbon/index.js +13 -0
- package/section/Section.js +133 -0
- package/section/SectionBody.js +52 -0
- package/section/SectionHeader.js +70 -0
- package/section/SectionToolbar.js +18 -0
- package/section/SectionToolbarItem.js +17 -0
- package/section/index.js +41 -0
- package/select/InputSelect.js +270 -0
- package/select/Select.js +818 -0
- package/select/index.js +20 -0
- package/select/subComponent/Checkbox.js +48 -0
- package/select/subComponent/Footer.js +13 -0
- package/select/subComponent/ListBox.js +30 -0
- package/select/subComponent/Option.js +45 -0
- package/select/subComponent/OptionGroup.js +23 -0
- package/select/subComponent/Options.js +32 -0
- package/select/subComponent/SearchBox.js +58 -0
- package/select/subComponent/SelectedMultipleCount.js +39 -0
- package/select/subComponent/SelectedMultipleTags.js +54 -0
- package/select/subComponent/SelectedMultipleText.js +70 -0
- package/select/subComponent/SelectedSingle.js +17 -0
- package/styles/GlobalStyle.js +334 -0
- package/styles/config/breakpoint.style.js +13 -0
- package/styles/config/header.style.js +10 -0
- package/styles/config/sidebar.style.js +17 -0
- package/styles/index.js +20 -0
- package/styles/mixin/backgroundColor.js +44 -0
- package/styles/mixin/borderColor.js +37 -0
- package/styles/mixin/color.js +37 -0
- package/styles/mixin/colorOnBackground.js +37 -0
- package/styles/mixin/inputPlaceholder.js +30 -0
- package/styles/mixin/media.js +21 -0
- package/styles/mixin/rounded.js +30 -0
- package/styles/mixin/scrollbar.js +32 -0
- package/styles/theme/dark.theme.js +97 -0
- package/styles/theme/light.theme.js +97 -0
- package/styles/theme/white.theme.js +97 -0
- package/styles/themes.js +16 -0
- package/table/GridTable.js +336 -0
- package/table/ImageBox.js +45 -0
- package/table/InfiniteGridTable.js +403 -0
- package/table/PermissionTable.js +64 -0
- package/table/SimpleGridTable.js +143 -0
- package/table/Table.js +568 -0
- package/table/__mock__/columns.js +70 -0
- package/table/__mock__/data.js +536 -0
- package/table/hooks/index.js +20 -0
- package/table/hooks/useCalculateDataRange.js +28 -0
- package/table/hooks/useGenerateSort.js +39 -0
- package/table/index.js +48 -0
- package/table/subComponent/BaseTableHeadCell.js +62 -0
- package/table/subComponent/GridTableFooter.js +24 -0
- package/table/subComponent/GridTableHeadCell.js +20 -0
- package/table/subComponent/Resizer.js +77 -0
- package/table/subComponent/TableFooter.js +31 -0
- package/table/subComponent/TableFooterInfo.js +13 -0
- package/table/subComponent/TableFooterPager.js +33 -0
- package/table/subComponent/TableHeadCell.js +19 -0
- package/table/subComponent/TableSort.js +38 -0
- package/tagify/TagifyStyle.js +60 -0
- package/tagify/Tags.js +56 -0
- package/tagify/index.js +27 -0
- package/tagify/templates/getCreateButtonTemplate.js +18 -0
- package/text/Paragraph.js +86 -0
- package/text/index.js +13 -0
- package/timeline/Timeline.js +139 -0
- package/timeline/index.js +13 -0
- package/toast/CustomToastContainer.js +45 -0
- package/toast/MessageContainer.js +51 -0
- package/toast/index.js +36 -0
- package/toast/show.js +39 -0
- package/toast/style.css +1 -0
- package/tooltip/Tooltip.js +140 -0
- package/tooltip/index.js +13 -0
- package/treeView/TreeViewV2.js +38 -0
- package/treeView/TreeflexStyle.js +49 -0
- package/treeView/index.js +20 -0
- package/wizard/Wizard.js +251 -0
- package/wizard/index.js +13 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _reactChartjs = require("react-chartjs-2");
|
|
8
|
+
const yAxisTopTitlePlugin = {
|
|
9
|
+
id: 'yAxisTopTitle',
|
|
10
|
+
afterDraw(chart) {
|
|
11
|
+
const {
|
|
12
|
+
options
|
|
13
|
+
} = chart.config;
|
|
14
|
+
const config = options.plugins.yAxisTopTitle;
|
|
15
|
+
if (!config || !config.title) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const {
|
|
19
|
+
title
|
|
20
|
+
} = config;
|
|
21
|
+
const {
|
|
22
|
+
ctx,
|
|
23
|
+
chartArea,
|
|
24
|
+
scales
|
|
25
|
+
} = chart;
|
|
26
|
+
const yScale = scales.y;
|
|
27
|
+
if (!yScale) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
ctx.save();
|
|
31
|
+
const {
|
|
32
|
+
font,
|
|
33
|
+
color
|
|
34
|
+
} = _reactChartjs.defaults;
|
|
35
|
+
const {
|
|
36
|
+
family,
|
|
37
|
+
size
|
|
38
|
+
} = font;
|
|
39
|
+
ctx.font = `bold ${size}px ${family}`;
|
|
40
|
+
ctx.fillStyle = color;
|
|
41
|
+
ctx.textAlign = 'left';
|
|
42
|
+
ctx.textBaseline = 'middle';
|
|
43
|
+
const x = yScale.left;
|
|
44
|
+
const y = chartArea.top - 24;
|
|
45
|
+
ctx.fillText(title, x, y);
|
|
46
|
+
ctx.restore();
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var _default = exports.default = yAxisTopTitlePlugin;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
const FlexContainer = _styledComponents.default.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
|
|
12
|
+
${_ref => {
|
|
13
|
+
let {
|
|
14
|
+
marginBottom
|
|
15
|
+
} = _ref;
|
|
16
|
+
return marginBottom && 'margin-bottom: var(--spacing-l)';
|
|
17
|
+
}};
|
|
18
|
+
|
|
19
|
+
${_ref2 => {
|
|
20
|
+
let {
|
|
21
|
+
wrap
|
|
22
|
+
} = _ref2;
|
|
23
|
+
return wrap && 'flex-wrap: wrap';
|
|
24
|
+
}};
|
|
25
|
+
|
|
26
|
+
${_ref3 => {
|
|
27
|
+
let {
|
|
28
|
+
alignCenter
|
|
29
|
+
} = _ref3;
|
|
30
|
+
return alignCenter && 'align-items: center;';
|
|
31
|
+
}}
|
|
32
|
+
|
|
33
|
+
${_ref4 => {
|
|
34
|
+
let {
|
|
35
|
+
spaceBetween
|
|
36
|
+
} = _ref4;
|
|
37
|
+
return spaceBetween && 'justify-content: space-between;';
|
|
38
|
+
}}
|
|
39
|
+
`;
|
|
40
|
+
var _default = exports.default = FlexContainer;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "FlexContainer", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _FlexContainer.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _FlexContainer = _interopRequireDefault(require("./FlexContainer"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
require("cropperjs/dist/cropper.css");
|
|
9
|
+
var _cropperjs = _interopRequireDefault(require("cropperjs"));
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
const CropperWrapper = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
src,
|
|
15
|
+
alt = 'picture',
|
|
16
|
+
width,
|
|
17
|
+
height,
|
|
18
|
+
cropBoxResizable = false,
|
|
19
|
+
onInitialized,
|
|
20
|
+
dragMode = 'move'
|
|
21
|
+
} = _ref;
|
|
22
|
+
const imageRef = (0, _react.useRef)(null);
|
|
23
|
+
(0, _react.useEffect)(() => {
|
|
24
|
+
const node = imageRef.current;
|
|
25
|
+
if (node !== null) {
|
|
26
|
+
const cropper = new _cropperjs.default(node, {
|
|
27
|
+
dragMode,
|
|
28
|
+
viewMode: 1,
|
|
29
|
+
initialAspectRatio: 9 / 16,
|
|
30
|
+
background: true,
|
|
31
|
+
cropBoxResizable,
|
|
32
|
+
data: {
|
|
33
|
+
width,
|
|
34
|
+
height
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
if (onInitialized) {
|
|
38
|
+
onInitialized(cropper);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return () => {
|
|
42
|
+
node?.cropper?.destroy();
|
|
43
|
+
};
|
|
44
|
+
}, [onInitialized, dragMode, width, height, cropBoxResizable]);
|
|
45
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
46
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
47
|
+
src: src,
|
|
48
|
+
alt: alt,
|
|
49
|
+
ref: imageRef,
|
|
50
|
+
crossOrigin: "anonymous"
|
|
51
|
+
})
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
var _default = exports.default = CropperWrapper;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _TitleModal = _interopRequireDefault(require("../modal/TitleModal"));
|
|
8
|
+
var _CropImageModal = _interopRequireDefault(require("./subComponent/CropImageModal"));
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
const CropperModalHandler = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
src,
|
|
14
|
+
file,
|
|
15
|
+
width,
|
|
16
|
+
height,
|
|
17
|
+
cropBoxResizable = false,
|
|
18
|
+
onCrop,
|
|
19
|
+
onClose
|
|
20
|
+
} = _ref;
|
|
21
|
+
(0, _TitleModal.default)({
|
|
22
|
+
size: 'normal',
|
|
23
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CropImageModal.default, {
|
|
24
|
+
src: src,
|
|
25
|
+
mime: file.type,
|
|
26
|
+
alt: file.name,
|
|
27
|
+
file: file,
|
|
28
|
+
width: width,
|
|
29
|
+
height: height,
|
|
30
|
+
cropBoxResizable: cropBoxResizable,
|
|
31
|
+
onCrop: onCrop,
|
|
32
|
+
onClose: onClose
|
|
33
|
+
}),
|
|
34
|
+
onClose: dismiss => {
|
|
35
|
+
if (dismiss === true && onClose) {
|
|
36
|
+
onClose();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
var _default = exports.default = CropperModalHandler;
|
package/cropper/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Cropper", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _Cropper.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "CropperModalHandler", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _CropperModalHandler.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
var _Cropper = _interopRequireDefault(require("./Cropper"));
|
|
19
|
+
var _CropperModalHandler = _interopRequireDefault(require("./CropperModalHandler"));
|
|
20
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactI18next = require("react-i18next");
|
|
9
|
+
var _utils = require("@cashub/utils");
|
|
10
|
+
var _Cropper = _interopRequireDefault(require("../Cropper"));
|
|
11
|
+
var _Button = _interopRequireDefault(require("../../button/Button"));
|
|
12
|
+
var _ButtonGroup = _interopRequireDefault(require("../../button/ButtonGroup"));
|
|
13
|
+
var _TitleModal = _interopRequireDefault(require("../../modal/TitleModal"));
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
const CropImageModal = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
src,
|
|
19
|
+
mime,
|
|
20
|
+
alt,
|
|
21
|
+
width,
|
|
22
|
+
height,
|
|
23
|
+
cropBoxResizable = false,
|
|
24
|
+
onCrop,
|
|
25
|
+
onClose,
|
|
26
|
+
close
|
|
27
|
+
} = _ref;
|
|
28
|
+
const {
|
|
29
|
+
t
|
|
30
|
+
} = (0, _reactI18next.useTranslation)();
|
|
31
|
+
const [instance, setIntance] = (0, _react.useState)(null);
|
|
32
|
+
const [resizedImage, setResizedImage] = (0, _react.useState)(null);
|
|
33
|
+
const handleCrop = (0, _react.useCallback)(() => {
|
|
34
|
+
onCrop(instance.getCroppedCanvas().toDataURL());
|
|
35
|
+
close();
|
|
36
|
+
}, [onCrop, instance, close]);
|
|
37
|
+
const handleInitialized = (0, _react.useCallback)(instance => {
|
|
38
|
+
setIntance(instance);
|
|
39
|
+
}, []);
|
|
40
|
+
const handleClose = () => {
|
|
41
|
+
if (onClose) {
|
|
42
|
+
onClose();
|
|
43
|
+
}
|
|
44
|
+
close();
|
|
45
|
+
};
|
|
46
|
+
(0, _react.useEffect)(() => {
|
|
47
|
+
(0, _utils.resizeImage)(src, mime, width > height ? width : height, 'cover', resizedImageUrl => {
|
|
48
|
+
setResizedImage(resizedImageUrl);
|
|
49
|
+
});
|
|
50
|
+
}, [src, mime, height, width]);
|
|
51
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
52
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TitleModal.default.Header, {
|
|
53
|
+
handleClose: handleClose,
|
|
54
|
+
children: t('CropImage')
|
|
55
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TitleModal.default.Body, {
|
|
56
|
+
children: resizedImage && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Cropper.default, {
|
|
57
|
+
src: resizedImage,
|
|
58
|
+
alt: alt,
|
|
59
|
+
width: width,
|
|
60
|
+
height: height,
|
|
61
|
+
cropBoxResizable: cropBoxResizable,
|
|
62
|
+
onInitialized: handleInitialized
|
|
63
|
+
})
|
|
64
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TitleModal.default.Footer, {
|
|
65
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ButtonGroup.default, {
|
|
66
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
67
|
+
danger: true,
|
|
68
|
+
onClick: handleClose,
|
|
69
|
+
children: t('button:Cancel')
|
|
70
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
71
|
+
success: true,
|
|
72
|
+
onClick: handleCrop,
|
|
73
|
+
children: t('button:Confirm')
|
|
74
|
+
})]
|
|
75
|
+
})
|
|
76
|
+
})]
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
var _default = exports.default = CropImageModal;
|
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
|
+
var _reactI18next = require("react-i18next");
|
|
10
|
+
var _reactOutsideClickHandler = _interopRequireDefault(require("react-outside-click-handler"));
|
|
11
|
+
var _hooks = require("@cashub/hooks");
|
|
12
|
+
var _utils = require("@cashub/utils");
|
|
13
|
+
var _Button = _interopRequireDefault(require("../button/Button"));
|
|
14
|
+
var _Accordion = _interopRequireDefault(require("./subComponent/Accordion"));
|
|
15
|
+
var _Input = _interopRequireDefault(require("../form/Input"));
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
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); }
|
|
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; }
|
|
20
|
+
const DatePicker = _ref => {
|
|
21
|
+
let {
|
|
22
|
+
onConfirm,
|
|
23
|
+
selected,
|
|
24
|
+
minDate,
|
|
25
|
+
maxDate,
|
|
26
|
+
fixedYear,
|
|
27
|
+
disabled
|
|
28
|
+
} = _ref;
|
|
29
|
+
const {
|
|
30
|
+
t
|
|
31
|
+
} = (0, _reactI18next.useTranslation)();
|
|
32
|
+
const [currentDisplayType, setCurrentDisplayType] = (0, _react.useState)(null);
|
|
33
|
+
const [displayPicker, setDisplayPicker] = (0, _react.useState)(false);
|
|
34
|
+
const [selectedYear, setSelectedYear] = (0, _react.useState)(selected ? new Date(selected).getFullYear() : new Date().getFullYear());
|
|
35
|
+
const [selectedMonth, setSelectedMonth] = (0, _react.useState)(selected ? new Date(selected).getMonth() : new Date().getMonth());
|
|
36
|
+
const [selectedDay, setSelectedDay] = (0, _react.useState)(selected ? new Date(selected).getDate() : new Date().getDate());
|
|
37
|
+
const [confirmYear, setConfirmYear] = (0, _react.useState)(selected ? new Date(selected).getFullYear() : '');
|
|
38
|
+
const [confirmMonth, setConfirmMonth] = (0, _react.useState)(selected ? new Date(selected).getMonth() : '');
|
|
39
|
+
const [confirmDay, setConfirmDay] = (0, _react.useState)(selected ? new Date(selected).getDate() : '');
|
|
40
|
+
const [inputValue, setInputValue] = (0, _react.useState)(selected ? selected : '');
|
|
41
|
+
const [toggleElement, setToggleElement] = (0, _react.useState)(null);
|
|
42
|
+
const [contentElement, setContentElement] = (0, _react.useState)(null);
|
|
43
|
+
const {
|
|
44
|
+
styles,
|
|
45
|
+
attributes,
|
|
46
|
+
state,
|
|
47
|
+
update
|
|
48
|
+
} = (0, _hooks.useCustomPopper)(toggleElement, contentElement, {
|
|
49
|
+
strategy: 'absolute',
|
|
50
|
+
placement: 'bottom-start'
|
|
51
|
+
});
|
|
52
|
+
const weeks = (0, _react.useMemo)(() => {
|
|
53
|
+
return ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'].map(week => /*#__PURE__*/(0, _jsxRuntime.jsx)(Week, {
|
|
54
|
+
children: week
|
|
55
|
+
}, week));
|
|
56
|
+
}, []);
|
|
57
|
+
const handleDisplayAccordionContent = (0, _react.useCallback)(type => {
|
|
58
|
+
if (currentDisplayType === type) {
|
|
59
|
+
setCurrentDisplayType(null);
|
|
60
|
+
} else {
|
|
61
|
+
setCurrentDisplayType(type);
|
|
62
|
+
}
|
|
63
|
+
}, [currentDisplayType]);
|
|
64
|
+
const handleChangeYear = selected => {
|
|
65
|
+
if (selected === 'previous') {
|
|
66
|
+
setSelectedYear(previousParams => {
|
|
67
|
+
if (previousParams <= 1) {
|
|
68
|
+
return previousParams;
|
|
69
|
+
}
|
|
70
|
+
return previousParams - 1;
|
|
71
|
+
});
|
|
72
|
+
} else if (selected === 'next') {
|
|
73
|
+
setSelectedYear(previousParams => {
|
|
74
|
+
return previousParams + 1;
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
setCurrentDisplayType(null);
|
|
78
|
+
};
|
|
79
|
+
const handleChangeMonth = selected => {
|
|
80
|
+
if (selected === 'previous') {
|
|
81
|
+
setSelectedMonth(previousParams => {
|
|
82
|
+
if (previousParams <= 0) {
|
|
83
|
+
return 11;
|
|
84
|
+
}
|
|
85
|
+
return previousParams - 1;
|
|
86
|
+
});
|
|
87
|
+
} else if (selected === 'next') {
|
|
88
|
+
setSelectedMonth(previousParams => {
|
|
89
|
+
if (previousParams >= 11) {
|
|
90
|
+
return 0;
|
|
91
|
+
}
|
|
92
|
+
return previousParams + 1;
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
setCurrentDisplayType(null);
|
|
96
|
+
};
|
|
97
|
+
const handleDisabled = (0, _react.useCallback)((firstWeekOfMonth, daysOfMonthForSelectedDate, dayIndex, day) => {
|
|
98
|
+
const selectedDate = (0, _utils.formatDate)(new Date(selectedYear, firstWeekOfMonth >= dayIndex + 1 ? selectedMonth - 1 : daysOfMonthForSelectedDate + firstWeekOfMonth < dayIndex + 1 ? selectedMonth + 1 : selectedMonth, day).getTime() + 86399 * 1000);
|
|
99
|
+
if (minDate && minDate > selectedDate || maxDate && maxDate < selectedDate) {
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
if (fixedYear) {
|
|
103
|
+
const disabledDateInDec = selectedMonth === 11 && dayIndex >= daysOfMonthForSelectedDate + firstWeekOfMonth;
|
|
104
|
+
const disabledDateInJan = selectedMonth === 0 && dayIndex < firstWeekOfMonth;
|
|
105
|
+
return !!(disabledDateInDec || disabledDateInJan);
|
|
106
|
+
}
|
|
107
|
+
return false;
|
|
108
|
+
}, [fixedYear, minDate, maxDate, selectedMonth, selectedYear]);
|
|
109
|
+
const handleChangeDate = (0, _react.useCallback)((daysOfMonthForSelectedDate, firstWeekOfMonth, dayIndex, day) => {
|
|
110
|
+
if (!fixedYear) {
|
|
111
|
+
setSelectedYear(() => {
|
|
112
|
+
if (selectedMonth === 0 && dayIndex < firstWeekOfMonth && selectedYear > 1) {
|
|
113
|
+
return selectedYear - 1;
|
|
114
|
+
} else if (selectedMonth === 11 && dayIndex >= daysOfMonthForSelectedDate + firstWeekOfMonth) {
|
|
115
|
+
return selectedYear + 1;
|
|
116
|
+
}
|
|
117
|
+
return selectedYear;
|
|
118
|
+
});
|
|
119
|
+
setConfirmYear(() => {
|
|
120
|
+
if (selectedMonth === 0 && dayIndex < firstWeekOfMonth && selectedYear > 1) {
|
|
121
|
+
return selectedYear - 1;
|
|
122
|
+
} else if (selectedMonth === 11 && dayIndex >= daysOfMonthForSelectedDate + firstWeekOfMonth) {
|
|
123
|
+
return selectedYear + 1;
|
|
124
|
+
}
|
|
125
|
+
return selectedYear;
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
setSelectedMonth(() => {
|
|
129
|
+
if (firstWeekOfMonth > dayIndex) {
|
|
130
|
+
return selectedMonth !== 0 ? selectedMonth - 1 : 11;
|
|
131
|
+
} else if (daysOfMonthForSelectedDate + firstWeekOfMonth <= dayIndex) {
|
|
132
|
+
return selectedMonth !== 11 ? selectedMonth + 1 : 0;
|
|
133
|
+
}
|
|
134
|
+
return selectedMonth;
|
|
135
|
+
});
|
|
136
|
+
setConfirmMonth(() => {
|
|
137
|
+
if (firstWeekOfMonth > dayIndex) {
|
|
138
|
+
return selectedMonth !== 0 ? selectedMonth - 1 : 11;
|
|
139
|
+
} else if (daysOfMonthForSelectedDate + firstWeekOfMonth <= dayIndex) {
|
|
140
|
+
return selectedMonth !== 11 ? selectedMonth + 1 : 0;
|
|
141
|
+
}
|
|
142
|
+
return selectedMonth;
|
|
143
|
+
});
|
|
144
|
+
setConfirmDay(day);
|
|
145
|
+
}, [fixedYear, selectedMonth, selectedYear]);
|
|
146
|
+
const handleSelectedDay = (0, _react.useCallback)((day, daysOfMonthForSelectedDate, index, firstWeekOfMonth, lastWeekOfMonth) => {
|
|
147
|
+
if (confirmDay === day && confirmYear === selectedYear && confirmMonth === selectedMonth) {
|
|
148
|
+
if (firstWeekOfMonth === 6 && lastWeekOfMonth === 6) {
|
|
149
|
+
return true;
|
|
150
|
+
} else if (firstWeekOfMonth !== 6 && lastWeekOfMonth === 6) {
|
|
151
|
+
return index + 1 > firstWeekOfMonth;
|
|
152
|
+
}
|
|
153
|
+
return !!(index + 1 >= firstWeekOfMonth && index + 1 <= daysOfMonthForSelectedDate + firstWeekOfMonth);
|
|
154
|
+
}
|
|
155
|
+
return false;
|
|
156
|
+
}, [confirmYear, confirmMonth, confirmDay, selectedYear, selectedMonth]);
|
|
157
|
+
const handleDisplayDays = (0, _react.useMemo)(() => {
|
|
158
|
+
const daysOfMonthForSelectedDate = new Date(selectedYear, selectedMonth + 1, 0).getDate();
|
|
159
|
+
const daysOfPrevioueMonthForSelectedDate = new Date(selectedYear, selectedMonth + 1 - 1, 0).getDate();
|
|
160
|
+
const firstWeekOfMonth = new Date(`${selectedYear}/${selectedMonth + 1}/1`).getDay();
|
|
161
|
+
const lastWeekOfMonth = new Date(`${selectedYear}/${selectedMonth + 1}/${daysOfMonthForSelectedDate}`).getDay();
|
|
162
|
+
const days = [];
|
|
163
|
+
for (const day of [...Array(daysOfMonthForSelectedDate).keys()]) {
|
|
164
|
+
days.push(day + 1);
|
|
165
|
+
}
|
|
166
|
+
if (firstWeekOfMonth !== 0) {
|
|
167
|
+
for (let index = daysOfPrevioueMonthForSelectedDate; index > daysOfPrevioueMonthForSelectedDate - firstWeekOfMonth; index -= 1) {
|
|
168
|
+
days.unshift(index);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
if (lastWeekOfMonth !== 6) {
|
|
172
|
+
for (let index = 1; index <= 6 - lastWeekOfMonth; index += 1) {
|
|
173
|
+
days.push(index);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return days.map((day, index) => {
|
|
177
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Day, {
|
|
178
|
+
disabled: handleDisabled(firstWeekOfMonth, daysOfMonthForSelectedDate, index, day),
|
|
179
|
+
onClick: () => {
|
|
180
|
+
handleChangeDate(daysOfMonthForSelectedDate, firstWeekOfMonth, index, day);
|
|
181
|
+
},
|
|
182
|
+
selected: handleSelectedDay(day, daysOfMonthForSelectedDate, index, firstWeekOfMonth, lastWeekOfMonth),
|
|
183
|
+
children: day
|
|
184
|
+
}, index);
|
|
185
|
+
});
|
|
186
|
+
}, [selectedMonth, selectedYear, handleDisabled, handleChangeDate, handleSelectedDay]);
|
|
187
|
+
const handleToggle = () => {
|
|
188
|
+
setDisplayPicker(!displayPicker);
|
|
189
|
+
update();
|
|
190
|
+
};
|
|
191
|
+
const handleConfirm = () => {
|
|
192
|
+
onConfirm(inputValue);
|
|
193
|
+
setDisplayPicker(false);
|
|
194
|
+
setCurrentDisplayType(null);
|
|
195
|
+
};
|
|
196
|
+
(0, _react.useEffect)(() => {
|
|
197
|
+
if (!selected) return;
|
|
198
|
+
const date = new Date(selected);
|
|
199
|
+
setSelectedYear(date.getFullYear());
|
|
200
|
+
setSelectedMonth(date.getMonth());
|
|
201
|
+
setSelectedDay(date.getDate());
|
|
202
|
+
setConfirmYear(date.getFullYear());
|
|
203
|
+
setConfirmMonth(date.getMonth());
|
|
204
|
+
setConfirmDay(date.getDate());
|
|
205
|
+
setInputValue(selected);
|
|
206
|
+
}, [selected]);
|
|
207
|
+
(0, _react.useEffect)(() => {
|
|
208
|
+
if (!(confirmYear && confirmMonth && confirmDay)) return;
|
|
209
|
+
setInputValue((0, _utils.formatDate)(new Date(confirmYear, confirmMonth, confirmDay), 'date'));
|
|
210
|
+
}, [confirmYear, confirmMonth, confirmDay]);
|
|
211
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactOutsideClickHandler.default, {
|
|
212
|
+
onOutsideClick: handleConfirm,
|
|
213
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(PickerInput, {
|
|
214
|
+
ref: setToggleElement,
|
|
215
|
+
value: inputValue,
|
|
216
|
+
onClick: handleToggle,
|
|
217
|
+
readOnly: true,
|
|
218
|
+
disabled: disabled
|
|
219
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Wrapper, {
|
|
220
|
+
...attributes.popper,
|
|
221
|
+
style: styles.popper,
|
|
222
|
+
placement: state && state.placement,
|
|
223
|
+
ref: setContentElement,
|
|
224
|
+
displayPicker: displayPicker,
|
|
225
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(Body, {
|
|
226
|
+
displayType: currentDisplayType,
|
|
227
|
+
children: [!fixedYear && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Accordion.default, {
|
|
228
|
+
type: "year",
|
|
229
|
+
handleDisplayAccordionContent: () => {
|
|
230
|
+
handleDisplayAccordionContent('year');
|
|
231
|
+
},
|
|
232
|
+
handleChangeTitle: handleChangeYear,
|
|
233
|
+
setCurrentDisplayType: setCurrentDisplayType,
|
|
234
|
+
currentDisplayType: currentDisplayType,
|
|
235
|
+
selectedYear: selectedYear,
|
|
236
|
+
setSelectedYear: setSelectedYear,
|
|
237
|
+
selectedDay: selectedDay,
|
|
238
|
+
minDate: minDate,
|
|
239
|
+
maxDate: maxDate,
|
|
240
|
+
fixedYear: fixedYear
|
|
241
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Accordion.default, {
|
|
242
|
+
type: "month",
|
|
243
|
+
handleDisplayAccordionContent: () => {
|
|
244
|
+
handleDisplayAccordionContent('month');
|
|
245
|
+
},
|
|
246
|
+
handleChangeTitle: handleChangeMonth,
|
|
247
|
+
setCurrentDisplayType: setCurrentDisplayType,
|
|
248
|
+
currentDisplayType: currentDisplayType,
|
|
249
|
+
selectedMonth: selectedMonth,
|
|
250
|
+
setSelectedMonth: setSelectedMonth,
|
|
251
|
+
selectedYear: selectedYear,
|
|
252
|
+
selectedDay: selectedDay,
|
|
253
|
+
fixedYear: fixedYear,
|
|
254
|
+
minDate: minDate,
|
|
255
|
+
maxDate: maxDate
|
|
256
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(DateContent, {
|
|
257
|
+
children: [weeks, handleDisplayDays]
|
|
258
|
+
})]
|
|
259
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Footer, {
|
|
260
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ConfirmButton, {
|
|
261
|
+
fullWidth: true,
|
|
262
|
+
alignCenter: true,
|
|
263
|
+
onClick: handleConfirm,
|
|
264
|
+
children: t('Confirm')
|
|
265
|
+
})
|
|
266
|
+
})]
|
|
267
|
+
})]
|
|
268
|
+
});
|
|
269
|
+
};
|
|
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 => {
|
|
282
|
+
let {
|
|
283
|
+
displayPicker
|
|
284
|
+
} = _ref2;
|
|
285
|
+
return displayPicker ? 'block' : 'none';
|
|
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 => {
|
|
310
|
+
let {
|
|
311
|
+
selected
|
|
312
|
+
} = _ref3;
|
|
313
|
+
return selected && 'background: var(--color-hover);';
|
|
314
|
+
}}
|
|
315
|
+
|
|
316
|
+
${_ref4 => {
|
|
317
|
+
let {
|
|
318
|
+
disabled
|
|
319
|
+
} = _ref4;
|
|
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 => {
|
|
344
|
+
let {
|
|
345
|
+
displayType
|
|
346
|
+
} = _ref5;
|
|
347
|
+
return displayType && (0, _styledComponents.css)`
|
|
348
|
+
height: 216px;
|
|
349
|
+
`;
|
|
350
|
+
}}
|
|
351
|
+
|
|
352
|
+
overflow: hidden;
|
|
353
|
+
padding: ${_ref6 => {
|
|
354
|
+
let {
|
|
355
|
+
displayType
|
|
356
|
+
} = _ref6;
|
|
357
|
+
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
|
+
`;
|
|
363
|
+
var _default = exports.default = DatePicker;
|