@uniai-fe/ui-legacy 0.1.1
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/LICENSE +27 -0
- package/README.md +3 -0
- package/package.json +141 -0
- package/src/alternate/components/empty/Cage.tsx +29 -0
- package/src/alternate/components/empty/Data.tsx +35 -0
- package/src/alternate/components/empty/Table.tsx +38 -0
- package/src/alternate/components/index.tsx +19 -0
- package/src/alternate/components/loading/Default.tsx +38 -0
- package/src/alternate/components/loading/Icon.tsx +26 -0
- package/src/alternate/components/loading/Table.tsx +46 -0
- package/src/alternate/components/notice/SelectFlock.tsx +21 -0
- package/src/alternate/components/notice/SelectLabel.tsx +15 -0
- package/src/alternate/index.tsx +3 -0
- package/src/alternate/styles/styled/alternate.ts +92 -0
- package/src/asset-url.ts +7 -0
- package/src/button/button.scss +3 -0
- package/src/button/components/array/Add.tsx +39 -0
- package/src/button/components/array/Remove.tsx +34 -0
- package/src/button/components/base/Default.tsx +76 -0
- package/src/button/components/base/Expand.tsx +39 -0
- package/src/button/components/base/Link.tsx +40 -0
- package/src/button/components/base/Refresh.tsx +43 -0
- package/src/button/components/base/Reset.tsx +43 -0
- package/src/button/components/base/ResetSelected.tsx +35 -0
- package/src/button/components/base/Text.tsx +35 -0
- package/src/button/components/base/Tooltip.tsx +35 -0
- package/src/button/components/multiple/Container.tsx +70 -0
- package/src/button/components/select/SelectBox.tsx +37 -0
- package/src/button/icons/Expand.tsx +16 -0
- package/src/button/icons/Loading.tsx +20 -0
- package/src/button/icons/Refresh.tsx +20 -0
- package/src/button/icons/Reset.tsx +20 -0
- package/src/button/icons/ResetSelected.tsx +21 -0
- package/src/button/index.tsx +29 -0
- package/src/button/styled.tsx +12 -0
- package/src/button/styles/scss/multiple.scss +17 -0
- package/src/button/styles/scss/size.scss +46 -0
- package/src/button/styles/scss/theme.scss +36 -0
- package/src/button/styles/styled-components/button.ts +311 -0
- package/src/button/styles/styled-components/icon.ts +30 -0
- package/src/button/styles/styled-components/multiple.ts +75 -0
- package/src/button/styles/styled-components/template.ts +43 -0
- package/src/chart/chart.scss +11 -0
- package/src/chart/components/Contents.tsx +17 -0
- package/src/chart/components/control/Button.tsx +39 -0
- package/src/chart/components/control/Container.tsx +27 -0
- package/src/chart/components/control/Provider.tsx +117 -0
- package/src/chart/components/control/index.tsx +12 -0
- package/src/chart/components/custom/ActivePieSector.tsx +29 -0
- package/src/chart/components/graphs/ArcGauge.tsx +58 -0
- package/src/chart/components/graphs/ArcMeter.tsx +112 -0
- package/src/chart/components/graphs/Area.tsx +132 -0
- package/src/chart/components/graphs/Bar.tsx +179 -0
- package/src/chart/components/graphs/Doughnut.tsx +90 -0
- package/src/chart/components/graphs/Line.tsx +123 -0
- package/src/chart/components/graphs/index.tsx +17 -0
- package/src/chart/components/ticks/XAxis.tsx +39 -0
- package/src/chart/components/ticks/index.tsx +7 -0
- package/src/chart/index.tsx +17 -0
- package/src/chart/styled.tsx +3 -0
- package/src/chart/styles/scss/arc-gauge.scss +11 -0
- package/src/chart/styles/scss/arc-meter.scss +6 -0
- package/src/chart/styles/scss/control.scss +34 -0
- package/src/chart/styles/scss/filter.scss +0 -0
- package/src/chart/styles/scss/graph.scss +3 -0
- package/src/chart/styles/scss/legend.scss +35 -0
- package/src/chart/styles/scss/level.color.scss +7 -0
- package/src/chart/styles/scss/tick.scss +48 -0
- package/src/chart/styles/scss/tooltip.scss +70 -0
- package/src/chart/styles/styled/arc-gauge.ts +65 -0
- package/src/chart/styles/styled/arc-meter.ts +42 -0
- package/src/chart/styles/styled/common.ts +14 -0
- package/src/chart/styles/styled/control.ts +31 -0
- package/src/chart/styles/styled/legend.ts +11 -0
- package/src/chart/svg/gauge-track.min.svg +1 -0
- package/src/chart/utils/getLevel.ts +23 -0
- package/src/chip/chip.scss +1 -0
- package/src/chip/components/Default.tsx +40 -0
- package/src/chip/index.tsx +5 -0
- package/src/chip/styled.tsx +7 -0
- package/src/chip/styles/scss/variables.scss +15 -0
- package/src/chip/styles/styled/base.ts +41 -0
- package/src/components.tsx +42 -0
- package/src/delta/components/Rounded.tsx +72 -0
- package/src/delta/components/Square.tsx +72 -0
- package/src/delta/index.tsx +6 -0
- package/src/delta/styles/styled/delta.ts +126 -0
- package/src/dot/components/Location.tsx +55 -0
- package/src/dot/index.tsx +7 -0
- package/src/dot/styles/styled/location.ts +78 -0
- package/src/dropdown/components/Container.tsx +36 -0
- package/src/dropdown/components/ParentContainer.tsx +32 -0
- package/src/dropdown/dropdown.scss +1 -0
- package/src/dropdown/index.tsx +9 -0
- package/src/dropdown/styled.tsx +3 -0
- package/src/dropdown/styles/scss/variables.scss +24 -0
- package/src/dropdown/styles/styled-components/dropdown.ts +79 -0
- package/src/form/components/Provider.tsx +37 -0
- package/src/form/index.tsx +5 -0
- package/src/form-field/common/components/item-contents/Container.tsx +51 -0
- package/src/form-field/common/components/item-contents/Label.tsx +21 -0
- package/src/form-field/common/components/item-contents/Wrapper.tsx +24 -0
- package/src/form-field/common/components/item-contents/index.tsx +11 -0
- package/src/form-field/common/field.scss +2 -0
- package/src/form-field/common/hook.tsx +1 -0
- package/src/form-field/common/hooks/index.tsx +13 -0
- package/src/form-field/common/hooks/types.ts +16 -0
- package/src/form-field/common/hooks/useChangeEvents.ts +171 -0
- package/src/form-field/common/hooks/useInputCountdown.ts +115 -0
- package/src/form-field/common/hooks/useInputFile.ts +94 -0
- package/src/form-field/common/hooks/useInputMask.ts +56 -0
- package/src/form-field/common/hooks/useOpenDaumPostCodePopup.tsx +55 -0
- package/src/form-field/common/index.tsx +7 -0
- package/src/form-field/common/jotai/find-address.ts +4 -0
- package/src/form-field/common/jotai/password-hide.ts +6 -0
- package/src/form-field/common/styled.tsx +7 -0
- package/src/form-field/common/styles/scss/reset.scss +52 -0
- package/src/form-field/common/styles/scss/variables.scss +52 -0
- package/src/form-field/common/styles/styled-components/item.ts +148 -0
- package/src/form-field/input/components/Container.tsx +54 -0
- package/src/form-field/input/components/assets/button/ResetButton.tsx +24 -0
- package/src/form-field/input/components/assets/calendar/DatePicker.tsx +184 -0
- package/src/form-field/input/components/assets/calendar/DateTimePicker.tsx +187 -0
- package/src/form-field/input/components/assets/calendar/TimePicker.tsx +163 -0
- package/src/form-field/input/components/assets/calendar/custom/ButtonContainer.tsx +15 -0
- package/src/form-field/input/components/assets/calendar/custom/TodayButton.tsx +23 -0
- package/src/form-field/input/components/assets/icon/CalendarIcon.tsx +14 -0
- package/src/form-field/input/components/assets/icon/CheckIcon.tsx +14 -0
- package/src/form-field/input/components/assets/icon/ExpandIcon.tsx +14 -0
- package/src/form-field/input/components/assets/icon/StatusIcon.tsx +17 -0
- package/src/form-field/input/components/assets/util/Countdown.tsx +34 -0
- package/src/form-field/input/components/assets/util/StatusNotice.tsx +22 -0
- package/src/form-field/input/components/click/Checkbox.tsx +99 -0
- package/src/form-field/input/components/click/Radio.tsx +77 -0
- package/src/form-field/input/components/click/index.tsx +9 -0
- package/src/form-field/input/components/date-time/Date.tsx +74 -0
- package/src/form-field/input/components/date-time/DateTime.tsx +72 -0
- package/src/form-field/input/components/date-time/Time.tsx +60 -0
- package/src/form-field/input/components/file-upload/Container.tsx +117 -0
- package/src/form-field/input/components/file-upload/DragAndDrop.tsx +65 -0
- package/src/form-field/input/components/text/Box.tsx +134 -0
- package/src/form-field/input/components/text/index.tsx +7 -0
- package/src/form-field/input/index.tsx +19 -0
- package/src/form-field/input/input.scss +2 -0
- package/src/form-field/input/styled.tsx +5 -0
- package/src/form-field/input/styles/scss/size.scss +39 -0
- package/src/form-field/input/styles/scss/theme.scss +39 -0
- package/src/form-field/input/styles/styled-components/base.ts +96 -0
- package/src/form-field/input/styles/styled-components/calendar.ts +18 -0
- package/src/form-field/input/styles/styled-components/click.ts +37 -0
- package/src/form-field/input/styles/styled-components/input-file.ts +26 -0
- package/src/form-field/input/styles/styled-components/mixin.ts +200 -0
- package/src/form-field/input/styles/styled-components/util.ts +47 -0
- package/src/form-field/select/components/Default.tsx +222 -0
- package/src/form-field/select/components/MultipleCategoryList.tsx +47 -0
- package/src/form-field/select/components/MultipleDefault.tsx +63 -0
- package/src/form-field/select/components/assets/Container.tsx +40 -0
- package/src/form-field/select/components/assets/dropdown/Default.tsx +114 -0
- package/src/form-field/select/components/assets/dropdown/MultipleCategoryList.tsx +95 -0
- package/src/form-field/select/components/assets/dropdown/MultipleDefault.tsx +149 -0
- package/src/form-field/select/components/assets/dropdown/Selected.tsx +48 -0
- package/src/form-field/select/index.tsx +13 -0
- package/src/form-field/select/select.scss +1 -0
- package/src/form-field/select/styled.tsx +5 -0
- package/src/form-field/select/styles/scss/variable.scss +14 -0
- package/src/form-field/select/styles/styled-components/base.ts +135 -0
- package/src/frame/components/breadcrumb/Arrow.tsx +18 -0
- package/src/frame/components/breadcrumb/Container.tsx +20 -0
- package/src/frame/components/breadcrumb/Dropdown.tsx +28 -0
- package/src/frame/components/breadcrumb/Item.tsx +30 -0
- package/src/frame/components/breadcrumb/Label.tsx +11 -0
- package/src/frame/components/breadcrumb/SelectBox.tsx +48 -0
- package/src/frame/components/breadcrumb/SelectItem.tsx +47 -0
- package/src/frame/components/breadcrumb/Selected.tsx +25 -0
- package/src/frame/components/breadcrumb/index.tsx +15 -0
- package/src/frame/components/header/Container.tsx +11 -0
- package/src/frame/components/header/Logo.tsx +19 -0
- package/src/frame/components/header/index.tsx +27 -0
- package/src/frame/components/header/util/Button.tsx +31 -0
- package/src/frame/components/header/util/Container.tsx +15 -0
- package/src/frame/components/header/util/Item.tsx +16 -0
- package/src/frame/components/header/util/logout/Logout.tsx +22 -0
- package/src/frame/components/header/util/notify/Container.tsx +57 -0
- package/src/frame/components/header/util/notify/Dropdown.tsx +24 -0
- package/src/frame/components/header/util/notify/List.tsx +56 -0
- package/src/frame/components/header/util/notify/OpenButton.tsx +35 -0
- package/src/frame/components/header/util/notify/RefreshButton.tsx +31 -0
- package/src/frame/components/header/util/profile/Avatar.tsx +19 -0
- package/src/frame/components/header/util/profile/Container.tsx +61 -0
- package/src/frame/components/header/util/profile/Dropdown.tsx +30 -0
- package/src/frame/components/header/util/profile/DropdownButton.tsx +27 -0
- package/src/frame/components/header/util/profile/Selected.tsx +29 -0
- package/src/frame/components/header/util/setting/Button.tsx +39 -0
- package/src/frame/components/header/util/time/Container.tsx +13 -0
- package/src/frame/components/header/util/time/Time.tsx +11 -0
- package/src/frame/components/index.tsx +17 -0
- package/src/frame/components/nav/Button.tsx +22 -0
- package/src/frame/components/nav/Container.tsx +64 -0
- package/src/frame/components/nav/Logo.tsx +24 -0
- package/src/frame/components/nav/index.tsx +5 -0
- package/src/frame/components/page/Container.tsx +11 -0
- package/src/frame/components/page/ServiceFrame.tsx +13 -0
- package/src/frame/components/page/ServiceMain.tsx +13 -0
- package/src/frame/components/page/ServiceMainWrapper.tsx +26 -0
- package/src/frame/components/page/index.tsx +14 -0
- package/src/frame/components/popup/Container.tsx +21 -0
- package/src/frame/components/popup/frame/Body.tsx +17 -0
- package/src/frame/components/popup/frame/Container.tsx +20 -0
- package/src/frame/components/popup/frame/Header.tsx +27 -0
- package/src/frame/components/popup/frame/index.tsx +11 -0
- package/src/frame/components/popup/index.tsx +9 -0
- package/src/frame/frame.scss +2 -0
- package/src/frame/index.tsx +3 -0
- package/src/frame/styled.tsx +3 -0
- package/src/frame/styles/scss/size.variables.scss +28 -0
- package/src/frame/styles/scss/theme.variables.scss +23 -0
- package/src/frame/styles/styled-components/breadcrumb/base.ts +126 -0
- package/src/frame/styles/styled-components/index.ts +13 -0
- package/src/frame/styles/styled-components/page/common.ts +66 -0
- package/src/frame/styles/styled-components/page/header.ts +44 -0
- package/src/frame/styles/styled-components/page/nav.ts +127 -0
- package/src/frame/styles/styled-components/page/util.common.ts +48 -0
- package/src/frame/styles/styled-components/page/util.notify.ts +116 -0
- package/src/frame/styles/styled-components/page/util.profile.ts +78 -0
- package/src/frame/styles/styled-components/popup/popup.ts +66 -0
- package/src/icon/components/alternate/Loading.tsx +15 -0
- package/src/icon/components/alternate/index.tsx +7 -0
- package/src/icon/components/arrow/dropdown/Breadcrumb.tsx +20 -0
- package/src/icon/components/arrow/dropdown/Select.tsx +20 -0
- package/src/icon/components/arrow/index.tsx +11 -0
- package/src/icon/components/button/Close.tsx +20 -0
- package/src/icon/components/button/Filter.tsx +19 -0
- package/src/icon/components/button/Refresh.tsx +18 -0
- package/src/icon/components/button/Reset.tsx +18 -0
- package/src/icon/components/button/add/Outline.tsx +23 -0
- package/src/icon/components/button/add/Solid.tsx +23 -0
- package/src/icon/components/button/add/index.tsx +9 -0
- package/src/icon/components/button/index.tsx +17 -0
- package/src/icon/components/button/remove/Outline.tsx +23 -0
- package/src/icon/components/button/remove/Solid.tsx +23 -0
- package/src/icon/components/button/remove/index.tsx +9 -0
- package/src/icon/components/cage/Fan.tsx +48 -0
- package/src/icon/components/cage/index.tsx +7 -0
- package/src/icon/components/chart/Control.tsx +40 -0
- package/src/icon/components/chart/index.tsx +7 -0
- package/src/icon/components/delta/Delta.tsx +79 -0
- package/src/icon/components/delta/index.tsx +3 -0
- package/src/icon/components/health-score/HealthScore.tsx +46 -0
- package/src/icon/components/health-score/index.tsx +3 -0
- package/src/icon/components/input/Checkbox.tsx +33 -0
- package/src/icon/components/input/Radio.tsx +17 -0
- package/src/icon/components/input/Search.tsx +12 -0
- package/src/icon/components/input/index.tsx +11 -0
- package/src/icon/components/nav/common/Farm.tsx +12 -0
- package/src/icon/components/nav/factory-service/CCTV.tsx +12 -0
- package/src/icon/components/nav/factory-service/Dashboard.tsx +12 -0
- package/src/icon/components/nav/factory-service/Home.tsx +12 -0
- package/src/icon/components/nav/factory-service/Message.tsx +12 -0
- package/src/icon/components/nav/factory-service/Productivity.tsx +12 -0
- package/src/icon/components/nav/farm-service/Analysis.tsx +12 -0
- package/src/icon/components/nav/farm-service/Control.tsx +12 -0
- package/src/icon/components/nav/farm-service/Dashboard.tsx +12 -0
- package/src/icon/components/nav/farm-service/Eggs.tsx +12 -0
- package/src/icon/components/nav/farm-service/Feeding.tsx +12 -0
- package/src/icon/components/nav/farm-service/Feeds.tsx +12 -0
- package/src/icon/components/nav/farm-service/Flock.tsx +12 -0
- package/src/icon/components/nav/farm-service/Medicine.tsx +12 -0
- package/src/icon/components/nav/farm-service/Summary.tsx +12 -0
- package/src/icon/components/nav/index.tsx +44 -0
- package/src/icon/components/page-header/Check.tsx +12 -0
- package/src/icon/components/page-header/index.tsx +5 -0
- package/src/icon/components/tab-menu/Graph.tsx +12 -0
- package/src/icon/components/tab-menu/Table.tsx +12 -0
- package/src/icon/components/tab-menu/index.tsx +9 -0
- package/src/icon/components/table/index.tsx +9 -0
- package/src/icon/components/table/pagination/First.tsx +18 -0
- package/src/icon/components/table/pagination/Last.tsx +18 -0
- package/src/icon/components/table/pagination/Next.tsx +18 -0
- package/src/icon/components/table/pagination/Prev.tsx +18 -0
- package/src/icon/components/table/pagination/index.tsx +13 -0
- package/src/icon/components/table/sort/Asc.tsx +12 -0
- package/src/icon/components/table/sort/Common.tsx +12 -0
- package/src/icon/components/table/sort/Desc.tsx +12 -0
- package/src/icon/components/table/sort/index.tsx +11 -0
- package/src/icon/components/tooltip/Outline.tsx +7 -0
- package/src/icon/components/tooltip/Solid.tsx +7 -0
- package/src/icon/components/tooltip/index.tsx +9 -0
- package/src/icon/icon.scss +5 -0
- package/src/icon/index.tsx +31 -0
- package/src/icon/styled.tsx +17 -0
- package/src/icon/styles/scss/arrow.scss +6 -0
- package/src/icon/styles/scss/chart.scss +3 -0
- package/src/icon/styles/scss/input.scss +11 -0
- package/src/icon/styles/scss/page-header.scss +6 -0
- package/src/icon/styles/scss/table.scss +6 -0
- package/src/icon/styles/styled/arrow.ts +18 -0
- package/src/icon/styles/styled/chart.ts +17 -0
- package/src/icon/styles/styled/common.ts +27 -0
- package/src/icon/styles/styled/delta.ts +25 -0
- package/src/icon/styles/styled/input.ts +76 -0
- package/src/icon/styles/styled/page-header.ts +17 -0
- package/src/icon/styles/styled/table.ts +19 -0
- package/src/icon/svg/arrow/depth.svg +3 -0
- package/src/icon/svg/arrow/dropdown/breadcrumb.svg +3 -0
- package/src/icon/svg/arrow/dropdown/select.svg +3 -0
- package/src/icon/svg/button/add-outline.svg +4 -0
- package/src/icon/svg/button/add-solid.svg +3 -0
- package/src/icon/svg/button/close.svg +3 -0
- package/src/icon/svg/button/filter.svg +5 -0
- package/src/icon/svg/button/loading.svg +4 -0
- package/src/icon/svg/button/refresh.svg +4 -0
- package/src/icon/svg/button/remove-outline.svg +3 -0
- package/src/icon/svg/button/remove-solid.svg +3 -0
- package/src/icon/svg/button/reset.svg +3 -0
- package/src/icon/svg/chart/control/pan-left.svg +4 -0
- package/src/icon/svg/chart/control/pan-right.svg +4 -0
- package/src/icon/svg/chart/control/zoom-in.svg +4 -0
- package/src/icon/svg/chart/control/zoom-out.svg +4 -0
- package/src/icon/svg/delta/down-arrow.svg +4 -0
- package/src/icon/svg/delta/down-flat.svg +10 -0
- package/src/icon/svg/delta/down-rounded.svg +10 -0
- package/src/icon/svg/delta/up-arrow.svg +4 -0
- package/src/icon/svg/delta/up-flat.svg +10 -0
- package/src/icon/svg/delta/up-rounded.svg +10 -0
- package/src/icon/svg/input/search.svg +4 -0
- package/src/icon/svg/nav/factory-service/cctv.svg +3 -0
- package/src/icon/svg/nav/factory-service/dashboard.svg +3 -0
- package/src/icon/svg/nav/factory-service/farm.svg +3 -0
- package/src/icon/svg/nav/factory-service/home.svg +5 -0
- package/src/icon/svg/nav/factory-service/message.svg +3 -0
- package/src/icon/svg/nav/farm-service/analysis.svg +3 -0
- package/src/icon/svg/nav/farm-service/cctv.svg +3 -0
- package/src/icon/svg/nav/farm-service/control.svg +3 -0
- package/src/icon/svg/nav/farm-service/dashboard.svg +5 -0
- package/src/icon/svg/nav/farm-service/eggs.svg +3 -0
- package/src/icon/svg/nav/farm-service/feeds.svg +14 -0
- package/src/icon/svg/nav/farm-service/flock.svg +14 -0
- package/src/icon/svg/nav/farm-service/medicine.svg +4 -0
- package/src/icon/svg/nav/farm-service/summary.svg +7 -0
- package/src/icon/svg/nav/farm.svg +3 -0
- package/src/icon/svg/nav/grid.svg +3 -0
- package/src/icon/svg/nav/lock.svg +1 -0
- package/src/icon/svg/page-header/check.svg +3 -0
- package/src/icon/svg/tab-menu/graph.svg +3 -0
- package/src/icon/svg/tab-menu/table.svg +8 -0
- package/src/icon/svg/table/pagination/first.svg +4 -0
- package/src/icon/svg/table/pagination/last.svg +4 -0
- package/src/icon/svg/table/pagination/next.svg +3 -0
- package/src/icon/svg/table/pagination/prev.svg +3 -0
- package/src/icon/svg/table/sort/asc.svg +3 -0
- package/src/icon/svg/table/sort/common.svg +6 -0
- package/src/icon/svg/table/sort/desc.svg +3 -0
- package/src/icon/svg/tooltip/outline.svg +5 -0
- package/src/icon/svg/tooltip/solid.svg +3 -0
- package/src/index.scss +20 -0
- package/src/index.tsx +16 -0
- package/src/modal/components/assets/alert/MessageBox.tsx +26 -0
- package/src/modal/components/assets/alert/index.tsx +7 -0
- package/src/modal/components/assets/button/ButtonClose.tsx +34 -0
- package/src/modal/components/assets/button/ButtonDialog.tsx +32 -0
- package/src/modal/components/assets/button/index.tsx +6 -0
- package/src/modal/components/assets/form/ButtonContainer.tsx +18 -0
- package/src/modal/components/assets/form/Provider.tsx +12 -0
- package/src/modal/components/assets/form/index.tsx +9 -0
- package/src/modal/components/assets/layout/Body.tsx +7 -0
- package/src/modal/components/assets/layout/Container.tsx +37 -0
- package/src/modal/components/assets/layout/Footer.tsx +25 -0
- package/src/modal/components/assets/layout/Header.tsx +45 -0
- package/src/modal/components/assets/layout/index.tsx +14 -0
- package/src/modal/components/basic/Container.tsx +45 -0
- package/src/modal/components/basic/Provider.tsx +30 -0
- package/src/modal/components/basic/Root.tsx +84 -0
- package/src/modal/components/basic/index.tsx +11 -0
- package/src/modal/components/draggable/Container.tsx +75 -0
- package/src/modal/components/draggable/Provider.tsx +26 -0
- package/src/modal/components/draggable/index.tsx +9 -0
- package/src/modal/components/index.tsx +17 -0
- package/src/modal/hooks/useModal.ts +295 -0
- package/src/modal/index.tsx +3 -0
- package/src/modal/jotai/modal.ts +18 -0
- package/src/modal/modal.scss +2 -0
- package/src/modal/styled.tsx +15 -0
- package/src/modal/styles/scss/legacy.scss +254 -0
- package/src/modal/styles/scss/variables.scss +32 -0
- package/src/modal/styles/styled-components/alert.ts +24 -0
- package/src/modal/styles/styled-components/basic.ts +41 -0
- package/src/modal/styles/styled-components/draggable.ts +35 -0
- package/src/modal/styles/styled-components/form.ts +23 -0
- package/src/modal/styles/styled-components/layout.ts +106 -0
- package/src/modal/util.ts +4 -0
- package/src/scrollbar/components/Container.tsx +70 -0
- package/src/scrollbar/index.tsx +5 -0
- package/src/scrollbar/scrollbar.scss +2 -0
- package/src/scrollbar/styled.tsx +3 -0
- package/src/scrollbar/styles/scss/reset.scss +59 -0
- package/src/scrollbar/styles/scss/size.scss +4 -0
- package/src/scrollbar/styles/styled-components/scrollbar.ts +82 -0
- package/src/style-base/base.scss +6 -0
- package/src/style-base/essentials/calendar.scss +557 -0
- package/src/style-base/essentials/colors.scss +195 -0
- package/src/style-base/essentials/document.scss +14 -0
- package/src/style-base/essentials/fonts.scss +24 -0
- package/src/style-base/essentials/icon.scss +11 -0
- package/src/style-base/essentials/palette.scss +146 -0
- package/src/style-base/essentials/reset.scss +156 -0
- package/src/style-base/mantine.css +4 -0
- package/src/style-base/responsive.scss +57 -0
- package/src/style-config/index.ts +5 -0
- package/src/style-config/postcss/postcss-config.ts +9 -0
- package/src/styled.components.tsx +31 -0
- package/src/styled.template.tsx +5 -0
- package/src/tab-menu/components/custom/AddButton.tsx +32 -0
- package/src/tab-menu/components/custom/Container.tsx +60 -0
- package/src/tab-menu/components/custom/MenuButton.tsx +39 -0
- package/src/tab-menu/components/filter/Default.tsx +3 -0
- package/src/tab-menu/components/filter/WithData.tsx +36 -0
- package/src/tab-menu/components/mode/List.tsx +66 -0
- package/src/tab-menu/components/page/List.tsx +88 -0
- package/src/tab-menu/components/separated-square/List.tsx +66 -0
- package/src/tab-menu/components/text/List.tsx +53 -0
- package/src/tab-menu/index.tsx +21 -0
- package/src/tab-menu/styled.tsx +21 -0
- package/src/tab-menu/styles/scss/mode.scss +5 -0
- package/src/tab-menu/styles/scss/page-menu.scss +4 -0
- package/src/tab-menu/styles/scss/text-menu.scss +7 -0
- package/src/tab-menu/styles/styled-components/custom-menu.ts +80 -0
- package/src/tab-menu/styles/styled-components/filter-with-data.ts +72 -0
- package/src/tab-menu/styles/styled-components/mode-menu.ts +114 -0
- package/src/tab-menu/styles/styled-components/page-menu.ts +90 -0
- package/src/tab-menu/styles/styled-components/separated-square.ts +78 -0
- package/src/tab-menu/styles/styled-components/tab-menu.ts +21 -0
- package/src/tab-menu/styles/styled-components/text-menu.ts +73 -0
- package/src/tab-menu/tab-menu.scss +3 -0
- package/src/table/components/pagination/Button.tsx +61 -0
- package/src/table/components/pagination/Container.tsx +148 -0
- package/src/table/components/pagination/Icon.tsx +26 -0
- package/src/table/components/sort/Button.tsx +34 -0
- package/src/table/components/tables/Container.tsx +41 -0
- package/src/table/components/tables/basic/Container.tsx +52 -0
- package/src/table/components/tables/basic/index.tsx +13 -0
- package/src/table/components/tables/common/Body.tsx +29 -0
- package/src/table/components/tables/common/Cell.tsx +32 -0
- package/src/table/components/tables/common/CellWrap.tsx +27 -0
- package/src/table/components/tables/common/ColGroup.tsx +30 -0
- package/src/table/components/tables/common/DefaultTemplate.tsx +37 -0
- package/src/table/components/tables/common/Foot.tsx +25 -0
- package/src/table/components/tables/common/Head.tsx +25 -0
- package/src/table/components/tables/common/HeadDefault.tsx +42 -0
- package/src/table/components/tables/common/Row.tsx +36 -0
- package/src/table/components/tables/common/TopLine.tsx +11 -0
- package/src/table/components/tables/common/index.tsx +37 -0
- package/src/table/components/tables/grid/Cell.tsx +25 -0
- package/src/table/components/tables/grid/Container.tsx +23 -0
- package/src/table/components/tables/grid/Contents.tsx +25 -0
- package/src/table/components/tables/grid/index.tsx +19 -0
- package/src/table/components/tables/list/Container.tsx +36 -0
- package/src/table/components/tables/list/index.tsx +13 -0
- package/src/table/components/tables/sheet/Container.tsx +39 -0
- package/src/table/components/tables/sheet/index.tsx +13 -0
- package/src/table/hooks/index.ts +5 -0
- package/src/table/hooks/useTableColumns.ts +24 -0
- package/src/table/hooks/useTablePage.ts +150 -0
- package/src/table/hooks/useTableRowCheck.ts +112 -0
- package/src/table/hooks/useTableSearch.ts +69 -0
- package/src/table/hooks/useTableSort.ts +108 -0
- package/src/table/index.tsx +37 -0
- package/src/table/styled.tsx +3 -0
- package/src/table/styles/scss/common.scss +31 -0
- package/src/table/styles/scss/pagination.scss +14 -0
- package/src/table/styles/scss/reset.scss +7 -0
- package/src/table/styles/styled/basic.ts +59 -0
- package/src/table/styles/styled/common.ts +123 -0
- package/src/table/styles/styled/grid.ts +62 -0
- package/src/table/styles/styled/index.ts +20 -0
- package/src/table/styles/styled/list.ts +38 -0
- package/src/table/styles/styled/pagination.ts +77 -0
- package/src/table/styles/styled/sort.ts +25 -0
- package/src/table/styles/styled/spreadsheet.ts +86 -0
- package/src/table/table.scss +3 -0
- package/src/table/util.ts +1 -0
- package/src/template/compare/compare.scss +1 -0
- package/src/template/compare/components/box/Container.tsx +33 -0
- package/src/template/compare/components/box/TextStrong.tsx +15 -0
- package/src/template/compare/components/box/TextSub.tsx +15 -0
- package/src/template/compare/components/box/index.tsx +11 -0
- package/src/template/compare/components/button/Remove.tsx +28 -0
- package/src/template/compare/components/button/index.tsx +5 -0
- package/src/template/compare/components/chart/Container.tsx +33 -0
- package/src/template/compare/components/chart/graph/Container.tsx +15 -0
- package/src/template/compare/components/chart/graph/Item.tsx +13 -0
- package/src/template/compare/components/chart/index.tsx +16 -0
- package/src/template/compare/components/chart/legend/Container.tsx +23 -0
- package/src/template/compare/components/chart/legend/Section.tsx +31 -0
- package/src/template/compare/components/select-list/Container.tsx +15 -0
- package/src/template/compare/components/select-list/Header.tsx +15 -0
- package/src/template/compare/components/select-list/Item.tsx +15 -0
- package/src/template/compare/components/select-list/List.tsx +18 -0
- package/src/template/compare/components/select-list/index.tsx +13 -0
- package/src/template/compare/index.tsx +13 -0
- package/src/template/compare/styled.tsx +17 -0
- package/src/template/compare/styles/scss/variables.scss +17 -0
- package/src/template/compare/styles/styled-components/chart/graph.ts +26 -0
- package/src/template/compare/styles/styled-components/chart/layout.ts +38 -0
- package/src/template/compare/styles/styled-components/chart/legend.ts +64 -0
- package/src/template/compare/styles/styled-components/common.ts +57 -0
- package/src/template/compare/styles/styled-components/select-list.ts +36 -0
- package/src/template/filter/components/Container.tsx +39 -0
- package/src/template/filter/components/Group.tsx +100 -0
- package/src/template/filter/components/ToggleButton.tsx +27 -0
- package/src/template/filter/index.tsx +5 -0
- package/src/template/filter/styled.tsx +3 -0
- package/src/template/filter/styles/styled-components/filter.ts +66 -0
- package/src/template/health-score/components/Chart.tsx +38 -0
- package/src/template/health-score/index.tsx +3 -0
- package/src/template/health-score/styled.tsx +3 -0
- package/src/template/health-score/styles/styled/chart.ts +26 -0
- package/src/template.tsx +5 -0
- package/src/text-editor/components/Container.tsx +68 -0
- package/src/text-editor/components/Contents.tsx +14 -0
- package/src/text-editor/components/toolbar/Container.tsx +20 -0
- package/src/text-editor/components/toolbar/ControlsGroup.tsx +18 -0
- package/src/text-editor/components/toolbar/align/Center.tsx +23 -0
- package/src/text-editor/components/toolbar/align/Justify.tsx +23 -0
- package/src/text-editor/components/toolbar/align/Left.tsx +23 -0
- package/src/text-editor/components/toolbar/align/Right.tsx +23 -0
- package/src/text-editor/components/toolbar/index.tsx +35 -0
- package/src/text-editor/components/toolbar/list/Bullet.tsx +23 -0
- package/src/text-editor/components/toolbar/list/Ordered.tsx +23 -0
- package/src/text-editor/components/toolbar/text/Bold.tsx +23 -0
- package/src/text-editor/components/toolbar/text/Italic.tsx +23 -0
- package/src/text-editor/components/toolbar/text/Strike.tsx +27 -0
- package/src/text-editor/components/toolbar/text/Underline.tsx +23 -0
- package/src/text-editor/index.tsx +11 -0
- package/src/text-editor/styled.tsx +5 -0
- package/src/text-editor/styles/scss/style.scss +10 -0
- package/src/text-editor/styles/scss/theme.scss +17 -0
- package/src/text-editor/styles/styled/editor.ts +73 -0
- package/src/text-editor/svg/align/center.svg +6 -0
- package/src/text-editor/svg/align/justify.svg +6 -0
- package/src/text-editor/svg/align/left.svg +6 -0
- package/src/text-editor/svg/align/right.svg +6 -0
- package/src/text-editor/svg/list/bullet.svg +8 -0
- package/src/text-editor/svg/list/ordered.svg +8 -0
- package/src/text-editor/svg/text/bold.svg +4 -0
- package/src/text-editor/svg/text/italic.svg +5 -0
- package/src/text-editor/svg/text/strikethrough.svg +4 -0
- package/src/text-editor/svg/text/underline.svg +4 -0
- package/src/text-editor/text-editor.scss +2 -0
- package/src/tooltip/components/Help.tsx +38 -0
- package/src/tooltip/components/MessageBox.tsx +26 -0
- package/src/tooltip/components/Wrapper.tsx +34 -0
- package/src/tooltip/index.tsx +11 -0
- package/src/tooltip/styled.tsx +9 -0
- package/src/tooltip/styles/scss/size.scss +4 -0
- package/src/tooltip/styles/styled-components/base.ts +20 -0
- package/src/tooltip/styles/styled-components/help.ts +17 -0
- package/src/tooltip/styles/styled-components/message-box.ts +74 -0
- package/src/tooltip/tooltip.scss +1 -0
- package/src/types/button/base.d.ts +91 -0
- package/src/types/button/index.d.ts +2 -0
- package/src/types/button/multiple.d.ts +6 -0
- package/src/types/chart/axis.d.ts +15 -0
- package/src/types/chart/control.d.ts +109 -0
- package/src/types/chart/data.d.ts +41 -0
- package/src/types/chart/dot.d.ts +3 -0
- package/src/types/chart/index.d.ts +7 -0
- package/src/types/chart/legend.d.ts +124 -0
- package/src/types/chart/props.d.ts +271 -0
- package/src/types/chart/tick.d.ts +30 -0
- package/src/types/chip/index.d.ts +1 -0
- package/src/types/chip/props.d.ts +14 -0
- package/src/types/common.d.ts +16 -0
- package/src/types/delta/index.d.ts +1 -0
- package/src/types/delta/option.d.ts +57 -0
- package/src/types/form/common/format.d.ts +15 -0
- package/src/types/form/common/hook.d.ts +74 -0
- package/src/types/form/common/index.d.ts +6 -0
- package/src/types/form/common/label.d.ts +11 -0
- package/src/types/form/common/props.d.ts +136 -0
- package/src/types/form/common/state.d.ts +96 -0
- package/src/types/form/common/validation.d.ts +18 -0
- package/src/types/form/index.d.ts +5 -0
- package/src/types/form/input/index.d.ts +7 -0
- package/src/types/form/input/legacy/auto-complete.d.ts +77 -0
- package/src/types/form/input/legacy/base.d.ts +159 -0
- package/src/types/form/input/legacy/find-address.d.ts +7 -0
- package/src/types/form/input/legacy/refer.d.ts +84 -0
- package/src/types/form/input/legacy/select.options.d.ts +123 -0
- package/src/types/form/input/props.d.ts +156 -0
- package/src/types/form/search/index.d.ts +1 -0
- package/src/types/form/search/search.d.ts +4 -0
- package/src/types/form/select/index.d.ts +2 -0
- package/src/types/form/select/option.d.ts +43 -0
- package/src/types/form/select/props.d.ts +101 -0
- package/src/types/form/util/find-address.d.ts +7 -0
- package/src/types/form/util/index.d.ts +1 -0
- package/src/types/frame/index.d.ts +2 -0
- package/src/types/frame/notify.d.ts +7 -0
- package/src/types/frame/sitemap.d.ts +38 -0
- package/src/types/icon/delta.d.ts +32 -0
- package/src/types/icon/fan.d.ts +17 -0
- package/src/types/icon/index.d.ts +2 -0
- package/src/types/index.d.ts +15 -0
- package/src/types/location/geojson.d.ts +59 -0
- package/src/types/location/index.d.ts +2 -0
- package/src/types/location/region.d.ts +19 -0
- package/src/types/modal/index.d.ts +2 -0
- package/src/types/modal/modal.d.ts +88 -0
- package/src/types/modal/modal.options.d.ts +33 -0
- package/src/types/style-option.d.ts +33 -0
- package/src/types/tab-menu/index.d.ts +1 -0
- package/src/types/tab-menu/tab-menu.d.ts +37 -0
- package/src/types/table/components/pagination.d.ts +7 -0
- package/src/types/table/components/props.d.ts +104 -0
- package/src/types/table/data/column.d.ts +60 -0
- package/src/types/table/data/row.d.ts +26 -0
- package/src/types/table/index.d.ts +10 -0
- package/src/types/table/layout/grid.d.ts +8 -0
- package/src/types/table/layout/layout.d.ts +3 -0
- package/src/types/table/utils/row.check.d.ts +37 -0
- package/src/types/template/compare/chart.d.ts +8 -0
- package/src/types/template/filter.d.ts +39 -0
- package/src/types/template/index.d.ts +2 -0
- package/src/types/weather/api.d.ts +184 -0
- package/src/types/weather/base.d.ts +14 -0
- package/src/types/weather/index.d.ts +4 -0
- package/src/types/weather/korea.d.ts +163 -0
- package/src/types/weather/open-weather-map.d.ts +181 -0
- package/src/weather/apis/index.ts +4 -0
- package/src/weather/apis/korea/client.ts +93 -0
- package/src/weather/apis/korea/server.ts +250 -0
- package/src/weather/apis/open-weather-map/client.ts +69 -0
- package/src/weather/apis/open-weather-map/server.ts +134 -0
- package/src/weather/components/icon/Address.tsx +17 -0
- package/src/weather/components/icon/Weather.tsx +33 -0
- package/src/weather/components/index.tsx +7 -0
- package/src/weather/components/page-header/Address.tsx +21 -0
- package/src/weather/components/page-header/Alert.tsx +42 -0
- package/src/weather/components/page-header/Container.tsx +14 -0
- package/src/weather/components/page-header/Forecast.tsx +23 -0
- package/src/weather/components/page-header/NextDays.tsx +34 -0
- package/src/weather/components/page-header/Today.tsx +153 -0
- package/src/weather/data/alert-regions-meta.json +1286 -0
- package/src/weather/data/response.ts +36 -0
- package/src/weather/data/weather-regions-meta.json +9833 -0
- package/src/weather/hooks/index.ts +4 -0
- package/src/weather/hooks/useOpenWeatherMap.ts +31 -0
- package/src/weather/hooks/useWeatherKorea.ts +58 -0
- package/src/weather/hooks/useWeatherKoreaAlert.ts +22 -0
- package/src/weather/index.tsx +4 -0
- package/src/weather/jotai/coordinate.ts +16 -0
- package/src/weather/jotai/farm-idx.ts +5 -0
- package/src/weather/jotai/index.ts +2 -0
- package/src/weather/styled.tsx +13 -0
- package/src/weather/styles/styled-components/alert.ts +30 -0
- package/src/weather/styles/styled-components/base.ts +79 -0
- package/src/weather/styles/styled-components/next-days.ts +25 -0
- package/src/weather/styles/styled-components/today.ts +40 -0
- package/src/weather/utils/alert.ts +30 -0
- package/src/weather/utils/date-time.ts +68 -0
- package/src/weather/utils/index.ts +4 -0
- package/src/weather/utils/location.ts +159 -0
- package/src/weather/utils/validate.ts +9 -0
- package/src/weather/utils/weather.ts +304 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useState } from "react";
|
|
4
|
+
import type { MaskType } from "../../../types";
|
|
5
|
+
import {
|
|
6
|
+
maskBusinessCode,
|
|
7
|
+
maskDate,
|
|
8
|
+
maskDecimalSeparator,
|
|
9
|
+
maskPhone,
|
|
10
|
+
maskResidentCode,
|
|
11
|
+
} from "@uniai-fe/util-functions";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Form-Field Hook; 입력 마스크
|
|
15
|
+
* @desc
|
|
16
|
+
* - 전화번호: "phone"
|
|
17
|
+
* - 주민등록번호: "residentCode"
|
|
18
|
+
* - 사업자등록번호: "businessCode"
|
|
19
|
+
* - 날짜: "date"
|
|
20
|
+
* - 숫자에 쉼표 추가: "comma"
|
|
21
|
+
* @return maskValue: 현재 마스크된 값, updateMaskValue: 마스크 업데이트 함수
|
|
22
|
+
*/
|
|
23
|
+
export default function useInputMask() {
|
|
24
|
+
const [maskValue, setMaskValue] = useState<string | number>("");
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 입력 마스크 업데이트 함수
|
|
28
|
+
* @param {string | number} value - 입력 값
|
|
29
|
+
* @param {MaskType} type - phone, residentCode, businessCode, date, comma
|
|
30
|
+
* @return {string} - 마스크된 값
|
|
31
|
+
*/
|
|
32
|
+
const updateMaskValue = useCallback(
|
|
33
|
+
(value: string | number, type: MaskType): string => {
|
|
34
|
+
if (String(maskValue) === String(value)) return String(value);
|
|
35
|
+
|
|
36
|
+
let newValue = String(value);
|
|
37
|
+
if (type === "phone") {
|
|
38
|
+
newValue = maskPhone(String(value));
|
|
39
|
+
} else if (type === "residentCode") {
|
|
40
|
+
newValue = maskResidentCode(String(value));
|
|
41
|
+
} else if (type === "businessCode") {
|
|
42
|
+
newValue = maskBusinessCode(String(value));
|
|
43
|
+
} else if (type === "comma") {
|
|
44
|
+
newValue = maskDecimalSeparator(value);
|
|
45
|
+
} else if (type === "date") {
|
|
46
|
+
newValue = maskDate(value);
|
|
47
|
+
}
|
|
48
|
+
setMaskValue(newValue);
|
|
49
|
+
|
|
50
|
+
return newValue;
|
|
51
|
+
},
|
|
52
|
+
[maskValue],
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
return { maskValue, updateMaskValue };
|
|
56
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useSetAtom } from "jotai";
|
|
4
|
+
import { useDaumPostcodePopup, type Address } from "react-daum-postcode";
|
|
5
|
+
import { daumPostCodeState } from "../jotai/find-address";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* react-daum-postcode 주소 찾기
|
|
9
|
+
* 참조: https://github.com/kmsbernard/react-daum-postcode
|
|
10
|
+
*/
|
|
11
|
+
export default function useOpenDaumPostCodePopup(addressKey: string) {
|
|
12
|
+
const openPopup = useDaumPostcodePopup();
|
|
13
|
+
// 팝업에서 선택한 주소 상태관리
|
|
14
|
+
const setDaumPostCodeState = useSetAtom(daumPostCodeState);
|
|
15
|
+
|
|
16
|
+
// 주소찾기 버튼 클릭 이벤트
|
|
17
|
+
return () => {
|
|
18
|
+
// 주소찾기 열기
|
|
19
|
+
openPopup({
|
|
20
|
+
// 주소찾기 선택 완료 시
|
|
21
|
+
onComplete: ({
|
|
22
|
+
address: locationAddress,
|
|
23
|
+
addressType,
|
|
24
|
+
bname,
|
|
25
|
+
buildingName,
|
|
26
|
+
zonecode,
|
|
27
|
+
}: Address) => {
|
|
28
|
+
let fullAddress: string = locationAddress;
|
|
29
|
+
let buildingAddress: string = "";
|
|
30
|
+
|
|
31
|
+
// 동읍면 및 빌딩 정보 추가
|
|
32
|
+
if (addressType === "R") {
|
|
33
|
+
if (bname !== "") buildingAddress += bname;
|
|
34
|
+
|
|
35
|
+
if (buildingName !== "")
|
|
36
|
+
buildingAddress +=
|
|
37
|
+
buildingAddress !== "" ? `, ${buildingName}` : buildingName;
|
|
38
|
+
fullAddress += buildingAddress !== "" ? ` (${buildingAddress})` : "";
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
console.log(`fullAddress: `, fullAddress);
|
|
42
|
+
// 선택한 주소 상태 저장
|
|
43
|
+
console.log(`addressKey`, addressKey);
|
|
44
|
+
if (typeof addressKey === "undefined" || addressKey === "") return;
|
|
45
|
+
setDaumPostCodeState(prev => ({
|
|
46
|
+
...prev,
|
|
47
|
+
[addressKey]: {
|
|
48
|
+
address: fullAddress,
|
|
49
|
+
zipCode: zonecode,
|
|
50
|
+
},
|
|
51
|
+
}));
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
input,
|
|
2
|
+
select,
|
|
3
|
+
textarea,
|
|
4
|
+
button {
|
|
5
|
+
&:focus,
|
|
6
|
+
&:focus-visible,
|
|
7
|
+
&:focus-within {
|
|
8
|
+
outline: none;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
select,
|
|
12
|
+
input,
|
|
13
|
+
textarea {
|
|
14
|
+
transition: border-color var(--field-item-state-transition-duration);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
select {
|
|
18
|
+
display: none;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
input {
|
|
22
|
+
&:focus {
|
|
23
|
+
border-color: var(--field-state-focus);
|
|
24
|
+
}
|
|
25
|
+
&[type="search"] {
|
|
26
|
+
outline-offset: -0.2rem;
|
|
27
|
+
}
|
|
28
|
+
&[type="file"] {
|
|
29
|
+
display: none;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@mixin placeholder {
|
|
34
|
+
&::placeholder {
|
|
35
|
+
opacity: 1;
|
|
36
|
+
color: var(--field-item-placeholder);
|
|
37
|
+
transition:
|
|
38
|
+
opacity var(--field-item-state-transition-duration),
|
|
39
|
+
color var(--field-item-state-transition-duration);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&:not([readonly], [disabled]):focus::placeholder {
|
|
43
|
+
color: transparent;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
input {
|
|
47
|
+
@include placeholder;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
textarea {
|
|
51
|
+
@include placeholder;
|
|
52
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
// state
|
|
3
|
+
--field-state-focus: var(--color-light-blue-600);
|
|
4
|
+
--field-state-success: var(--green);
|
|
5
|
+
--field-state-error: var(--red);
|
|
6
|
+
--field-item-state-transition-duration: 0.12s;
|
|
7
|
+
|
|
8
|
+
// background
|
|
9
|
+
--field-item-bg-default: var(--color_0);
|
|
10
|
+
--field-item-bg-hover: var(--color_10);
|
|
11
|
+
--field-item-bg-readonly: var(--theme-background-20);
|
|
12
|
+
|
|
13
|
+
// border
|
|
14
|
+
--field-item-border-radius: 4px;
|
|
15
|
+
--field-item-border-default: var(--color-blue-gray-300);
|
|
16
|
+
--field-item-border-focus: var(--color-light-blue-600);
|
|
17
|
+
--field-item-border-readonly: var(--color-light-blue-600);
|
|
18
|
+
|
|
19
|
+
// text
|
|
20
|
+
--field-label-text: var(--color_90);
|
|
21
|
+
--field-item-placeholder: var(--color_40);
|
|
22
|
+
--field-item-text-input: var(--color_70);
|
|
23
|
+
--field-item-text-select: var(--color_60);
|
|
24
|
+
--field-item-text-focus: var(--color_90);
|
|
25
|
+
--field-item-text-readonly: var(--color_40);
|
|
26
|
+
|
|
27
|
+
// align
|
|
28
|
+
--field-item-flex-wrap: wrap;
|
|
29
|
+
|
|
30
|
+
// size
|
|
31
|
+
--field-item-width: auto;
|
|
32
|
+
--field-item-margin-vertical: 0px;
|
|
33
|
+
--field-item-margin-horizontal: 0.4rem;
|
|
34
|
+
--field-item-padding-vertical: 0px;
|
|
35
|
+
--field-item-padding-horizontal: 0px;
|
|
36
|
+
--field-item-wrapper-width: 100%;
|
|
37
|
+
--field-item-wrapper-height: 3.6rem;
|
|
38
|
+
--field-gap-thumb: 0.8rem;
|
|
39
|
+
--field-gap-label: 0.8rem;
|
|
40
|
+
--field-label-width: fit-content;
|
|
41
|
+
--field-label-text-size: 1.4rem;
|
|
42
|
+
--field-item-height: 3.6rem;
|
|
43
|
+
|
|
44
|
+
&.dark-mode {
|
|
45
|
+
--field-item-bg-default: var(--color_bg_dark_40);
|
|
46
|
+
|
|
47
|
+
--field-item-border-default: var(--color_bg_dark_40);
|
|
48
|
+
|
|
49
|
+
// 디자인시스템에 일관성이 없음.
|
|
50
|
+
// 다크테마 정돈하고 적용해야함.
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
FormFieldType,
|
|
5
|
+
LabelPositionType,
|
|
6
|
+
LabelTopAlignType,
|
|
7
|
+
} from "../../../../types";
|
|
8
|
+
import { styled, css } from "styled-components";
|
|
9
|
+
|
|
10
|
+
const container = styled.div`
|
|
11
|
+
width: var(--field-item-width);
|
|
12
|
+
margin: var(--field-item-margin-vertical) var(--field-item-margin-horizontal);
|
|
13
|
+
&:first-child {
|
|
14
|
+
margin-left: 0;
|
|
15
|
+
}
|
|
16
|
+
&:last-child {
|
|
17
|
+
margin-right: 0;
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
type StyledWrapperProps = Partial<{
|
|
22
|
+
$state: string;
|
|
23
|
+
$focus: boolean;
|
|
24
|
+
$openSelect: boolean;
|
|
25
|
+
}>;
|
|
26
|
+
const contentsWrapper = styled.div<StyledWrapperProps>`
|
|
27
|
+
width: var(--field-item-wrapper-width);
|
|
28
|
+
min-height: var(--field-item-wrapper-height);
|
|
29
|
+
padding: var(--field-item-padding-vertical)
|
|
30
|
+
var(--field-item-padding-horizontal);
|
|
31
|
+
|
|
32
|
+
position: relative;
|
|
33
|
+
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
flex-wrap: var(--field-item-flex-wrap);
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
type StyledLabelTextProps = Partial<{
|
|
40
|
+
$pos: LabelPositionType;
|
|
41
|
+
$topAlign: LabelTopAlignType;
|
|
42
|
+
}>;
|
|
43
|
+
const labelBox = styled.div<StyledLabelTextProps>`
|
|
44
|
+
--field-label-text-size: 1.6rem;
|
|
45
|
+
|
|
46
|
+
${({ $topAlign }) =>
|
|
47
|
+
$topAlign
|
|
48
|
+
? css`
|
|
49
|
+
width: 100%;
|
|
50
|
+
margin-bottom: var(--field-gap-label);
|
|
51
|
+
`
|
|
52
|
+
: css`
|
|
53
|
+
width: var(--field-label-width);
|
|
54
|
+
`};
|
|
55
|
+
|
|
56
|
+
${({ $pos }) =>
|
|
57
|
+
$pos === "right"
|
|
58
|
+
? css`
|
|
59
|
+
margin-left: var(--field-gap-label);
|
|
60
|
+
`
|
|
61
|
+
: css`
|
|
62
|
+
margin-right: var(--field-gap-label);
|
|
63
|
+
`};
|
|
64
|
+
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: center;
|
|
67
|
+
|
|
68
|
+
${({ $topAlign }) => {
|
|
69
|
+
switch ($topAlign) {
|
|
70
|
+
case "left":
|
|
71
|
+
return css`
|
|
72
|
+
justify-content: flex-start;
|
|
73
|
+
`;
|
|
74
|
+
case "center":
|
|
75
|
+
return css`
|
|
76
|
+
justify-content: center;
|
|
77
|
+
`;
|
|
78
|
+
case "right":
|
|
79
|
+
return css`
|
|
80
|
+
justify-content: flex-end;
|
|
81
|
+
`;
|
|
82
|
+
default:
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
}};
|
|
86
|
+
|
|
87
|
+
span {
|
|
88
|
+
font-size: var(--field-label-text-size);
|
|
89
|
+
color: var(--field-label-text);
|
|
90
|
+
font-weight: 500;
|
|
91
|
+
white-space: nowrap;
|
|
92
|
+
user-select: none;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
i {
|
|
96
|
+
font-size: calc(var(--field-label-text-size) * 0.75);
|
|
97
|
+
align-self: self-end;
|
|
98
|
+
}
|
|
99
|
+
`;
|
|
100
|
+
|
|
101
|
+
type StyledContainerProps = Partial<{
|
|
102
|
+
$style: FormFieldType;
|
|
103
|
+
$hide: boolean;
|
|
104
|
+
$icon: boolean;
|
|
105
|
+
$thumb: boolean;
|
|
106
|
+
$readonly: boolean;
|
|
107
|
+
}>;
|
|
108
|
+
const contentsContainer = styled.label<StyledContainerProps>`
|
|
109
|
+
width: 100%;
|
|
110
|
+
${({ $style }) => {
|
|
111
|
+
switch ($style) {
|
|
112
|
+
case "checkbox":
|
|
113
|
+
return css`
|
|
114
|
+
${labelBox} {
|
|
115
|
+
cursor: pointer;
|
|
116
|
+
}
|
|
117
|
+
`;
|
|
118
|
+
default:
|
|
119
|
+
return undefined;
|
|
120
|
+
}
|
|
121
|
+
}}
|
|
122
|
+
${({ $readonly }) =>
|
|
123
|
+
$readonly &&
|
|
124
|
+
css`
|
|
125
|
+
opacity: 0.4;
|
|
126
|
+
cursor: default;
|
|
127
|
+
`}
|
|
128
|
+
`;
|
|
129
|
+
|
|
130
|
+
const contents = {
|
|
131
|
+
container: contentsContainer,
|
|
132
|
+
wrapper: contentsWrapper,
|
|
133
|
+
label: labelBox,
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const thumbnail = styled.figure`
|
|
137
|
+
width: 100%;
|
|
138
|
+
height: auto;
|
|
139
|
+
margin-bottom: var(--field-gap-thumb);
|
|
140
|
+
`;
|
|
141
|
+
|
|
142
|
+
const StyledFieldItem = {
|
|
143
|
+
container,
|
|
144
|
+
contents,
|
|
145
|
+
thumbnail,
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
export default StyledFieldItem;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { forwardRef, memo } from "react";
|
|
4
|
+
|
|
5
|
+
import FieldItem from "../../common/components/item-contents";
|
|
6
|
+
import type { InputContainerProps } from "../../../types";
|
|
7
|
+
|
|
8
|
+
const InputContainer = forwardRef(
|
|
9
|
+
(
|
|
10
|
+
{
|
|
11
|
+
className,
|
|
12
|
+
fieldType,
|
|
13
|
+
selectorId,
|
|
14
|
+
label,
|
|
15
|
+
wrapperOptions,
|
|
16
|
+
icon,
|
|
17
|
+
thumb,
|
|
18
|
+
readonly,
|
|
19
|
+
useHtmlLabel,
|
|
20
|
+
children,
|
|
21
|
+
}: InputContainerProps,
|
|
22
|
+
ref: React.ForwardedRef<HTMLDivElement>,
|
|
23
|
+
) => {
|
|
24
|
+
const isShowLabel = (isHide?: boolean) =>
|
|
25
|
+
typeof isHide === "boolean" && isHide === false;
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<FieldItem.Container
|
|
29
|
+
className={className}
|
|
30
|
+
fieldType={fieldType}
|
|
31
|
+
selectorId={selectorId}
|
|
32
|
+
labelName={label.tooltip}
|
|
33
|
+
labelHide={label.hide || true}
|
|
34
|
+
icon={icon}
|
|
35
|
+
thumb={thumb}
|
|
36
|
+
readonly={readonly}
|
|
37
|
+
useHtmlLabel={useHtmlLabel}
|
|
38
|
+
ref={ref}
|
|
39
|
+
>
|
|
40
|
+
<FieldItem.Wrapper className="input" {...wrapperOptions}>
|
|
41
|
+
{isShowLabel(label.hide) && label.position !== "right" && (
|
|
42
|
+
<FieldItem.Label {...label} />
|
|
43
|
+
)}
|
|
44
|
+
{children}
|
|
45
|
+
{isShowLabel(label.hide) && label.position === "right" && (
|
|
46
|
+
<FieldItem.Label {...label} />
|
|
47
|
+
)}
|
|
48
|
+
</FieldItem.Wrapper>
|
|
49
|
+
</FieldItem.Container>
|
|
50
|
+
);
|
|
51
|
+
},
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
export default memo(InputContainer);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import Reset from "@icon/action/close_circle_filled.svg";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 입력 값 모두 지우기 버튼
|
|
5
|
+
* @property {Function} clickEvent InputText에서 사용하는 reset callback
|
|
6
|
+
*/
|
|
7
|
+
export default function InputResetButton({
|
|
8
|
+
clickEvent,
|
|
9
|
+
}: {
|
|
10
|
+
clickEvent: (e?: React.MouseEvent<HTMLButtonElement>) => void;
|
|
11
|
+
}) {
|
|
12
|
+
return (
|
|
13
|
+
<button
|
|
14
|
+
type="reset"
|
|
15
|
+
className="input-util-item"
|
|
16
|
+
onClick={clickEvent}
|
|
17
|
+
tabIndex={-1}
|
|
18
|
+
>
|
|
19
|
+
<figure>
|
|
20
|
+
<Reset />
|
|
21
|
+
</figure>
|
|
22
|
+
</button>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
4
|
+
import { createPortal } from "react-dom";
|
|
5
|
+
import { useAtomValue } from "jotai";
|
|
6
|
+
import { Controller, useFormContext } from "react-hook-form";
|
|
7
|
+
import flatpickr from "flatpickr";
|
|
8
|
+
import DateTimePicker from "react-flatpickr";
|
|
9
|
+
import { Korean } from "flatpickr/dist/l10n/ko";
|
|
10
|
+
import { Japanese } from "flatpickr/dist/l10n/ja";
|
|
11
|
+
|
|
12
|
+
import type { InputDateTimeProps } from "../../../../../types";
|
|
13
|
+
import { systemLocaleState } from "@uniai-fe/i18n/jotai";
|
|
14
|
+
import { dateFormat, isValidDateType } from "@uniai-fe/util-functions";
|
|
15
|
+
import StyledInputBase from "../../../styles/styled-components/base";
|
|
16
|
+
import CustomButtonContainer from "./custom/ButtonContainer";
|
|
17
|
+
|
|
18
|
+
export default function CustomDatePicker({
|
|
19
|
+
selectorId,
|
|
20
|
+
dataKey,
|
|
21
|
+
label,
|
|
22
|
+
attr,
|
|
23
|
+
state,
|
|
24
|
+
register,
|
|
25
|
+
width,
|
|
26
|
+
updateIsOpenCalendar,
|
|
27
|
+
flatpickrOptions = {},
|
|
28
|
+
flatpickrCustomButtons,
|
|
29
|
+
preventChangeDatePicker,
|
|
30
|
+
onChangeDatePicker,
|
|
31
|
+
dateValidOptions,
|
|
32
|
+
errorMonitor,
|
|
33
|
+
formError,
|
|
34
|
+
}: InputDateTimeProps) {
|
|
35
|
+
const locale = useAtomValue(systemLocaleState) || "ko";
|
|
36
|
+
|
|
37
|
+
const flatPickrRef = useRef<DateTimePicker | null>(null);
|
|
38
|
+
|
|
39
|
+
const styledOptions = useMemo(
|
|
40
|
+
() => ({
|
|
41
|
+
$width: width,
|
|
42
|
+
$icon: true,
|
|
43
|
+
}),
|
|
44
|
+
[width],
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
const attrs = {
|
|
48
|
+
id: selectorId,
|
|
49
|
+
"aria-label": `${label.name} 날짜 입력`,
|
|
50
|
+
"table-cell": attr?.isTableCell ? "true" : "false",
|
|
51
|
+
};
|
|
52
|
+
if (typeof attr?.origin !== "undefined")
|
|
53
|
+
Object.assign(attrs, { ...attr.origin });
|
|
54
|
+
|
|
55
|
+
const [selectDate, setSelectDate] = useState<Date | string>("");
|
|
56
|
+
const isReadonly = useMemo(
|
|
57
|
+
(): boolean => ["readonly", "disabled"].includes(state?.fixed || ""),
|
|
58
|
+
[state?.fixed],
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
const formMethods = useFormContext();
|
|
62
|
+
|
|
63
|
+
// 날짜를 범위지정 하는 경우
|
|
64
|
+
const isRange = useMemo(
|
|
65
|
+
() => flatpickrOptions.mode === "range",
|
|
66
|
+
[flatpickrOptions.mode],
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
const options = useMemo(
|
|
70
|
+
(): flatpickr.Options.Options => ({
|
|
71
|
+
clickOpens: !isReadonly,
|
|
72
|
+
altFormat: "Y. m. d.",
|
|
73
|
+
dateFormat: "Y. m. d.",
|
|
74
|
+
monthSelectorType: "static",
|
|
75
|
+
time_24hr: true,
|
|
76
|
+
locale: locale === "jp" ? Japanese : locale === "ko" ? Korean : "en", // 언어 변경에 따른 달력 설정 업데이트
|
|
77
|
+
...flatpickrOptions,
|
|
78
|
+
}),
|
|
79
|
+
[flatpickrOptions, isReadonly, locale],
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
// 에러 모니터링
|
|
83
|
+
useEffect(() => {
|
|
84
|
+
if (typeof errorMonitor !== "undefined")
|
|
85
|
+
errorMonitor({ inputKey: dataKey });
|
|
86
|
+
}, [errorMonitor, dataKey, selectDate, formError]);
|
|
87
|
+
|
|
88
|
+
const registerName = useMemo(
|
|
89
|
+
() => (register?.name ? register.name : dataKey),
|
|
90
|
+
[dataKey, register?.name],
|
|
91
|
+
);
|
|
92
|
+
// console.log(`[${registerName}] options`, options);
|
|
93
|
+
|
|
94
|
+
return (
|
|
95
|
+
<>
|
|
96
|
+
{typeof formMethods?.control !== "undefined" ? (
|
|
97
|
+
<Controller
|
|
98
|
+
name={registerName}
|
|
99
|
+
control={formMethods.control}
|
|
100
|
+
rules={dateValidOptions}
|
|
101
|
+
render={({ field: { onChange, ...fieldProps } }) => (
|
|
102
|
+
<StyledInputBase.box
|
|
103
|
+
{...styledOptions}
|
|
104
|
+
as={DateTimePicker}
|
|
105
|
+
{...fieldProps}
|
|
106
|
+
ref={flatPickrRef}
|
|
107
|
+
{...attrs}
|
|
108
|
+
options={options}
|
|
109
|
+
disabled={isReadonly}
|
|
110
|
+
readOnly={isReadonly}
|
|
111
|
+
onOpen={() => {
|
|
112
|
+
if (typeof updateIsOpenCalendar !== "undefined")
|
|
113
|
+
updateIsOpenCalendar(true);
|
|
114
|
+
}}
|
|
115
|
+
onClose={() => {
|
|
116
|
+
if (typeof updateIsOpenCalendar !== "undefined")
|
|
117
|
+
updateIsOpenCalendar(false);
|
|
118
|
+
}}
|
|
119
|
+
onChange={(selectedDates, ...props) => {
|
|
120
|
+
if (typeof onChangeDatePicker !== "undefined") {
|
|
121
|
+
onChangeDatePicker(selectedDates, ...props);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if (!preventChangeDatePicker) {
|
|
125
|
+
const updateDate = isRange
|
|
126
|
+
? `${dateFormat(selectedDates[0])} ~ ${
|
|
127
|
+
isValidDateType(selectedDates[1])
|
|
128
|
+
? dateFormat(selectedDates[1])
|
|
129
|
+
: "----.--.--."
|
|
130
|
+
}`
|
|
131
|
+
: selectedDates[0];
|
|
132
|
+
|
|
133
|
+
setSelectDate(updateDate);
|
|
134
|
+
onChange(
|
|
135
|
+
isRange ? selectedDates : selectedDates[0],
|
|
136
|
+
...props,
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
}}
|
|
140
|
+
/>
|
|
141
|
+
)}
|
|
142
|
+
/>
|
|
143
|
+
) : (
|
|
144
|
+
<StyledInputBase.box
|
|
145
|
+
as={DateTimePicker}
|
|
146
|
+
{...styledOptions}
|
|
147
|
+
ref={flatPickrRef}
|
|
148
|
+
{...attrs}
|
|
149
|
+
options={options}
|
|
150
|
+
readOnly={isReadonly}
|
|
151
|
+
disabled={isReadonly}
|
|
152
|
+
onOpen={() => {
|
|
153
|
+
if (typeof updateIsOpenCalendar !== "undefined")
|
|
154
|
+
updateIsOpenCalendar(true);
|
|
155
|
+
}}
|
|
156
|
+
onClose={() => {
|
|
157
|
+
if (typeof updateIsOpenCalendar !== "undefined")
|
|
158
|
+
updateIsOpenCalendar(false);
|
|
159
|
+
}}
|
|
160
|
+
onChange={(selectedDates, ...props) => {
|
|
161
|
+
if (typeof onChangeDatePicker !== "undefined") {
|
|
162
|
+
onChangeDatePicker(selectedDates, ...props);
|
|
163
|
+
}
|
|
164
|
+
const updateDate = isRange
|
|
165
|
+
? `${dateFormat(selectedDates[0])} ~ ${dateFormat(selectedDates[1])}`
|
|
166
|
+
: selectedDates[0];
|
|
167
|
+
|
|
168
|
+
setSelectDate(updateDate);
|
|
169
|
+
}}
|
|
170
|
+
/>
|
|
171
|
+
)}
|
|
172
|
+
{flatpickrCustomButtons &&
|
|
173
|
+
flatpickrCustomButtons instanceof HTMLElement &&
|
|
174
|
+
flatPickrRef.current &&
|
|
175
|
+
flatPickrRef.current.flatpickr?.calendarContainer &&
|
|
176
|
+
createPortal(
|
|
177
|
+
<CustomButtonContainer>
|
|
178
|
+
{flatpickrCustomButtons(flatPickrRef.current.flatpickr)}
|
|
179
|
+
</CustomButtonContainer>,
|
|
180
|
+
flatPickrRef.current.flatpickr.calendarContainer,
|
|
181
|
+
)}
|
|
182
|
+
</>
|
|
183
|
+
);
|
|
184
|
+
}
|