@ncds/ui-admin 1.3.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/assets/scripts/comboBox.js +280 -0
- package/dist/cjs/assets/scripts/datePicker.js +231 -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 +255 -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/MessageNotification.js +146 -0
- package/dist/cjs/assets/scripts/notification/Notification.js +116 -0
- package/dist/cjs/assets/scripts/notification/const/classNames.js +50 -0
- package/dist/cjs/assets/scripts/notification/const/icons.js +45 -0
- package/dist/cjs/assets/scripts/notification/const/index.js +87 -0
- package/dist/cjs/assets/scripts/notification/const/sizes.js +54 -0
- package/dist/cjs/assets/scripts/notification/const/types.js +14 -0
- package/dist/cjs/assets/scripts/notification/index.js +92 -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 +368 -0
- package/dist/cjs/assets/scripts/utils/selectbox/SelectBoxController.js +681 -0
- package/dist/cjs/assets/scripts/utils/selectbox/UnifiedSelectBox.js +711 -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/button/ButtonStepper.js +22 -0
- package/dist/cjs/src/components/button/index.js +22 -0
- 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 +126 -24
- package/dist/cjs/src/components/date-picker/RangeDatePicker.js +3 -1
- package/dist/cjs/src/components/date-picker/RangeDatePickerWithButtons.js +7 -3
- 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/NumberInput.js +130 -0
- package/dist/cjs/src/components/input/Textarea.js +12 -20
- package/dist/cjs/src/components/input/index.js +11 -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/notification/MessageNotification.js +137 -0
- package/dist/cjs/src/components/notification/Notification.js +23 -9
- package/dist/cjs/src/components/notification/index.js +11 -0
- 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 +138 -30
- 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 +275 -0
- package/dist/esm/assets/scripts/datePicker.js +228 -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 +250 -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/MessageNotification.js +141 -0
- package/dist/esm/assets/scripts/notification/Notification.js +111 -0
- package/dist/esm/assets/scripts/notification/const/classNames.js +44 -0
- package/dist/esm/assets/scripts/notification/const/icons.js +39 -0
- package/dist/esm/assets/scripts/notification/const/index.js +4 -0
- package/dist/esm/assets/scripts/notification/const/sizes.js +48 -0
- package/dist/esm/assets/scripts/notification/const/types.js +8 -0
- package/dist/esm/assets/scripts/notification/index.js +11 -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 +363 -0
- package/dist/esm/assets/scripts/utils/selectbox/SelectBoxController.js +676 -0
- package/dist/esm/assets/scripts/utils/selectbox/UnifiedSelectBox.js +706 -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/button/ButtonStepper.js +14 -0
- package/dist/esm/src/components/button/index.js +3 -1
- 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 +127 -25
- package/dist/esm/src/components/date-picker/RangeDatePicker.js +3 -1
- package/dist/esm/src/components/date-picker/RangeDatePickerWithButtons.js +7 -3
- 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/NumberInput.js +124 -0
- package/dist/esm/src/components/input/Textarea.js +12 -20
- package/dist/esm/src/components/input/index.js +2 -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/notification/MessageNotification.js +130 -0
- package/dist/esm/src/components/notification/Notification.js +23 -9
- package/dist/esm/src/components/notification/index.js +2 -1
- 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 +139 -31
- 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 +91 -0
- package/dist/types/assets/scripts/datePicker.d.ts +17 -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/MessageNotification.d.ts +23 -0
- package/dist/types/assets/scripts/notification/Notification.d.ts +22 -0
- package/dist/types/assets/scripts/notification/const/classNames.d.ts +44 -0
- package/dist/types/assets/scripts/notification/const/icons.d.ts +26 -0
- package/dist/types/assets/scripts/notification/const/index.d.ts +6 -0
- package/dist/types/assets/scripts/notification/const/sizes.d.ts +33 -0
- package/dist/types/assets/scripts/notification/const/types.d.ts +20 -0
- package/dist/types/assets/scripts/notification/index.d.ts +8 -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 +158 -0
- package/dist/types/assets/scripts/utils/selectbox/SelectBoxController.d.ts +171 -0
- package/dist/types/assets/scripts/utils/selectbox/UnifiedSelectBox.d.ts +99 -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/button/ButtonStepper.d.ts +10 -0
- package/dist/types/src/components/button/index.d.ts +2 -0
- 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 +3 -0
- package/dist/types/src/components/date-picker/RangeDatePickerWithButtons.d.ts +4 -4
- 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/NumberInput.d.ts +10 -0
- package/dist/types/src/components/input/index.d.ts +1 -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/MessageNotification.d.ts +40 -0
- package/dist/types/src/components/notification/Notification.d.ts +14 -3
- package/dist/types/src/components/notification/index.d.ts +1 -0
- 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 +7 -3
- 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 +2065 -397
- package/package.json +8 -4
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SelectBox = void 0;
|
|
7
|
+
var _UnifiedSelectBox = require("./utils/selectbox/UnifiedSelectBox");
|
|
8
|
+
var __assign = void 0 && (void 0).__assign || function () {
|
|
9
|
+
__assign = Object.assign || function (t) {
|
|
10
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
11
|
+
s = arguments[i];
|
|
12
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
13
|
+
}
|
|
14
|
+
return t;
|
|
15
|
+
};
|
|
16
|
+
return __assign.apply(this, arguments);
|
|
17
|
+
};
|
|
18
|
+
var SelectBox = exports.SelectBox = /** @class */function () {
|
|
19
|
+
function SelectBox(element, config) {
|
|
20
|
+
if (config === void 0) {
|
|
21
|
+
config = {};
|
|
22
|
+
}
|
|
23
|
+
var _this = this;
|
|
24
|
+
var _a, _b, _c, _d, _e, _f;
|
|
25
|
+
this.targetSelect = null;
|
|
26
|
+
this.isInitializing = true;
|
|
27
|
+
this.lastValue = '';
|
|
28
|
+
this.element = element;
|
|
29
|
+
// 타겟 select 요소 찾기
|
|
30
|
+
this.targetSelect = this.findTargetSelect(element);
|
|
31
|
+
// HTML에서 옵션 파싱 (config.options가 없을 경우)
|
|
32
|
+
var htmlOptions = this.parseOptionsFromHTML();
|
|
33
|
+
// JavaScript 옵션을 DropdownOption 형식으로 변환
|
|
34
|
+
var normalizedOptions = config.options ? this.normalizeOptions(config.options) : htmlOptions;
|
|
35
|
+
var finalOptions = normalizedOptions;
|
|
36
|
+
// HTML에서 속성 파싱
|
|
37
|
+
var htmlAttributes = this.parseAttributesFromHTML();
|
|
38
|
+
// 기존 API를 새 API로 변환
|
|
39
|
+
var unifiedConfig = __assign(__assign({}, config), {
|
|
40
|
+
type: 'selectbox',
|
|
41
|
+
multiple: (_a = config.multiple) !== null && _a !== void 0 ? _a : false,
|
|
42
|
+
showFooterButtons: (_b = config.showFooterButtons) !== null && _b !== void 0 ? _b : false,
|
|
43
|
+
onEdit: config.onEdit,
|
|
44
|
+
onSelectAll: config.onSelectAll,
|
|
45
|
+
onComplete: config.onComplete,
|
|
46
|
+
options: finalOptions,
|
|
47
|
+
placeholder: config.placeholder || htmlAttributes.placeholder || '선택하세요',
|
|
48
|
+
value: (_d = (_c = config.value) !== null && _c !== void 0 ? _c : htmlAttributes.value) !== null && _d !== void 0 ? _d : config.multiple ? [] : '',
|
|
49
|
+
disabled: (_f = (_e = config.disabled) !== null && _e !== void 0 ? _e : htmlAttributes.disabled) !== null && _f !== void 0 ? _f : false,
|
|
50
|
+
size: config.size || htmlAttributes.size || 'md',
|
|
51
|
+
onChange: function (value) {
|
|
52
|
+
var _a;
|
|
53
|
+
// 초기화 중에는 동기화하지 않음 (무한 루프 방지)
|
|
54
|
+
if (_this.isInitializing) {
|
|
55
|
+
_this.lastValue = value; // 초기값 저장
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
// 값이 실제로 변경되지 않았으면 동기화 생략 (무한 루프 방지)
|
|
59
|
+
if (JSON.stringify(_this.lastValue) === JSON.stringify(value)) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
_this.lastValue = value; // 새 값 저장
|
|
63
|
+
// 타겟 select와 동기화
|
|
64
|
+
if (config.multiple) {
|
|
65
|
+
_this.syncWithTargetSelectMultiple(value);
|
|
66
|
+
} else {
|
|
67
|
+
_this.syncWithTargetSelect(value);
|
|
68
|
+
}
|
|
69
|
+
// onChange 콜백에는 실제 value를 전달
|
|
70
|
+
var realValue = config.multiple ? value.map(function (v) {
|
|
71
|
+
return _this.getRealValueFromId(v);
|
|
72
|
+
}) : _this.getRealValueFromId(value);
|
|
73
|
+
(_a = config.onChange) === null || _a === void 0 ? void 0 : _a.call(config, realValue);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
this.unifiedSelectBox = new _UnifiedSelectBox.UnifiedSelectBox(element, unifiedConfig);
|
|
77
|
+
// 초기화 완료 (다음 이벤트 루프에서 실행)
|
|
78
|
+
setTimeout(function () {
|
|
79
|
+
_this.isInitializing = false;
|
|
80
|
+
}, 0);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* JavaScript 옵션을 DropdownOption 형식으로 변환
|
|
84
|
+
*/
|
|
85
|
+
SelectBox.prototype.normalizeOptions = function (options) {
|
|
86
|
+
return options.map(function (option) {
|
|
87
|
+
// 이미 DropdownOption 형식인 경우
|
|
88
|
+
if ('label' in option) {
|
|
89
|
+
return option;
|
|
90
|
+
}
|
|
91
|
+
// SelectBoxOptionType 형식인 경우 (text -> label 변환)
|
|
92
|
+
var selectBoxOption = option;
|
|
93
|
+
return {
|
|
94
|
+
id: selectBoxOption.id,
|
|
95
|
+
label: selectBoxOption.text,
|
|
96
|
+
disabled: selectBoxOption.disabled
|
|
97
|
+
};
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* 타겟 select 요소 찾기
|
|
102
|
+
*/
|
|
103
|
+
SelectBox.prototype.findTargetSelect = function (element) {
|
|
104
|
+
// 1. 직접 select 태그인 경우
|
|
105
|
+
if (element.tagName === 'SELECT') {
|
|
106
|
+
return element;
|
|
107
|
+
}
|
|
108
|
+
// 2. 자식으로 select 태그가 있는 경우
|
|
109
|
+
var selectChild = element.querySelector('select');
|
|
110
|
+
if (selectChild) {
|
|
111
|
+
return selectChild;
|
|
112
|
+
}
|
|
113
|
+
// 3. data-target 속성으로 지정된 경우
|
|
114
|
+
var targetId = element.getAttribute('data-target');
|
|
115
|
+
if (targetId) {
|
|
116
|
+
var targetElement = document.getElementById(targetId);
|
|
117
|
+
if (targetElement && targetElement.tagName === 'SELECT') {
|
|
118
|
+
return targetElement;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return null;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* HTML select에서 옵션 파싱
|
|
125
|
+
*/
|
|
126
|
+
SelectBox.prototype.parseOptionsFromHTML = function () {
|
|
127
|
+
if (!this.targetSelect) return [];
|
|
128
|
+
var options = [];
|
|
129
|
+
var optionElements = this.targetSelect.querySelectorAll('option');
|
|
130
|
+
// 빈 값 옵션 개수 확인 (최적화를 위해)
|
|
131
|
+
var emptyValueCount = Array.from(optionElements).filter(function (opt) {
|
|
132
|
+
return opt.value === '';
|
|
133
|
+
}).length;
|
|
134
|
+
optionElements.forEach(function (optionElement, index) {
|
|
135
|
+
var optionValue = optionElement.value;
|
|
136
|
+
// 빈 값 옵션이 1개뿐이면 단순 처리, 여러 개면 고유 ID 생성
|
|
137
|
+
var optionId;
|
|
138
|
+
if (optionValue !== '') {
|
|
139
|
+
optionId = optionValue;
|
|
140
|
+
} else if (emptyValueCount === 1) {
|
|
141
|
+
// 빈 값 옵션이 하나뿐이면 그냥 빈 문자열 사용 (단순화)
|
|
142
|
+
optionId = '';
|
|
143
|
+
} else {
|
|
144
|
+
// 빈 값 옵션이 여러 개면 고유 ID 생성 (구분 필요)
|
|
145
|
+
optionId = "__empty_option_".concat(index);
|
|
146
|
+
}
|
|
147
|
+
options.push({
|
|
148
|
+
id: optionId,
|
|
149
|
+
label: optionElement.textContent || optionElement.value || '선택하세요',
|
|
150
|
+
disabled: optionElement.disabled,
|
|
151
|
+
// 원본 value 저장 (동기화를 위해)
|
|
152
|
+
originalValue: optionValue
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
return options;
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* HTML에서 속성 파싱
|
|
159
|
+
*/
|
|
160
|
+
SelectBox.prototype.parseAttributesFromHTML = function () {
|
|
161
|
+
var attributes = {};
|
|
162
|
+
if (this.targetSelect) {
|
|
163
|
+
// select 요소의 속성들
|
|
164
|
+
if (this.targetSelect.disabled) attributes.disabled = true;
|
|
165
|
+
if (this.targetSelect.value) attributes.value = this.targetSelect.value;
|
|
166
|
+
// placeholder는 첫 번째 빈 option에서 가져오기
|
|
167
|
+
var firstOption = this.targetSelect.querySelector('option[value=""], option:not([value])');
|
|
168
|
+
if (firstOption) {
|
|
169
|
+
attributes.placeholder = firstOption.textContent || '선택하세요';
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
// 컨테이너 요소의 data 속성들
|
|
173
|
+
var containerAttributes = this.element.dataset;
|
|
174
|
+
if (containerAttributes.placeholder) attributes.placeholder = containerAttributes.placeholder;
|
|
175
|
+
if (containerAttributes.size) attributes.size = containerAttributes.size;
|
|
176
|
+
if (containerAttributes.disabled === 'true') attributes.disabled = true;
|
|
177
|
+
return attributes;
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* ID로부터 실제 HTML select의 value 값을 가져오기
|
|
181
|
+
*/
|
|
182
|
+
SelectBox.prototype.getRealValueFromId = function (id) {
|
|
183
|
+
var options = this.unifiedSelectBox.getOptions();
|
|
184
|
+
var option = options.find(function (opt) {
|
|
185
|
+
return opt.id === id;
|
|
186
|
+
});
|
|
187
|
+
// originalValue가 있으면 그것을 사용, 없으면 id를 문자열로 변환
|
|
188
|
+
return (option === null || option === void 0 ? void 0 : option.originalValue) !== undefined ? option.originalValue : String(id);
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* 실제 HTML select의 value 값으로부터 내부 ID를 가져오기
|
|
192
|
+
*/
|
|
193
|
+
SelectBox.prototype.getIdFromRealValue = function (value) {
|
|
194
|
+
var options = this.unifiedSelectBox.getOptions();
|
|
195
|
+
var option = options.find(function (opt) {
|
|
196
|
+
return opt.originalValue === String(value);
|
|
197
|
+
});
|
|
198
|
+
// originalValue가 일치하는 옵션을 찾으면 그 ID를 반환, 없으면 value 그대로 반환
|
|
199
|
+
return option ? option.id : value;
|
|
200
|
+
};
|
|
201
|
+
/**
|
|
202
|
+
* 타겟 select와 동기화 (Single 모드)
|
|
203
|
+
*/
|
|
204
|
+
SelectBox.prototype.syncWithTargetSelect = function (value) {
|
|
205
|
+
if (this.targetSelect) {
|
|
206
|
+
// originalValue가 있는 옵션을 찾아서 실제 value로 변환
|
|
207
|
+
var realValue = this.getRealValueFromId(value);
|
|
208
|
+
this.targetSelect.value = realValue;
|
|
209
|
+
// select 요소의 change 이벤트 발생
|
|
210
|
+
var event_1 = new Event('change', {
|
|
211
|
+
bubbles: true
|
|
212
|
+
});
|
|
213
|
+
this.targetSelect.dispatchEvent(event_1);
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
/**
|
|
217
|
+
* 타겟 select와 동기화 (Multiple 모드)
|
|
218
|
+
*/
|
|
219
|
+
SelectBox.prototype.syncWithTargetSelectMultiple = function (values) {
|
|
220
|
+
var _this = this;
|
|
221
|
+
if (this.targetSelect && this.targetSelect.multiple) {
|
|
222
|
+
// 모든 옵션 선택 해제
|
|
223
|
+
Array.from(this.targetSelect.options).forEach(function (option) {
|
|
224
|
+
option.selected = false;
|
|
225
|
+
});
|
|
226
|
+
// 선택된 값들에 해당하는 옵션들 선택
|
|
227
|
+
values.forEach(function (value) {
|
|
228
|
+
var realValue = _this.getRealValueFromId(value);
|
|
229
|
+
var option = _this.targetSelect.querySelector("option[value=\"".concat(realValue, "\"]"));
|
|
230
|
+
if (option) {
|
|
231
|
+
option.selected = true;
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
// select 요소의 change 이벤트 발생
|
|
235
|
+
var event_2 = new Event('change', {
|
|
236
|
+
bubbles: true
|
|
237
|
+
});
|
|
238
|
+
this.targetSelect.dispatchEvent(event_2);
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
// 기존 API 호환성 메서드들
|
|
242
|
+
SelectBox.prototype.getValues = function () {
|
|
243
|
+
var _this = this;
|
|
244
|
+
var internalValue = this.unifiedSelectBox.getValues();
|
|
245
|
+
return internalValue.map(function (option) {
|
|
246
|
+
return __assign(__assign({}, option), {
|
|
247
|
+
id: _this.getRealValueFromId(option.id)
|
|
248
|
+
});
|
|
249
|
+
});
|
|
250
|
+
};
|
|
251
|
+
SelectBox.prototype.setValues = function (value) {
|
|
252
|
+
var _this = this;
|
|
253
|
+
var internalValue = value.map(function (v) {
|
|
254
|
+
return _this.getIdFromRealValue(v.id);
|
|
255
|
+
});
|
|
256
|
+
if (JSON.stringify(this.lastValue) === JSON.stringify(internalValue)) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
this.lastValue = internalValue;
|
|
260
|
+
// id 배열을 옵션 객체 배열로 변환
|
|
261
|
+
var allOptions = this.unifiedSelectBox.getOptions();
|
|
262
|
+
var optionArray = internalValue.map(function (id) {
|
|
263
|
+
return allOptions.find(function (opt) {
|
|
264
|
+
return opt.id === id;
|
|
265
|
+
});
|
|
266
|
+
}).filter(function (opt) {
|
|
267
|
+
return opt !== undefined;
|
|
268
|
+
});
|
|
269
|
+
this.unifiedSelectBox.setValues(optionArray);
|
|
270
|
+
// setValues 호출 시에도 타겟 select와 동기화
|
|
271
|
+
if (this.targetSelect) {
|
|
272
|
+
if (this.unifiedSelectBox.isMultiple()) {
|
|
273
|
+
this.syncWithTargetSelectMultiple(internalValue);
|
|
274
|
+
} else {
|
|
275
|
+
// 단일 선택 모드인 경우 첫 번째 값만 사용
|
|
276
|
+
this.syncWithTargetSelect(internalValue[0] || '');
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
SelectBox.prototype.getOptions = function () {
|
|
281
|
+
return this.unifiedSelectBox.getOptions();
|
|
282
|
+
};
|
|
283
|
+
SelectBox.prototype.updateOptions = function (newOptions) {
|
|
284
|
+
this.unifiedSelectBox.updateOptions(newOptions);
|
|
285
|
+
};
|
|
286
|
+
SelectBox.prototype.setDisabled = function (disabled) {
|
|
287
|
+
this.unifiedSelectBox.setDisabled(disabled);
|
|
288
|
+
};
|
|
289
|
+
SelectBox.prototype.open = function () {
|
|
290
|
+
this.unifiedSelectBox.open();
|
|
291
|
+
};
|
|
292
|
+
SelectBox.prototype.close = function () {
|
|
293
|
+
this.unifiedSelectBox.close();
|
|
294
|
+
};
|
|
295
|
+
SelectBox.prototype.focus = function () {
|
|
296
|
+
this.unifiedSelectBox.focus();
|
|
297
|
+
};
|
|
298
|
+
SelectBox.prototype.destroy = function () {
|
|
299
|
+
this.unifiedSelectBox.destroy();
|
|
300
|
+
};
|
|
301
|
+
// Multiple 모드 전용 메서드들
|
|
302
|
+
SelectBox.prototype.selectAll = function () {
|
|
303
|
+
this.unifiedSelectBox.selectAll();
|
|
304
|
+
};
|
|
305
|
+
SelectBox.prototype.deselectAll = function () {
|
|
306
|
+
this.unifiedSelectBox.deselectAll();
|
|
307
|
+
};
|
|
308
|
+
SelectBox.prototype.getSelectedCount = function () {
|
|
309
|
+
var values = this.getValues();
|
|
310
|
+
return values.length;
|
|
311
|
+
};
|
|
312
|
+
SelectBox.prototype.isMultiple = function () {
|
|
313
|
+
return this.unifiedSelectBox.isMultiple();
|
|
314
|
+
};
|
|
315
|
+
SelectBox.prototype.toggleSelectAll = function () {
|
|
316
|
+
this.unifiedSelectBox.toggleSelectAll();
|
|
317
|
+
};
|
|
318
|
+
return SelectBox;
|
|
319
|
+
}();
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ButtonCloseX = ButtonCloseX;
|
|
7
|
+
exports.X_CLOSE_SVG = exports.SVG_SIZE = void 0;
|
|
8
|
+
// 공통 X버튼 로직 (React ButtonCloseX 컴포넌트와 동일한 구조)
|
|
9
|
+
// React ButtonCloseX와 동일한 SVG 사이즈 매핑
|
|
10
|
+
var SVG_SIZE = exports.SVG_SIZE = {
|
|
11
|
+
xs: 16,
|
|
12
|
+
sm: 20,
|
|
13
|
+
md: 20,
|
|
14
|
+
lg: 24
|
|
15
|
+
};
|
|
16
|
+
// X버튼 SVG 아이콘
|
|
17
|
+
var X_CLOSE_SVG = function (size) {
|
|
18
|
+
return "<svg width=\"".concat(size, "\" height=\"").concat(size, "\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>");
|
|
19
|
+
};
|
|
20
|
+
// X버튼 렌더링 유틸리티 (React ButtonCloseX와 동일한 인터페이스)
|
|
21
|
+
exports.X_CLOSE_SVG = X_CLOSE_SVG;
|
|
22
|
+
function ButtonCloseX(size, theme, additionalClasses, ariaLabel, onClick) {
|
|
23
|
+
if (theme === void 0) {
|
|
24
|
+
theme = 'light';
|
|
25
|
+
}
|
|
26
|
+
if (additionalClasses === void 0) {
|
|
27
|
+
additionalClasses = '';
|
|
28
|
+
}
|
|
29
|
+
if (ariaLabel === void 0) {
|
|
30
|
+
ariaLabel = '닫기';
|
|
31
|
+
}
|
|
32
|
+
var svgSize = SVG_SIZE[size];
|
|
33
|
+
var buttonId = "close-btn-".concat(Math.random().toString(36).substr(2, 9));
|
|
34
|
+
var buttonHTML = "\n <button type=\"button\" id=\"".concat(buttonId, "\" class=\"ncua-button-close-x ncua-button-close-x--").concat(size, " ncua-button-close-x--").concat(theme, " ").concat(additionalClasses, "\" aria-label=\"").concat(ariaLabel, "\">\n ").concat(X_CLOSE_SVG(svgSize.toString()), "\n </button>\n ");
|
|
35
|
+
// onClick이 제공된 경우 이벤트 바인딩
|
|
36
|
+
if (onClick) {
|
|
37
|
+
// DOM에 추가된 후 이벤트 바인딩을 위해 setTimeout 사용
|
|
38
|
+
setTimeout(function () {
|
|
39
|
+
var button = document.getElementById(buttonId);
|
|
40
|
+
if (button) {
|
|
41
|
+
button.addEventListener('click', onClick);
|
|
42
|
+
}
|
|
43
|
+
}, 0);
|
|
44
|
+
}
|
|
45
|
+
return buttonHTML;
|
|
46
|
+
}
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Tag = void 0;
|
|
7
|
+
var _classNames = require("./const/classNames");
|
|
8
|
+
var _sizes = require("./const/sizes");
|
|
9
|
+
var __assign = void 0 && (void 0).__assign || function () {
|
|
10
|
+
__assign = Object.assign || function (t) {
|
|
11
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
12
|
+
s = arguments[i];
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
14
|
+
}
|
|
15
|
+
return t;
|
|
16
|
+
};
|
|
17
|
+
return __assign.apply(this, arguments);
|
|
18
|
+
};
|
|
19
|
+
// CSS 변수 값을 가져오는 유틸리티 함수
|
|
20
|
+
var getCSSVariable = function (variableName, fallback) {
|
|
21
|
+
if (fallback === void 0) {
|
|
22
|
+
fallback = '';
|
|
23
|
+
}
|
|
24
|
+
return getComputedStyle(document.documentElement).getPropertyValue(variableName).trim() || fallback;
|
|
25
|
+
};
|
|
26
|
+
// 위치 계산 로직
|
|
27
|
+
var calculateOptimalPosition = function (triggerElement, tooltipElement) {
|
|
28
|
+
var triggerRect = triggerElement.getBoundingClientRect();
|
|
29
|
+
var tooltipRect = tooltipElement.getBoundingClientRect();
|
|
30
|
+
var viewportWidth = window.innerWidth,
|
|
31
|
+
viewportHeight = window.innerHeight;
|
|
32
|
+
var tooltipWidth = tooltipRect.width || _sizes.DEFAULT_TOOLTIP_WIDTH;
|
|
33
|
+
var tooltipHeight = tooltipRect.height || _sizes.DEFAULT_TOOLTIP_HEIGHT;
|
|
34
|
+
var spaces = {
|
|
35
|
+
top: triggerRect.top,
|
|
36
|
+
bottom: viewportHeight - triggerRect.bottom,
|
|
37
|
+
left: triggerRect.left,
|
|
38
|
+
right: viewportWidth - triggerRect.right
|
|
39
|
+
};
|
|
40
|
+
// 위/아래 공간을 먼저 확인하고 우선순위 결정
|
|
41
|
+
var hasTopSpace = spaces.top >= tooltipHeight + _sizes.MARGIN;
|
|
42
|
+
// 위쪽 공간이 있으면 top 우선, 없으면 bottom 우선
|
|
43
|
+
var positions = hasTopSpace ? ['top-right', 'top-left', 'bottom-right', 'bottom-left'] : ['bottom-right', 'bottom-left', 'top-right', 'top-left'];
|
|
44
|
+
for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
|
|
45
|
+
var position = positions_1[_i];
|
|
46
|
+
var isTop = position.includes('top');
|
|
47
|
+
var isRight = position.includes('right');
|
|
48
|
+
var hasVerticalSpace = isTop ? spaces.top >= tooltipHeight + _sizes.MARGIN : spaces.bottom >= tooltipHeight + _sizes.MARGIN;
|
|
49
|
+
var hasHorizontalSpace = isRight ? spaces.right >= tooltipWidth + _sizes.MARGIN // right 정렬: 툴팁이 오른쪽으로 펼쳐짐
|
|
50
|
+
: spaces.left >= tooltipWidth + _sizes.MARGIN; // left 정렬: 툴팁이 왼쪽으로 펼쳐짐
|
|
51
|
+
if (hasVerticalSpace && hasHorizontalSpace) {
|
|
52
|
+
return position;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
// 모든 조건이 맞지 않으면 공간이 더 많은 쪽으로
|
|
56
|
+
var fallbackPosition = hasTopSpace ? 'top-right' : 'bottom-right';
|
|
57
|
+
return fallbackPosition;
|
|
58
|
+
};
|
|
59
|
+
var Tag = exports.Tag = /** @class */function () {
|
|
60
|
+
function Tag(options) {
|
|
61
|
+
var _this = this;
|
|
62
|
+
this.isTooltipVisible = false;
|
|
63
|
+
this.calculatedPosition = 'top-right';
|
|
64
|
+
this.tooltipElement = null;
|
|
65
|
+
this.handleMouseEnter = function () {
|
|
66
|
+
if (!_this.shouldTruncate()) return;
|
|
67
|
+
_this.isTooltipVisible = true;
|
|
68
|
+
// 위치 계산
|
|
69
|
+
if (_this.tooltipElement) {
|
|
70
|
+
var optimalPosition = calculateOptimalPosition(_this.element, _this.tooltipElement);
|
|
71
|
+
_this.calculatedPosition = optimalPosition;
|
|
72
|
+
} else {
|
|
73
|
+
// 툴팁이 없으면 더미 요소로 계산
|
|
74
|
+
var dummyTooltipElement = document.createElement('div');
|
|
75
|
+
dummyTooltipElement.style.width = "".concat(_sizes.DEFAULT_TOOLTIP_WIDTH, "px");
|
|
76
|
+
dummyTooltipElement.style.height = "".concat(_sizes.DEFAULT_TOOLTIP_HEIGHT, "px");
|
|
77
|
+
var optimalPosition = calculateOptimalPosition(_this.element, dummyTooltipElement);
|
|
78
|
+
_this.calculatedPosition = optimalPosition;
|
|
79
|
+
}
|
|
80
|
+
_this.createTooltip();
|
|
81
|
+
};
|
|
82
|
+
this.handleMouseLeave = function () {
|
|
83
|
+
_this.removeTooltip(); // removeTooltip에서 isTooltipVisible을 false로 설정
|
|
84
|
+
};
|
|
85
|
+
this.options = __assign({
|
|
86
|
+
size: 'sm',
|
|
87
|
+
maxLength: 20
|
|
88
|
+
}, options);
|
|
89
|
+
this.createElement();
|
|
90
|
+
}
|
|
91
|
+
Tag.prototype.createElement = function () {
|
|
92
|
+
// 메인 태그 요소 생성
|
|
93
|
+
this.element = document.createElement('span');
|
|
94
|
+
this.element.className = this.getTagClasses();
|
|
95
|
+
// 텍스트 길이 체크 및 말줄임 처리
|
|
96
|
+
var shouldTruncate = this.shouldTruncate();
|
|
97
|
+
var displayText = shouldTruncate ? this.getTruncatedText() : this.options.text;
|
|
98
|
+
// 아이콘 추가
|
|
99
|
+
if (this.options.icon) {
|
|
100
|
+
var iconElement = this.createSideSlot(this.options.icon);
|
|
101
|
+
if (iconElement) {
|
|
102
|
+
this.element.appendChild(iconElement);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
// 텍스트 요소 생성
|
|
106
|
+
var textElement = document.createElement('span');
|
|
107
|
+
textElement.className = _classNames.TAG_CLASS_NAMES.text;
|
|
108
|
+
textElement.textContent = displayText;
|
|
109
|
+
this.element.appendChild(textElement);
|
|
110
|
+
// 카운트 추가
|
|
111
|
+
if (this.options.count) {
|
|
112
|
+
var countElement = document.createElement('span');
|
|
113
|
+
countElement.className = _classNames.TAG_CLASS_NAMES.count;
|
|
114
|
+
countElement.textContent = this.options.count;
|
|
115
|
+
this.element.appendChild(countElement);
|
|
116
|
+
}
|
|
117
|
+
// 닫기 버튼 추가
|
|
118
|
+
if (this.options.close) {
|
|
119
|
+
var closeButton = this.createCloseButton();
|
|
120
|
+
this.element.appendChild(closeButton);
|
|
121
|
+
}
|
|
122
|
+
// 툴팁 이벤트 리스너 추가 (텍스트가 잘린 경우에만)
|
|
123
|
+
if (shouldTruncate) {
|
|
124
|
+
this.element.addEventListener('mouseenter', this.handleMouseEnter);
|
|
125
|
+
this.element.addEventListener('mouseleave', this.handleMouseLeave);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
Tag.prototype.getTagClasses = function () {
|
|
129
|
+
var classes = [_classNames.TAG_CLASS_NAMES.tag, (0, _classNames.getTagSizeClassName)(this.options.size)];
|
|
130
|
+
if (this.shouldTruncate()) {
|
|
131
|
+
classes.push(_classNames.TAG_CLASS_NAMES.truncated);
|
|
132
|
+
}
|
|
133
|
+
return classes.join(' ');
|
|
134
|
+
};
|
|
135
|
+
Tag.prototype.shouldTruncate = function () {
|
|
136
|
+
return this.options.text.length > this.options.maxLength;
|
|
137
|
+
};
|
|
138
|
+
Tag.prototype.getTruncatedText = function () {
|
|
139
|
+
return "".concat(this.options.text.slice(0, this.options.maxLength - 2), "...");
|
|
140
|
+
};
|
|
141
|
+
Tag.prototype.createSideSlot = function (slot) {
|
|
142
|
+
if (slot.type === 'icon') {
|
|
143
|
+
// 아이콘 SVG 문자열을 DOM 요소로 변환 (DOMParser 사용)
|
|
144
|
+
var iconSVG = this.createIconSVG(slot.icon, _sizes.iconSize[this.options.size], slot.color);
|
|
145
|
+
var parser = new DOMParser();
|
|
146
|
+
var doc = parser.parseFromString(iconSVG, 'image/svg+xml');
|
|
147
|
+
return doc.documentElement;
|
|
148
|
+
}
|
|
149
|
+
if (slot.type === 'dot') {
|
|
150
|
+
var dotElement = document.createElement('span');
|
|
151
|
+
dotElement.className = "ncua-dot ncua-dot--neutral ncua-dot--".concat(slot.size || 'sm');
|
|
152
|
+
if (slot.color) {
|
|
153
|
+
dotElement.style.backgroundColor = slot.color;
|
|
154
|
+
}
|
|
155
|
+
return dotElement;
|
|
156
|
+
}
|
|
157
|
+
// 커스텀 요소는 그대로 반환
|
|
158
|
+
return slot.children;
|
|
159
|
+
};
|
|
160
|
+
Tag.prototype.createIconSVG = function (iconName, size, color) {
|
|
161
|
+
var colorStyle = color ? " style=\"color: ".concat(color, "\"") : '';
|
|
162
|
+
// 현재는 arrow-left 아이콘만 지원
|
|
163
|
+
if (iconName === 'arrow-left') {
|
|
164
|
+
return "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"".concat(size, "\" height=\"").concat(size, "\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"none\"").concat(colorStyle, ">\n <path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M19 12H5m0 0 7 7m-7-7 7-7\" />\n </svg>");
|
|
165
|
+
}
|
|
166
|
+
// 기본 빈 SVG
|
|
167
|
+
return "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"".concat(size, "\" height=\"").concat(size, "\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"none\"").concat(colorStyle, "></svg>");
|
|
168
|
+
};
|
|
169
|
+
Tag.prototype.createCloseButton = function () {
|
|
170
|
+
// react와 동일한 구조로 직접 구현
|
|
171
|
+
var button = document.createElement('button');
|
|
172
|
+
button.type = 'button';
|
|
173
|
+
button.className = _classNames.TAG_CLASS_NAMES.close;
|
|
174
|
+
// React 버전과 동일한 SVG 생성 (문자열 방식)
|
|
175
|
+
var grayColor = getCSSVariable('--gray-300', '#a4a5a8');
|
|
176
|
+
var svgString = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"".concat(_sizes.iconSize[this.options.size], "\" height=\"").concat(_sizes.iconSize[this.options.size], "\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"none\" style=\"color: ").concat(grayColor, "\">\n <path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M18 6 6 18M6 6l12 12\" />\n </svg>");
|
|
177
|
+
// DOMParser로 SVG 문자열을 DOM 요소로 변환
|
|
178
|
+
var parser = new DOMParser();
|
|
179
|
+
var doc = parser.parseFromString(svgString, 'image/svg+xml');
|
|
180
|
+
var svg = doc.documentElement;
|
|
181
|
+
button.appendChild(svg);
|
|
182
|
+
// 이벤트 리스너 추가
|
|
183
|
+
if (this.options.onButtonClick) {
|
|
184
|
+
button.addEventListener('click', this.options.onButtonClick);
|
|
185
|
+
}
|
|
186
|
+
return button;
|
|
187
|
+
};
|
|
188
|
+
Tag.prototype.createTooltip = function () {
|
|
189
|
+
if (this.tooltipElement || !this.isTooltipVisible) {
|
|
190
|
+
return; // 이미 생성됨 또는 표시하지 않음
|
|
191
|
+
}
|
|
192
|
+
this.tooltipElement = document.createElement('span');
|
|
193
|
+
this.tooltipElement.className = "".concat(_classNames.TAG_CLASS_NAMES.tooltip, " ").concat((0, _classNames.getTooltipPositionClassName)(this.calculatedPosition));
|
|
194
|
+
var tooltipContent = document.createElement('span');
|
|
195
|
+
tooltipContent.className = _classNames.TAG_CLASS_NAMES.tooltipContent;
|
|
196
|
+
tooltipContent.textContent = this.options.text;
|
|
197
|
+
this.tooltipElement.appendChild(tooltipContent);
|
|
198
|
+
this.element.appendChild(this.tooltipElement);
|
|
199
|
+
};
|
|
200
|
+
Tag.prototype.removeTooltip = function () {
|
|
201
|
+
if (this.tooltipElement) {
|
|
202
|
+
this.element.removeChild(this.tooltipElement);
|
|
203
|
+
this.tooltipElement = null;
|
|
204
|
+
}
|
|
205
|
+
this.isTooltipVisible = false;
|
|
206
|
+
};
|
|
207
|
+
Tag.prototype.getElement = function () {
|
|
208
|
+
return this.element;
|
|
209
|
+
};
|
|
210
|
+
Tag.prototype.isTooltipShown = function () {
|
|
211
|
+
return this.isTooltipVisible;
|
|
212
|
+
};
|
|
213
|
+
Tag.prototype.setText = function (text) {
|
|
214
|
+
this.options.text = text;
|
|
215
|
+
this.updateTextElement();
|
|
216
|
+
};
|
|
217
|
+
Tag.prototype.setCount = function (count) {
|
|
218
|
+
this.options.count = count;
|
|
219
|
+
this.updateCountElement();
|
|
220
|
+
};
|
|
221
|
+
Tag.prototype.updateTextElement = function () {
|
|
222
|
+
var textElement = this.element.querySelector(".".concat(_classNames.TAG_CLASS_NAMES.text));
|
|
223
|
+
if (textElement) {
|
|
224
|
+
var shouldTruncate = this.shouldTruncate();
|
|
225
|
+
var displayText = shouldTruncate ? this.getTruncatedText() : this.options.text;
|
|
226
|
+
textElement.textContent = displayText;
|
|
227
|
+
// 클래스 업데이트
|
|
228
|
+
if (shouldTruncate) {
|
|
229
|
+
this.element.classList.add(_classNames.TAG_CLASS_NAMES.truncated);
|
|
230
|
+
} else {
|
|
231
|
+
this.element.classList.remove(_classNames.TAG_CLASS_NAMES.truncated);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
Tag.prototype.updateCountElement = function () {
|
|
236
|
+
var existingCount = this.element.querySelector(".".concat(_classNames.TAG_CLASS_NAMES.count));
|
|
237
|
+
if (this.options.count) {
|
|
238
|
+
if (existingCount) {
|
|
239
|
+
existingCount.textContent = this.options.count;
|
|
240
|
+
} else {
|
|
241
|
+
// 카운트 요소 새로 생성
|
|
242
|
+
var countElement = document.createElement('span');
|
|
243
|
+
countElement.className = _classNames.TAG_CLASS_NAMES.count;
|
|
244
|
+
countElement.textContent = this.options.count;
|
|
245
|
+
// 닫기 버튼 앞에 삽입
|
|
246
|
+
var closeButton = this.element.querySelector(".".concat(_classNames.TAG_CLASS_NAMES.close));
|
|
247
|
+
if (closeButton) {
|
|
248
|
+
this.element.insertBefore(countElement, closeButton);
|
|
249
|
+
} else {
|
|
250
|
+
this.element.appendChild(countElement);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
} else {
|
|
254
|
+
// 카운트 제거
|
|
255
|
+
if (existingCount) {
|
|
256
|
+
this.element.removeChild(existingCount);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
Tag.prototype.destroy = function () {
|
|
261
|
+
this.element.removeEventListener('mouseenter', this.handleMouseEnter);
|
|
262
|
+
this.element.removeEventListener('mouseleave', this.handleMouseLeave);
|
|
263
|
+
if (this.tooltipElement) {
|
|
264
|
+
this.removeTooltip();
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
return Tag;
|
|
268
|
+
}();
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getTooltipPositionClassName = exports.getTagSizeClassName = exports.TAG_CLASS_NAMES = void 0;
|
|
7
|
+
// Tag 관련 CSS 클래스명 상수
|
|
8
|
+
var TAG_CLASS_NAMES = exports.TAG_CLASS_NAMES = {
|
|
9
|
+
tag: 'ncua-tag',
|
|
10
|
+
text: 'ncua-tag__text',
|
|
11
|
+
count: 'ncua-tag__count',
|
|
12
|
+
close: 'ncua-tag__close',
|
|
13
|
+
tooltip: 'ncua-tag__tooltip',
|
|
14
|
+
tooltipContent: 'ncua-tag__tooltip-content',
|
|
15
|
+
truncated: 'ncua-tag--truncated'
|
|
16
|
+
};
|
|
17
|
+
var getTagSizeClassName = function (size) {
|
|
18
|
+
return "ncua-tag--".concat(size);
|
|
19
|
+
};
|
|
20
|
+
exports.getTagSizeClassName = getTagSizeClassName;
|
|
21
|
+
var getTooltipPositionClassName = function (position) {
|
|
22
|
+
return "ncua-tag__tooltip--".concat(position);
|
|
23
|
+
};
|
|
24
|
+
exports.getTooltipPositionClassName = getTooltipPositionClassName;
|