@ncds/ui-admin 1.2.2 → 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
|
@@ -0,0 +1,115 @@
|
|
|
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 { SVG_ICONS, CLASS_NAMES, FULL_WIDTH_ICON_MAP, FULL_WIDTH_SIZES } from './const';
|
|
12
|
+
import { createWrapperElement, renderSupportingText, renderActions, bindNotificationEvents, setupAutoClose } from './utils';
|
|
13
|
+
var FullWidthNotification = /** @class */function () {
|
|
14
|
+
function FullWidthNotification(options) {
|
|
15
|
+
this.options = __assign({
|
|
16
|
+
color: 'neutral',
|
|
17
|
+
className: '',
|
|
18
|
+
actions: [],
|
|
19
|
+
autoClose: 0,
|
|
20
|
+
supportingText: undefined
|
|
21
|
+
}, options);
|
|
22
|
+
this.element = this.createElement();
|
|
23
|
+
this.bindEvents();
|
|
24
|
+
this.setupAutoClose();
|
|
25
|
+
}
|
|
26
|
+
FullWidthNotification.prototype.createElement = function () {
|
|
27
|
+
var _a = this.options,
|
|
28
|
+
title = _a.title,
|
|
29
|
+
supportingText = _a.supportingText,
|
|
30
|
+
color = _a.color,
|
|
31
|
+
className = _a.className,
|
|
32
|
+
actions = _a.actions,
|
|
33
|
+
onClose = _a.onClose,
|
|
34
|
+
supportTextLink = _a.supportTextLink,
|
|
35
|
+
onHidePermanently = _a.onHidePermanently;
|
|
36
|
+
var wrapper = createWrapperElement(CLASS_NAMES.FULL_WIDTH.BASE, color, className);
|
|
37
|
+
var iconHtml = FULL_WIDTH_ICON_MAP[color](FULL_WIDTH_SIZES.ICON);
|
|
38
|
+
wrapper.innerHTML = this.buildTemplate({
|
|
39
|
+
iconHtml: iconHtml,
|
|
40
|
+
title: title,
|
|
41
|
+
supportingText: supportingText,
|
|
42
|
+
actions: actions,
|
|
43
|
+
onClose: onClose,
|
|
44
|
+
supportTextLink: supportTextLink,
|
|
45
|
+
onHidePermanently: onHidePermanently
|
|
46
|
+
});
|
|
47
|
+
return wrapper;
|
|
48
|
+
};
|
|
49
|
+
FullWidthNotification.prototype.buildTemplate = function (params) {
|
|
50
|
+
var iconHtml = params.iconHtml,
|
|
51
|
+
title = params.title,
|
|
52
|
+
supportingText = params.supportingText,
|
|
53
|
+
actions = params.actions,
|
|
54
|
+
onClose = params.onClose,
|
|
55
|
+
supportTextLink = params.supportTextLink,
|
|
56
|
+
onHidePermanently = params.onHidePermanently;
|
|
57
|
+
return "\n <div class=\"".concat(CLASS_NAMES.FULL_WIDTH.CONTAINER, "\">\n <div class=\"").concat(CLASS_NAMES.FULL_WIDTH.CONTENT, "\">\n <div class=\"").concat(CLASS_NAMES.FULL_WIDTH.CONTENT_WRAPPER, "\">\n <div class=\"").concat(CLASS_NAMES.FULL_WIDTH.ICON, "\">").concat(iconHtml, "</div>\n <div class=\"").concat(CLASS_NAMES.FULL_WIDTH.TEXT_CONTAINER, "\">\n <span class=\"").concat(CLASS_NAMES.FULL_WIDTH.TITLE, "\">").concat(title, "</span>\n ").concat(renderSupportingText(supportingText, CLASS_NAMES.FULL_WIDTH.SUPPORTING_TEXT, supportTextLink), "\n </div>\n </div>\n <div class=\"").concat(CLASS_NAMES.FULL_WIDTH.ACTIONS_CONTAINER, "\">\n ").concat(actions && actions.length > 0 ? renderActions(actions, CLASS_NAMES.FULL_WIDTH.ACTIONS) : '', "\n ").concat(this.renderHidePermanentlyButton(onHidePermanently), "\n ").concat(this.renderCloseButton(onClose), "\n </div>\n </div>\n </div>\n ");
|
|
58
|
+
};
|
|
59
|
+
FullWidthNotification.prototype.renderHidePermanentlyButton = function (onHidePermanently) {
|
|
60
|
+
if (!onHidePermanently) return '';
|
|
61
|
+
return "\n <button type=\"button\" class=\"ncua-notification__action-button ncua-notification__action-button--text ncua-full-width-notification__link\" data-hide-permanently=\"true\">\n \uB2E4\uC2DC\uBCF4\uC9C0 \uC54A\uAE30\n </button>\n ";
|
|
62
|
+
};
|
|
63
|
+
FullWidthNotification.prototype.renderCloseButton = function (onClose) {
|
|
64
|
+
if (!onClose) return '';
|
|
65
|
+
return "\n <button type=\"button\" class=\"".concat(CLASS_NAMES.FULL_WIDTH.CLOSE_BUTTON, "\" aria-label=\"\uC54C\uB9BC \uB2EB\uAE30\">\n ").concat(SVG_ICONS['x-close'](FULL_WIDTH_SIZES.CLOSE_BUTTON), "\n </button>\n ");
|
|
66
|
+
};
|
|
67
|
+
FullWidthNotification.prototype.bindEvents = function () {
|
|
68
|
+
var _this = this;
|
|
69
|
+
bindNotificationEvents(this.element, this.options.actions, this.options.onClose, function () {
|
|
70
|
+
return _this.remove();
|
|
71
|
+
});
|
|
72
|
+
// 다시보지 않기 버튼 이벤트 바인딩
|
|
73
|
+
if (this.options.onHidePermanently) {
|
|
74
|
+
var hidePermanentlyButton = this.element.querySelector('[data-hide-permanently="true"]');
|
|
75
|
+
if (hidePermanentlyButton) {
|
|
76
|
+
hidePermanentlyButton.addEventListener('click', function () {
|
|
77
|
+
var _a, _b;
|
|
78
|
+
(_b = (_a = _this.options).onHidePermanently) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
79
|
+
_this.remove();
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
FullWidthNotification.prototype.setupAutoClose = function () {
|
|
85
|
+
var _this = this;
|
|
86
|
+
this.autoCloseTimer = setupAutoClose(this.options.autoClose, this.options.onClose, function () {
|
|
87
|
+
return _this.remove();
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
// Public methods
|
|
91
|
+
FullWidthNotification.prototype.getElement = function () {
|
|
92
|
+
return this.element;
|
|
93
|
+
};
|
|
94
|
+
FullWidthNotification.prototype.appendTo = function (parent) {
|
|
95
|
+
parent.appendChild(this.element);
|
|
96
|
+
};
|
|
97
|
+
FullWidthNotification.prototype.remove = function () {
|
|
98
|
+
if (this.autoCloseTimer) {
|
|
99
|
+
clearTimeout(this.autoCloseTimer);
|
|
100
|
+
this.autoCloseTimer = undefined;
|
|
101
|
+
}
|
|
102
|
+
if (this.element && this.element.parentNode) {
|
|
103
|
+
this.element.parentNode.removeChild(this.element);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
FullWidthNotification.prototype.destroy = function () {
|
|
107
|
+
this.remove();
|
|
108
|
+
};
|
|
109
|
+
// Static factory methods
|
|
110
|
+
FullWidthNotification.create = function (options) {
|
|
111
|
+
return new FullWidthNotification(options);
|
|
112
|
+
};
|
|
113
|
+
return FullWidthNotification;
|
|
114
|
+
}();
|
|
115
|
+
export { FullWidthNotification };
|
|
@@ -0,0 +1,108 @@
|
|
|
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
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
14
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
15
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
16
|
+
}
|
|
17
|
+
return t;
|
|
18
|
+
};
|
|
19
|
+
import { FullWidthNotification } from './FullWidthNotification';
|
|
20
|
+
import { FloatingNotification } from './FloatingNotification';
|
|
21
|
+
// 통합 Notification 클래스
|
|
22
|
+
var Notification = /** @class */function () {
|
|
23
|
+
function Notification(options) {
|
|
24
|
+
var _a = options.type,
|
|
25
|
+
type = _a === void 0 ? 'floating' : _a,
|
|
26
|
+
baseOptions = __rest(options, ["type"]);
|
|
27
|
+
if (type === 'floating') {
|
|
28
|
+
this.instance = new FloatingNotification(baseOptions);
|
|
29
|
+
} else {
|
|
30
|
+
this.instance = new FullWidthNotification(baseOptions);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
// 모든 메서드를 instance에 위임
|
|
34
|
+
Notification.prototype.getElement = function () {
|
|
35
|
+
return this.instance.getElement();
|
|
36
|
+
};
|
|
37
|
+
Notification.prototype.appendTo = function (parent) {
|
|
38
|
+
return this.instance.appendTo(parent);
|
|
39
|
+
};
|
|
40
|
+
Notification.prototype.remove = function () {
|
|
41
|
+
return this.instance.remove();
|
|
42
|
+
};
|
|
43
|
+
Notification.prototype.destroy = function () {
|
|
44
|
+
return this.instance.destroy();
|
|
45
|
+
};
|
|
46
|
+
Notification.prototype.show = function (parent) {
|
|
47
|
+
if (parent) {
|
|
48
|
+
this.instance.appendTo(parent);
|
|
49
|
+
} else {
|
|
50
|
+
this.instance.appendTo(document.body);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
// Static factory methods
|
|
54
|
+
Notification.create = function (options) {
|
|
55
|
+
return new Notification(options);
|
|
56
|
+
};
|
|
57
|
+
// Convenience method for creating notifications with specific color
|
|
58
|
+
Notification.createWithColor = function (color, title, supportingText, options) {
|
|
59
|
+
var autoCloseMap = {
|
|
60
|
+
success: 3000,
|
|
61
|
+
error: 5000,
|
|
62
|
+
warning: 3000,
|
|
63
|
+
info: 3000,
|
|
64
|
+
neutral: 0
|
|
65
|
+
};
|
|
66
|
+
return new Notification(__assign({
|
|
67
|
+
title: title,
|
|
68
|
+
supportingText: supportingText,
|
|
69
|
+
color: color,
|
|
70
|
+
type: 'floating',
|
|
71
|
+
autoClose: autoCloseMap[color]
|
|
72
|
+
}, options));
|
|
73
|
+
};
|
|
74
|
+
// 클래스를 생성하지 않고도 기본 floating 알림 생성을 하기 위한 함수들
|
|
75
|
+
Notification.success = function (title, supportingText, options) {
|
|
76
|
+
var notification = this.createWithColor('success', title, supportingText, options);
|
|
77
|
+
notification.show();
|
|
78
|
+
return notification;
|
|
79
|
+
};
|
|
80
|
+
Notification.error = function (title, supportingText, options) {
|
|
81
|
+
var notification = this.createWithColor('error', title, supportingText, options);
|
|
82
|
+
notification.show();
|
|
83
|
+
return notification;
|
|
84
|
+
};
|
|
85
|
+
Notification.warning = function (title, supportingText, options) {
|
|
86
|
+
var notification = this.createWithColor('warning', title, supportingText, options);
|
|
87
|
+
notification.show();
|
|
88
|
+
return notification;
|
|
89
|
+
};
|
|
90
|
+
Notification.info = function (title, supportingText, options) {
|
|
91
|
+
var notification = this.createWithColor('info', title, supportingText, options);
|
|
92
|
+
notification.show();
|
|
93
|
+
return notification;
|
|
94
|
+
};
|
|
95
|
+
Notification.neutral = function (title, supportingText, options) {
|
|
96
|
+
var notification = this.createWithColor('neutral', title, supportingText, options);
|
|
97
|
+
notification.show();
|
|
98
|
+
return notification;
|
|
99
|
+
};
|
|
100
|
+
// showFullWidth method for backward compatibility
|
|
101
|
+
Notification.showFullWidth = function (options) {
|
|
102
|
+
return new Notification(__assign(__assign({}, options), {
|
|
103
|
+
type: 'full-width'
|
|
104
|
+
}));
|
|
105
|
+
};
|
|
106
|
+
return Notification;
|
|
107
|
+
}();
|
|
108
|
+
export { Notification };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// CSS class names
|
|
2
|
+
export var CLASS_NAMES = {
|
|
3
|
+
FULL_WIDTH: {
|
|
4
|
+
BASE: 'ncua-full-width-notification',
|
|
5
|
+
CONTAINER: 'ncua-full-width-notification__container',
|
|
6
|
+
CONTENT: 'ncua-full-width-notification__content',
|
|
7
|
+
CONTENT_WRAPPER: 'ncua-full-width-notification__content-wrapper',
|
|
8
|
+
ICON: 'ncua-full-width-notification__icon',
|
|
9
|
+
TEXT_CONTAINER: 'ncua-full-width-notification__text-container',
|
|
10
|
+
TITLE: 'ncua-full-width-notification__title',
|
|
11
|
+
SUPPORTING_TEXT: 'ncua-full-width-notification__supporting-text',
|
|
12
|
+
ACTIONS_CONTAINER: 'ncua-full-width-notification__actions-container',
|
|
13
|
+
ACTIONS: 'ncua-full-width-notification__actions',
|
|
14
|
+
CLOSE_BUTTON: 'ncua-full-width-notification__close-button'
|
|
15
|
+
},
|
|
16
|
+
FLOATING: {
|
|
17
|
+
BASE: 'ncua-floating-notification',
|
|
18
|
+
CONTAINER: 'ncua-floating-notification__container',
|
|
19
|
+
CONTENT: 'ncua-floating-notification__content',
|
|
20
|
+
TEXT_CONTAINER: 'ncua-floating-notification__text-container',
|
|
21
|
+
TITLE_WRAPPER: 'ncua-floating-notification__title-wrapper',
|
|
22
|
+
TITLE: 'ncua-floating-notification__title',
|
|
23
|
+
SUPPORTING_TEXT: 'ncua-floating-notification__supporting-text',
|
|
24
|
+
ACTIONS: 'ncua-floating-notification__actions',
|
|
25
|
+
CLOSE_BUTTON: 'ncua-floating-notification__close-button'
|
|
26
|
+
},
|
|
27
|
+
COMMON: {
|
|
28
|
+
ACTION_BUTTON: 'ncua-notification__action-button'
|
|
29
|
+
}
|
|
30
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// SVG 아이콘들 (크기는 동적으로 설정)
|
|
2
|
+
export var SVG_ICONS = {
|
|
3
|
+
'pin-02': function (size) {
|
|
4
|
+
return "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"".concat(size, "\" height=\"").concat(size, "\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"none\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8.377 15.616 2.72 21.273m8.974-14.631-1.56 1.56a2 2 0 0 1-.264.242 1 1 0 0 1-.207.111c-.082.032-.17.05-.347.085l-3.665.733c-.952.19-1.428.286-1.65.537a1 1 0 0 0-.243.8c.046.333.39.677 1.076 1.363l7.086 7.086c.686.687 1.03 1.03 1.362 1.076a1 1 0 0 0 .801-.242c.251-.223.346-.7.537-1.651l.733-3.665c.035-.176.053-.265.085-.347a1 1 0 0 1 .11-.207c.051-.072.115-.136.242-.263l1.561-1.561c.082-.082.122-.122.167-.158q.06-.047.126-.085c.05-.029.103-.051.208-.097l2.495-1.069c.727-.312 1.091-.467 1.256-.72a1 1 0 0 0 .144-.747c-.06-.295-.34-.575-.9-1.135l-5.142-5.143c-.56-.56-.84-.84-1.135-.9a1 1 0 0 0-.748.145c-.252.165-.407.529-.72 1.256l-1.068 2.495a2 2 0 0 1-.097.208 1 1 0 0 1-.085.126 2 2 0 0 1-.158.167\"></path></svg>");
|
|
5
|
+
},
|
|
6
|
+
'alert-triangle': function (size) {
|
|
7
|
+
return "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"".concat(size, "\" height=\"").concat(size, "\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"none\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M12 9v4m0 4h.01M10.615 3.892 2.39 18.098c-.456.788-.684 1.182-.65 1.506a1 1 0 0 0 .406.705c.263.191.718.191 1.629.191h16.45c.91 0 1.365 0 1.628-.191a1 1 0 0 0 .407-.705c.034-.324-.195-.718-.65-1.506L13.383 3.892c-.454-.785-.681-1.178-.978-1.31a1 1 0 0 0-.812 0c-.297.132-.524.525-.979 1.31\"></path></svg>");
|
|
8
|
+
},
|
|
9
|
+
'alert-circle': function (size) {
|
|
10
|
+
return "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"".concat(size, "\" height=\"").concat(size, "\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"none\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M12 8v4m0 4h.01M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10\"></path></svg>");
|
|
11
|
+
},
|
|
12
|
+
'check-circle': function (size) {
|
|
13
|
+
return "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"".concat(size, "\" height=\"").concat(size, "\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"none\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"m7.5 12 3 3 6-6m5.5 3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10\"></path></svg>");
|
|
14
|
+
},
|
|
15
|
+
'info-circle': function (size) {
|
|
16
|
+
return "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"".concat(size, "\" height=\"").concat(size, "\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"none\" color=\"#5720B7\" class=\"ncua-full-width-notification__icon\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M12 16v-4m0-4h.01M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10\"></path></svg>");
|
|
17
|
+
},
|
|
18
|
+
'message-chat-square': function (size) {
|
|
19
|
+
return "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"".concat(size, "\" height=\"").concat(size, "\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"none\" color=\"#0C111D\" class=\"ncua-full-width-notification__icon\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"m10 15-3.075 3.114c-.43.434-.644.651-.828.666a.5.5 0 0 1-.421-.172c-.12-.14-.12-.446-.12-1.056v-1.56c0-.548-.449-.944-.99-1.024v0a3 3 0 0 1-2.534-2.533C2 12.219 2 11.96 2 11.445V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C4.28 2 5.12 2 6.8 2h7.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C19 4.28 19 5.12 19 6.8V11m0 11-2.176-1.513c-.306-.213-.46-.32-.626-.395a2 2 0 0 0-.462-.145c-.18-.033-.367-.033-.74-.033H13.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C10 18.394 10 17.834 10 16.714V14.2c0-1.12 0-1.68.218-2.108a2 2 0 0 1 .874-.874C11.52 11 12.08 11 13.2 11h5.6c1.12 0 1.68 0 2.108.218a2 2 0 0 1 .874.874C22 12.52 22 13.08 22 14.2v2.714c0 .932 0 1.398-.152 1.766a2 2 0 0 1-1.083 1.082c-.367.152-.833.152-1.765.152z\"></path></svg>");
|
|
20
|
+
},
|
|
21
|
+
'x-close': function (size) {
|
|
22
|
+
return "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"".concat(size, "\" height=\"").concat(size, "\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"none\"><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M18 6 6 18M6 6l12 12\"></path></svg>");
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
export var FLOATING_ICON_MAP = {
|
|
26
|
+
neutral: SVG_ICONS['pin-02'],
|
|
27
|
+
error: SVG_ICONS['alert-triangle'],
|
|
28
|
+
warning: SVG_ICONS['alert-circle'],
|
|
29
|
+
success: SVG_ICONS['check-circle']
|
|
30
|
+
// info는 floating에서는 지원하지 않음
|
|
31
|
+
};
|
|
32
|
+
export var FULL_WIDTH_ICON_MAP = {
|
|
33
|
+
neutral: SVG_ICONS['message-chat-square'],
|
|
34
|
+
error: SVG_ICONS['alert-triangle'],
|
|
35
|
+
warning: SVG_ICONS['alert-triangle'],
|
|
36
|
+
success: SVG_ICONS['check-circle'],
|
|
37
|
+
info: SVG_ICONS['info-circle']
|
|
38
|
+
};
|
|
39
|
+
export var ICON_MAP = FULL_WIDTH_ICON_MAP;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// 알림 컴포넌트 사이즈 관련 상수들
|
|
2
|
+
// FeaturedIcon 사이즈
|
|
3
|
+
export var FEATURED_ICON_SIZES = {
|
|
4
|
+
MOBILE: 'md',
|
|
5
|
+
DESKTOP: 'sm'
|
|
6
|
+
};
|
|
7
|
+
// SVG 아이콘 픽셀 사이즈
|
|
8
|
+
export var ICON_PIXEL_SIZES = {
|
|
9
|
+
MOBILE: '20',
|
|
10
|
+
DESKTOP: '16',
|
|
11
|
+
FULL_WIDTH: '16' // Full-width는 항상 고정
|
|
12
|
+
};
|
|
13
|
+
// 닫기 버튼 사이즈
|
|
14
|
+
export var CLOSE_BUTTON_SIZES = {
|
|
15
|
+
MOBILE: 'sm',
|
|
16
|
+
DESKTOP: 'xs'
|
|
17
|
+
};
|
|
18
|
+
// 닫기 버튼 SVG 픽셀 사이즈
|
|
19
|
+
export var CLOSE_BUTTON_SVG_SIZES = {
|
|
20
|
+
xs: 16,
|
|
21
|
+
sm: 20
|
|
22
|
+
};
|
|
23
|
+
// Full-width 알림 고정 사이즈
|
|
24
|
+
export var FULL_WIDTH_SIZES = {
|
|
25
|
+
ICON: '16',
|
|
26
|
+
CLOSE_BUTTON: '20'
|
|
27
|
+
};
|
|
28
|
+
// 사이즈 유틸리티 함수들
|
|
29
|
+
export var getSizes = {
|
|
30
|
+
featuredIcon: function (isMobile) {
|
|
31
|
+
return isMobile ? FEATURED_ICON_SIZES.MOBILE : FEATURED_ICON_SIZES.DESKTOP;
|
|
32
|
+
},
|
|
33
|
+
iconPixel: function (isMobile) {
|
|
34
|
+
return isMobile ? ICON_PIXEL_SIZES.MOBILE : ICON_PIXEL_SIZES.DESKTOP;
|
|
35
|
+
},
|
|
36
|
+
closeButton: function (isMobile) {
|
|
37
|
+
return isMobile ? CLOSE_BUTTON_SIZES.MOBILE : CLOSE_BUTTON_SIZES.DESKTOP;
|
|
38
|
+
},
|
|
39
|
+
closeButtonSvg: function (size) {
|
|
40
|
+
return CLOSE_BUTTON_SVG_SIZES[size];
|
|
41
|
+
}
|
|
42
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { Notification } from './Notification';
|
|
2
|
+
export { FullWidthNotification } from './FullWidthNotification';
|
|
3
|
+
export { FloatingNotification } from './FloatingNotification';
|
|
4
|
+
export * from './utils';
|
|
5
|
+
export { SVG_ICONS, CLASS_NAMES, ICON_MAP, FLOATING_ICON_MAP, FULL_WIDTH_ICON_MAP } from './const';
|
|
6
|
+
// 전역 등록 ( 추후 index.ts와 개별동작 할 수 있게끔 대비 )
|
|
7
|
+
if (typeof window !== 'undefined') {
|
|
8
|
+
window.ncua = window.ncua || {};
|
|
9
|
+
window.ncua.Notification = Notification;
|
|
10
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { CLASS_NAMES } from './const';
|
|
2
|
+
import { BREAKPOINT } from '../../../src/constant/breakpoint';
|
|
3
|
+
// 공통 유틸리티 함수들
|
|
4
|
+
export function createWrapperElement(baseClass, color, className) {
|
|
5
|
+
var wrapper = document.createElement('div');
|
|
6
|
+
wrapper.className = buildClassName(baseClass, color, className);
|
|
7
|
+
wrapper.setAttribute('role', 'alert');
|
|
8
|
+
return wrapper;
|
|
9
|
+
}
|
|
10
|
+
export function buildClassName(baseClass, color, className) {
|
|
11
|
+
var classes = [baseClass, "".concat(baseClass, "--").concat(color)];
|
|
12
|
+
if (className) {
|
|
13
|
+
classes.push(className);
|
|
14
|
+
}
|
|
15
|
+
return classes.join(' ');
|
|
16
|
+
}
|
|
17
|
+
export function renderSupportingText(supportingText, className, supportTextLink) {
|
|
18
|
+
if (!supportingText) return '';
|
|
19
|
+
if (supportTextLink) {
|
|
20
|
+
return "<a href=\"".concat(supportTextLink, "\" class=\"ncua-full-width-notification__link\"><span class=\"").concat(className, "\">").concat(supportingText, "</span></a>");
|
|
21
|
+
}
|
|
22
|
+
return "<span class=\"".concat(className, "\">").concat(supportingText, "</span>");
|
|
23
|
+
}
|
|
24
|
+
export function renderActions(actions, wrapperClass) {
|
|
25
|
+
// 액션이 없으면 빈 문자열 반환
|
|
26
|
+
if (!actions || actions.length === 0) {
|
|
27
|
+
return '';
|
|
28
|
+
}
|
|
29
|
+
var buttonsHtml = actions.map(function (action) {
|
|
30
|
+
var buttonHtml = "\n <button \n class=\"ncua-notification__action-button ncua-notification__action-button--".concat(action.hierarchy || 'link', "\"\n data-action=\"").concat(action.label, "-").concat(action.hierarchy, "\"\n >\n ").concat(action.label, "\n </button>");
|
|
31
|
+
return buttonHtml;
|
|
32
|
+
}).join('');
|
|
33
|
+
return "<div class=\"".concat(wrapperClass, "\">").concat(buttonsHtml, "</div>");
|
|
34
|
+
}
|
|
35
|
+
// 공통 이벤트 처리
|
|
36
|
+
export function bindNotificationEvents(element, actions, onClose, onRemove) {
|
|
37
|
+
element.addEventListener('click', function (event) {
|
|
38
|
+
var target = event.target;
|
|
39
|
+
// 닫기 버튼 클릭 처리
|
|
40
|
+
if (target.matches(".".concat(CLASS_NAMES.FULL_WIDTH.CLOSE_BUTTON, ", .").concat(CLASS_NAMES.FLOATING.CLOSE_BUTTON)) || target.closest(".".concat(CLASS_NAMES.FULL_WIDTH.CLOSE_BUTTON, ", .").concat(CLASS_NAMES.FLOATING.CLOSE_BUTTON))) {
|
|
41
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
42
|
+
onRemove === null || onRemove === void 0 ? void 0 : onRemove();
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
// 액션 버튼 클릭 처리
|
|
46
|
+
var actionButton = target.closest('.ncua-notification__action-button[data-action]');
|
|
47
|
+
if (actionButton && actions) {
|
|
48
|
+
var actionData = actionButton.getAttribute('data-action');
|
|
49
|
+
if (actionData) {
|
|
50
|
+
var matchedAction = null;
|
|
51
|
+
for (var _i = 0, actions_1 = actions; _i < actions_1.length; _i++) {
|
|
52
|
+
var action = actions_1[_i];
|
|
53
|
+
var expectedDataAction = "".concat(action.label, "-").concat(action.hierarchy || 'link');
|
|
54
|
+
if (actionData === expectedDataAction) {
|
|
55
|
+
matchedAction = action;
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (matchedAction === null || matchedAction === void 0 ? void 0 : matchedAction.onClick) {
|
|
60
|
+
matchedAction.onClick();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
// 자동 닫기 설정
|
|
67
|
+
export function setupAutoClose(autoClose, onClose, onRemove) {
|
|
68
|
+
if (autoClose > 0) {
|
|
69
|
+
return window.setTimeout(function () {
|
|
70
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
71
|
+
onRemove === null || onRemove === void 0 ? void 0 : onRemove();
|
|
72
|
+
}, autoClose);
|
|
73
|
+
}
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
// Mobile detection utility
|
|
77
|
+
export var isMobile = function () {
|
|
78
|
+
return window.innerWidth <= parseInt(BREAKPOINT.mobile);
|
|
79
|
+
};
|