@ncds/ui-admin 1.3.0 → 1.4.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/dist/cjs/assets/scripts/comboBox.js +262 -0
- package/dist/cjs/assets/scripts/datePicker.js +178 -60
- package/dist/cjs/assets/scripts/featuredIcon.js +95 -0
- package/dist/cjs/assets/scripts/fileInput/FileInput.js +183 -0
- package/dist/cjs/assets/scripts/fileInput/FileInputModel.js +246 -0
- package/dist/cjs/assets/scripts/fileInput/FileInputView.js +455 -0
- package/dist/cjs/assets/scripts/fileInput/const/classNames.js +35 -0
- package/dist/cjs/assets/scripts/fileInput/const/index.js +27 -0
- package/dist/cjs/assets/scripts/fileInput/const/types.js +13 -0
- package/dist/cjs/assets/scripts/fileInput/index.js +44 -0
- package/dist/cjs/assets/scripts/imageFileInput/ImageFileInput.js +187 -0
- package/dist/cjs/assets/scripts/imageFileInput/ImageFileInputModel.js +268 -0
- package/dist/cjs/assets/scripts/imageFileInput/ImageFileInputView.js +354 -0
- package/dist/cjs/assets/scripts/imageFileInput/const/classNames.js +41 -0
- package/dist/cjs/assets/scripts/imageFileInput/const/index.js +27 -0
- package/dist/cjs/assets/scripts/imageFileInput/const/types.js +13 -0
- package/dist/cjs/assets/scripts/imageFileInput/index.js +44 -0
- package/dist/cjs/assets/scripts/index.js +21 -1
- package/dist/cjs/assets/scripts/modal/Modal.js +116 -0
- package/dist/cjs/assets/scripts/modal/ModalActions.js +128 -0
- package/dist/cjs/assets/scripts/modal/ModalContent.js +46 -0
- package/dist/cjs/assets/scripts/modal/ModalHeader.js +115 -0
- package/dist/cjs/assets/scripts/modal/const/classNames.js +41 -0
- package/dist/cjs/assets/scripts/modal/const/index.js +27 -0
- package/dist/cjs/assets/scripts/modal/const/types.js +5 -0
- package/dist/cjs/assets/scripts/modal/index.js +61 -0
- package/dist/cjs/assets/scripts/modal/utils/contentUtils.js +35 -0
- package/dist/cjs/assets/scripts/notification/FloatingNotification.js +180 -0
- package/dist/cjs/assets/scripts/notification/FullWidthNotification.js +120 -0
- package/dist/cjs/assets/scripts/notification/Notification.js +113 -0
- package/dist/cjs/assets/scripts/notification/const/classNames.js +36 -0
- package/dist/cjs/assets/scripts/notification/const/icons.js +45 -0
- package/dist/cjs/assets/scripts/notification/const/index.js +74 -0
- package/dist/cjs/assets/scripts/notification/const/sizes.js +48 -0
- package/dist/cjs/assets/scripts/notification/const/types.js +5 -0
- package/dist/cjs/assets/scripts/notification/index.js +84 -0
- package/dist/cjs/assets/scripts/notification/utils.js +92 -0
- package/dist/cjs/assets/scripts/progress-bar/ProgressBar.js +272 -0
- package/dist/cjs/assets/scripts/progress-bar/index.js +12 -0
- package/dist/cjs/assets/scripts/selectBox.js +319 -0
- package/dist/cjs/assets/scripts/shared/ButtonCloseX.js +46 -0
- package/dist/cjs/assets/scripts/tag/Tag.js +268 -0
- package/dist/cjs/assets/scripts/tag/const/classNames.js +24 -0
- package/dist/cjs/assets/scripts/tag/const/index.js +38 -0
- package/dist/cjs/assets/scripts/tag/const/sizes.js +13 -0
- package/dist/cjs/assets/scripts/tag/const/types.js +5 -0
- package/dist/cjs/assets/scripts/tag/index.js +44 -0
- package/dist/cjs/assets/scripts/tooltip/Tooltip.js +380 -0
- package/dist/cjs/assets/scripts/tooltip/TooltipLayerManager.js +84 -0
- package/dist/cjs/assets/scripts/tooltip/const/classNames.js +29 -0
- package/dist/cjs/assets/scripts/tooltip/const/constants.js +56 -0
- package/dist/cjs/assets/scripts/tooltip/const/icons.js +15 -0
- package/dist/cjs/assets/scripts/tooltip/const/index.js +123 -0
- package/dist/cjs/assets/scripts/tooltip/const/templates.js +49 -0
- package/dist/cjs/assets/scripts/tooltip/const/types.js +5 -0
- package/dist/cjs/assets/scripts/tooltip/index.js +57 -0
- package/dist/cjs/assets/scripts/tooltip/utils.js +41 -0
- package/dist/cjs/assets/scripts/utils/selectbox/DOMRenderer.js +384 -0
- package/dist/cjs/assets/scripts/utils/selectbox/DropdownModel.js +361 -0
- package/dist/cjs/assets/scripts/utils/selectbox/SelectBoxController.js +681 -0
- package/dist/cjs/assets/scripts/utils/selectbox/UnifiedSelectBox.js +677 -0
- package/dist/cjs/constant/color.js +2 -0
- package/dist/cjs/src/components/button/Button.js +9 -35
- package/dist/cjs/src/components/button/ButtonGroup.js +9 -10
- package/dist/cjs/src/components/checkbox/Checkbox.js +20 -19
- package/dist/cjs/src/components/checkbox/CheckboxInput.js +22 -45
- package/dist/cjs/src/components/combobox/ComboBox.js +337 -0
- package/dist/cjs/src/components/combobox/index.js +12 -0
- package/dist/cjs/src/components/date-picker/CustomInput.js +52 -0
- package/dist/cjs/src/components/date-picker/DatePicker.js +86 -23
- package/dist/cjs/src/components/date-picker/RangeDatePicker.js +1 -1
- package/dist/cjs/src/components/{input → file-upload}/FileInput.js +17 -9
- package/dist/cjs/src/components/file-upload/index.js +16 -0
- package/dist/cjs/src/components/image-file-input/ImageFileInput.js +263 -0
- package/dist/cjs/src/components/image-file-input/components/ImagePreview.js +44 -0
- package/dist/cjs/src/components/image-file-input/index.js +16 -0
- package/dist/cjs/src/components/index.js +44 -0
- package/dist/cjs/src/components/input/InputBase.js +54 -10
- package/dist/cjs/src/components/input/Textarea.js +12 -20
- package/dist/cjs/src/components/input/index.js +0 -11
- package/dist/cjs/src/components/modal/Modal.js +7 -3
- package/dist/cjs/src/components/notification/FloatingNotification.js +34 -3
- package/dist/cjs/src/components/notification/FullWidthNotification.js +54 -5
- package/dist/cjs/src/components/pagination/NavButton.js +1 -13
- package/dist/cjs/src/components/pagination/Pagination.js +6 -20
- package/dist/cjs/src/components/progress-bar/ProgressBar.js +89 -20
- package/dist/cjs/src/components/progress-bar/components/SegmentBar.js +25 -0
- package/dist/cjs/src/components/progress-bar/components/SegmentLabels.js +74 -0
- package/dist/cjs/src/components/progress-bar/hooks/useProgressBar.js +119 -0
- package/dist/cjs/src/components/progress-bar/index.js +11 -0
- package/dist/cjs/src/components/progress-bar/types.js +5 -0
- package/dist/cjs/src/components/progress-bar/utils.js +31 -0
- package/dist/cjs/src/components/radio/Radio.js +5 -6
- package/dist/cjs/src/components/select/Select.js +7 -4
- package/dist/cjs/src/components/select-dropdown/SelectDropdown.js +146 -0
- package/dist/cjs/src/components/select-dropdown/index.js +12 -0
- package/dist/cjs/src/components/selectbox/SelectBox.js +283 -0
- package/dist/cjs/src/components/selectbox/index.js +12 -0
- package/dist/cjs/src/components/shared/hintText/HintText.js +1 -1
- package/dist/cjs/src/components/switch/Switch.js +123 -0
- package/dist/cjs/src/components/switch/index.js +12 -0
- package/dist/cjs/src/components/tab/HorizontalTab.js +8 -20
- package/dist/cjs/src/components/tab/TabButton.js +33 -16
- package/dist/cjs/src/components/tab/VerticalTab.js +15 -30
- package/dist/cjs/src/components/tag/Tag.js +92 -3
- package/dist/cjs/src/components/tooltip/Tooltip.js +125 -28
- package/dist/cjs/src/hooks/dropdown/index.js +47 -0
- package/dist/cjs/src/hooks/dropdown/useDropdown.js +109 -0
- package/dist/cjs/src/hooks/dropdown/useDropdownKeyboard.js +131 -0
- package/dist/cjs/src/hooks/dropdown/useDropdownPosition.js +27 -0
- package/dist/cjs/src/hooks/dropdown/useOutsideClick.js +33 -0
- package/dist/cjs/src/hooks/dropdown/useScrollLock.js +78 -0
- package/dist/cjs/src/hooks/dropdown/useWindowResize.js +52 -0
- package/dist/cjs/src/hooks/index.js +18 -1
- package/dist/cjs/src/types/dropdown/dropdown.js +5 -0
- package/dist/cjs/src/types/dropdown/index.js +27 -0
- package/dist/cjs/src/types/dropdown/option.js +5 -0
- package/dist/cjs/src/types/index.js +16 -0
- package/dist/cjs/src/utils/date-picker.js +37 -1
- package/dist/cjs/src/utils/dropdown/dropdownUtils.js +107 -0
- package/dist/cjs/src/utils/dropdown/index.js +27 -0
- package/dist/cjs/src/utils/dropdown/multiSelect.js +100 -0
- package/dist/cjs/src/utils/index.js +27 -0
- package/dist/esm/assets/scripts/comboBox.js +257 -0
- package/dist/esm/assets/scripts/datePicker.js +175 -59
- package/dist/esm/assets/scripts/featuredIcon.js +90 -0
- package/dist/esm/assets/scripts/fileInput/FileInput.js +178 -0
- package/dist/esm/assets/scripts/fileInput/FileInputModel.js +241 -0
- package/dist/esm/assets/scripts/fileInput/FileInputView.js +450 -0
- package/dist/esm/assets/scripts/fileInput/const/classNames.js +25 -0
- package/dist/esm/assets/scripts/fileInput/const/index.js +2 -0
- package/dist/esm/assets/scripts/fileInput/const/types.js +7 -0
- package/dist/esm/assets/scripts/fileInput/index.js +9 -0
- package/dist/esm/assets/scripts/imageFileInput/ImageFileInput.js +182 -0
- package/dist/esm/assets/scripts/imageFileInput/ImageFileInputModel.js +263 -0
- package/dist/esm/assets/scripts/imageFileInput/ImageFileInputView.js +349 -0
- package/dist/esm/assets/scripts/imageFileInput/const/classNames.js +30 -0
- package/dist/esm/assets/scripts/imageFileInput/const/index.js +2 -0
- package/dist/esm/assets/scripts/imageFileInput/const/types.js +7 -0
- package/dist/esm/assets/scripts/imageFileInput/index.js +9 -0
- package/dist/esm/assets/scripts/index.js +21 -1
- package/dist/esm/assets/scripts/modal/Modal.js +110 -0
- package/dist/esm/assets/scripts/modal/ModalActions.js +123 -0
- package/dist/esm/assets/scripts/modal/ModalContent.js +41 -0
- package/dist/esm/assets/scripts/modal/ModalHeader.js +110 -0
- package/dist/esm/assets/scripts/modal/const/classNames.js +31 -0
- package/dist/esm/assets/scripts/modal/const/index.js +2 -0
- package/dist/esm/assets/scripts/modal/const/types.js +1 -0
- package/dist/esm/assets/scripts/modal/index.js +15 -0
- package/dist/esm/assets/scripts/modal/utils/contentUtils.js +28 -0
- package/dist/esm/assets/scripts/notification/FloatingNotification.js +176 -0
- package/dist/esm/assets/scripts/notification/FullWidthNotification.js +115 -0
- package/dist/esm/assets/scripts/notification/Notification.js +108 -0
- package/dist/esm/assets/scripts/notification/const/classNames.js +30 -0
- package/dist/esm/assets/scripts/notification/const/icons.js +39 -0
- package/dist/esm/assets/scripts/notification/const/index.js +3 -0
- package/dist/esm/assets/scripts/notification/const/sizes.js +42 -0
- package/dist/esm/assets/scripts/notification/const/types.js +1 -0
- package/dist/esm/assets/scripts/notification/index.js +10 -0
- package/dist/esm/assets/scripts/notification/utils.js +79 -0
- package/dist/esm/assets/scripts/progress-bar/ProgressBar.js +267 -0
- package/dist/esm/assets/scripts/progress-bar/index.js +1 -0
- package/dist/esm/assets/scripts/selectBox.js +314 -0
- package/dist/esm/assets/scripts/shared/ButtonCloseX.js +38 -0
- package/dist/esm/assets/scripts/tag/Tag.js +263 -0
- package/dist/esm/assets/scripts/tag/const/classNames.js +16 -0
- package/dist/esm/assets/scripts/tag/const/index.js +3 -0
- package/dist/esm/assets/scripts/tag/const/sizes.js +7 -0
- package/dist/esm/assets/scripts/tag/const/types.js +1 -0
- package/dist/esm/assets/scripts/tag/index.js +9 -0
- package/dist/esm/assets/scripts/tooltip/Tooltip.js +375 -0
- package/dist/esm/assets/scripts/tooltip/TooltipLayerManager.js +79 -0
- package/dist/esm/assets/scripts/tooltip/const/classNames.js +23 -0
- package/dist/esm/assets/scripts/tooltip/const/constants.js +50 -0
- package/dist/esm/assets/scripts/tooltip/const/icons.js +9 -0
- package/dist/esm/assets/scripts/tooltip/const/index.js +4 -0
- package/dist/esm/assets/scripts/tooltip/const/templates.js +42 -0
- package/dist/esm/assets/scripts/tooltip/const/types.js +1 -0
- package/dist/esm/assets/scripts/tooltip/index.js +10 -0
- package/dist/esm/assets/scripts/tooltip/utils.js +35 -0
- package/dist/esm/assets/scripts/utils/selectbox/DOMRenderer.js +379 -0
- package/dist/esm/assets/scripts/utils/selectbox/DropdownModel.js +356 -0
- package/dist/esm/assets/scripts/utils/selectbox/SelectBoxController.js +676 -0
- package/dist/esm/assets/scripts/utils/selectbox/UnifiedSelectBox.js +672 -0
- package/dist/esm/constant/color.js +2 -0
- package/dist/esm/src/components/button/Button.js +10 -36
- package/dist/esm/src/components/button/ButtonGroup.js +9 -10
- package/dist/esm/src/components/checkbox/Checkbox.js +21 -19
- package/dist/esm/src/components/checkbox/CheckboxInput.js +24 -47
- package/dist/esm/src/components/combobox/ComboBox.js +330 -0
- package/dist/esm/src/components/combobox/index.js +1 -0
- package/dist/esm/src/components/date-picker/CustomInput.js +45 -0
- package/dist/esm/src/components/date-picker/DatePicker.js +87 -24
- package/dist/esm/src/components/date-picker/RangeDatePicker.js +1 -1
- package/dist/esm/src/components/{input → file-upload}/FileInput.js +17 -9
- package/dist/esm/src/components/file-upload/index.js +1 -0
- package/dist/esm/src/components/image-file-input/ImageFileInput.js +256 -0
- package/dist/esm/src/components/image-file-input/components/ImagePreview.js +37 -0
- package/dist/esm/src/components/image-file-input/index.js +1 -0
- package/dist/esm/src/components/index.js +4 -0
- package/dist/esm/src/components/input/InputBase.js +55 -11
- package/dist/esm/src/components/input/Textarea.js +12 -20
- package/dist/esm/src/components/input/index.js +1 -2
- package/dist/esm/src/components/modal/Modal.js +7 -3
- package/dist/esm/src/components/notification/FloatingNotification.js +35 -4
- package/dist/esm/src/components/notification/FullWidthNotification.js +55 -6
- package/dist/esm/src/components/pagination/NavButton.js +1 -13
- package/dist/esm/src/components/pagination/Pagination.js +6 -20
- package/dist/esm/src/components/progress-bar/ProgressBar.js +89 -20
- package/dist/esm/src/components/progress-bar/components/SegmentBar.js +18 -0
- package/dist/esm/src/components/progress-bar/components/SegmentLabels.js +66 -0
- package/dist/esm/src/components/progress-bar/hooks/useProgressBar.js +112 -0
- package/dist/esm/src/components/progress-bar/index.js +2 -1
- package/dist/esm/src/components/progress-bar/types.js +1 -0
- package/dist/esm/src/components/progress-bar/utils.js +22 -0
- package/dist/esm/src/components/radio/Radio.js +5 -5
- package/dist/esm/src/components/select/Select.js +7 -4
- package/dist/esm/src/components/select-dropdown/SelectDropdown.js +139 -0
- package/dist/esm/src/components/select-dropdown/index.js +1 -0
- package/dist/esm/src/components/selectbox/SelectBox.js +276 -0
- package/dist/esm/src/components/selectbox/index.js +1 -0
- package/dist/esm/src/components/shared/hintText/HintText.js +1 -1
- package/dist/esm/src/components/switch/Switch.js +116 -0
- package/dist/esm/src/components/switch/index.js +1 -0
- package/dist/esm/src/components/tab/HorizontalTab.js +7 -19
- package/dist/esm/src/components/tab/TabButton.js +34 -17
- package/dist/esm/src/components/tab/VerticalTab.js +15 -30
- package/dist/esm/src/components/tag/Tag.js +92 -3
- package/dist/esm/src/components/tooltip/Tooltip.js +125 -28
- package/dist/esm/src/hooks/dropdown/index.js +6 -0
- package/dist/esm/src/hooks/dropdown/useDropdown.js +102 -0
- package/dist/esm/src/hooks/dropdown/useDropdownKeyboard.js +124 -0
- package/dist/esm/src/hooks/dropdown/useDropdownPosition.js +20 -0
- package/dist/esm/src/hooks/dropdown/useOutsideClick.js +26 -0
- package/dist/esm/src/hooks/dropdown/useScrollLock.js +71 -0
- package/dist/esm/src/hooks/dropdown/useWindowResize.js +45 -0
- package/dist/esm/src/hooks/index.js +4 -1
- package/dist/esm/src/types/dropdown/dropdown.js +1 -0
- package/dist/esm/src/types/dropdown/index.js +2 -0
- package/dist/esm/src/types/dropdown/option.js +1 -0
- package/dist/esm/src/types/index.js +2 -0
- package/dist/esm/src/utils/date-picker.js +33 -1
- package/dist/esm/src/utils/dropdown/dropdownUtils.js +97 -0
- package/dist/esm/src/utils/dropdown/index.js +2 -0
- package/dist/esm/src/utils/dropdown/multiSelect.js +88 -0
- package/dist/esm/src/utils/index.js +4 -0
- package/dist/types/assets/scripts/comboBox.d.ts +79 -0
- package/dist/types/assets/scripts/datePicker.d.ts +16 -13
- package/dist/types/assets/scripts/featuredIcon.d.ts +23 -0
- package/dist/types/assets/scripts/fileInput/FileInput.d.ts +67 -0
- package/dist/types/assets/scripts/fileInput/FileInputModel.d.ts +70 -0
- package/dist/types/assets/scripts/fileInput/FileInputView.d.ts +77 -0
- package/dist/types/assets/scripts/fileInput/const/classNames.d.ts +17 -0
- package/dist/types/assets/scripts/fileInput/const/index.d.ts +3 -0
- package/dist/types/assets/scripts/fileInput/const/types.d.ts +132 -0
- package/dist/types/assets/scripts/fileInput/index.d.ts +4 -0
- package/dist/types/assets/scripts/imageFileInput/ImageFileInput.d.ts +64 -0
- package/dist/types/assets/scripts/imageFileInput/ImageFileInputModel.d.ts +74 -0
- package/dist/types/assets/scripts/imageFileInput/ImageFileInputView.d.ts +80 -0
- package/dist/types/assets/scripts/imageFileInput/const/classNames.d.ts +20 -0
- package/dist/types/assets/scripts/imageFileInput/const/index.d.ts +3 -0
- package/dist/types/assets/scripts/imageFileInput/const/types.d.ts +126 -0
- package/dist/types/assets/scripts/imageFileInput/index.d.ts +4 -0
- package/dist/types/assets/scripts/index.d.ts +28 -2
- package/dist/types/assets/scripts/modal/Modal.d.ts +28 -0
- package/dist/types/assets/scripts/modal/ModalActions.d.ts +19 -0
- package/dist/types/assets/scripts/modal/ModalContent.d.ts +14 -0
- package/dist/types/assets/scripts/modal/ModalHeader.d.ts +16 -0
- package/dist/types/assets/scripts/modal/const/classNames.d.ts +23 -0
- package/dist/types/assets/scripts/modal/const/index.d.ts +3 -0
- package/dist/types/assets/scripts/modal/const/types.d.ts +62 -0
- package/dist/types/assets/scripts/modal/index.d.ts +8 -0
- package/dist/types/assets/scripts/modal/utils/contentUtils.d.ts +11 -0
- package/dist/types/assets/scripts/notification/FloatingNotification.d.ts +25 -0
- package/dist/types/assets/scripts/notification/FullWidthNotification.d.ts +22 -0
- package/dist/types/assets/scripts/notification/Notification.d.ts +22 -0
- package/dist/types/assets/scripts/notification/const/classNames.d.ts +30 -0
- package/dist/types/assets/scripts/notification/const/icons.d.ts +26 -0
- package/dist/types/assets/scripts/notification/const/index.d.ts +5 -0
- package/dist/types/assets/scripts/notification/const/sizes.d.ts +28 -0
- package/dist/types/assets/scripts/notification/const/types.d.ts +19 -0
- package/dist/types/assets/scripts/notification/index.d.ts +7 -0
- package/dist/types/assets/scripts/notification/utils.d.ts +9 -0
- package/dist/types/assets/scripts/progress-bar/ProgressBar.d.ts +68 -0
- package/dist/types/assets/scripts/progress-bar/index.d.ts +2 -0
- package/dist/types/assets/scripts/selectBox.d.ts +77 -0
- package/dist/types/assets/scripts/shared/ButtonCloseX.d.ts +6 -0
- package/dist/types/assets/scripts/tag/Tag.d.ts +28 -0
- package/dist/types/assets/scripts/tag/const/classNames.d.ts +12 -0
- package/dist/types/assets/scripts/tag/const/index.d.ts +4 -0
- package/dist/types/assets/scripts/tag/const/sizes.d.ts +8 -0
- package/dist/types/assets/scripts/tag/const/types.d.ts +34 -0
- package/dist/types/assets/scripts/tag/index.d.ts +4 -0
- package/dist/types/assets/scripts/tooltip/Tooltip.d.ts +55 -0
- package/dist/types/assets/scripts/tooltip/TooltipLayerManager.d.ts +22 -0
- package/dist/types/assets/scripts/tooltip/const/classNames.d.ts +18 -0
- package/dist/types/assets/scripts/tooltip/const/constants.d.ts +34 -0
- package/dist/types/assets/scripts/tooltip/const/icons.d.ts +5 -0
- package/dist/types/assets/scripts/tooltip/const/index.d.ts +6 -0
- package/dist/types/assets/scripts/tooltip/const/templates.d.ts +17 -0
- package/dist/types/assets/scripts/tooltip/const/types.d.ts +15 -0
- package/dist/types/assets/scripts/tooltip/index.d.ts +7 -0
- package/dist/types/assets/scripts/tooltip/utils.d.ts +3 -0
- package/dist/types/assets/scripts/utils/selectbox/DOMRenderer.d.ts +108 -0
- package/dist/types/assets/scripts/utils/selectbox/DropdownModel.d.ts +154 -0
- package/dist/types/assets/scripts/utils/selectbox/SelectBoxController.d.ts +171 -0
- package/dist/types/assets/scripts/utils/selectbox/UnifiedSelectBox.d.ts +80 -0
- package/dist/types/constant/color.d.ts +3 -1
- package/dist/types/src/components/button/Button.d.ts +14 -12
- package/dist/types/src/components/button/ButtonGroup.d.ts +4 -289
- package/dist/types/src/components/checkbox/Checkbox.d.ts +2 -3
- package/dist/types/src/components/combobox/ComboBox.d.ts +28 -0
- package/dist/types/src/components/combobox/index.d.ts +3 -0
- package/dist/types/src/components/date-picker/CustomInput.d.ts +12 -0
- package/dist/types/src/components/date-picker/DatePicker.d.ts +2 -0
- package/dist/types/src/components/{input → file-upload}/FileInput.d.ts +1 -1
- package/dist/types/src/components/file-upload/index.d.ts +2 -0
- package/dist/types/src/components/image-file-input/ImageFileInput.d.ts +78 -0
- package/dist/types/src/components/image-file-input/components/ImagePreview.d.ts +6 -0
- package/dist/types/src/components/image-file-input/index.d.ts +2 -0
- package/dist/types/src/components/index.d.ts +4 -0
- package/dist/types/src/components/input/InputBase.d.ts +2 -0
- package/dist/types/src/components/input/index.d.ts +0 -1
- package/dist/types/src/components/modal/Modal.d.ts +3 -2
- package/dist/types/src/components/notification/FloatingNotification.d.ts +5 -0
- package/dist/types/src/components/notification/FullWidthNotification.d.ts +15 -1
- package/dist/types/src/components/notification/Notification.d.ts +8 -2
- package/dist/types/src/components/pagination/NavButton.d.ts +1 -4
- package/dist/types/src/components/pagination/Pagination.d.ts +2 -13
- package/dist/types/src/components/progress-bar/ProgressBar.d.ts +2 -6
- package/dist/types/src/components/progress-bar/components/SegmentBar.d.ts +8 -0
- package/dist/types/src/components/progress-bar/components/SegmentLabels.d.ts +16 -0
- package/dist/types/src/components/progress-bar/hooks/useProgressBar.d.ts +14 -0
- package/dist/types/src/components/progress-bar/index.d.ts +1 -0
- package/dist/types/src/components/progress-bar/types.d.ts +16 -0
- package/dist/types/src/components/progress-bar/utils.d.ts +13 -0
- package/dist/types/src/components/radio/Radio.d.ts +2 -3
- package/dist/types/src/components/select/Select.d.ts +1 -4
- package/dist/types/src/components/select-dropdown/SelectDropdown.d.ts +28 -0
- package/dist/types/src/components/select-dropdown/index.d.ts +2 -0
- package/dist/types/src/components/selectbox/SelectBox.d.ts +25 -0
- package/dist/types/src/components/selectbox/index.d.ts +2 -0
- package/dist/types/src/components/switch/Switch.d.ts +22 -0
- package/dist/types/src/components/switch/index.d.ts +3 -0
- package/dist/types/src/components/tab/HorizontalTab.d.ts +1 -2
- package/dist/types/src/components/tab/TabButton.d.ts +9 -12
- package/dist/types/src/components/tab/VerticalTab.d.ts +2 -2
- package/dist/types/src/components/tag/Tag.d.ts +3 -1
- package/dist/types/src/components/tooltip/Tooltip.d.ts +4 -2
- package/dist/types/src/hooks/dropdown/index.d.ts +7 -0
- package/dist/types/src/hooks/dropdown/useDropdown.d.ts +30 -0
- package/dist/types/src/hooks/dropdown/useDropdownKeyboard.d.ts +11 -0
- package/dist/types/src/hooks/dropdown/useDropdownPosition.d.ts +10 -0
- package/dist/types/src/hooks/dropdown/useOutsideClick.d.ts +6 -0
- package/dist/types/src/hooks/dropdown/useScrollLock.d.ts +5 -0
- package/dist/types/src/hooks/dropdown/useWindowResize.d.ts +8 -0
- package/dist/types/src/hooks/index.d.ts +2 -1
- package/dist/types/src/types/dropdown/dropdown.d.ts +40 -0
- package/dist/types/src/types/dropdown/index.d.ts +3 -0
- package/dist/types/src/types/dropdown/option.d.ts +20 -0
- package/dist/types/src/types/index.d.ts +2 -0
- package/dist/types/src/utils/date-picker.d.ts +3 -0
- package/dist/types/src/utils/dropdown/dropdownUtils.d.ts +18 -0
- package/dist/types/src/utils/dropdown/index.d.ts +3 -0
- package/dist/types/src/utils/dropdown/multiSelect.d.ts +32 -0
- package/dist/types/src/utils/index.d.ts +3 -0
- package/dist/ui-admin/assets/styles/style.css +1744 -358
- package/package.json +8 -4
|
@@ -29,11 +29,12 @@ export var Modal = function (_a) {
|
|
|
29
29
|
_b = _a.size,
|
|
30
30
|
size = _b === void 0 ? 'md' : _b,
|
|
31
31
|
_c = _a.closeOnBackdropClick,
|
|
32
|
-
closeOnBackdropClick = _c === void 0 ?
|
|
32
|
+
closeOnBackdropClick = _c === void 0 ? false : _c,
|
|
33
33
|
_d = _a.closeOnEsc,
|
|
34
34
|
closeOnEsc = _d === void 0 ? true : _d,
|
|
35
35
|
className = _a.className,
|
|
36
|
-
|
|
36
|
+
zIndex = _a.zIndex,
|
|
37
|
+
restProps = __rest(_a, ["isOpen", "onClose", "children", "size", "closeOnBackdropClick", "closeOnEsc", "className", "zIndex"]);
|
|
37
38
|
var modalRef = useRef(null);
|
|
38
39
|
var handleBackdropClick = function (e) {
|
|
39
40
|
if (closeOnBackdropClick && e.target === e.currentTarget) {
|
|
@@ -59,7 +60,10 @@ export var Modal = function (_a) {
|
|
|
59
60
|
var modalContent = _jsx("div", __assign({
|
|
60
61
|
className: classnames('ncua-modal-backdrop', className),
|
|
61
62
|
onClick: handleBackdropClick,
|
|
62
|
-
ref: modalRef
|
|
63
|
+
ref: modalRef,
|
|
64
|
+
style: zIndex ? {
|
|
65
|
+
zIndex: zIndex
|
|
66
|
+
} : undefined
|
|
63
67
|
}, restProps, {
|
|
64
68
|
children: _jsx("div", __assign({
|
|
65
69
|
className: classnames('ncua-modal', "ncua-modal--".concat(size))
|
|
@@ -18,7 +18,7 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
18
18
|
};
|
|
19
19
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
20
|
import classNames from 'classnames';
|
|
21
|
-
import { forwardRef } from 'react';
|
|
21
|
+
import { forwardRef, useEffect, useRef, useState } from 'react';
|
|
22
22
|
import { MEDIA_QUERY } from '../../constant/breakpoint';
|
|
23
23
|
import { useMediaQuery } from '../../hooks/useMediaQuery';
|
|
24
24
|
import { Button } from '../button';
|
|
@@ -29,6 +29,7 @@ var iconNameMap = {
|
|
|
29
29
|
error: 'alert-triangle',
|
|
30
30
|
warning: 'alert-circle',
|
|
31
31
|
success: 'check-circle'
|
|
32
|
+
// info는 floating에서는 지원하지 않음
|
|
32
33
|
};
|
|
33
34
|
export var FloatingNotification = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
34
35
|
var title = _a.title,
|
|
@@ -38,10 +39,15 @@ export var FloatingNotification = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
38
39
|
onClose = _a.onClose,
|
|
39
40
|
className = _a.className,
|
|
40
41
|
actions = _a.actions,
|
|
41
|
-
|
|
42
|
+
_c = _a.autoClose,
|
|
43
|
+
autoClose = _c === void 0 ? 0 : _c,
|
|
44
|
+
rest = __rest(_a, ["title", "supportingText", "color", "onClose", "className", "actions", "autoClose"]);
|
|
45
|
+
var _d = useState(false),
|
|
46
|
+
shouldRemove = _d[0],
|
|
47
|
+
setShouldRemove = _d[1];
|
|
42
48
|
var iconColor = color;
|
|
43
49
|
var featuredIconProps = {
|
|
44
|
-
name: iconNameMap[color],
|
|
50
|
+
name: iconNameMap[color] || 'pin-02',
|
|
45
51
|
size: 'sm',
|
|
46
52
|
color: iconColor,
|
|
47
53
|
theme: 'dark-circle'
|
|
@@ -49,6 +55,31 @@ export var FloatingNotification = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
49
55
|
var isMobile = useMediaQuery(MEDIA_QUERY.mobile, {
|
|
50
56
|
onMatched: onClose
|
|
51
57
|
});
|
|
58
|
+
// autoClose 타이머 관리
|
|
59
|
+
var timerRef = useRef(null);
|
|
60
|
+
useEffect(function () {
|
|
61
|
+
// autoClose가 0보다 크면 무조건 타이머 설정
|
|
62
|
+
if (autoClose > 0) {
|
|
63
|
+
timerRef.current = setTimeout(function () {
|
|
64
|
+
if (onClose) {
|
|
65
|
+
onClose();
|
|
66
|
+
}
|
|
67
|
+
// DOM에서 바로 제거
|
|
68
|
+
setShouldRemove(true);
|
|
69
|
+
}, autoClose);
|
|
70
|
+
}
|
|
71
|
+
// cleanup 함수: 컴포넌트 언마운트 시 타이머 정리
|
|
72
|
+
return function () {
|
|
73
|
+
if (timerRef.current) {
|
|
74
|
+
clearTimeout(timerRef.current);
|
|
75
|
+
timerRef.current = null;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}, [autoClose, onClose]);
|
|
79
|
+
// DOM에서 완전히 제거
|
|
80
|
+
if (shouldRemove) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
52
83
|
return _jsxs("div", __assign({
|
|
53
84
|
ref: ref,
|
|
54
85
|
className: classNames('ncua-floating-notification', "ncua-floating-notification--".concat(color), className),
|
|
@@ -83,7 +114,7 @@ export var FloatingNotification = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
83
114
|
children: actions.map(function (action) {
|
|
84
115
|
return _jsx(Button, {
|
|
85
116
|
size: "xs",
|
|
86
|
-
hierarchy: action.hierarchy || '
|
|
117
|
+
hierarchy: action.hierarchy || 'text',
|
|
87
118
|
label: action.label,
|
|
88
119
|
onClick: action === null || action === void 0 ? void 0 : action.onClick
|
|
89
120
|
}, "".concat(action.label, "-").concat(action.hierarchy));
|
|
@@ -19,19 +19,21 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
19
19
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
20
|
import Icon from '@ncds/ui-admin-icon/dynamic';
|
|
21
21
|
import classNames from 'classnames';
|
|
22
|
-
import { forwardRef } from 'react';
|
|
22
|
+
import { forwardRef, useEffect, useRef, useState } from 'react';
|
|
23
23
|
import { COLOR } from '../../../constant/color';
|
|
24
24
|
var iconNameMap = {
|
|
25
25
|
neutral: 'message-chat-square',
|
|
26
26
|
error: 'alert-triangle',
|
|
27
27
|
warning: 'alert-triangle',
|
|
28
|
-
success: 'check-circle'
|
|
28
|
+
success: 'check-circle',
|
|
29
|
+
info: 'info-circle'
|
|
29
30
|
};
|
|
30
31
|
var iconColorMap = {
|
|
31
32
|
neutral: 'gray700',
|
|
32
33
|
error: 'red500',
|
|
33
34
|
warning: 'orange500',
|
|
34
|
-
success: 'green600'
|
|
35
|
+
success: 'green600',
|
|
36
|
+
info: 'violet600'
|
|
35
37
|
};
|
|
36
38
|
export var FullWidthNotification = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
37
39
|
var title = _a.title,
|
|
@@ -41,11 +43,43 @@ export var FullWidthNotification = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
41
43
|
onClose = _a.onClose,
|
|
42
44
|
className = _a.className,
|
|
43
45
|
actions = _a.actions,
|
|
44
|
-
|
|
46
|
+
_c = _a.autoClose,
|
|
47
|
+
autoClose = _c === void 0 ? 0 : _c,
|
|
48
|
+
supportTextLink = _a.supportTextLink,
|
|
49
|
+
onHidePermanently = _a.onHidePermanently,
|
|
50
|
+
rest = __rest(_a, ["title", "supportingText", "color", "onClose", "className", "actions", "autoClose", "supportTextLink", "onHidePermanently"]);
|
|
51
|
+
var _d = useState(false),
|
|
52
|
+
shouldRemove = _d[0],
|
|
53
|
+
setShouldRemove = _d[1];
|
|
45
54
|
var closeIconSize = {
|
|
46
55
|
width: 20,
|
|
47
56
|
height: 20
|
|
48
57
|
};
|
|
58
|
+
// autoClose 타이머 관리
|
|
59
|
+
var timerRef = useRef(null);
|
|
60
|
+
useEffect(function () {
|
|
61
|
+
// autoClose가 0보다 크면 무조건 타이머 설정
|
|
62
|
+
if (autoClose > 0) {
|
|
63
|
+
timerRef.current = setTimeout(function () {
|
|
64
|
+
if (onClose) {
|
|
65
|
+
onClose();
|
|
66
|
+
}
|
|
67
|
+
// DOM에서 바로 제거
|
|
68
|
+
setShouldRemove(true);
|
|
69
|
+
}, autoClose);
|
|
70
|
+
}
|
|
71
|
+
// cleanup 함수: 컴포넌트 언마운트 시 타이머 정리
|
|
72
|
+
return function () {
|
|
73
|
+
if (timerRef.current) {
|
|
74
|
+
clearTimeout(timerRef.current);
|
|
75
|
+
timerRef.current = null;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}, [autoClose, onClose]);
|
|
79
|
+
// DOM에서 완전히 제거
|
|
80
|
+
if (shouldRemove) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
49
83
|
return _jsx("div", __assign({
|
|
50
84
|
ref: ref,
|
|
51
85
|
className: classNames('ncua-full-width-notification', "ncua-full-width-notification--".concat(color), className),
|
|
@@ -73,10 +107,19 @@ export var FullWidthNotification = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
73
107
|
className: "ncua-full-width-notification__title"
|
|
74
108
|
}, {
|
|
75
109
|
children: title
|
|
76
|
-
})), supportingText && _jsx("span", __assign({
|
|
110
|
+
})), !supportTextLink && supportingText && _jsx("span", __assign({
|
|
77
111
|
className: "ncua-full-width-notification__supporting-text"
|
|
78
112
|
}, {
|
|
79
113
|
children: supportingText
|
|
114
|
+
})), supportTextLink && supportingText && _jsx("a", __assign({
|
|
115
|
+
href: supportTextLink,
|
|
116
|
+
className: "ncua-full-width-notification__link"
|
|
117
|
+
}, {
|
|
118
|
+
children: _jsx("span", __assign({
|
|
119
|
+
className: "ncua-full-width-notification__supporting-text"
|
|
120
|
+
}, {
|
|
121
|
+
children: supportingText
|
|
122
|
+
}))
|
|
80
123
|
}))]
|
|
81
124
|
}))]
|
|
82
125
|
})), _jsxs("div", __assign({
|
|
@@ -88,11 +131,17 @@ export var FullWidthNotification = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
88
131
|
children: actions.map(function (action) {
|
|
89
132
|
return _jsx("button", __assign({
|
|
90
133
|
onClick: action.onClick,
|
|
91
|
-
className: classNames('ncua-notification__action-button', "ncua-notification__action-button--".concat(action.hierarchy || '
|
|
134
|
+
className: classNames('ncua-notification__action-button', "ncua-notification__action-button--".concat(action.hierarchy || 'text'))
|
|
92
135
|
}, {
|
|
93
136
|
children: action.label
|
|
94
137
|
}), "".concat(action.label, "-").concat(action.hierarchy));
|
|
95
138
|
})
|
|
139
|
+
})), onHidePermanently && _jsx("button", __assign({
|
|
140
|
+
type: "button",
|
|
141
|
+
className: classNames('ncua-notification__action-button', 'ncua-notification__action-button--text', 'ncua-full-width-notification__link'),
|
|
142
|
+
onClick: onHidePermanently
|
|
143
|
+
}, {
|
|
144
|
+
children: "\uB2E4\uC2DC\uBCF4\uC9C0 \uC54A\uAE30"
|
|
96
145
|
})), onClose && _jsx("button", __assign({
|
|
97
146
|
type: "button",
|
|
98
147
|
className: "ncua-full-width-notification__close-button",
|
|
@@ -42,12 +42,9 @@ var NAV_BUTTON_CONFIG = {
|
|
|
42
42
|
};
|
|
43
43
|
export var NavButton = function (_a) {
|
|
44
44
|
var type = _a.type,
|
|
45
|
-
as = _a.as,
|
|
46
45
|
breakPoint = _a.breakPoint,
|
|
47
46
|
noPrev = _a.noPrev,
|
|
48
47
|
noNext = _a.noNext,
|
|
49
|
-
href = _a.href,
|
|
50
|
-
target = _a.target,
|
|
51
48
|
onClick = _a.onClick;
|
|
52
49
|
var config = NAV_BUTTON_CONFIG[type];
|
|
53
50
|
var isNavigationButton = type === 'first' || type === 'prev' || type === 'next' || type === 'last';
|
|
@@ -73,14 +70,5 @@ export var NavButton = function (_a) {
|
|
|
73
70
|
};
|
|
74
71
|
// key 값 별도 계산
|
|
75
72
|
var buttonKey = isNavigationButton ? "".concat(breakPoint, "-").concat(type) : undefined;
|
|
76
|
-
|
|
77
|
-
return _jsx(Button, __assign({
|
|
78
|
-
as: "a",
|
|
79
|
-
href: href,
|
|
80
|
-
target: target
|
|
81
|
-
}, buttonProps), buttonKey);
|
|
82
|
-
}
|
|
83
|
-
return _jsx(Button, __assign({
|
|
84
|
-
as: "button"
|
|
85
|
-
}, buttonProps), buttonKey);
|
|
73
|
+
return _jsx(Button, __assign({}, buttonProps), buttonKey);
|
|
86
74
|
};
|
|
@@ -31,16 +31,14 @@ export var Pagination = function (_a) {
|
|
|
31
31
|
_d = _a.pageCount,
|
|
32
32
|
pageCount = _d === void 0 ? 10 : _d,
|
|
33
33
|
currentPage = _a.currentPage,
|
|
34
|
-
_e = _a.
|
|
35
|
-
|
|
36
|
-
_f = _a.breakPoint,
|
|
37
|
-
breakPoint = _f === void 0 ? 'pc' : _f,
|
|
34
|
+
_e = _a.breakPoint,
|
|
35
|
+
breakPoint = _e === void 0 ? 'pc' : _e,
|
|
38
36
|
onPageChange = _a.onPageChange,
|
|
39
|
-
restProps = __rest(_a, ["className", "totalCount", "itemCountPerPage", "pageCount", "currentPage", "
|
|
37
|
+
restProps = __rest(_a, ["className", "totalCount", "itemCountPerPage", "pageCount", "currentPage", "breakPoint", "onPageChange"]);
|
|
40
38
|
var totalPage = Math.ceil(totalCount / itemCountPerPage);
|
|
41
|
-
var
|
|
42
|
-
start =
|
|
43
|
-
setStart =
|
|
39
|
+
var _f = useState(1),
|
|
40
|
+
start = _f[0],
|
|
41
|
+
setStart = _f[1];
|
|
44
42
|
var noPrev = start === 1;
|
|
45
43
|
var noNext = start + pageCount - 1 >= totalPage;
|
|
46
44
|
var showJumpPageButton = totalPage > pageCount;
|
|
@@ -75,23 +73,17 @@ export var Pagination = function (_a) {
|
|
|
75
73
|
children: [showJumpPageButton && _jsxs(_Fragment, {
|
|
76
74
|
children: [NavButton({
|
|
77
75
|
type: 'first',
|
|
78
|
-
as: as,
|
|
79
76
|
breakPoint: breakPoint,
|
|
80
77
|
noPrev: noPrev,
|
|
81
78
|
noNext: noNext,
|
|
82
|
-
href: restProps.href || '',
|
|
83
|
-
target: restProps.target || '',
|
|
84
79
|
onClick: function () {
|
|
85
80
|
return handleClickButton(1);
|
|
86
81
|
}
|
|
87
82
|
}), NavButton({
|
|
88
83
|
type: 'prev',
|
|
89
|
-
as: as,
|
|
90
84
|
breakPoint: breakPoint,
|
|
91
85
|
noPrev: noPrev,
|
|
92
86
|
noNext: noNext,
|
|
93
|
-
href: restProps.href || '',
|
|
94
|
-
target: restProps.target || '',
|
|
95
87
|
onClick: function () {
|
|
96
88
|
return handleClickButton(Math.max(start - pageCount, 1));
|
|
97
89
|
}
|
|
@@ -126,23 +118,17 @@ export var Pagination = function (_a) {
|
|
|
126
118
|
})), showJumpPageButton && _jsxs(_Fragment, {
|
|
127
119
|
children: [NavButton({
|
|
128
120
|
type: 'next',
|
|
129
|
-
as: as,
|
|
130
121
|
breakPoint: breakPoint,
|
|
131
122
|
noPrev: noPrev,
|
|
132
123
|
noNext: noNext,
|
|
133
|
-
href: restProps.href || '',
|
|
134
|
-
target: restProps.target || '',
|
|
135
124
|
onClick: function () {
|
|
136
125
|
return handleClickButton(Math.min(start + pageCount, totalPage));
|
|
137
126
|
}
|
|
138
127
|
}), NavButton({
|
|
139
128
|
type: 'last',
|
|
140
|
-
as: as,
|
|
141
129
|
breakPoint: breakPoint,
|
|
142
130
|
noPrev: noPrev,
|
|
143
131
|
noNext: noNext,
|
|
144
|
-
href: restProps.href || '',
|
|
145
|
-
target: restProps.target || '',
|
|
146
132
|
onClick: function () {
|
|
147
133
|
return handleClickButton(totalPage);
|
|
148
134
|
}
|
|
@@ -9,42 +9,111 @@ var __assign = this && this.__assign || function () {
|
|
|
9
9
|
return __assign.apply(this, arguments);
|
|
10
10
|
};
|
|
11
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { useProgressBar } from './hooks/useProgressBar';
|
|
13
|
+
import { SegmentBar } from './components/SegmentBar';
|
|
14
|
+
import { SegmentLabels, SingleLabel } from './components/SegmentLabels';
|
|
15
|
+
import { getFillColorClass } from './utils';
|
|
12
16
|
export var ProgressBar = function (_a) {
|
|
13
17
|
var label = _a.label,
|
|
14
|
-
value = _a.value
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
value = _a.value,
|
|
19
|
+
segments = _a.segments,
|
|
20
|
+
_b = _a.showZeroLabel,
|
|
21
|
+
showZeroLabel = _b === void 0 ? false : _b,
|
|
22
|
+
_c = _a.valueToPercent,
|
|
23
|
+
valueToPercent = _c === void 0 ? true : _c;
|
|
24
|
+
var _d = useProgressBar(label, value, segments, valueToPercent),
|
|
25
|
+
totalValue = _d.totalValue,
|
|
26
|
+
displayValue = _d.displayValue,
|
|
27
|
+
processedSegments = _d.processedSegments,
|
|
28
|
+
effectiveLabel = _d.effectiveLabel,
|
|
29
|
+
progressValueStyle = _d.progressValueStyle,
|
|
30
|
+
hasSegments = _d.hasSegments,
|
|
31
|
+
segmentCount = _d.segmentCount,
|
|
32
|
+
shouldSpaceOut = _d.shouldSpaceOut;
|
|
33
|
+
var isFloatingLabel = effectiveLabel === 'top-float' || effectiveLabel === 'bottom-float';
|
|
34
|
+
// segments가 1개일 때는 기존 value 방식과 동일하게 처리
|
|
35
|
+
if (hasSegments && segmentCount === 1) {
|
|
36
|
+
var singleSegment = processedSegments[0];
|
|
37
|
+
return _jsxs("div", __assign({
|
|
38
|
+
className: "ncua-progress-bar ncua-progress-bar-".concat(effectiveLabel || ''),
|
|
39
|
+
style: progressValueStyle
|
|
23
40
|
}, {
|
|
24
|
-
children:
|
|
41
|
+
children: [isFloatingLabel && _jsx(SingleLabel, {
|
|
42
|
+
labelType: effectiveLabel,
|
|
43
|
+
displayValue: displayValue,
|
|
44
|
+
totalValue: totalValue,
|
|
45
|
+
showZeroLabel: showZeroLabel
|
|
46
|
+
}), _jsxs("div", __assign({
|
|
47
|
+
className: "ncua-progress-bar__content"
|
|
48
|
+
}, {
|
|
49
|
+
children: [_jsx("div", __assign({
|
|
50
|
+
className: "ncua-progress-bar__bar"
|
|
51
|
+
}, {
|
|
52
|
+
children: _jsx("div", {
|
|
53
|
+
className: "ncua-progress-bar__fill ".concat(getFillColorClass(singleSegment.color)),
|
|
54
|
+
style: {
|
|
55
|
+
width: "".concat(totalValue, "%")
|
|
56
|
+
},
|
|
57
|
+
"aria-valuenow": totalValue,
|
|
58
|
+
"aria-valuemin": 0,
|
|
59
|
+
"aria-valuemax": 100
|
|
60
|
+
})
|
|
61
|
+
})), effectiveLabel === 'right' && _jsx(SingleLabel, {
|
|
62
|
+
labelType: "right",
|
|
63
|
+
displayValue: displayValue,
|
|
64
|
+
totalValue: totalValue,
|
|
65
|
+
showZeroLabel: showZeroLabel
|
|
66
|
+
})]
|
|
67
|
+
})), effectiveLabel === 'bottom' && _jsx(SingleLabel, {
|
|
68
|
+
labelType: "bottom",
|
|
69
|
+
displayValue: displayValue,
|
|
70
|
+
totalValue: totalValue,
|
|
71
|
+
showZeroLabel: showZeroLabel
|
|
72
|
+
})]
|
|
25
73
|
}));
|
|
26
|
-
}
|
|
27
|
-
var isFloatingLabel = label === 'top-float' || label === 'bottom-float';
|
|
74
|
+
}
|
|
28
75
|
return _jsxs("div", __assign({
|
|
29
|
-
className: "ncua-progress-bar ncua-progress-bar-".concat(
|
|
76
|
+
className: "ncua-progress-bar ncua-progress-bar-".concat(effectiveLabel || ''),
|
|
30
77
|
style: progressValueStyle
|
|
31
78
|
}, {
|
|
32
|
-
children: [isFloatingLabel &&
|
|
79
|
+
children: [isFloatingLabel && _jsx(SingleLabel, {
|
|
80
|
+
labelType: effectiveLabel,
|
|
81
|
+
displayValue: displayValue,
|
|
82
|
+
totalValue: totalValue,
|
|
83
|
+
showZeroLabel: showZeroLabel
|
|
84
|
+
}), _jsxs("div", __assign({
|
|
33
85
|
className: "ncua-progress-bar__content"
|
|
34
86
|
}, {
|
|
35
87
|
children: [_jsx("div", __assign({
|
|
36
|
-
className: "ncua-progress-bar__bar"
|
|
88
|
+
className: "ncua-progress-bar__bar ".concat(hasSegments ? 'ncua-progress-bar__bar--segments' : '')
|
|
37
89
|
}, {
|
|
38
|
-
children: _jsx(
|
|
90
|
+
children: hasSegments ? _jsx(SegmentBar, {
|
|
91
|
+
segments: processedSegments,
|
|
92
|
+
shouldSpaceOut: shouldSpaceOut
|
|
93
|
+
}) : _jsx("div", {
|
|
39
94
|
className: "ncua-progress-bar__fill",
|
|
40
95
|
style: {
|
|
41
|
-
width: "".concat(
|
|
96
|
+
width: "".concat(totalValue, "%")
|
|
42
97
|
},
|
|
43
|
-
"aria-valuenow":
|
|
98
|
+
"aria-valuenow": totalValue,
|
|
44
99
|
"aria-valuemin": 0,
|
|
45
100
|
"aria-valuemax": 100
|
|
46
101
|
})
|
|
47
|
-
})),
|
|
48
|
-
|
|
102
|
+
})), effectiveLabel === 'right' && _jsx(SingleLabel, {
|
|
103
|
+
labelType: "right",
|
|
104
|
+
displayValue: displayValue,
|
|
105
|
+
totalValue: totalValue,
|
|
106
|
+
showZeroLabel: showZeroLabel
|
|
107
|
+
})]
|
|
108
|
+
})), hasSegments && segmentCount >= 2 ? _jsx(SegmentLabels, {
|
|
109
|
+
segments: processedSegments,
|
|
110
|
+
segmentCount: segmentCount,
|
|
111
|
+
showZeroLabel: showZeroLabel
|
|
112
|
+
}) : effectiveLabel === 'bottom' ? _jsx(SingleLabel, {
|
|
113
|
+
labelType: "bottom",
|
|
114
|
+
displayValue: displayValue,
|
|
115
|
+
totalValue: totalValue,
|
|
116
|
+
showZeroLabel: showZeroLabel
|
|
117
|
+
}) : null]
|
|
49
118
|
}));
|
|
50
119
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { getFillColorClass } from '../utils';
|
|
3
|
+
export var SegmentBar = function (_a) {
|
|
4
|
+
var segments = _a.segments,
|
|
5
|
+
shouldSpaceOut = _a.shouldSpaceOut;
|
|
6
|
+
return _jsx(_Fragment, {
|
|
7
|
+
children: segments.map(function (segment, index) {
|
|
8
|
+
var isFirst = index === 0;
|
|
9
|
+
var isLast = index === segments.length - 1;
|
|
10
|
+
return _jsx("div", {
|
|
11
|
+
className: "ncua-progress-bar__fill ".concat(isFirst ? 'ncua-progress-bar__fill--first' : '', " ").concat(isLast ? 'ncua-progress-bar__fill--last' : '', " ").concat(shouldSpaceOut && isLast ? 'ncua-progress-bar__fill--spaced' : '', " ").concat(getFillColorClass(segment.color)),
|
|
12
|
+
style: {
|
|
13
|
+
width: "".concat(segment.width, "%")
|
|
14
|
+
}
|
|
15
|
+
}, index);
|
|
16
|
+
})
|
|
17
|
+
});
|
|
18
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var __assign = this && this.__assign || function () {
|
|
2
|
+
__assign = Object.assign || function (t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
6
|
+
}
|
|
7
|
+
return t;
|
|
8
|
+
};
|
|
9
|
+
return __assign.apply(this, arguments);
|
|
10
|
+
};
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
import { getLabelColorClass } from '../utils';
|
|
13
|
+
export var SegmentLabels = function (_a) {
|
|
14
|
+
var segments = _a.segments,
|
|
15
|
+
segmentCount = _a.segmentCount,
|
|
16
|
+
_b = _a.showZeroLabel,
|
|
17
|
+
showZeroLabel = _b === void 0 ? false : _b;
|
|
18
|
+
if (segmentCount >= 2) {
|
|
19
|
+
return _jsx("div", __assign({
|
|
20
|
+
className: "ncua-progress-bar__labels--multiple"
|
|
21
|
+
}, {
|
|
22
|
+
children: segments.map(function (segment, index) {
|
|
23
|
+
// 0%이고 showZeroLabel이 false면 라벨 표시하지 않음
|
|
24
|
+
if (segment.value === 0 && !showZeroLabel) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
var leftPosition = 0;
|
|
28
|
+
for (var i = 0; i < index; i++) {
|
|
29
|
+
leftPosition += segments[i].width;
|
|
30
|
+
}
|
|
31
|
+
// 0%일 때는 segment 시작 위치에 맞추되, 라벨이 게이지 바를 넘어가지 않도록 조정
|
|
32
|
+
// 그 외에는 중앙에 정렬
|
|
33
|
+
var isZero = segment.value === 0;
|
|
34
|
+
// 0%일 때는 약간의 오프셋을 주어 자연스럽게 보이도록 함 (라벨 너비의 절반 정도)
|
|
35
|
+
var labelPosition = isZero ? Math.max(0, leftPosition - 1) : leftPosition + segment.width / 2;
|
|
36
|
+
var transform = isZero ? 'translateX(0)' : 'translateX(-50%)';
|
|
37
|
+
return _jsx("span", __assign({
|
|
38
|
+
className: "ncua-progress-bar__label ncua-progress-bar__label--segment ".concat(getLabelColorClass(segment.color)),
|
|
39
|
+
style: {
|
|
40
|
+
left: "".concat(labelPosition, "%"),
|
|
41
|
+
transform: transform
|
|
42
|
+
}
|
|
43
|
+
}, {
|
|
44
|
+
children: "".concat(segment.value.toFixed(0), "%")
|
|
45
|
+
}), index);
|
|
46
|
+
})
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
};
|
|
51
|
+
export var SingleLabel = function (_a) {
|
|
52
|
+
var labelType = _a.labelType,
|
|
53
|
+
displayValue = _a.displayValue,
|
|
54
|
+
totalValue = _a.totalValue,
|
|
55
|
+
_b = _a.showZeroLabel,
|
|
56
|
+
showZeroLabel = _b === void 0 ? false : _b;
|
|
57
|
+
// 0%이고 showZeroLabel이 false면 라벨 표시하지 않음
|
|
58
|
+
if (totalValue === 0 && !showZeroLabel) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
return _jsx("span", __assign({
|
|
62
|
+
className: "ncua-progress-bar__label ncua-progress-bar__label-".concat(labelType)
|
|
63
|
+
}, {
|
|
64
|
+
children: displayValue
|
|
65
|
+
}));
|
|
66
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
var __assign = this && this.__assign || function () {
|
|
2
|
+
__assign = Object.assign || function (t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
6
|
+
}
|
|
7
|
+
return t;
|
|
8
|
+
};
|
|
9
|
+
return __assign.apply(this, arguments);
|
|
10
|
+
};
|
|
11
|
+
import { useMemo } from 'react';
|
|
12
|
+
import { clampValue } from '../utils';
|
|
13
|
+
/**
|
|
14
|
+
* segments를 처리하여 프로그레스 바에 표시할 데이터를 계산합니다.
|
|
15
|
+
*/
|
|
16
|
+
var processSegments = function (segments, segmentCount, valueToPercent) {
|
|
17
|
+
// segment가 2개 이상일 때만 valueToPercent 적용 (기본값: true)
|
|
18
|
+
var shouldApplyValueToPercent = segmentCount >= 2 && valueToPercent !== false;
|
|
19
|
+
var segmentsToProcess = segments;
|
|
20
|
+
// valueToPercent 적용: segments의 합계를 100%로 규정하고 비율로 계산
|
|
21
|
+
if (shouldApplyValueToPercent) {
|
|
22
|
+
// 원본 값들의 합계 계산
|
|
23
|
+
var originalTotal_1 = segmentsToProcess.reduce(function (sum, seg) {
|
|
24
|
+
return sum + Number(seg.value);
|
|
25
|
+
}, 0);
|
|
26
|
+
if (originalTotal_1 > 0) {
|
|
27
|
+
// 각 segment를 합계 대비 비율로 변환 (합계를 100%로 규정)
|
|
28
|
+
segmentsToProcess = segmentsToProcess.map(function (segment) {
|
|
29
|
+
return {
|
|
30
|
+
value: segment.value / originalTotal_1 * 100,
|
|
31
|
+
color: segment.color
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
// 각 값 제한 (0-100 범위)
|
|
37
|
+
var limitedSegments = segmentsToProcess.map(function (segment) {
|
|
38
|
+
return {
|
|
39
|
+
value: clampValue(segment.value),
|
|
40
|
+
color: segment.color
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
// 전체 합계 계산
|
|
44
|
+
var actualTotal = limitedSegments.reduce(function (sum, seg) {
|
|
45
|
+
return sum + seg.value;
|
|
46
|
+
}, 0);
|
|
47
|
+
var total = Math.min(actualTotal, 100);
|
|
48
|
+
// 모든 segments를 좌측에서부터 연속적으로 배치 (비율로 계산)
|
|
49
|
+
var processed = limitedSegments.map(function (segment) {
|
|
50
|
+
return __assign(__assign({}, segment), {
|
|
51
|
+
width: actualTotal > 0 ? segment.value / actualTotal * total : 0
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
return {
|
|
55
|
+
totalValue: total,
|
|
56
|
+
displayValue: "".concat(total.toFixed(0), "%"),
|
|
57
|
+
processedSegments: processed,
|
|
58
|
+
shouldSpaceOut: false // 항상 왼쪽에 붙도록 통일
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
export var useProgressBar = function (label, value, segments, valueToPercent) {
|
|
62
|
+
var _a;
|
|
63
|
+
var hasSegments = Boolean(segments && segments.length > 0);
|
|
64
|
+
var segmentCount = (_a = segments === null || segments === void 0 ? void 0 : segments.length) !== null && _a !== void 0 ? _a : 0;
|
|
65
|
+
var _b = useMemo(function () {
|
|
66
|
+
// segments가 있을 때는 각 값을 제한하고 전체 합계를 계산
|
|
67
|
+
// value는 무시되며, 각 segment의 값을 value로 처리
|
|
68
|
+
if (hasSegments) {
|
|
69
|
+
return processSegments(segments, segmentCount, valueToPercent);
|
|
70
|
+
}
|
|
71
|
+
// value만 있을 때는 valueToPercent 무시 (이미 퍼센트로 간주)
|
|
72
|
+
if (value !== undefined) {
|
|
73
|
+
var clamped = clampValue(value);
|
|
74
|
+
return {
|
|
75
|
+
totalValue: clamped,
|
|
76
|
+
displayValue: "".concat(clamped.toFixed(0), "%"),
|
|
77
|
+
processedSegments: [],
|
|
78
|
+
shouldSpaceOut: false
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
totalValue: 0,
|
|
83
|
+
displayValue: '0%',
|
|
84
|
+
processedSegments: [],
|
|
85
|
+
shouldSpaceOut: false
|
|
86
|
+
};
|
|
87
|
+
}, [hasSegments, segments, segmentCount, value, valueToPercent]),
|
|
88
|
+
totalValue = _b.totalValue,
|
|
89
|
+
displayValue = _b.displayValue,
|
|
90
|
+
processedSegments = _b.processedSegments,
|
|
91
|
+
shouldSpaceOut = _b.shouldSpaceOut;
|
|
92
|
+
// segment의 개수가 2이상일때는 bottom 라벨로 고정
|
|
93
|
+
var effectiveLabel = segmentCount >= 2 ? 'bottom' : label;
|
|
94
|
+
var progressValueStyle = useMemo(function () {
|
|
95
|
+
if (effectiveLabel === 'top-float' || effectiveLabel === 'bottom-float') {
|
|
96
|
+
return {
|
|
97
|
+
'--progress-value': "".concat(totalValue, "%")
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
return undefined;
|
|
101
|
+
}, [effectiveLabel, totalValue]);
|
|
102
|
+
return {
|
|
103
|
+
totalValue: totalValue,
|
|
104
|
+
displayValue: displayValue,
|
|
105
|
+
processedSegments: processedSegments,
|
|
106
|
+
effectiveLabel: effectiveLabel,
|
|
107
|
+
progressValueStyle: progressValueStyle,
|
|
108
|
+
hasSegments: hasSegments,
|
|
109
|
+
segmentCount: segmentCount,
|
|
110
|
+
shouldSpaceOut: shouldSpaceOut
|
|
111
|
+
};
|
|
112
|
+
};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from './ProgressBar';
|
|
1
|
+
export * from './ProgressBar';
|
|
2
|
+
export * from './types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 색상 이름을 fill 색상 클래스명으로 변환
|
|
3
|
+
*/
|
|
4
|
+
export var getFillColorClass = function (color) {
|
|
5
|
+
if (!color) return '';
|
|
6
|
+
var normalizedColor = color.toLowerCase().trim();
|
|
7
|
+
return "ncua-progress-bar__fill--color-".concat(normalizedColor);
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* 색상 이름을 label 색상 클래스명으로 변환
|
|
11
|
+
*/
|
|
12
|
+
export var getLabelColorClass = function (color) {
|
|
13
|
+
if (!color) return '';
|
|
14
|
+
var normalizedColor = color.toLowerCase().trim();
|
|
15
|
+
return "ncua-progress-bar__label--color-".concat(normalizedColor);
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* 값을 0-100 범위로 제한
|
|
19
|
+
*/
|
|
20
|
+
export var clampValue = function (value) {
|
|
21
|
+
return Math.min(Math.max(0, value), 100);
|
|
22
|
+
};
|