@cashub/ui-elv 1.0.2 → 1.0.4
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/datetimePicker/index.js +2 -37
- package/esm/Tab/Tab.js +21 -0
- package/esm/Tab/TabList.js +160 -0
- package/esm/Tab/TabPanel.js +42 -0
- package/esm/Tab/TabTab.js +98 -0
- package/esm/Tab/index.js +23 -0
- package/esm/Tab/subComponent/TabContext.js +3 -0
- package/esm/Tab/subComponent/TabListV2.js +18 -0
- package/esm/Tab/subComponent/TabPanelV2.js +45 -0
- package/esm/Tab/subComponent/TabTabV2.js +56 -0
- package/esm/VerticalTab/TabList.js +20 -0
- package/esm/VerticalTab/TabPanel.js +45 -0
- package/esm/VerticalTab/TabTab.js +63 -0
- package/esm/VerticalTab/VerticalTab.js +34 -0
- package/esm/VerticalTab/index.js +9 -0
- package/esm/VerticalTab/subComponent/TabContext.js +3 -0
- package/esm/alert/Alert.js +22 -0
- package/esm/alert/index.js +1 -0
- package/esm/animate/Collapse.js +65 -0
- package/esm/animate/Loader.js +51 -0
- package/esm/animate/NumberCounter.js +45 -0
- package/esm/animate/PulseRing.js +26 -0
- package/esm/animate/Spinner.js +11 -0
- package/esm/animate/index.js +5 -0
- package/esm/assets/css/autocomplete.css +16 -0
- package/esm/assets/css/font.css +4 -0
- package/esm/assets/css/global.css +2 -0
- package/esm/assets/font/helvetica/Helvetica.ttf +0 -0
- package/esm/assets/font/nanumGothic/NanumGothic-Bold.ttf +0 -0
- package/esm/assets/font/nanumGothic/NanumGothic-ExtraBold.ttf +0 -0
- package/esm/assets/font/nanumGothic/NanumGothic-Regular.ttf +0 -0
- package/esm/assets/icons/app-management.png +0 -0
- package/esm/assets/icons/burger-black.png +0 -0
- package/esm/assets/icons/burger-white.png +0 -0
- package/esm/assets/icons/burger.png +0 -0
- package/esm/assets/icons/file.svg +1 -0
- package/esm/assets/icons/map_icon1.png +0 -0
- package/esm/assets/icons/map_icon4.png +0 -0
- package/esm/assets/images/bg-aside.png +0 -0
- package/esm/assets/images/bg-chart-circle.png +0 -0
- package/esm/assets/images/bg-chart-triangle.png +0 -0
- package/esm/assets/images/cashub-logo-only.png +0 -0
- package/esm/assets/images/default-user.jpg +0 -0
- package/esm/assets/images/logo-cashub.png +0 -0
- package/esm/assets/images/map.png +0 -0
- package/esm/assets/images/qrcode.png +0 -0
- package/esm/backdrop/BaseBackdrop.js +11 -0
- package/esm/backdrop/LoadingBackdrop.js +10 -0
- package/esm/backdrop/ModalBackdrop.js +8 -0
- package/esm/backdrop/index.js +3 -0
- package/esm/badge/Badge.js +19 -0
- package/esm/badge/BadgeDot.js +11 -0
- package/esm/badge/BadgeFill.js +42 -0
- package/esm/badge/BadgeFillTriangle.js +138 -0
- package/esm/badge/BadgeWithText.js +24 -0
- package/esm/badge/index.js +5 -0
- package/esm/billing/BarChart.js +45 -0
- package/esm/billing/Grid.js +38 -0
- package/esm/billing/Header2.js +19 -0
- package/esm/billing/Header3.js +31 -0
- package/esm/billing/Paragraph.js +27 -0
- package/esm/billing/ParagraphGroup.js +16 -0
- package/esm/billing/ParagraphText.js +20 -0
- package/esm/billing/Section.js +44 -0
- package/esm/billing/SectionBody.js +11 -0
- package/esm/billing/SectionHeader.js +20 -0
- package/esm/billing/__stories__/BarChart.stories.js_bak +46 -0
- package/esm/billing/__stories__/Grid.stories.js_bak +57 -0
- package/esm/billing/__stories__/Header2.stories.js_bak +62 -0
- package/esm/billing/__stories__/Header3.stories.js_bak +69 -0
- package/esm/billing/__stories__/Paragraph.stories.js_bak +84 -0
- package/esm/billing/__stories__/ParagraphGroup.stories.js_bak +68 -0
- package/esm/billing/__stories__/ParagraphText.stories.js_bak +64 -0
- package/esm/billing/__stories__/Section.stories.js_bak +115 -0
- package/esm/billing/__stories__/SectionBody.stories.js_bak +62 -0
- package/esm/billing/__stories__/SectionHeader.stories.js-bak +68 -0
- package/esm/breadcrumb/Breadcrumb.js +71 -0
- package/esm/breadcrumb/index.js +1 -0
- package/esm/button/Button.js +145 -0
- package/esm/button/ButtonGroup.js +54 -0
- package/esm/button/IconButton.js +64 -0
- package/esm/button/ScrollToTopButton.js +47 -0
- package/esm/button/index.js +4 -0
- package/esm/callout/Callout.js +45 -0
- package/esm/callout/index.js +1 -0
- package/esm/chart/BarChart.js +147 -0
- package/esm/chart/DoughnutChart.js +110 -0
- package/esm/chart/LineChart.js +140 -0
- package/esm/chart/SingleBarChart.js +35 -0
- package/esm/chart/index.js +5 -0
- package/esm/chart/utils/centerTextPlugin.js +56 -0
- package/esm/chart/utils/customTooltip.js +84 -0
- package/esm/chart/utils/customTooltipLifecyclePlugin.js +16 -0
- package/esm/chart/utils/htmlLegendPlugin.js +83 -0
- package/esm/chart/utils/index.js +3 -0
- package/esm/chart/utils/padEmptyChartBar.js +47 -0
- package/esm/chart/utils/tooltipElement.js +17 -0
- package/esm/chart/utils/xAxisLabelTooltipPlugin.js +101 -0
- package/esm/chart/utils/yAxisTopTitlePlugin.js +43 -0
- package/esm/container/FlexContainer.js +33 -0
- package/esm/container/index.js +1 -0
- package/esm/cropper/Cropper.js +47 -0
- package/esm/cropper/CropperModalHandler.js +34 -0
- package/esm/cropper/index.js +2 -0
- package/esm/cropper/subComponent/CropImageModal.js +72 -0
- package/{datetimePicker/DatetimePicker.js → esm/datetimePicker/DatetimePickerV3.js} +63 -31
- package/esm/datetimePicker/TimeInput.js +49 -0
- package/esm/datetimePicker/TimePickerStyle.js +58 -0
- package/esm/datetimePicker/TimePickerV2.js +199 -0
- package/esm/datetimePicker/accordion/Month.js +245 -0
- package/esm/datetimePicker/accordion/Year.js +275 -0
- package/esm/datetimePicker/index.js +4 -0
- package/esm/datetimePicker/provider/constant.js +38 -0
- package/esm/datetimePicker/subComponent/DateTimePickerContext.js +3 -0
- package/esm/datetimePicker/utils/GMTDate.js +9 -0
- package/esm/datetimePicker/utils/pad.js +7 -0
- package/esm/datetimePicker/utils/toUTC0.js +7 -0
- package/esm/descriptionList/DescriptionDetail.js +21 -0
- package/esm/descriptionList/DescriptionList.js +18 -0
- package/esm/descriptionList/DescriptionTerm.js +7 -0
- package/esm/descriptionList/index.js +3 -0
- package/esm/divider/Divider.js +24 -0
- package/esm/divider/index.js +1 -0
- package/esm/dropdown/Dropdown.js +48 -0
- package/esm/dropdown/DropdownButtonOption.js +36 -0
- package/esm/dropdown/DropdownContent.js +83 -0
- package/esm/dropdown/DropdownDivOption.js +19 -0
- package/esm/dropdown/DropdownItem.js +19 -0
- package/esm/dropdown/DropdownLinkOption.js +17 -0
- package/esm/dropdown/DropdownToggle.js +31 -0
- package/esm/dropdown/index.js +11 -0
- package/esm/dropdown/subComponent/DropdownContext.js +3 -0
- package/esm/dropzone/FileDropzone.js +472 -0
- package/esm/dropzone/ImageDropzone.js +327 -0
- package/esm/dropzone/index.js +2 -0
- package/esm/dropzone/subComponent/Message.js +19 -0
- package/esm/figure/IconFigure.js +35 -0
- package/esm/figure/ImageFigure.js +31 -0
- package/esm/figure/index.js +2 -0
- package/esm/file/HiddenFileInput.js +8 -0
- package/esm/file/index.js +1 -0
- package/esm/form/Checkbox.js +157 -0
- package/esm/form/Fieldset.js +11 -0
- package/esm/form/FormItem.js +15 -0
- package/esm/form/Input.js +59 -0
- package/esm/form/Label.js +54 -0
- package/esm/form/MutedText.js +14 -0
- package/esm/form/PasswordInput.js +40 -0
- package/esm/form/RadioButton.js +94 -0
- package/esm/form/SearchSelect.js +174 -0
- package/esm/form/Searchbox.js +91 -0
- package/esm/form/Slider.js +39 -0
- package/esm/form/SwitchButton.js +97 -0
- package/esm/form/Textarea.js +34 -0
- package/esm/form/TreeView.js +66 -0
- package/esm/form/index.js +14 -0
- package/esm/grid/Column.js +39 -0
- package/esm/grid/Grid.js +28 -0
- package/esm/grid/index.js +2 -0
- package/esm/heading/Heading1.js +14 -0
- package/esm/heading/Heading2.js +21 -0
- package/esm/heading/Heading3.js +42 -0
- package/esm/heading/index.js +3 -0
- package/esm/helmet/Helmet.js +17 -0
- package/esm/helmet/index.js +3 -0
- package/esm/iconbox/ApplicationIconBox.js +74 -0
- package/esm/iconbox/IconBox.js +60 -0
- package/esm/iconbox/IconBoxV2.js +63 -0
- package/esm/iconbox/index.js +3 -0
- package/esm/iconbox/subComponent/IconBoxFigure.js +43 -0
- package/esm/iconbox/subComponent/IconBoxImage.js +35 -0
- package/esm/image/ImageFluid.js +10 -0
- package/esm/image/UploadImage.js +243 -0
- package/esm/image/index.js +2 -0
- package/esm/index.js +47 -0
- package/esm/keyframe/Pulse.js +15 -0
- package/esm/keyframe/Spin.js +7 -0
- package/esm/layout/Aside.js +39 -0
- package/esm/layout/AsideHeader.jsx +27 -0
- package/esm/layout/Backdrop.js +16 -0
- package/esm/layout/Container.js +30 -0
- package/esm/layout/Footer.js +36 -0
- package/esm/layout/Header.jsx +55 -0
- package/esm/layout/Layout.jsx +84 -0
- package/esm/layout/Logo.jsx +17 -0
- package/esm/layout/MenuIcon.jsx +27 -0
- package/esm/layout/Sidebar.jsx +271 -0
- package/esm/layout/index.js +1 -0
- package/esm/link/LinkSpan.js +62 -0
- package/esm/link/index.js +1 -0
- package/esm/map/GoogleMap.js +439 -0
- package/esm/map/GoogleReverseGeolocation.js +193 -0
- package/esm/map/LeafletMap.js +224 -0
- package/esm/map/LeafletReverseGeolocation.js +94 -0
- package/esm/map/index.js +4 -0
- package/esm/map/subComponent/BasicLeafletMap.js +27 -0
- package/esm/map/subComponent/GoogleMapContainer.js +22 -0
- package/esm/map/subComponent/GoogleMapPopup.js +103 -0
- package/esm/map/subComponent/GoogleMapWrapper.js +34 -0
- package/esm/map/subComponent/LeafletDrawControl.js +116 -0
- package/esm/map/subComponent/LeafletMapContainer.js +166 -0
- package/esm/map/subComponent/MapSearchBoxControl.js +47 -0
- package/esm/modal/StateModal.js +169 -0
- package/esm/modal/TitleModal.js +241 -0
- package/esm/modal/index.js +2 -0
- package/esm/page/Disclaimer.js +121 -0
- package/esm/page/index.js +1 -0
- package/esm/paginate/Paginate.js +129 -0
- package/esm/paginate/index.js +1 -0
- package/esm/popover/Popover.js +82 -0
- package/esm/popover/index.js +1 -0
- package/esm/qrcode/QRCode.js +51 -0
- package/esm/qrcode/QRCodeContainter.js +27 -0
- package/esm/qrcode/index.js +2 -0
- package/esm/ribbon/Ribbon.js +35 -0
- package/esm/ribbon/index.js +1 -0
- package/esm/section/Section.js +126 -0
- package/esm/section/SectionBody.js +43 -0
- package/esm/section/SectionHeader.js +61 -0
- package/esm/section/SectionToolbar.js +11 -0
- package/esm/section/SectionToolbarItem.js +10 -0
- package/esm/section/index.js +5 -0
- package/esm/select/InputSelect.js +263 -0
- package/esm/select/Select.js +811 -0
- package/esm/select/index.js +2 -0
- package/esm/select/subComponent/Checkbox.js +40 -0
- package/esm/select/subComponent/Footer.js +6 -0
- package/esm/select/subComponent/ListBox.js +23 -0
- package/esm/select/subComponent/Option.js +37 -0
- package/esm/select/subComponent/OptionGroup.js +16 -0
- package/esm/select/subComponent/Options.js +25 -0
- package/esm/select/subComponent/SearchBox.js +51 -0
- package/esm/select/subComponent/SelectedMultipleCount.js +32 -0
- package/esm/select/subComponent/SelectedMultipleTags.js +47 -0
- package/esm/select/subComponent/SelectedMultipleText.js +63 -0
- package/esm/select/subComponent/SelectedSingle.js +10 -0
- package/esm/styles/GlobalStyle.js +328 -0
- package/esm/styles/config/breakpoint.style.js +7 -0
- package/esm/styles/config/header.style.js +4 -0
- package/esm/styles/config/sidebar.style.js +11 -0
- package/esm/styles/index.js +2 -0
- package/esm/styles/mixin/backgroundColor.js +38 -0
- package/esm/styles/mixin/borderColor.js +31 -0
- package/esm/styles/mixin/color.js +31 -0
- package/esm/styles/mixin/colorOnBackground.js +31 -0
- package/esm/styles/mixin/inputPlaceholder.js +24 -0
- package/esm/styles/mixin/media.js +15 -0
- package/esm/styles/mixin/rounded.js +24 -0
- package/esm/styles/mixin/scrollbar.js +26 -0
- package/esm/styles/theme/dark.theme.js +91 -0
- package/esm/styles/theme/light.theme.js +91 -0
- package/esm/styles/theme/white.theme.js +91 -0
- package/esm/styles/themes.js +9 -0
- package/esm/table/GridTable.js +329 -0
- package/esm/table/ImageBox.js +38 -0
- package/esm/table/InfiniteGridTable.js +396 -0
- package/esm/table/PermissionTable.js +57 -0
- package/esm/table/SimpleGridTable.js +136 -0
- package/esm/table/Table.js +559 -0
- package/esm/table/__mock__/columns.js +64 -0
- package/esm/table/__mock__/data.js +530 -0
- package/esm/table/hooks/index.js +2 -0
- package/esm/table/hooks/useCalculateDataRange.js +22 -0
- package/esm/table/hooks/useGenerateSort.js +32 -0
- package/esm/table/index.js +6 -0
- package/esm/table/subComponent/BaseTableHeadCell.js +54 -0
- package/esm/table/subComponent/GridTableFooter.js +17 -0
- package/esm/table/subComponent/GridTableHeadCell.js +13 -0
- package/esm/table/subComponent/Resizer.js +70 -0
- package/esm/table/subComponent/TableFooter.js +24 -0
- package/esm/table/subComponent/TableFooterInfo.js +6 -0
- package/esm/table/subComponent/TableFooterPager.js +26 -0
- package/esm/table/subComponent/TableHeadCell.js +12 -0
- package/esm/table/subComponent/TableSort.js +31 -0
- package/esm/tagify/TagifyStyle.js +54 -0
- package/esm/tagify/Tags.js +49 -0
- package/esm/tagify/index.js +3 -0
- package/esm/tagify/templates/getCreateButtonTemplate.js +12 -0
- package/esm/text/Paragraph.js +79 -0
- package/esm/text/index.js +1 -0
- package/esm/timeline/Timeline.js +132 -0
- package/esm/timeline/index.js +1 -0
- package/esm/toast/CustomToastContainer.js +38 -0
- package/esm/toast/MessageContainer.js +44 -0
- package/esm/toast/index.js +3 -0
- package/esm/toast/show.js +29 -0
- package/esm/toast/style.css +1 -0
- package/esm/tooltip/Tooltip.js +133 -0
- package/esm/tooltip/index.js +1 -0
- package/esm/treeView/TreeViewV2.js +32 -0
- package/esm/treeView/TreeflexStyle.js +43 -0
- package/esm/treeView/index.js +2 -0
- package/esm/wizard/Wizard.js +244 -0
- package/esm/wizard/index.js +1 -0
- package/helmet/index.js +3 -7
- package/index.js +0 -12
- package/layout/Sidebar.jsx +1 -1
- package/package.json +5 -4
- package/datetimePicker/DatePicker.js +0 -363
- package/datetimePicker/DatePickerV2.js +0 -407
- package/datetimePicker/DatetimePickerV2.js +0 -395
- package/datetimePicker/TimePicker.js +0 -317
- package/datetimePicker/hooks/index.js +0 -27
- package/datetimePicker/hooks/useChangeNumber.js +0 -42
- package/datetimePicker/hooks/useDecrease.js +0 -38
- package/datetimePicker/hooks/useIncrease.js +0 -38
- package/datetimePicker/subComponent/Accordion.js +0 -373
- package/datetimePicker/subComponent/CustomTimeInput.js +0 -47
- package/jsoneditor/JsonEditor.js +0 -142
- package/jsoneditor/index.js +0 -13
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { MapContainer } from 'react-leaflet';
|
|
3
|
+
const LeafletMapContainer = styled(MapContainer)`
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: ${_ref => {
|
|
6
|
+
let {
|
|
7
|
+
height
|
|
8
|
+
} = _ref;
|
|
9
|
+
return height;
|
|
10
|
+
}}px;
|
|
11
|
+
border: 1px solid transparent;
|
|
12
|
+
border-radius: var(--border-radius);
|
|
13
|
+
z-index: 1;
|
|
14
|
+
|
|
15
|
+
&:focus {
|
|
16
|
+
border-color: var(--border-color);
|
|
17
|
+
box-shadow: var(--box-shadow);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.leaflet-control-container {
|
|
21
|
+
.leaflet-control-zoom {
|
|
22
|
+
box-shadow: var(--box-shadow);
|
|
23
|
+
border-radius: var(--border-radius);
|
|
24
|
+
|
|
25
|
+
a {
|
|
26
|
+
background: transparent;
|
|
27
|
+
border-bottom: 1px solid var(--border-color);
|
|
28
|
+
color: var(--font-on-background);
|
|
29
|
+
|
|
30
|
+
&:last-child {
|
|
31
|
+
border-bottom: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&.leaflet-disabled {
|
|
35
|
+
opacity: 0.5;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.leaflet-draw {
|
|
41
|
+
box-shadow: var(--box-shadow);
|
|
42
|
+
border-radius: var(--border-radius);
|
|
43
|
+
|
|
44
|
+
a {
|
|
45
|
+
background-color: var(--color-background1);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.leaflet-draw-draw-polyline {
|
|
49
|
+
background-position: -3px -3px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.leaflet-draw-draw-polygon {
|
|
53
|
+
background-position: -32px -3px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.leaflet-draw-draw-rectangle {
|
|
57
|
+
background-position: -63px -3px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.leaflet-draw-draw-circle {
|
|
61
|
+
background-position: -93px -3px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.leaflet-draw-draw-marker {
|
|
65
|
+
background-position: -123px -3px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.leaflet-draw-draw-circlemarker {
|
|
69
|
+
background-position: -273px -3px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.leaflet-draw-edit-edit {
|
|
73
|
+
background-position: -213px -3px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.leaflet-draw-edit-remove {
|
|
77
|
+
background-position: -243px -3px;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.leaflet-left .leaflet-control {
|
|
82
|
+
margin-left: var(--spacing-s);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.leaflet-right .leaflet-control {
|
|
86
|
+
margin-right: var(--spacing-s);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.leaflet-top .leaflet-control {
|
|
90
|
+
margin-top: var(--spacing-s);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.leaflet-control {
|
|
94
|
+
font-weight: bold;
|
|
95
|
+
background: var(--color-background1);
|
|
96
|
+
|
|
97
|
+
&.leaflet-control-attribution {
|
|
98
|
+
background: var(--color-white);
|
|
99
|
+
color: var(--color-dark);
|
|
100
|
+
margin: 0;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.leaflet-edit-move {
|
|
106
|
+
border-radius: 50px;
|
|
107
|
+
border-color: var(--border-color);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.leaflet-edit-resize {
|
|
111
|
+
border-radius: 50px;
|
|
112
|
+
border-color: var(--border-color);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&.leaflet-touch {
|
|
116
|
+
.leaflet-bar {
|
|
117
|
+
border: none;
|
|
118
|
+
|
|
119
|
+
a {
|
|
120
|
+
width: 24px;
|
|
121
|
+
height: 24px;
|
|
122
|
+
line-height: 24px;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.leaflet-left .leaflet-control {
|
|
127
|
+
margin-left: var(--spacing-s);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.leaflet-right .leaflet-control {
|
|
131
|
+
margin-right: var(--spacing-s);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.leaflet-top .leaflet-control {
|
|
135
|
+
margin-top: var(--spacing-s);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.marker-cluster {
|
|
140
|
+
background: var(--color-primary) a1;
|
|
141
|
+
|
|
142
|
+
div {
|
|
143
|
+
background: var(--color-primary);
|
|
144
|
+
color: var(--font-on-primary);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.leaflet-popup-content-wrapper {
|
|
149
|
+
background: transparent;
|
|
150
|
+
box-shadow: unset;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.leaflet-popup-content p {
|
|
154
|
+
margin: 0;
|
|
155
|
+
margin-bottom: var(--spacing-s);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.leaflet-popup-tip {
|
|
159
|
+
display: none;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.sr-only {
|
|
163
|
+
display: none;
|
|
164
|
+
}
|
|
165
|
+
`;
|
|
166
|
+
export default LeafletMapContainer;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { useRef, useEffect } from 'react';
|
|
2
|
+
import L from 'leaflet';
|
|
3
|
+
import { useMap } from 'react-leaflet';
|
|
4
|
+
import Searchbox from '../../form/Searchbox';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
const MapSearchBoxControl = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
changeLatlng,
|
|
9
|
+
onSearch,
|
|
10
|
+
onError
|
|
11
|
+
} = _ref;
|
|
12
|
+
const map = useMap();
|
|
13
|
+
const barRef = useRef(null);
|
|
14
|
+
const handleError = errorCode => {
|
|
15
|
+
if (onError) {
|
|
16
|
+
onError(errorCode);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
const handleSearch = async address => {
|
|
20
|
+
try {
|
|
21
|
+
const latlng = await onSearch(address);
|
|
22
|
+
if (latlng) {
|
|
23
|
+
map.flyTo(latlng, 15);
|
|
24
|
+
changeLatlng(latlng);
|
|
25
|
+
} else {
|
|
26
|
+
handleError('NO_RESULT');
|
|
27
|
+
}
|
|
28
|
+
} catch (error) {
|
|
29
|
+
handleError(error.message);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
L.DomEvent.disableClickPropagation(barRef.current);
|
|
34
|
+
}, []);
|
|
35
|
+
return /*#__PURE__*/_jsx("div", {
|
|
36
|
+
className: "leaflet-top leaflet-right",
|
|
37
|
+
ref: barRef,
|
|
38
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
39
|
+
className: "leaflet-control leaflet-bar",
|
|
40
|
+
children: /*#__PURE__*/_jsx(Searchbox, {
|
|
41
|
+
onSearch: handleSearch,
|
|
42
|
+
autoFocus: true
|
|
43
|
+
})
|
|
44
|
+
})
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
export default MapSearchBoxControl;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { useState, useRef } from 'react';
|
|
2
|
+
import ReactDOM, { unmountComponentAtNode } from 'react-dom';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import uniqueId from 'lodash.uniqueid';
|
|
5
|
+
import { BsCheckCircle, BsExclamationTriangle, BsExclamationCircle } from 'react-icons/bs/index.esm';
|
|
6
|
+
import { FaRegTimesCircle } from 'react-icons/fa/index.esm';
|
|
7
|
+
import { appendElementTo } from '@cashub/utils';
|
|
8
|
+
import ButtonGroup from '../button/ButtonGroup';
|
|
9
|
+
import Button from '../button/Button';
|
|
10
|
+
import ModalBackdrop from '../backdrop/ModalBackdrop';
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
const StateModal = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
onClose,
|
|
15
|
+
...props
|
|
16
|
+
} = _ref;
|
|
17
|
+
const rootElement = appendElementTo('StateModalContainer');
|
|
18
|
+
const Container = document.createElement('div');
|
|
19
|
+
rootElement.appendChild(Container);
|
|
20
|
+
const handleClose = () => {
|
|
21
|
+
// unmount component and clear event handler and state before remove container
|
|
22
|
+
unmountComponentAtNode(Container);
|
|
23
|
+
Container.remove();
|
|
24
|
+
if (onClose) onClose();
|
|
25
|
+
};
|
|
26
|
+
ReactDOM.render(/*#__PURE__*/_jsx(ModalContent, {
|
|
27
|
+
...props,
|
|
28
|
+
onClose: handleClose
|
|
29
|
+
}), Container);
|
|
30
|
+
};
|
|
31
|
+
const ModalContent = _ref2 => {
|
|
32
|
+
let {
|
|
33
|
+
type,
|
|
34
|
+
title,
|
|
35
|
+
text,
|
|
36
|
+
buttons,
|
|
37
|
+
confirmButtonText,
|
|
38
|
+
cancelButtonText,
|
|
39
|
+
showConfirmButton = true,
|
|
40
|
+
showCancelButton,
|
|
41
|
+
onClose,
|
|
42
|
+
onConfirm,
|
|
43
|
+
onCancel,
|
|
44
|
+
allowDismiss = true,
|
|
45
|
+
cancelButtonType = 'danger',
|
|
46
|
+
confirmButtonType = 'success'
|
|
47
|
+
} = _ref2;
|
|
48
|
+
const refWrapper = useRef(null);
|
|
49
|
+
const [id] = useState(uniqueId('SD-'));
|
|
50
|
+
let Icon = BsCheckCircle;
|
|
51
|
+
if (type === 'error') Icon = FaRegTimesCircle;
|
|
52
|
+
if (type === 'danger') Icon = BsExclamationTriangle;
|
|
53
|
+
if (type === 'warning') Icon = BsExclamationCircle;
|
|
54
|
+
const getButtonTypeProps = buttonType => ({
|
|
55
|
+
...(buttonType === 'danger' && {
|
|
56
|
+
danger: true
|
|
57
|
+
}),
|
|
58
|
+
...(buttonType === 'warning' && {
|
|
59
|
+
warning: true
|
|
60
|
+
}),
|
|
61
|
+
...(buttonType === 'success' && {
|
|
62
|
+
success: true
|
|
63
|
+
})
|
|
64
|
+
});
|
|
65
|
+
const handleDismiss = event => {
|
|
66
|
+
if (event.target === refWrapper.current && allowDismiss === true) {
|
|
67
|
+
onClose();
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const modalButtons = buttons || [showCancelButton === true && {
|
|
71
|
+
text: cancelButtonText || 'Cancel',
|
|
72
|
+
type: cancelButtonType,
|
|
73
|
+
onClick: onCancel
|
|
74
|
+
}, showConfirmButton === true && {
|
|
75
|
+
text: confirmButtonText || 'Confirm',
|
|
76
|
+
type: confirmButtonType,
|
|
77
|
+
onClick: onConfirm
|
|
78
|
+
}].filter(Boolean);
|
|
79
|
+
const handleButtonClick = button => {
|
|
80
|
+
if (button.onClick) button.onClick();
|
|
81
|
+
if (button.closeOnClick !== false) onClose();
|
|
82
|
+
};
|
|
83
|
+
return /*#__PURE__*/_jsx(Wrapper, {
|
|
84
|
+
ref: refWrapper,
|
|
85
|
+
onClick: handleDismiss,
|
|
86
|
+
role: "dialog",
|
|
87
|
+
"aria-labelledby": `${id}-Title`,
|
|
88
|
+
children: /*#__PURE__*/_jsxs(Container, {
|
|
89
|
+
children: [/*#__PURE__*/_jsxs(Body, {
|
|
90
|
+
type: type,
|
|
91
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
92
|
+
role: "img"
|
|
93
|
+
}), /*#__PURE__*/_jsx(Title, {
|
|
94
|
+
children: title
|
|
95
|
+
}), /*#__PURE__*/_jsx(Message, {
|
|
96
|
+
children: text
|
|
97
|
+
})]
|
|
98
|
+
}), modalButtons.length > 0 && /*#__PURE__*/_jsx(ButtonGroup, {
|
|
99
|
+
alignRight: true,
|
|
100
|
+
children: modalButtons.map((_ref3, index) => {
|
|
101
|
+
let {
|
|
102
|
+
text: buttonText,
|
|
103
|
+
children,
|
|
104
|
+
type: buttonType,
|
|
105
|
+
onClick,
|
|
106
|
+
closeOnClick,
|
|
107
|
+
...buttonProps
|
|
108
|
+
} = _ref3;
|
|
109
|
+
return /*#__PURE__*/_jsx(Button, {
|
|
110
|
+
...getButtonTypeProps(buttonType),
|
|
111
|
+
...buttonProps,
|
|
112
|
+
onClick: () => handleButtonClick({
|
|
113
|
+
onClick,
|
|
114
|
+
closeOnClick
|
|
115
|
+
}),
|
|
116
|
+
children: children || buttonText
|
|
117
|
+
}, `${id}-Button-${index}`);
|
|
118
|
+
})
|
|
119
|
+
})]
|
|
120
|
+
})
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
const Wrapper = styled(ModalBackdrop)`
|
|
124
|
+
z-index: 90;
|
|
125
|
+
`;
|
|
126
|
+
const Container = styled.div`
|
|
127
|
+
width: 500px;
|
|
128
|
+
max-width: 90%;
|
|
129
|
+
background: var(--color-background2);
|
|
130
|
+
box-shadow: var(--box-shadow);
|
|
131
|
+
padding: var(--spacing);
|
|
132
|
+
border-radius: var(--border-radius);
|
|
133
|
+
color: var(--font-on-background);
|
|
134
|
+
border: var(--border-width) solid var(--border-color);
|
|
135
|
+
text-align: center;
|
|
136
|
+
`;
|
|
137
|
+
const Body = styled.div`
|
|
138
|
+
margin-bottom: var(--spacing);
|
|
139
|
+
|
|
140
|
+
> svg {
|
|
141
|
+
font-size: 120px;
|
|
142
|
+
margin-bottom: var(--spacing);
|
|
143
|
+
|
|
144
|
+
${_ref4 => {
|
|
145
|
+
let {
|
|
146
|
+
type
|
|
147
|
+
} = _ref4;
|
|
148
|
+
switch (type) {
|
|
149
|
+
case 'error':
|
|
150
|
+
case 'danger':
|
|
151
|
+
return 'color: var(--color-danger);';
|
|
152
|
+
case 'warning':
|
|
153
|
+
return 'color: var(--color-warning);';
|
|
154
|
+
default:
|
|
155
|
+
return 'color: var(--color-success);';
|
|
156
|
+
}
|
|
157
|
+
}}
|
|
158
|
+
}
|
|
159
|
+
`;
|
|
160
|
+
const Title = styled.h2`
|
|
161
|
+
font-size: var(--font-body1);
|
|
162
|
+
font-weight: var(--font-bold);
|
|
163
|
+
margin-bottom: var(--spacing-s);
|
|
164
|
+
`;
|
|
165
|
+
const Message = styled.p`
|
|
166
|
+
font-size: var(--font-body1);
|
|
167
|
+
white-space: pre-line;
|
|
168
|
+
`;
|
|
169
|
+
export default StateModal;
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { useRef, useCallback, useState, useEffect, cloneElement, useMemo, forwardRef } from 'react';
|
|
2
|
+
import ReactDOM, { unmountComponentAtNode } from 'react-dom';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { MdClose } from 'react-icons/md/index.esm';
|
|
5
|
+
import { useForkRef } from '@cashub/hooks';
|
|
6
|
+
import { appendElementTo, isReactComponent } from '@cashub/utils';
|
|
7
|
+
import media from '../styles/mixin/media';
|
|
8
|
+
import scrollbar from '../styles/mixin/scrollbar';
|
|
9
|
+
import Heading3 from '../heading/Heading3';
|
|
10
|
+
import ModalBackdrop from '../backdrop/ModalBackdrop';
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
const TitleModal = props => {
|
|
13
|
+
const rootElement = appendElementTo('TitleModalContainer');
|
|
14
|
+
const Container = document.createElement('div');
|
|
15
|
+
rootElement.appendChild(Container);
|
|
16
|
+
const handleClose = async function () {
|
|
17
|
+
let dismiss = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
18
|
+
if (props.onBeforeClose) {
|
|
19
|
+
// expect a promise
|
|
20
|
+
// resolve indicate want to close modal
|
|
21
|
+
// reject indicate do not close modal
|
|
22
|
+
try {
|
|
23
|
+
await props.onBeforeClose(dismiss);
|
|
24
|
+
} catch (error) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// unmount component and clear event handler and state before remove container
|
|
30
|
+
unmountComponentAtNode(Container);
|
|
31
|
+
Container.remove();
|
|
32
|
+
if (props.onClose) {
|
|
33
|
+
props.onClose(dismiss);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const methods = {
|
|
37
|
+
close: handleClose
|
|
38
|
+
};
|
|
39
|
+
ReactDOM.render(/*#__PURE__*/_jsx(ModalContent, {
|
|
40
|
+
...props,
|
|
41
|
+
onClose: handleClose,
|
|
42
|
+
methods: methods
|
|
43
|
+
}), Container);
|
|
44
|
+
};
|
|
45
|
+
const ModalContent = _ref => {
|
|
46
|
+
let {
|
|
47
|
+
children,
|
|
48
|
+
onClose,
|
|
49
|
+
methods,
|
|
50
|
+
size
|
|
51
|
+
} = _ref;
|
|
52
|
+
const refWrapper = useRef(null);
|
|
53
|
+
const [clickTarget, setClickTarget] = useState(null);
|
|
54
|
+
const child = useMemo(() => {
|
|
55
|
+
return isReactComponent(children) ? /*#__PURE__*/cloneElement(children, methods) : children;
|
|
56
|
+
}, [children, methods]);
|
|
57
|
+
const handleDismiss = dismiss => {
|
|
58
|
+
if (clickTarget === refWrapper.current) {
|
|
59
|
+
onClose(dismiss);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
return /*#__PURE__*/_jsx(Wrapper, {
|
|
63
|
+
ref: refWrapper,
|
|
64
|
+
onClick: () => {
|
|
65
|
+
handleDismiss(true);
|
|
66
|
+
},
|
|
67
|
+
onMouseDown: event => {
|
|
68
|
+
setClickTarget(event.target);
|
|
69
|
+
},
|
|
70
|
+
children: /*#__PURE__*/_jsx(Container, {
|
|
71
|
+
size: size,
|
|
72
|
+
onMouseDown: event => {
|
|
73
|
+
setClickTarget(event.target);
|
|
74
|
+
},
|
|
75
|
+
children: child
|
|
76
|
+
})
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
const ModalHeader = _ref2 => {
|
|
80
|
+
let {
|
|
81
|
+
handleClose,
|
|
82
|
+
children
|
|
83
|
+
} = _ref2;
|
|
84
|
+
return /*#__PURE__*/_jsxs(Header, {
|
|
85
|
+
children: [/*#__PURE__*/_jsx(MdClose, {
|
|
86
|
+
onClick: handleClose
|
|
87
|
+
}), /*#__PURE__*/_jsx(Heading3, {
|
|
88
|
+
children: children
|
|
89
|
+
})]
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
const ModalBody = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
93
|
+
let {
|
|
94
|
+
children,
|
|
95
|
+
...props
|
|
96
|
+
} = _ref3;
|
|
97
|
+
const ownRef = useRef(null);
|
|
98
|
+
const bodyRef = useForkRef(ownRef, ref);
|
|
99
|
+
const recalculateHeight = useCallback(() => {
|
|
100
|
+
// body element not render yet
|
|
101
|
+
if (!ownRef.current) return;
|
|
102
|
+
const ModalBodyElement = ownRef.current;
|
|
103
|
+
const ModalHeaderElement = ModalBodyElement.previousSibling;
|
|
104
|
+
const ModalFooterElement = ModalBodyElement.nextSibling;
|
|
105
|
+
let needSubtractHeight = 0;
|
|
106
|
+
if (ModalHeaderElement) {
|
|
107
|
+
needSubtractHeight += ModalHeaderElement.offsetHeight;
|
|
108
|
+
}
|
|
109
|
+
if (ModalFooterElement) {
|
|
110
|
+
needSubtractHeight += ModalFooterElement.offsetHeight;
|
|
111
|
+
}
|
|
112
|
+
ModalBodyElement.style.maxHeight = `calc(90vh - ${needSubtractHeight}px)`;
|
|
113
|
+
}, []);
|
|
114
|
+
useEffect(() => {
|
|
115
|
+
recalculateHeight();
|
|
116
|
+
window.addEventListener('resize', recalculateHeight);
|
|
117
|
+
return () => window.removeEventListener('resize', recalculateHeight);
|
|
118
|
+
}, [recalculateHeight]);
|
|
119
|
+
return /*#__PURE__*/_jsx(Body, {
|
|
120
|
+
ref: bodyRef,
|
|
121
|
+
...props,
|
|
122
|
+
children: children
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
ModalBody.displayName = 'ModalBody';
|
|
126
|
+
const ModalFooter = _ref4 => {
|
|
127
|
+
let {
|
|
128
|
+
children
|
|
129
|
+
} = _ref4;
|
|
130
|
+
return /*#__PURE__*/_jsx(Footer, {
|
|
131
|
+
children: children
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
const Wrapper = styled(ModalBackdrop)`
|
|
135
|
+
z-index: 80;
|
|
136
|
+
`;
|
|
137
|
+
const Container = styled.div`
|
|
138
|
+
position: relative;
|
|
139
|
+
border-radius: var(--border-radius);
|
|
140
|
+
background: var(--color-background2);
|
|
141
|
+
box-shadow: var(--box-shadow);
|
|
142
|
+
border: var(--border-width) solid var(--border-color);
|
|
143
|
+
width: 100%;
|
|
144
|
+
|
|
145
|
+
${_ref5 => {
|
|
146
|
+
let {
|
|
147
|
+
size
|
|
148
|
+
} = _ref5;
|
|
149
|
+
switch (size) {
|
|
150
|
+
case 'extraLarge':
|
|
151
|
+
return 'max-width: 90%;';
|
|
152
|
+
case 'large':
|
|
153
|
+
return 'max-width: 75%;';
|
|
154
|
+
case 'normal':
|
|
155
|
+
return 'max-width: 50%;';
|
|
156
|
+
case 'small':
|
|
157
|
+
return 'max-width: 30%;';
|
|
158
|
+
default:
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
}}
|
|
162
|
+
|
|
163
|
+
${media.tablet`
|
|
164
|
+
${_ref6 => {
|
|
165
|
+
let {
|
|
166
|
+
size
|
|
167
|
+
} = _ref6;
|
|
168
|
+
switch (size) {
|
|
169
|
+
case 'extraLarge':
|
|
170
|
+
case 'large':
|
|
171
|
+
return 'max-width: 90%;';
|
|
172
|
+
case 'normal':
|
|
173
|
+
return 'max-width: 75%;';
|
|
174
|
+
case 'small':
|
|
175
|
+
return 'max-width: 50%;';
|
|
176
|
+
default:
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
179
|
+
}}
|
|
180
|
+
`}
|
|
181
|
+
|
|
182
|
+
${media.mobile`
|
|
183
|
+
${_ref7 => {
|
|
184
|
+
let {
|
|
185
|
+
size
|
|
186
|
+
} = _ref7;
|
|
187
|
+
switch (size) {
|
|
188
|
+
case 'normal':
|
|
189
|
+
return 'max-width: 90%;';
|
|
190
|
+
case 'small':
|
|
191
|
+
return 'max-width: 70%;';
|
|
192
|
+
default:
|
|
193
|
+
break;
|
|
194
|
+
}
|
|
195
|
+
}}
|
|
196
|
+
`}
|
|
197
|
+
`;
|
|
198
|
+
const Header = styled.div`
|
|
199
|
+
display: flex;
|
|
200
|
+
align-items: center;
|
|
201
|
+
padding: var(--spacing-s) 56px var(--spacing-s) var(--spacing-s);
|
|
202
|
+
border-bottom: var(--border-width) solid var(--border-color);
|
|
203
|
+
min-height: 64px;
|
|
204
|
+
color: var(--font-on-background);
|
|
205
|
+
|
|
206
|
+
> svg {
|
|
207
|
+
position: absolute;
|
|
208
|
+
top: 24px;
|
|
209
|
+
right: calc(12px + var(--spacing));
|
|
210
|
+
color: var(--font-on-mute);
|
|
211
|
+
font-size: var(--font-body1);
|
|
212
|
+
cursor: pointer;
|
|
213
|
+
}
|
|
214
|
+
`;
|
|
215
|
+
const Body = styled.div`
|
|
216
|
+
padding: var(--spacing);
|
|
217
|
+
overflow-y: auto;
|
|
218
|
+
overflow-x: hidden;
|
|
219
|
+
|
|
220
|
+
${scrollbar}
|
|
221
|
+
|
|
222
|
+
${_ref8 => {
|
|
223
|
+
let {
|
|
224
|
+
noPaddingBottom
|
|
225
|
+
} = _ref8;
|
|
226
|
+
return noPaddingBottom && 'padding-bottom: 0;';
|
|
227
|
+
}}
|
|
228
|
+
`;
|
|
229
|
+
const Footer = styled.div`
|
|
230
|
+
display: flex;
|
|
231
|
+
justify-content: flex-end;
|
|
232
|
+
padding: 0 var(--spacing);
|
|
233
|
+
border-top: var(--border-width) solid var(--border-color);
|
|
234
|
+
height: 64px;
|
|
235
|
+
line-height: 64px;
|
|
236
|
+
`;
|
|
237
|
+
export default Object.assign(TitleModal, {
|
|
238
|
+
Header: ModalHeader,
|
|
239
|
+
Body: ModalBody,
|
|
240
|
+
Footer: ModalFooter
|
|
241
|
+
});
|