diginet-core-ui 1.3.88 → 1.3.89

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 (437) hide show
  1. package/assets/avatar/default.svg +3 -3
  2. package/assets/images/icons/wifi.svg +3 -3
  3. package/assets/images/menu/bem/WA3F0100.svg +6 -6
  4. package/assets/images/menu/bem/WA3F1025.svg +10 -10
  5. package/assets/images/menu/bem/WA3F2000.svg +10 -10
  6. package/assets/images/menu/bem/WA3F2020.svg +6 -6
  7. package/assets/images/menu/bem/WA3F2030.svg +14 -14
  8. package/assets/images/menu/bem/WA3F2040.svg +8 -8
  9. package/assets/images/menu/bem/WA3F2100.svg +6 -6
  10. package/assets/images/menu/dhr/ALL.svg +6 -6
  11. package/assets/images/menu/dhr/D00.svg +12 -12
  12. package/assets/images/menu/dhr/D09.svg +8 -8
  13. package/assets/images/menu/dhr/D13.svg +10 -10
  14. package/assets/images/menu/dhr/D15.svg +10 -10
  15. package/assets/images/menu/dhr/D21.svg +10 -10
  16. package/assets/images/menu/dhr/D25.svg +11 -11
  17. package/assets/images/menu/dhr/D29.svg +11 -11
  18. package/assets/images/menu/dhr/D38.svg +6 -6
  19. package/assets/images/menu/dhr/D39.svg +10 -10
  20. package/assets/images/menu/dhr/D51.svg +12 -12
  21. package/assets/images/menu/dhr/D52.svg +16 -16
  22. package/assets/images/menu/dhr/D77.svg +16 -16
  23. package/assets/images/menu/dhr/D84.svg +12 -12
  24. package/assets/images/menu/dhr/D89.svg +8 -8
  25. package/assets/images/menu/dhr/Default.svg +13 -13
  26. package/assets/images/menu/dhr/MHRM00N0001.svg +14 -14
  27. package/assets/images/menu/dhr/MHRM00N0002.svg +22 -22
  28. package/assets/images/menu/dhr/MHRM00N0003.svg +17 -17
  29. package/assets/images/menu/dhr/MHRM00N0004.svg +12 -12
  30. package/assets/images/menu/dhr/MHRM00N0005.svg +11 -11
  31. package/assets/images/menu/dhr/MHRM09N0002.svg +3 -3
  32. package/assets/images/menu/dhr/MHRM09N0003.svg +25 -25
  33. package/assets/images/menu/dhr/MHRM09N0004.svg +14 -14
  34. package/assets/images/menu/dhr/MHRM09N0005.svg +7 -7
  35. package/assets/images/menu/dhr/MHRM09N1010.svg +12 -12
  36. package/assets/images/menu/dhr/MHRM09N1015.svg +18 -18
  37. package/assets/images/menu/dhr/MHRM09N1020.svg +13 -13
  38. package/assets/images/menu/dhr/MHRM09N1025.svg +12 -12
  39. package/assets/images/menu/dhr/MHRM09N1030.svg +11 -11
  40. package/assets/images/menu/dhr/MHRM09N1035.svg +15 -15
  41. package/assets/images/menu/dhr/MHRM09N1040.svg +8 -8
  42. package/assets/images/menu/dhr/MHRM09N1400.svg +11 -11
  43. package/assets/images/menu/dhr/MHRM13N0001.svg +16 -16
  44. package/assets/images/menu/dhr/MHRM13N0002.svg +13 -13
  45. package/assets/images/menu/dhr/MHRM13N0003.svg +12 -12
  46. package/assets/images/menu/dhr/MHRM13N0004.svg +21 -21
  47. package/assets/images/menu/dhr/MHRM25N0001.svg +26 -26
  48. package/assets/images/menu/dhr/MHRM29N0001.svg +30 -30
  49. package/assets/images/menu/dhr/MHRM29N0002.svg +13 -13
  50. package/assets/images/menu/dhr/MHRM29N0003.svg +17 -17
  51. package/assets/images/menu/dhr/MHRM29N0004.svg +18 -18
  52. package/assets/images/menu/dhr/MHRM29N0005.svg +13 -13
  53. package/assets/images/menu/dhr/MHRM29N0015.svg +63 -63
  54. package/assets/images/menu/dhr/MHRM39N0012.svg +43 -43
  55. package/assets/images/menu/dhr/MHRM39N0013.svg +24 -24
  56. package/assets/images/menu/dhr/MHRM39N0014.svg +14 -14
  57. package/assets/images/menu/dhr/MHRM39N0015.svg +36 -36
  58. package/assets/images/menu/dhr/MHRM39N0016.svg +23 -23
  59. package/assets/images/menu/dhr/MHRM39N0017.svg +14 -14
  60. package/assets/images/menu/dhr/MHRM39N0018.svg +5 -5
  61. package/assets/images/menu/dhr/MHRM39N0019.svg +11 -11
  62. package/assets/images/menu/dhr/MHRM39N0020.svg +11 -11
  63. package/assets/images/menu/dhr/MHRM39N0021.svg +11 -11
  64. package/assets/images/menu/dhr/MHRM39N0022.svg +18 -18
  65. package/assets/images/menu/dhr/MHRM39N0023.svg +13 -13
  66. package/assets/images/menu/dhr/MHRM77N0001.svg +28 -28
  67. package/assets/images/menu/dhr/MHRM82N0001.svg +8 -8
  68. package/assets/images/menu/dhr/MHRM82N0002.svg +5 -5
  69. package/assets/images/menu/dhr/MHRM84N0001.svg +27 -27
  70. package/assets/images/menu/dhr/MHRM84N0002.svg +24 -24
  71. package/assets/images/menu/dhr/MHRM89N0001.svg +16 -16
  72. package/assets/images/menu/dhr/MHRP00N0001.svg +10 -10
  73. package/assets/images/menu/dhr/MHRP09N0001.svg +22 -22
  74. package/assets/images/menu/dhr/MHRP09N0002.svg +19 -19
  75. package/assets/images/menu/dhr/MHRP09N0003.svg +12 -12
  76. package/assets/images/menu/dhr/MHRP09N0004.svg +6 -6
  77. package/assets/images/menu/dhr/MHRP09N0005.svg +10 -10
  78. package/assets/images/menu/dhr/MHRP09N0006.svg +17 -17
  79. package/assets/images/menu/dhr/MHRP09N0007.svg +15 -15
  80. package/assets/images/menu/dhr/MHRP09N0008.svg +8 -8
  81. package/assets/images/menu/dhr/MHRP09N0009.svg +10 -10
  82. package/assets/images/menu/dhr/MHRP09N0010.svg +12 -12
  83. package/assets/images/menu/dhr/MHRP09N0011.svg +16 -16
  84. package/assets/images/menu/dhr/MHRP09N0012.svg +6 -6
  85. package/assets/images/menu/dhr/MHRP09N0013.svg +8 -8
  86. package/assets/images/menu/dhr/MHRP09N0014.svg +11 -11
  87. package/assets/images/menu/dhr/MHRP09N0015.svg +12 -12
  88. package/assets/images/menu/dhr/MHRP09N0016.svg +18 -18
  89. package/assets/images/menu/dhr/MHRP09N0017.svg +18 -18
  90. package/assets/images/menu/dhr/MHRP09N0018.svg +12 -12
  91. package/assets/images/menu/dhr/MHRP09N0019.svg +13 -13
  92. package/assets/images/menu/dhr/MHRP09N0020.svg +17 -17
  93. package/assets/images/menu/dhr/MHRP09N0021.svg +10 -10
  94. package/assets/images/menu/dhr/MHRP09N0022.svg +16 -16
  95. package/assets/images/menu/dhr/MHRP09N0023.svg +8 -8
  96. package/assets/images/menu/dhr/MHRP09N0024.svg +15 -15
  97. package/assets/images/menu/dhr/MHRP09N0025.svg +16 -16
  98. package/assets/images/menu/dhr/MHRP09N0026.svg +13 -13
  99. package/assets/images/menu/dhr/MHRP09N0027.svg +10 -10
  100. package/assets/images/menu/dhr/MHRP09N0028.svg +6 -6
  101. package/assets/images/menu/dhr/MHRP09N0029.svg +14 -14
  102. package/assets/images/menu/dhr/MHRP09N0030.svg +4 -4
  103. package/assets/images/menu/dhr/MHRP09N0031.svg +5 -5
  104. package/assets/images/menu/dhr/MHRP09N0032.svg +7 -7
  105. package/assets/images/menu/dhr/MHRP13N0001.svg +9 -9
  106. package/assets/images/menu/dhr/MHRP21N0001.svg +12 -12
  107. package/assets/images/menu/dhr/MHRP21N0002.svg +13 -13
  108. package/assets/images/menu/dhr/MHRP25L0101.svg +15 -15
  109. package/assets/images/menu/dhr/MHRP25L0501.svg +14 -14
  110. package/assets/images/menu/dhr/MHRP25N0001.svg +13 -13
  111. package/assets/images/menu/dhr/MHRP25N0002.svg +16 -16
  112. package/assets/images/menu/dhr/MHRP25N0003.svg +38 -38
  113. package/assets/images/menu/dhr/MHRP25N0004.svg +17 -17
  114. package/assets/images/menu/dhr/MHRP25N0005.svg +20 -20
  115. package/assets/images/menu/dhr/MHRP29N0001.svg +18 -18
  116. package/assets/images/menu/dhr/MHRP29N0002.svg +15 -15
  117. package/assets/images/menu/dhr/MHRP29N0003.svg +20 -20
  118. package/assets/images/menu/dhr/MHRP29N0004.svg +21 -21
  119. package/assets/images/menu/dhr/MHRP29N0005.svg +21 -21
  120. package/assets/images/menu/dhr/MHRP29N0006.svg +14 -14
  121. package/assets/images/menu/dhr/MHRP29N0007.svg +19 -19
  122. package/assets/images/menu/dhr/MHRP29N0008.svg +20 -20
  123. package/assets/images/menu/dhr/MHRP29N0009.svg +11 -11
  124. package/assets/images/menu/dhr/MHRP29N0010.svg +11 -11
  125. package/assets/images/menu/dhr/MHRP29N0011.svg +12 -12
  126. package/assets/images/menu/dhr/MHRP29N0012.svg +7 -7
  127. package/assets/images/menu/dhr/MHRP29N0013.svg +27 -27
  128. package/assets/images/menu/dhr/MHRP29N0014.svg +32 -32
  129. package/assets/images/menu/dhr/MHRP29N0016.svg +54 -54
  130. package/assets/images/menu/dhr/MHRP29N0017.svg +24 -24
  131. package/assets/images/menu/dhr/MHRP29N0018.svg +44 -44
  132. package/assets/images/menu/dhr/MHRP29N0019.svg +17 -17
  133. package/assets/images/menu/dhr/MHRP29N0020.svg +11 -11
  134. package/assets/images/menu/dhr/MHRP29N0021.svg +8 -8
  135. package/assets/images/menu/dhr/MHRP29N0022.svg +9 -9
  136. package/assets/images/menu/dhr/MHRP29N0023.svg +22 -22
  137. package/assets/images/menu/dhr/MHRP29N0026.svg +13 -13
  138. package/assets/images/menu/dhr/MHRP29N0027.svg +14 -14
  139. package/assets/images/menu/dhr/MHRP29N0028.svg +15 -15
  140. package/assets/images/menu/dhr/MHRP38N0001.svg +13 -13
  141. package/assets/images/menu/dhr/MHRP38N0002.svg +14 -14
  142. package/assets/images/menu/dhr/MHRP39N0001.svg +15 -15
  143. package/assets/images/menu/dhr/MHRP39N0002.svg +13 -13
  144. package/assets/images/menu/dhr/MHRP39N0003.svg +16 -16
  145. package/assets/images/menu/dhr/MHRP39N0004.svg +22 -22
  146. package/assets/images/menu/dhr/MHRP39N0005.svg +16 -16
  147. package/assets/images/menu/dhr/MHRP39N0006.svg +17 -17
  148. package/assets/images/menu/dhr/MHRP39N0007.svg +13 -13
  149. package/assets/images/menu/dhr/MHRP39N0008.svg +3 -3
  150. package/assets/images/menu/dhr/MHRP39N0009.svg +3 -3
  151. package/assets/images/menu/dhr/MHRP39N0010.svg +7 -7
  152. package/assets/images/menu/dhr/MHRP39N0011.svg +7 -7
  153. package/assets/images/menu/dhr/MHRP39N0013.svg +10 -10
  154. package/assets/images/menu/dhr/MHRP39N0014.svg +11 -11
  155. package/assets/images/menu/dhr/MHRP39N0015.svg +5 -5
  156. package/assets/images/menu/dhr/MHRP39N0017.svg +11 -11
  157. package/assets/images/menu/dhr/MHRP39N0018.svg +11 -11
  158. package/assets/images/menu/dhr/MHRP39N1222.svg +12 -12
  159. package/assets/images/menu/dhr/MHRP51N0001.svg +9 -9
  160. package/assets/images/menu/dhr/MHRP51N0002.svg +13 -13
  161. package/assets/images/menu/dhr/MHRP52N0001.svg +21 -21
  162. package/assets/images/menu/dhr/MHRP52N0002.svg +21 -21
  163. package/assets/images/menu/dhr/MHRP52N0003.svg +16 -16
  164. package/assets/images/menu/dhr/MHRP75N0001.svg +19 -19
  165. package/assets/images/menu/dhr/MHRP75N0002.svg +25 -25
  166. package/assets/images/menu/dhr/MHRP75N0003.svg +3 -3
  167. package/assets/images/menu/dhr/MHRP75N0006.svg +14 -14
  168. package/assets/images/menu/dhr/MHRP75N0007.svg +19 -19
  169. package/assets/images/menu/dhr/MHRP75N0008.svg +19 -19
  170. package/assets/images/menu/dhr/MHRP77N0007.svg +28 -28
  171. package/assets/images/menu/dhr/MHRP77N0008.svg +17 -17
  172. package/assets/images/menu/dhr/MHRP77N0009.svg +19 -19
  173. package/assets/images/menu/dhr/MHRP77N0010.svg +20 -20
  174. package/assets/images/menu/dhr/MHRP89N1000.svg +5 -5
  175. package/assets/images/menu/dhr/MHRP89N1001.svg +5 -5
  176. package/assets/images/menu/dhr/TASK.svg +9 -9
  177. package/assets/images/menu/dhr/W00F0001.svg +3 -3
  178. package/assets/images/menu/dhr/W00F0002.svg +3 -3
  179. package/assets/images/menu/dhr/W00F0003.svg +3 -3
  180. package/assets/images/menu/dhr/W00F0004.svg +3 -3
  181. package/assets/images/menu/dhr/W09F2000-WEB5.svg +17 -17
  182. package/assets/images/menu/dhr/W09F2000.svg +4 -4
  183. package/assets/images/menu/dhr/W09F2002-WEB5.svg +21 -21
  184. package/assets/images/menu/dhr/W09F2005-WEB5.svg +13 -13
  185. package/assets/images/menu/dhr/W09F2020-WEB5.svg +16 -16
  186. package/assets/images/menu/dhr/W09F2022-WEB5.svg +20 -20
  187. package/assets/images/menu/dhr/W09F2150-WEB5.svg +16 -16
  188. package/assets/images/menu/dhr/W09F2152-WEB5.svg +20 -20
  189. package/assets/images/menu/dhr/W09F2160-WEB5.svg +14 -14
  190. package/assets/images/menu/dhr/W09F2162-WEB5.svg +18 -18
  191. package/assets/images/menu/dhr/W29F4006-WEB5.svg +19 -19
  192. package/assets/images/menu/dhr/W75F2260-WEB5.svg +15 -15
  193. package/assets/images/menu/dhr/W75F2261-WEB5.svg +19 -19
  194. package/assets/images/menu/dhr/W75F3005-WEB5.svg +13 -13
  195. package/assets/images/menu/dhr/W75F4070-WEB5.svg +21 -21
  196. package/assets/images/menu/dhr/W75F4071-WEB5.svg +17 -17
  197. package/assets/images/menu/dhr/W75F4100-WEB5.svg +14 -14
  198. package/assets/images/menu/dhr/W77F1011.svg +19 -19
  199. package/assets/images/menu/dhr/W77F1013.svg +22 -22
  200. package/assets/images/menu/erp/D05.svg +8 -8
  201. package/assets/images/menu/erp/D06.svg +4 -4
  202. package/assets/images/menu/erp/D90R.svg +9 -9
  203. package/assets/images/menu/erp/DBC.svg +9 -9
  204. package/assets/images/menu/erp/W00F0001.svg +3 -3
  205. package/assets/images/menu/erp/W00F0002.svg +3 -3
  206. package/assets/images/menu/erp/W00F0003.svg +3 -3
  207. package/assets/images/menu/erp/W00F0004.svg +3 -3
  208. package/assets/images/menu/erp/W05F0001.svg +16 -16
  209. package/assets/images/menu/erp/W05F0001N0000.svg +16 -16
  210. package/assets/images/menu/erp/W05F0004N0000.svg +6 -6
  211. package/assets/images/menu/erp/W05F0006N0000.svg +30 -30
  212. package/assets/images/menu/erp/W05F0007N0000.svg +6 -6
  213. package/assets/images/menu/erp/W05F0008N0000.svg +14 -14
  214. package/assets/images/menu/erp/W05F0011N0000.svg +20 -20
  215. package/assets/images/menu/erp/W05F0013N0000.svg +9 -9
  216. package/assets/images/menu/erp/W05F4000N0000.svg +9 -9
  217. package/assets/images/menu/erp/W06F0001.svg +17 -17
  218. package/assets/images/menu/erp/W06F0001N0000.svg +17 -17
  219. package/assets/images/menu/erp/W06F0004N0000.svg +22 -22
  220. package/assets/images/menu/erp/W06F0005N0000.svg +22 -22
  221. package/assets/images/menu/erp/W06F0006N0000.svg +55 -55
  222. package/assets/images/menu/erp/W06F0008N0000.svg +17 -17
  223. package/assets/images/menu/erp/W94F1000N0000.svg +9 -9
  224. package/assets/images/menu/erp/W94F1000N0001.svg +9 -9
  225. package/assets/images/menu/erp/WA3F1025.svg +5 -5
  226. package/assets/images/menu/erp/WA3F2100.svg +10 -10
  227. package/assets/storybook/avatar01.svg +9 -9
  228. package/assets/storybook/cover01.svg +9 -9
  229. package/components/accordion/details.js +2 -6
  230. package/components/accordion/group.js +2 -9
  231. package/components/accordion/index.js +2 -15
  232. package/components/accordion/summary.js +4 -27
  233. package/components/alert/index.js +2 -33
  234. package/components/alert/notify.js +12 -22
  235. package/components/avatar/index.js +22 -81
  236. package/components/badge/index.js +20 -45
  237. package/components/button/icon.js +25 -56
  238. package/components/button/index.js +16 -65
  239. package/components/button/more.js +15 -35
  240. package/components/button/ripple-effect.js +0 -10
  241. package/components/card/body.js +2 -7
  242. package/components/card/extra.js +2 -7
  243. package/components/card/footer.js +2 -7
  244. package/components/card/header.js +2 -7
  245. package/components/card/index.js +2 -22
  246. package/components/chart/Pie/Circle.js +0 -1
  247. package/components/chart/Pie/Sector.js +2 -19
  248. package/components/chart/Pie/Sectors.js +0 -10
  249. package/components/chart/Pie/index.js +4 -36
  250. package/components/chart/Pie-v2/Circle.js +0 -1
  251. package/components/chart/Pie-v2/Sector.js +2 -15
  252. package/components/chart/Pie-v2/Sectors.js +0 -20
  253. package/components/chart/Pie-v2/index.js +11 -38
  254. package/components/chart/bar/Axis.js +0 -12
  255. package/components/chart/bar/Bar.js +13 -35
  256. package/components/chart/bar/Grid.js +0 -18
  257. package/components/chart/bar/Labels.js +4 -22
  258. package/components/chart/bar/Points.js +0 -17
  259. package/components/chart/bar/index.js +6 -26
  260. package/components/chart/bar-v2/Axis.js +0 -12
  261. package/components/chart/bar-v2/Bar.js +15 -36
  262. package/components/chart/bar-v2/Grid.js +0 -18
  263. package/components/chart/bar-v2/Labels.js +4 -22
  264. package/components/chart/bar-v2/Points.js +0 -17
  265. package/components/chart/bar-v2/index.js +6 -26
  266. package/components/chart/line/Axis.js +4 -16
  267. package/components/chart/line/Grid.js +2 -19
  268. package/components/chart/line/Labels.js +4 -22
  269. package/components/chart/line/Path.js +24 -34
  270. package/components/chart/line/Point.js +7 -41
  271. package/components/chart/line/Title.js +0 -3
  272. package/components/chart/line/index.js +12 -35
  273. package/components/chart/line-v2/Axis.js +0 -13
  274. package/components/chart/line-v2/Grid.js +0 -18
  275. package/components/chart/line-v2/Labels.js +4 -22
  276. package/components/chart/line-v2/Path.js +23 -33
  277. package/components/chart/line-v2/Point.js +6 -35
  278. package/components/chart/line-v2/Title.js +0 -3
  279. package/components/chart/line-v2/index.js +12 -30
  280. package/components/check-text/index.js +7 -15
  281. package/components/check-text/interview-confirmation.js +24 -31
  282. package/components/check-text/interview-status.js +24 -31
  283. package/components/chip/attach.js +9 -22
  284. package/components/chip/index.js +13 -38
  285. package/components/collapse/index.js +0 -13
  286. package/components/divider/index.js +2 -13
  287. package/components/form-control/attachment/index.js +41 -202
  288. package/components/form-control/calendar/function.js +154 -208
  289. package/components/form-control/calendar/index.js +21 -46
  290. package/components/form-control/calendar/range.js +11 -28
  291. package/components/form-control/checkbox/index.js +12 -46
  292. package/components/form-control/control/index.js +4 -14
  293. package/components/form-control/date-picker/index-old.js +18 -0
  294. package/components/form-control/date-picker/index.js +23 -99
  295. package/components/form-control/date-range-picker/index.js +44 -180
  296. package/components/form-control/dropdown/index.js +101 -314
  297. package/components/form-control/dropdown-box/index.js +7 -37
  298. package/components/form-control/form/index.js +0 -2
  299. package/components/form-control/form-group/index.js +1 -6
  300. package/components/form-control/helper-text/index.js +2 -9
  301. package/components/form-control/input-base/index.js +4 -68
  302. package/components/form-control/label/index.js +2 -12
  303. package/components/form-control/money-input/index.js +54 -143
  304. package/components/form-control/number-input/index.js +26 -124
  305. package/components/form-control/number-input/index2.js +95 -134
  306. package/components/form-control/phone-input/index.js +23 -85
  307. package/components/form-control/radio/index.js +16 -35
  308. package/components/form-control/text-input/index.js +10 -46
  309. package/components/form-control/time-picker/index.js +43 -100
  310. package/components/form-control/time-picker/swiper.js +21 -73
  311. package/components/form-control/toggle/index.js +26 -40
  312. package/components/form-view/helper-text.js +2 -2
  313. package/components/form-view/index.js +0 -14
  314. package/components/form-view/input.js +2 -13
  315. package/components/form-view/label.js +0 -2
  316. package/components/grid/Col.js +2 -16
  317. package/components/grid/Container.js +2 -21
  318. package/components/grid/Row.js +2 -21
  319. package/components/grid/index.js +2 -44
  320. package/components/image/index.js +2 -22
  321. package/components/index.js +62 -31
  322. package/components/list/list-item-action.js +12 -21
  323. package/components/list/list-item-icon.js +10 -19
  324. package/components/list/list-item-text.js +0 -5
  325. package/components/list/list-item.js +27 -38
  326. package/components/list/list.js +37 -50
  327. package/components/list/sub-header.js +13 -17
  328. package/components/modal/body.js +2 -6
  329. package/components/modal/footer.js +2 -11
  330. package/components/modal/header.js +2 -12
  331. package/components/modal/index.js +2 -10
  332. package/components/modal/modal.js +11 -52
  333. package/components/others/extra/index.js +3 -10
  334. package/components/others/import/index.js +0 -7
  335. package/components/others/option-wrapper/index.js +4 -7
  336. package/components/others/scrollbar/index.js +0 -3
  337. package/components/paging/page-info.js +35 -99
  338. package/components/paging/page-selector.js +10 -38
  339. package/components/paging/page-selector2.js +35 -74
  340. package/components/paper/index.js +23 -34
  341. package/components/popover/body.js +2 -6
  342. package/components/popover/footer.js +2 -11
  343. package/components/popover/header.js +2 -7
  344. package/components/popover/index.js +54 -146
  345. package/components/popup/danger_popup.js +0 -19
  346. package/components/popup/index.js +4 -50
  347. package/components/popup/proposals_popup.js +11 -50
  348. package/components/popup/v2/index.js +13 -47
  349. package/components/progress/circular.js +10 -48
  350. package/components/progress/linear.js +58 -74
  351. package/components/rating/index.js +10 -35
  352. package/components/slider/slider-container.js +4 -41
  353. package/components/slider/slider-item.js +10 -25
  354. package/components/status/index.js +2 -14
  355. package/components/tab/tab-container.js +4 -18
  356. package/components/tab/tab-header.js +4 -24
  357. package/components/tab/tab-panel.js +4 -16
  358. package/components/tab/tab.js +8 -33
  359. package/components/tooltip/index.js +12 -97
  360. package/components/tooltip/portal.js +0 -2
  361. package/components/transfer/index.js +28 -73
  362. package/components/tree-view/index.js +62 -202
  363. package/components/typography/index.js +14 -42
  364. package/global/index.js +0 -8
  365. package/icons/basic.js +0 -48
  366. package/icons/effect.js +15 -32
  367. package/icons/general/clock/clock.js +0 -2
  368. package/icons/general/color-handler/background.js +0 -2
  369. package/icons/general/color-handler/text.js +0 -2
  370. package/icons/general/emoji/emoji.js +0 -2
  371. package/icons/general/font-properties/bold.js +0 -2
  372. package/icons/general/font-properties/font-family.js +0 -2
  373. package/icons/general/font-properties/font-size.js +0 -2
  374. package/icons/general/font-properties/italic.js +0 -2
  375. package/icons/general/font-properties/underline.js +0 -2
  376. package/icons/general/hyperlink/hyperlink.js +0 -2
  377. package/icons/general/indent/decrease.js +0 -2
  378. package/icons/general/indent/increase.js +0 -2
  379. package/icons/general/list/bullets.js +0 -2
  380. package/icons/general/list/numbering.js +0 -2
  381. package/icons/general/picture/picture.js +0 -2
  382. package/icons/general/steps/redo.js +0 -2
  383. package/icons/general/steps/undo.js +0 -2
  384. package/icons/general/text-align/center.js +0 -2
  385. package/icons/general/text-align/justify.js +0 -2
  386. package/icons/general/text-align/left.js +0 -2
  387. package/icons/general/text-align/right.js +0 -2
  388. package/icons/menu/dhr.js +2 -1
  389. package/icons/menu/index.js +2 -2
  390. package/icons/menu/v2/index.js +2 -15
  391. package/package.json +42 -42
  392. package/readme.md +1034 -1027
  393. package/styles/animation.js +15 -58
  394. package/styles/color-helper.js +127 -157
  395. package/styles/colors.js +17 -9
  396. package/styles/general.js +16 -57
  397. package/styles/typography.js +4 -4
  398. package/styles/utils.js +18 -18
  399. package/theme/createBreakpoints.js +7 -18
  400. package/theme/make-styles.js +2 -5
  401. package/theme/set-theme.js +6 -9
  402. package/theme/settings.js +17 -22
  403. package/theme/theme-provider.js +0 -1
  404. package/utils/array/array.js +45 -54
  405. package/utils/classNames/index.js +0 -5
  406. package/utils/console.js +0 -6
  407. package/utils/date.js +69 -138
  408. package/utils/error/error.js +3 -11
  409. package/utils/error/errors.js +100 -147
  410. package/utils/getFileType.js +0 -9
  411. package/utils/handleBreakpoints.js +0 -5
  412. package/utils/intersectionObserver.js +0 -5
  413. package/utils/iterator.js +0 -9
  414. package/utils/map-parent.js +3 -10
  415. package/utils/object/extend.js +0 -10
  416. package/utils/object/object.js +12 -11
  417. package/utils/parseHTML.js +0 -1
  418. package/utils/promisify.js +0 -5
  419. package/utils/randomString.js +0 -7
  420. package/utils/remove-unicode.js +0 -1
  421. package/utils/render-portal.js +1 -9
  422. package/utils/renderHTML.js +4 -6
  423. package/utils/renderIcon.js +9 -19
  424. package/utils/sb-template.js +6 -5
  425. package/utils/string/capitalize.js +0 -1
  426. package/utils/string/capitalizeSentenceCase.js +0 -2
  427. package/utils/string/string.js +0 -13
  428. package/utils/type.js +0 -21
  429. package/utils/updatePosition.js +4 -5
  430. package/utils/useDelayUnmount.js +0 -4
  431. package/utils/useElementSize.js +9 -3
  432. package/utils/useEventListener.js +12 -6
  433. package/utils/useInput.js +0 -6
  434. package/utils/useMediaQuery/index.js +8 -10
  435. package/utils/useOnClickOutside.js +2 -4
  436. package/utils/usePortal.js +12 -19
  437. package/utils/validate.js +39 -53
@@ -1,5 +1,4 @@
1
1
  /** @jsxRuntime classic */
2
-
3
2
  /** @jsx jsx */
4
3
  import { css, jsx } from '@emotion/core';
5
4
  import { Avatar, ButtonIcon, Checkbox, Chip, CircularProgress, HelperText, InputBase, Label, TreeView, Typography } from "../..";
@@ -39,25 +38,22 @@ const {
39
38
  spacing
40
39
  } = useTheme();
41
40
  const timing = {},
42
- currentValue = {},
43
- currentObjectDefault = {},
44
- isSearch = {},
45
- allValue = {};
41
+ currentValue = {},
42
+ currentObjectDefault = {},
43
+ isSearch = {},
44
+ allValue = {};
46
45
  const separatorPattern = /\{\w+\}/g;
47
46
  const regexBetween = /[^{}]+(?=})/g;
48
47
  const regexInclude = /{|}/g;
49
-
50
48
  const checkHasValue = value => {
51
49
  return Array.isArray(value) ? value.length > 0 : value === 0 || !!value;
52
50
  };
53
-
54
51
  const convertData = (dt, valueExpr) => {
55
52
  let data = dt || [];
56
53
  let valueTemp = Array.isArray(data) ? data : [data];
57
54
  valueTemp = valueTemp.map(i => i[valueExpr] || i);
58
55
  return valueTemp;
59
56
  };
60
-
61
57
  const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
62
58
  allowSearch,
63
59
  children,
@@ -129,36 +125,26 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
129
125
  const [openState, setOpenState] = useState(false);
130
126
  const [showClear, setShowClear] = useState(false);
131
127
  const [textValue, setTextValue] = useState('');
132
- let valueTemp = valueProp || defaultValue || []; // only mode multi
128
+ let valueTemp = valueProp || defaultValue || [];
133
129
 
130
+ // only mode multi
134
131
  if (multiple) {
135
132
  valueTemp = convertData(valueTemp, valueExpr);
136
133
  }
137
-
138
134
  const [valueMulti, setValueMulti] = useState(valueTemp);
139
-
140
135
  const _isMobile = isMobile.any();
141
-
142
136
  const _InputCSS = InputCSS(multiple, typeof renderSelectedItem === 'function');
143
-
144
137
  const _DropdownInputCSS = DropdownInputCSS(viewType, multiple, placeholder, disabled, readOnly);
145
-
146
138
  const _IconCSS = IconCSS(viewType);
147
-
148
139
  const _DropdownFormCSS = DropdownFormCSS(viewType, multiple, disabled, placeholder, _DropdownInputCSS.name);
149
-
150
140
  const _DropdownListCSS = DropdownListCSS(loading);
151
-
152
141
  const _DropdownItemCSS = DropdownItemCSS(multiple, selectBox);
153
-
154
142
  const _DropdownRootCSS = DropdownRootCSS(_DropdownFormCSS.name, _DropdownInputCSS.name);
155
- /* Start handler */
156
-
157
143
 
144
+ /* Start handler */
158
145
  const triggerInput = e => {
159
146
  const target = e.currentTarget;
160
147
  target.style.pointerEvents = 'none';
161
-
162
148
  if (!dropdownListRef.current) {
163
149
  onClickInput();
164
150
  } else {
@@ -166,48 +152,38 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
166
152
  target: null
167
153
  });
168
154
  }
169
-
170
155
  setTimeout(() => {
171
156
  target.style.pointerEvents = null;
172
157
  }, 200);
173
158
  };
174
-
175
159
  const triggerBlur = (blur = true) => {
176
160
  if ((currentValue[unique] || currentValue[unique] === 0) && !multiple) {
177
161
  setValueIntoInput(currentValue[unique]);
178
162
  } else if (!multiple) {
179
163
  setValueIntoInput('');
180
164
  }
181
-
182
165
  !!blur && inputRef.current.blur();
183
166
  };
184
-
185
167
  const onClickInput = e => {
186
168
  if (disabled || readOnly || loading) return;
187
-
188
169
  if (!dropdownListRef.current) {
189
170
  if (!multiple || !Array.from(inputRef.current.querySelectorAll('.DGN-UI-Chip')).some(item => item.contains(e === null || e === void 0 ? void 0 : e.target))) {
190
171
  setOpenState(true);
191
172
  }
192
173
  }
193
174
  };
194
-
195
175
  const onClickOutsideOfInput = event => {
196
176
  var _inputRef$current, _iconRef$current, _dropdownListRef$curr, _dropdownListRef$curr2, _dropdownListRef$curr3;
197
-
198
177
  if (inputRef.current && !((_inputRef$current = inputRef.current) !== null && _inputRef$current !== void 0 && _inputRef$current.contains(event === null || event === void 0 ? void 0 : event.target)) && iconRef.current && !((_iconRef$current = iconRef.current) !== null && _iconRef$current !== void 0 && _iconRef$current.contains(event === null || event === void 0 ? void 0 : event.target)) && dropdownListRef.current && !((_dropdownListRef$curr = dropdownListRef.current) !== null && _dropdownListRef$curr !== void 0 && (_dropdownListRef$curr2 = _dropdownListRef$curr.parentNode) !== null && _dropdownListRef$curr2 !== void 0 && (_dropdownListRef$curr3 = _dropdownListRef$curr2.parentNode) !== null && _dropdownListRef$curr3 !== void 0 && _dropdownListRef$curr3.contains(event === null || event === void 0 ? void 0 : event.target))) {
199
178
  closeDropdown();
200
179
  triggerBlur(false);
201
180
  }
202
181
  };
203
-
204
182
  const showDropdown = () => {
205
183
  var _displayExpr, _searchRef$current;
206
-
207
184
  if (displayExpr && Array.isArray(displayExpr)) {
208
185
  displayExpr = displayExpr.join(' - ');
209
186
  }
210
-
211
187
  const keyArr = (_displayExpr = displayExpr) === null || _displayExpr === void 0 ? void 0 : _displayExpr.match(separatorPattern);
212
188
  const dropdown = children ? jsx("div", {
213
189
  css: _DropdownListCSS,
@@ -224,11 +200,11 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
224
200
  left,
225
201
  height,
226
202
  width
227
- } = formRef.current.getBoundingClientRect(); // Calculate to set position of Dropdown box
203
+ } = formRef.current.getBoundingClientRect();
228
204
 
205
+ // Calculate to set position of Dropdown box
229
206
  const dropdownHeight = Math.min(Math.max(1, (itemMode === 'normal' ? dropdown.props.children : mapParent(dataSource, treeViewID, treeViewParentID)).length || 1), 7) * 40 + (multiple ? 43 : 0);
230
207
  let positionTop = top + height + 4;
231
-
232
208
  if (top + height + 4 + dropdownHeight + (allowSearch ? 40 : 0) > innerHeight) {
233
209
  if (top - dropdownHeight > 0) {
234
210
  positionTop = top - dropdownHeight;
@@ -236,11 +212,8 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
236
212
  positionTop = innerHeight - dropdownHeight;
237
213
  }
238
214
  }
239
-
240
215
  const defaultSearch = lastSearchRef.current || (onInput ? (_searchRef$current = searchRef.current) === null || _searchRef$current === void 0 ? void 0 : _searchRef$current.value : '');
241
-
242
216
  const _DropdownCSS = DropdownCSS(positionTop, left, width, _isMobile, allowSearch);
243
-
244
217
  const el = jsx("div", {
245
218
  css: _DropdownCSS,
246
219
  ref: dropdownRef,
@@ -269,34 +242,28 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
269
242
  }, jsx(CircularProgress, {
270
243
  size: 24
271
244
  })) : null);
272
-
273
245
  if (!((multiple || allowSearch) && itemMode === 'normal' && !children)) {
274
246
  inputRef.current.addEventListener('keydown', pressESCHandler);
275
247
  }
276
-
277
248
  document.documentElement.style.overflow = 'hidden';
278
249
  setTimeout(() => {
279
250
  window.addEventListener('resize', customizeWidthDropdown);
280
251
  document.addEventListener('wheel', onWheelHandler);
281
252
  document.addEventListener('mousedown', onClickOutsideOfInput);
282
-
283
253
  if (onLoadMore && dataSource.length < total) {
284
254
  dropdownListRef.current && dropdownListRef.current.addEventListener('scroll', onLoadMoreHandler);
285
255
  }
286
256
  }, 10);
287
257
  return el;
288
258
  };
289
-
290
259
  const moveOnItem = e => {
291
260
  if (e.key === 'Escape' || e.key === 'Tab') {
292
261
  closeDropdown();
293
262
  triggerBlur();
294
263
  }
295
-
296
264
  if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {
297
265
  let activeEl = document.activeElement;
298
266
  activeEl = e.key === 'ArrowDown' ? activeEl.nextElementSibling : activeEl.previousElementSibling;
299
-
300
267
  if (activeEl) {
301
268
  activeEl.focus();
302
269
  activeEl.scrollIntoView({
@@ -306,7 +273,6 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
306
273
  }
307
274
  }
308
275
  };
309
-
310
276
  const pressESCHandler = e => {
311
277
  if (e.key === 'Escape' || e.key === 'Tab') {
312
278
  closeDropdown();
@@ -316,94 +282,74 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
316
282
  dropdownListRef.current.firstChild.focus();
317
283
  }
318
284
  };
319
-
320
285
  const onWheelHandler = e => {
321
286
  var _dropdownRef$current;
322
-
323
287
  if (!dropdownRef.current) {
324
288
  document.removeEventListener('wheel', onWheelHandler);
325
289
  return;
326
290
  }
327
-
328
291
  if (!((_dropdownRef$current = dropdownRef.current) !== null && _dropdownRef$current !== void 0 && _dropdownRef$current.contains(e.target))) {
329
292
  closeDropdown();
330
293
  triggerBlur();
331
294
  }
332
295
  };
333
-
334
296
  const closeDropdown = () => {
335
297
  if (dropdownRef.current) {
336
298
  setOpenState(false);
337
299
  document.removeEventListener('mousedown', onClickOutsideOfInput);
338
300
  window.removeEventListener('resize', customizeWidthDropdown);
339
301
  document.removeEventListener('wheel', onWheelHandler);
340
-
341
302
  if (onLoadMore && dropdownListRef.current) {
342
303
  dropdownListRef.current.removeEventListener('scroll', onLoadMoreHandler);
343
304
  dropdownListRef.current = null;
344
305
  }
345
306
  }
346
-
347
307
  document.documentElement.style.overflow = 'auto';
348
308
  if (searchRef.current) lastSearchRef.current = '';
349
309
  onClosed === null || onClosed === void 0 ? void 0 : onClosed();
350
310
  };
351
-
352
311
  const renderDropdown = pattern => {
353
312
  var _displayExpr2;
354
-
355
313
  const keyArr = (_displayExpr2 = displayExpr) === null || _displayExpr2 === void 0 ? void 0 : _displayExpr2.match(separatorPattern);
356
314
  const dropdown = mapDropdown(pattern, keyArr);
357
315
  const el = document.createElement('div');
358
316
  el.className = `DGN-Dropdown-Box`;
359
-
360
317
  if (dropdownRef.current) {
361
318
  var _dropdownRef$current$;
362
-
363
319
  (_dropdownRef$current$ = dropdownRef.current.querySelector('.DGN-Dropdown-Box')) === null || _dropdownRef$current$ === void 0 ? void 0 : _dropdownRef$current$.remove();
364
320
  ReactDOM.render(dropdown, dropdownRef.current.appendChild(el));
365
321
  setTimeout(() => {
366
322
  if (onLoadMore && dataSource.length < total) {
367
323
  dropdownListRef.current && dropdownListRef.current.addEventListener('scroll', onLoadMoreHandler);
368
324
  }
369
-
370
325
  updatePositionDropdown();
371
326
  }, 0);
372
327
  }
373
328
  };
374
-
375
329
  const handleRenderBySearch = (data, searchValue) => {
376
330
  let existExpr;
377
331
  typeof data === 'object' ? existExpr = searchExpr.filter(value => Object.keys(data).includes(value)) : existExpr = [data];
378
332
  return existExpr.every(key => {
379
333
  const _data = (data === null || data === void 0 ? void 0 : data[key]) || key.toString();
380
-
381
334
  if (searchMode === 'contains') {
382
335
  if (_data.indexOf(searchValue) !== -1) return false;
383
336
  }
384
-
385
337
  if (searchMode === 'startswith') {
386
338
  if (_data.lastIndexOf(searchValue) === 0) return false;
387
339
  }
388
-
389
340
  if (searchMode === 'equals') {
390
341
  if (_data === searchValue) return false;
391
342
  }
392
-
393
343
  return true;
394
344
  });
395
345
  };
396
-
397
346
  const mapDropdown = (pattern, keyArr) => {
398
347
  var _currentObjectDefault;
399
-
400
348
  const items = [];
401
349
  const dataSourceUsable = [...dataSource];
402
-
403
350
  if (currentObjectDefault[unique] && (_currentObjectDefault = currentObjectDefault[unique]) !== null && _currentObjectDefault !== void 0 && _currentObjectDefault.length) {
404
351
  const length = currentObjectDefault[unique].length;
405
352
  let existItemQuantity = 0;
406
-
407
353
  for (let index = length - 1; index >= 0; index--) {
408
354
  if (!dataSourceUsable.some(data => data[valueExpr] === currentObjectDefault[unique][index][valueExpr])) {
409
355
  dataSourceUsable.unshift(currentObjectDefault[unique][index]);
@@ -412,26 +358,20 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
412
358
  if (++existItemQuantity > limit) {
413
359
  continue;
414
360
  }
415
-
416
361
  currentObjectDefault[unique].splice(index, 1);
417
362
  }
418
363
  }
419
364
  }
420
-
421
365
  const length = dataSourceUsable.length;
422
-
423
366
  for (let index = 0; index < length; index++) {
424
367
  var _searchExpr;
425
-
426
368
  const data = dataSourceUsable[index];
427
369
  const itemHidden = typeof data === 'object' ? data['hidden'] : false;
428
370
  if (itemHidden) continue;
429
371
  let displayText = typeof data === 'object' ? keyArr ? renderData(data, keyArr) : data[displayExpr] || data[valueExpr] : data;
430
-
431
372
  if (((_searchExpr = searchExpr) === null || _searchExpr === void 0 ? void 0 : _searchExpr.length) > 0 && pattern) {
432
373
  if (handleRenderBySearch(data, pattern)) continue;
433
374
  } else if (pattern && !new RegExp(pattern).test(displayText.normalize())) continue;
434
-
435
375
  if (renderItem && typeof renderItem === 'function') {
436
376
  displayText = renderItem({
437
377
  data,
@@ -450,14 +390,12 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
450
390
  index
451
391
  }) : data[subText] || subText));
452
392
  }
453
-
454
393
  const value = typeof data === 'object' ? data[valueExpr] : data;
455
394
  let itemDisabled = typeof data === 'object' ? data['disabled'] : false;
456
395
  const icon = getIconFromData(data);
457
396
  const text = jsx(Typography, {
458
397
  type: 'p1'
459
398
  }, displayText);
460
-
461
399
  if (multiple && selectBox) {
462
400
  const checked = Array.isArray(valueMulti) ? valueMulti.includes(value) : valueMulti.includes(value);
463
401
  const isMaximumSelection = maximumSelectionLength === (valueMulti === null || valueMulti === void 0 ? void 0 : valueMulti.length);
@@ -465,7 +403,8 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
465
403
  items.push(jsx("div", {
466
404
  key: index,
467
405
  css: !itemDisabled ? _DropdownItemCSS : [DisabledCSS, _DropdownItemCSS],
468
- className: 'DGN-UI-Dropdown-Item' // onClick={() => {
406
+ className: 'DGN-UI-Dropdown-Item'
407
+ // onClick={() => {
469
408
  // if (itemDisabled) return;
470
409
  // onChangeValueWithCheckbox(e) & onChangeValue(displayText, value, icon, data, index);
471
410
  // onChangeValue(displayText, value, icon, data, index);
@@ -473,8 +412,10 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
473
412
  ,
474
413
  onKeyPress: e => {
475
414
  if (itemDisabled) return;
476
- if (e.key === 'Enter') e.currentTarget.firstChild.click(); // if (e.key === 'Enter') onChangeValue(displayText, value, icon, data, index);
415
+ if (e.key === 'Enter') e.currentTarget.firstChild.click();
416
+ // if (e.key === 'Enter') onChangeValue(displayText, value, icon, data, index);
477
417
  },
418
+
478
419
  tabIndex: -1
479
420
  }, jsx(Checkbox, {
480
421
  css: CheckBoxCSS,
@@ -502,7 +443,6 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
502
443
  }, icon, text));
503
444
  }
504
445
  }
505
-
506
446
  return jsx("div", {
507
447
  css: _DropdownListCSS,
508
448
  ref: dropdownListRef,
@@ -511,7 +451,6 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
511
451
  tabIndex: -1
512
452
  }, items !== null && items !== void 0 && items.length ? items : EmptyDataText);
513
453
  };
514
-
515
454
  const mapTreeView = () => {
516
455
  return jsx("div", {
517
456
  css: _DropdownListCSS,
@@ -538,17 +477,13 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
538
477
  renderItem: renderItem
539
478
  }) : EmptyDataText);
540
479
  };
541
-
542
480
  const loadMoreItemsDropdown = (i = 0, pattern) => {
543
481
  var _currentObjectDefault2, _displayExpr3;
544
-
545
- const dataSourceUsable = [...dataSource]; // Nếu có load more thì đẩy đội tượng mặc định lên đầu
546
-
482
+ const dataSourceUsable = [...dataSource];
483
+ // Nếu có load more thì đẩy đội tượng mặc định lên đầu
547
484
  let notExistItem = 0;
548
-
549
485
  if (onLoadMore && (_currentObjectDefault2 = currentObjectDefault[unique]) !== null && _currentObjectDefault2 !== void 0 && _currentObjectDefault2.length) {
550
486
  const length = currentObjectDefault[unique].length;
551
-
552
487
  for (let index = length - 1; index >= 0; index--) {
553
488
  if (!dataSourceUsable.some(data => data[valueExpr] === currentObjectDefault[unique][index][valueExpr])) {
554
489
  notExistItem++;
@@ -556,20 +491,17 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
556
491
  }
557
492
  }
558
493
  }
559
-
560
494
  const length = dataSourceUsable.length;
561
495
  let num = 0;
562
-
563
496
  if (displayExpr && Array.isArray(displayExpr)) {
564
497
  displayExpr = displayExpr.join(' - ');
565
498
  }
566
-
567
499
  const keyArr = (_displayExpr3 = displayExpr) === null || _displayExpr3 === void 0 ? void 0 : _displayExpr3.match(separatorPattern);
568
-
569
500
  for (i; i < length; i++) {
570
- const data = { ...dataSourceUsable[i]
571
- }; // Nếu đối tượng đã được hiển thị ở trên rồi thì không hiển thị ra nữa
572
-
501
+ const data = {
502
+ ...dataSourceUsable[i]
503
+ };
504
+ // Nếu đối tượng đã được hiển thị ở trên rồi thì không hiển thị ra nữa
573
505
  if (onLoadMore && i > notExistItem && currentObjectDefault[unique].some(valueObject => valueObject[valueExpr] === data[valueExpr])) continue;
574
506
  let displayText = typeof data === 'object' ? keyArr ? renderData(data, keyArr) : data[displayExpr] || data[valueExpr] : data;
575
507
  if (pattern && !new RegExp(pattern).test(displayText.normalize())) continue;
@@ -578,7 +510,6 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
578
510
  const text = jsx(Typography, {
579
511
  type: 'p1'
580
512
  }, displayText);
581
-
582
513
  if (renderItem && typeof renderItem === 'function') {
583
514
  displayText = renderItem({
584
515
  data,
@@ -597,7 +528,6 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
597
528
  index: i
598
529
  }) : data[subText] || subText));
599
530
  }
600
-
601
531
  const dropdownItem = document.createElement('div');
602
532
  dropdownItem.className = `DGN-UI-Dropdown-Item css-${_DropdownItemCSS.name}`;
603
533
  dropdownItem.tabIndex = -1;
@@ -606,7 +536,6 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
606
536
  if (e.key === 'Enter') dropdownItem.firstChild.click();
607
537
  });
608
538
  let item = null;
609
-
610
539
  if (multiple && selectBox) {
611
540
  const checked = Array.isArray(currentValue[unique]) ? currentValue[unique].includes(value) : [currentValue[unique]].includes(value);
612
541
  item = jsx(Checkbox, {
@@ -617,13 +546,10 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
617
546
  } else {
618
547
  item = jsx(Fragment, null, icon, text);
619
548
  }
620
-
621
549
  if (!dropdownListRef.current) {
622
550
  return;
623
551
  }
624
-
625
552
  ReactDOM.render(item, dropdownListRef.current.appendChild(dropdownItem));
626
-
627
553
  if (++num === 100) {
628
554
  timerRef.current = setTimeout(() => {
629
555
  loadMoreItemsDropdown(i + 1, pattern);
@@ -632,34 +558,26 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
632
558
  }
633
559
  }
634
560
  };
635
-
636
561
  const renderData = (data, keyArr) => {
637
562
  const pattern = keyArr.join('|').replace(/([{}])/g, '\\$1');
638
563
  const separatorArr = displayExpr.split(new RegExp(pattern));
639
564
  let str = '';
640
565
  let i = 0;
641
-
642
566
  for (i; i < keyArr.length; i++) {
643
567
  str += separatorArr[i] + (data[keyArr[i].replace(/\W/g, '')] !== undefined ? data[keyArr[i].replace(/\W/g, '')] : keyArr[i]);
644
568
  }
645
-
646
569
  return str + separatorArr[i];
647
570
  };
648
-
649
571
  const getIconFromData = (data, insideChip = false) => {
650
572
  if (!iconExpr || iconExpr === 'none') return null;
651
-
652
573
  let _src;
653
-
654
574
  if (typeof iconExpr === 'string') _src = data[iconExpr];else {
655
575
  let prefix = iconExpr.prefix || '';
656
576
  const suffix = iconExpr.suffix || '';
657
577
  const url = data[iconExpr.key];
658
-
659
578
  if (prefix && /^http/i.test(prefix) && /^http/i.test(url)) {
660
579
  prefix = '';
661
580
  }
662
-
663
581
  _src = prefix + url + suffix;
664
582
  }
665
583
  return jsx(Avatar, {
@@ -667,55 +585,45 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
667
585
  src: _src,
668
586
  width: insideChip ? 20 : 24,
669
587
  height: insideChip ? 20 : 24,
670
- style: { ...iconExpr.style,
588
+ style: {
589
+ ...iconExpr.style,
671
590
  marginRight: spacing([insideChip ? 0 : 2])
672
591
  }
673
592
  });
674
593
  };
675
-
676
594
  const customizeWidthDropdown = () => {
677
595
  if (dropdownListRef.current && _isMobile) dropdownListRef.current.style.maxHeight = `${Math.min(280, window.innerHeight) - (allowSearch ? 40 : 0)}px`;
678
-
679
596
  if (!ref.current) {
680
597
  window.removeEventListener('resize', customizeWidthDropdown);
681
598
  return;
682
599
  }
683
-
684
600
  const {
685
601
  width
686
602
  } = ref.current.getBoundingClientRect();
687
-
688
603
  if (dropdownRef.current) {
689
604
  dropdownRef.current.style.width = width + 'px';
690
605
  }
691
-
692
606
  updatePositionDropdown();
693
607
  };
694
-
695
608
  const updatePositionDropdown = () => {
696
609
  if (!formRef.current || !dropdownRef.current) {
697
610
  document.removeEventListener('wheel', onWheelHandler);
698
611
  return;
699
612
  }
700
-
701
613
  _isMobile ? updatePosition(formRef.current, dropdownRef.current, null) : updatePosition(formRef.current, dropdownRef.current, closeDropdown);
702
614
  };
703
-
704
615
  const onLoadMoreHandler = e => {
705
616
  if (loadMoreTimer.current) {
706
617
  clearTimeout(loadMoreTimer.current);
707
618
  }
708
-
709
619
  loadMoreTimer.current = setTimeout(() => {
710
620
  const {
711
621
  scrollTop,
712
622
  scrollHeight,
713
623
  offsetHeight
714
624
  } = e.target;
715
-
716
625
  if (scrollHeight === Math.ceil(scrollTop) + offsetHeight && dropdownListRef.current) {
717
626
  var _dropdownListRef$curr4, _currentObjectDefault3;
718
-
719
627
  const length = ((_dropdownListRef$curr4 = dropdownListRef.current.children) === null || _dropdownListRef$curr4 === void 0 ? void 0 : _dropdownListRef$curr4.length) - (((_currentObjectDefault3 = currentObjectDefault[unique]) === null || _currentObjectDefault3 === void 0 ? void 0 : _currentObjectDefault3.length) || 0);
720
628
  dropdownListRef.current.removeEventListener('scroll', onLoadMoreHandler);
721
629
  !!onLoadMore && onLoadMore({
@@ -725,54 +633,47 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
725
633
  }
726
634
  });
727
635
  };
728
-
729
636
  const onPreventKeyDownHandler = e => {
730
637
  e.preventDefault();
731
638
  return false;
732
639
  };
733
-
734
640
  const onChangeInput = e => {
735
641
  if (searchRef.current) lastSearchRef.current = searchRef.current.value;
736
642
  const dataFilter = getData();
737
643
  dataChoosen.current = [...dataFilter].filter(i => [...valueMulti].includes(i === null || i === void 0 ? void 0 : i[valueExpr]));
738
-
739
644
  if (onInput) {
740
- isSearch[unique] = true; // const valueInput = e.target.value;
645
+ isSearch[unique] = true;
646
+ // const valueInput = e.target.value;
741
647
  // const text = (valueInput || e.target.textContent).normalize();
742
-
743
648
  if (timeout.current) {
744
649
  if (timing[unique]) {
745
650
  clearTimeout(timing[unique]);
746
651
  }
747
-
748
652
  timing[unique] = setTimeout(() => {
749
653
  // e.target.value = text;
750
- onInput(e); // e.target.value = valueInput;
654
+ onInput(e);
655
+ // e.target.value = valueInput;
751
656
  }, timeout.current || searchDelayTime);
752
657
  } else {
753
658
  // e.target.value = text;
754
- onInput(e); // e.target.value = valueInput;
659
+ onInput(e);
660
+ // e.target.value = valueInput;
755
661
  }
756
662
 
757
663
  return;
758
664
  }
759
-
760
665
  const value = e.target.value || e.target.textContent;
761
-
762
666
  if (typeof renderSelectedItem === 'function' && e.target.childNodes && Array.from(e.target.childNodes).some(node => node.toString() !== '[object Text]')) {
763
667
  const cursor = document.getSelection().anchorOffset;
764
668
  e.target.innerHTML = value;
765
669
  document.getSelection().collapse(e.target, cursor);
766
670
  }
767
-
768
671
  if (timing[unique]) clearTimeout(timing[unique]);
769
672
  timing[unique] = setTimeout(() => {
770
673
  var _searchExpr2;
771
-
772
674
  renderDropdown(((_searchExpr2 = searchExpr) === null || _searchExpr2 === void 0 ? void 0 : _searchExpr2.length) > 0 ? value.normalize() : new RegExp(value.normalize(), 'gim'));
773
675
  }, timeout.current || searchDelayTime);
774
676
  };
775
-
776
677
  const onChangeValue = (displayText, value, icon, data) => {
777
678
  if (itemMode === 'treeview') {
778
679
  if (valueProp === undefined) {
@@ -780,7 +681,6 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
780
681
  setValueIntoInput(value);
781
682
  setShowClear(clearAble && checkHasValue(value) && !disabled && !readOnly && !loading);
782
683
  }
783
-
784
684
  !!onChange && onChange({
785
685
  value
786
686
  });
@@ -789,10 +689,11 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
789
689
  }, 0);
790
690
  } else if (multiple) {
791
691
  if (!Array.isArray(currentValue[unique])) currentValue[unique] = [];
792
- const newValueArr = [...currentValue[unique]]; // const newValueArrState = [...valueMulti];
793
-
692
+ const newValueArr = [...currentValue[unique]];
693
+ // const newValueArrState = [...valueMulti];
794
694
  if (!currentValue[unique].some(v => JSON.stringify(v) === JSON.stringify(value))) {
795
- newValueArr.push(value); // newValueArrState.push(value);
695
+ newValueArr.push(value);
696
+ // newValueArrState.push(value);
796
697
  // if (valueProp === undefined) {
797
698
  // let item = null;
798
699
  // if (typeof renderSelectedItem === 'function') {
@@ -817,14 +718,14 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
817
718
  // }
818
719
  } else {
819
720
  const index = newValueArr.indexOf(value);
820
- newValueArr.splice(index, 1); // newValueArrState.splice(index, 1);
721
+ newValueArr.splice(index, 1);
722
+ // newValueArrState.splice(index, 1);
821
723
  // if (valueProp === undefined) {
822
724
  // const nodes = inputRef.current.querySelectorAll('.dropdown-item');
823
725
  // nodes[index]?.remove();
824
726
  // }
825
- } // setValueMulti(newValueArrState);
826
-
827
-
727
+ }
728
+ // setValueMulti(newValueArrState);
828
729
  !!onChange && onChange({
829
730
  value: newValueArr,
830
731
  data
@@ -834,14 +735,12 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
834
735
  }, 0);
835
736
  } else {
836
737
  const isChanged = currentValue[unique] !== value;
837
-
838
738
  if (isChanged) {
839
739
  if (valueProp === undefined) {
840
740
  allValue[unique].push(value);
841
741
  setValueIntoInput(value);
842
742
  setShowClear(clearAble && checkHasValue(value) && !disabled && !readOnly && !loading);
843
743
  }
844
-
845
744
  !!onChange && onChange({
846
745
  value,
847
746
  data
@@ -851,7 +750,6 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
851
750
  triggerBlur(false);
852
751
  }
853
752
  }
854
-
855
753
  if (closeAfterSelect === true || closeAfterSelect === undefined && !multiple) {
856
754
  closeDropdown();
857
755
  } else {
@@ -859,22 +757,22 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
859
757
  updatePositionDropdown();
860
758
  }, 0);
861
759
  }
862
- }; // const onChangeValueWithCheckbox = e => {
760
+ };
761
+
762
+ // const onChangeValueWithCheckbox = e => {
863
763
  // const firstChild = e.currentTarget.firstChild;
864
764
  // if (!firstChild.contains(e.target)) {
865
765
  // firstChild.click();
866
766
  // }
867
767
  // };
868
768
 
869
-
870
769
  const onRemove = (e, value) => {
871
770
  var _ref;
872
-
873
771
  if (readOnly || disabled) return;
874
772
  const index = currentValue[unique].findIndex(v => JSON.stringify(v) === JSON.stringify(value));
875
-
876
773
  if (index !== -1) {
877
- currentValue[unique].splice(index, 1); // setTimeout(() => {
774
+ currentValue[unique].splice(index, 1);
775
+ // setTimeout(() => {
878
776
  // if (dropdownListRef.current && multiple && selectBox && !children) {
879
777
  // const input = dropdownListRef.current.querySelector(`input[value="${value}"]`);
880
778
  // if (input) {
@@ -887,9 +785,9 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
887
785
  // }, 0);
888
786
  // setValueMulti([...valueMulti]?.filter(i=>i!==value) || []);
889
787
  // !!onChange && onChange({ value: currentValue[unique], removed: value });
890
- } // logic mới
891
-
788
+ }
892
789
 
790
+ // logic mới
893
791
  const newValueArrState = ((_ref = [...valueMulti]) === null || _ref === void 0 ? void 0 : _ref.filter(i => i !== value)) || [];
894
792
  setValueMulti(newValueArrState);
895
793
  !!onChange && onChange({
@@ -897,26 +795,25 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
897
795
  removed: value
898
796
  });
899
797
  };
900
-
901
798
  const onClear = e => {
902
799
  if (disabled || readOnly || loading || !clearAble) return;
903
800
  currentValue[unique] = multiple ? [] : '';
904
-
905
- if (inputRef.current.tagName.toLowerCase() === 'div') {// inputRef.current.innerHTML = '';
801
+ if (inputRef.current.tagName.toLowerCase() === 'div') {
802
+ // inputRef.current.innerHTML = '';
906
803
  // if (dropdownListRef.current) {
907
804
  // dropdownListRef.current.querySelectorAll('input').forEach(input => (input.checked = false));
908
805
  // }
909
806
  } else {
910
807
  inputRef.current.value = '';
911
808
  setTextValue('');
912
- } // onChangeValue('', '');
913
-
914
-
809
+ }
810
+ // onChangeValue('', '');
915
811
  setValueMulti([]);
916
812
  setShowClear(false);
917
813
  e && e.target && e.target.blur();
918
814
  updatePositionDropdown();
919
- onInput === null || onInput === void 0 ? void 0 : onInput({ ...(inputRef === null || inputRef === void 0 ? void 0 : inputRef.current),
815
+ onInput === null || onInput === void 0 ? void 0 : onInput({
816
+ ...(inputRef === null || inputRef === void 0 ? void 0 : inputRef.current),
920
817
  target: {
921
818
  value: inputRef === null || inputRef === void 0 ? void 0 : inputRef.current.value
922
819
  }
@@ -925,12 +822,10 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
925
822
  value: currentValue[unique]
926
823
  });
927
824
  };
928
-
929
825
  const setPreviousValue = () => {
930
826
  allValue[unique].pop();
931
827
  setValueIntoInput(allValue[unique][allValue[unique].length - 1]);
932
828
  };
933
-
934
829
  const setValueIntoInput = source => {
935
830
  if (!source && source !== 0) {
936
831
  if (multiple) {
@@ -943,45 +838,34 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
943
838
  inputRef.current.value = '';
944
839
  setTextValue('');
945
840
  }
946
-
947
841
  currentValue[unique] = '';
948
842
  }
949
-
950
843
  return;
951
844
  }
952
-
953
845
  const length = dataSource.length;
954
846
  const displayKey = typeof renderSelectedItem === 'string' ? renderSelectedItem : displayExpr;
955
-
956
847
  if (displayKey && Array.isArray(displayKey)) {
957
848
  displayExpr = displayExpr.join(' - ');
958
849
  }
959
-
960
850
  const keyArr = displayKey === null || displayKey === void 0 ? void 0 : displayKey.match(separatorPattern);
961
-
962
851
  if (multiple) {
963
852
  let valueArr = source;
964
-
965
853
  if (!Array.isArray(valueArr)) {
966
854
  valueArr = [valueArr];
967
855
  }
968
-
969
856
  valueArr = [...new Set(valueArr)];
970
- currentValue[unique] = []; // inputRef.current.innerHTML = '';
971
-
857
+ currentValue[unique] = [];
858
+ // inputRef.current.innerHTML = '';
972
859
  valueArr.forEach(v => {
973
860
  var _currentObjectDefault4;
974
-
975
861
  for (let i = 0; i < length; i++) {
976
862
  if (typeof dataSource[i] === 'object' && dataSource[i][valueExpr] === v || dataSource[i] === v) {
977
863
  setMultipleValueHandler(dataSource[i], v, keyArr, i);
978
864
  return;
979
865
  }
980
866
  }
981
-
982
867
  if ((_currentObjectDefault4 = currentObjectDefault[unique]) !== null && _currentObjectDefault4 !== void 0 && _currentObjectDefault4.length) {
983
868
  const itemOfValue = currentObjectDefault[unique].find(valueObject => valueObject[valueExpr] === v || valueObject === v);
984
-
985
869
  if (itemOfValue) {
986
870
  setMultipleValueHandler(itemOfValue, v, keyArr);
987
871
  }
@@ -989,31 +873,25 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
989
873
  });
990
874
  } else {
991
875
  var _currentObjectDefault5;
992
-
993
876
  currentValue[unique] = source;
994
-
995
877
  for (let i = 0; i < length; i++) {
996
878
  if (dataSource[i][valueExpr] === source || dataSource[i] === source) {
997
879
  setSingleValueHandler(dataSource[i], keyArr);
998
880
  return;
999
881
  }
1000
882
  }
1001
-
1002
883
  if ((_currentObjectDefault5 = currentObjectDefault[unique]) !== null && _currentObjectDefault5 !== void 0 && _currentObjectDefault5.length) {
1003
884
  const itemOfValue = currentObjectDefault[unique].find(valueObject => valueObject[valueExpr] === source || valueObject === source);
1004
-
1005
885
  if (itemOfValue) {
1006
886
  setSingleValueHandler(itemOfValue, keyArr);
1007
887
  return;
1008
888
  }
1009
889
  }
1010
-
1011
890
  if (!isSearch[unique]) {
1012
891
  inputRef.current.value = source;
1013
892
  }
1014
893
  }
1015
894
  };
1016
-
1017
895
  const setMultipleValueHandler = (data, value) => {
1018
896
  // let item = null;
1019
897
  // if (typeof renderSelectedItem === 'function') {
@@ -1039,10 +917,8 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
1039
917
  // ReactDOM.render(item, inputRef.current.appendChild(el));
1040
918
  currentValue[unique].push(value);
1041
919
  };
1042
-
1043
920
  const setSingleValueHandler = (data, keyArr) => {
1044
921
  const text = keyArr ? renderData(data, keyArr) : typeof renderSelectedItem === 'string' ? data[renderSelectedItem] : data[displayExpr] || data[valueExpr] || data;
1045
-
1046
922
  if (typeof renderSelectedItem === 'function') {
1047
923
  inputRef.current.innerHTML = '';
1048
924
  const item = renderSelectedItem({
@@ -1068,7 +944,6 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
1068
944
  setTextValue(text);
1069
945
  }
1070
946
  };
1071
-
1072
947
  useImperativeHandle(reference, () => {
1073
948
  const currentRef = ref.current || {};
1074
949
  const _instance = {
@@ -1084,30 +959,22 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
1084
959
  if (allValue[unique][allValue[unique].length - 1] !== value) {
1085
960
  allValue[unique].push(value);
1086
961
  }
1087
-
1088
962
  setValueIntoInput(value);
1089
963
  }
1090
964
  }; // methods
1091
-
1092
965
  _instance.__proto__ = {}; // hidden methods
1093
-
1094
- currentRef.instance = _instance; // keep old method
1095
-
966
+ currentRef.instance = _instance;
967
+ // keep old method
1096
968
  currentRef.closeDropdown = () => closeDropdown();
1097
-
1098
969
  currentRef.showDropdown = () => setOpenState(true);
1099
-
1100
970
  currentRef.onClear = onClear;
1101
971
  currentRef.setPreviousValue = setPreviousValue;
1102
-
1103
972
  currentRef.setValue = value => {
1104
973
  if (allValue[unique][allValue[unique].length - 1] !== value) {
1105
974
  allValue[unique].push(value);
1106
975
  }
1107
-
1108
976
  setValueIntoInput(value);
1109
977
  };
1110
-
1111
978
  currentRef.DOM = ref.current;
1112
979
  return currentRef;
1113
980
  });
@@ -1124,19 +991,16 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
1124
991
  } else {
1125
992
  currentObjectDefault[unique] = [];
1126
993
  }
1127
-
1128
994
  return () => {
1129
995
  currentObjectDefault[unique] = null;
1130
996
  };
1131
997
  }, [valueObjectDefault]);
1132
998
  useEffect(() => {
1133
999
  allValue[unique] = [];
1134
-
1135
1000
  if (defaultValue !== undefined && JSON.stringify(defaultValue) !== '[]') {
1136
1001
  setValueIntoInput(defaultValue);
1137
1002
  setShowClear(clearAble && checkHasValue(defaultValue) && !disabled && !readOnly && !loading);
1138
1003
  }
1139
-
1140
1004
  return () => {
1141
1005
  allValue[unique] = null;
1142
1006
  closeDropdown();
@@ -1145,7 +1009,6 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
1145
1009
  useEffect(() => {
1146
1010
  if (searchDelayTime) {
1147
1011
  var _searchDelayTime$matc, _searchDelayTime$matc2;
1148
-
1149
1012
  if (searchDelayTime === true) searchDelayTime = getGlobal('delayOnInput');
1150
1013
  const units = {
1151
1014
  m: 60000,
@@ -1162,12 +1025,10 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
1162
1025
  if (allValue[unique][allValue[unique].length - 1] !== valueProp) {
1163
1026
  allValue[unique].push(valueProp);
1164
1027
  }
1165
-
1166
1028
  if (multiple && valueProp) {
1167
1029
  setValueMulti(convertData(valueProp, valueExpr));
1168
- } // Close dropdown treeview by children when select item
1169
-
1170
-
1030
+ }
1031
+ // Close dropdown treeview by children when select item
1171
1032
  if (children && (closeAfterSelect === true || closeAfterSelect === undefined && !multiple)) {
1172
1033
  closeDropdown();
1173
1034
  }
@@ -1179,26 +1040,21 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
1179
1040
  }, [valueProp, dataSource]);
1180
1041
  useEffect(() => {
1181
1042
  inputRef.current.readOnly = readOnly || inputProps.readOnly;
1182
-
1183
1043
  if (!readOnly && !disabled) {
1184
1044
  !!onLoadMore && dropdownListRef.current && dropdownListRef.current.addEventListener('scroll', onLoadMoreHandler);
1185
1045
  }
1186
-
1187
1046
  if (disabled || readOnly || children) {
1188
1047
  inputRef.current.addEventListener('keydown', onPreventKeyDownHandler);
1189
1048
  } else {
1190
1049
  inputRef.current.addEventListener('keydown', onKeyDown);
1191
1050
  }
1192
-
1193
1051
  return () => {
1194
1052
  if (!ref.current || !inputRef.current || !iconRef.current) return;
1195
-
1196
1053
  if (disabled || readOnly || children) {
1197
1054
  inputRef.current.removeEventListener('keydown', onPreventKeyDownHandler);
1198
1055
  } else {
1199
1056
  inputRef.current.removeEventListener('keydown', onKeyDown);
1200
1057
  }
1201
-
1202
1058
  closeDropdown();
1203
1059
  };
1204
1060
  }, [disabled, readOnly, displayExpr, multiple, allowSearch, viewType, closeAfterSelect, selectBox]);
@@ -1207,7 +1063,6 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
1207
1063
  inputRef.current.addEventListener('click', onClickInput);
1208
1064
  inputRef.current.addEventListener('input', onChangeInput);
1209
1065
  }
1210
-
1211
1066
  return () => {
1212
1067
  if (!disabled && !readOnly && inputRef.current) {
1213
1068
  inputRef.current.removeEventListener('click', onClickInput);
@@ -1219,16 +1074,12 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
1219
1074
  if (!disabled && !readOnly) {
1220
1075
  inputRef.current.addEventListener('click', onClickInput);
1221
1076
  }
1222
-
1223
1077
  if (dropdownListRef.current) {
1224
1078
  var _dropdownListRef$curr5, _dropdownListRef$curr6, _currentObjectDefault6;
1225
-
1226
1079
  if (!disabled && !readOnly) {
1227
1080
  inputRef.current.addEventListener('input', onChangeInput);
1228
1081
  }
1229
-
1230
1082
  const length = (_dropdownListRef$curr5 = dropdownListRef.current) === null || _dropdownListRef$curr5 === void 0 ? void 0 : (_dropdownListRef$curr6 = _dropdownListRef$curr5.children) === null || _dropdownListRef$curr6 === void 0 ? void 0 : _dropdownListRef$curr6.length;
1231
-
1232
1083
  if (length < dataSource.length + ((_currentObjectDefault6 = currentObjectDefault[unique]) === null || _currentObjectDefault6 === void 0 ? void 0 : _currentObjectDefault6.length) && !isSearch[unique]) {
1233
1084
  loadMoreItemsDropdown(length);
1234
1085
  !!onLoadMore && dataSource.length < total && dropdownListRef.current.addEventListener('scroll', onLoadMoreHandler);
@@ -1240,20 +1091,17 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
1240
1091
  inputRef.current.addEventListener('input', onChangeInput);
1241
1092
  }
1242
1093
  }
1243
-
1244
1094
  return () => {
1245
1095
  if (inputRef.current) {
1246
1096
  inputRef.current.removeEventListener('input', onChangeInput);
1247
1097
  inputRef.current.removeEventListener('click', onClickInput);
1248
1098
  }
1249
-
1250
1099
  !!dropdownListRef.current && dropdownListRef.current.removeEventListener('scroll', onLoadMoreHandler);
1251
1100
  };
1252
1101
  }, [dataSource]);
1253
1102
  /* End handler */
1254
1103
 
1255
1104
  /* Start component */
1256
-
1257
1105
  const EmptyDataText = jsx("div", {
1258
1106
  css: _DropdownItemCSS,
1259
1107
  className: 'no-data'
@@ -1263,20 +1111,17 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
1263
1111
  disabled: disabled,
1264
1112
  ...labelProps
1265
1113
  }, label) : null, [label, required, disabled, labelProps]);
1266
-
1267
1114
  const getData = () => {
1268
1115
  let dataFilter = JSON.parse(JSON.stringify(dataSource));
1269
-
1270
1116
  if (Array.isArray(valueObjectDefault)) {
1271
1117
  dataFilter = [...dataFilter, ...dataChoosen.current, ...valueObjectDefault];
1272
1118
  } else if (typeof valueObjectDefault === 'object') {
1273
- dataFilter = [...dataFilter, ...dataChoosen.current, { ...valueObjectDefault
1119
+ dataFilter = [...dataFilter, ...dataChoosen.current, {
1120
+ ...valueObjectDefault
1274
1121
  }];
1275
1122
  }
1276
-
1277
1123
  return dataFilter;
1278
1124
  };
1279
-
1280
1125
  const InputView = useMemo(() => {
1281
1126
  return jsx("div", {
1282
1127
  css: _DropdownFormCSS,
@@ -1285,7 +1130,8 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
1285
1130
  }, jsx("div", {
1286
1131
  css: _InputCSS,
1287
1132
  className: 'DGN-UI-Dropdown-Form-Input'
1288
- }, multiple && valueMulti !== null && valueMulti !== void 0 && valueMulti.length ? jsx("div", { ...inputProps,
1133
+ }, multiple && valueMulti !== null && valueMulti !== void 0 && valueMulti.length ? jsx("div", {
1134
+ ...inputProps,
1289
1135
  style: {
1290
1136
  gap: spacing(0.5),
1291
1137
  ...inputStyle
@@ -1301,24 +1147,19 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
1301
1147
  let dataFilter = getData();
1302
1148
  const data = dataFilter.find(v => v[valueExpr] === vl);
1303
1149
  let text = '';
1304
-
1305
1150
  if (data) {
1306
1151
  var _mask;
1307
-
1308
1152
  displayExpr = typeof renderSelectedItem === 'string' ? renderSelectedItem : displayExpr || valueExpr;
1309
- let mask = data === null || data === void 0 ? void 0 : data[displayExpr]; // convert {id} - {name} to {<data[id]>} - {<data[name]>}
1153
+ let mask = data === null || data === void 0 ? void 0 : data[displayExpr];
1310
1154
 
1155
+ // convert {id} - {name} to {<data[id]>} - {<data[name]>}
1311
1156
  if (!mask && regexBetween.test(displayExpr)) {
1312
1157
  var _displayExpr4;
1313
-
1314
1158
  mask = (_displayExpr4 = displayExpr) === null || _displayExpr4 === void 0 ? void 0 : _displayExpr4.replace(regexBetween, _ => data[_]);
1315
1159
  }
1316
-
1317
1160
  text = (_mask = mask) === null || _mask === void 0 ? void 0 : _mask.replace(regexInclude, '');
1318
1161
  }
1319
-
1320
1162
  let item;
1321
-
1322
1163
  if (typeof renderSelectedItem === 'function') {
1323
1164
  item = renderSelectedItem({
1324
1165
  data,
@@ -1335,9 +1176,9 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
1335
1176
  onRemove: e => onRemove(e, vl)
1336
1177
  });
1337
1178
  }
1338
-
1339
1179
  return item;
1340
- })) : typeof renderSelectedItem === 'function' || iconExpr && iconExpr !== 'none' ? jsx("div", { ...inputProps,
1180
+ })) : typeof renderSelectedItem === 'function' || iconExpr && iconExpr !== 'none' ? jsx("div", {
1181
+ ...inputProps,
1341
1182
  style: inputStyle,
1342
1183
  ref: inputRef,
1343
1184
  css: _DropdownInputCSS,
@@ -1382,7 +1223,8 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
1382
1223
  }) : null));
1383
1224
  }, [openState, showClear, textValue, valueMulti, clearAble, dataSource, disabled, displayExpr, inputProps, inputStyle, loading, multilineSelectedItem, multiple, onChange, placeholder, readOnly, renderSelectedItem, valueExpr, valueObjectDefault, viewType]);
1384
1225
  const ErrorView = useMemo(() => {
1385
- return error ? jsx(HelperText, { ...helperTextProps,
1226
+ return error ? jsx(HelperText, {
1227
+ ...helperTextProps,
1386
1228
  disabled: disabled
1387
1229
  }, error) : null;
1388
1230
  }, [disabled, error, helperTextProps]);
@@ -1398,14 +1240,13 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
1398
1240
  className: classNames('DGN-UI-Dropdown', className, error && 'error', loading && 'dgn-dropdown-loading', disabled ? 'disabled' : readOnly && 'readOnly')
1399
1241
  }, LabelView, InputView, ErrorView), DropdownView);
1400
1242
  }));
1401
- /* Start styled */
1402
1243
 
1244
+ /* Start styled */
1403
1245
  const InputCSS = (multiple, renderSelectedItem) => css`
1404
1246
  ${displayFlex};
1405
1247
  ${positionRelative};
1406
1248
  ${parseWidth(!multiple && renderSelectedItem ? 'calc(100% - 34px)' : '100%')};
1407
1249
  `;
1408
-
1409
1250
  const DropdownInputCSS = (viewType, multiple, placeholder, disabled, readOnly) => css`
1410
1251
  ${displayFlex};
1411
1252
  ${itemsCenter};
@@ -1458,14 +1299,12 @@ const DropdownInputCSS = (viewType, multiple, placeholder, disabled, readOnly) =
1458
1299
  ${disabled && `color: ${systemDisabled}`};
1459
1300
  }
1460
1301
  `;
1461
-
1462
1302
  const IconCSS = viewType => css`
1463
1303
  ${displayFlex};
1464
1304
  ${itemsCenter};
1465
1305
  ${mgl([2])};
1466
1306
  ${mgr([viewType !== 'outlined' ? 0 : 4])};
1467
1307
  `;
1468
-
1469
1308
  const DropdownFormCSS = (viewType, multiple, disabled, placeholder, DropdownInputCSSName) => viewType !== 'outlined' ? css`
1470
1309
  ${displayFlex};
1471
1310
  ${flexRow};
@@ -1577,7 +1416,6 @@ const DropdownFormCSS = (viewType, multiple, disabled, placeholder, DropdownInpu
1577
1416
  content: '';
1578
1417
  }
1579
1418
  `;
1580
-
1581
1419
  const DropdownListCSS = loading => css`
1582
1420
  ${displayBlock};
1583
1421
  ${positionRelative};
@@ -1605,7 +1443,6 @@ const DropdownListCSS = loading => css`
1605
1443
  ${pd([0.25])};
1606
1444
  }
1607
1445
  `;
1608
-
1609
1446
  const DropdownItemCSS = (multiple, selectBox) => css`
1610
1447
  ${displayFlex};
1611
1448
  ${flexRow};
@@ -1632,7 +1469,6 @@ const DropdownItemCSS = (multiple, selectBox) => css`
1632
1469
  color: ${systemActive};
1633
1470
  }
1634
1471
  `;
1635
-
1636
1472
  const DropdownRootCSS = (DropdownFormCSSName, DropdownInputCSSName) => css`
1637
1473
  ${displayBlock};
1638
1474
  ${positionRelative};
@@ -1666,7 +1502,6 @@ const DropdownRootCSS = (DropdownFormCSSName, DropdownInputCSSName) => css`
1666
1502
  }
1667
1503
  }
1668
1504
  `;
1669
-
1670
1505
  const DropdownCSS = (top, left, width, isMobile, allowSearch) => css`
1671
1506
  ${positionFixed};
1672
1507
  ${parseWidth(width)};
@@ -1681,7 +1516,6 @@ const DropdownCSS = (top, left, width, isMobile, allowSearch) => css`
1681
1516
  top: auto;
1682
1517
  `}
1683
1518
  `;
1684
-
1685
1519
  const LoadingProgressCSS = css`
1686
1520
  ${displayFlex};
1687
1521
  ${flexRow};
@@ -1733,51 +1567,39 @@ Dropdown.defaultProps = {
1733
1567
  Dropdown.propTypes = {
1734
1568
  /** If `true`, display input box search. */
1735
1569
  allowSearch: PropTypes.bool,
1736
-
1737
1570
  /** The contents in Dropdown box (Exp: TreeView). */
1738
1571
  children: PropTypes.node,
1739
-
1740
1572
  /** Class for component. */
1741
1573
  className: PropTypes.string,
1742
-
1743
1574
  /** If `true`, display clear icon.*/
1744
1575
  clearAble: PropTypes.bool,
1745
-
1746
1576
  /** If `true`, dropdown will close after select an item. */
1747
1577
  closeAfterSelect: PropTypes.bool,
1748
-
1749
1578
  /** The array of elements that appear in the dropdown list. */
1750
1579
  dataSource: PropTypes.array,
1751
-
1752
1580
  /** Default value displayed when first render. */
1753
1581
  defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),
1754
-
1755
1582
  /** If `true`, the component is disabled. */
1756
1583
  disabled: PropTypes.bool,
1757
-
1758
- /** Field name used for text display in dropdown list.<br/>
1759
- * Example: 'name', '{id} - {name}', '{age} age(s)'<br/>
1760
- * Note: don't use 'id - name', return undefined
1584
+ /** Field name used for text display in dropdown list.<br/>
1585
+ * Example: 'name', '{id} - {name}', '{age} age(s)'<br/>
1586
+ * Note: don't use 'id - name', return undefined
1761
1587
  */
1762
1588
  displayExpr: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),
1763
-
1764
1589
  /** Style inline of dropdown items. */
1765
1590
  dropdownItemStyle: PropTypes.object,
1766
-
1767
1591
  /** Error displayed below input. */
1768
1592
  error: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
1769
-
1770
1593
  /** Props applied to the [HelperText](https://core.diginet.com.vn/ui/?path=/story/form-control-text-helpertext) element. */
1771
1594
  helperTextProps: PropTypes.object,
1772
-
1773
- /** Field name used for icon display.<br/>
1774
- * Example:<br/>
1775
- * &nbsp;&nbsp;string: 'icon'<br/>
1776
- * &nbsp;&nbsp;object: {<br/>
1777
- * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;key: 'icon',<br/>
1778
- * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;prefix: 'https://imglink.com',<br/>
1779
- * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;suffix: '.jpg'<br/>
1780
- * &nbsp;&nbsp;}
1595
+ /** Field name used for icon display.<br/>
1596
+ * Example:<br/>
1597
+ * &nbsp;&nbsp;string: 'icon'<br/>
1598
+ * &nbsp;&nbsp;object: {<br/>
1599
+ * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;key: 'icon',<br/>
1600
+ * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;prefix: 'https://imglink.com',<br/>
1601
+ * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;suffix: '.jpg'<br/>
1602
+ * &nbsp;&nbsp;}
1781
1603
  */
1782
1604
  iconExpr: PropTypes.oneOfType([PropTypes.string, PropTypes.shape({
1783
1605
  key: PropTypes.string,
@@ -1785,133 +1607,98 @@ Dropdown.propTypes = {
1785
1607
  suffix: PropTypes.string,
1786
1608
  style: PropTypes.object
1787
1609
  })]),
1788
-
1789
1610
  /** Attributes applied to the input element. */
1790
1611
  inputProps: PropTypes.object,
1791
-
1792
1612
  /** Style inline of input element. */
1793
1613
  inputStyle: PropTypes.object,
1794
-
1795
1614
  /** The mode of item when rendering. */
1796
1615
  itemMode: PropTypes.oneOf(['normal', 'table', 'treeview']),
1797
-
1798
1616
  /** The label of the input. */
1799
1617
  label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
1800
-
1801
1618
  /** [Props](https://core.diginet.com.vn/ui/?path=/docs/form-control-text-label--simple) of label. */
1802
1619
  labelProps: PropTypes.object,
1803
-
1804
1620
  /** Number of items that are rendered each time. */
1805
1621
  limit: PropTypes.number,
1806
-
1807
1622
  /** If `true`, the loading indicator is shown. */
1808
1623
  loading: PropTypes.bool,
1809
-
1810
1624
  /** Set restrictions regarding the maximum number of options that can be selected. (Use with prop `multiple`) */
1811
1625
  maximumSelectionLength: PropTypes.number,
1812
-
1813
1626
  /** If `true`, show multi-line selected item(s). */
1814
1627
  multilineSelectedItem: PropTypes.bool,
1815
-
1816
1628
  /** If `true`, value must be an array and the dropdown will support multiple selections. */
1817
1629
  multiple: PropTypes.bool,
1818
-
1819
1630
  /** Specifies a text string shown when there is no data. */
1820
1631
  noDataText: PropTypes.string,
1821
-
1822
1632
  /** Callback fired when the value changes. */
1823
1633
  onChange: PropTypes.func,
1824
-
1825
1634
  /** Callback fired when dropdown closed. */
1826
1635
  onClosed: PropTypes.func,
1827
-
1828
- /** Callback fired when the input value changes.<br/>
1829
- * if undefined: the filter function will run (default)
1636
+ /** Callback fired when the input value changes.<br/>
1637
+ * if undefined: the filter function will run (default)
1830
1638
  */
1831
1639
  onInput: PropTypes.func,
1832
-
1833
1640
  /** Callback fired when key down input */
1834
1641
  onKeyDown: PropTypes.func,
1835
-
1836
1642
  /** Callback fired when scroll near the end. */
1837
1643
  onLoadMore: PropTypes.func,
1838
-
1839
1644
  /** The short hint displayed in the input before the user select a value. */
1840
1645
  placeholder: PropTypes.string,
1841
-
1842
1646
  /** If `true`, the component is read-only. */
1843
1647
  readOnly: PropTypes.bool,
1844
-
1845
- /** Function displays items by custom.<br/>
1846
- * renderItem={(data, index) => data.name + ' - ' + data.role}<br/>
1847
- * --> such as: displayExpr={'name - role'}
1648
+ /** Function displays items by custom.<br/>
1649
+ * renderItem={(data, index) => data.name + ' - ' + data.role}<br/>
1650
+ * --> such as: displayExpr={'name - role'}
1848
1651
  */
1849
1652
  renderItem: PropTypes.func,
1850
-
1851
- /** Function or field name used for display selected items, example:<br/>
1852
- * renderSelectedItem={(data, index) => index + ' - ' + data.name}<br/>
1653
+ /** Function or field name used for display selected items, example:<br/>
1654
+ * renderSelectedItem={(data, index) => index + ' - ' + data.name}<br/>
1853
1655
  */
1854
1656
  renderSelectedItem: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
1855
-
1856
1657
  /** If `true`, the label will indicate that the input is required. */
1857
1658
  required: PropTypes.bool,
1858
-
1859
- /**
1860
- * Duration wait enter search content on search.<br/>
1861
- * Example: 700 -> 700ms, '700ms' -> 700ms, '0.7s' -> 700ms, '1m' -> 60000ms
1862
- * If `true`, used default delayOnInput.
1659
+ /**
1660
+ * Duration wait enter search content on search.<br/>
1661
+ * Example: 700 -> 700ms, '700ms' -> 700ms, '0.7s' -> 700ms, '1m' -> 60000ms
1662
+ * If `true`, used default delayOnInput.
1863
1663
  */
1864
1664
  searchDelayTime: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]),
1865
-
1866
1665
  /** Specifies a data object's field name or an expression whose value is compared to the search string. */
1867
1666
  searchExpr: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
1868
-
1869
1667
  /** Specifies a comparison operation used to search items. */
1870
1668
  searchMode: PropTypes.oneOf(['contains', 'startswith', 'equals']),
1871
-
1872
1669
  /** If `true`, show checkbox in each dropdown item. */
1873
1670
  selectBox: PropTypes.bool,
1874
-
1875
1671
  /** Style inline of component. */
1876
1672
  style: PropTypes.object,
1877
-
1878
1673
  /** Display sub content. */
1879
1674
  subText: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
1880
-
1881
1675
  /** The total number of items in the dropdown list. */
1882
1676
  total: PropTypes.number,
1883
-
1884
1677
  /** Used to identify the parent key (only used for `itemMode` is 'treeview'). */
1885
1678
  treeViewID: PropTypes.string,
1886
-
1887
1679
  /** Used for mapping into a nested list (only used for `itemMode` is 'treeview'). */
1888
1680
  treeViewParentID: PropTypes.string,
1889
-
1890
1681
  /** The displayed value of component. */
1891
1682
  value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),
1892
-
1893
1683
  /** The field name used for the returned result. */
1894
1684
  valueExpr: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
1895
-
1896
1685
  /** An object default for value (use for load more). */
1897
1686
  valueObjectDefault: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
1898
-
1899
1687
  /**The variant to use. */
1900
1688
  viewType: PropTypes.oneOf(['underlined', 'outlined', 'none']),
1901
-
1902
- /**
1903
- * ref methods
1904
- *
1905
- * how to get component element? ref.current
1906
- *
1907
- * how to call method? ref.current.instance.{method}
1908
- *
1909
- * * showDropdown(): Show dropdown
1910
- * * closeDropdown(): Close dropdown
1911
- * * onClear(): Clear selected value
1912
- * * setPreviousValue(): Set value to previous value
1913
- * * setValue(value): Set value of dropdown
1914
- * * @param {value} - string || number || array
1689
+ /**
1690
+ * ref methods
1691
+ *
1692
+ * how to get component element? ref.current
1693
+ *
1694
+ * how to call method? ref.current.instance.{method}
1695
+ *
1696
+ * * showDropdown(): Show dropdown
1697
+ * * closeDropdown(): Close dropdown
1698
+ * * onClear(): Clear selected value
1699
+ * * setPreviousValue(): Set value to previous value
1700
+ * * setValue(value): Set value of dropdown
1701
+ * * @param {value} - string || number || array
1915
1702
  */
1916
1703
  reference: ref
1917
1704
  };