@cashub/ui 0.48.30 → 0.49.0-beta.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/dist/assets/images/bg-aside.png +0 -0
- package/dist/assets/images/bg-main-vivid.png +0 -0
- package/dist/assets/images/bg-main.png +0 -0
- package/dist/button/IconButton.js +70 -0
- package/dist/icon/assets/android.jsx +10 -0
- package/dist/icon/assets/app-management.jsx +10 -0
- package/dist/icon/assets/appStore.jsx +6 -0
- package/dist/icon/assets/battery.jsx +15 -0
- package/dist/icon/assets/bill.jsx +10 -0
- package/dist/icon/assets/campaign.jsx +9 -0
- package/dist/icon/assets/casstore.jsx +8 -0
- package/dist/icon/assets/dashboard.jsx +6 -0
- package/dist/icon/assets/enterprise.jsx +15 -0
- package/dist/icon/assets/firmware.jsx +8 -0
- package/dist/icon/assets/folder.jsx +8 -0
- package/dist/icon/assets/group.jsx +18 -0
- package/dist/icon/assets/heartbeats.jsx +9 -0
- package/dist/icon/assets/invite-user.jsx +9 -0
- package/dist/icon/assets/log.jsx +9 -0
- package/dist/icon/assets/manufacturer.jsx +7 -0
- package/dist/icon/assets/merchant.jsx +16 -0
- package/dist/icon/assets/package-collection.jsx +8 -0
- package/dist/icon/assets/report.jsx +11 -0
- package/dist/icon/assets/resource.jsx +9 -0
- package/dist/icon/assets/role.jsx +7 -0
- package/dist/icon/assets/shield-lock.jsx +202 -0
- package/dist/icon/assets/shield-no-signal.jsx +195 -0
- package/dist/icon/assets/shield-unsafe.jsx +191 -0
- package/dist/icon/assets/shield.jsx +186 -0
- package/dist/icon/assets/statistics.jsx +9 -0
- package/dist/icon/assets/tag.jsx +14 -0
- package/dist/icon/assets/template-management.jsx +8 -0
- package/dist/icon/assets/terminal.jsx +7 -0
- package/dist/icon/assets/tradeye.jsx +7 -0
- package/dist/icon/registry.js +70 -0
- package/dist/iconbox/IconBox.js +103 -0
- package/dist/iconbox/assets/bg-enterprise.png +0 -0
- package/dist/iconbox/assets/bg-merchant.png +0 -0
- package/dist/iconbox/assets/bg-terminal.png +0 -0
- package/dist/iconbox/assets/bg-user.png +0 -0
- package/dist/iconbox/bgImageRegistry.js +18 -0
- package/dist/iconbox/subComponent/IconBoxImage.js +85 -0
- package/dist/layout/Aside.js +58 -0
- package/dist/layout/Container.js +56 -0
- package/dist/layout/Header.jsx +48 -0
- package/dist/layout/Layout.jsx +69 -0
- package/dist/layout/Logo.jsx +17 -0
- package/dist/layout/MenuIcon.jsx +45 -0
- package/dist/layout/Sidebar.jsx +261 -0
- package/dist/layout/assets/burger-modern.jsx +9 -0
- package/dist/layout/bgMainRegistry.js +14 -0
- package/dist/package.json +55 -0
- package/dist/styles/GlobalStyle.js +356 -0
- package/dist/styles/theme/dark.theme.js +99 -0
- package/dist/styles/theme/ember.theme.js +100 -0
- package/dist/styles/theme/midnight.theme.js +99 -0
- package/dist/styles/theme/white.theme.js +101 -0
- package/dist/styles/themes.js +20 -0
- package/package.json +64 -55
- package/setupTests.js +9 -0
- package/src/Tab/Tab.js +11 -0
- package/src/Tab/TabList.js +159 -0
- package/src/Tab/TabPanel.js +35 -0
- package/src/Tab/TabTab.js +99 -0
- package/src/Tab/__stories__/Tab.stories.js +55 -0
- package/src/Tab/__stories__/TabList.stories.js +49 -0
- package/src/Tab/__stories__/TabPanel.stories.js +45 -0
- package/src/Tab/__stories__/TabTab.stories.js +30 -0
- package/src/Tab/__stories__/TabV2.stories.js +47 -0
- package/src/Tab/__test__/Tab.test.js +43 -0
- package/src/Tab/__test__/TabList.test.js +22 -0
- package/src/Tab/__test__/TabPanel.test.js +27 -0
- package/src/Tab/__test__/TabTab.test.js +58 -0
- package/src/Tab/index.js +22 -0
- package/src/Tab/subComponent/TabContext.js +5 -0
- package/src/Tab/subComponent/TabListV2.js +16 -0
- package/src/Tab/subComponent/TabPanelV2.js +38 -0
- package/src/Tab/subComponent/TabTabV2.js +47 -0
- package/src/VerticalTab/TabList.js +18 -0
- package/src/VerticalTab/TabPanel.js +38 -0
- package/src/VerticalTab/TabTab.js +54 -0
- package/src/VerticalTab/VerticalTab.js +20 -0
- package/src/VerticalTab/index.js +10 -0
- package/src/VerticalTab/subComponent/TabContext.js +5 -0
- package/src/VerticalTab/subComponent/VerticalTab.stories.js +82 -0
- package/src/alert/Alert.js +15 -0
- package/src/alert/__stories__/Alert.stories.js +18 -0
- package/src/alert/index.js +1 -0
- package/src/animate/Collapse.js +68 -0
- package/src/animate/Loader.js +36 -0
- package/src/animate/NumberCounter.js +49 -0
- package/src/animate/PulseRing.js +25 -0
- package/src/animate/Spinner.js +13 -0
- package/src/animate/__stories__/Collapse.stories.js +60 -0
- package/src/animate/__stories__/Loader.stories.js +33 -0
- package/src/animate/__stories__/NumberCounter.stories.js +29 -0
- package/src/animate/__stories__/PulseRing.stories.js +17 -0
- package/src/animate/__stories__/Spinner.stories.js +13 -0
- package/src/animate/__test__/Collapse.test.js +125 -0
- package/src/animate/__test__/Loader.test.js +42 -0
- package/src/animate/__test__/NumberCounter.test.js +71 -0
- package/src/animate/__test__/PulseRing.test.js +37 -0
- package/src/animate/__test__/Spinner.test.js +18 -0
- package/src/animate/index.js +5 -0
- package/src/assets/css/autocomplete.css +16 -0
- package/src/assets/css/font.css +4 -0
- package/src/assets/css/global.css +2 -0
- package/src/assets/font/helvetica/Helvetica.ttf +0 -0
- package/src/assets/font/nanumGothic/NanumGothic-Bold.ttf +0 -0
- package/src/assets/font/nanumGothic/NanumGothic-ExtraBold.ttf +0 -0
- package/src/assets/font/nanumGothic/NanumGothic-Regular.ttf +0 -0
- package/src/assets/icons/app-management.png +0 -0
- package/src/assets/icons/burger-black.png +0 -0
- package/src/assets/icons/burger-white.png +0 -0
- package/src/assets/icons/burger.png +0 -0
- package/src/assets/icons/file.svg +1 -0
- package/src/assets/icons/map_icon1.png +0 -0
- package/src/assets/icons/map_icon4.png +0 -0
- package/src/assets/images/bg-aside.png +0 -0
- package/src/assets/images/bg-chart-circle.png +0 -0
- package/src/assets/images/bg-chart-triangle.png +0 -0
- package/src/assets/images/bg-main-vivid.png +0 -0
- package/src/assets/images/bg-main.png +0 -0
- package/src/assets/images/cashub-logo-only.png +0 -0
- package/src/assets/images/default-user.jpg +0 -0
- package/src/assets/images/logo-cashub.png +0 -0
- package/src/assets/images/map.png +0 -0
- package/src/assets/images/qrcode.png +0 -0
- package/src/backdrop/BaseBackdrop.js +13 -0
- package/src/backdrop/LoadingBackdrop.js +12 -0
- package/src/backdrop/ModalBackdrop.js +10 -0
- package/src/backdrop/__test__/BaseBackdrop.test.js +10 -0
- package/src/backdrop/__test__/LoadingBackdrop.test.js +9 -0
- package/src/backdrop/__test__/ModalBackdrop.test.js +8 -0
- package/src/backdrop/index.js +3 -0
- package/src/badge/Badge.js +21 -0
- package/src/badge/BadgeDot.js +13 -0
- package/src/badge/BadgeFill.js +29 -0
- package/src/badge/BadgeFillTriangle.js +76 -0
- package/src/badge/BadgeWithText.js +21 -0
- package/src/badge/__stories__/Badge.stories.js +47 -0
- package/src/badge/__stories__/BadgeDot.stories.js +23 -0
- package/src/badge/__stories__/BadgeFill.stories.js +29 -0
- package/src/badge/__stories__/BadgeFillTriangle.stories.js +29 -0
- package/src/badge/__stories__/BadgeWithText.stories.js +26 -0
- package/src/badge/__test__/Badge.test.js +32 -0
- package/src/badge/__test__/BadgeDot.test.js +22 -0
- package/src/badge/__test__/BadgeFill.test.js +41 -0
- package/src/badge/__test__/BadgeWithText.test.js +22 -0
- package/src/badge/index.js +5 -0
- package/src/billing/BarChart.js +42 -0
- package/src/billing/Grid.js +30 -0
- package/src/billing/Header2.js +15 -0
- package/src/billing/Header3.js +32 -0
- package/src/billing/Paragraph.js +27 -0
- package/src/billing/ParagraphGroup.js +12 -0
- package/src/billing/ParagraphText.js +16 -0
- package/src/billing/Section.js +48 -0
- package/src/billing/SectionBody.js +7 -0
- package/src/billing/SectionHeader.js +16 -0
- package/src/billing/__stories__/BarChart.stories.js_bak +46 -0
- package/src/billing/__stories__/Grid.stories.js_bak +57 -0
- package/src/billing/__stories__/Header2.stories.js_bak +62 -0
- package/src/billing/__stories__/Header3.stories.js_bak +69 -0
- package/src/billing/__stories__/Paragraph.stories.js_bak +84 -0
- package/src/billing/__stories__/ParagraphGroup.stories.js_bak +68 -0
- package/src/billing/__stories__/ParagraphText.stories.js_bak +64 -0
- package/src/billing/__stories__/Section.stories.js_bak +115 -0
- package/src/billing/__stories__/SectionBody.stories.js_bak +62 -0
- package/src/billing/__stories__/SectionHeader.stories.js-bak +68 -0
- package/src/breadcrumb/Breadcrumb.js +66 -0
- package/src/breadcrumb/__stories__/Breadcrumb.stories.js +31 -0
- package/src/breadcrumb/__test__/breadcrumb.test.js +27 -0
- package/src/breadcrumb/index.js +1 -0
- package/src/button/Button.js +110 -0
- package/src/button/ButtonGroup.js +33 -0
- package/src/button/IconButton.js +35 -0
- package/src/button/ScrollToTopButton.js +48 -0
- package/src/button/__stories__/Button.stories.js +104 -0
- package/src/button/__stories__/ButtonGroup.stories.js +48 -0
- package/src/button/__stories__/IconButton.stories.js +30 -0
- package/src/button/__stories__/ScrollToTopButton.stories.js +22 -0
- package/src/button/__test__/Button.test.js +32 -0
- package/src/button/__test__/ButtonGroup.test.js +25 -0
- package/src/button/__test__/IconButton.test.js +34 -0
- package/src/button/__test__/ScrollToTopButton.test.js +19 -0
- package/src/button/index.js +4 -0
- package/src/callout/Callout.js +52 -0
- package/src/callout/__stories__/Callout.stories.js +23 -0
- package/src/callout/__test__/Callout.test.js +29 -0
- package/src/callout/index.js +1 -0
- package/src/chart/BarChart.js +158 -0
- package/src/chart/DoughnutChart.js +118 -0
- package/src/chart/LineChart.js +151 -0
- package/src/chart/SingleBarChart.js +27 -0
- package/src/chart/__stories__/BarChart.stories.js +56 -0
- package/src/chart/__stories__/DoughnutChart.stories.js +63 -0
- package/src/chart/__stories__/LineChart.stories.js +75 -0
- package/src/chart/__stories__/SingleBarChart.stories.js +22 -0
- package/src/chart/index.js +5 -0
- package/src/chart/utils/centerTextPlugin.js +51 -0
- package/src/chart/utils/customTooltip.js +116 -0
- package/src/chart/utils/htmlLegendPlugin.js +98 -0
- package/src/chart/utils/index.js +3 -0
- package/src/chart/utils/padEmptyChartBar.js +41 -0
- package/src/chart/utils/yAxisTopTitlePlugin.js +38 -0
- package/src/container/FlexContainer.js +15 -0
- package/src/container/__stories__/FlexContainer.stories.js +39 -0
- package/src/container/__test__/FlexContainer.test.js +21 -0
- package/src/container/index.js +1 -0
- package/src/cropper/Cropper.js +49 -0
- package/src/cropper/CropperModalHandler.js +36 -0
- package/src/cropper/__stories__/Cropper.stories.js +32 -0
- package/src/cropper/__test__/Cropper.test.js +90 -0
- package/src/cropper/index.js +2 -0
- package/src/cropper/subComponent/CropImageModal.js +84 -0
- package/src/datetimePicker/DatePicker.js +493 -0
- package/src/datetimePicker/DatePickerV2.js +500 -0
- package/src/datetimePicker/DatetimePicker.js +235 -0
- package/src/datetimePicker/DatetimePickerV2.js +512 -0
- package/src/datetimePicker/DatetimePickerV3.js +292 -0
- package/src/datetimePicker/TimeInput.js +45 -0
- package/src/datetimePicker/TimePicker.js +318 -0
- package/src/datetimePicker/TimePickerStyle.js +59 -0
- package/src/datetimePicker/TimePickerV2.js +222 -0
- package/src/datetimePicker/__stories__/DatePicker.stories.js +51 -0
- package/src/datetimePicker/__stories__/DatePickerV2.stories.js +73 -0
- package/src/datetimePicker/__stories__/DatetimePicker.stories.js +74 -0
- package/src/datetimePicker/__stories__/DatetimePickerV2.stories.js +91 -0
- package/src/datetimePicker/__stories__/DatetimePickerV3.stories.js +80 -0
- package/src/datetimePicker/__stories__/TimeInput.stories.js +67 -0
- package/src/datetimePicker/__stories__/TimePicker.stories.js +29 -0
- package/src/datetimePicker/__stories__/TimePickerV2.stories.js +22 -0
- package/src/datetimePicker/__test__/CustomTimeInput.test.js +25 -0
- package/src/datetimePicker/__test__/DatetimePicker.test.js +121 -0
- package/src/datetimePicker/__test__/TimeInput.test.js +22 -0
- package/src/datetimePicker/accordion/Month.js +258 -0
- package/src/datetimePicker/accordion/Year.js +307 -0
- package/src/datetimePicker/hooks/index.js +3 -0
- package/src/datetimePicker/hooks/useChangeNumber.js +42 -0
- package/src/datetimePicker/hooks/useDecrease.js +31 -0
- package/src/datetimePicker/hooks/useIncrease.js +31 -0
- package/src/datetimePicker/index.js +9 -0
- package/src/datetimePicker/provider/constant.js +16 -0
- package/src/datetimePicker/subComponent/Accordion.js +407 -0
- package/src/datetimePicker/subComponent/CustomTimeInput.js +48 -0
- package/src/datetimePicker/subComponent/DateTimePickerContext.js +5 -0
- package/src/datetimePicker/utils/GMTDate.js +13 -0
- package/src/datetimePicker/utils/pad.js +9 -0
- package/src/datetimePicker/utils/toUTC0.js +10 -0
- package/src/descriptionList/DescriptionDetail.js +18 -0
- package/src/descriptionList/DescriptionList.js +15 -0
- package/src/descriptionList/DescriptionTerm.js +9 -0
- package/src/descriptionList/__stories__/DescriptionDetail.stories.js +39 -0
- package/src/descriptionList/__stories__/DescriptionList.stories.js +39 -0
- package/src/descriptionList/__stories__/DescriptionTerm.stories.js +13 -0
- package/src/descriptionList/__test__/DescriptionDetail.test.js +13 -0
- package/src/descriptionList/__test__/DescriptionList.test.js +12 -0
- package/src/descriptionList/__test__/DescriptionTerm.test.js +7 -0
- package/src/descriptionList/index.js +3 -0
- package/src/divider/Divider.js +21 -0
- package/src/divider/__stories__/Divider.stories.js +23 -0
- package/src/divider/__test__/Divider.test.js +24 -0
- package/src/divider/index.js +1 -0
- package/src/dropdown/Dropdown.js +50 -0
- package/src/dropdown/DropdownButtonOption.js +25 -0
- package/src/dropdown/DropdownContent.js +78 -0
- package/src/dropdown/DropdownDivOption.js +21 -0
- package/src/dropdown/DropdownItem.js +17 -0
- package/src/dropdown/DropdownLinkOption.js +19 -0
- package/src/dropdown/DropdownToggle.js +26 -0
- package/src/dropdown/__stories__/Dropdown.stories.js +46 -0
- package/src/dropdown/__stories__/DropdownButtonOption.stories.js +33 -0
- package/src/dropdown/__stories__/DropdownContent.stories.js +34 -0
- package/src/dropdown/__stories__/DropdownDivOption.stories.js +27 -0
- package/src/dropdown/__stories__/DropdownItem.stories.js +48 -0
- package/src/dropdown/__stories__/DropdownLinkOption.stories.js +63 -0
- package/src/dropdown/__stories__/DropdownToggle.stories.js +40 -0
- package/src/dropdown/__test__/Dropdown.test.js +132 -0
- package/src/dropdown/__test__/DropdownButtonOption.test.js +8 -0
- package/src/dropdown/__test__/DropdownContent.test.js +85 -0
- package/src/dropdown/__test__/DropdownDivOption.test.js +8 -0
- package/src/dropdown/__test__/DropdownItem.test.js +55 -0
- package/src/dropdown/__test__/DropdownLinkOption.test.js +14 -0
- package/src/dropdown/__test__/DropdownToggle.test.js +53 -0
- package/src/dropdown/index.js +12 -0
- package/src/dropdown/subComponent/DropdownContext.js +5 -0
- package/src/dropzone/FileDropzone.js +541 -0
- package/src/dropzone/ImageDropzone.js +365 -0
- package/src/dropzone/__stories__/FileDropzone.stories.js +148 -0
- package/src/dropzone/__stories__/ImageDropzone.stories.js +101 -0
- package/src/dropzone/__test__/FileDropzone.test.js +382 -0
- package/src/dropzone/__test__/ImageDropzone.test.js +290 -0
- package/src/dropzone/__test__/Message.test.js +14 -0
- package/src/dropzone/index.js +2 -0
- package/src/dropzone/subComponent/Message.js +16 -0
- package/src/figure/IconFigure.js +31 -0
- package/src/figure/ImageFigure.js +25 -0
- package/src/figure/__stories__/IconFigure.stories.js +25 -0
- package/src/figure/__stories__/ImageFigure.stories.js +26 -0
- package/src/figure/__test__/IconFigure.test.js +28 -0
- package/src/figure/__test__/ImageFigure.test.js +38 -0
- package/src/figure/index.js +2 -0
- package/src/file/HiddenFileInput.js +10 -0
- package/src/file/index.js +1 -0
- package/src/form/Checkbox.js +138 -0
- package/src/form/Fieldset.js +13 -0
- package/src/form/FormItem.js +12 -0
- package/src/form/Input.js +42 -0
- package/src/form/Label.js +35 -0
- package/src/form/MutedText.js +11 -0
- package/src/form/PasswordInput.js +40 -0
- package/src/form/RadioButton.js +82 -0
- package/src/form/SearchSelect.js +198 -0
- package/src/form/Searchbox.js +95 -0
- package/src/form/Slider.js +34 -0
- package/src/form/SwitchButton.js +86 -0
- package/src/form/Textarea.js +36 -0
- package/src/form/TreeView.js +77 -0
- package/src/form/__stories__/Checkbox.stories.js +87 -0
- package/src/form/__stories__/FormItem.stories.js +33 -0
- package/src/form/__stories__/Input.stories.js +30 -0
- package/src/form/__stories__/Label.stories.js +38 -0
- package/src/form/__stories__/MutedText.stories.js +27 -0
- package/src/form/__stories__/PasswordInput.stories.js +16 -0
- package/src/form/__stories__/RadioButton.stories.js +48 -0
- package/src/form/__stories__/SearchSelect.stories.js +99 -0
- package/src/form/__stories__/Searchbox.stories.js +24 -0
- package/src/form/__stories__/Slider.stories.js +46 -0
- package/src/form/__stories__/SwitchButton.stories.js +48 -0
- package/src/form/__stories__/Textarea.stories.js +19 -0
- package/src/form/__stories__/TreeView.stories.js +76 -0
- package/src/form/__test__/Checkbox.test.js +68 -0
- package/src/form/__test__/FormItem.test.js +8 -0
- package/src/form/__test__/Input.test.js +28 -0
- package/src/form/__test__/Label.test.js +33 -0
- package/src/form/__test__/MutedText.test.js +18 -0
- package/src/form/__test__/RadioButton.test.js +57 -0
- package/src/form/__test__/Searchbox.test.js +50 -0
- package/src/form/__test__/Textarea.test.js +25 -0
- package/src/form/index.js +14 -0
- package/src/grid/Column.js +36 -0
- package/src/grid/Grid.js +15 -0
- package/src/grid/__stories__/Grid.stories.js +38 -0
- package/src/grid/__test__/Grid.test.js +44 -0
- package/src/grid/index.js +2 -0
- package/src/heading/Heading1.js +11 -0
- package/src/heading/Heading2.js +13 -0
- package/src/heading/Heading3.js +21 -0
- package/src/heading/__stories__/Heading1.stories.js +24 -0
- package/src/heading/__stories__/Heading2.stories.js +24 -0
- package/src/heading/__stories__/Heading3.stories.js +24 -0
- package/src/heading/__test__/Heading1.test.js +21 -0
- package/src/heading/__test__/Heading2.test.js +34 -0
- package/src/heading/__test__/Heading3.test.js +46 -0
- package/src/heading/index.js +3 -0
- package/src/helmet/Helmet.js +12 -0
- package/src/helmet/__test__/Helmet.test.js +38 -0
- package/src/helmet/index.js +2 -0
- package/src/icon/assets/android.jsx +10 -0
- package/src/icon/assets/app-management.jsx +10 -0
- package/src/icon/assets/appStore.jsx +6 -0
- package/src/icon/assets/battery.jsx +15 -0
- package/src/icon/assets/bill.jsx +10 -0
- package/src/icon/assets/campaign.jsx +9 -0
- package/src/icon/assets/casstore.jsx +8 -0
- package/src/icon/assets/dashboard.jsx +6 -0
- package/src/icon/assets/enterprise.jsx +15 -0
- package/src/icon/assets/firmware.jsx +8 -0
- package/src/icon/assets/folder.jsx +8 -0
- package/src/icon/assets/group.jsx +18 -0
- package/src/icon/assets/heartbeats.jsx +9 -0
- package/src/icon/assets/invite-user.jsx +9 -0
- package/src/icon/assets/log.jsx +9 -0
- package/src/icon/assets/manufacturer.jsx +7 -0
- package/src/icon/assets/merchant.jsx +16 -0
- package/src/icon/assets/package-collection.jsx +8 -0
- package/src/icon/assets/report.jsx +11 -0
- package/src/icon/assets/resource.jsx +9 -0
- package/src/icon/assets/role.jsx +7 -0
- package/src/icon/assets/shield-lock.jsx +202 -0
- package/src/icon/assets/shield-no-signal.jsx +195 -0
- package/src/icon/assets/shield-unsafe.jsx +191 -0
- package/src/icon/assets/shield.jsx +186 -0
- package/src/icon/assets/statistics.jsx +9 -0
- package/src/icon/assets/tag.jsx +14 -0
- package/src/icon/assets/template-management.jsx +8 -0
- package/src/icon/assets/terminal.jsx +7 -0
- package/src/icon/assets/tradeye.jsx +7 -0
- package/src/icon/registry.js +65 -0
- package/src/iconbox/ApplicationIconBox.js +62 -0
- package/src/iconbox/IconBox.js +85 -0
- package/src/iconbox/IconBoxV2.js +61 -0
- package/src/iconbox/__stories__/ApplicationIconBox.stories.js +53 -0
- package/src/iconbox/__stories__/IconBox.stories.js +34 -0
- package/src/iconbox/__stories__/IconBoxFigure.stories.js +67 -0
- package/src/iconbox/__stories__/IconBoxFigure.stories_V2.stories.js +41 -0
- package/src/iconbox/__stories__/IconBoxImage.stories.js +32 -0
- package/src/iconbox/__stories__/IconBoxV2.stories.js +66 -0
- package/src/iconbox/__test__/ApplicationIconBox.test.js +77 -0
- package/src/iconbox/__test__/IconBox.test.js +22 -0
- package/src/iconbox/__test__/IconBoxFigure.test.js +37 -0
- package/src/iconbox/__test__/IconBoxImage.test.js +32 -0
- package/src/iconbox/__test__/IconBoxV2.test.js +51 -0
- package/src/iconbox/assets/bg-enterprise.png +0 -0
- package/src/iconbox/assets/bg-merchant.png +0 -0
- package/src/iconbox/assets/bg-terminal.png +0 -0
- package/src/iconbox/assets/bg-user.png +0 -0
- package/src/iconbox/bgImageRegistry.js +13 -0
- package/src/iconbox/index.js +3 -0
- package/src/iconbox/subComponent/IconBoxFigure.js +16 -0
- package/src/iconbox/subComponent/IconBoxImage.js +52 -0
- package/src/image/ImageFluid.js +12 -0
- package/src/image/UploadImage.js +287 -0
- package/src/image/__stories__/ImageFluid.stories.js +25 -0
- package/src/image/__stories__/UploadImage.stories.js +56 -0
- package/src/image/__test__/ImageFluid.test.js +44 -0
- package/src/image/__test__/UploadImage.test.js +315 -0
- package/src/image/index.js +2 -0
- package/src/index.js +49 -0
- package/src/jsoneditor/JsonEditor.js +132 -0
- package/src/jsoneditor/__stories__/JsonEditor.stories.js +55 -0
- package/src/jsoneditor/__test__/JsonEditor.test.js +52 -0
- package/src/jsoneditor/index.js +1 -0
- package/src/keyframe/Pulse.js +17 -0
- package/src/keyframe/Spin.js +9 -0
- package/src/layout/Aside.js +47 -0
- package/src/layout/AsideHeader.jsx +27 -0
- package/src/layout/Backdrop.js +13 -0
- package/src/layout/Container.js +48 -0
- package/src/layout/Footer.js +32 -0
- package/src/layout/Header.jsx +48 -0
- package/src/layout/Layout.jsx +69 -0
- package/src/layout/Logo.jsx +17 -0
- package/src/layout/MenuIcon.jsx +45 -0
- package/src/layout/Sidebar.jsx +261 -0
- package/src/layout/assets/burger-modern.jsx +9 -0
- package/src/layout/bgMainRegistry.js +9 -0
- package/src/layout/index.js +1 -0
- package/src/link/LinkSpan.js +44 -0
- package/src/link/__stories__/LinkSpan.stories.js +27 -0
- package/src/link/__test__/LinkSpan.test.js +52 -0
- package/src/link/index.js +1 -0
- package/src/map/GoogleMap.js +489 -0
- package/src/map/GoogleReverseGeolocation.js +197 -0
- package/src/map/LeafletMap.js +264 -0
- package/src/map/LeafletReverseGeolocation.js +89 -0
- package/src/map/__stories__/GoogleMap.stories.js +139 -0
- package/src/map/__stories__/GoogleReverseGeolocation.stories.js +95 -0
- package/src/map/__stories__/LeafletMap.stories.js +136 -0
- package/src/map/__stories__/LeafletReverseGeolocation.stories.js +91 -0
- package/src/map/__test__/LeafletReverseGeolocation.test.js +245 -0
- package/src/map/__test__/MapSearchBoxControl.test.js +89 -0
- package/src/map/index.js +4 -0
- package/src/map/subComponent/BasicLeafletMap.js +33 -0
- package/src/map/subComponent/GoogleMapContainer.js +19 -0
- package/src/map/subComponent/GoogleMapPopup.js +115 -0
- package/src/map/subComponent/GoogleMapWrapper.js +27 -0
- package/src/map/subComponent/LeafletDrawControl.js +133 -0
- package/src/map/subComponent/LeafletMapContainer.js +163 -0
- package/src/map/subComponent/MapSearchBoxControl.js +43 -0
- package/src/modal/StateModal.js +182 -0
- package/src/modal/TitleModal.js +244 -0
- package/src/modal/__stories__/StateModal.stories.js +119 -0
- package/src/modal/__stories__/TitleModal.stories.js +56 -0
- package/src/modal/__test__/StateModal.test.js +144 -0
- package/src/modal/index.js +2 -0
- package/src/page/Disclaimer.js +123 -0
- package/src/page/index.js +1 -0
- package/src/paginate/Paginate.js +132 -0
- package/src/paginate/__stories__/Paginate.stories.js +49 -0
- package/src/paginate/__test__/Paginate.test.js +124 -0
- package/src/paginate/index.js +1 -0
- package/src/popover/Popover.js +82 -0
- package/src/popover/__stories__/Popover.stories.js +44 -0
- package/src/popover/index.js +1 -0
- package/src/qrcode/QRCode.js +54 -0
- package/src/qrcode/QRCodeContainter.js +25 -0
- package/src/qrcode/__stories__/QRCode.stories.js +36 -0
- package/src/qrcode/__stories__/QRCodeContainter.stories.js +28 -0
- package/src/qrcode/index.js +2 -0
- package/src/ribbon/Ribbon.js +38 -0
- package/src/ribbon/__stories__/Ribbon.stories.js +25 -0
- package/src/ribbon/index.js +1 -0
- package/src/section/Section.js +66 -0
- package/src/section/SectionBody.js +34 -0
- package/src/section/SectionHeader.js +41 -0
- package/src/section/SectionToolbar.js +13 -0
- package/src/section/SectionToolbarItem.js +12 -0
- package/src/section/__stories__/Section.stories.js +52 -0
- package/src/section/__stories__/SectionBody.stories.js +40 -0
- package/src/section/__stories__/SectionHeader.stories.js +67 -0
- package/src/section/__stories__/SectionToolbar.stories.js +43 -0
- package/src/section/__test__/Section.test.js +98 -0
- package/src/section/__test__/SectionBody.test.js +89 -0
- package/src/section/__test__/SectionHeader.test.js +35 -0
- package/src/section/__test__/SectionToolbar.test.js +17 -0
- package/src/section/index.js +5 -0
- package/src/select/InputSelect.js +314 -0
- package/src/select/Select.js +935 -0
- package/src/select/__stories__/InputSelect.stories.js +60 -0
- package/src/select/__stories__/Select.stories.js +236 -0
- package/src/select/__test__/Select.test.js +219 -0
- package/src/select/index.js +2 -0
- package/src/select/subComponent/Checkbox.js +33 -0
- package/src/select/subComponent/Footer.js +8 -0
- package/src/select/subComponent/ListBox.js +15 -0
- package/src/select/subComponent/Option.js +30 -0
- package/src/select/subComponent/OptionGroup.js +18 -0
- package/src/select/subComponent/Options.js +24 -0
- package/src/select/subComponent/SearchBox.js +53 -0
- package/src/select/subComponent/SelectedMultipleCount.js +42 -0
- package/src/select/subComponent/SelectedMultipleTags.js +41 -0
- package/src/select/subComponent/SelectedMultipleText.js +61 -0
- package/src/select/subComponent/SelectedSingle.js +12 -0
- package/src/styles/GlobalStyle.js +110 -0
- package/src/styles/config/breakpoint.style.js +8 -0
- package/src/styles/config/header.style.js +5 -0
- package/src/styles/config/sidebar.style.js +12 -0
- package/src/styles/index.js +2 -0
- package/src/styles/mixin/backgroundColor.js +15 -0
- package/src/styles/mixin/borderColor.js +15 -0
- package/src/styles/mixin/color.js +15 -0
- package/src/styles/mixin/colorOnBackground.js +13 -0
- package/src/styles/mixin/inputPlaceholder.js +26 -0
- package/src/styles/mixin/media.js +14 -0
- package/src/styles/mixin/rounded.js +12 -0
- package/src/styles/mixin/scrollbar.js +26 -0
- package/src/styles/theme/dark.theme.js +101 -0
- package/src/styles/theme/ember.theme.js +94 -0
- package/src/styles/theme/light.theme.js +99 -0
- package/src/styles/theme/midnight.theme.js +93 -0
- package/src/styles/theme/white.theme.js +103 -0
- package/src/styles/themes.js +15 -0
- package/src/table/GridTable.js +333 -0
- package/src/table/ImageBox.js +37 -0
- package/src/table/InfiniteGridTable.js +424 -0
- package/src/table/PermissionTable.js +36 -0
- package/src/table/SimpleGridTable.js +135 -0
- package/src/table/Table.js +553 -0
- package/src/table/__mock__/columns.js +67 -0
- package/src/table/__mock__/data.js +456 -0
- package/src/table/__stories__/GridTable.stories.js +129 -0
- package/src/table/__stories__/ImageBox.stories.js +27 -0
- package/src/table/__stories__/InfiniteGridTable.stories.js +120 -0
- package/src/table/__stories__/PermissionTable.stories.js +52 -0
- package/src/table/__stories__/SimpleGridTable.stories.js +58 -0
- package/src/table/__stories__/Table.stories.js +158 -0
- package/src/table/hooks/index.js +2 -0
- package/src/table/hooks/useCalculateDataRange.js +26 -0
- package/src/table/hooks/useGenerateSort.js +37 -0
- package/src/table/index.js +6 -0
- package/src/table/subComponent/BaseTableHeadCell.js +48 -0
- package/src/table/subComponent/GridTableFooter.js +18 -0
- package/src/table/subComponent/GridTableHeadCell.js +14 -0
- package/src/table/subComponent/Resizer.js +81 -0
- package/src/table/subComponent/TableFooter.js +19 -0
- package/src/table/subComponent/TableFooterInfo.js +8 -0
- package/src/table/subComponent/TableFooterPager.js +26 -0
- package/src/table/subComponent/TableHeadCell.js +14 -0
- package/src/table/subComponent/TableSort.js +25 -0
- package/src/tagify/TagifyStyle.js +55 -0
- package/src/tagify/Tags.js +49 -0
- package/src/tagify/__stories__/Tags.stories.js +59 -0
- package/src/tagify/index.js +3 -0
- package/src/tagify/templates/getCreateButtonTemplate.js +12 -0
- package/src/text/Paragraph.js +52 -0
- package/src/text/__stories__/Paragraph.stories.js +40 -0
- package/src/text/index.js +1 -0
- package/src/timeline/Timeline.js +106 -0
- package/src/timeline/__stories__/Timeline.stories.js +55 -0
- package/src/timeline/index.js +1 -0
- package/src/toast/CustomToastContainer.js +40 -0
- package/src/toast/MessageContainer.js +40 -0
- package/src/toast/__stories__/MessageContainer.stories.js +47 -0
- package/src/toast/index.js +3 -0
- package/src/toast/show.js +39 -0
- package/src/toast/style.css +1 -0
- package/src/tooltip/Tooltip.js +149 -0
- package/src/tooltip/__stories__/Tooltip.stories.js +72 -0
- package/src/tooltip/__test__/tooltip.test.js +130 -0
- package/src/tooltip/index.js +1 -0
- package/src/treeView/TreeViewV2.js +33 -0
- package/src/treeView/TreeflexStyle.js +44 -0
- package/src/treeView/index.js +2 -0
- package/src/wizard/Wizard.js +276 -0
- package/src/wizard/__stories__/Wizard.stories.js +81 -0
- package/src/wizard/__test__/Wizard.test.js +173 -0
- package/src/wizard/index.js +1 -0
- package/src/xmleditor/XmlEditor.js +25 -0
- package/src/xmleditor/index.js +1 -0
- package/transformer/fileTransformer.js +9 -0
- package/assets/images/bg-aside.png +0 -0
- package/button/IconButton.js +0 -72
- package/iconbox/IconBox.js +0 -67
- package/iconbox/subComponent/IconBoxImage.js +0 -42
- package/layout/Aside.js +0 -48
- package/layout/Container.js +0 -39
- package/layout/Header.jsx +0 -55
- package/layout/Layout.jsx +0 -84
- package/layout/Logo.jsx +0 -17
- package/layout/MenuIcon.jsx +0 -27
- package/layout/Sidebar.jsx +0 -271
- package/styles/GlobalStyle.js +0 -334
- package/styles/theme/dark.theme.js +0 -97
- package/styles/theme/white.theme.js +0 -97
- package/styles/themes.js +0 -16
- /package/{Tab → dist/Tab}/Tab.js +0 -0
- /package/{Tab → dist/Tab}/TabList.js +0 -0
- /package/{Tab → dist/Tab}/TabPanel.js +0 -0
- /package/{Tab → dist/Tab}/TabTab.js +0 -0
- /package/{Tab → dist/Tab}/index.js +0 -0
- /package/{Tab → dist/Tab}/subComponent/TabContext.js +0 -0
- /package/{Tab → dist/Tab}/subComponent/TabListV2.js +0 -0
- /package/{Tab → dist/Tab}/subComponent/TabPanelV2.js +0 -0
- /package/{Tab → dist/Tab}/subComponent/TabTabV2.js +0 -0
- /package/{VerticalTab → dist/VerticalTab}/TabList.js +0 -0
- /package/{VerticalTab → dist/VerticalTab}/TabPanel.js +0 -0
- /package/{VerticalTab → dist/VerticalTab}/TabTab.js +0 -0
- /package/{VerticalTab → dist/VerticalTab}/VerticalTab.js +0 -0
- /package/{VerticalTab → dist/VerticalTab}/index.js +0 -0
- /package/{VerticalTab → dist/VerticalTab}/subComponent/TabContext.js +0 -0
- /package/{alert → dist/alert}/Alert.js +0 -0
- /package/{alert → dist/alert}/index.js +0 -0
- /package/{animate → dist/animate}/Collapse.js +0 -0
- /package/{animate → dist/animate}/Loader.js +0 -0
- /package/{animate → dist/animate}/NumberCounter.js +0 -0
- /package/{animate → dist/animate}/PulseRing.js +0 -0
- /package/{animate → dist/animate}/Spinner.js +0 -0
- /package/{animate → dist/animate}/index.js +0 -0
- /package/{assets → dist/assets}/css/autocomplete.css +0 -0
- /package/{assets → dist/assets}/css/font.css +0 -0
- /package/{assets → dist/assets}/css/global.css +0 -0
- /package/{assets → dist/assets}/font/helvetica/Helvetica.ttf +0 -0
- /package/{assets → dist/assets}/font/nanumGothic/NanumGothic-Bold.ttf +0 -0
- /package/{assets → dist/assets}/font/nanumGothic/NanumGothic-ExtraBold.ttf +0 -0
- /package/{assets → dist/assets}/font/nanumGothic/NanumGothic-Regular.ttf +0 -0
- /package/{assets → dist/assets}/icons/app-management.png +0 -0
- /package/{assets → dist/assets}/icons/burger-black.png +0 -0
- /package/{assets → dist/assets}/icons/burger-white.png +0 -0
- /package/{assets → dist/assets}/icons/burger.png +0 -0
- /package/{assets → dist/assets}/icons/file.svg +0 -0
- /package/{assets → dist/assets}/icons/map_icon1.png +0 -0
- /package/{assets → dist/assets}/icons/map_icon4.png +0 -0
- /package/{assets → dist/assets}/images/bg-chart-circle.png +0 -0
- /package/{assets → dist/assets}/images/bg-chart-triangle.png +0 -0
- /package/{assets → dist/assets}/images/cashub-logo-only.png +0 -0
- /package/{assets → dist/assets}/images/default-user.jpg +0 -0
- /package/{assets → dist/assets}/images/logo-cashub.png +0 -0
- /package/{assets → dist/assets}/images/map.png +0 -0
- /package/{assets → dist/assets}/images/qrcode.png +0 -0
- /package/{backdrop → dist/backdrop}/BaseBackdrop.js +0 -0
- /package/{backdrop → dist/backdrop}/LoadingBackdrop.js +0 -0
- /package/{backdrop → dist/backdrop}/ModalBackdrop.js +0 -0
- /package/{backdrop → dist/backdrop}/index.js +0 -0
- /package/{badge → dist/badge}/Badge.js +0 -0
- /package/{badge → dist/badge}/BadgeDot.js +0 -0
- /package/{badge → dist/badge}/BadgeFill.js +0 -0
- /package/{badge → dist/badge}/BadgeFillTriangle.js +0 -0
- /package/{badge → dist/badge}/BadgeWithText.js +0 -0
- /package/{badge → dist/badge}/index.js +0 -0
- /package/{billing → dist/billing}/BarChart.js +0 -0
- /package/{billing → dist/billing}/Grid.js +0 -0
- /package/{billing → dist/billing}/Header2.js +0 -0
- /package/{billing → dist/billing}/Header3.js +0 -0
- /package/{billing → dist/billing}/Paragraph.js +0 -0
- /package/{billing → dist/billing}/ParagraphGroup.js +0 -0
- /package/{billing → dist/billing}/ParagraphText.js +0 -0
- /package/{billing → dist/billing}/Section.js +0 -0
- /package/{billing → dist/billing}/SectionBody.js +0 -0
- /package/{billing → dist/billing}/SectionHeader.js +0 -0
- /package/{billing → dist/billing}/__stories__/BarChart.stories.js_bak +0 -0
- /package/{billing → dist/billing}/__stories__/Grid.stories.js_bak +0 -0
- /package/{billing → dist/billing}/__stories__/Header2.stories.js_bak +0 -0
- /package/{billing → dist/billing}/__stories__/Header3.stories.js_bak +0 -0
- /package/{billing → dist/billing}/__stories__/Paragraph.stories.js_bak +0 -0
- /package/{billing → dist/billing}/__stories__/ParagraphGroup.stories.js_bak +0 -0
- /package/{billing → dist/billing}/__stories__/ParagraphText.stories.js_bak +0 -0
- /package/{billing → dist/billing}/__stories__/Section.stories.js_bak +0 -0
- /package/{billing → dist/billing}/__stories__/SectionBody.stories.js_bak +0 -0
- /package/{billing → dist/billing}/__stories__/SectionHeader.stories.js-bak +0 -0
- /package/{breadcrumb → dist/breadcrumb}/Breadcrumb.js +0 -0
- /package/{breadcrumb → dist/breadcrumb}/index.js +0 -0
- /package/{button → dist/button}/Button.js +0 -0
- /package/{button → dist/button}/ButtonGroup.js +0 -0
- /package/{button → dist/button}/ScrollToTopButton.js +0 -0
- /package/{button → dist/button}/index.js +0 -0
- /package/{callout → dist/callout}/Callout.js +0 -0
- /package/{callout → dist/callout}/index.js +0 -0
- /package/{chart → dist/chart}/BarChart.js +0 -0
- /package/{chart → dist/chart}/DoughnutChart.js +0 -0
- /package/{chart → dist/chart}/LineChart.js +0 -0
- /package/{chart → dist/chart}/SingleBarChart.js +0 -0
- /package/{chart → dist/chart}/index.js +0 -0
- /package/{chart → dist/chart}/utils/centerTextPlugin.js +0 -0
- /package/{chart → dist/chart}/utils/customTooltip.js +0 -0
- /package/{chart → dist/chart}/utils/htmlLegendPlugin.js +0 -0
- /package/{chart → dist/chart}/utils/index.js +0 -0
- /package/{chart → dist/chart}/utils/padEmptyChartBar.js +0 -0
- /package/{chart → dist/chart}/utils/yAxisTopTitlePlugin.js +0 -0
- /package/{container → dist/container}/FlexContainer.js +0 -0
- /package/{container → dist/container}/index.js +0 -0
- /package/{cropper → dist/cropper}/Cropper.js +0 -0
- /package/{cropper → dist/cropper}/CropperModalHandler.js +0 -0
- /package/{cropper → dist/cropper}/index.js +0 -0
- /package/{cropper → dist/cropper}/subComponent/CropImageModal.js +0 -0
- /package/{datetimePicker → dist/datetimePicker}/DatePicker.js +0 -0
- /package/{datetimePicker → dist/datetimePicker}/DatePickerV2.js +0 -0
- /package/{datetimePicker → dist/datetimePicker}/DatetimePicker.js +0 -0
- /package/{datetimePicker → dist/datetimePicker}/DatetimePickerV2.js +0 -0
- /package/{datetimePicker → dist/datetimePicker}/DatetimePickerV3.js +0 -0
- /package/{datetimePicker → dist/datetimePicker}/TimeInput.js +0 -0
- /package/{datetimePicker → dist/datetimePicker}/TimePicker.js +0 -0
- /package/{datetimePicker → dist/datetimePicker}/TimePickerStyle.js +0 -0
- /package/{datetimePicker → dist/datetimePicker}/TimePickerV2.js +0 -0
- /package/{datetimePicker → dist/datetimePicker}/accordion/Month.js +0 -0
- /package/{datetimePicker → dist/datetimePicker}/accordion/Year.js +0 -0
- /package/{datetimePicker → dist/datetimePicker}/hooks/index.js +0 -0
- /package/{datetimePicker → dist/datetimePicker}/hooks/useChangeNumber.js +0 -0
- /package/{datetimePicker → dist/datetimePicker}/hooks/useDecrease.js +0 -0
- /package/{datetimePicker → dist/datetimePicker}/hooks/useIncrease.js +0 -0
- /package/{datetimePicker → dist/datetimePicker}/index.js +0 -0
- /package/{datetimePicker → dist/datetimePicker}/provider/constant.js +0 -0
- /package/{datetimePicker → dist/datetimePicker}/subComponent/Accordion.js +0 -0
- /package/{datetimePicker → dist/datetimePicker}/subComponent/CustomTimeInput.js +0 -0
- /package/{datetimePicker → dist/datetimePicker}/subComponent/DateTimePickerContext.js +0 -0
- /package/{datetimePicker → dist/datetimePicker}/utils/GMTDate.js +0 -0
- /package/{datetimePicker → dist/datetimePicker}/utils/pad.js +0 -0
- /package/{datetimePicker → dist/datetimePicker}/utils/toUTC0.js +0 -0
- /package/{descriptionList → dist/descriptionList}/DescriptionDetail.js +0 -0
- /package/{descriptionList → dist/descriptionList}/DescriptionList.js +0 -0
- /package/{descriptionList → dist/descriptionList}/DescriptionTerm.js +0 -0
- /package/{descriptionList → dist/descriptionList}/index.js +0 -0
- /package/{divider → dist/divider}/Divider.js +0 -0
- /package/{divider → dist/divider}/index.js +0 -0
- /package/{dropdown → dist/dropdown}/Dropdown.js +0 -0
- /package/{dropdown → dist/dropdown}/DropdownButtonOption.js +0 -0
- /package/{dropdown → dist/dropdown}/DropdownContent.js +0 -0
- /package/{dropdown → dist/dropdown}/DropdownDivOption.js +0 -0
- /package/{dropdown → dist/dropdown}/DropdownItem.js +0 -0
- /package/{dropdown → dist/dropdown}/DropdownLinkOption.js +0 -0
- /package/{dropdown → dist/dropdown}/DropdownToggle.js +0 -0
- /package/{dropdown → dist/dropdown}/index.js +0 -0
- /package/{dropdown → dist/dropdown}/subComponent/DropdownContext.js +0 -0
- /package/{dropzone → dist/dropzone}/FileDropzone.js +0 -0
- /package/{dropzone → dist/dropzone}/ImageDropzone.js +0 -0
- /package/{dropzone → dist/dropzone}/index.js +0 -0
- /package/{dropzone → dist/dropzone}/subComponent/Message.js +0 -0
- /package/{figure → dist/figure}/IconFigure.js +0 -0
- /package/{figure → dist/figure}/ImageFigure.js +0 -0
- /package/{figure → dist/figure}/index.js +0 -0
- /package/{file → dist/file}/HiddenFileInput.js +0 -0
- /package/{file → dist/file}/index.js +0 -0
- /package/{form → dist/form}/Checkbox.js +0 -0
- /package/{form → dist/form}/Fieldset.js +0 -0
- /package/{form → dist/form}/FormItem.js +0 -0
- /package/{form → dist/form}/Input.js +0 -0
- /package/{form → dist/form}/Label.js +0 -0
- /package/{form → dist/form}/MutedText.js +0 -0
- /package/{form → dist/form}/PasswordInput.js +0 -0
- /package/{form → dist/form}/RadioButton.js +0 -0
- /package/{form → dist/form}/SearchSelect.js +0 -0
- /package/{form → dist/form}/Searchbox.js +0 -0
- /package/{form → dist/form}/Slider.js +0 -0
- /package/{form → dist/form}/SwitchButton.js +0 -0
- /package/{form → dist/form}/Textarea.js +0 -0
- /package/{form → dist/form}/TreeView.js +0 -0
- /package/{form → dist/form}/index.js +0 -0
- /package/{grid → dist/grid}/Column.js +0 -0
- /package/{grid → dist/grid}/Grid.js +0 -0
- /package/{grid → dist/grid}/index.js +0 -0
- /package/{heading → dist/heading}/Heading1.js +0 -0
- /package/{heading → dist/heading}/Heading2.js +0 -0
- /package/{heading → dist/heading}/Heading3.js +0 -0
- /package/{heading → dist/heading}/index.js +0 -0
- /package/{helmet → dist/helmet}/Helmet.js +0 -0
- /package/{helmet → dist/helmet}/index.js +0 -0
- /package/{iconbox → dist/iconbox}/ApplicationIconBox.js +0 -0
- /package/{iconbox → dist/iconbox}/IconBoxV2.js +0 -0
- /package/{iconbox → dist/iconbox}/index.js +0 -0
- /package/{iconbox → dist/iconbox}/subComponent/IconBoxFigure.js +0 -0
- /package/{image → dist/image}/ImageFluid.js +0 -0
- /package/{image → dist/image}/UploadImage.js +0 -0
- /package/{image → dist/image}/index.js +0 -0
- /package/{index.js → dist/index.js} +0 -0
- /package/{jsoneditor → dist/jsoneditor}/JsonEditor.js +0 -0
- /package/{jsoneditor → dist/jsoneditor}/index.js +0 -0
- /package/{keyframe → dist/keyframe}/Pulse.js +0 -0
- /package/{keyframe → dist/keyframe}/Spin.js +0 -0
- /package/{layout → dist/layout}/AsideHeader.jsx +0 -0
- /package/{layout → dist/layout}/Backdrop.js +0 -0
- /package/{layout → dist/layout}/Footer.js +0 -0
- /package/{layout → dist/layout}/index.js +0 -0
- /package/{link → dist/link}/LinkSpan.js +0 -0
- /package/{link → dist/link}/index.js +0 -0
- /package/{map → dist/map}/GoogleMap.js +0 -0
- /package/{map → dist/map}/GoogleReverseGeolocation.js +0 -0
- /package/{map → dist/map}/LeafletMap.js +0 -0
- /package/{map → dist/map}/LeafletReverseGeolocation.js +0 -0
- /package/{map → dist/map}/index.js +0 -0
- /package/{map → dist/map}/subComponent/BasicLeafletMap.js +0 -0
- /package/{map → dist/map}/subComponent/GoogleMapContainer.js +0 -0
- /package/{map → dist/map}/subComponent/GoogleMapPopup.js +0 -0
- /package/{map → dist/map}/subComponent/GoogleMapWrapper.js +0 -0
- /package/{map → dist/map}/subComponent/LeafletDrawControl.js +0 -0
- /package/{map → dist/map}/subComponent/LeafletMapContainer.js +0 -0
- /package/{map → dist/map}/subComponent/MapSearchBoxControl.js +0 -0
- /package/{modal → dist/modal}/StateModal.js +0 -0
- /package/{modal → dist/modal}/TitleModal.js +0 -0
- /package/{modal → dist/modal}/index.js +0 -0
- /package/{page → dist/page}/Disclaimer.js +0 -0
- /package/{page → dist/page}/index.js +0 -0
- /package/{paginate → dist/paginate}/Paginate.js +0 -0
- /package/{paginate → dist/paginate}/index.js +0 -0
- /package/{popover → dist/popover}/Popover.js +0 -0
- /package/{popover → dist/popover}/index.js +0 -0
- /package/{qrcode → dist/qrcode}/QRCode.js +0 -0
- /package/{qrcode → dist/qrcode}/QRCodeContainter.js +0 -0
- /package/{qrcode → dist/qrcode}/index.js +0 -0
- /package/{ribbon → dist/ribbon}/Ribbon.js +0 -0
- /package/{ribbon → dist/ribbon}/index.js +0 -0
- /package/{section → dist/section}/Section.js +0 -0
- /package/{section → dist/section}/SectionBody.js +0 -0
- /package/{section → dist/section}/SectionHeader.js +0 -0
- /package/{section → dist/section}/SectionToolbar.js +0 -0
- /package/{section → dist/section}/SectionToolbarItem.js +0 -0
- /package/{section → dist/section}/index.js +0 -0
- /package/{select → dist/select}/InputSelect.js +0 -0
- /package/{select → dist/select}/Select.js +0 -0
- /package/{select → dist/select}/index.js +0 -0
- /package/{select → dist/select}/subComponent/Checkbox.js +0 -0
- /package/{select → dist/select}/subComponent/Footer.js +0 -0
- /package/{select → dist/select}/subComponent/ListBox.js +0 -0
- /package/{select → dist/select}/subComponent/Option.js +0 -0
- /package/{select → dist/select}/subComponent/OptionGroup.js +0 -0
- /package/{select → dist/select}/subComponent/Options.js +0 -0
- /package/{select → dist/select}/subComponent/SearchBox.js +0 -0
- /package/{select → dist/select}/subComponent/SelectedMultipleCount.js +0 -0
- /package/{select → dist/select}/subComponent/SelectedMultipleTags.js +0 -0
- /package/{select → dist/select}/subComponent/SelectedMultipleText.js +0 -0
- /package/{select → dist/select}/subComponent/SelectedSingle.js +0 -0
- /package/{styles → dist/styles}/config/breakpoint.style.js +0 -0
- /package/{styles → dist/styles}/config/header.style.js +0 -0
- /package/{styles → dist/styles}/config/sidebar.style.js +0 -0
- /package/{styles → dist/styles}/index.js +0 -0
- /package/{styles → dist/styles}/mixin/backgroundColor.js +0 -0
- /package/{styles → dist/styles}/mixin/borderColor.js +0 -0
- /package/{styles → dist/styles}/mixin/color.js +0 -0
- /package/{styles → dist/styles}/mixin/colorOnBackground.js +0 -0
- /package/{styles → dist/styles}/mixin/inputPlaceholder.js +0 -0
- /package/{styles → dist/styles}/mixin/media.js +0 -0
- /package/{styles → dist/styles}/mixin/rounded.js +0 -0
- /package/{styles → dist/styles}/mixin/scrollbar.js +0 -0
- /package/{styles → dist/styles}/theme/light.theme.js +0 -0
- /package/{table → dist/table}/GridTable.js +0 -0
- /package/{table → dist/table}/ImageBox.js +0 -0
- /package/{table → dist/table}/InfiniteGridTable.js +0 -0
- /package/{table → dist/table}/PermissionTable.js +0 -0
- /package/{table → dist/table}/SimpleGridTable.js +0 -0
- /package/{table → dist/table}/Table.js +0 -0
- /package/{table → dist/table}/__mock__/columns.js +0 -0
- /package/{table → dist/table}/__mock__/data.js +0 -0
- /package/{table → dist/table}/hooks/index.js +0 -0
- /package/{table → dist/table}/hooks/useCalculateDataRange.js +0 -0
- /package/{table → dist/table}/hooks/useGenerateSort.js +0 -0
- /package/{table → dist/table}/index.js +0 -0
- /package/{table → dist/table}/subComponent/BaseTableHeadCell.js +0 -0
- /package/{table → dist/table}/subComponent/GridTableFooter.js +0 -0
- /package/{table → dist/table}/subComponent/GridTableHeadCell.js +0 -0
- /package/{table → dist/table}/subComponent/Resizer.js +0 -0
- /package/{table → dist/table}/subComponent/TableFooter.js +0 -0
- /package/{table → dist/table}/subComponent/TableFooterInfo.js +0 -0
- /package/{table → dist/table}/subComponent/TableFooterPager.js +0 -0
- /package/{table → dist/table}/subComponent/TableHeadCell.js +0 -0
- /package/{table → dist/table}/subComponent/TableSort.js +0 -0
- /package/{tagify → dist/tagify}/TagifyStyle.js +0 -0
- /package/{tagify → dist/tagify}/Tags.js +0 -0
- /package/{tagify → dist/tagify}/index.js +0 -0
- /package/{tagify → dist/tagify}/templates/getCreateButtonTemplate.js +0 -0
- /package/{text → dist/text}/Paragraph.js +0 -0
- /package/{text → dist/text}/index.js +0 -0
- /package/{timeline → dist/timeline}/Timeline.js +0 -0
- /package/{timeline → dist/timeline}/index.js +0 -0
- /package/{toast → dist/toast}/CustomToastContainer.js +0 -0
- /package/{toast → dist/toast}/MessageContainer.js +0 -0
- /package/{toast → dist/toast}/index.js +0 -0
- /package/{toast → dist/toast}/show.js +0 -0
- /package/{toast → dist/toast}/style.css +0 -0
- /package/{tooltip → dist/tooltip}/Tooltip.js +0 -0
- /package/{tooltip → dist/tooltip}/index.js +0 -0
- /package/{treeView → dist/treeView}/TreeViewV2.js +0 -0
- /package/{treeView → dist/treeView}/TreeflexStyle.js +0 -0
- /package/{treeView → dist/treeView}/index.js +0 -0
- /package/{wizard → dist/wizard}/Wizard.js +0 -0
- /package/{wizard → dist/wizard}/index.js +0 -0
- /package/{xmleditor → dist/xmleditor}/XmlEditor.js +0 -0
- /package/{xmleditor → dist/xmleditor}/index.js +0 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { useState, useMemo, useRef, useEffect } from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import GoogleMapWrapper from './subComponent/GoogleMapWrapper';
|
|
4
|
+
import GoogleMapContainer from './subComponent/GoogleMapContainer';
|
|
5
|
+
import Searchbox from '../form/Searchbox';
|
|
6
|
+
import MapIcon from '../assets/icons/map_icon4.png';
|
|
7
|
+
|
|
8
|
+
const GoogleReverseGeolocation = ({
|
|
9
|
+
apiKey,
|
|
10
|
+
children,
|
|
11
|
+
defaultLatlng,
|
|
12
|
+
changeLatlng,
|
|
13
|
+
onChoose,
|
|
14
|
+
onSearch,
|
|
15
|
+
onError,
|
|
16
|
+
}) => {
|
|
17
|
+
const [markerLatLng, setMarkerLatLng] = useState(defaultLatlng);
|
|
18
|
+
|
|
19
|
+
const handleChangeLatlng = (latlng) => {
|
|
20
|
+
setMarkerLatLng(latlng);
|
|
21
|
+
changeLatlng(latlng);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const confirmChooseLocation = async (callback) => {
|
|
25
|
+
if (markerLatLng.lat && markerLatLng.lng) {
|
|
26
|
+
try {
|
|
27
|
+
const address = await onChoose(markerLatLng);
|
|
28
|
+
if (address) {
|
|
29
|
+
callback({ address });
|
|
30
|
+
} else {
|
|
31
|
+
callback({ error: 'ReverseGeo' });
|
|
32
|
+
}
|
|
33
|
+
} catch (error) {
|
|
34
|
+
callback(error);
|
|
35
|
+
}
|
|
36
|
+
} else {
|
|
37
|
+
callback({ error: 'PleaseChooseLocation' });
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<>
|
|
43
|
+
{children(
|
|
44
|
+
<GoogleMapWrapper
|
|
45
|
+
apiKey={apiKey}
|
|
46
|
+
height={512}
|
|
47
|
+
zoom={3}
|
|
48
|
+
markerLatLng={markerLatLng}
|
|
49
|
+
handleChangeLatlng={handleChangeLatlng}
|
|
50
|
+
onSearch={onSearch}
|
|
51
|
+
onError={onError}
|
|
52
|
+
>
|
|
53
|
+
<Map />
|
|
54
|
+
</GoogleMapWrapper>,
|
|
55
|
+
confirmChooseLocation,
|
|
56
|
+
)}
|
|
57
|
+
</>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const Map = ({
|
|
62
|
+
height,
|
|
63
|
+
zoom,
|
|
64
|
+
markerLatLng,
|
|
65
|
+
handleChangeLatlng,
|
|
66
|
+
onSearch,
|
|
67
|
+
onError,
|
|
68
|
+
}) => {
|
|
69
|
+
const ref = useRef(null);
|
|
70
|
+
const [map, setMap] = useState();
|
|
71
|
+
|
|
72
|
+
const options = useMemo(() => {
|
|
73
|
+
return {
|
|
74
|
+
zoom,
|
|
75
|
+
center: {
|
|
76
|
+
lat: 1,
|
|
77
|
+
lng: 1,
|
|
78
|
+
},
|
|
79
|
+
scrollwheel: true,
|
|
80
|
+
zoomControl: true,
|
|
81
|
+
zoomControlOptions: {
|
|
82
|
+
position: window.google.maps.ControlPosition.LEFT_TOP,
|
|
83
|
+
},
|
|
84
|
+
mapTypeControl: false,
|
|
85
|
+
scaleControl: false,
|
|
86
|
+
streetViewControl: false,
|
|
87
|
+
rotateControl: false,
|
|
88
|
+
fullscreenControl: false,
|
|
89
|
+
minZoom: 3,
|
|
90
|
+
restriction: {
|
|
91
|
+
latLngBounds: {
|
|
92
|
+
east: 179.9999,
|
|
93
|
+
north: 85,
|
|
94
|
+
south: -85,
|
|
95
|
+
west: -179.9999,
|
|
96
|
+
},
|
|
97
|
+
strictBounds: true,
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
}, [zoom]);
|
|
101
|
+
|
|
102
|
+
const handleError = (errorCode) => {
|
|
103
|
+
if (onError) {
|
|
104
|
+
onError(errorCode);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
const handleSearch = async (address) => {
|
|
109
|
+
try {
|
|
110
|
+
const latlng = await onSearch(address);
|
|
111
|
+
if (latlng) {
|
|
112
|
+
map.setZoom(15);
|
|
113
|
+
map.panTo(latlng);
|
|
114
|
+
handleChangeLatlng(latlng);
|
|
115
|
+
} else {
|
|
116
|
+
handleError('NO_RESULT');
|
|
117
|
+
}
|
|
118
|
+
} catch (error) {
|
|
119
|
+
handleError(error.message);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
// setup map
|
|
124
|
+
useEffect(() => {
|
|
125
|
+
if (map) {
|
|
126
|
+
map.setOptions(options);
|
|
127
|
+
}
|
|
128
|
+
}, [map, options]);
|
|
129
|
+
|
|
130
|
+
// click to choose location
|
|
131
|
+
useEffect(() => {
|
|
132
|
+
if (map) {
|
|
133
|
+
map.addListener('click', (event) => {
|
|
134
|
+
handleChangeLatlng(event.latLng.toJSON());
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
return () => {
|
|
138
|
+
window.google.maps.event.clearListeners(map, 'click');
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
}, [map, handleChangeLatlng]);
|
|
142
|
+
|
|
143
|
+
// render marker cluster
|
|
144
|
+
useEffect(() => {
|
|
145
|
+
if (map && markerLatLng.lat && markerLatLng.lng) {
|
|
146
|
+
const marker = new window.google.maps.Marker({
|
|
147
|
+
icon: {
|
|
148
|
+
url: MapIcon,
|
|
149
|
+
scaledSize: new window.google.maps.Size(40, 50),
|
|
150
|
+
},
|
|
151
|
+
position: markerLatLng,
|
|
152
|
+
});
|
|
153
|
+
marker.setMap(map);
|
|
154
|
+
|
|
155
|
+
return () => {
|
|
156
|
+
marker.setMap(null);
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
}, [map, markerLatLng]);
|
|
160
|
+
|
|
161
|
+
useEffect(() => {
|
|
162
|
+
if (ref.current && !map) {
|
|
163
|
+
setMap(new window.google.maps.Map(ref.current, {}));
|
|
164
|
+
}
|
|
165
|
+
}, [map, options]);
|
|
166
|
+
|
|
167
|
+
return (
|
|
168
|
+
<div style={{ position: 'relative' }}>
|
|
169
|
+
<MapSearchBoxControl>
|
|
170
|
+
<Searchbox onSearch={handleSearch} autoFocus />
|
|
171
|
+
</MapSearchBoxControl>
|
|
172
|
+
<GoogleMapContainer
|
|
173
|
+
ref={ref}
|
|
174
|
+
height={height}
|
|
175
|
+
tabIndex='0'
|
|
176
|
+
onClick={(event) => {
|
|
177
|
+
event.target.focus();
|
|
178
|
+
}}
|
|
179
|
+
onFocus={() => {
|
|
180
|
+
map.setOptions({ scrollwheel: true });
|
|
181
|
+
}}
|
|
182
|
+
onBlur={() => {
|
|
183
|
+
map.setOptions({ scrollwheel: false });
|
|
184
|
+
}}
|
|
185
|
+
/>
|
|
186
|
+
</div>
|
|
187
|
+
);
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
const MapSearchBoxControl = styled.div`
|
|
191
|
+
position: absolute;
|
|
192
|
+
top: var(--spacing-s);
|
|
193
|
+
right: var(--spacing-s);
|
|
194
|
+
z-index: 1;
|
|
195
|
+
`;
|
|
196
|
+
|
|
197
|
+
export default GoogleReverseGeolocation;
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { useCallback, useEffect, useState, useRef } from 'react';
|
|
2
|
+
import L from 'leaflet';
|
|
3
|
+
import {
|
|
4
|
+
Marker,
|
|
5
|
+
Popup,
|
|
6
|
+
useMapEvents,
|
|
7
|
+
FeatureGroup,
|
|
8
|
+
Circle,
|
|
9
|
+
} from 'react-leaflet';
|
|
10
|
+
import MarkerClusterGroup from 'react-leaflet-markercluster';
|
|
11
|
+
import 'leaflet/dist/leaflet.css';
|
|
12
|
+
import 'react-leaflet-markercluster/dist/styles.min.css';
|
|
13
|
+
import BasicLeafletMap from './subComponent/BasicLeafletMap';
|
|
14
|
+
import LeafletDrawControl from './subComponent/LeafletDrawControl';
|
|
15
|
+
import PrimaryMapIcon from '../assets/icons/map_icon1.png';
|
|
16
|
+
import MapIcon from '../assets/icons/map_icon4.png';
|
|
17
|
+
|
|
18
|
+
const LeafletMap = ({
|
|
19
|
+
height = 512,
|
|
20
|
+
zoom = 10,
|
|
21
|
+
data = { defaultPosition: null, position: null, locations: [] },
|
|
22
|
+
geoFence = false,
|
|
23
|
+
geoFenceOptions = {},
|
|
24
|
+
onError,
|
|
25
|
+
customPopup,
|
|
26
|
+
checkPrimaryLocation,
|
|
27
|
+
}) => {
|
|
28
|
+
const [hasError, setHasError] = useState(true);
|
|
29
|
+
const [validLocations, setValidLocations] = useState([]);
|
|
30
|
+
const [validBound, setValidBound] = useState([]);
|
|
31
|
+
const [markers, setMarkers] = useState([]);
|
|
32
|
+
const drawControlRef = useRef();
|
|
33
|
+
|
|
34
|
+
const handleError = useCallback(
|
|
35
|
+
(errorCode) => {
|
|
36
|
+
if (onError) {
|
|
37
|
+
onError(errorCode);
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
[onError],
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
const handleMountedDrawControl = useCallback(
|
|
44
|
+
(control) => {
|
|
45
|
+
drawControlRef.current = control;
|
|
46
|
+
if (geoFenceOptions.editable) {
|
|
47
|
+
drawControlRef.current.enableEdit();
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
[geoFenceOptions.editable],
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
const handleEditResizeDraw = useCallback(
|
|
54
|
+
(event) => {
|
|
55
|
+
const { minRadius, eventHandlers } = geoFenceOptions;
|
|
56
|
+
const radius = event.layer.getRadius();
|
|
57
|
+
if (minRadius && radius < minRadius) {
|
|
58
|
+
event.layer.setRadius(minRadius);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const tooltips = event.target._panes.popupPane.getElementsByClassName(
|
|
63
|
+
'leaflet-draw-tooltip',
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
for (let index = 0; index < tooltips.length; index += 1) {
|
|
67
|
+
tooltips[index].textContent = `Radius: ${parseInt(radius, 10)}`;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (eventHandlers.edit) {
|
|
71
|
+
eventHandlers.edit(radius);
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
[geoFenceOptions],
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
const handleEditMoveDraw = useCallback(
|
|
78
|
+
(event) => {
|
|
79
|
+
const { eventHandlers } = geoFenceOptions;
|
|
80
|
+
if (eventHandlers.drag) {
|
|
81
|
+
eventHandlers.drag(event.layer.getLatLng());
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
[geoFenceOptions],
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
const { defaultPosition, position, locations } = data;
|
|
89
|
+
const arrLatLngs = [];
|
|
90
|
+
const bounds = [];
|
|
91
|
+
const markers = [];
|
|
92
|
+
|
|
93
|
+
if (!position && !defaultPosition) {
|
|
94
|
+
handleError('NO_COORDINATES');
|
|
95
|
+
setHasError(true);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
locations.forEach((location, index) => {
|
|
100
|
+
const { latitude, longitude } = location;
|
|
101
|
+
if (
|
|
102
|
+
(!latitude && latitude !== 0) ||
|
|
103
|
+
(!longitude && longitude !== 0) ||
|
|
104
|
+
(latitude === 0 && longitude === 0) ||
|
|
105
|
+
(latitude === '0' && longitude === '0')
|
|
106
|
+
) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// prevent duplicate LatLngBounds
|
|
111
|
+
if (
|
|
112
|
+
!bounds.some((LatLng) => {
|
|
113
|
+
return latitude === LatLng[0] && longitude === LatLng[1];
|
|
114
|
+
})
|
|
115
|
+
) {
|
|
116
|
+
bounds.push([latitude, longitude]);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
arrLatLngs.push([latitude, longitude]);
|
|
120
|
+
|
|
121
|
+
let popupContent = null;
|
|
122
|
+
if (customPopup) {
|
|
123
|
+
popupContent = (
|
|
124
|
+
<Popup maxWidth={400} closeButton={false}>
|
|
125
|
+
{customPopup(location)}
|
|
126
|
+
</Popup>
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
let Icon = L.icon({
|
|
131
|
+
iconUrl: MapIcon,
|
|
132
|
+
iconSize: [40, 50],
|
|
133
|
+
});
|
|
134
|
+
if (checkPrimaryLocation && checkPrimaryLocation(location)) {
|
|
135
|
+
Icon = L.icon({
|
|
136
|
+
iconUrl: PrimaryMapIcon,
|
|
137
|
+
iconSize: [40, 50],
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
markers.push(
|
|
142
|
+
<Marker position={[latitude, longitude]} key={index} icon={Icon}>
|
|
143
|
+
{popupContent}
|
|
144
|
+
</Marker>,
|
|
145
|
+
);
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
// pass all checking
|
|
149
|
+
setHasError(false);
|
|
150
|
+
setValidLocations(arrLatLngs);
|
|
151
|
+
setValidBound(bounds);
|
|
152
|
+
setMarkers(markers);
|
|
153
|
+
}, [data, handleError, customPopup, checkPrimaryLocation]);
|
|
154
|
+
|
|
155
|
+
useEffect(() => {
|
|
156
|
+
if (drawControlRef.current && geoFenceOptions.editable) {
|
|
157
|
+
drawControlRef.current.enableEdit();
|
|
158
|
+
}
|
|
159
|
+
}, [geoFenceOptions.editable]);
|
|
160
|
+
|
|
161
|
+
if (!hasError) {
|
|
162
|
+
return (
|
|
163
|
+
<BasicLeafletMap height={height} zoom={zoom}>
|
|
164
|
+
<MapInteractor
|
|
165
|
+
zoom={zoom}
|
|
166
|
+
locations={validLocations}
|
|
167
|
+
bounds={validBound}
|
|
168
|
+
markers={markers}
|
|
169
|
+
defaultPosition={data.defaultPosition}
|
|
170
|
+
position={data.position}
|
|
171
|
+
/>
|
|
172
|
+
|
|
173
|
+
{markers.length > 0 && (
|
|
174
|
+
<MarkerClusterGroup
|
|
175
|
+
maxClusterRadius={120}
|
|
176
|
+
iconCreateFunction={(cluster) => {
|
|
177
|
+
return L.divIcon({
|
|
178
|
+
html: `<div><span>${cluster.getChildCount()}</span></div>`,
|
|
179
|
+
className: 'marker-cluster',
|
|
180
|
+
iconSize: L.point(40, 40),
|
|
181
|
+
});
|
|
182
|
+
}}
|
|
183
|
+
>
|
|
184
|
+
{markers}
|
|
185
|
+
</MarkerClusterGroup>
|
|
186
|
+
)}
|
|
187
|
+
|
|
188
|
+
{geoFence && (
|
|
189
|
+
<FeatureGroup>
|
|
190
|
+
<LeafletDrawControl
|
|
191
|
+
draw={false}
|
|
192
|
+
edit={{ edit: false, remove: false }}
|
|
193
|
+
onMounted={handleMountedDrawControl}
|
|
194
|
+
onEditResize={handleEditResizeDraw}
|
|
195
|
+
onEditMove={handleEditMoveDraw}
|
|
196
|
+
/>
|
|
197
|
+
<Circle
|
|
198
|
+
center={[geoFenceOptions.latitude, geoFenceOptions.longitude]}
|
|
199
|
+
radius={geoFenceOptions.radius}
|
|
200
|
+
pathOptions={{
|
|
201
|
+
stroke: false,
|
|
202
|
+
fillColor: 'var(--color-primary)',
|
|
203
|
+
fillOpacity: 0.5,
|
|
204
|
+
}}
|
|
205
|
+
/>
|
|
206
|
+
</FeatureGroup>
|
|
207
|
+
)}
|
|
208
|
+
</BasicLeafletMap>
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
return <div></div>;
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
const MapInteractor = ({
|
|
216
|
+
zoom,
|
|
217
|
+
locations,
|
|
218
|
+
bounds,
|
|
219
|
+
markers,
|
|
220
|
+
defaultPosition,
|
|
221
|
+
position,
|
|
222
|
+
}) => {
|
|
223
|
+
const map = useMapEvents({
|
|
224
|
+
click: (event) => {
|
|
225
|
+
event.originalEvent.stopPropagation();
|
|
226
|
+
},
|
|
227
|
+
focus: () => {
|
|
228
|
+
map.scrollWheelZoom.enable();
|
|
229
|
+
},
|
|
230
|
+
blur: () => {
|
|
231
|
+
map.scrollWheelZoom.disable();
|
|
232
|
+
},
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
useEffect(() => {
|
|
236
|
+
if (bounds.length === 1) {
|
|
237
|
+
map.setView(bounds[0]);
|
|
238
|
+
} else if (locations.length > 0) {
|
|
239
|
+
map.fitBounds(bounds);
|
|
240
|
+
|
|
241
|
+
// check current view has marker, if not set view to first marker
|
|
242
|
+
const currentBounds = map.getBounds();
|
|
243
|
+
const found = locations.find((LatLng) => {
|
|
244
|
+
const tmpLat = parseFloat(LatLng[0]);
|
|
245
|
+
const tmpLng = parseFloat(LatLng[1]);
|
|
246
|
+
if (Number.isNaN(tmpLat) || Number.isNaN(tmpLng)) return false;
|
|
247
|
+
return currentBounds.contains([tmpLat, tmpLng]);
|
|
248
|
+
});
|
|
249
|
+
if (!found) {
|
|
250
|
+
map.setView(locations[0]);
|
|
251
|
+
}
|
|
252
|
+
} else {
|
|
253
|
+
map.setView([
|
|
254
|
+
(position && position.latitude) || defaultPosition.latitude,
|
|
255
|
+
(position && position.longitude) || defaultPosition.longitude,
|
|
256
|
+
]);
|
|
257
|
+
}
|
|
258
|
+
map.setZoom(zoom);
|
|
259
|
+
}, [map, zoom, locations, bounds, markers, defaultPosition, position]);
|
|
260
|
+
|
|
261
|
+
return null;
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
export default LeafletMap;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { useState, useMemo, useEffect } from 'react';
|
|
2
|
+
import L from 'leaflet';
|
|
3
|
+
import { Marker, useMapEvents } from 'react-leaflet';
|
|
4
|
+
import BasicLeafletMap from './subComponent/BasicLeafletMap';
|
|
5
|
+
import MapSearchBoxControl from './subComponent/MapSearchBoxControl';
|
|
6
|
+
import MapIcon from '../assets/icons/map_icon4.png';
|
|
7
|
+
|
|
8
|
+
const LeafletReverseGeolocation = ({
|
|
9
|
+
children,
|
|
10
|
+
defaultLatlng,
|
|
11
|
+
changeLatlng,
|
|
12
|
+
onChoose,
|
|
13
|
+
onSearch,
|
|
14
|
+
onError,
|
|
15
|
+
}) => {
|
|
16
|
+
const [markerLatLng, setMarkerLatLng] = useState(defaultLatlng);
|
|
17
|
+
|
|
18
|
+
const Icon = useMemo(() => {
|
|
19
|
+
return L.icon({
|
|
20
|
+
iconUrl: MapIcon,
|
|
21
|
+
iconSize: [40, 50],
|
|
22
|
+
});
|
|
23
|
+
}, []);
|
|
24
|
+
|
|
25
|
+
const handleChangeLatlng = (latlng) => {
|
|
26
|
+
setMarkerLatLng(latlng);
|
|
27
|
+
changeLatlng(latlng);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const confirmChooseLocation = async (callback) => {
|
|
31
|
+
if (markerLatLng.lat && markerLatLng.lng) {
|
|
32
|
+
try {
|
|
33
|
+
const address = await onChoose(markerLatLng);
|
|
34
|
+
if (address) {
|
|
35
|
+
callback({ address });
|
|
36
|
+
} else {
|
|
37
|
+
callback({ error: 'ReverseGeo' });
|
|
38
|
+
}
|
|
39
|
+
} catch (error) {
|
|
40
|
+
callback(error);
|
|
41
|
+
}
|
|
42
|
+
} else {
|
|
43
|
+
callback({ error: 'PleaseChooseLocation' });
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const Map = (
|
|
48
|
+
<BasicLeafletMap height={500} zoom={10} scrollWheelZoom={true}>
|
|
49
|
+
{markerLatLng.lat && markerLatLng.lng && (
|
|
50
|
+
<Marker position={[markerLatLng.lat, markerLatLng.lng]} icon={Icon} />
|
|
51
|
+
)}
|
|
52
|
+
|
|
53
|
+
<MapInteractor changeLatlng={handleChangeLatlng} />
|
|
54
|
+
|
|
55
|
+
<MapSearchBoxControl
|
|
56
|
+
changeLatlng={handleChangeLatlng}
|
|
57
|
+
onSearch={onSearch}
|
|
58
|
+
onError={onError}
|
|
59
|
+
/>
|
|
60
|
+
</BasicLeafletMap>
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
return <>{children(Map, confirmChooseLocation)}</>;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const MapInteractor = ({ changeLatlng }) => {
|
|
67
|
+
const map = useMapEvents({
|
|
68
|
+
click: (event) => {
|
|
69
|
+
const { lat, lng } = event.latlng;
|
|
70
|
+
changeLatlng({ lat: lat.toString(), lng: lng.toString() });
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
const bounds = L.latLngBounds([
|
|
76
|
+
[90, 180],
|
|
77
|
+
[-90, -180],
|
|
78
|
+
]);
|
|
79
|
+
const wantedZoom = map.getBoundsZoom(bounds, true);
|
|
80
|
+
|
|
81
|
+
const center = bounds.getCenter();
|
|
82
|
+
map.setView(center);
|
|
83
|
+
map.setZoom(wantedZoom);
|
|
84
|
+
}, [map]);
|
|
85
|
+
|
|
86
|
+
return null;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export default LeafletReverseGeolocation;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import GoogleMap from '../GoogleMap';
|
|
2
|
+
import Section from '../../section/Section';
|
|
3
|
+
import SectionHeader from '../../section/SectionHeader';
|
|
4
|
+
import SectionBody from '../../section/SectionBody';
|
|
5
|
+
import Heading3 from '../../heading/Heading3';
|
|
6
|
+
import Paragraph from '../../text/Paragraph';
|
|
7
|
+
|
|
8
|
+
const metadata = {
|
|
9
|
+
title: 'Map/GoogleMap',
|
|
10
|
+
component: GoogleMap,
|
|
11
|
+
argTypes: {
|
|
12
|
+
apiKey: { description: 'API key for google platform' },
|
|
13
|
+
height: { description: 'Style variant' },
|
|
14
|
+
zoom: { description: 'Initial map zoom level' },
|
|
15
|
+
data: {
|
|
16
|
+
description:
|
|
17
|
+
'Object, which will have defaultPosition, position, locations',
|
|
18
|
+
},
|
|
19
|
+
onError: {
|
|
20
|
+
description:
|
|
21
|
+
'A callback function that notifies the component of an error and returns error code',
|
|
22
|
+
control: { action: 'onError' },
|
|
23
|
+
},
|
|
24
|
+
onCustomPopup: { description: 'Content of Popup', action: 'customPopup' },
|
|
25
|
+
onCheckPrimaryLocation: {
|
|
26
|
+
description:
|
|
27
|
+
'A callback function, tells the component to check the primary location and return information about each item in the locations',
|
|
28
|
+
action: 'checkPrimaryLocation',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const Default = ({
|
|
34
|
+
onError,
|
|
35
|
+
onCheckPrimaryLocation,
|
|
36
|
+
onCustomPopup,
|
|
37
|
+
...args
|
|
38
|
+
}) => {
|
|
39
|
+
const handleCheckPrimaryLocation = (data) => {
|
|
40
|
+
onCheckPrimaryLocation(data);
|
|
41
|
+
return data.tenant_id === 'f317ce1f-aea0-4bb0-b156-e513a842e489';
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const renderPopup = (data) => {
|
|
45
|
+
onCustomPopup(data);
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<Section>
|
|
49
|
+
<SectionHeader>
|
|
50
|
+
<Heading3>Merchant Information</Heading3>
|
|
51
|
+
</SectionHeader>
|
|
52
|
+
<SectionBody>
|
|
53
|
+
<Paragraph>name: {data.name}</Paragraph>
|
|
54
|
+
<Paragraph>Contact Email: {data.contact_email}</Paragraph>
|
|
55
|
+
<Paragraph>Address: {data.address}</Paragraph>
|
|
56
|
+
</SectionBody>
|
|
57
|
+
</Section>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<>
|
|
63
|
+
<GoogleMap
|
|
64
|
+
{...args}
|
|
65
|
+
customPopup={renderPopup}
|
|
66
|
+
checkPrimaryLocation={handleCheckPrimaryLocation}
|
|
67
|
+
/>
|
|
68
|
+
</>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
Default.args = {
|
|
72
|
+
apiKey: import.meta.env.STORYBOOK_GOOGLE_API_KEY,
|
|
73
|
+
height: 512,
|
|
74
|
+
zoom: 5,
|
|
75
|
+
data: {
|
|
76
|
+
defaultPosition: {
|
|
77
|
+
latitude: 24.9837825,
|
|
78
|
+
longitude: 121.539943,
|
|
79
|
+
},
|
|
80
|
+
locations: [
|
|
81
|
+
{
|
|
82
|
+
address:
|
|
83
|
+
'上海市人民政府, 人民广场, 同益里, 南京东路街道, 上海市, 黄浦区, 上海市, 200001, 中国',
|
|
84
|
+
contact_email: '784665363@qq.com',
|
|
85
|
+
latitude: '31.2322758',
|
|
86
|
+
logo_url:
|
|
87
|
+
'https://cs-uat-cashub.s3.ap-northeast-1.amazonaws.com/images/2022/05/17/tej2rEB33SmzYNVxZGPvbK1aHJ8bbE9dDGEfIjYx.png',
|
|
88
|
+
longitude: '121.4692071',
|
|
89
|
+
name: 'Unilever',
|
|
90
|
+
tenant_id: 'f317ce1f-aea0-4bb0-b156-e513a842e489',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
address: '文化路, 寶安里, 大坪林, 新店區, 新北市, 23141, 臺灣',
|
|
94
|
+
contact_email: ' shenglow1993@gmail.com',
|
|
95
|
+
latitude: '35.2322758',
|
|
96
|
+
logo_url:
|
|
97
|
+
'https://cs-uat-cashub.s3.ap-northeast-1.amazonaws.com/images/2022/05/17/tej2rEB33SmzYNVxZGPvbK1aHJ8bbE9dDGEfIjYx.png',
|
|
98
|
+
longitude: '130.4692071',
|
|
99
|
+
name: 'Boon-EN1-1',
|
|
100
|
+
tenant_id: 'f317ce1f-aea0-4bb0-b156-e513a842e488',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
address: '文化路, 寶安里, 大坪林, 新店區, 新北市, 23142, 臺灣',
|
|
104
|
+
contact_email: ' shenglow1993@gmail.com',
|
|
105
|
+
latitude: '35.2322758',
|
|
106
|
+
logo_url:
|
|
107
|
+
'https://cs-uat-cashub.s3.ap-northeast-1.amazonaws.com/images/2022/05/17/tej2rEB33SmzYNVxZGPvbK1aHJ8bbE9dDGEfIjYx.png',
|
|
108
|
+
longitude: '130.4692071',
|
|
109
|
+
name: 'Boon-EN1-1',
|
|
110
|
+
tenant_id: 'f317ce1f-aea0-4bb0-b156-e513a842e488',
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
position: null,
|
|
114
|
+
message: 'Merchant address not found',
|
|
115
|
+
},
|
|
116
|
+
geoFence: true,
|
|
117
|
+
geoFenceOptions: {
|
|
118
|
+
latitude: 31.2322758,
|
|
119
|
+
longitude: 121.4692071,
|
|
120
|
+
radius: 200,
|
|
121
|
+
minRadius: 100,
|
|
122
|
+
enabledReposition: true,
|
|
123
|
+
editable: true,
|
|
124
|
+
eventHandlers: {
|
|
125
|
+
click: (event) => {
|
|
126
|
+
console.log(event);
|
|
127
|
+
},
|
|
128
|
+
edit: (radius) => {
|
|
129
|
+
console.log(radius);
|
|
130
|
+
},
|
|
131
|
+
drag: (latlng) => {
|
|
132
|
+
console.log(latlng);
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
export default metadata;
|
|
139
|
+
export { Default };
|