@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.
Files changed (391) hide show
  1. package/dist/cjs/assets/scripts/comboBox.js +280 -0
  2. package/dist/cjs/assets/scripts/datePicker.js +231 -60
  3. package/dist/cjs/assets/scripts/featuredIcon.js +95 -0
  4. package/dist/cjs/assets/scripts/fileInput/FileInput.js +183 -0
  5. package/dist/cjs/assets/scripts/fileInput/FileInputModel.js +246 -0
  6. package/dist/cjs/assets/scripts/fileInput/FileInputView.js +455 -0
  7. package/dist/cjs/assets/scripts/fileInput/const/classNames.js +35 -0
  8. package/dist/cjs/assets/scripts/fileInput/const/index.js +27 -0
  9. package/dist/cjs/assets/scripts/fileInput/const/types.js +13 -0
  10. package/dist/cjs/assets/scripts/fileInput/index.js +44 -0
  11. package/dist/cjs/assets/scripts/imageFileInput/ImageFileInput.js +187 -0
  12. package/dist/cjs/assets/scripts/imageFileInput/ImageFileInputModel.js +255 -0
  13. package/dist/cjs/assets/scripts/imageFileInput/ImageFileInputView.js +354 -0
  14. package/dist/cjs/assets/scripts/imageFileInput/const/classNames.js +41 -0
  15. package/dist/cjs/assets/scripts/imageFileInput/const/index.js +27 -0
  16. package/dist/cjs/assets/scripts/imageFileInput/const/types.js +13 -0
  17. package/dist/cjs/assets/scripts/imageFileInput/index.js +44 -0
  18. package/dist/cjs/assets/scripts/index.js +21 -1
  19. package/dist/cjs/assets/scripts/modal/Modal.js +116 -0
  20. package/dist/cjs/assets/scripts/modal/ModalActions.js +128 -0
  21. package/dist/cjs/assets/scripts/modal/ModalContent.js +46 -0
  22. package/dist/cjs/assets/scripts/modal/ModalHeader.js +115 -0
  23. package/dist/cjs/assets/scripts/modal/const/classNames.js +41 -0
  24. package/dist/cjs/assets/scripts/modal/const/index.js +27 -0
  25. package/dist/cjs/assets/scripts/modal/const/types.js +5 -0
  26. package/dist/cjs/assets/scripts/modal/index.js +61 -0
  27. package/dist/cjs/assets/scripts/modal/utils/contentUtils.js +35 -0
  28. package/dist/cjs/assets/scripts/notification/FloatingNotification.js +180 -0
  29. package/dist/cjs/assets/scripts/notification/FullWidthNotification.js +120 -0
  30. package/dist/cjs/assets/scripts/notification/MessageNotification.js +146 -0
  31. package/dist/cjs/assets/scripts/notification/Notification.js +116 -0
  32. package/dist/cjs/assets/scripts/notification/const/classNames.js +50 -0
  33. package/dist/cjs/assets/scripts/notification/const/icons.js +45 -0
  34. package/dist/cjs/assets/scripts/notification/const/index.js +87 -0
  35. package/dist/cjs/assets/scripts/notification/const/sizes.js +54 -0
  36. package/dist/cjs/assets/scripts/notification/const/types.js +14 -0
  37. package/dist/cjs/assets/scripts/notification/index.js +92 -0
  38. package/dist/cjs/assets/scripts/notification/utils.js +92 -0
  39. package/dist/cjs/assets/scripts/progress-bar/ProgressBar.js +272 -0
  40. package/dist/cjs/assets/scripts/progress-bar/index.js +12 -0
  41. package/dist/cjs/assets/scripts/selectBox.js +319 -0
  42. package/dist/cjs/assets/scripts/shared/ButtonCloseX.js +46 -0
  43. package/dist/cjs/assets/scripts/tag/Tag.js +268 -0
  44. package/dist/cjs/assets/scripts/tag/const/classNames.js +24 -0
  45. package/dist/cjs/assets/scripts/tag/const/index.js +38 -0
  46. package/dist/cjs/assets/scripts/tag/const/sizes.js +13 -0
  47. package/dist/cjs/assets/scripts/tag/const/types.js +5 -0
  48. package/dist/cjs/assets/scripts/tag/index.js +44 -0
  49. package/dist/cjs/assets/scripts/tooltip/Tooltip.js +380 -0
  50. package/dist/cjs/assets/scripts/tooltip/TooltipLayerManager.js +84 -0
  51. package/dist/cjs/assets/scripts/tooltip/const/classNames.js +29 -0
  52. package/dist/cjs/assets/scripts/tooltip/const/constants.js +56 -0
  53. package/dist/cjs/assets/scripts/tooltip/const/icons.js +15 -0
  54. package/dist/cjs/assets/scripts/tooltip/const/index.js +123 -0
  55. package/dist/cjs/assets/scripts/tooltip/const/templates.js +49 -0
  56. package/dist/cjs/assets/scripts/tooltip/const/types.js +5 -0
  57. package/dist/cjs/assets/scripts/tooltip/index.js +57 -0
  58. package/dist/cjs/assets/scripts/tooltip/utils.js +41 -0
  59. package/dist/cjs/assets/scripts/utils/selectbox/DOMRenderer.js +384 -0
  60. package/dist/cjs/assets/scripts/utils/selectbox/DropdownModel.js +368 -0
  61. package/dist/cjs/assets/scripts/utils/selectbox/SelectBoxController.js +681 -0
  62. package/dist/cjs/assets/scripts/utils/selectbox/UnifiedSelectBox.js +711 -0
  63. package/dist/cjs/constant/color.js +2 -0
  64. package/dist/cjs/src/components/button/Button.js +9 -35
  65. package/dist/cjs/src/components/button/ButtonGroup.js +9 -10
  66. package/dist/cjs/src/components/button/ButtonStepper.js +22 -0
  67. package/dist/cjs/src/components/button/index.js +22 -0
  68. package/dist/cjs/src/components/checkbox/Checkbox.js +20 -19
  69. package/dist/cjs/src/components/checkbox/CheckboxInput.js +22 -45
  70. package/dist/cjs/src/components/combobox/ComboBox.js +337 -0
  71. package/dist/cjs/src/components/combobox/index.js +12 -0
  72. package/dist/cjs/src/components/date-picker/CustomInput.js +52 -0
  73. package/dist/cjs/src/components/date-picker/DatePicker.js +126 -24
  74. package/dist/cjs/src/components/date-picker/RangeDatePicker.js +3 -1
  75. package/dist/cjs/src/components/date-picker/RangeDatePickerWithButtons.js +7 -3
  76. package/dist/cjs/src/components/{input → file-upload}/FileInput.js +17 -9
  77. package/dist/cjs/src/components/file-upload/index.js +16 -0
  78. package/dist/cjs/src/components/image-file-input/ImageFileInput.js +263 -0
  79. package/dist/cjs/src/components/image-file-input/components/ImagePreview.js +44 -0
  80. package/dist/cjs/src/components/image-file-input/index.js +16 -0
  81. package/dist/cjs/src/components/index.js +44 -0
  82. package/dist/cjs/src/components/input/InputBase.js +54 -10
  83. package/dist/cjs/src/components/input/NumberInput.js +130 -0
  84. package/dist/cjs/src/components/input/Textarea.js +12 -20
  85. package/dist/cjs/src/components/input/index.js +11 -11
  86. package/dist/cjs/src/components/modal/Modal.js +7 -3
  87. package/dist/cjs/src/components/notification/FloatingNotification.js +34 -3
  88. package/dist/cjs/src/components/notification/FullWidthNotification.js +54 -5
  89. package/dist/cjs/src/components/notification/MessageNotification.js +137 -0
  90. package/dist/cjs/src/components/notification/Notification.js +23 -9
  91. package/dist/cjs/src/components/notification/index.js +11 -0
  92. package/dist/cjs/src/components/pagination/NavButton.js +1 -13
  93. package/dist/cjs/src/components/pagination/Pagination.js +6 -20
  94. package/dist/cjs/src/components/progress-bar/ProgressBar.js +89 -20
  95. package/dist/cjs/src/components/progress-bar/components/SegmentBar.js +25 -0
  96. package/dist/cjs/src/components/progress-bar/components/SegmentLabels.js +74 -0
  97. package/dist/cjs/src/components/progress-bar/hooks/useProgressBar.js +119 -0
  98. package/dist/cjs/src/components/progress-bar/index.js +11 -0
  99. package/dist/cjs/src/components/progress-bar/types.js +5 -0
  100. package/dist/cjs/src/components/progress-bar/utils.js +31 -0
  101. package/dist/cjs/src/components/radio/Radio.js +5 -6
  102. package/dist/cjs/src/components/select/Select.js +7 -4
  103. package/dist/cjs/src/components/select-dropdown/SelectDropdown.js +146 -0
  104. package/dist/cjs/src/components/select-dropdown/index.js +12 -0
  105. package/dist/cjs/src/components/selectbox/SelectBox.js +283 -0
  106. package/dist/cjs/src/components/selectbox/index.js +12 -0
  107. package/dist/cjs/src/components/shared/hintText/HintText.js +1 -1
  108. package/dist/cjs/src/components/switch/Switch.js +123 -0
  109. package/dist/cjs/src/components/switch/index.js +12 -0
  110. package/dist/cjs/src/components/tab/HorizontalTab.js +8 -20
  111. package/dist/cjs/src/components/tab/TabButton.js +33 -16
  112. package/dist/cjs/src/components/tab/VerticalTab.js +15 -30
  113. package/dist/cjs/src/components/tag/Tag.js +92 -3
  114. package/dist/cjs/src/components/tooltip/Tooltip.js +138 -30
  115. package/dist/cjs/src/hooks/dropdown/index.js +47 -0
  116. package/dist/cjs/src/hooks/dropdown/useDropdown.js +109 -0
  117. package/dist/cjs/src/hooks/dropdown/useDropdownKeyboard.js +131 -0
  118. package/dist/cjs/src/hooks/dropdown/useDropdownPosition.js +27 -0
  119. package/dist/cjs/src/hooks/dropdown/useOutsideClick.js +33 -0
  120. package/dist/cjs/src/hooks/dropdown/useScrollLock.js +78 -0
  121. package/dist/cjs/src/hooks/dropdown/useWindowResize.js +52 -0
  122. package/dist/cjs/src/hooks/index.js +18 -1
  123. package/dist/cjs/src/types/dropdown/dropdown.js +5 -0
  124. package/dist/cjs/src/types/dropdown/index.js +27 -0
  125. package/dist/cjs/src/types/dropdown/option.js +5 -0
  126. package/dist/cjs/src/types/index.js +16 -0
  127. package/dist/cjs/src/utils/date-picker.js +37 -1
  128. package/dist/cjs/src/utils/dropdown/dropdownUtils.js +107 -0
  129. package/dist/cjs/src/utils/dropdown/index.js +27 -0
  130. package/dist/cjs/src/utils/dropdown/multiSelect.js +100 -0
  131. package/dist/cjs/src/utils/index.js +27 -0
  132. package/dist/esm/assets/scripts/comboBox.js +275 -0
  133. package/dist/esm/assets/scripts/datePicker.js +228 -59
  134. package/dist/esm/assets/scripts/featuredIcon.js +90 -0
  135. package/dist/esm/assets/scripts/fileInput/FileInput.js +178 -0
  136. package/dist/esm/assets/scripts/fileInput/FileInputModel.js +241 -0
  137. package/dist/esm/assets/scripts/fileInput/FileInputView.js +450 -0
  138. package/dist/esm/assets/scripts/fileInput/const/classNames.js +25 -0
  139. package/dist/esm/assets/scripts/fileInput/const/index.js +2 -0
  140. package/dist/esm/assets/scripts/fileInput/const/types.js +7 -0
  141. package/dist/esm/assets/scripts/fileInput/index.js +9 -0
  142. package/dist/esm/assets/scripts/imageFileInput/ImageFileInput.js +182 -0
  143. package/dist/esm/assets/scripts/imageFileInput/ImageFileInputModel.js +250 -0
  144. package/dist/esm/assets/scripts/imageFileInput/ImageFileInputView.js +349 -0
  145. package/dist/esm/assets/scripts/imageFileInput/const/classNames.js +30 -0
  146. package/dist/esm/assets/scripts/imageFileInput/const/index.js +2 -0
  147. package/dist/esm/assets/scripts/imageFileInput/const/types.js +7 -0
  148. package/dist/esm/assets/scripts/imageFileInput/index.js +9 -0
  149. package/dist/esm/assets/scripts/index.js +21 -1
  150. package/dist/esm/assets/scripts/modal/Modal.js +110 -0
  151. package/dist/esm/assets/scripts/modal/ModalActions.js +123 -0
  152. package/dist/esm/assets/scripts/modal/ModalContent.js +41 -0
  153. package/dist/esm/assets/scripts/modal/ModalHeader.js +110 -0
  154. package/dist/esm/assets/scripts/modal/const/classNames.js +31 -0
  155. package/dist/esm/assets/scripts/modal/const/index.js +2 -0
  156. package/dist/esm/assets/scripts/modal/const/types.js +1 -0
  157. package/dist/esm/assets/scripts/modal/index.js +15 -0
  158. package/dist/esm/assets/scripts/modal/utils/contentUtils.js +28 -0
  159. package/dist/esm/assets/scripts/notification/FloatingNotification.js +176 -0
  160. package/dist/esm/assets/scripts/notification/FullWidthNotification.js +115 -0
  161. package/dist/esm/assets/scripts/notification/MessageNotification.js +141 -0
  162. package/dist/esm/assets/scripts/notification/Notification.js +111 -0
  163. package/dist/esm/assets/scripts/notification/const/classNames.js +44 -0
  164. package/dist/esm/assets/scripts/notification/const/icons.js +39 -0
  165. package/dist/esm/assets/scripts/notification/const/index.js +4 -0
  166. package/dist/esm/assets/scripts/notification/const/sizes.js +48 -0
  167. package/dist/esm/assets/scripts/notification/const/types.js +8 -0
  168. package/dist/esm/assets/scripts/notification/index.js +11 -0
  169. package/dist/esm/assets/scripts/notification/utils.js +79 -0
  170. package/dist/esm/assets/scripts/progress-bar/ProgressBar.js +267 -0
  171. package/dist/esm/assets/scripts/progress-bar/index.js +1 -0
  172. package/dist/esm/assets/scripts/selectBox.js +314 -0
  173. package/dist/esm/assets/scripts/shared/ButtonCloseX.js +38 -0
  174. package/dist/esm/assets/scripts/tag/Tag.js +263 -0
  175. package/dist/esm/assets/scripts/tag/const/classNames.js +16 -0
  176. package/dist/esm/assets/scripts/tag/const/index.js +3 -0
  177. package/dist/esm/assets/scripts/tag/const/sizes.js +7 -0
  178. package/dist/esm/assets/scripts/tag/const/types.js +1 -0
  179. package/dist/esm/assets/scripts/tag/index.js +9 -0
  180. package/dist/esm/assets/scripts/tooltip/Tooltip.js +375 -0
  181. package/dist/esm/assets/scripts/tooltip/TooltipLayerManager.js +79 -0
  182. package/dist/esm/assets/scripts/tooltip/const/classNames.js +23 -0
  183. package/dist/esm/assets/scripts/tooltip/const/constants.js +50 -0
  184. package/dist/esm/assets/scripts/tooltip/const/icons.js +9 -0
  185. package/dist/esm/assets/scripts/tooltip/const/index.js +4 -0
  186. package/dist/esm/assets/scripts/tooltip/const/templates.js +42 -0
  187. package/dist/esm/assets/scripts/tooltip/const/types.js +1 -0
  188. package/dist/esm/assets/scripts/tooltip/index.js +10 -0
  189. package/dist/esm/assets/scripts/tooltip/utils.js +35 -0
  190. package/dist/esm/assets/scripts/utils/selectbox/DOMRenderer.js +379 -0
  191. package/dist/esm/assets/scripts/utils/selectbox/DropdownModel.js +363 -0
  192. package/dist/esm/assets/scripts/utils/selectbox/SelectBoxController.js +676 -0
  193. package/dist/esm/assets/scripts/utils/selectbox/UnifiedSelectBox.js +706 -0
  194. package/dist/esm/constant/color.js +2 -0
  195. package/dist/esm/src/components/button/Button.js +10 -36
  196. package/dist/esm/src/components/button/ButtonGroup.js +9 -10
  197. package/dist/esm/src/components/button/ButtonStepper.js +14 -0
  198. package/dist/esm/src/components/button/index.js +3 -1
  199. package/dist/esm/src/components/checkbox/Checkbox.js +21 -19
  200. package/dist/esm/src/components/checkbox/CheckboxInput.js +24 -47
  201. package/dist/esm/src/components/combobox/ComboBox.js +330 -0
  202. package/dist/esm/src/components/combobox/index.js +1 -0
  203. package/dist/esm/src/components/date-picker/CustomInput.js +45 -0
  204. package/dist/esm/src/components/date-picker/DatePicker.js +127 -25
  205. package/dist/esm/src/components/date-picker/RangeDatePicker.js +3 -1
  206. package/dist/esm/src/components/date-picker/RangeDatePickerWithButtons.js +7 -3
  207. package/dist/esm/src/components/{input → file-upload}/FileInput.js +17 -9
  208. package/dist/esm/src/components/file-upload/index.js +1 -0
  209. package/dist/esm/src/components/image-file-input/ImageFileInput.js +256 -0
  210. package/dist/esm/src/components/image-file-input/components/ImagePreview.js +37 -0
  211. package/dist/esm/src/components/image-file-input/index.js +1 -0
  212. package/dist/esm/src/components/index.js +4 -0
  213. package/dist/esm/src/components/input/InputBase.js +55 -11
  214. package/dist/esm/src/components/input/NumberInput.js +124 -0
  215. package/dist/esm/src/components/input/Textarea.js +12 -20
  216. package/dist/esm/src/components/input/index.js +2 -2
  217. package/dist/esm/src/components/modal/Modal.js +7 -3
  218. package/dist/esm/src/components/notification/FloatingNotification.js +35 -4
  219. package/dist/esm/src/components/notification/FullWidthNotification.js +55 -6
  220. package/dist/esm/src/components/notification/MessageNotification.js +130 -0
  221. package/dist/esm/src/components/notification/Notification.js +23 -9
  222. package/dist/esm/src/components/notification/index.js +2 -1
  223. package/dist/esm/src/components/pagination/NavButton.js +1 -13
  224. package/dist/esm/src/components/pagination/Pagination.js +6 -20
  225. package/dist/esm/src/components/progress-bar/ProgressBar.js +89 -20
  226. package/dist/esm/src/components/progress-bar/components/SegmentBar.js +18 -0
  227. package/dist/esm/src/components/progress-bar/components/SegmentLabels.js +66 -0
  228. package/dist/esm/src/components/progress-bar/hooks/useProgressBar.js +112 -0
  229. package/dist/esm/src/components/progress-bar/index.js +2 -1
  230. package/dist/esm/src/components/progress-bar/types.js +1 -0
  231. package/dist/esm/src/components/progress-bar/utils.js +22 -0
  232. package/dist/esm/src/components/radio/Radio.js +5 -5
  233. package/dist/esm/src/components/select/Select.js +7 -4
  234. package/dist/esm/src/components/select-dropdown/SelectDropdown.js +139 -0
  235. package/dist/esm/src/components/select-dropdown/index.js +1 -0
  236. package/dist/esm/src/components/selectbox/SelectBox.js +276 -0
  237. package/dist/esm/src/components/selectbox/index.js +1 -0
  238. package/dist/esm/src/components/shared/hintText/HintText.js +1 -1
  239. package/dist/esm/src/components/switch/Switch.js +116 -0
  240. package/dist/esm/src/components/switch/index.js +1 -0
  241. package/dist/esm/src/components/tab/HorizontalTab.js +7 -19
  242. package/dist/esm/src/components/tab/TabButton.js +34 -17
  243. package/dist/esm/src/components/tab/VerticalTab.js +15 -30
  244. package/dist/esm/src/components/tag/Tag.js +92 -3
  245. package/dist/esm/src/components/tooltip/Tooltip.js +139 -31
  246. package/dist/esm/src/hooks/dropdown/index.js +6 -0
  247. package/dist/esm/src/hooks/dropdown/useDropdown.js +102 -0
  248. package/dist/esm/src/hooks/dropdown/useDropdownKeyboard.js +124 -0
  249. package/dist/esm/src/hooks/dropdown/useDropdownPosition.js +20 -0
  250. package/dist/esm/src/hooks/dropdown/useOutsideClick.js +26 -0
  251. package/dist/esm/src/hooks/dropdown/useScrollLock.js +71 -0
  252. package/dist/esm/src/hooks/dropdown/useWindowResize.js +45 -0
  253. package/dist/esm/src/hooks/index.js +4 -1
  254. package/dist/esm/src/types/dropdown/dropdown.js +1 -0
  255. package/dist/esm/src/types/dropdown/index.js +2 -0
  256. package/dist/esm/src/types/dropdown/option.js +1 -0
  257. package/dist/esm/src/types/index.js +2 -0
  258. package/dist/esm/src/utils/date-picker.js +33 -1
  259. package/dist/esm/src/utils/dropdown/dropdownUtils.js +97 -0
  260. package/dist/esm/src/utils/dropdown/index.js +2 -0
  261. package/dist/esm/src/utils/dropdown/multiSelect.js +88 -0
  262. package/dist/esm/src/utils/index.js +4 -0
  263. package/dist/types/assets/scripts/comboBox.d.ts +91 -0
  264. package/dist/types/assets/scripts/datePicker.d.ts +17 -13
  265. package/dist/types/assets/scripts/featuredIcon.d.ts +23 -0
  266. package/dist/types/assets/scripts/fileInput/FileInput.d.ts +67 -0
  267. package/dist/types/assets/scripts/fileInput/FileInputModel.d.ts +70 -0
  268. package/dist/types/assets/scripts/fileInput/FileInputView.d.ts +77 -0
  269. package/dist/types/assets/scripts/fileInput/const/classNames.d.ts +17 -0
  270. package/dist/types/assets/scripts/fileInput/const/index.d.ts +3 -0
  271. package/dist/types/assets/scripts/fileInput/const/types.d.ts +132 -0
  272. package/dist/types/assets/scripts/fileInput/index.d.ts +4 -0
  273. package/dist/types/assets/scripts/imageFileInput/ImageFileInput.d.ts +64 -0
  274. package/dist/types/assets/scripts/imageFileInput/ImageFileInputModel.d.ts +74 -0
  275. package/dist/types/assets/scripts/imageFileInput/ImageFileInputView.d.ts +80 -0
  276. package/dist/types/assets/scripts/imageFileInput/const/classNames.d.ts +20 -0
  277. package/dist/types/assets/scripts/imageFileInput/const/index.d.ts +3 -0
  278. package/dist/types/assets/scripts/imageFileInput/const/types.d.ts +126 -0
  279. package/dist/types/assets/scripts/imageFileInput/index.d.ts +4 -0
  280. package/dist/types/assets/scripts/index.d.ts +28 -2
  281. package/dist/types/assets/scripts/modal/Modal.d.ts +28 -0
  282. package/dist/types/assets/scripts/modal/ModalActions.d.ts +19 -0
  283. package/dist/types/assets/scripts/modal/ModalContent.d.ts +14 -0
  284. package/dist/types/assets/scripts/modal/ModalHeader.d.ts +16 -0
  285. package/dist/types/assets/scripts/modal/const/classNames.d.ts +23 -0
  286. package/dist/types/assets/scripts/modal/const/index.d.ts +3 -0
  287. package/dist/types/assets/scripts/modal/const/types.d.ts +62 -0
  288. package/dist/types/assets/scripts/modal/index.d.ts +8 -0
  289. package/dist/types/assets/scripts/modal/utils/contentUtils.d.ts +11 -0
  290. package/dist/types/assets/scripts/notification/FloatingNotification.d.ts +25 -0
  291. package/dist/types/assets/scripts/notification/FullWidthNotification.d.ts +22 -0
  292. package/dist/types/assets/scripts/notification/MessageNotification.d.ts +23 -0
  293. package/dist/types/assets/scripts/notification/Notification.d.ts +22 -0
  294. package/dist/types/assets/scripts/notification/const/classNames.d.ts +44 -0
  295. package/dist/types/assets/scripts/notification/const/icons.d.ts +26 -0
  296. package/dist/types/assets/scripts/notification/const/index.d.ts +6 -0
  297. package/dist/types/assets/scripts/notification/const/sizes.d.ts +33 -0
  298. package/dist/types/assets/scripts/notification/const/types.d.ts +20 -0
  299. package/dist/types/assets/scripts/notification/index.d.ts +8 -0
  300. package/dist/types/assets/scripts/notification/utils.d.ts +9 -0
  301. package/dist/types/assets/scripts/progress-bar/ProgressBar.d.ts +68 -0
  302. package/dist/types/assets/scripts/progress-bar/index.d.ts +2 -0
  303. package/dist/types/assets/scripts/selectBox.d.ts +77 -0
  304. package/dist/types/assets/scripts/shared/ButtonCloseX.d.ts +6 -0
  305. package/dist/types/assets/scripts/tag/Tag.d.ts +28 -0
  306. package/dist/types/assets/scripts/tag/const/classNames.d.ts +12 -0
  307. package/dist/types/assets/scripts/tag/const/index.d.ts +4 -0
  308. package/dist/types/assets/scripts/tag/const/sizes.d.ts +8 -0
  309. package/dist/types/assets/scripts/tag/const/types.d.ts +34 -0
  310. package/dist/types/assets/scripts/tag/index.d.ts +4 -0
  311. package/dist/types/assets/scripts/tooltip/Tooltip.d.ts +55 -0
  312. package/dist/types/assets/scripts/tooltip/TooltipLayerManager.d.ts +22 -0
  313. package/dist/types/assets/scripts/tooltip/const/classNames.d.ts +18 -0
  314. package/dist/types/assets/scripts/tooltip/const/constants.d.ts +34 -0
  315. package/dist/types/assets/scripts/tooltip/const/icons.d.ts +5 -0
  316. package/dist/types/assets/scripts/tooltip/const/index.d.ts +6 -0
  317. package/dist/types/assets/scripts/tooltip/const/templates.d.ts +17 -0
  318. package/dist/types/assets/scripts/tooltip/const/types.d.ts +15 -0
  319. package/dist/types/assets/scripts/tooltip/index.d.ts +7 -0
  320. package/dist/types/assets/scripts/tooltip/utils.d.ts +3 -0
  321. package/dist/types/assets/scripts/utils/selectbox/DOMRenderer.d.ts +108 -0
  322. package/dist/types/assets/scripts/utils/selectbox/DropdownModel.d.ts +158 -0
  323. package/dist/types/assets/scripts/utils/selectbox/SelectBoxController.d.ts +171 -0
  324. package/dist/types/assets/scripts/utils/selectbox/UnifiedSelectBox.d.ts +99 -0
  325. package/dist/types/constant/color.d.ts +3 -1
  326. package/dist/types/src/components/button/Button.d.ts +14 -12
  327. package/dist/types/src/components/button/ButtonGroup.d.ts +4 -289
  328. package/dist/types/src/components/button/ButtonStepper.d.ts +10 -0
  329. package/dist/types/src/components/button/index.d.ts +2 -0
  330. package/dist/types/src/components/checkbox/Checkbox.d.ts +2 -3
  331. package/dist/types/src/components/combobox/ComboBox.d.ts +28 -0
  332. package/dist/types/src/components/combobox/index.d.ts +3 -0
  333. package/dist/types/src/components/date-picker/CustomInput.d.ts +12 -0
  334. package/dist/types/src/components/date-picker/DatePicker.d.ts +3 -0
  335. package/dist/types/src/components/date-picker/RangeDatePickerWithButtons.d.ts +4 -4
  336. package/dist/types/src/components/{input → file-upload}/FileInput.d.ts +1 -1
  337. package/dist/types/src/components/file-upload/index.d.ts +2 -0
  338. package/dist/types/src/components/image-file-input/ImageFileInput.d.ts +78 -0
  339. package/dist/types/src/components/image-file-input/components/ImagePreview.d.ts +6 -0
  340. package/dist/types/src/components/image-file-input/index.d.ts +2 -0
  341. package/dist/types/src/components/index.d.ts +4 -0
  342. package/dist/types/src/components/input/InputBase.d.ts +2 -0
  343. package/dist/types/src/components/input/NumberInput.d.ts +10 -0
  344. package/dist/types/src/components/input/index.d.ts +1 -1
  345. package/dist/types/src/components/modal/Modal.d.ts +3 -2
  346. package/dist/types/src/components/notification/FloatingNotification.d.ts +5 -0
  347. package/dist/types/src/components/notification/FullWidthNotification.d.ts +15 -1
  348. package/dist/types/src/components/notification/MessageNotification.d.ts +40 -0
  349. package/dist/types/src/components/notification/Notification.d.ts +14 -3
  350. package/dist/types/src/components/notification/index.d.ts +1 -0
  351. package/dist/types/src/components/pagination/NavButton.d.ts +1 -4
  352. package/dist/types/src/components/pagination/Pagination.d.ts +2 -13
  353. package/dist/types/src/components/progress-bar/ProgressBar.d.ts +2 -6
  354. package/dist/types/src/components/progress-bar/components/SegmentBar.d.ts +8 -0
  355. package/dist/types/src/components/progress-bar/components/SegmentLabels.d.ts +16 -0
  356. package/dist/types/src/components/progress-bar/hooks/useProgressBar.d.ts +14 -0
  357. package/dist/types/src/components/progress-bar/index.d.ts +1 -0
  358. package/dist/types/src/components/progress-bar/types.d.ts +16 -0
  359. package/dist/types/src/components/progress-bar/utils.d.ts +13 -0
  360. package/dist/types/src/components/radio/Radio.d.ts +2 -3
  361. package/dist/types/src/components/select/Select.d.ts +1 -4
  362. package/dist/types/src/components/select-dropdown/SelectDropdown.d.ts +28 -0
  363. package/dist/types/src/components/select-dropdown/index.d.ts +2 -0
  364. package/dist/types/src/components/selectbox/SelectBox.d.ts +25 -0
  365. package/dist/types/src/components/selectbox/index.d.ts +2 -0
  366. package/dist/types/src/components/switch/Switch.d.ts +22 -0
  367. package/dist/types/src/components/switch/index.d.ts +3 -0
  368. package/dist/types/src/components/tab/HorizontalTab.d.ts +1 -2
  369. package/dist/types/src/components/tab/TabButton.d.ts +9 -12
  370. package/dist/types/src/components/tab/VerticalTab.d.ts +2 -2
  371. package/dist/types/src/components/tag/Tag.d.ts +3 -1
  372. package/dist/types/src/components/tooltip/Tooltip.d.ts +7 -3
  373. package/dist/types/src/hooks/dropdown/index.d.ts +7 -0
  374. package/dist/types/src/hooks/dropdown/useDropdown.d.ts +30 -0
  375. package/dist/types/src/hooks/dropdown/useDropdownKeyboard.d.ts +11 -0
  376. package/dist/types/src/hooks/dropdown/useDropdownPosition.d.ts +10 -0
  377. package/dist/types/src/hooks/dropdown/useOutsideClick.d.ts +6 -0
  378. package/dist/types/src/hooks/dropdown/useScrollLock.d.ts +5 -0
  379. package/dist/types/src/hooks/dropdown/useWindowResize.d.ts +8 -0
  380. package/dist/types/src/hooks/index.d.ts +2 -1
  381. package/dist/types/src/types/dropdown/dropdown.d.ts +40 -0
  382. package/dist/types/src/types/dropdown/index.d.ts +3 -0
  383. package/dist/types/src/types/dropdown/option.d.ts +20 -0
  384. package/dist/types/src/types/index.d.ts +2 -0
  385. package/dist/types/src/utils/date-picker.d.ts +3 -0
  386. package/dist/types/src/utils/dropdown/dropdownUtils.d.ts +18 -0
  387. package/dist/types/src/utils/dropdown/index.d.ts +3 -0
  388. package/dist/types/src/utils/dropdown/multiSelect.d.ts +32 -0
  389. package/dist/types/src/utils/index.d.ts +3 -0
  390. package/dist/ui-admin/assets/styles/style.css +2065 -397
  391. package/package.json +8 -4
@@ -3,6 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ var _exportNames = {
7
+ useCallbackRef: true,
8
+ useMediaQuery: true,
9
+ useMergeRefs: true
10
+ };
6
11
  Object.defineProperty(exports, "useCallbackRef", {
7
12
  enumerable: true,
8
13
  get: function () {
@@ -21,6 +26,18 @@ Object.defineProperty(exports, "useMergeRefs", {
21
26
  return _useMergeRefs.useMergeRefs;
22
27
  }
23
28
  });
29
+ var _useCallbackRef = require("./useCallbackRef");
24
30
  var _useMediaQuery = require("./useMediaQuery");
25
31
  var _useMergeRefs = require("./useMergeRefs");
26
- var _useCallbackRef = require("./useCallbackRef");
32
+ var _dropdown = require("./dropdown");
33
+ Object.keys(_dropdown).forEach(function (key) {
34
+ if (key === "default" || key === "__esModule") return;
35
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
36
+ if (key in exports && exports[key] === _dropdown[key]) return;
37
+ Object.defineProperty(exports, key, {
38
+ enumerable: true,
39
+ get: function () {
40
+ return _dropdown[key];
41
+ }
42
+ });
43
+ });
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _dropdown = require("./dropdown");
7
+ Object.keys(_dropdown).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _dropdown[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _dropdown[key];
14
+ }
15
+ });
16
+ });
17
+ var _option = require("./option");
18
+ Object.keys(_option).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _option[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _option[key];
25
+ }
26
+ });
27
+ });
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _dropdown = require("./dropdown");
7
+ Object.keys(_dropdown).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _dropdown[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _dropdown[key];
14
+ }
15
+ });
16
+ });
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.formatMinuteInput = exports.formatHourInput = exports.formatDateInput = void 0;
6
7
  exports.getDateFormat = getDateFormat;
7
8
  exports.getSubtractDate = getSubtractDate;
8
9
  exports.getToday = getToday;
@@ -23,4 +24,39 @@ function getSubtractDate(_a) {
23
24
  period = _a.period,
24
25
  unit = _a.unit;
25
26
  return (0, _moment.default)(date).subtract(period, unit).toDate();
26
- }
27
+ }
28
+ var formatDateInput = function (input) {
29
+ var dateRegex = /^(19|20)\d{2}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[0-1])$/;
30
+ if (dateRegex.test(input)) {
31
+ // 20231112 -> 2023-11-12 형식으로 변환
32
+ var year = input.substring(0, 4);
33
+ var month = input.substring(4, 6);
34
+ var day = input.substring(6, 8);
35
+ return "".concat(year, "-").concat(month, "-").concat(day);
36
+ }
37
+ return input;
38
+ };
39
+ exports.formatDateInput = formatDateInput;
40
+ var formatHourInput = function (input) {
41
+ var numbers = input.replace(/\D/g, '');
42
+ var hourStr = numbers.substring(0, 2);
43
+ var hourNum = parseInt(hourStr, 10);
44
+ if (hourNum >= 0 && hourNum <= 23) {
45
+ return hourStr;
46
+ }
47
+ return input;
48
+ };
49
+ exports.formatHourInput = formatHourInput;
50
+ var formatMinuteInput = function (input) {
51
+ // 숫자만 추출
52
+ var numbers = input.replace(/\D/g, '');
53
+ // 2자리 숫자로 제한
54
+ var minuteStr = numbers.substring(0, 2);
55
+ var minuteNum = parseInt(minuteStr, 10);
56
+ // 00-59 범위 체크
57
+ if (minuteNum >= 0 && minuteNum <= 59) {
58
+ return minuteStr; // 2자리로 패딩
59
+ }
60
+ return input;
61
+ };
62
+ exports.formatMinuteInput = formatMinuteInput;
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.findScrollableParent = exports.calculateNextFocusIndex = exports.calculateDropdownPosition = exports.adjustDropdownPosition = void 0;
7
+ /**
8
+ * 드롭다운 위치를 계산하는 유틸리티 함수
9
+ */
10
+ var calculateDropdownPosition = function (_a) {
11
+ var triggerRef = _a.triggerRef,
12
+ maxHeight = _a.maxHeight,
13
+ itemCount = _a.itemCount,
14
+ _b = _a.itemHeight,
15
+ itemHeight = _b === void 0 ? 40 : _b,
16
+ _c = _a.offset,
17
+ offset = _c === void 0 ? 20 : _c;
18
+ if (!(triggerRef === null || triggerRef === void 0 ? void 0 : triggerRef.current)) {
19
+ return {
20
+ direction: 'down',
21
+ maxHeight: maxHeight
22
+ };
23
+ }
24
+ var rect = triggerRef === null || triggerRef === void 0 ? void 0 : triggerRef.current.getBoundingClientRect();
25
+ var viewportHeight = window.innerHeight;
26
+ var dropdownHeight = Math.min(maxHeight, itemCount * itemHeight);
27
+ // 아래쪽 공간이 충분한지 확인
28
+ var spaceBelow = viewportHeight - rect.bottom;
29
+ if (spaceBelow < dropdownHeight + offset) {
30
+ return {
31
+ direction: 'up',
32
+ maxHeight: maxHeight
33
+ };
34
+ } else {
35
+ return {
36
+ direction: 'down',
37
+ maxHeight: maxHeight
38
+ };
39
+ }
40
+ };
41
+ /**
42
+ * 키보드 네비게이션을 위한 포커스 인덱스 계산
43
+ */
44
+ exports.calculateDropdownPosition = calculateDropdownPosition;
45
+ var calculateNextFocusIndex = function (currentIndex, direction, validOptionsLength) {
46
+ if (validOptionsLength === 0) return -1;
47
+ if (direction === 'down') {
48
+ return currentIndex < validOptionsLength - 1 ? currentIndex + 1 : 0;
49
+ } else {
50
+ return currentIndex > 0 ? currentIndex - 1 : validOptionsLength - 1;
51
+ }
52
+ };
53
+ /**
54
+ * 드롭다운이 뷰포트를 벗어나지 않도록 위치 조정
55
+ */
56
+ exports.calculateNextFocusIndex = calculateNextFocusIndex;
57
+ var adjustDropdownPosition = function (dropdownElement, triggerElement) {
58
+ var dropdownRect = dropdownElement.getBoundingClientRect();
59
+ var viewportWidth = window.innerWidth;
60
+ var viewportHeight = window.innerHeight;
61
+ // 좌우 위치 조정
62
+ if (dropdownRect.right > viewportWidth) {
63
+ var overflow = dropdownRect.right - viewportWidth;
64
+ dropdownElement.style.left = "".concat(-overflow - 10, "px");
65
+ }
66
+ if (dropdownRect.left < 0) {
67
+ dropdownElement.style.left = '10px';
68
+ }
69
+ // 상하 위치 조정 (이미 up/down 방향이 결정된 후 미세 조정)
70
+ if (dropdownRect.bottom > viewportHeight) {
71
+ var overflow = dropdownRect.bottom - viewportHeight;
72
+ dropdownElement.style.maxHeight = "".concat(dropdownRect.height - overflow - 10, "px");
73
+ }
74
+ };
75
+ /**
76
+ * 스크롤 가능한 부모 요소를 찾는 유틸리티 함수
77
+ */
78
+ exports.adjustDropdownPosition = adjustDropdownPosition;
79
+ var findScrollableParent = function (element, boundary) {
80
+ var current = element;
81
+ while (current && current !== boundary && current !== document.body) {
82
+ var style = window.getComputedStyle(current);
83
+ var overflowY = style.overflowY;
84
+ if (overflowY === 'scroll' || overflowY === 'auto') {
85
+ var scrollHeight = current.scrollHeight,
86
+ clientHeight = current.clientHeight;
87
+ if (scrollHeight > clientHeight) {
88
+ return current;
89
+ }
90
+ }
91
+ current = current.parentElement;
92
+ }
93
+ // boundary 자체가 스크롤 가능한지 확인
94
+ if (current === boundary) {
95
+ var style = window.getComputedStyle(boundary);
96
+ var overflowY = style.overflowY;
97
+ if (overflowY === 'scroll' || overflowY === 'auto') {
98
+ var scrollHeight = boundary.scrollHeight,
99
+ clientHeight = boundary.clientHeight;
100
+ if (scrollHeight > clientHeight) {
101
+ return boundary;
102
+ }
103
+ }
104
+ }
105
+ return null;
106
+ };
107
+ exports.findScrollableParent = findScrollableParent;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _dropdownUtils = require("./dropdownUtils");
7
+ Object.keys(_dropdownUtils).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _dropdownUtils[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _dropdownUtils[key];
14
+ }
15
+ });
16
+ });
17
+ var _multiSelect = require("./multiSelect");
18
+ Object.keys(_multiSelect).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _multiSelect[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _multiSelect[key];
25
+ }
26
+ });
27
+ });
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useMultiSelect = exports.removeTagFromSelected = exports.isAllItemsSelected = exports.handleSelectAllItems = exports.getSelectedTags = exports.getSelectAllButtonText = void 0;
7
+ /**
8
+ * 전체 선택 상태를 확인하는 유틸 함수
9
+ */
10
+ var isAllItemsSelected = function (selectedValues, options) {
11
+ if (options.length === 0) return false;
12
+ var validOptionIds = options.filter(function (option) {
13
+ return !option.disabled;
14
+ }).map(function (option) {
15
+ return option.id;
16
+ });
17
+ return validOptionIds.length > 0 && validOptionIds.every(function (id) {
18
+ return selectedValues.includes(id);
19
+ });
20
+ };
21
+ /**
22
+ * 전체 선택 버튼 텍스트를 반환하는 유틸 함수
23
+ */
24
+ exports.isAllItemsSelected = isAllItemsSelected;
25
+ var getSelectAllButtonText = function (selectedValues, options, selectText, deselectText) {
26
+ if (selectText === void 0) {
27
+ selectText = '전체 선택';
28
+ }
29
+ if (deselectText === void 0) {
30
+ deselectText = '전체 해제';
31
+ }
32
+ return isAllItemsSelected(selectedValues, options) ? deselectText : selectText;
33
+ };
34
+ /**
35
+ * 전체 선택/해제를 처리하는 유틸 함수
36
+ */
37
+ exports.getSelectAllButtonText = getSelectAllButtonText;
38
+ var handleSelectAllItems = function (selectedValues, options) {
39
+ if (isAllItemsSelected(selectedValues, options)) {
40
+ // 전체 해제: 빈 배열 반환
41
+ return [];
42
+ }
43
+ // 전체 선택: 비활성화되지 않은 모든 옵션 ID 반환
44
+ return options.filter(function (option) {
45
+ return !option.disabled;
46
+ }).map(function (option) {
47
+ return option.id;
48
+ });
49
+ };
50
+ /**
51
+ * 선택된 항목들을 태그 데이터로 변환하는 유틸 함수
52
+ */
53
+ exports.handleSelectAllItems = handleSelectAllItems;
54
+ var getSelectedTags = function (selectedValues, options) {
55
+ return selectedValues.map(function (value) {
56
+ var option = options.find(function (opt) {
57
+ return opt.id === value;
58
+ });
59
+ return option ? {
60
+ id: option.id,
61
+ label: option.label || String(option.id)
62
+ } : null;
63
+ }).filter(function (tag) {
64
+ return tag !== null;
65
+ });
66
+ };
67
+ /**
68
+ * 태그 제거 시 선택값에서 해당 ID를 제거하는 유틸 함수
69
+ */
70
+ exports.getSelectedTags = getSelectedTags;
71
+ var removeTagFromSelected = function (selectedValues, tagIdToRemove) {
72
+ return selectedValues.filter(function (id) {
73
+ return id !== tagIdToRemove;
74
+ });
75
+ };
76
+ /**
77
+ * 전체 선택 관련 로직을 한 번에 처리하는 커스텀 훅
78
+ */
79
+ exports.removeTagFromSelected = removeTagFromSelected;
80
+ var useMultiSelect = function (selectedValues, options, selectText, deselectText) {
81
+ var isAllSelected = isAllItemsSelected(selectedValues, options);
82
+ var buttonText = getSelectAllButtonText(selectedValues, options, selectText, deselectText);
83
+ var toggleSelectAll = function () {
84
+ return handleSelectAllItems(selectedValues, options);
85
+ };
86
+ var getSelectedTagsData = function () {
87
+ return getSelectedTags(selectedValues, options);
88
+ };
89
+ var removeTag = function (tagId) {
90
+ return removeTagFromSelected(selectedValues, tagId);
91
+ };
92
+ return {
93
+ isAllSelected: isAllSelected,
94
+ buttonText: buttonText,
95
+ toggleSelectAll: toggleSelectAll,
96
+ getSelectedTagsData: getSelectedTagsData,
97
+ removeTag: removeTag
98
+ };
99
+ };
100
+ exports.useMultiSelect = useMultiSelect;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _datePicker = require("./date-picker");
7
+ Object.keys(_datePicker).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _datePicker[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _datePicker[key];
14
+ }
15
+ });
16
+ });
17
+ var _dropdown = require("./dropdown");
18
+ Object.keys(_dropdown).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _dropdown[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _dropdown[key];
25
+ }
26
+ });
27
+ });
@@ -0,0 +1,275 @@
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 __spreadArray = this && this.__spreadArray || function (to, from, pack) {
12
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
13
+ if (ar || !(i in from)) {
14
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
15
+ ar[i] = from[i];
16
+ }
17
+ }
18
+ return to.concat(ar || Array.prototype.slice.call(from));
19
+ };
20
+ import { UnifiedSelectBox } from './utils/selectbox/UnifiedSelectBox';
21
+ var ComboBox = /** @class */function () {
22
+ function ComboBox(element, config) {
23
+ if (config === void 0) {
24
+ config = {};
25
+ }
26
+ var _this = this;
27
+ var _a, _b, _c, _d, _e, _f;
28
+ this.targetSelect = null;
29
+ this.isInitializing = true;
30
+ this.lastValue = '';
31
+ this.element = element;
32
+ // 타겟 select 요소 찾기
33
+ this.targetSelect = this.findTargetSelect(element);
34
+ // HTML에서 옵션 파싱 (config.options가 없을 경우)
35
+ var htmlOptions = this.parseOptionsFromHTML();
36
+ // JavaScript 옵션을 DropdownOption 형식으로 변환 (이제 구조가 동일하므로 단순 복사)
37
+ var normalizedOptions = config.options ? __spreadArray([], config.options, true) : htmlOptions;
38
+ var finalOptions = normalizedOptions;
39
+ // HTML에서 속성 파싱
40
+ var htmlAttributes = this.parseAttributesFromHTML();
41
+ // 기존 API를 새 API로 변환
42
+ var unifiedConfig = __assign(__assign({}, config), {
43
+ type: 'combobox',
44
+ multiple: (_a = config.multiple) !== null && _a !== void 0 ? _a : false,
45
+ showFooterButtons: (_b = config.showFooterButtons) !== null && _b !== void 0 ? _b : false,
46
+ onSelectAll: config.onSelectAll,
47
+ onSearchAll: config.onSearchAll,
48
+ onComplete: config.onComplete,
49
+ onScrollBottom: config.onScrollBottom,
50
+ searchDebounceMs: config.searchDebounceMs,
51
+ options: finalOptions,
52
+ placeholder: config.placeholder || htmlAttributes.placeholder || '검색하고 선택하세요',
53
+ value: (_d = (_c = config.value) !== null && _c !== void 0 ? _c : htmlAttributes.value) !== null && _d !== void 0 ? _d : config.multiple ? [] : '',
54
+ disabled: (_f = (_e = config.disabled) !== null && _e !== void 0 ? _e : htmlAttributes.disabled) !== null && _f !== void 0 ? _f : false,
55
+ size: config.size || htmlAttributes.size || 'md',
56
+ onChange: function (value) {
57
+ var _a;
58
+ // 초기화 중에는 동기화하지 않음 (무한 루프 방지)
59
+ if (_this.isInitializing) {
60
+ _this.lastValue = value;
61
+ return;
62
+ }
63
+ // 값이 실제로 변경되지 않았으면 동기화 생략 (무한 루프 방지)
64
+ if (JSON.stringify(_this.lastValue) === JSON.stringify(value)) {
65
+ return;
66
+ }
67
+ _this.lastValue = value;
68
+ // 타겟 select와 동기화
69
+ if (config.multiple) {
70
+ _this.syncWithTargetSelectMultiple(value);
71
+ } else {
72
+ _this.syncWithTargetSelect(value);
73
+ }
74
+ (_a = config.onChange) === null || _a === void 0 ? void 0 : _a.call(config, value);
75
+ }
76
+ });
77
+ this.unifiedSelectBox = new UnifiedSelectBox(element, unifiedConfig);
78
+ // 초기화 완료 (다음 이벤트 루프에서 실행)
79
+ setTimeout(function () {
80
+ _this.isInitializing = false;
81
+ }, 0);
82
+ }
83
+ /**
84
+ * 타겟 select 요소 찾기
85
+ */
86
+ ComboBox.prototype.findTargetSelect = function (element) {
87
+ // 1. 직접 select 태그인 경우
88
+ if (element.tagName === 'SELECT') {
89
+ return element;
90
+ }
91
+ // 2. 자식으로 select 태그가 있는 경우
92
+ var selectChild = element.querySelector('select');
93
+ if (selectChild) {
94
+ return selectChild;
95
+ }
96
+ // 3. data-target 속성으로 지정된 경우
97
+ var targetId = element.getAttribute('data-target');
98
+ if (targetId) {
99
+ var targetElement = document.getElementById(targetId);
100
+ if (targetElement && targetElement.tagName === 'SELECT') {
101
+ return targetElement;
102
+ }
103
+ }
104
+ return null;
105
+ };
106
+ /**
107
+ * HTML select에서 옵션 파싱
108
+ */
109
+ ComboBox.prototype.parseOptionsFromHTML = function () {
110
+ if (!this.targetSelect) return [];
111
+ var options = [];
112
+ var optionElements = this.targetSelect.querySelectorAll('option');
113
+ optionElements.forEach(function (optionElement) {
114
+ if (optionElement.value) {
115
+ // value가 있는 옵션만 추가
116
+ options.push({
117
+ id: optionElement.value,
118
+ label: optionElement.textContent || optionElement.value,
119
+ disabled: optionElement.disabled
120
+ });
121
+ }
122
+ });
123
+ return options;
124
+ };
125
+ /**
126
+ * HTML에서 속성 파싱
127
+ */
128
+ ComboBox.prototype.parseAttributesFromHTML = function () {
129
+ var attributes = {};
130
+ if (this.targetSelect) {
131
+ // select 요소의 속성들
132
+ if (this.targetSelect.disabled) attributes.disabled = true;
133
+ if (this.targetSelect.value) attributes.value = this.targetSelect.value;
134
+ // placeholder는 첫 번째 빈 option에서 가져오기
135
+ var firstOption = this.targetSelect.querySelector('option[value=""], option:not([value])');
136
+ if (firstOption) {
137
+ attributes.placeholder = firstOption.textContent || '검색하고 선택하세요';
138
+ }
139
+ }
140
+ // 컨테이너 요소의 data 속성들
141
+ var containerAttributes = this.element.dataset;
142
+ if (containerAttributes.placeholder) attributes.placeholder = containerAttributes.placeholder;
143
+ if (containerAttributes.size) attributes.size = containerAttributes.size;
144
+ if (containerAttributes.disabled === 'true') attributes.disabled = true;
145
+ return attributes;
146
+ };
147
+ /**
148
+ * 타겟 select와 동기화 (Single 모드)
149
+ */
150
+ ComboBox.prototype.syncWithTargetSelect = function (value) {
151
+ if (this.targetSelect) {
152
+ this.targetSelect.value = String(value);
153
+ // select 요소의 change 이벤트 발생
154
+ var event_1 = new Event('change', {
155
+ bubbles: true
156
+ });
157
+ this.targetSelect.dispatchEvent(event_1);
158
+ }
159
+ };
160
+ /**
161
+ * 타겟 select와 동기화 (Multiple 모드)
162
+ */
163
+ ComboBox.prototype.syncWithTargetSelectMultiple = function (values) {
164
+ var _this = this;
165
+ if (this.targetSelect && this.targetSelect.multiple) {
166
+ // 모든 옵션 선택 해제
167
+ Array.from(this.targetSelect.options).forEach(function (option) {
168
+ option.selected = false;
169
+ });
170
+ // 선택된 값들에 해당하는 옵션들 선택
171
+ values.forEach(function (value) {
172
+ var option = _this.targetSelect.querySelector("option[value=\"".concat(value, "\"]"));
173
+ if (option) {
174
+ option.selected = true;
175
+ }
176
+ });
177
+ // select 요소의 change 이벤트 발생
178
+ var event_2 = new Event('change', {
179
+ bubbles: true
180
+ });
181
+ this.targetSelect.dispatchEvent(event_2);
182
+ }
183
+ };
184
+ // 기존 API 호환성 메서드들
185
+ ComboBox.prototype.getValues = function () {
186
+ return this.unifiedSelectBox.getValues();
187
+ };
188
+ ComboBox.prototype.getOptions = function () {
189
+ return this.unifiedSelectBox.getOptions();
190
+ };
191
+ ComboBox.prototype.setValues = function (value) {
192
+ // 옵션 객체 배열에서 id 배열로 변환하여 lastValue 비교
193
+ var ids = value.map(function (option) {
194
+ return option.id;
195
+ });
196
+ var valueForComparison = this.unifiedSelectBox.isMultiple() ? ids : ids[0] || '';
197
+ // 값이 변경되지 않았으면 무시
198
+ if (JSON.stringify(this.lastValue) === JSON.stringify(valueForComparison)) {
199
+ return;
200
+ }
201
+ this.lastValue = valueForComparison;
202
+ this.unifiedSelectBox.setValues(value);
203
+ // setValues 호출 시에도 타겟 select와 동기화
204
+ if (this.targetSelect) {
205
+ if (this.unifiedSelectBox.isMultiple()) {
206
+ this.syncWithTargetSelectMultiple(ids);
207
+ } else {
208
+ this.syncWithTargetSelect(ids[0] || '');
209
+ }
210
+ }
211
+ };
212
+ ComboBox.prototype.updateOptions = function (newOptions) {
213
+ this.unifiedSelectBox.updateOptions(newOptions);
214
+ };
215
+ ComboBox.prototype.setDisabled = function (disabled) {
216
+ this.unifiedSelectBox.setDisabled(disabled);
217
+ };
218
+ ComboBox.prototype.open = function () {
219
+ this.unifiedSelectBox.open();
220
+ };
221
+ ComboBox.prototype.close = function () {
222
+ this.unifiedSelectBox.close();
223
+ };
224
+ ComboBox.prototype.focus = function () {
225
+ this.unifiedSelectBox.focus();
226
+ };
227
+ ComboBox.prototype.destroy = function () {
228
+ this.unifiedSelectBox.destroy();
229
+ };
230
+ // ComboBox 특화 메서드들
231
+ ComboBox.prototype.clearInput = function () {
232
+ // UnifiedSelectBox의 handleClearInput과 동일한 로직
233
+ this.unifiedSelectBox.close();
234
+ };
235
+ ComboBox.prototype.getDebugInfo = function () {
236
+ return this.unifiedSelectBox.getDebugInfo();
237
+ };
238
+ // Multiple 모드 전용 메서드들
239
+ ComboBox.prototype.selectAll = function () {
240
+ this.unifiedSelectBox.selectAll();
241
+ };
242
+ ComboBox.prototype.deselectAll = function () {
243
+ this.unifiedSelectBox.deselectAll();
244
+ };
245
+ ComboBox.prototype.getSelectedCount = function () {
246
+ var value = this.getValues();
247
+ return Array.isArray(value) ? value.length : value ? 1 : 0;
248
+ };
249
+ ComboBox.prototype.isMultiple = function () {
250
+ return this.unifiedSelectBox.isMultiple();
251
+ };
252
+ ComboBox.prototype.toggleSelectAll = function () {
253
+ this.unifiedSelectBox.toggleSelectAll();
254
+ };
255
+ /**
256
+ * 드롭다운을 스크롤의 바닥으로 이동
257
+ */
258
+ ComboBox.prototype.scrollToBottom = function () {
259
+ this.unifiedSelectBox.scrollToBottom();
260
+ };
261
+ /**
262
+ * 전체 선택 버튼의 텍스트를 외부에서 변경
263
+ */
264
+ ComboBox.prototype.setSelectAllButtonText = function (text) {
265
+ this.unifiedSelectBox.setSelectAllButtonText(text);
266
+ };
267
+ /**
268
+ * 특정 인덱스의 옵션으로 포커스 이동
269
+ */
270
+ ComboBox.prototype.setFocusIndex = function (index) {
271
+ this.unifiedSelectBox.setFocusIndex(index);
272
+ };
273
+ return ComboBox;
274
+ }();
275
+ export { ComboBox };