@cashub/ui 0.49.0-beta.0 → 0.49.0-beta.2

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 (888) hide show
  1. package/cashub-ui-0.49.0-beta.1.tgz +0 -0
  2. package/icon/Icon.js +39 -0
  3. package/icon/assets/announcement.jsx +6 -0
  4. package/icon/assets/master-data.jsx +7 -0
  5. package/icon/assets/system-setting.jsx +8 -0
  6. package/icon/index.js +13 -0
  7. package/{dist/icon → icon}/registry.js +7 -1
  8. package/{dist/iconbox → iconbox}/bgImageRegistry.js +3 -1
  9. package/{dist/index.js → index.js} +8 -0
  10. package/{src/layout → layout}/AsideHeader.jsx +3 -7
  11. package/package.json +55 -64
  12. package/{dist/styles → styles}/theme/dark.theme.js +1 -0
  13. package/{dist/styles → styles}/theme/ember.theme.js +2 -2
  14. package/{dist/styles → styles}/theme/light.theme.js +1 -0
  15. package/{dist/styles → styles}/theme/white.theme.js +1 -0
  16. package/dist/layout/AsideHeader.jsx +0 -27
  17. package/dist/package.json +0 -55
  18. package/setupTests.js +0 -9
  19. package/src/Tab/Tab.js +0 -11
  20. package/src/Tab/TabList.js +0 -159
  21. package/src/Tab/TabPanel.js +0 -35
  22. package/src/Tab/TabTab.js +0 -99
  23. package/src/Tab/__stories__/Tab.stories.js +0 -55
  24. package/src/Tab/__stories__/TabList.stories.js +0 -49
  25. package/src/Tab/__stories__/TabPanel.stories.js +0 -45
  26. package/src/Tab/__stories__/TabTab.stories.js +0 -30
  27. package/src/Tab/__stories__/TabV2.stories.js +0 -47
  28. package/src/Tab/__test__/Tab.test.js +0 -43
  29. package/src/Tab/__test__/TabList.test.js +0 -22
  30. package/src/Tab/__test__/TabPanel.test.js +0 -27
  31. package/src/Tab/__test__/TabTab.test.js +0 -58
  32. package/src/Tab/index.js +0 -22
  33. package/src/Tab/subComponent/TabContext.js +0 -5
  34. package/src/Tab/subComponent/TabListV2.js +0 -16
  35. package/src/Tab/subComponent/TabPanelV2.js +0 -38
  36. package/src/Tab/subComponent/TabTabV2.js +0 -47
  37. package/src/VerticalTab/TabList.js +0 -18
  38. package/src/VerticalTab/TabPanel.js +0 -38
  39. package/src/VerticalTab/TabTab.js +0 -54
  40. package/src/VerticalTab/VerticalTab.js +0 -20
  41. package/src/VerticalTab/index.js +0 -10
  42. package/src/VerticalTab/subComponent/TabContext.js +0 -5
  43. package/src/VerticalTab/subComponent/VerticalTab.stories.js +0 -82
  44. package/src/alert/Alert.js +0 -15
  45. package/src/alert/__stories__/Alert.stories.js +0 -18
  46. package/src/alert/index.js +0 -1
  47. package/src/animate/Collapse.js +0 -68
  48. package/src/animate/Loader.js +0 -36
  49. package/src/animate/NumberCounter.js +0 -49
  50. package/src/animate/PulseRing.js +0 -25
  51. package/src/animate/Spinner.js +0 -13
  52. package/src/animate/__stories__/Collapse.stories.js +0 -60
  53. package/src/animate/__stories__/Loader.stories.js +0 -33
  54. package/src/animate/__stories__/NumberCounter.stories.js +0 -29
  55. package/src/animate/__stories__/PulseRing.stories.js +0 -17
  56. package/src/animate/__stories__/Spinner.stories.js +0 -13
  57. package/src/animate/__test__/Collapse.test.js +0 -125
  58. package/src/animate/__test__/Loader.test.js +0 -42
  59. package/src/animate/__test__/NumberCounter.test.js +0 -71
  60. package/src/animate/__test__/PulseRing.test.js +0 -37
  61. package/src/animate/__test__/Spinner.test.js +0 -18
  62. package/src/animate/index.js +0 -5
  63. package/src/assets/css/autocomplete.css +0 -16
  64. package/src/assets/css/font.css +0 -4
  65. package/src/assets/css/global.css +0 -2
  66. package/src/assets/font/helvetica/Helvetica.ttf +0 -0
  67. package/src/assets/font/nanumGothic/NanumGothic-Bold.ttf +0 -0
  68. package/src/assets/font/nanumGothic/NanumGothic-ExtraBold.ttf +0 -0
  69. package/src/assets/font/nanumGothic/NanumGothic-Regular.ttf +0 -0
  70. package/src/assets/icons/app-management.png +0 -0
  71. package/src/assets/icons/burger-black.png +0 -0
  72. package/src/assets/icons/burger-white.png +0 -0
  73. package/src/assets/icons/burger.png +0 -0
  74. package/src/assets/icons/file.svg +0 -1
  75. package/src/assets/icons/map_icon1.png +0 -0
  76. package/src/assets/icons/map_icon4.png +0 -0
  77. package/src/assets/images/bg-aside.png +0 -0
  78. package/src/assets/images/bg-chart-circle.png +0 -0
  79. package/src/assets/images/bg-chart-triangle.png +0 -0
  80. package/src/assets/images/bg-main-vivid.png +0 -0
  81. package/src/assets/images/bg-main.png +0 -0
  82. package/src/assets/images/cashub-logo-only.png +0 -0
  83. package/src/assets/images/default-user.jpg +0 -0
  84. package/src/assets/images/logo-cashub.png +0 -0
  85. package/src/assets/images/map.png +0 -0
  86. package/src/assets/images/qrcode.png +0 -0
  87. package/src/backdrop/BaseBackdrop.js +0 -13
  88. package/src/backdrop/LoadingBackdrop.js +0 -12
  89. package/src/backdrop/ModalBackdrop.js +0 -10
  90. package/src/backdrop/__test__/BaseBackdrop.test.js +0 -10
  91. package/src/backdrop/__test__/LoadingBackdrop.test.js +0 -9
  92. package/src/backdrop/__test__/ModalBackdrop.test.js +0 -8
  93. package/src/backdrop/index.js +0 -3
  94. package/src/badge/Badge.js +0 -21
  95. package/src/badge/BadgeDot.js +0 -13
  96. package/src/badge/BadgeFill.js +0 -29
  97. package/src/badge/BadgeFillTriangle.js +0 -76
  98. package/src/badge/BadgeWithText.js +0 -21
  99. package/src/badge/__stories__/Badge.stories.js +0 -47
  100. package/src/badge/__stories__/BadgeDot.stories.js +0 -23
  101. package/src/badge/__stories__/BadgeFill.stories.js +0 -29
  102. package/src/badge/__stories__/BadgeFillTriangle.stories.js +0 -29
  103. package/src/badge/__stories__/BadgeWithText.stories.js +0 -26
  104. package/src/badge/__test__/Badge.test.js +0 -32
  105. package/src/badge/__test__/BadgeDot.test.js +0 -22
  106. package/src/badge/__test__/BadgeFill.test.js +0 -41
  107. package/src/badge/__test__/BadgeWithText.test.js +0 -22
  108. package/src/badge/index.js +0 -5
  109. package/src/billing/BarChart.js +0 -42
  110. package/src/billing/Grid.js +0 -30
  111. package/src/billing/Header2.js +0 -15
  112. package/src/billing/Header3.js +0 -32
  113. package/src/billing/Paragraph.js +0 -27
  114. package/src/billing/ParagraphGroup.js +0 -12
  115. package/src/billing/ParagraphText.js +0 -16
  116. package/src/billing/Section.js +0 -48
  117. package/src/billing/SectionBody.js +0 -7
  118. package/src/billing/SectionHeader.js +0 -16
  119. package/src/billing/__stories__/BarChart.stories.js_bak +0 -46
  120. package/src/billing/__stories__/Grid.stories.js_bak +0 -57
  121. package/src/billing/__stories__/Header2.stories.js_bak +0 -62
  122. package/src/billing/__stories__/Header3.stories.js_bak +0 -69
  123. package/src/billing/__stories__/Paragraph.stories.js_bak +0 -84
  124. package/src/billing/__stories__/ParagraphGroup.stories.js_bak +0 -68
  125. package/src/billing/__stories__/ParagraphText.stories.js_bak +0 -64
  126. package/src/billing/__stories__/Section.stories.js_bak +0 -115
  127. package/src/billing/__stories__/SectionBody.stories.js_bak +0 -62
  128. package/src/billing/__stories__/SectionHeader.stories.js-bak +0 -68
  129. package/src/breadcrumb/Breadcrumb.js +0 -66
  130. package/src/breadcrumb/__stories__/Breadcrumb.stories.js +0 -31
  131. package/src/breadcrumb/__test__/breadcrumb.test.js +0 -27
  132. package/src/breadcrumb/index.js +0 -1
  133. package/src/button/Button.js +0 -110
  134. package/src/button/ButtonGroup.js +0 -33
  135. package/src/button/IconButton.js +0 -35
  136. package/src/button/ScrollToTopButton.js +0 -48
  137. package/src/button/__stories__/Button.stories.js +0 -104
  138. package/src/button/__stories__/ButtonGroup.stories.js +0 -48
  139. package/src/button/__stories__/IconButton.stories.js +0 -30
  140. package/src/button/__stories__/ScrollToTopButton.stories.js +0 -22
  141. package/src/button/__test__/Button.test.js +0 -32
  142. package/src/button/__test__/ButtonGroup.test.js +0 -25
  143. package/src/button/__test__/IconButton.test.js +0 -34
  144. package/src/button/__test__/ScrollToTopButton.test.js +0 -19
  145. package/src/button/index.js +0 -4
  146. package/src/callout/Callout.js +0 -52
  147. package/src/callout/__stories__/Callout.stories.js +0 -23
  148. package/src/callout/__test__/Callout.test.js +0 -29
  149. package/src/callout/index.js +0 -1
  150. package/src/chart/BarChart.js +0 -158
  151. package/src/chart/DoughnutChart.js +0 -118
  152. package/src/chart/LineChart.js +0 -151
  153. package/src/chart/SingleBarChart.js +0 -27
  154. package/src/chart/__stories__/BarChart.stories.js +0 -56
  155. package/src/chart/__stories__/DoughnutChart.stories.js +0 -63
  156. package/src/chart/__stories__/LineChart.stories.js +0 -75
  157. package/src/chart/__stories__/SingleBarChart.stories.js +0 -22
  158. package/src/chart/index.js +0 -5
  159. package/src/chart/utils/centerTextPlugin.js +0 -51
  160. package/src/chart/utils/customTooltip.js +0 -116
  161. package/src/chart/utils/htmlLegendPlugin.js +0 -98
  162. package/src/chart/utils/index.js +0 -3
  163. package/src/chart/utils/padEmptyChartBar.js +0 -41
  164. package/src/chart/utils/yAxisTopTitlePlugin.js +0 -38
  165. package/src/container/FlexContainer.js +0 -15
  166. package/src/container/__stories__/FlexContainer.stories.js +0 -39
  167. package/src/container/__test__/FlexContainer.test.js +0 -21
  168. package/src/container/index.js +0 -1
  169. package/src/cropper/Cropper.js +0 -49
  170. package/src/cropper/CropperModalHandler.js +0 -36
  171. package/src/cropper/__stories__/Cropper.stories.js +0 -32
  172. package/src/cropper/__test__/Cropper.test.js +0 -90
  173. package/src/cropper/index.js +0 -2
  174. package/src/cropper/subComponent/CropImageModal.js +0 -84
  175. package/src/datetimePicker/DatePicker.js +0 -493
  176. package/src/datetimePicker/DatePickerV2.js +0 -500
  177. package/src/datetimePicker/DatetimePicker.js +0 -235
  178. package/src/datetimePicker/DatetimePickerV2.js +0 -512
  179. package/src/datetimePicker/DatetimePickerV3.js +0 -292
  180. package/src/datetimePicker/TimeInput.js +0 -45
  181. package/src/datetimePicker/TimePicker.js +0 -318
  182. package/src/datetimePicker/TimePickerStyle.js +0 -59
  183. package/src/datetimePicker/TimePickerV2.js +0 -222
  184. package/src/datetimePicker/__stories__/DatePicker.stories.js +0 -51
  185. package/src/datetimePicker/__stories__/DatePickerV2.stories.js +0 -73
  186. package/src/datetimePicker/__stories__/DatetimePicker.stories.js +0 -74
  187. package/src/datetimePicker/__stories__/DatetimePickerV2.stories.js +0 -91
  188. package/src/datetimePicker/__stories__/DatetimePickerV3.stories.js +0 -80
  189. package/src/datetimePicker/__stories__/TimeInput.stories.js +0 -67
  190. package/src/datetimePicker/__stories__/TimePicker.stories.js +0 -29
  191. package/src/datetimePicker/__stories__/TimePickerV2.stories.js +0 -22
  192. package/src/datetimePicker/__test__/CustomTimeInput.test.js +0 -25
  193. package/src/datetimePicker/__test__/DatetimePicker.test.js +0 -121
  194. package/src/datetimePicker/__test__/TimeInput.test.js +0 -22
  195. package/src/datetimePicker/accordion/Month.js +0 -258
  196. package/src/datetimePicker/accordion/Year.js +0 -307
  197. package/src/datetimePicker/hooks/index.js +0 -3
  198. package/src/datetimePicker/hooks/useChangeNumber.js +0 -42
  199. package/src/datetimePicker/hooks/useDecrease.js +0 -31
  200. package/src/datetimePicker/hooks/useIncrease.js +0 -31
  201. package/src/datetimePicker/index.js +0 -9
  202. package/src/datetimePicker/provider/constant.js +0 -16
  203. package/src/datetimePicker/subComponent/Accordion.js +0 -407
  204. package/src/datetimePicker/subComponent/CustomTimeInput.js +0 -48
  205. package/src/datetimePicker/subComponent/DateTimePickerContext.js +0 -5
  206. package/src/datetimePicker/utils/GMTDate.js +0 -13
  207. package/src/datetimePicker/utils/pad.js +0 -9
  208. package/src/datetimePicker/utils/toUTC0.js +0 -10
  209. package/src/descriptionList/DescriptionDetail.js +0 -18
  210. package/src/descriptionList/DescriptionList.js +0 -15
  211. package/src/descriptionList/DescriptionTerm.js +0 -9
  212. package/src/descriptionList/__stories__/DescriptionDetail.stories.js +0 -39
  213. package/src/descriptionList/__stories__/DescriptionList.stories.js +0 -39
  214. package/src/descriptionList/__stories__/DescriptionTerm.stories.js +0 -13
  215. package/src/descriptionList/__test__/DescriptionDetail.test.js +0 -13
  216. package/src/descriptionList/__test__/DescriptionList.test.js +0 -12
  217. package/src/descriptionList/__test__/DescriptionTerm.test.js +0 -7
  218. package/src/descriptionList/index.js +0 -3
  219. package/src/divider/Divider.js +0 -21
  220. package/src/divider/__stories__/Divider.stories.js +0 -23
  221. package/src/divider/__test__/Divider.test.js +0 -24
  222. package/src/divider/index.js +0 -1
  223. package/src/dropdown/Dropdown.js +0 -50
  224. package/src/dropdown/DropdownButtonOption.js +0 -25
  225. package/src/dropdown/DropdownContent.js +0 -78
  226. package/src/dropdown/DropdownDivOption.js +0 -21
  227. package/src/dropdown/DropdownItem.js +0 -17
  228. package/src/dropdown/DropdownLinkOption.js +0 -19
  229. package/src/dropdown/DropdownToggle.js +0 -26
  230. package/src/dropdown/__stories__/Dropdown.stories.js +0 -46
  231. package/src/dropdown/__stories__/DropdownButtonOption.stories.js +0 -33
  232. package/src/dropdown/__stories__/DropdownContent.stories.js +0 -34
  233. package/src/dropdown/__stories__/DropdownDivOption.stories.js +0 -27
  234. package/src/dropdown/__stories__/DropdownItem.stories.js +0 -48
  235. package/src/dropdown/__stories__/DropdownLinkOption.stories.js +0 -63
  236. package/src/dropdown/__stories__/DropdownToggle.stories.js +0 -40
  237. package/src/dropdown/__test__/Dropdown.test.js +0 -132
  238. package/src/dropdown/__test__/DropdownButtonOption.test.js +0 -8
  239. package/src/dropdown/__test__/DropdownContent.test.js +0 -85
  240. package/src/dropdown/__test__/DropdownDivOption.test.js +0 -8
  241. package/src/dropdown/__test__/DropdownItem.test.js +0 -55
  242. package/src/dropdown/__test__/DropdownLinkOption.test.js +0 -14
  243. package/src/dropdown/__test__/DropdownToggle.test.js +0 -53
  244. package/src/dropdown/index.js +0 -12
  245. package/src/dropdown/subComponent/DropdownContext.js +0 -5
  246. package/src/dropzone/FileDropzone.js +0 -541
  247. package/src/dropzone/ImageDropzone.js +0 -365
  248. package/src/dropzone/__stories__/FileDropzone.stories.js +0 -148
  249. package/src/dropzone/__stories__/ImageDropzone.stories.js +0 -101
  250. package/src/dropzone/__test__/FileDropzone.test.js +0 -382
  251. package/src/dropzone/__test__/ImageDropzone.test.js +0 -290
  252. package/src/dropzone/__test__/Message.test.js +0 -14
  253. package/src/dropzone/index.js +0 -2
  254. package/src/dropzone/subComponent/Message.js +0 -16
  255. package/src/figure/IconFigure.js +0 -31
  256. package/src/figure/ImageFigure.js +0 -25
  257. package/src/figure/__stories__/IconFigure.stories.js +0 -25
  258. package/src/figure/__stories__/ImageFigure.stories.js +0 -26
  259. package/src/figure/__test__/IconFigure.test.js +0 -28
  260. package/src/figure/__test__/ImageFigure.test.js +0 -38
  261. package/src/figure/index.js +0 -2
  262. package/src/file/HiddenFileInput.js +0 -10
  263. package/src/file/index.js +0 -1
  264. package/src/form/Checkbox.js +0 -138
  265. package/src/form/Fieldset.js +0 -13
  266. package/src/form/FormItem.js +0 -12
  267. package/src/form/Input.js +0 -42
  268. package/src/form/Label.js +0 -35
  269. package/src/form/MutedText.js +0 -11
  270. package/src/form/PasswordInput.js +0 -40
  271. package/src/form/RadioButton.js +0 -82
  272. package/src/form/SearchSelect.js +0 -198
  273. package/src/form/Searchbox.js +0 -95
  274. package/src/form/Slider.js +0 -34
  275. package/src/form/SwitchButton.js +0 -86
  276. package/src/form/Textarea.js +0 -36
  277. package/src/form/TreeView.js +0 -77
  278. package/src/form/__stories__/Checkbox.stories.js +0 -87
  279. package/src/form/__stories__/FormItem.stories.js +0 -33
  280. package/src/form/__stories__/Input.stories.js +0 -30
  281. package/src/form/__stories__/Label.stories.js +0 -38
  282. package/src/form/__stories__/MutedText.stories.js +0 -27
  283. package/src/form/__stories__/PasswordInput.stories.js +0 -16
  284. package/src/form/__stories__/RadioButton.stories.js +0 -48
  285. package/src/form/__stories__/SearchSelect.stories.js +0 -99
  286. package/src/form/__stories__/Searchbox.stories.js +0 -24
  287. package/src/form/__stories__/Slider.stories.js +0 -46
  288. package/src/form/__stories__/SwitchButton.stories.js +0 -48
  289. package/src/form/__stories__/Textarea.stories.js +0 -19
  290. package/src/form/__stories__/TreeView.stories.js +0 -76
  291. package/src/form/__test__/Checkbox.test.js +0 -68
  292. package/src/form/__test__/FormItem.test.js +0 -8
  293. package/src/form/__test__/Input.test.js +0 -28
  294. package/src/form/__test__/Label.test.js +0 -33
  295. package/src/form/__test__/MutedText.test.js +0 -18
  296. package/src/form/__test__/RadioButton.test.js +0 -57
  297. package/src/form/__test__/Searchbox.test.js +0 -50
  298. package/src/form/__test__/Textarea.test.js +0 -25
  299. package/src/form/index.js +0 -14
  300. package/src/grid/Column.js +0 -36
  301. package/src/grid/Grid.js +0 -15
  302. package/src/grid/__stories__/Grid.stories.js +0 -38
  303. package/src/grid/__test__/Grid.test.js +0 -44
  304. package/src/grid/index.js +0 -2
  305. package/src/heading/Heading1.js +0 -11
  306. package/src/heading/Heading2.js +0 -13
  307. package/src/heading/Heading3.js +0 -21
  308. package/src/heading/__stories__/Heading1.stories.js +0 -24
  309. package/src/heading/__stories__/Heading2.stories.js +0 -24
  310. package/src/heading/__stories__/Heading3.stories.js +0 -24
  311. package/src/heading/__test__/Heading1.test.js +0 -21
  312. package/src/heading/__test__/Heading2.test.js +0 -34
  313. package/src/heading/__test__/Heading3.test.js +0 -46
  314. package/src/heading/index.js +0 -3
  315. package/src/helmet/Helmet.js +0 -12
  316. package/src/helmet/__test__/Helmet.test.js +0 -38
  317. package/src/helmet/index.js +0 -2
  318. package/src/icon/assets/android.jsx +0 -10
  319. package/src/icon/assets/app-management.jsx +0 -10
  320. package/src/icon/assets/appStore.jsx +0 -6
  321. package/src/icon/assets/battery.jsx +0 -15
  322. package/src/icon/assets/bill.jsx +0 -10
  323. package/src/icon/assets/campaign.jsx +0 -9
  324. package/src/icon/assets/casstore.jsx +0 -8
  325. package/src/icon/assets/dashboard.jsx +0 -6
  326. package/src/icon/assets/enterprise.jsx +0 -15
  327. package/src/icon/assets/firmware.jsx +0 -8
  328. package/src/icon/assets/folder.jsx +0 -8
  329. package/src/icon/assets/group.jsx +0 -18
  330. package/src/icon/assets/heartbeats.jsx +0 -9
  331. package/src/icon/assets/invite-user.jsx +0 -9
  332. package/src/icon/assets/log.jsx +0 -9
  333. package/src/icon/assets/manufacturer.jsx +0 -7
  334. package/src/icon/assets/merchant.jsx +0 -16
  335. package/src/icon/assets/package-collection.jsx +0 -8
  336. package/src/icon/assets/report.jsx +0 -11
  337. package/src/icon/assets/resource.jsx +0 -9
  338. package/src/icon/assets/role.jsx +0 -7
  339. package/src/icon/assets/shield-lock.jsx +0 -202
  340. package/src/icon/assets/shield-no-signal.jsx +0 -195
  341. package/src/icon/assets/shield-unsafe.jsx +0 -191
  342. package/src/icon/assets/shield.jsx +0 -186
  343. package/src/icon/assets/statistics.jsx +0 -9
  344. package/src/icon/assets/tag.jsx +0 -14
  345. package/src/icon/assets/template-management.jsx +0 -8
  346. package/src/icon/assets/terminal.jsx +0 -7
  347. package/src/icon/assets/tradeye.jsx +0 -7
  348. package/src/icon/registry.js +0 -65
  349. package/src/iconbox/ApplicationIconBox.js +0 -62
  350. package/src/iconbox/IconBox.js +0 -85
  351. package/src/iconbox/IconBoxV2.js +0 -61
  352. package/src/iconbox/__stories__/ApplicationIconBox.stories.js +0 -53
  353. package/src/iconbox/__stories__/IconBox.stories.js +0 -34
  354. package/src/iconbox/__stories__/IconBoxFigure.stories.js +0 -67
  355. package/src/iconbox/__stories__/IconBoxFigure.stories_V2.stories.js +0 -41
  356. package/src/iconbox/__stories__/IconBoxImage.stories.js +0 -32
  357. package/src/iconbox/__stories__/IconBoxV2.stories.js +0 -66
  358. package/src/iconbox/__test__/ApplicationIconBox.test.js +0 -77
  359. package/src/iconbox/__test__/IconBox.test.js +0 -22
  360. package/src/iconbox/__test__/IconBoxFigure.test.js +0 -37
  361. package/src/iconbox/__test__/IconBoxImage.test.js +0 -32
  362. package/src/iconbox/__test__/IconBoxV2.test.js +0 -51
  363. package/src/iconbox/assets/bg-enterprise.png +0 -0
  364. package/src/iconbox/assets/bg-merchant.png +0 -0
  365. package/src/iconbox/assets/bg-terminal.png +0 -0
  366. package/src/iconbox/bgImageRegistry.js +0 -13
  367. package/src/iconbox/index.js +0 -3
  368. package/src/iconbox/subComponent/IconBoxFigure.js +0 -16
  369. package/src/iconbox/subComponent/IconBoxImage.js +0 -52
  370. package/src/image/ImageFluid.js +0 -12
  371. package/src/image/UploadImage.js +0 -287
  372. package/src/image/__stories__/ImageFluid.stories.js +0 -25
  373. package/src/image/__stories__/UploadImage.stories.js +0 -56
  374. package/src/image/__test__/ImageFluid.test.js +0 -44
  375. package/src/image/__test__/UploadImage.test.js +0 -315
  376. package/src/image/index.js +0 -2
  377. package/src/index.js +0 -49
  378. package/src/jsoneditor/JsonEditor.js +0 -132
  379. package/src/jsoneditor/__stories__/JsonEditor.stories.js +0 -55
  380. package/src/jsoneditor/__test__/JsonEditor.test.js +0 -52
  381. package/src/jsoneditor/index.js +0 -1
  382. package/src/keyframe/Pulse.js +0 -17
  383. package/src/keyframe/Spin.js +0 -9
  384. package/src/layout/Aside.js +0 -47
  385. package/src/layout/Backdrop.js +0 -13
  386. package/src/layout/Container.js +0 -48
  387. package/src/layout/Footer.js +0 -32
  388. package/src/layout/Header.jsx +0 -48
  389. package/src/layout/Layout.jsx +0 -69
  390. package/src/layout/Logo.jsx +0 -17
  391. package/src/layout/MenuIcon.jsx +0 -45
  392. package/src/layout/Sidebar.jsx +0 -261
  393. package/src/layout/assets/burger-modern.jsx +0 -9
  394. package/src/layout/bgMainRegistry.js +0 -9
  395. package/src/layout/index.js +0 -1
  396. package/src/link/LinkSpan.js +0 -44
  397. package/src/link/__stories__/LinkSpan.stories.js +0 -27
  398. package/src/link/__test__/LinkSpan.test.js +0 -52
  399. package/src/link/index.js +0 -1
  400. package/src/map/GoogleMap.js +0 -489
  401. package/src/map/GoogleReverseGeolocation.js +0 -197
  402. package/src/map/LeafletMap.js +0 -264
  403. package/src/map/LeafletReverseGeolocation.js +0 -89
  404. package/src/map/__stories__/GoogleMap.stories.js +0 -139
  405. package/src/map/__stories__/GoogleReverseGeolocation.stories.js +0 -95
  406. package/src/map/__stories__/LeafletMap.stories.js +0 -136
  407. package/src/map/__stories__/LeafletReverseGeolocation.stories.js +0 -91
  408. package/src/map/__test__/LeafletReverseGeolocation.test.js +0 -245
  409. package/src/map/__test__/MapSearchBoxControl.test.js +0 -89
  410. package/src/map/index.js +0 -4
  411. package/src/map/subComponent/BasicLeafletMap.js +0 -33
  412. package/src/map/subComponent/GoogleMapContainer.js +0 -19
  413. package/src/map/subComponent/GoogleMapPopup.js +0 -115
  414. package/src/map/subComponent/GoogleMapWrapper.js +0 -27
  415. package/src/map/subComponent/LeafletDrawControl.js +0 -133
  416. package/src/map/subComponent/LeafletMapContainer.js +0 -163
  417. package/src/map/subComponent/MapSearchBoxControl.js +0 -43
  418. package/src/modal/StateModal.js +0 -182
  419. package/src/modal/TitleModal.js +0 -244
  420. package/src/modal/__stories__/StateModal.stories.js +0 -119
  421. package/src/modal/__stories__/TitleModal.stories.js +0 -56
  422. package/src/modal/__test__/StateModal.test.js +0 -144
  423. package/src/modal/index.js +0 -2
  424. package/src/page/Disclaimer.js +0 -123
  425. package/src/page/index.js +0 -1
  426. package/src/paginate/Paginate.js +0 -132
  427. package/src/paginate/__stories__/Paginate.stories.js +0 -49
  428. package/src/paginate/__test__/Paginate.test.js +0 -124
  429. package/src/paginate/index.js +0 -1
  430. package/src/popover/Popover.js +0 -82
  431. package/src/popover/__stories__/Popover.stories.js +0 -44
  432. package/src/popover/index.js +0 -1
  433. package/src/qrcode/QRCode.js +0 -54
  434. package/src/qrcode/QRCodeContainter.js +0 -25
  435. package/src/qrcode/__stories__/QRCode.stories.js +0 -36
  436. package/src/qrcode/__stories__/QRCodeContainter.stories.js +0 -28
  437. package/src/qrcode/index.js +0 -2
  438. package/src/ribbon/Ribbon.js +0 -38
  439. package/src/ribbon/__stories__/Ribbon.stories.js +0 -25
  440. package/src/ribbon/index.js +0 -1
  441. package/src/section/Section.js +0 -66
  442. package/src/section/SectionBody.js +0 -34
  443. package/src/section/SectionHeader.js +0 -41
  444. package/src/section/SectionToolbar.js +0 -13
  445. package/src/section/SectionToolbarItem.js +0 -12
  446. package/src/section/__stories__/Section.stories.js +0 -52
  447. package/src/section/__stories__/SectionBody.stories.js +0 -40
  448. package/src/section/__stories__/SectionHeader.stories.js +0 -67
  449. package/src/section/__stories__/SectionToolbar.stories.js +0 -43
  450. package/src/section/__test__/Section.test.js +0 -98
  451. package/src/section/__test__/SectionBody.test.js +0 -89
  452. package/src/section/__test__/SectionHeader.test.js +0 -35
  453. package/src/section/__test__/SectionToolbar.test.js +0 -17
  454. package/src/section/index.js +0 -5
  455. package/src/select/InputSelect.js +0 -314
  456. package/src/select/Select.js +0 -935
  457. package/src/select/__stories__/InputSelect.stories.js +0 -60
  458. package/src/select/__stories__/Select.stories.js +0 -236
  459. package/src/select/__test__/Select.test.js +0 -219
  460. package/src/select/index.js +0 -2
  461. package/src/select/subComponent/Checkbox.js +0 -33
  462. package/src/select/subComponent/Footer.js +0 -8
  463. package/src/select/subComponent/ListBox.js +0 -15
  464. package/src/select/subComponent/Option.js +0 -30
  465. package/src/select/subComponent/OptionGroup.js +0 -18
  466. package/src/select/subComponent/Options.js +0 -24
  467. package/src/select/subComponent/SearchBox.js +0 -53
  468. package/src/select/subComponent/SelectedMultipleCount.js +0 -42
  469. package/src/select/subComponent/SelectedMultipleTags.js +0 -41
  470. package/src/select/subComponent/SelectedMultipleText.js +0 -61
  471. package/src/select/subComponent/SelectedSingle.js +0 -12
  472. package/src/styles/GlobalStyle.js +0 -110
  473. package/src/styles/config/breakpoint.style.js +0 -8
  474. package/src/styles/config/header.style.js +0 -5
  475. package/src/styles/config/sidebar.style.js +0 -12
  476. package/src/styles/index.js +0 -2
  477. package/src/styles/mixin/backgroundColor.js +0 -15
  478. package/src/styles/mixin/borderColor.js +0 -15
  479. package/src/styles/mixin/color.js +0 -15
  480. package/src/styles/mixin/colorOnBackground.js +0 -13
  481. package/src/styles/mixin/inputPlaceholder.js +0 -26
  482. package/src/styles/mixin/media.js +0 -14
  483. package/src/styles/mixin/rounded.js +0 -12
  484. package/src/styles/mixin/scrollbar.js +0 -26
  485. package/src/styles/theme/dark.theme.js +0 -101
  486. package/src/styles/theme/ember.theme.js +0 -94
  487. package/src/styles/theme/light.theme.js +0 -99
  488. package/src/styles/theme/midnight.theme.js +0 -93
  489. package/src/styles/theme/white.theme.js +0 -103
  490. package/src/styles/themes.js +0 -15
  491. package/src/table/GridTable.js +0 -333
  492. package/src/table/ImageBox.js +0 -37
  493. package/src/table/InfiniteGridTable.js +0 -424
  494. package/src/table/PermissionTable.js +0 -36
  495. package/src/table/SimpleGridTable.js +0 -135
  496. package/src/table/Table.js +0 -553
  497. package/src/table/__mock__/columns.js +0 -67
  498. package/src/table/__mock__/data.js +0 -456
  499. package/src/table/__stories__/GridTable.stories.js +0 -129
  500. package/src/table/__stories__/ImageBox.stories.js +0 -27
  501. package/src/table/__stories__/InfiniteGridTable.stories.js +0 -120
  502. package/src/table/__stories__/PermissionTable.stories.js +0 -52
  503. package/src/table/__stories__/SimpleGridTable.stories.js +0 -58
  504. package/src/table/__stories__/Table.stories.js +0 -158
  505. package/src/table/hooks/index.js +0 -2
  506. package/src/table/hooks/useCalculateDataRange.js +0 -26
  507. package/src/table/hooks/useGenerateSort.js +0 -37
  508. package/src/table/index.js +0 -6
  509. package/src/table/subComponent/BaseTableHeadCell.js +0 -48
  510. package/src/table/subComponent/GridTableFooter.js +0 -18
  511. package/src/table/subComponent/GridTableHeadCell.js +0 -14
  512. package/src/table/subComponent/Resizer.js +0 -81
  513. package/src/table/subComponent/TableFooter.js +0 -19
  514. package/src/table/subComponent/TableFooterInfo.js +0 -8
  515. package/src/table/subComponent/TableFooterPager.js +0 -26
  516. package/src/table/subComponent/TableHeadCell.js +0 -14
  517. package/src/table/subComponent/TableSort.js +0 -25
  518. package/src/tagify/TagifyStyle.js +0 -55
  519. package/src/tagify/Tags.js +0 -49
  520. package/src/tagify/__stories__/Tags.stories.js +0 -59
  521. package/src/tagify/index.js +0 -3
  522. package/src/tagify/templates/getCreateButtonTemplate.js +0 -12
  523. package/src/text/Paragraph.js +0 -52
  524. package/src/text/__stories__/Paragraph.stories.js +0 -40
  525. package/src/text/index.js +0 -1
  526. package/src/timeline/Timeline.js +0 -106
  527. package/src/timeline/__stories__/Timeline.stories.js +0 -55
  528. package/src/timeline/index.js +0 -1
  529. package/src/toast/CustomToastContainer.js +0 -40
  530. package/src/toast/MessageContainer.js +0 -40
  531. package/src/toast/__stories__/MessageContainer.stories.js +0 -47
  532. package/src/toast/index.js +0 -3
  533. package/src/toast/show.js +0 -39
  534. package/src/toast/style.css +0 -1
  535. package/src/tooltip/Tooltip.js +0 -149
  536. package/src/tooltip/__stories__/Tooltip.stories.js +0 -72
  537. package/src/tooltip/__test__/tooltip.test.js +0 -130
  538. package/src/tooltip/index.js +0 -1
  539. package/src/treeView/TreeViewV2.js +0 -33
  540. package/src/treeView/TreeflexStyle.js +0 -44
  541. package/src/treeView/index.js +0 -2
  542. package/src/wizard/Wizard.js +0 -276
  543. package/src/wizard/__stories__/Wizard.stories.js +0 -81
  544. package/src/wizard/__test__/Wizard.test.js +0 -173
  545. package/src/wizard/index.js +0 -1
  546. package/src/xmleditor/XmlEditor.js +0 -25
  547. package/src/xmleditor/index.js +0 -1
  548. package/transformer/fileTransformer.js +0 -9
  549. /package/{dist/Tab → Tab}/Tab.js +0 -0
  550. /package/{dist/Tab → Tab}/TabList.js +0 -0
  551. /package/{dist/Tab → Tab}/TabPanel.js +0 -0
  552. /package/{dist/Tab → Tab}/TabTab.js +0 -0
  553. /package/{dist/Tab → Tab}/index.js +0 -0
  554. /package/{dist/Tab → Tab}/subComponent/TabContext.js +0 -0
  555. /package/{dist/Tab → Tab}/subComponent/TabListV2.js +0 -0
  556. /package/{dist/Tab → Tab}/subComponent/TabPanelV2.js +0 -0
  557. /package/{dist/Tab → Tab}/subComponent/TabTabV2.js +0 -0
  558. /package/{dist/VerticalTab → VerticalTab}/TabList.js +0 -0
  559. /package/{dist/VerticalTab → VerticalTab}/TabPanel.js +0 -0
  560. /package/{dist/VerticalTab → VerticalTab}/TabTab.js +0 -0
  561. /package/{dist/VerticalTab → VerticalTab}/VerticalTab.js +0 -0
  562. /package/{dist/VerticalTab → VerticalTab}/index.js +0 -0
  563. /package/{dist/VerticalTab → VerticalTab}/subComponent/TabContext.js +0 -0
  564. /package/{dist/alert → alert}/Alert.js +0 -0
  565. /package/{dist/alert → alert}/index.js +0 -0
  566. /package/{dist/animate → animate}/Collapse.js +0 -0
  567. /package/{dist/animate → animate}/Loader.js +0 -0
  568. /package/{dist/animate → animate}/NumberCounter.js +0 -0
  569. /package/{dist/animate → animate}/PulseRing.js +0 -0
  570. /package/{dist/animate → animate}/Spinner.js +0 -0
  571. /package/{dist/animate → animate}/index.js +0 -0
  572. /package/{dist/assets → assets}/css/autocomplete.css +0 -0
  573. /package/{dist/assets → assets}/css/font.css +0 -0
  574. /package/{dist/assets → assets}/css/global.css +0 -0
  575. /package/{dist/assets → assets}/font/helvetica/Helvetica.ttf +0 -0
  576. /package/{dist/assets → assets}/font/nanumGothic/NanumGothic-Bold.ttf +0 -0
  577. /package/{dist/assets → assets}/font/nanumGothic/NanumGothic-ExtraBold.ttf +0 -0
  578. /package/{dist/assets → assets}/font/nanumGothic/NanumGothic-Regular.ttf +0 -0
  579. /package/{dist/assets → assets}/icons/app-management.png +0 -0
  580. /package/{dist/assets → assets}/icons/burger-black.png +0 -0
  581. /package/{dist/assets → assets}/icons/burger-white.png +0 -0
  582. /package/{dist/assets → assets}/icons/burger.png +0 -0
  583. /package/{dist/assets → assets}/icons/file.svg +0 -0
  584. /package/{dist/assets → assets}/icons/map_icon1.png +0 -0
  585. /package/{dist/assets → assets}/icons/map_icon4.png +0 -0
  586. /package/{dist/assets → assets}/images/bg-aside.png +0 -0
  587. /package/{dist/assets → assets}/images/bg-chart-circle.png +0 -0
  588. /package/{dist/assets → assets}/images/bg-chart-triangle.png +0 -0
  589. /package/{dist/assets → assets}/images/bg-main-vivid.png +0 -0
  590. /package/{dist/assets → assets}/images/bg-main.png +0 -0
  591. /package/{dist/assets → assets}/images/cashub-logo-only.png +0 -0
  592. /package/{dist/assets → assets}/images/default-user.jpg +0 -0
  593. /package/{dist/assets → assets}/images/logo-cashub.png +0 -0
  594. /package/{dist/assets → assets}/images/map.png +0 -0
  595. /package/{dist/assets → assets}/images/qrcode.png +0 -0
  596. /package/{dist/backdrop → backdrop}/BaseBackdrop.js +0 -0
  597. /package/{dist/backdrop → backdrop}/LoadingBackdrop.js +0 -0
  598. /package/{dist/backdrop → backdrop}/ModalBackdrop.js +0 -0
  599. /package/{dist/backdrop → backdrop}/index.js +0 -0
  600. /package/{dist/badge → badge}/Badge.js +0 -0
  601. /package/{dist/badge → badge}/BadgeDot.js +0 -0
  602. /package/{dist/badge → badge}/BadgeFill.js +0 -0
  603. /package/{dist/badge → badge}/BadgeFillTriangle.js +0 -0
  604. /package/{dist/badge → badge}/BadgeWithText.js +0 -0
  605. /package/{dist/badge → badge}/index.js +0 -0
  606. /package/{dist/billing → billing}/BarChart.js +0 -0
  607. /package/{dist/billing → billing}/Grid.js +0 -0
  608. /package/{dist/billing → billing}/Header2.js +0 -0
  609. /package/{dist/billing → billing}/Header3.js +0 -0
  610. /package/{dist/billing → billing}/Paragraph.js +0 -0
  611. /package/{dist/billing → billing}/ParagraphGroup.js +0 -0
  612. /package/{dist/billing → billing}/ParagraphText.js +0 -0
  613. /package/{dist/billing → billing}/Section.js +0 -0
  614. /package/{dist/billing → billing}/SectionBody.js +0 -0
  615. /package/{dist/billing → billing}/SectionHeader.js +0 -0
  616. /package/{dist/billing → billing}/__stories__/BarChart.stories.js_bak +0 -0
  617. /package/{dist/billing → billing}/__stories__/Grid.stories.js_bak +0 -0
  618. /package/{dist/billing → billing}/__stories__/Header2.stories.js_bak +0 -0
  619. /package/{dist/billing → billing}/__stories__/Header3.stories.js_bak +0 -0
  620. /package/{dist/billing → billing}/__stories__/Paragraph.stories.js_bak +0 -0
  621. /package/{dist/billing → billing}/__stories__/ParagraphGroup.stories.js_bak +0 -0
  622. /package/{dist/billing → billing}/__stories__/ParagraphText.stories.js_bak +0 -0
  623. /package/{dist/billing → billing}/__stories__/Section.stories.js_bak +0 -0
  624. /package/{dist/billing → billing}/__stories__/SectionBody.stories.js_bak +0 -0
  625. /package/{dist/billing → billing}/__stories__/SectionHeader.stories.js-bak +0 -0
  626. /package/{dist/breadcrumb → breadcrumb}/Breadcrumb.js +0 -0
  627. /package/{dist/breadcrumb → breadcrumb}/index.js +0 -0
  628. /package/{dist/button → button}/Button.js +0 -0
  629. /package/{dist/button → button}/ButtonGroup.js +0 -0
  630. /package/{dist/button → button}/IconButton.js +0 -0
  631. /package/{dist/button → button}/ScrollToTopButton.js +0 -0
  632. /package/{dist/button → button}/index.js +0 -0
  633. /package/{dist/callout → callout}/Callout.js +0 -0
  634. /package/{dist/callout → callout}/index.js +0 -0
  635. /package/{dist/chart → chart}/BarChart.js +0 -0
  636. /package/{dist/chart → chart}/DoughnutChart.js +0 -0
  637. /package/{dist/chart → chart}/LineChart.js +0 -0
  638. /package/{dist/chart → chart}/SingleBarChart.js +0 -0
  639. /package/{dist/chart → chart}/index.js +0 -0
  640. /package/{dist/chart → chart}/utils/centerTextPlugin.js +0 -0
  641. /package/{dist/chart → chart}/utils/customTooltip.js +0 -0
  642. /package/{dist/chart → chart}/utils/htmlLegendPlugin.js +0 -0
  643. /package/{dist/chart → chart}/utils/index.js +0 -0
  644. /package/{dist/chart → chart}/utils/padEmptyChartBar.js +0 -0
  645. /package/{dist/chart → chart}/utils/yAxisTopTitlePlugin.js +0 -0
  646. /package/{dist/container → container}/FlexContainer.js +0 -0
  647. /package/{dist/container → container}/index.js +0 -0
  648. /package/{dist/cropper → cropper}/Cropper.js +0 -0
  649. /package/{dist/cropper → cropper}/CropperModalHandler.js +0 -0
  650. /package/{dist/cropper → cropper}/index.js +0 -0
  651. /package/{dist/cropper → cropper}/subComponent/CropImageModal.js +0 -0
  652. /package/{dist/datetimePicker → datetimePicker}/DatePicker.js +0 -0
  653. /package/{dist/datetimePicker → datetimePicker}/DatePickerV2.js +0 -0
  654. /package/{dist/datetimePicker → datetimePicker}/DatetimePicker.js +0 -0
  655. /package/{dist/datetimePicker → datetimePicker}/DatetimePickerV2.js +0 -0
  656. /package/{dist/datetimePicker → datetimePicker}/DatetimePickerV3.js +0 -0
  657. /package/{dist/datetimePicker → datetimePicker}/TimeInput.js +0 -0
  658. /package/{dist/datetimePicker → datetimePicker}/TimePicker.js +0 -0
  659. /package/{dist/datetimePicker → datetimePicker}/TimePickerStyle.js +0 -0
  660. /package/{dist/datetimePicker → datetimePicker}/TimePickerV2.js +0 -0
  661. /package/{dist/datetimePicker → datetimePicker}/accordion/Month.js +0 -0
  662. /package/{dist/datetimePicker → datetimePicker}/accordion/Year.js +0 -0
  663. /package/{dist/datetimePicker → datetimePicker}/hooks/index.js +0 -0
  664. /package/{dist/datetimePicker → datetimePicker}/hooks/useChangeNumber.js +0 -0
  665. /package/{dist/datetimePicker → datetimePicker}/hooks/useDecrease.js +0 -0
  666. /package/{dist/datetimePicker → datetimePicker}/hooks/useIncrease.js +0 -0
  667. /package/{dist/datetimePicker → datetimePicker}/index.js +0 -0
  668. /package/{dist/datetimePicker → datetimePicker}/provider/constant.js +0 -0
  669. /package/{dist/datetimePicker → datetimePicker}/subComponent/Accordion.js +0 -0
  670. /package/{dist/datetimePicker → datetimePicker}/subComponent/CustomTimeInput.js +0 -0
  671. /package/{dist/datetimePicker → datetimePicker}/subComponent/DateTimePickerContext.js +0 -0
  672. /package/{dist/datetimePicker → datetimePicker}/utils/GMTDate.js +0 -0
  673. /package/{dist/datetimePicker → datetimePicker}/utils/pad.js +0 -0
  674. /package/{dist/datetimePicker → datetimePicker}/utils/toUTC0.js +0 -0
  675. /package/{dist/descriptionList → descriptionList}/DescriptionDetail.js +0 -0
  676. /package/{dist/descriptionList → descriptionList}/DescriptionList.js +0 -0
  677. /package/{dist/descriptionList → descriptionList}/DescriptionTerm.js +0 -0
  678. /package/{dist/descriptionList → descriptionList}/index.js +0 -0
  679. /package/{dist/divider → divider}/Divider.js +0 -0
  680. /package/{dist/divider → divider}/index.js +0 -0
  681. /package/{dist/dropdown → dropdown}/Dropdown.js +0 -0
  682. /package/{dist/dropdown → dropdown}/DropdownButtonOption.js +0 -0
  683. /package/{dist/dropdown → dropdown}/DropdownContent.js +0 -0
  684. /package/{dist/dropdown → dropdown}/DropdownDivOption.js +0 -0
  685. /package/{dist/dropdown → dropdown}/DropdownItem.js +0 -0
  686. /package/{dist/dropdown → dropdown}/DropdownLinkOption.js +0 -0
  687. /package/{dist/dropdown → dropdown}/DropdownToggle.js +0 -0
  688. /package/{dist/dropdown → dropdown}/index.js +0 -0
  689. /package/{dist/dropdown → dropdown}/subComponent/DropdownContext.js +0 -0
  690. /package/{dist/dropzone → dropzone}/FileDropzone.js +0 -0
  691. /package/{dist/dropzone → dropzone}/ImageDropzone.js +0 -0
  692. /package/{dist/dropzone → dropzone}/index.js +0 -0
  693. /package/{dist/dropzone → dropzone}/subComponent/Message.js +0 -0
  694. /package/{dist/figure → figure}/IconFigure.js +0 -0
  695. /package/{dist/figure → figure}/ImageFigure.js +0 -0
  696. /package/{dist/figure → figure}/index.js +0 -0
  697. /package/{dist/file → file}/HiddenFileInput.js +0 -0
  698. /package/{dist/file → file}/index.js +0 -0
  699. /package/{dist/form → form}/Checkbox.js +0 -0
  700. /package/{dist/form → form}/Fieldset.js +0 -0
  701. /package/{dist/form → form}/FormItem.js +0 -0
  702. /package/{dist/form → form}/Input.js +0 -0
  703. /package/{dist/form → form}/Label.js +0 -0
  704. /package/{dist/form → form}/MutedText.js +0 -0
  705. /package/{dist/form → form}/PasswordInput.js +0 -0
  706. /package/{dist/form → form}/RadioButton.js +0 -0
  707. /package/{dist/form → form}/SearchSelect.js +0 -0
  708. /package/{dist/form → form}/Searchbox.js +0 -0
  709. /package/{dist/form → form}/Slider.js +0 -0
  710. /package/{dist/form → form}/SwitchButton.js +0 -0
  711. /package/{dist/form → form}/Textarea.js +0 -0
  712. /package/{dist/form → form}/TreeView.js +0 -0
  713. /package/{dist/form → form}/index.js +0 -0
  714. /package/{dist/grid → grid}/Column.js +0 -0
  715. /package/{dist/grid → grid}/Grid.js +0 -0
  716. /package/{dist/grid → grid}/index.js +0 -0
  717. /package/{dist/heading → heading}/Heading1.js +0 -0
  718. /package/{dist/heading → heading}/Heading2.js +0 -0
  719. /package/{dist/heading → heading}/Heading3.js +0 -0
  720. /package/{dist/heading → heading}/index.js +0 -0
  721. /package/{dist/helmet → helmet}/Helmet.js +0 -0
  722. /package/{dist/helmet → helmet}/index.js +0 -0
  723. /package/{dist/icon → icon}/assets/android.jsx +0 -0
  724. /package/{dist/icon → icon}/assets/app-management.jsx +0 -0
  725. /package/{dist/icon → icon}/assets/appStore.jsx +0 -0
  726. /package/{dist/icon → icon}/assets/battery.jsx +0 -0
  727. /package/{dist/icon → icon}/assets/bill.jsx +0 -0
  728. /package/{dist/icon → icon}/assets/campaign.jsx +0 -0
  729. /package/{dist/icon → icon}/assets/casstore.jsx +0 -0
  730. /package/{dist/icon → icon}/assets/dashboard.jsx +0 -0
  731. /package/{dist/icon → icon}/assets/enterprise.jsx +0 -0
  732. /package/{dist/icon → icon}/assets/firmware.jsx +0 -0
  733. /package/{dist/icon → icon}/assets/folder.jsx +0 -0
  734. /package/{dist/icon → icon}/assets/group.jsx +0 -0
  735. /package/{dist/icon → icon}/assets/heartbeats.jsx +0 -0
  736. /package/{dist/icon → icon}/assets/invite-user.jsx +0 -0
  737. /package/{dist/icon → icon}/assets/log.jsx +0 -0
  738. /package/{dist/icon → icon}/assets/manufacturer.jsx +0 -0
  739. /package/{dist/icon → icon}/assets/merchant.jsx +0 -0
  740. /package/{dist/icon → icon}/assets/package-collection.jsx +0 -0
  741. /package/{dist/icon → icon}/assets/report.jsx +0 -0
  742. /package/{dist/icon → icon}/assets/resource.jsx +0 -0
  743. /package/{dist/icon → icon}/assets/role.jsx +0 -0
  744. /package/{dist/icon → icon}/assets/shield-lock.jsx +0 -0
  745. /package/{dist/icon → icon}/assets/shield-no-signal.jsx +0 -0
  746. /package/{dist/icon → icon}/assets/shield-unsafe.jsx +0 -0
  747. /package/{dist/icon → icon}/assets/shield.jsx +0 -0
  748. /package/{dist/icon → icon}/assets/statistics.jsx +0 -0
  749. /package/{dist/icon → icon}/assets/tag.jsx +0 -0
  750. /package/{dist/icon → icon}/assets/template-management.jsx +0 -0
  751. /package/{dist/icon → icon}/assets/terminal.jsx +0 -0
  752. /package/{dist/icon → icon}/assets/tradeye.jsx +0 -0
  753. /package/{dist/iconbox → iconbox}/ApplicationIconBox.js +0 -0
  754. /package/{dist/iconbox → iconbox}/IconBox.js +0 -0
  755. /package/{dist/iconbox → iconbox}/IconBoxV2.js +0 -0
  756. /package/{dist/iconbox/assets/bg-user.png → iconbox/assets/bg-app-management.png} +0 -0
  757. /package/{dist/iconbox → iconbox}/assets/bg-enterprise.png +0 -0
  758. /package/{dist/iconbox → iconbox}/assets/bg-merchant.png +0 -0
  759. /package/{dist/iconbox → iconbox}/assets/bg-terminal.png +0 -0
  760. /package/{src/iconbox → iconbox}/assets/bg-user.png +0 -0
  761. /package/{dist/iconbox → iconbox}/index.js +0 -0
  762. /package/{dist/iconbox → iconbox}/subComponent/IconBoxFigure.js +0 -0
  763. /package/{dist/iconbox → iconbox}/subComponent/IconBoxImage.js +0 -0
  764. /package/{dist/image → image}/ImageFluid.js +0 -0
  765. /package/{dist/image → image}/UploadImage.js +0 -0
  766. /package/{dist/image → image}/index.js +0 -0
  767. /package/{dist/jsoneditor → jsoneditor}/JsonEditor.js +0 -0
  768. /package/{dist/jsoneditor → jsoneditor}/index.js +0 -0
  769. /package/{dist/keyframe → keyframe}/Pulse.js +0 -0
  770. /package/{dist/keyframe → keyframe}/Spin.js +0 -0
  771. /package/{dist/layout → layout}/Aside.js +0 -0
  772. /package/{dist/layout → layout}/Backdrop.js +0 -0
  773. /package/{dist/layout → layout}/Container.js +0 -0
  774. /package/{dist/layout → layout}/Footer.js +0 -0
  775. /package/{dist/layout → layout}/Header.jsx +0 -0
  776. /package/{dist/layout → layout}/Layout.jsx +0 -0
  777. /package/{dist/layout → layout}/Logo.jsx +0 -0
  778. /package/{dist/layout → layout}/MenuIcon.jsx +0 -0
  779. /package/{dist/layout → layout}/Sidebar.jsx +0 -0
  780. /package/{dist/layout → layout}/assets/burger-modern.jsx +0 -0
  781. /package/{dist/layout → layout}/bgMainRegistry.js +0 -0
  782. /package/{dist/layout → layout}/index.js +0 -0
  783. /package/{dist/link → link}/LinkSpan.js +0 -0
  784. /package/{dist/link → link}/index.js +0 -0
  785. /package/{dist/map → map}/GoogleMap.js +0 -0
  786. /package/{dist/map → map}/GoogleReverseGeolocation.js +0 -0
  787. /package/{dist/map → map}/LeafletMap.js +0 -0
  788. /package/{dist/map → map}/LeafletReverseGeolocation.js +0 -0
  789. /package/{dist/map → map}/index.js +0 -0
  790. /package/{dist/map → map}/subComponent/BasicLeafletMap.js +0 -0
  791. /package/{dist/map → map}/subComponent/GoogleMapContainer.js +0 -0
  792. /package/{dist/map → map}/subComponent/GoogleMapPopup.js +0 -0
  793. /package/{dist/map → map}/subComponent/GoogleMapWrapper.js +0 -0
  794. /package/{dist/map → map}/subComponent/LeafletDrawControl.js +0 -0
  795. /package/{dist/map → map}/subComponent/LeafletMapContainer.js +0 -0
  796. /package/{dist/map → map}/subComponent/MapSearchBoxControl.js +0 -0
  797. /package/{dist/modal → modal}/StateModal.js +0 -0
  798. /package/{dist/modal → modal}/TitleModal.js +0 -0
  799. /package/{dist/modal → modal}/index.js +0 -0
  800. /package/{dist/page → page}/Disclaimer.js +0 -0
  801. /package/{dist/page → page}/index.js +0 -0
  802. /package/{dist/paginate → paginate}/Paginate.js +0 -0
  803. /package/{dist/paginate → paginate}/index.js +0 -0
  804. /package/{dist/popover → popover}/Popover.js +0 -0
  805. /package/{dist/popover → popover}/index.js +0 -0
  806. /package/{dist/qrcode → qrcode}/QRCode.js +0 -0
  807. /package/{dist/qrcode → qrcode}/QRCodeContainter.js +0 -0
  808. /package/{dist/qrcode → qrcode}/index.js +0 -0
  809. /package/{dist/ribbon → ribbon}/Ribbon.js +0 -0
  810. /package/{dist/ribbon → ribbon}/index.js +0 -0
  811. /package/{dist/section → section}/Section.js +0 -0
  812. /package/{dist/section → section}/SectionBody.js +0 -0
  813. /package/{dist/section → section}/SectionHeader.js +0 -0
  814. /package/{dist/section → section}/SectionToolbar.js +0 -0
  815. /package/{dist/section → section}/SectionToolbarItem.js +0 -0
  816. /package/{dist/section → section}/index.js +0 -0
  817. /package/{dist/select → select}/InputSelect.js +0 -0
  818. /package/{dist/select → select}/Select.js +0 -0
  819. /package/{dist/select → select}/index.js +0 -0
  820. /package/{dist/select → select}/subComponent/Checkbox.js +0 -0
  821. /package/{dist/select → select}/subComponent/Footer.js +0 -0
  822. /package/{dist/select → select}/subComponent/ListBox.js +0 -0
  823. /package/{dist/select → select}/subComponent/Option.js +0 -0
  824. /package/{dist/select → select}/subComponent/OptionGroup.js +0 -0
  825. /package/{dist/select → select}/subComponent/Options.js +0 -0
  826. /package/{dist/select → select}/subComponent/SearchBox.js +0 -0
  827. /package/{dist/select → select}/subComponent/SelectedMultipleCount.js +0 -0
  828. /package/{dist/select → select}/subComponent/SelectedMultipleTags.js +0 -0
  829. /package/{dist/select → select}/subComponent/SelectedMultipleText.js +0 -0
  830. /package/{dist/select → select}/subComponent/SelectedSingle.js +0 -0
  831. /package/{dist/styles → styles}/GlobalStyle.js +0 -0
  832. /package/{dist/styles → styles}/config/breakpoint.style.js +0 -0
  833. /package/{dist/styles → styles}/config/header.style.js +0 -0
  834. /package/{dist/styles → styles}/config/sidebar.style.js +0 -0
  835. /package/{dist/styles → styles}/index.js +0 -0
  836. /package/{dist/styles → styles}/mixin/backgroundColor.js +0 -0
  837. /package/{dist/styles → styles}/mixin/borderColor.js +0 -0
  838. /package/{dist/styles → styles}/mixin/color.js +0 -0
  839. /package/{dist/styles → styles}/mixin/colorOnBackground.js +0 -0
  840. /package/{dist/styles → styles}/mixin/inputPlaceholder.js +0 -0
  841. /package/{dist/styles → styles}/mixin/media.js +0 -0
  842. /package/{dist/styles → styles}/mixin/rounded.js +0 -0
  843. /package/{dist/styles → styles}/mixin/scrollbar.js +0 -0
  844. /package/{dist/styles → styles}/theme/midnight.theme.js +0 -0
  845. /package/{dist/styles → styles}/themes.js +0 -0
  846. /package/{dist/table → table}/GridTable.js +0 -0
  847. /package/{dist/table → table}/ImageBox.js +0 -0
  848. /package/{dist/table → table}/InfiniteGridTable.js +0 -0
  849. /package/{dist/table → table}/PermissionTable.js +0 -0
  850. /package/{dist/table → table}/SimpleGridTable.js +0 -0
  851. /package/{dist/table → table}/Table.js +0 -0
  852. /package/{dist/table → table}/__mock__/columns.js +0 -0
  853. /package/{dist/table → table}/__mock__/data.js +0 -0
  854. /package/{dist/table → table}/hooks/index.js +0 -0
  855. /package/{dist/table → table}/hooks/useCalculateDataRange.js +0 -0
  856. /package/{dist/table → table}/hooks/useGenerateSort.js +0 -0
  857. /package/{dist/table → table}/index.js +0 -0
  858. /package/{dist/table → table}/subComponent/BaseTableHeadCell.js +0 -0
  859. /package/{dist/table → table}/subComponent/GridTableFooter.js +0 -0
  860. /package/{dist/table → table}/subComponent/GridTableHeadCell.js +0 -0
  861. /package/{dist/table → table}/subComponent/Resizer.js +0 -0
  862. /package/{dist/table → table}/subComponent/TableFooter.js +0 -0
  863. /package/{dist/table → table}/subComponent/TableFooterInfo.js +0 -0
  864. /package/{dist/table → table}/subComponent/TableFooterPager.js +0 -0
  865. /package/{dist/table → table}/subComponent/TableHeadCell.js +0 -0
  866. /package/{dist/table → table}/subComponent/TableSort.js +0 -0
  867. /package/{dist/tagify → tagify}/TagifyStyle.js +0 -0
  868. /package/{dist/tagify → tagify}/Tags.js +0 -0
  869. /package/{dist/tagify → tagify}/index.js +0 -0
  870. /package/{dist/tagify → tagify}/templates/getCreateButtonTemplate.js +0 -0
  871. /package/{dist/text → text}/Paragraph.js +0 -0
  872. /package/{dist/text → text}/index.js +0 -0
  873. /package/{dist/timeline → timeline}/Timeline.js +0 -0
  874. /package/{dist/timeline → timeline}/index.js +0 -0
  875. /package/{dist/toast → toast}/CustomToastContainer.js +0 -0
  876. /package/{dist/toast → toast}/MessageContainer.js +0 -0
  877. /package/{dist/toast → toast}/index.js +0 -0
  878. /package/{dist/toast → toast}/show.js +0 -0
  879. /package/{dist/toast → toast}/style.css +0 -0
  880. /package/{dist/tooltip → tooltip}/Tooltip.js +0 -0
  881. /package/{dist/tooltip → tooltip}/index.js +0 -0
  882. /package/{dist/treeView → treeView}/TreeViewV2.js +0 -0
  883. /package/{dist/treeView → treeView}/TreeflexStyle.js +0 -0
  884. /package/{dist/treeView → treeView}/index.js +0 -0
  885. /package/{dist/wizard → wizard}/Wizard.js +0 -0
  886. /package/{dist/wizard → wizard}/index.js +0 -0
  887. /package/{dist/xmleditor → xmleditor}/XmlEditor.js +0 -0
  888. /package/{dist/xmleditor → xmleditor}/index.js +0 -0
@@ -1,935 +0,0 @@
1
- import {
2
- Fragment,
3
- useState,
4
- useEffect,
5
- useMemo,
6
- useCallback,
7
- useRef,
8
- } from 'react';
9
- import { createPortal } from 'react-dom';
10
- import { useTranslation } from 'react-i18next';
11
- import OutsideClickHandler from 'react-outside-click-handler';
12
- import styled from 'styled-components';
13
- import uniqueId from 'lodash.uniqueid';
14
- import { TiArrowSortedDown } from 'react-icons/ti';
15
- import { MdClose } from 'react-icons/md';
16
- import { useCustomPopper } from '@cashub/hooks';
17
- import { KEY_CODE } from '@cashub/utils';
18
- import media from '../styles/mixin/media';
19
- import SelectedSingle from './subComponent/SelectedSingle';
20
- import SelectedMultipleTags from './subComponent/SelectedMultipleTags';
21
- import SelectedMultipleText from './subComponent/SelectedMultipleText';
22
- import SelectedMultipleCount from './subComponent/SelectedMultipleCount';
23
- import ListBox from './subComponent/ListBox';
24
- import SearchBox from './subComponent/SearchBox';
25
- import Options from './subComponent/Options';
26
- import OptionGroup from './subComponent/OptionGroup';
27
- import Option from './subComponent/Option';
28
- import Checkbox from './subComponent/Checkbox';
29
- import Footer from './subComponent/Footer';
30
- import { IconFigure } from '../figure';
31
- import { ImageFluid } from '../image';
32
-
33
- const Select = ({
34
- options,
35
- enableSelectAll = false,
36
- selected,
37
- onSelect,
38
- onDeselect,
39
- multiple = false,
40
- displayMode = 'tags',
41
- allowClear = false,
42
- allowSearch = true,
43
- disabled,
44
- placeholder = '',
45
- fullWidth,
46
- large,
47
- fill,
48
- fillReverse,
49
- onBlur,
50
- onSearch,
51
- flexGrow,
52
- footer,
53
- }) => {
54
- const { t } = useTranslation();
55
- const [id] = useState(uniqueId('select-'));
56
- const [allOptionId] = useState(uniqueId('allOptons-'));
57
- const [display, setDisplay] = useState(false);
58
- const [comboboxElement, setComboboxElement] = useState(null);
59
- const [listBoxElement, setListBoxElement] = useState(null);
60
- const optionsElementRef = useRef(null);
61
- const searchBoxElement = useRef(null);
62
- const [listBoxWidth, setListBoxWidth] = useState(0);
63
- const [optionList, setOptionList] = useState([]);
64
- const [focusedOption, setFocusedOption] = useState(null);
65
- const [isFocusCombobox, setIsFocusCombobox] = useState(false);
66
- const [selectedOptions, setSelectedOptions] = useState([]);
67
- const [filteredOptions, setFilteredOptions] = useState(options);
68
- const [search, setSearch] = useState('');
69
-
70
- const { styles, attributes, state, update } = useCustomPopper(
71
- comboboxElement,
72
- listBoxElement,
73
- );
74
- const newOptions = useMemo(() => {
75
- if (!options) return;
76
- const newOptions = options.map((item) => {
77
- return { isDisable: false, ...item };
78
- });
79
- if (options.length > 0 && multiple && enableSelectAll) {
80
- newOptions.unshift({ id: allOptionId, text: t('All') });
81
- }
82
-
83
- return newOptions;
84
- }, [options, multiple, enableSelectAll, allOptionId]);
85
-
86
- const enabledOptions = useMemo(() => {
87
- return newOptions.filter((item) => !item.isDisable);
88
- }, [newOptions]);
89
-
90
- // parse all value to string
91
- // for subsequently determine whether it is a selected item
92
- const parsedSelected = useMemo(() => {
93
- if (selected || selected === 0) {
94
- // multiple value
95
- if (Array.isArray(selected)) {
96
- return selected.map((value) => value.toString());
97
- }
98
-
99
- // single value
100
- return selected.toString();
101
- }
102
- return '';
103
- }, [selected]);
104
-
105
- const selectedAllOptions = useMemo(() => {
106
- if (
107
- multiple &&
108
- enableSelectAll &&
109
- parsedSelected.length + 1 === enabledOptions.length
110
- ) {
111
- const selectedAllOptions = [...parsedSelected];
112
- selectedAllOptions.unshift(allOptionId);
113
- return selectedAllOptions;
114
- }
115
- return parsedSelected;
116
- }, [
117
- multiple,
118
- enableSelectAll,
119
- enabledOptions.length,
120
- parsedSelected,
121
- allOptionId,
122
- ]);
123
-
124
- const showCheckbox = useMemo(() => {
125
- if (multiple && displayMode === 'text') {
126
- return true;
127
- }
128
-
129
- return false;
130
- }, [displayMode, multiple]);
131
-
132
- const getOptionText = useCallback((option) => {
133
- return [option.text, option.suffix]
134
- .filter((text) => text || text === 0)
135
- .join(' ');
136
- }, []);
137
-
138
- const renderOptionContent = useCallback(
139
- (option) => {
140
- const text = getOptionText(option);
141
- const highlightText = option.highlightText?.toString();
142
-
143
- if (highlightText && text.includes(highlightText)) {
144
- return (
145
- <OptionLabel>
146
- {text.split(highlightText).map((textPart, index, textParts) => {
147
- return (
148
- <Fragment key={`${highlightText}-${index}`}>
149
- {textPart}
150
- {index < textParts.length - 1 && (
151
- <OptionHighlight $color={option.highlightColor}>
152
- {highlightText}
153
- </OptionHighlight>
154
- )}
155
- </Fragment>
156
- );
157
- })}
158
- </OptionLabel>
159
- );
160
- }
161
-
162
- return (
163
- <OptionLabel>
164
- {option.text}
165
- {option.suffix && <OptionBadge>&nbsp;{option.suffix}</OptionBadge>}
166
- </OptionLabel>
167
- );
168
- },
169
- [getOptionText],
170
- );
171
-
172
- // set focused option
173
- const handleFocusItem = useCallback((element) => {
174
- if (!optionsElementRef.current) return;
175
-
176
- setFocusedOption(element);
177
-
178
- const container = optionsElementRef.current;
179
- if (container.scrollHeight > container.clientHeight) {
180
- const scrollBottom = container.clientHeight + container.scrollTop;
181
- const elementBottom = element.offsetTop + element.offsetHeight;
182
- if (elementBottom > scrollBottom) {
183
- container.scrollTop = elementBottom - container.clientHeight;
184
- } else if (element.offsetTop < container.scrollTop) {
185
- container.scrollTop = element.offsetTop;
186
- }
187
- }
188
- }, []);
189
-
190
- const focusFirstItem = useCallback(() => {
191
- const firstItem = listBoxElement.querySelector('[role="option"]');
192
-
193
- if (firstItem) {
194
- handleFocusItem(firstItem);
195
- }
196
- }, [listBoxElement, handleFocusItem]);
197
-
198
- const setupFocus = useCallback(() => {
199
- if (!listBoxElement) return;
200
-
201
- const selectedItem = listBoxElement.querySelector('[aria-selected="true"]');
202
-
203
- if (selectedItem) {
204
- handleFocusItem(selectedItem);
205
- } else if (optionList.length > 0) {
206
- focusFirstItem();
207
- } else {
208
- setFocusedOption(null);
209
- }
210
- }, [listBoxElement, handleFocusItem, focusFirstItem, optionList]);
211
-
212
- const findPreviousItem = useCallback(
213
- (currentItem) => {
214
- const allItem = [...listBoxElement.querySelectorAll('[role="option"]')];
215
- const currentItemIndex = allItem.indexOf(currentItem);
216
- let previousItem = null;
217
-
218
- if (currentItemIndex !== -1 && currentItemIndex > 0) {
219
- previousItem = allItem[currentItemIndex - 1];
220
- }
221
-
222
- return previousItem;
223
- },
224
- [listBoxElement],
225
- );
226
-
227
- const findNextItem = useCallback(
228
- (currentItem) => {
229
- const allItem = [...listBoxElement.querySelectorAll('[role="option"]')];
230
- const currentItemIndex = allItem.indexOf(currentItem);
231
- let nextItem = null;
232
-
233
- if (currentItemIndex !== -1 && currentItemIndex < allItem.length - 1) {
234
- nextItem = allItem[currentItemIndex + 1];
235
- }
236
-
237
- return nextItem;
238
- },
239
- [listBoxElement],
240
- );
241
-
242
- const handleOnSelect = useCallback(
243
- (event, value) => {
244
- event.stopPropagation();
245
- if (disabled === true) return;
246
-
247
- const targetOption = newOptions.find(({ id, child }) => id === value || (child && child.find(({ id }) => id === value)));
248
- const actualOpt = targetOption?.child ? targetOption.child.find(({ id }) => id === value) : targetOption;
249
- if (actualOpt?.isDisable) return;
250
-
251
- // 選取選項
252
- // 點選 all 全選
253
- if (multiple) {
254
- if (
255
- value.toString() === allOptionId &&
256
- selectedAllOptions.length < enabledOptions.length
257
- ) {
258
- for (let index = 1; index < enabledOptions.length; index += 1) {
259
- onSelect(enabledOptions[index].id);
260
- }
261
- }
262
-
263
- if (
264
- value.toString() !== allOptionId &&
265
- !selectedAllOptions.includes(value.toString())
266
- ) {
267
- // 選取一個選項,變成全選
268
- if (selectedAllOptions.length + 2 === enabledOptions.length) {
269
- onSelect(value);
270
- } else {
271
- // 選取特定選項
272
- onSelect(value);
273
- }
274
- }
275
-
276
- // 刪除選項
277
- // 點選 all 刪除全選
278
- if (
279
- value.toString() === allOptionId &&
280
- selectedAllOptions.length === enabledOptions.length
281
- ) {
282
- for (let index = 0; index < enabledOptions.length; index += 1) {
283
- onDeselect(enabledOptions[index].id);
284
- }
285
- }
286
-
287
- if (
288
- value.toString() !== allOptionId &&
289
- selectedAllOptions.includes(value.toString())
290
- ) {
291
- // 原本是 all 全選後來刪除其中一個選項
292
- if (selectedAllOptions.length === enabledOptions.length) {
293
- onDeselect(value);
294
- } else {
295
- // 刪除特定選項
296
- onDeselect(value);
297
- }
298
- }
299
- setDisplay(true);
300
- } else {
301
- onSelect(value);
302
- setDisplay(false);
303
- }
304
- comboboxElement.focus();
305
- setSearch('');
306
- },
307
- [
308
- disabled,
309
- onSelect,
310
- comboboxElement,
311
- selectedAllOptions,
312
- onDeselect,
313
- newOptions,
314
- allOptionId,
315
- multiple,
316
- enabledOptions,
317
- ],
318
- );
319
-
320
- const handleOnDeselect = useCallback(
321
- (event, value) => {
322
- event.stopPropagation();
323
- if (disabled === true) return;
324
-
325
- if (multiple) {
326
- if (value.toString() === allOptionId) {
327
- for (let index = 0; index < optionList.length; index += 1) {
328
- onDeselect(optionList[index].id);
329
- }
330
- } else {
331
- onDeselect(value);
332
- }
333
- } else {
334
- onDeselect(value);
335
- }
336
- },
337
- [disabled, onDeselect, optionList, allOptionId, multiple],
338
- );
339
-
340
- // list all selected option
341
- const selectedItem = useMemo(() => {
342
- if (selectedOptions.length > 0) {
343
- if (multiple) {
344
- if (displayMode === 'text') {
345
- let text;
346
- if (selectedOptions[0].id === allOptionId) {
347
- [{ text }] = selectedOptions;
348
- } else {
349
- text = selectedOptions
350
- .map((value) => {
351
- return getOptionText(value);
352
- })
353
- .join(', ');
354
- }
355
-
356
- return <SelectedMultipleText>{text}</SelectedMultipleText>;
357
- }
358
-
359
- if (displayMode === 'count') {
360
- return (
361
- <SelectedMultipleCount
362
- placeholder={placeholder}
363
- firstSelectedText={selectedOptions.length > 0 ? getOptionText(selectedOptions[0]) : ''}
364
- count={selectedOptions.length}
365
- />
366
- );
367
- }
368
-
369
- if (selectedOptions[0].id === allOptionId) {
370
- return (
371
- <SelectedMultipleTags
372
- content={renderOptionContent(selectedOptions[0])}
373
- key={selectedOptions[0].id}
374
- onClick={(event) =>
375
- handleOnDeselect(event, selectedOptions[0].id)
376
- }
377
- disabled={disabled}
378
- />
379
- );
380
- }
381
-
382
- return selectedOptions.map((value) => {
383
- return (
384
- <SelectedMultipleTags
385
- content={renderOptionContent(value)}
386
- key={value.id}
387
- onClick={(event) => handleOnDeselect(event, value.id)}
388
- disabled={disabled}
389
- />
390
- );
391
- });
392
- }
393
-
394
- return (
395
- <SelectedSingle>
396
- {selectedOptions[0].icon && <Icon src={selectedOptions[0].icon} />}
397
- {renderOptionContent(selectedOptions[0])}
398
- </SelectedSingle>
399
- );
400
- }
401
-
402
- return placeholder;
403
- }, [
404
- placeholder,
405
- handleOnDeselect,
406
- multiple,
407
- displayMode,
408
- selectedOptions,
409
- disabled,
410
- allOptionId,
411
- getOptionText,
412
- renderOptionContent,
413
- ]);
414
-
415
- const optionItem = useMemo(() => {
416
- if (optionList.length <= 0) return null;
417
- return optionList.map((option) => {
418
- if (option.child && option.child.length > 0) {
419
- return (
420
- <OptionGroup aria-labelledby={option.text} key={option.text}>
421
- <Option role='presentation' id={option.text}>
422
- {option.text}
423
- </Option>
424
-
425
- {option.child.map((option) => {
426
- return (
427
- <Option
428
- role='option'
429
- tabIndex={option.isDisable ? '-1' : '0'}
430
- id={option.id}
431
- key={option.id}
432
- onClick={(event) => !option.isDisable && handleOnSelect(event, option.id)}
433
- focus={
434
- focusedOption && focusedOption.id === option.id.toString()
435
- }
436
- selected={option.selected}
437
- aria-selected={option.selected}
438
- aria-disabled={option.isDisable}
439
- disabled={option.isDisable}
440
- >
441
- {showCheckbox && <Checkbox selected={option.selected} disabled={option.isDisable}/>}
442
- {renderOptionContent(option)}
443
- </Option>
444
- );
445
- })}
446
- </OptionGroup>
447
- );
448
- }
449
-
450
- return (
451
- <Option
452
- role='option'
453
- tabIndex={option.isDisable ? '-1' : '0'}
454
- id={option.id}
455
- key={option.id}
456
- onClick={(event) => !option.isDisable && handleOnSelect(event, option.id)}
457
- focus={focusedOption && focusedOption.id === option.id.toString()}
458
- selected={option.selected}
459
- aria-selected={option.selected}
460
- aria-disabled={option.isDisable}
461
- disabled={option.isDisable}
462
- >
463
- {showCheckbox && <Checkbox selected={option.selected} disabled={option.isDisable}/>}
464
- {option.icon && <Icon src={option.icon} />}
465
- {renderOptionContent(option)}
466
- </Option>
467
- );
468
- });
469
- }, [
470
- optionList,
471
- focusedOption,
472
- handleOnSelect,
473
- showCheckbox,
474
- renderOptionContent,
475
- ]);
476
-
477
- // show or hide listbox
478
- // and set listbox width according to combobox current width
479
- const handleToggle = () => {
480
- if (disabled === true) return;
481
-
482
- const tmpDisplay = !display;
483
- if (!tmpDisplay) {
484
- setFocusedOption(null);
485
- }
486
-
487
- setDisplay(tmpDisplay);
488
- update();
489
- };
490
-
491
- // handle keyboard interaction
492
- const handleKeyUp = (event) => {
493
- const key = event.keyCode;
494
-
495
- switch (key) {
496
- case KEY_CODE.ENTER:
497
- if (!display) {
498
- handleToggle();
499
- } else if (focusedOption) {
500
- if (focusedOption.getAttribute('aria-disabled') === 'true') return;
501
- handleOnSelect(event, focusedOption.id);
502
- }
503
-
504
- break;
505
- case KEY_CODE.ESCAPE:
506
- if (display) {
507
- handleToggle();
508
- }
509
- break;
510
- case KEY_CODE.UP: {
511
- if (!focusedOption) {
512
- return;
513
- }
514
-
515
- let previousItem = findPreviousItem(focusedOption);
516
- while (previousItem && previousItem.getAttribute('aria-disabled') === 'true') {
517
- previousItem = findPreviousItem(previousItem);
518
- }
519
- if (previousItem) {
520
- handleFocusItem(previousItem);
521
- }
522
-
523
- break;
524
- }
525
- case KEY_CODE.DOWN: {
526
- if (!focusedOption) {
527
- return;
528
- }
529
-
530
- let nextItem = findNextItem(focusedOption);
531
- while (nextItem && nextItem.getAttribute('aria-disabled') === 'true') {
532
- nextItem = findNextItem(nextItem);
533
- }
534
- if (nextItem) {
535
- handleFocusItem(nextItem);
536
- }
537
-
538
- break;
539
- }
540
- case KEY_CODE.END: {
541
- event.preventDefault();
542
- const itemList = listBoxElement.querySelectorAll('[role="option"]');
543
-
544
- if (itemList.length) {
545
- handleFocusItem(itemList[itemList.length - 1]);
546
- }
547
-
548
- break;
549
- }
550
- case KEY_CODE.HOME:
551
- event.preventDefault();
552
- focusFirstItem();
553
- break;
554
- default:
555
- break;
556
- }
557
- };
558
-
559
- const handleKeyDown = (event) => {
560
- const key = event.keyCode;
561
-
562
- switch (key) {
563
- case KEY_CODE.ENTER:
564
- case KEY_CODE.ESCAPE:
565
- case KEY_CODE.UP:
566
- case KEY_CODE.DOWN:
567
- case KEY_CODE.END:
568
- case KEY_CODE.HOME:
569
- event.preventDefault();
570
- break;
571
- default:
572
- break;
573
- }
574
- };
575
-
576
- // handle search keyword change
577
- const handleSearchChange = (event) => {
578
- if (onSearch) {
579
- onSearch(event.target.value);
580
- }
581
-
582
- setSearch(event.target.value);
583
- };
584
-
585
- const handleFocus = (event) => {
586
- event.preventDefault();
587
- event.stopPropagation();
588
-
589
- setIsFocusCombobox(true);
590
- };
591
-
592
- // determine selected option(s)
593
- useEffect(() => {
594
- if (!newOptions) return;
595
-
596
- const tmpSelectedOptions = [];
597
-
598
- newOptions.forEach((option) => {
599
- if (option.child && option.child.length > 0) {
600
- option.child.forEach((option) => {
601
- if (multiple && selectedAllOptions.includes(option.id.toString())) {
602
- tmpSelectedOptions.push(option);
603
- } else if (selectedAllOptions === option.id.toString()) {
604
- tmpSelectedOptions.push(option);
605
- }
606
- });
607
- } else {
608
- if (multiple && selectedAllOptions.includes(option.id.toString())) {
609
- tmpSelectedOptions.push(option);
610
- } else if (selectedAllOptions === option.id.toString()) {
611
- tmpSelectedOptions.push(option);
612
- }
613
- }
614
- return false;
615
- });
616
-
617
- setSelectedOptions(tmpSelectedOptions);
618
- }, [newOptions, selectedAllOptions, multiple]);
619
-
620
- useEffect(() => {
621
- if (update) {
622
- setTimeout(() => {
623
- update();
624
- }, 100);
625
- }
626
- }, [update, listBoxWidth]);
627
-
628
- // observe element resized
629
- useEffect(() => {
630
- if (!comboboxElement) return;
631
-
632
- const resizeObserverInstance = new ResizeObserver((entries) => {
633
- for (const entry of entries) {
634
- if (entry.target) {
635
- const borderBoxSize = entry.target.clientWidth;
636
-
637
- setListBoxWidth(borderBoxSize);
638
- }
639
- }
640
- });
641
-
642
- resizeObserverInstance.observe(comboboxElement);
643
-
644
- return () => {
645
- // unobserve element
646
- resizeObserverInstance.unobserve(comboboxElement);
647
- };
648
- }, [comboboxElement]);
649
-
650
- // re-setup focus when option list changed and update popper position
651
- useEffect(() => {
652
- setupFocus();
653
- if (update) update();
654
- }, [setupFocus, optionList, update]);
655
-
656
- // parse option list when filtered options change
657
- useEffect(() => {
658
- if (!filteredOptions) return;
659
-
660
- setOptionList(
661
- filteredOptions.map((option) => {
662
- if (option.child && option.child.length > 0) {
663
- return {
664
- ...option,
665
- child: option.child.map((option) => {
666
- let selected = false;
667
- if (
668
- multiple &&
669
- selectedAllOptions.includes(option.id.toString())
670
- ) {
671
- selected = true;
672
- } else if (selectedAllOptions === option.id.toString()) {
673
- selected = true;
674
- }
675
-
676
- return {
677
- ...option,
678
- selected,
679
- };
680
- }),
681
- };
682
- }
683
-
684
- let selected = false;
685
-
686
- if (multiple && selectedAllOptions.includes(option.id.toString())) {
687
- selected = true;
688
- } else if (selectedAllOptions === option.id.toString()) {
689
- selected = true;
690
- }
691
-
692
- return {
693
- ...option,
694
- selected,
695
- };
696
- }),
697
- );
698
- }, [filteredOptions, multiple, selectedAllOptions]);
699
-
700
- // filter options on search keyword changed
701
- useEffect(() => {
702
- const tmpFilteredOptions = [];
703
-
704
- newOptions.forEach((option) => {
705
- if (option.child && option.child.length > 0) {
706
- const tmpFilteredChildOptions = option.child.filter((option) =>
707
- getOptionText(option)
708
- .toLowerCase()
709
- .indexOf(search.toLowerCase().trim()) !== -1);
710
- if (tmpFilteredChildOptions.length > 0) {
711
- tmpFilteredOptions.push({
712
- ...option,
713
- child: tmpFilteredChildOptions,
714
- });
715
- }
716
- } else if (
717
- getOptionText(option)
718
- .toLowerCase()
719
- .indexOf(search.toLowerCase().trim()) !== -1
720
- ) {
721
- tmpFilteredOptions.push(option);
722
- }
723
- });
724
- setFilteredOptions(tmpFilteredOptions);
725
- }, [search, newOptions, getOptionText]);
726
-
727
- useEffect(() => {
728
- if (display) {
729
- setupFocus();
730
-
731
- if (allowSearch) {
732
- searchBoxElement.current.focus();
733
- }
734
- }
735
- }, [setupFocus, display, allowSearch]);
736
-
737
- return (
738
- <div
739
- style={{
740
- flexGrow: flexGrow ? 1 : 0,
741
- }}
742
- >
743
- <OutsideClickHandler
744
- onOutsideClick={() => {
745
- setDisplay(false);
746
- if (onBlur) onBlur();
747
- setIsFocusCombobox(false);
748
- }}
749
- disabled={!isFocusCombobox}
750
- >
751
- <Combobox
752
- flexGrow={flexGrow}
753
- role='combobox'
754
- tabIndex='0'
755
- aria-haspopup='listbox'
756
- aria-expanded={display}
757
- aria-owns={id}
758
- ref={setComboboxElement}
759
- onClick={handleToggle}
760
- onKeyUp={handleKeyUp}
761
- onKeyDown={handleKeyDown}
762
- $display={display}
763
- disabled={disabled}
764
- fullWidth={fullWidth}
765
- large={large}
766
- $fill={fill}
767
- fillReverse={fillReverse}
768
- onFocus={handleFocus}
769
- placeholder={placeholder}
770
- >
771
- {selectedItem}
772
-
773
- {selectedOptions.length > 0 &&
774
- !multiple &&
775
- !disabled &&
776
- allowClear && (
777
- <CloseButton
778
- onClick={() => {
779
- onSelect('');
780
- }}
781
- />
782
- )}
783
- <ExpandArrow aria-haspopup='listbox' aria-expanded={display} />
784
- </Combobox>
785
- {createPortal(
786
- <ListBox
787
- role='listbox'
788
- tabIndex='0'
789
- id={id}
790
- ref={setListBoxElement}
791
- onKeyUp={handleKeyUp}
792
- onKeyDown={handleKeyDown}
793
- width={listBoxWidth}
794
- $display={display}
795
- style={styles.popper}
796
- {...attributes.popper}
797
- placement={state && state.placement}
798
- >
799
- {allowSearch && (
800
- <SearchBox
801
- ref={searchBoxElement}
802
- placeholder='Search'
803
- onChange={handleSearchChange}
804
- value={search}
805
- />
806
- )}
807
-
808
- <Options ref={optionsElementRef} allowSearch={allowSearch}>
809
- {optionItem || <Message>No results found</Message>}
810
- </Options>
811
-
812
- {footer && <Footer>{footer}</Footer>}
813
- </ListBox>,
814
- document.body,
815
- )}
816
- </OutsideClickHandler>
817
- </div>
818
- );
819
- };
820
-
821
- const Icon = ({ src }) => {
822
- return (
823
- <>
824
- <IconFigure size='medium'>
825
- <ImageFluid crossOrigin='anonymous' src={src} alt='' roundedS />
826
- </IconFigure>
827
- &nbsp;
828
- </>
829
- );
830
- };
831
-
832
- const Combobox = styled.div`
833
- display: flex;
834
- flex-wrap: wrap;
835
- align-items: center;
836
- min-height: 36px;
837
- cursor: pointer;
838
- position: relative;
839
- background: transparent;
840
- color: var(--font-on-background);
841
- font-size: var(--font-body1);
842
- border: var(--border-width) solid var(--border-color);
843
- border-radius: var(--border-radius-l);
844
- padding: 0 calc(var(--spacing-s) * 2 + 8px) 0 var(--spacing-s);
845
-
846
- &:focus {
847
- ${({ disabled }) =>
848
- !disabled &&
849
- `
850
- border-color: var(--color-primary);
851
- outline: none;
852
- `};
853
- }
854
-
855
- ${({ flexGrow }) => !flexGrow && 'min-width: 160px;'}
856
-
857
- ${({ $display }) =>
858
- $display &&
859
- `
860
- border-color: var(--color-primary);
861
- outline: none;
862
- `}
863
-
864
- ${({ disabled }) => disabled && 'cursor: not-allowed;opacity: 0.5;'}
865
- ${({ placeholder }) => placeholder && 'color: var(--font-on-mute);'}
866
-
867
- ${({ fullWidth }) => (fullWidth ? 'width: 100%' : 'max-width: 320px')};
868
-
869
- ${({ large }) =>
870
- large &&
871
- `
872
- height: 40px;
873
- padding: 12px calc(var(--spacing-s) * 2 + 8px) 12px var(--spacing-s);
874
- `}
875
-
876
- ${({ $fill }) =>
877
- $fill &&
878
- `
879
- background: var(--color-background2);
880
- border-color: transparent;
881
- `}
882
-
883
- ${({ fillReverse }) =>
884
- fillReverse &&
885
- `
886
- background: var(--color-background1);
887
- border-color: transparent;
888
- `}
889
- `;
890
- Combobox.displayName = 'Combobox';
891
-
892
- const CloseButton = styled(MdClose)`
893
- position: absolute;
894
- top: 50%;
895
- transform: translateY(-50%);
896
- color: var(--color-primary);
897
- font-size: var(--font-body1);
898
- right: var(--spacing-l);
899
-
900
- ${media.tablet`
901
- right: calc(var(--spacing) + var(--spacing-s));
902
- `};
903
- `;
904
- CloseButton.displayName = 'CloseButton';
905
-
906
- const ExpandArrow = styled(TiArrowSortedDown)`
907
- position: absolute;
908
- top: 50%;
909
- transform: translateY(-50%);
910
- color: var(--color-primary);
911
- font-size: var(--font-body1);
912
- right: var(--spacing-s);
913
- `;
914
- ExpandArrow.displayName = 'ExpandArrow';
915
-
916
- const Message = styled.p`
917
- margin: 0;
918
- padding: 12px var(--spacing-s);
919
- `;
920
- Message.displayName = 'Message';
921
-
922
- const OptionBadge = styled.span`
923
- color: var(--color-danger);
924
- font-style: italic;
925
- `;
926
-
927
- const OptionLabel = styled.div`
928
- min-width: 0;
929
- `;
930
-
931
- const OptionHighlight = styled.span`
932
- color: ${({ $color }) => $color || 'var(--color-danger)'};
933
- `;
934
-
935
- export default Select;