@antscorp/antsomi-ui 1.3.5-beta.13 → 1.3.5-beta.14

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 (1030) hide show
  1. package/README.md +78 -78
  2. package/es/assets/css/main.scss +4 -4
  3. package/es/assets/images/feedback.svg +3 -3
  4. package/es/components/atoms/Alert/Alert.d.ts +4 -4
  5. package/es/components/atoms/Alert/Alert.js +19 -19
  6. package/es/components/atoms/Alert/index.d.ts +1 -1
  7. package/es/components/atoms/Alert/index.js +1 -1
  8. package/es/components/atoms/Button/Button.d.ts +1 -1
  9. package/es/components/atoms/Button/Button.js +1 -1
  10. package/es/components/atoms/Button/index.d.ts +4 -4
  11. package/es/components/atoms/Button/index.js +2 -2
  12. package/es/components/atoms/Button/test.d.ts +3 -3
  13. package/es/components/atoms/Button/test.js +99 -99
  14. package/es/components/atoms/Checkbox/Checkbox.d.ts +1 -1
  15. package/es/components/atoms/Checkbox/Checkbox.js +1 -1
  16. package/es/components/atoms/Checkbox/index.d.ts +1 -1
  17. package/es/components/atoms/Checkbox/index.js +1 -1
  18. package/es/components/atoms/Divider/Divider.d.ts +1 -1
  19. package/es/components/atoms/Divider/Divider.js +1 -1
  20. package/es/components/atoms/Divider/index.d.ts +1 -1
  21. package/es/components/atoms/Divider/index.js +1 -1
  22. package/es/components/atoms/DividerPure/DividerPure.d.ts +10 -10
  23. package/es/components/atoms/DividerPure/DividerPure.js +27 -27
  24. package/es/components/atoms/DividerPure/index.d.ts +1 -1
  25. package/es/components/atoms/DividerPure/index.js +1 -1
  26. package/es/components/atoms/DividerPure/styled.d.ts +1 -1
  27. package/es/components/atoms/DividerPure/styled.js +41 -41
  28. package/es/components/atoms/Empty/Empty.d.ts +6 -6
  29. package/es/components/atoms/Empty/Empty.js +8 -8
  30. package/es/components/atoms/Empty/index.d.ts +1 -1
  31. package/es/components/atoms/Empty/index.js +1 -1
  32. package/es/components/atoms/Flex/Flex.d.ts +2 -2
  33. package/es/components/atoms/Flex/Flex.js +1 -1
  34. package/es/components/atoms/Flex/index.d.ts +1 -1
  35. package/es/components/atoms/Flex/index.js +1 -1
  36. package/es/components/atoms/FloatButton/FloatButton.d.ts +1 -1
  37. package/es/components/atoms/FloatButton/FloatButton.js +1 -1
  38. package/es/components/atoms/FloatButton/index.d.ts +1 -1
  39. package/es/components/atoms/FloatButton/index.js +2 -2
  40. package/es/components/atoms/Grid/Grid.d.ts +3 -3
  41. package/es/components/atoms/Grid/Grid.js +3 -3
  42. package/es/components/atoms/Grid/index.d.ts +1 -1
  43. package/es/components/atoms/Grid/index.js +1 -1
  44. package/es/components/atoms/Icon/index.d.ts +10 -10
  45. package/es/components/atoms/Icon/index.js +36 -36
  46. package/es/components/atoms/Input/Input.d.ts +31 -31
  47. package/es/components/atoms/Input/Input.js +96 -96
  48. package/es/components/atoms/Input/index.d.ts +2 -2
  49. package/es/components/atoms/Input/index.js +1 -1
  50. package/es/components/atoms/Input/styled.d.ts +11 -11
  51. package/es/components/atoms/Input/styled.js +109 -109
  52. package/es/components/atoms/InputDynamic/EditCaretPositioning.d.ts +2 -2
  53. package/es/components/atoms/InputDynamic/EditCaretPositioning.js +89 -89
  54. package/es/components/atoms/InputDynamic/InputDynamic.d.ts +10 -10
  55. package/es/components/atoms/InputDynamic/InputDynamic.js +516 -516
  56. package/es/components/atoms/InputDynamic/PopupShortLink.d.ts +16 -16
  57. package/es/components/atoms/InputDynamic/PopupShortLink.js +85 -85
  58. package/es/components/atoms/InputDynamic/constants.d.ts +71 -71
  59. package/es/components/atoms/InputDynamic/constants.js +71 -71
  60. package/es/components/atoms/InputDynamic/index.d.ts +2 -2
  61. package/es/components/atoms/InputDynamic/index.js +1 -1
  62. package/es/components/atoms/InputDynamic/styled.d.ts +13 -13
  63. package/es/components/atoms/InputDynamic/styled.js +293 -293
  64. package/es/components/atoms/InputDynamic/types.d.ts +116 -116
  65. package/es/components/atoms/InputDynamic/types.js +1 -1
  66. package/es/components/atoms/InputDynamic/utils.d.ts +30 -30
  67. package/es/components/atoms/InputDynamic/utils.js +874 -874
  68. package/es/components/atoms/InputNumber/InputNumber.d.ts +6 -6
  69. package/es/components/atoms/InputNumber/InputNumber.js +27 -27
  70. package/es/components/atoms/InputNumber/index.d.ts +1 -1
  71. package/es/components/atoms/InputNumber/index.js +1 -1
  72. package/es/components/atoms/Message/Message.d.ts +1 -1
  73. package/es/components/atoms/Message/Message.js +1 -1
  74. package/es/components/atoms/Message/index.d.ts +1 -1
  75. package/es/components/atoms/Message/index.js +1 -1
  76. package/es/components/atoms/MobileFrame/MobileFrame.d.ts +4 -4
  77. package/es/components/atoms/MobileFrame/MobileFrame.js +22 -22
  78. package/es/components/atoms/MobileFrame/constants.d.ts +4 -4
  79. package/es/components/atoms/MobileFrame/constants.js +4 -4
  80. package/es/components/atoms/MobileFrame/index.d.ts +2 -2
  81. package/es/components/atoms/MobileFrame/index.js +1 -1
  82. package/es/components/atoms/MobileFrame/styled.d.ts +3 -3
  83. package/es/components/atoms/MobileFrame/styled.js +33 -33
  84. package/es/components/atoms/Notification/Notification.d.ts +1 -1
  85. package/es/components/atoms/Notification/Notification.js +1 -1
  86. package/es/components/atoms/Notification/index.d.ts +1 -1
  87. package/es/components/atoms/Notification/index.js +1 -1
  88. package/es/components/atoms/Pagination/Pagination.d.ts +2 -2
  89. package/es/components/atoms/Pagination/Pagination.js +2 -2
  90. package/es/components/atoms/Pagination/index.d.ts +2 -2
  91. package/es/components/atoms/Pagination/index.js +1 -1
  92. package/es/components/atoms/Popover/Popover.d.ts +4 -4
  93. package/es/components/atoms/Popover/Popover.js +2 -2
  94. package/es/components/atoms/Popover/index.d.ts +1 -1
  95. package/es/components/atoms/Popover/index.js +1 -1
  96. package/es/components/atoms/Popover/styled.d.ts +4 -4
  97. package/es/components/atoms/Popover/styled.js +5 -5
  98. package/es/components/atoms/PreviewTabs/PreviewTabs.d.ts +7 -7
  99. package/es/components/atoms/PreviewTabs/PreviewTabs.js +67 -67
  100. package/es/components/atoms/PreviewTabs/index.d.ts +2 -2
  101. package/es/components/atoms/PreviewTabs/index.js +1 -1
  102. package/es/components/atoms/PreviewTabs/styled.d.ts +6 -6
  103. package/es/components/atoms/PreviewTabs/styled.js +79 -79
  104. package/es/components/atoms/Progress/Progress.d.ts +2 -2
  105. package/es/components/atoms/Progress/Progress.js +2 -2
  106. package/es/components/atoms/Progress/index.d.ts +1 -1
  107. package/es/components/atoms/Progress/index.js +1 -1
  108. package/es/components/atoms/Radio/Radio.d.ts +1 -1
  109. package/es/components/atoms/Radio/Radio.js +1 -1
  110. package/es/components/atoms/Radio/index.d.ts +7 -7
  111. package/es/components/atoms/Radio/index.js +25 -25
  112. package/es/components/atoms/Rate/Rate.d.ts +2 -2
  113. package/es/components/atoms/Rate/Rate.js +2 -2
  114. package/es/components/atoms/Rate/index.d.ts +1 -1
  115. package/es/components/atoms/Rate/index.js +1 -1
  116. package/es/components/atoms/RateV2/RateV2.d.ts +18 -18
  117. package/es/components/atoms/RateV2/RateV2.js +73 -73
  118. package/es/components/atoms/RateV2/index.d.ts +1 -1
  119. package/es/components/atoms/RateV2/index.js +1 -1
  120. package/es/components/atoms/RequiredLabel/index.d.ts +8 -8
  121. package/es/components/atoms/RequiredLabel/index.js +25 -25
  122. package/es/components/atoms/RequiredLabel/styled.d.ts +2 -2
  123. package/es/components/atoms/RequiredLabel/styled.js +10 -10
  124. package/es/components/atoms/ScrollBox/index.d.ts +9 -9
  125. package/es/components/atoms/ScrollBox/index.js +51 -51
  126. package/es/components/atoms/Segmented/Segmented.d.ts +2 -2
  127. package/es/components/atoms/Segmented/Segmented.js +2 -2
  128. package/es/components/atoms/Segmented/index.d.ts +1 -1
  129. package/es/components/atoms/Segmented/index.js +1 -1
  130. package/es/components/atoms/Skeleton/Skeleton.d.ts +8 -8
  131. package/es/components/atoms/Skeleton/Skeleton.js +2 -2
  132. package/es/components/atoms/Skeleton/index.d.ts +1 -1
  133. package/es/components/atoms/Skeleton/index.js +1 -1
  134. package/es/components/atoms/SlideBar/SlideBar.d.ts +34 -34
  135. package/es/components/atoms/SlideBar/SlideBar.js +283 -283
  136. package/es/components/atoms/SlideBar/constants.d.ts +10 -10
  137. package/es/components/atoms/SlideBar/constants.js +10 -10
  138. package/es/components/atoms/SlideBar/index.d.ts +1 -1
  139. package/es/components/atoms/SlideBar/index.js +1 -1
  140. package/es/components/atoms/SlideBar/styled.d.ts +20 -20
  141. package/es/components/atoms/SlideBar/styled.js +136 -136
  142. package/es/components/atoms/Slider/index.d.ts +6 -6
  143. package/es/components/atoms/Slider/index.js +30 -30
  144. package/es/components/atoms/Slider/styled.d.ts +7 -7
  145. package/es/components/atoms/Slider/styled.js +44 -44
  146. package/es/components/atoms/SliderV2/index.d.ts +6 -6
  147. package/es/components/atoms/SliderV2/index.js +21 -21
  148. package/es/components/atoms/Space/Space.d.ts +6 -6
  149. package/es/components/atoms/Space/Space.js +9 -9
  150. package/es/components/atoms/Space/index.d.ts +1 -1
  151. package/es/components/atoms/Space/index.js +1 -1
  152. package/es/components/atoms/Spin/Spin.d.ts +10 -10
  153. package/es/components/atoms/Spin/Spin.js +28 -28
  154. package/es/components/atoms/Spin/index.d.ts +1 -1
  155. package/es/components/atoms/Spin/index.js +1 -1
  156. package/es/components/atoms/Spin/styled.d.ts +1 -1
  157. package/es/components/atoms/Spin/styled.js +7 -7
  158. package/es/components/atoms/Statistic/Statistic.d.ts +1 -1
  159. package/es/components/atoms/Statistic/Statistic.js +2 -2
  160. package/es/components/atoms/Statistic/index.d.ts +1 -1
  161. package/es/components/atoms/Statistic/index.js +1 -1
  162. package/es/components/atoms/Steps/Steps.d.ts +4 -4
  163. package/es/components/atoms/Steps/Steps.js +2 -2
  164. package/es/components/atoms/Steps/index.d.ts +1 -1
  165. package/es/components/atoms/Steps/index.js +1 -1
  166. package/es/components/atoms/Switch/Switch.d.ts +2 -2
  167. package/es/components/atoms/Switch/Switch.js +2 -2
  168. package/es/components/atoms/Switch/index.d.ts +1 -1
  169. package/es/components/atoms/Switch/index.js +1 -1
  170. package/es/components/atoms/Tag/Tag.d.ts +1 -1
  171. package/es/components/atoms/Tag/Tag.js +1 -1
  172. package/es/components/atoms/Tag/index.d.ts +1 -1
  173. package/es/components/atoms/Tag/index.js +1 -1
  174. package/es/components/atoms/Text/index.d.ts +10 -10
  175. package/es/components/atoms/Text/index.js +27 -27
  176. package/es/components/atoms/Text/styled.d.ts +7 -7
  177. package/es/components/atoms/Text/styled.js +52 -52
  178. package/es/components/atoms/Timeline/Timeline.d.ts +4 -4
  179. package/es/components/atoms/Timeline/Timeline.js +2 -2
  180. package/es/components/atoms/Timeline/index.d.ts +1 -1
  181. package/es/components/atoms/Timeline/index.js +1 -1
  182. package/es/components/atoms/Tooltip/Tooltip.d.ts +1 -1
  183. package/es/components/atoms/Tooltip/Tooltip.js +1 -1
  184. package/es/components/atoms/Tooltip/index.d.ts +1 -1
  185. package/es/components/atoms/Tooltip/index.js +1 -1
  186. package/es/components/atoms/Typography/Text.d.ts +1 -1
  187. package/es/components/atoms/Typography/Text.js +1 -1
  188. package/es/components/atoms/Typography/index.d.ts +1 -1
  189. package/es/components/atoms/Typography/index.js +1 -1
  190. package/es/components/atoms/Watermark/Watermark.d.ts +2 -2
  191. package/es/components/atoms/Watermark/Watermark.js +2 -2
  192. package/es/components/atoms/Watermark/index.d.ts +1 -1
  193. package/es/components/atoms/Watermark/index.js +1 -1
  194. package/es/components/atoms/index.d.ts +42 -42
  195. package/es/components/atoms/index.js +39 -39
  196. package/es/components/common/ConfigProvider/ConfigProvider.d.ts +11 -11
  197. package/es/components/common/ConfigProvider/ConfigProvider.js +54 -54
  198. package/es/components/common/ConfigProvider/GlobalStyle.d.ts +5 -5
  199. package/es/components/common/ConfigProvider/GlobalStyle.js +782 -782
  200. package/es/components/common/ConfigProvider/index.d.ts +1 -1
  201. package/es/components/common/ConfigProvider/index.js +1 -1
  202. package/es/components/common/index.d.ts +1 -1
  203. package/es/components/common/index.js +1 -1
  204. package/es/components/icons/AccountCircle.d.ts +3 -3
  205. package/es/components/icons/AccountCircle.js +3 -3
  206. package/es/components/icons/AddShoppingCart.d.ts +3 -3
  207. package/es/components/icons/AddShoppingCart.js +3 -3
  208. package/es/components/icons/ArrowGrowIcon.d.ts +2 -2
  209. package/es/components/icons/ArrowGrowIcon.js +4 -4
  210. package/es/components/icons/AssignmentInd.d.ts +3 -3
  211. package/es/components/icons/AssignmentInd.js +3 -3
  212. package/es/components/icons/AudioRecordIcon.d.ts +2 -2
  213. package/es/components/icons/AudioRecordIcon.js +4 -4
  214. package/es/components/icons/BugIcon.d.ts +2 -2
  215. package/es/components/icons/BugIcon.js +4 -4
  216. package/es/components/icons/Call.d.ts +3 -3
  217. package/es/components/icons/Call.js +3 -3
  218. package/es/components/icons/CameraIcon.d.ts +2 -2
  219. package/es/components/icons/CameraIcon.js +4 -4
  220. package/es/components/icons/CaptureIcon.d.ts +2 -2
  221. package/es/components/icons/CaptureIcon.js +4 -4
  222. package/es/components/icons/Category.d.ts +3 -3
  223. package/es/components/icons/Category.js +5 -5
  224. package/es/components/icons/ChatBubbleOutline.d.ts +3 -3
  225. package/es/components/icons/ChatBubbleOutline.js +3 -3
  226. package/es/components/icons/CheckSlimIcon.d.ts +2 -2
  227. package/es/components/icons/CheckSlimIcon.js +4 -4
  228. package/es/components/icons/CircleNotifications.d.ts +3 -3
  229. package/es/components/icons/CircleNotifications.js +3 -3
  230. package/es/components/icons/CloseIcon.d.ts +4 -4
  231. package/es/components/icons/CloseIcon.js +22 -22
  232. package/es/components/icons/CommentIcon.d.ts +2 -2
  233. package/es/components/icons/CommentIcon.js +4 -4
  234. package/es/components/icons/ConfirmationNumber.d.ts +3 -3
  235. package/es/components/icons/ConfirmationNumber.js +3 -3
  236. package/es/components/icons/DesktopWindows.d.ts +3 -3
  237. package/es/components/icons/DesktopWindows.js +3 -3
  238. package/es/components/icons/EventIcon.d.ts +4 -4
  239. package/es/components/icons/EventIcon.js +18 -18
  240. package/es/components/icons/FactCheck.d.ts +3 -3
  241. package/es/components/icons/FactCheck.js +3 -3
  242. package/es/components/icons/FreeDrawIcon.d.ts +2 -2
  243. package/es/components/icons/FreeDrawIcon.js +4 -4
  244. package/es/components/icons/GPTIcon.d.ts +2 -2
  245. package/es/components/icons/GPTIcon.js +18 -18
  246. package/es/components/icons/GPTIconV2.d.ts +2 -2
  247. package/es/components/icons/GPTIconV2.js +18 -18
  248. package/es/components/icons/GPTIconV3.d.ts +2 -2
  249. package/es/components/icons/GPTIconV3.js +5 -5
  250. package/es/components/icons/HighlightIcon.d.ts +2 -2
  251. package/es/components/icons/HighlightIcon.js +4 -4
  252. package/es/components/icons/HightlightAlt.d.ts +3 -3
  253. package/es/components/icons/HightlightAlt.js +3 -3
  254. package/es/components/icons/HowToReg.d.ts +3 -3
  255. package/es/components/icons/HowToReg.js +3 -3
  256. package/es/components/icons/IdeaIcon.d.ts +2 -2
  257. package/es/components/icons/IdeaIcon.js +4 -4
  258. package/es/components/icons/Interactive.d.ts +3 -3
  259. package/es/components/icons/Interactive.js +3 -3
  260. package/es/components/icons/InvisibleIcon.d.ts +2 -2
  261. package/es/components/icons/InvisibleIcon.js +5 -5
  262. package/es/components/icons/List.d.ts +3 -3
  263. package/es/components/icons/List.js +3 -3
  264. package/es/components/icons/LocalMallIcon.d.ts +3 -3
  265. package/es/components/icons/LocalMallIcon.js +3 -3
  266. package/es/components/icons/MobileFriendly.d.ts +3 -3
  267. package/es/components/icons/MobileFriendly.js +3 -3
  268. package/es/components/icons/MuteIcon.d.ts +2 -2
  269. package/es/components/icons/MuteIcon.js +4 -4
  270. package/es/components/icons/NotificationsActive.d.ts +3 -3
  271. package/es/components/icons/NotificationsActive.js +3 -3
  272. package/es/components/icons/OpenUrlIcon.d.ts +2 -2
  273. package/es/components/icons/OpenUrlIcon.js +4 -4
  274. package/es/components/icons/PauseIcon.d.ts +2 -2
  275. package/es/components/icons/PauseIcon.js +4 -4
  276. package/es/components/icons/Payment.d.ts +3 -3
  277. package/es/components/icons/Payment.js +3 -3
  278. package/es/components/icons/PersonAddDisabled.d.ts +3 -3
  279. package/es/components/icons/PersonAddDisabled.js +4 -4
  280. package/es/components/icons/PhoneCallback.d.ts +3 -3
  281. package/es/components/icons/PhoneCallback.js +3 -3
  282. package/es/components/icons/PlaneIcon.d.ts +2 -2
  283. package/es/components/icons/PlaneIcon.js +8 -8
  284. package/es/components/icons/Preview.d.ts +3 -3
  285. package/es/components/icons/Preview.js +3 -3
  286. package/es/components/icons/Redeem.d.ts +3 -3
  287. package/es/components/icons/Redeem.js +3 -3
  288. package/es/components/icons/RemoveRedEye.d.ts +3 -3
  289. package/es/components/icons/RemoveRedEye.js +3 -3
  290. package/es/components/icons/RemoveShoppingCart.d.ts +3 -3
  291. package/es/components/icons/RemoveShoppingCart.js +3 -3
  292. package/es/components/icons/RequestIcon.d.ts +2 -2
  293. package/es/components/icons/RequestIcon.js +4 -4
  294. package/es/components/icons/Search.d.ts +3 -3
  295. package/es/components/icons/Search.js +3 -3
  296. package/es/components/icons/ShoppingBag.d.ts +3 -3
  297. package/es/components/icons/ShoppingBag.js +3 -3
  298. package/es/components/icons/ShoppingCart.d.ts +3 -3
  299. package/es/components/icons/ShoppingCart.js +3 -3
  300. package/es/components/icons/StopRecordIcon.d.ts +2 -2
  301. package/es/components/icons/StopRecordIcon.js +4 -4
  302. package/es/components/icons/Store.d.ts +3 -3
  303. package/es/components/icons/Store.js +3 -3
  304. package/es/components/icons/UserIcon.d.ts +2 -2
  305. package/es/components/icons/UserIcon.js +8 -8
  306. package/es/components/icons/VerticalDotsIcon.d.ts +2 -2
  307. package/es/components/icons/VerticalDotsIcon.js +4 -4
  308. package/es/components/icons/WarningIcon.d.ts +2 -2
  309. package/es/components/icons/WarningIcon.js +4 -4
  310. package/es/components/icons/Web.d.ts +3 -3
  311. package/es/components/icons/Web.js +3 -3
  312. package/es/components/icons/WebAsset.d.ts +3 -3
  313. package/es/components/icons/WebAsset.js +3 -3
  314. package/es/components/icons/index.d.ts +54 -54
  315. package/es/components/icons/index.js +54 -54
  316. package/es/components/icons/type.d.ts +3 -3
  317. package/es/components/icons/type.js +1 -1
  318. package/es/components/index.d.ts +5 -5
  319. package/es/components/index.js +5 -5
  320. package/es/components/molecules/AddDynamicContent/AddDynamicContent.d.ts +35 -35
  321. package/es/components/molecules/AddDynamicContent/AddDynamicContent.js +1248 -1248
  322. package/es/components/molecules/AddDynamicContent/components/DisplayFormat/DisplayFormat.d.ts +12 -12
  323. package/es/components/molecules/AddDynamicContent/components/DisplayFormat/DisplayFormat.js +25 -25
  324. package/es/components/molecules/AddDynamicContent/components/DisplayFormat/index.d.ts +3 -3
  325. package/es/components/molecules/AddDynamicContent/components/DisplayFormat/index.js +3 -3
  326. package/es/components/molecules/AddDynamicContent/components/FormatDatetime/FormatDatetime.d.ts +19 -19
  327. package/es/components/molecules/AddDynamicContent/components/FormatDatetime/FormatDatetime.js +100 -100
  328. package/es/components/molecules/AddDynamicContent/components/FormatDatetime/index.d.ts +1 -1
  329. package/es/components/molecules/AddDynamicContent/components/FormatDatetime/index.js +1 -1
  330. package/es/components/molecules/AddDynamicContent/components/FormatNumber/FormatNumber.d.ts +52 -52
  331. package/es/components/molecules/AddDynamicContent/components/FormatNumber/FormatNumber.js +132 -132
  332. package/es/components/molecules/AddDynamicContent/components/FormatNumber/index.d.ts +1 -1
  333. package/es/components/molecules/AddDynamicContent/components/FormatNumber/index.js +1 -1
  334. package/es/components/molecules/AddDynamicContent/components/index.d.ts +3 -3
  335. package/es/components/molecules/AddDynamicContent/components/index.js +3 -3
  336. package/es/components/molecules/AddDynamicContent/constants.d.ts +101 -101
  337. package/es/components/molecules/AddDynamicContent/constants.js +152 -152
  338. package/es/components/molecules/AddDynamicContent/currencies.json +1523 -1523
  339. package/es/components/molecules/AddDynamicContent/index.d.ts +2 -2
  340. package/es/components/molecules/AddDynamicContent/index.js +2 -2
  341. package/es/components/molecules/AddDynamicContent/styled.d.ts +12 -12
  342. package/es/components/molecules/AddDynamicContent/styled.js +30 -30
  343. package/es/components/molecules/AddDynamicContent/types.d.ts +13 -13
  344. package/es/components/molecules/AddDynamicContent/types.js +1 -1
  345. package/es/components/molecules/AddDynamicContent/utils.d.ts +41 -41
  346. package/es/components/molecules/AddDynamicContent/utils.js +396 -396
  347. package/es/components/molecules/AlignSetting/index.d.ts +19 -19
  348. package/es/components/molecules/AlignSetting/index.js +52 -52
  349. package/es/components/molecules/AlignSetting/styled.d.ts +1 -1
  350. package/es/components/molecules/AlignSetting/styled.js +7 -7
  351. package/es/components/molecules/AlignSetting/utils.d.ts +3 -3
  352. package/es/components/molecules/AlignSetting/utils.js +19 -19
  353. package/es/components/molecules/CalendarSelection/CalendarSelection.d.ts +3 -3
  354. package/es/components/molecules/CalendarSelection/CalendarSelection.js +45 -45
  355. package/es/components/molecules/CalendarSelection/actions.d.ts +55 -55
  356. package/es/components/molecules/CalendarSelection/actions.js +39 -39
  357. package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/AutoUpdateTo.d.ts +7 -7
  358. package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/AutoUpdateTo.js +24 -24
  359. package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/index.d.ts +1 -1
  360. package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/index.js +1 -1
  361. package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/styled.d.ts +1 -1
  362. package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/styled.js +10 -10
  363. package/es/components/molecules/CalendarSelection/components/CustomPicker/CustomPicker.d.ts +3 -3
  364. package/es/components/molecules/CalendarSelection/components/CustomPicker/CustomPicker.js +89 -89
  365. package/es/components/molecules/CalendarSelection/components/CustomPicker/index.d.ts +1 -1
  366. package/es/components/molecules/CalendarSelection/components/CustomPicker/index.js +1 -1
  367. package/es/components/molecules/CalendarSelection/components/CustomPicker/styled.d.ts +6 -6
  368. package/es/components/molecules/CalendarSelection/components/CustomPicker/styled.js +141 -141
  369. package/es/components/molecules/CalendarSelection/components/CustomPicker/types.d.ts +1 -1
  370. package/es/components/molecules/CalendarSelection/components/CustomPicker/types.js +1 -1
  371. package/es/components/molecules/CalendarSelection/components/Footer/Footer.d.ts +2 -2
  372. package/es/components/molecules/CalendarSelection/components/Footer/Footer.js +11 -11
  373. package/es/components/molecules/CalendarSelection/components/Footer/index.d.ts +1 -1
  374. package/es/components/molecules/CalendarSelection/components/Footer/index.js +1 -1
  375. package/es/components/molecules/CalendarSelection/components/Footer/styled.d.ts +1 -1
  376. package/es/components/molecules/CalendarSelection/components/Footer/styled.js +6 -6
  377. package/es/components/molecules/CalendarSelection/components/RangePicker/RangePicker.d.ts +5 -5
  378. package/es/components/molecules/CalendarSelection/components/RangePicker/RangePicker.js +4 -4
  379. package/es/components/molecules/CalendarSelection/components/RangePicker/index.d.ts +1 -1
  380. package/es/components/molecules/CalendarSelection/components/RangePicker/index.js +1 -1
  381. package/es/components/molecules/CalendarSelection/components/RangePicker/styled.d.ts +5 -5
  382. package/es/components/molecules/CalendarSelection/components/RangePicker/styled.js +13 -13
  383. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/RangeSelectOptions.d.ts +3 -3
  384. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/RangeSelectOptions.js +23 -23
  385. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/NumOfDaysRanges/NumOfDaysRanges.d.ts +2 -2
  386. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/NumOfDaysRanges/NumOfDaysRanges.js +41 -41
  387. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/NumOfDaysRanges/index.d.ts +1 -1
  388. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/NumOfDaysRanges/index.js +1 -1
  389. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/Option.d.ts +11 -11
  390. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/Option.js +40 -40
  391. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/index.d.ts +1 -1
  392. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/index.js +1 -1
  393. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/styled.d.ts +1 -1
  394. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/styled.js +29 -29
  395. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/index.d.ts +2 -2
  396. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/index.js +2 -2
  397. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/index.d.ts +1 -1
  398. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/index.js +1 -1
  399. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/styled.d.ts +3 -3
  400. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/styled.js +34 -34
  401. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/types.d.ts +1 -1
  402. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/types.js +1 -1
  403. package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/TimeRangeDisplay.d.ts +5 -5
  404. package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/TimeRangeDisplay.js +45 -45
  405. package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/index.d.ts +2 -2
  406. package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/index.js +2 -2
  407. package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/styled.d.ts +1 -1
  408. package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/styled.js +70 -70
  409. package/es/components/molecules/CalendarSelection/components/index.d.ts +5 -5
  410. package/es/components/molecules/CalendarSelection/components/index.js +5 -5
  411. package/es/components/molecules/CalendarSelection/constants.d.ts +97 -97
  412. package/es/components/molecules/CalendarSelection/constants.js +183 -183
  413. package/es/components/molecules/CalendarSelection/context.d.ts +4 -4
  414. package/es/components/molecules/CalendarSelection/context.js +6 -6
  415. package/es/components/molecules/CalendarSelection/hooks/index.d.ts +2 -2
  416. package/es/components/molecules/CalendarSelection/hooks/index.js +2 -2
  417. package/es/components/molecules/CalendarSelection/hooks/useStateContext.d.ts +4 -4
  418. package/es/components/molecules/CalendarSelection/hooks/useStateContext.js +13 -13
  419. package/es/components/molecules/CalendarSelection/hooks/useTriggerOut.d.ts +9 -9
  420. package/es/components/molecules/CalendarSelection/hooks/useTriggerOut.js +19 -19
  421. package/es/components/molecules/CalendarSelection/index.d.ts +25 -25
  422. package/es/components/molecules/CalendarSelection/index.js +6 -6
  423. package/es/components/molecules/CalendarSelection/reducer.d.ts +3 -3
  424. package/es/components/molecules/CalendarSelection/reducer.js +121 -121
  425. package/es/components/molecules/CalendarSelection/styled.d.ts +5 -5
  426. package/es/components/molecules/CalendarSelection/styled.js +10 -10
  427. package/es/components/molecules/CalendarSelection/types.d.ts +98 -98
  428. package/es/components/molecules/CalendarSelection/types.js +1 -1
  429. package/es/components/molecules/CalendarSelection/utils.d.ts +48 -48
  430. package/es/components/molecules/CalendarSelection/utils.js +300 -300
  431. package/es/components/molecules/CaptureScreen/CaptureScreen.d.ts +16 -16
  432. package/es/components/molecules/CaptureScreen/CaptureScreen.js +834 -834
  433. package/es/components/molecules/CaptureScreen/components/CommentBox/CommentBox.d.ts +17 -17
  434. package/es/components/molecules/CaptureScreen/components/CommentBox/CommentBox.js +80 -80
  435. package/es/components/molecules/CaptureScreen/components/CommentBox/index.d.ts +1 -1
  436. package/es/components/molecules/CaptureScreen/components/CommentBox/index.js +1 -1
  437. package/es/components/molecules/CaptureScreen/components/CommentBox/styled.d.ts +12 -12
  438. package/es/components/molecules/CaptureScreen/components/CommentBox/styled.js +136 -136
  439. package/es/components/molecules/CaptureScreen/components/CommentBox/types.d.ts +15 -15
  440. package/es/components/molecules/CaptureScreen/components/CommentBox/types.js +1 -1
  441. package/es/components/molecules/CaptureScreen/components/Cursor/Cursor.d.ts +4 -4
  442. package/es/components/molecules/CaptureScreen/components/Cursor/Cursor.js +17 -17
  443. package/es/components/molecules/CaptureScreen/components/Cursor/index.d.ts +1 -1
  444. package/es/components/molecules/CaptureScreen/components/Cursor/index.js +1 -1
  445. package/es/components/molecules/CaptureScreen/components/Cursor/styled.d.ts +7 -7
  446. package/es/components/molecules/CaptureScreen/components/Cursor/styled.js +79 -79
  447. package/es/components/molecules/CaptureScreen/components/Cursor/types.d.ts +10 -10
  448. package/es/components/molecules/CaptureScreen/components/Cursor/types.js +1 -1
  449. package/es/components/molecules/CaptureScreen/constants.d.ts +41 -41
  450. package/es/components/molecules/CaptureScreen/constants.js +118 -118
  451. package/es/components/molecules/CaptureScreen/hooks/useImageEditor.d.ts +5 -5
  452. package/es/components/molecules/CaptureScreen/hooks/useImageEditor.js +103 -103
  453. package/es/components/molecules/CaptureScreen/index.d.ts +1 -1
  454. package/es/components/molecules/CaptureScreen/index.js +1 -1
  455. package/es/components/molecules/CaptureScreen/styled.d.ts +26 -26
  456. package/es/components/molecules/CaptureScreen/styled.js +255 -255
  457. package/es/components/molecules/CaptureScreen/themes/black.d.ts +54 -54
  458. package/es/components/molecules/CaptureScreen/themes/black.js +64 -64
  459. package/es/components/molecules/CaptureScreen/themes/white.d.ts +54 -54
  460. package/es/components/molecules/CaptureScreen/themes/white.js +64 -64
  461. package/es/components/molecules/CaptureScreen/types.d.ts +108 -108
  462. package/es/components/molecules/CaptureScreen/types.js +1 -1
  463. package/es/components/molecules/CaptureScreen/utils.d.ts +13 -13
  464. package/es/components/molecules/CaptureScreen/utils.js +62 -62
  465. package/es/components/molecules/Card/Card.d.ts +1 -1
  466. package/es/components/molecules/Card/Card.js +2 -2
  467. package/es/components/molecules/Card/index.d.ts +1 -1
  468. package/es/components/molecules/Card/index.js +1 -1
  469. package/es/components/molecules/Cascader/Cascader.d.ts +1 -1
  470. package/es/components/molecules/Cascader/Cascader.js +1 -1
  471. package/es/components/molecules/Cascader/index.d.ts +1 -1
  472. package/es/components/molecules/Cascader/index.js +1 -1
  473. package/es/components/molecules/ChatBox/ChatBox.d.ts +3 -3
  474. package/es/components/molecules/ChatBox/ChatBox.js +188 -188
  475. package/es/components/molecules/ChatBox/MessageItem.d.ts +5 -5
  476. package/es/components/molecules/ChatBox/MessageItem.js +66 -66
  477. package/es/components/molecules/ChatBox/constants.d.ts +6 -6
  478. package/es/components/molecules/ChatBox/constants.js +51 -51
  479. package/es/components/molecules/ChatBox/index.d.ts +1 -1
  480. package/es/components/molecules/ChatBox/index.js +1 -1
  481. package/es/components/molecules/ChatBox/styled.d.ts +10 -10
  482. package/es/components/molecules/ChatBox/styled.js +280 -280
  483. package/es/components/molecules/ChatBox/types.d.ts +32 -32
  484. package/es/components/molecules/ChatBox/types.js +1 -1
  485. package/es/components/molecules/Collapse/Collapse.d.ts +4 -4
  486. package/es/components/molecules/Collapse/Collapse.js +11 -11
  487. package/es/components/molecules/Collapse/index.d.ts +1 -1
  488. package/es/components/molecules/Collapse/index.js +1 -1
  489. package/es/components/molecules/ColorPicker/ChromePicker/index.d.ts +1 -1
  490. package/es/components/molecules/ColorPicker/ChromePicker/index.js +3 -3
  491. package/es/components/molecules/ColorPicker/ChromePicker/styled.d.ts +1 -1
  492. package/es/components/molecules/ColorPicker/ChromePicker/styled.js +15 -15
  493. package/es/components/molecules/ColorPicker/CustomPicker/index.d.ts +2 -2
  494. package/es/components/molecules/ColorPicker/CustomPicker/index.js +117 -117
  495. package/es/components/molecules/ColorPicker/CustomPicker/styled.d.ts +9 -9
  496. package/es/components/molecules/ColorPicker/CustomPicker/styled.js +104 -104
  497. package/es/components/molecules/ColorPicker/SketchPicker/index.d.ts +10 -10
  498. package/es/components/molecules/ColorPicker/SketchPicker/index.js +5 -5
  499. package/es/components/molecules/ColorPicker/SketchPicker/styled.d.ts +1 -1
  500. package/es/components/molecules/ColorPicker/SketchPicker/styled.js +10 -10
  501. package/es/components/molecules/ColorPicker/index.d.ts +14 -14
  502. package/es/components/molecules/ColorPicker/index.js +96 -96
  503. package/es/components/molecules/ColorPicker/styled.d.ts +1 -1
  504. package/es/components/molecules/ColorPicker/styled.js +10 -10
  505. package/es/components/molecules/ColorSetting/index.d.ts +14 -14
  506. package/es/components/molecules/ColorSetting/index.js +97 -97
  507. package/es/components/molecules/ColorSetting/styled.d.ts +7 -7
  508. package/es/components/molecules/ColorSetting/styled.js +42 -42
  509. package/es/components/molecules/DatePicker/DatePicker.d.ts +8 -8
  510. package/es/components/molecules/DatePicker/DatePicker.js +8 -8
  511. package/es/components/molecules/DatePicker/components/AdvancedPicker/AdvancedPicker.d.ts +32 -32
  512. package/es/components/molecules/DatePicker/components/AdvancedPicker/AdvancedPicker.js +439 -439
  513. package/es/components/molecules/DatePicker/components/AdvancedPicker/constants.d.ts +106 -106
  514. package/es/components/molecules/DatePicker/components/AdvancedPicker/constants.js +197 -197
  515. package/es/components/molecules/DatePicker/components/AdvancedPicker/index.d.ts +3 -3
  516. package/es/components/molecules/DatePicker/components/AdvancedPicker/index.js +1 -1
  517. package/es/components/molecules/DatePicker/components/AdvancedPicker/styled.d.ts +9 -9
  518. package/es/components/molecules/DatePicker/components/AdvancedPicker/styled.js +100 -100
  519. package/es/components/molecules/DatePicker/components/AdvancedPicker/types.d.ts +36 -36
  520. package/es/components/molecules/DatePicker/components/AdvancedPicker/types.js +1 -1
  521. package/es/components/molecules/DatePicker/components/AdvancedPicker/utils.d.ts +39 -39
  522. package/es/components/molecules/DatePicker/components/AdvancedPicker/utils.js +211 -211
  523. package/es/components/molecules/DatePicker/components/AdvancedRangePicker/AdvancedRangePicker.d.ts +18 -18
  524. package/es/components/molecules/DatePicker/components/AdvancedRangePicker/AdvancedRangePicker.js +83 -83
  525. package/es/components/molecules/DatePicker/components/AdvancedRangePicker/constants.d.ts +5 -5
  526. package/es/components/molecules/DatePicker/components/AdvancedRangePicker/constants.js +5 -5
  527. package/es/components/molecules/DatePicker/components/AdvancedRangePicker/index.d.ts +2 -2
  528. package/es/components/molecules/DatePicker/components/AdvancedRangePicker/index.js +1 -1
  529. package/es/components/molecules/DatePicker/components/AdvancedRangePicker/types.d.ts +18 -18
  530. package/es/components/molecules/DatePicker/components/AdvancedRangePicker/types.js +1 -1
  531. package/es/components/molecules/DatePicker/components/DropdownLabel/DropdownLabel.d.ts +13 -13
  532. package/es/components/molecules/DatePicker/components/DropdownLabel/DropdownLabel.js +87 -87
  533. package/es/components/molecules/DatePicker/components/ErrorMessage/ErrorMessage.d.ts +6 -6
  534. package/es/components/molecules/DatePicker/components/ErrorMessage/ErrorMessage.js +12 -12
  535. package/es/components/molecules/DatePicker/index.d.ts +3 -3
  536. package/es/components/molecules/DatePicker/index.js +1 -1
  537. package/es/components/molecules/Drawer/Drawer.d.ts +5 -5
  538. package/es/components/molecules/Drawer/Drawer.js +4 -4
  539. package/es/components/molecules/Drawer/index.d.ts +2 -2
  540. package/es/components/molecules/Drawer/index.js +1 -1
  541. package/es/components/molecules/Dropdown/Dropdown.d.ts +1 -1
  542. package/es/components/molecules/Dropdown/Dropdown.js +1 -1
  543. package/es/components/molecules/Dropdown/index.d.ts +1 -1
  544. package/es/components/molecules/Dropdown/index.js +1 -1
  545. package/es/components/molecules/EdgeSetting/index.d.ts +39 -39
  546. package/es/components/molecules/EdgeSetting/index.js +192 -192
  547. package/es/components/molecules/EdgeSetting/styled.d.ts +3 -3
  548. package/es/components/molecules/EdgeSetting/styled.js +18 -18
  549. package/es/components/molecules/EditorScript/EditorScript.d.ts +25 -14
  550. package/es/components/molecules/EditorScript/EditorScript.js +89 -89
  551. package/es/components/molecules/EditorScript/index.d.ts +1 -1
  552. package/es/components/molecules/EditorScript/index.js +1 -1
  553. package/es/components/molecules/EditorScript/styled.d.ts +1 -1
  554. package/es/components/molecules/EditorScript/styled.js +3 -3
  555. package/es/components/molecules/FontFamilySelect/constants.d.ts +307 -307
  556. package/es/components/molecules/FontFamilySelect/constants.js +257 -257
  557. package/es/components/molecules/FontFamilySelect/index.d.ts +17 -17
  558. package/es/components/molecules/FontFamilySelect/index.js +53 -53
  559. package/es/components/molecules/FontSetting/constants.d.ts +3 -3
  560. package/es/components/molecules/FontSetting/constants.js +22 -22
  561. package/es/components/molecules/FontSetting/index.d.ts +24 -24
  562. package/es/components/molecules/FontSetting/index.js +54 -54
  563. package/es/components/molecules/FontSetting/types.d.ts +22 -22
  564. package/es/components/molecules/FontSetting/types.js +1 -1
  565. package/es/components/molecules/FontWeightSelect/constants.d.ts +28 -28
  566. package/es/components/molecules/FontWeightSelect/constants.js +11 -11
  567. package/es/components/molecules/FontWeightSelect/index.d.ts +9 -9
  568. package/es/components/molecules/FontWeightSelect/index.js +39 -39
  569. package/es/components/molecules/Form/Form.d.ts +1 -1
  570. package/es/components/molecules/Form/Form.js +1 -1
  571. package/es/components/molecules/Form/index.d.ts +1 -1
  572. package/es/components/molecules/Form/index.js +1 -1
  573. package/es/components/molecules/GradientSetting/index.d.ts +36 -36
  574. package/es/components/molecules/GradientSetting/index.js +99 -99
  575. package/es/components/molecules/GradientSetting/styled.d.ts +1 -1
  576. package/es/components/molecules/GradientSetting/styled.js +59 -59
  577. package/es/components/molecules/IconSelection/components/Icon/index.d.ts +10 -10
  578. package/es/components/molecules/IconSelection/components/Icon/index.js +28 -28
  579. package/es/components/molecules/IconSelection/constants.d.ts +56 -56
  580. package/es/components/molecules/IconSelection/constants.js +89 -89
  581. package/es/components/molecules/IconSelection/index.d.ts +3 -3
  582. package/es/components/molecules/IconSelection/index.js +143 -143
  583. package/es/components/molecules/IconSelection/styled.d.ts +8 -8
  584. package/es/components/molecules/IconSelection/styled.js +80 -80
  585. package/es/components/molecules/IconSelection/types.d.ts +26 -26
  586. package/es/components/molecules/IconSelection/types.js +2 -2
  587. package/es/components/molecules/IconSelection/utils.d.ts +4 -4
  588. package/es/components/molecules/IconSelection/utils.js +13 -13
  589. package/es/components/molecules/InputNumber/index.d.ts +9 -9
  590. package/es/components/molecules/InputNumber/index.js +81 -81
  591. package/es/components/molecules/InputNumberWithUnit/index.d.ts +31 -31
  592. package/es/components/molecules/InputNumberWithUnit/index.js +37 -37
  593. package/es/components/molecules/InputNumberWithUnit/styled.d.ts +1 -1
  594. package/es/components/molecules/InputNumberWithUnit/styled.js +20 -20
  595. package/es/components/molecules/InputSearch/index.d.ts +7 -7
  596. package/es/components/molecules/InputSearch/index.js +23 -23
  597. package/es/components/molecules/InputSearch/styled.d.ts +1 -1
  598. package/es/components/molecules/InputSearch/styled.js +48 -48
  599. package/es/components/molecules/Modal/Modal.d.ts +23 -23
  600. package/es/components/molecules/Modal/Modal.js +26 -26
  601. package/es/components/molecules/Modal/index.d.ts +2 -2
  602. package/es/components/molecules/Modal/index.js +1 -1
  603. package/es/components/molecules/Modal/styled.d.ts +15 -15
  604. package/es/components/molecules/Modal/styled.js +80 -80
  605. package/es/components/molecules/ModalV2/ModalV2.d.ts +5 -5
  606. package/es/components/molecules/ModalV2/ModalV2.js +26 -26
  607. package/es/components/molecules/ModalV2/index.d.ts +2 -2
  608. package/es/components/molecules/ModalV2/index.js +1 -1
  609. package/es/components/molecules/ModalV2/styled.d.ts +7 -7
  610. package/es/components/molecules/ModalV2/styled.js +22 -22
  611. package/es/components/molecules/Popconfirm/Popconfirm.d.ts +4 -4
  612. package/es/components/molecules/Popconfirm/Popconfirm.js +2 -2
  613. package/es/components/molecules/Popconfirm/index.d.ts +1 -1
  614. package/es/components/molecules/Popconfirm/index.js +1 -1
  615. package/es/components/molecules/PopupDraggable/PopupDraggable.d.ts +6 -6
  616. package/es/components/molecules/PopupDraggable/PopupDraggable.js +52 -52
  617. package/es/components/molecules/PopupDraggable/index.d.ts +1 -1
  618. package/es/components/molecules/PopupDraggable/index.js +1 -1
  619. package/es/components/molecules/PopupDraggable/styled.d.ts +5 -5
  620. package/es/components/molecules/PopupDraggable/styled.js +52 -52
  621. package/es/components/molecules/PopupDraggable/types.d.ts +15 -15
  622. package/es/components/molecules/PopupDraggable/types.js +1 -1
  623. package/es/components/molecules/PreviewModal/PreviewModal.d.ts +7 -7
  624. package/es/components/molecules/PreviewModal/PreviewModal.js +30 -30
  625. package/es/components/molecules/PreviewModal/index.d.ts +2 -2
  626. package/es/components/molecules/PreviewModal/index.js +1 -1
  627. package/es/components/molecules/PreviewModal/styled.d.ts +4 -4
  628. package/es/components/molecules/PreviewModal/styled.js +39 -39
  629. package/es/components/molecules/RadioGroup/index.d.ts +7 -7
  630. package/es/components/molecules/RadioGroup/index.js +23 -23
  631. package/es/components/molecules/RadioGroup/styled.d.ts +3 -3
  632. package/es/components/molecules/RadioGroup/styled.js +14 -14
  633. package/es/components/molecules/ResizeGrid/ResizeGrid.d.ts +3 -3
  634. package/es/components/molecules/ResizeGrid/ResizeGrid.js +736 -736
  635. package/es/components/molecules/ResizeGrid/components/Cell/Cell.d.ts +3 -3
  636. package/es/components/molecules/ResizeGrid/components/Cell/Cell.js +87 -87
  637. package/es/components/molecules/ResizeGrid/components/Cell/index.d.ts +1 -1
  638. package/es/components/molecules/ResizeGrid/components/Cell/index.js +1 -1
  639. package/es/components/molecules/ResizeGrid/components/Cell/styled.d.ts +3 -3
  640. package/es/components/molecules/ResizeGrid/components/Cell/styled.js +80 -80
  641. package/es/components/molecules/ResizeGrid/constant.d.ts +35 -35
  642. package/es/components/molecules/ResizeGrid/constant.js +111 -111
  643. package/es/components/molecules/ResizeGrid/index.d.ts +2 -2
  644. package/es/components/molecules/ResizeGrid/index.js +1 -1
  645. package/es/components/molecules/ResizeGrid/styled.d.ts +10 -10
  646. package/es/components/molecules/ResizeGrid/styled.js +56 -56
  647. package/es/components/molecules/ResizeGrid/types.d.ts +148 -148
  648. package/es/components/molecules/ResizeGrid/types.js +1 -1
  649. package/es/components/molecules/Result/Result.d.ts +1 -1
  650. package/es/components/molecules/Result/Result.js +2 -2
  651. package/es/components/molecules/Result/index.d.ts +1 -1
  652. package/es/components/molecules/Result/index.js +1 -1
  653. package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuBlock.d.ts +14 -14
  654. package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuBlock.js +53 -53
  655. package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/index.d.ts +18 -18
  656. package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/index.js +110 -110
  657. package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/styled.d.ts +20 -20
  658. package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/styled.js +135 -135
  659. package/es/components/molecules/RichMenu/RichMenuBlock/constants.d.ts +2 -2
  660. package/es/components/molecules/RichMenu/RichMenuBlock/constants.js +765 -765
  661. package/es/components/molecules/RichMenu/RichMenuBlock/index.d.ts +3 -3
  662. package/es/components/molecules/RichMenu/RichMenuBlock/index.js +2 -2
  663. package/es/components/molecules/RichMenu/RichMenuBlock/styled.d.ts +9 -9
  664. package/es/components/molecules/RichMenu/RichMenuBlock/styled.js +17 -17
  665. package/es/components/molecules/RichMenu/RichMenuChatBar/RichMenuChatBar.d.ts +10 -10
  666. package/es/components/molecules/RichMenu/RichMenuChatBar/RichMenuChatBar.js +32 -32
  667. package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/index.d.ts +6 -6
  668. package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/index.js +15 -15
  669. package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/styled.d.ts +4 -4
  670. package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/styled.js +47 -47
  671. package/es/components/molecules/RichMenu/RichMenuChatBar/index.d.ts +2 -2
  672. package/es/components/molecules/RichMenu/RichMenuChatBar/index.js +1 -1
  673. package/es/components/molecules/RichMenu/RichMenuChatBar/styled.d.ts +9 -9
  674. package/es/components/molecules/RichMenu/RichMenuChatBar/styled.js +37 -37
  675. package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.d.ts +11 -11
  676. package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.js +37 -37
  677. package/es/components/molecules/RichMenu/RichMenuMobileView/index.d.ts +1 -1
  678. package/es/components/molecules/RichMenu/RichMenuMobileView/index.js +1 -1
  679. package/es/components/molecules/RichMenu/RichMenuMobileView/styled.d.ts +6 -6
  680. package/es/components/molecules/RichMenu/RichMenuMobileView/styled.js +20 -20
  681. package/es/components/molecules/RichMenu/index.d.ts +3 -3
  682. package/es/components/molecules/RichMenu/index.js +3 -3
  683. package/es/components/molecules/Select/Select.d.ts +17 -17
  684. package/es/components/molecules/Select/Select.js +50 -50
  685. package/es/components/molecules/Select/Test.d.ts +3 -3
  686. package/es/components/molecules/Select/Test.js +22 -22
  687. package/es/components/molecules/Select/index.d.ts +2 -2
  688. package/es/components/molecules/Select/index.js +1 -1
  689. package/es/components/molecules/Select/styled.d.ts +4 -4
  690. package/es/components/molecules/Select/styled.js +41 -41
  691. package/es/components/molecules/SettingWrapper/index.d.ts +12 -12
  692. package/es/components/molecules/SettingWrapper/index.js +20 -20
  693. package/es/components/molecules/SettingWrapper/styled.d.ts +5 -5
  694. package/es/components/molecules/SettingWrapper/styled.js +17 -17
  695. package/es/components/molecules/SettingWrapperPopover/index.d.ts +16 -16
  696. package/es/components/molecules/SettingWrapperPopover/index.js +17 -17
  697. package/es/components/molecules/ShareAccess/ShareAccess.d.ts +3 -3
  698. package/es/components/molecules/ShareAccess/ShareAccess.js +23 -23
  699. package/es/components/molecules/ShareAccess/actions.d.ts +16 -16
  700. package/es/components/molecules/ShareAccess/actions.js +12 -12
  701. package/es/components/molecules/ShareAccess/components/GeneralAccess/GeneralAccess.d.ts +2 -2
  702. package/es/components/molecules/ShareAccess/components/GeneralAccess/GeneralAccess.js +78 -78
  703. package/es/components/molecules/ShareAccess/components/GeneralAccess/index.d.ts +1 -1
  704. package/es/components/molecules/ShareAccess/components/GeneralAccess/index.js +1 -1
  705. package/es/components/molecules/ShareAccess/components/GeneralAccess/styled.d.ts +1 -1
  706. package/es/components/molecules/ShareAccess/components/GeneralAccess/styled.js +57 -57
  707. package/es/components/molecules/ShareAccess/components/LayoutContent/LayoutContent.d.ts +3 -3
  708. package/es/components/molecules/ShareAccess/components/LayoutContent/LayoutContent.js +19 -19
  709. package/es/components/molecules/ShareAccess/components/LayoutContent/index.d.ts +1 -1
  710. package/es/components/molecules/ShareAccess/components/LayoutContent/index.js +1 -1
  711. package/es/components/molecules/ShareAccess/components/LayoutContent/styled.d.ts +1 -1
  712. package/es/components/molecules/ShareAccess/components/LayoutContent/styled.js +7 -7
  713. package/es/components/molecules/ShareAccess/components/ModalTransferOwnerShip/ModalTransferOwnerShip.d.ts +2 -2
  714. package/es/components/molecules/ShareAccess/components/ModalTransferOwnerShip/ModalTransferOwnerShip.js +43 -43
  715. package/es/components/molecules/ShareAccess/components/ModalTransferOwnerShip/index.js +1 -1
  716. package/es/components/molecules/ShareAccess/components/ModalTransferOwnerShip/styled.d.ts +7 -7
  717. package/es/components/molecules/ShareAccess/components/ModalTransferOwnerShip/styled.js +18 -18
  718. package/es/components/molecules/ShareAccess/components/PeopleAccess/PeopleAccess.d.ts +5 -5
  719. package/es/components/molecules/ShareAccess/components/PeopleAccess/PeopleAccess.js +97 -97
  720. package/es/components/molecules/ShareAccess/components/PeopleAccess/index.d.ts +1 -1
  721. package/es/components/molecules/ShareAccess/components/PeopleAccess/index.js +1 -1
  722. package/es/components/molecules/ShareAccess/components/PeopleAccess/styled.d.ts +1 -1
  723. package/es/components/molecules/ShareAccess/components/PeopleAccess/styled.js +46 -46
  724. package/es/components/molecules/ShareAccess/components/SearchUser/SearchUser.d.ts +5 -5
  725. package/es/components/molecules/ShareAccess/components/SearchUser/SearchUser.js +73 -73
  726. package/es/components/molecules/ShareAccess/components/SearchUser/index.d.ts +1 -1
  727. package/es/components/molecules/ShareAccess/components/SearchUser/index.js +1 -1
  728. package/es/components/molecules/ShareAccess/components/SearchUser/styled.d.ts +2 -2
  729. package/es/components/molecules/ShareAccess/components/SearchUser/styled.js +29 -29
  730. package/es/components/molecules/ShareAccess/components/index.d.ts +1 -1
  731. package/es/components/molecules/ShareAccess/components/index.js +1 -1
  732. package/es/components/molecules/ShareAccess/constants.d.ts +67 -67
  733. package/es/components/molecules/ShareAccess/constants.js +85 -85
  734. package/es/components/molecules/ShareAccess/context.d.ts +4 -4
  735. package/es/components/molecules/ShareAccess/context.js +3 -3
  736. package/es/components/molecules/ShareAccess/hooks/index.d.ts +1 -1
  737. package/es/components/molecules/ShareAccess/hooks/index.js +1 -1
  738. package/es/components/molecules/ShareAccess/hooks/useShareAccess.d.ts +18 -18
  739. package/es/components/molecules/ShareAccess/hooks/useShareAccess.js +29 -29
  740. package/es/components/molecules/ShareAccess/index.d.ts +4 -3
  741. package/es/components/molecules/ShareAccess/index.js +4 -3
  742. package/es/components/molecules/ShareAccess/reducer.d.ts +2 -2
  743. package/es/components/molecules/ShareAccess/reducer.js +19 -19
  744. package/es/components/molecules/ShareAccess/types.d.ts +55 -55
  745. package/es/components/molecules/ShareAccess/types.js +1 -1
  746. package/es/components/molecules/ShareAccess/utils.d.ts +38 -38
  747. package/es/components/molecules/ShareAccess/utils.js +57 -57
  748. package/es/components/molecules/SliderWithInputNumber/index.d.ts +11 -11
  749. package/es/components/molecules/SliderWithInputNumber/index.js +62 -62
  750. package/es/components/molecules/SliderWithInputNumber/styled.d.ts +1 -1
  751. package/es/components/molecules/SliderWithInputNumber/styled.js +8 -8
  752. package/es/components/molecules/Tabs/Tabs.d.ts +1 -1
  753. package/es/components/molecules/Tabs/Tabs.js +1 -1
  754. package/es/components/molecules/Tabs/index.d.ts +1 -1
  755. package/es/components/molecules/Tabs/index.js +1 -1
  756. package/es/components/molecules/TextDecorationSelect/constants.d.ts +19 -19
  757. package/es/components/molecules/TextDecorationSelect/constants.js +26 -26
  758. package/es/components/molecules/TextDecorationSelect/index.d.ts +15 -15
  759. package/es/components/molecules/TextDecorationSelect/index.js +45 -45
  760. package/es/components/molecules/TextTransformSelect/constants.d.ts +13 -13
  761. package/es/components/molecules/TextTransformSelect/constants.js +19 -19
  762. package/es/components/molecules/TextTransformSelect/index.d.ts +9 -9
  763. package/es/components/molecules/TextTransformSelect/index.js +39 -39
  764. package/es/components/molecules/ThumbnailCard/ThumbnailCard.d.ts +3 -3
  765. package/es/components/molecules/ThumbnailCard/ThumbnailCard.js +72 -72
  766. package/es/components/molecules/ThumbnailCard/constants.d.ts +3 -3
  767. package/es/components/molecules/ThumbnailCard/constants.js +3 -3
  768. package/es/components/molecules/ThumbnailCard/index.d.ts +2 -2
  769. package/es/components/molecules/ThumbnailCard/index.js +2 -2
  770. package/es/components/molecules/ThumbnailCard/styled.d.ts +1 -1
  771. package/es/components/molecules/ThumbnailCard/styled.js +89 -89
  772. package/es/components/molecules/ThumbnailCard/types.d.ts +20 -20
  773. package/es/components/molecules/ThumbnailCard/types.js +1 -1
  774. package/es/components/molecules/TreeSelect/TreeSelect.d.ts +11 -11
  775. package/es/components/molecules/TreeSelect/TreeSelect.js +2 -2
  776. package/es/components/molecules/TreeSelect/index.d.ts +1 -1
  777. package/es/components/molecules/TreeSelect/index.js +1 -1
  778. package/es/components/molecules/UploadImage/MediaIcon.d.ts +3 -3
  779. package/es/components/molecules/UploadImage/MediaIcon.js +8 -8
  780. package/es/components/molecules/UploadImage/MediaThumb.d.ts +8 -8
  781. package/es/components/molecules/UploadImage/MediaThumb.js +15 -15
  782. package/es/components/molecules/UploadImage/VideoThumbnail.d.ts +4 -4
  783. package/es/components/molecules/UploadImage/VideoThumbnail.js +43 -43
  784. package/es/components/molecules/UploadImage/index.d.ts +37 -37
  785. package/es/components/molecules/UploadImage/index.js +386 -386
  786. package/es/components/molecules/UploadImage/styled.d.ts +13 -13
  787. package/es/components/molecules/UploadImage/styled.js +130 -130
  788. package/es/components/molecules/UploadImage/utils.d.ts +3 -3
  789. package/es/components/molecules/UploadImage/utils.js +24 -24
  790. package/es/components/molecules/index.d.ts +48 -48
  791. package/es/components/molecules/index.js +41 -41
  792. package/es/components/organism/GenerativeInsights/constants.d.ts +1 -1
  793. package/es/components/organism/GenerativeInsights/constants.js +1 -1
  794. package/es/components/organism/GenerativeInsights/index.d.ts +11 -11
  795. package/es/components/organism/GenerativeInsights/index.js +57 -57
  796. package/es/components/organism/GenerativeInsights/styled.d.ts +12 -12
  797. package/es/components/organism/GenerativeInsights/styled.js +66 -66
  798. package/es/components/organism/GenerativeInsights/utils.d.ts +13 -13
  799. package/es/components/organism/GenerativeInsights/utils.js +50 -50
  800. package/es/components/organism/Help/Help.d.ts +5 -5
  801. package/es/components/organism/Help/Help.js +1005 -1005
  802. package/es/components/organism/Help/constants.d.ts +140 -140
  803. package/es/components/organism/Help/constants.js +1653 -1653
  804. package/es/components/organism/Help/index.d.ts +1 -1
  805. package/es/components/organism/Help/index.js +1 -1
  806. package/es/components/organism/Help/styled.d.ts +71 -71
  807. package/es/components/organism/Help/styled.js +264 -264
  808. package/es/components/organism/Help/types.d.ts +67 -67
  809. package/es/components/organism/Help/types.js +1 -1
  810. package/es/components/organism/Help/utils.d.ts +15 -15
  811. package/es/components/organism/Help/utils.js +82 -82
  812. package/es/components/organism/Menu/Menu.d.ts +1 -1
  813. package/es/components/organism/Menu/Menu.js +1 -1
  814. package/es/components/organism/Menu/index.d.ts +1 -1
  815. package/es/components/organism/Menu/index.js +3 -3
  816. package/es/components/organism/PositionSetting/config.d.ts +10 -10
  817. package/es/components/organism/PositionSetting/config.js +10 -10
  818. package/es/components/organism/PositionSetting/index.d.ts +15 -15
  819. package/es/components/organism/PositionSetting/index.js +62 -62
  820. package/es/components/organism/PositionSetting/styled.d.ts +1 -1
  821. package/es/components/organism/PositionSetting/styled.js +3 -3
  822. package/es/components/organism/PositionSetting/types.d.ts +10 -10
  823. package/es/components/organism/PositionSetting/types.js +1 -1
  824. package/es/components/organism/Table/CrossTabTable/CrossTabTable.d.ts +18 -18
  825. package/es/components/organism/Table/CrossTabTable/CrossTabTable.js +305 -305
  826. package/es/components/organism/Table/CrossTabTable/components/CustomCell/CustomCell.d.ts +11 -11
  827. package/es/components/organism/Table/CrossTabTable/components/CustomCell/CustomCell.js +22 -22
  828. package/es/components/organism/Table/CrossTabTable/components/CustomCell/index.d.ts +1 -1
  829. package/es/components/organism/Table/CrossTabTable/components/CustomCell/index.js +1 -1
  830. package/es/components/organism/Table/CrossTabTable/components/CustomCell/styled.d.ts +1 -1
  831. package/es/components/organism/Table/CrossTabTable/components/CustomCell/styled.js +13 -13
  832. package/es/components/organism/Table/CrossTabTable/constants.d.ts +75 -75
  833. package/es/components/organism/Table/CrossTabTable/constants.js +1525 -1525
  834. package/es/components/organism/Table/CrossTabTable/index.d.ts +1 -1
  835. package/es/components/organism/Table/CrossTabTable/index.js +1 -1
  836. package/es/components/organism/Table/CrossTabTable/styled.d.ts +1 -1
  837. package/es/components/organism/Table/CrossTabTable/styled.js +13 -13
  838. package/es/components/organism/Table/CrossTabTable/types.d.ts +1 -1
  839. package/es/components/organism/Table/CrossTabTable/types.js +1 -1
  840. package/es/components/organism/Table/CrossTabTable/utils.d.ts +1 -1
  841. package/es/components/organism/Table/CrossTabTable/utils.js +1 -1
  842. package/es/components/organism/Table/ExplorePivotTable/ExplorePivotTable.d.ts +11 -11
  843. package/es/components/organism/Table/ExplorePivotTable/ExplorePivotTable.js +51 -51
  844. package/es/components/organism/Table/ExplorePivotTable/components/CustomCell/CustomCell.d.ts +12 -12
  845. package/es/components/organism/Table/ExplorePivotTable/components/CustomCell/CustomCell.js +41 -41
  846. package/es/components/organism/Table/ExplorePivotTable/components/CustomCell/index.d.ts +1 -1
  847. package/es/components/organism/Table/ExplorePivotTable/components/CustomCell/index.js +1 -1
  848. package/es/components/organism/Table/ExplorePivotTable/components/CustomCell/styled.d.ts +3 -3
  849. package/es/components/organism/Table/ExplorePivotTable/components/CustomCell/styled.js +21 -21
  850. package/es/components/organism/Table/ExplorePivotTable/constants.d.ts +4 -4
  851. package/es/components/organism/Table/ExplorePivotTable/constants.js +84 -84
  852. package/es/components/organism/Table/ExplorePivotTable/index.d.ts +2 -2
  853. package/es/components/organism/Table/ExplorePivotTable/index.js +2 -2
  854. package/es/components/organism/Table/ExplorePivotTable/styled.d.ts +12 -12
  855. package/es/components/organism/Table/ExplorePivotTable/styled.js +15 -15
  856. package/es/components/organism/Table/ExplorePivotTable/types.d.ts +17 -17
  857. package/es/components/organism/Table/ExplorePivotTable/types.js +1 -1
  858. package/es/components/organism/Table/ExplorePivotTable/utils.d.ts +4 -4
  859. package/es/components/organism/Table/ExplorePivotTable/utils.js +154 -154
  860. package/es/components/organism/Table/Table.d.ts +1 -1
  861. package/es/components/organism/Table/Table.js +1 -1
  862. package/es/components/organism/Table/index.d.ts +2 -2
  863. package/es/components/organism/Table/index.js +2 -2
  864. package/es/components/organism/index.d.ts +5 -5
  865. package/es/components/organism/index.js +5 -5
  866. package/es/components/template/TemplateListing/components/BlankTemplate/index.d.ts +3 -3
  867. package/es/components/template/TemplateListing/components/BlankTemplate/index.js +17 -17
  868. package/es/components/template/TemplateListing/components/BlankTemplate/styled.d.ts +2 -2
  869. package/es/components/template/TemplateListing/components/BlankTemplate/styled.js +26 -26
  870. package/es/components/template/TemplateListing/components/CategoryListing/index.d.ts +3 -3
  871. package/es/components/template/TemplateListing/components/CategoryListing/index.js +108 -108
  872. package/es/components/template/TemplateListing/components/CategoryListing/styled.d.ts +7 -7
  873. package/es/components/template/TemplateListing/components/CategoryListing/styled.js +77 -77
  874. package/es/components/template/TemplateListing/components/CategoryListing/types.d.ts +11 -11
  875. package/es/components/template/TemplateListing/components/CategoryListing/types.js +1 -1
  876. package/es/components/template/TemplateListing/components/index.d.ts +2 -2
  877. package/es/components/template/TemplateListing/components/index.js +2 -2
  878. package/es/components/template/TemplateListing/constants/defaultProps.d.ts +10 -10
  879. package/es/components/template/TemplateListing/constants/defaultProps.js +22 -22
  880. package/es/components/template/TemplateListing/constants/index.d.ts +2 -2
  881. package/es/components/template/TemplateListing/constants/index.js +2 -2
  882. package/es/components/template/TemplateListing/constants/mockData.d.ts +2 -2
  883. package/es/components/template/TemplateListing/constants/mockData.js +101 -101
  884. package/es/components/template/TemplateListing/index.d.ts +3 -3
  885. package/es/components/template/TemplateListing/index.js +21 -21
  886. package/es/components/template/TemplateListing/styled/index.d.ts +2 -2
  887. package/es/components/template/TemplateListing/styled/index.js +16 -16
  888. package/es/components/template/TemplateListing/types/BlankTemplate.d.ts +9 -9
  889. package/es/components/template/TemplateListing/types/BlankTemplate.js +1 -1
  890. package/es/components/template/TemplateListing/types/CategoryListing.d.ts +18 -18
  891. package/es/components/template/TemplateListing/types/CategoryListing.js +1 -1
  892. package/es/components/template/TemplateListing/types/TemplateListing.d.ts +16 -16
  893. package/es/components/template/TemplateListing/types/TemplateListing.js +1 -1
  894. package/es/components/template/TemplateListing/types/index.d.ts +3 -3
  895. package/es/components/template/TemplateListing/types/index.js +3 -3
  896. package/es/components/template/index.d.ts +2 -2
  897. package/es/components/template/index.js +2 -2
  898. package/es/constants/gradientSetting.d.ts +83 -83
  899. package/es/constants/gradientSetting.js +86 -86
  900. package/es/constants/index.d.ts +4 -4
  901. package/es/constants/index.js +4 -4
  902. package/es/constants/keyCode.d.ts +387 -387
  903. package/es/constants/keyCode.js +394 -394
  904. package/es/constants/queries.d.ts +14 -14
  905. package/es/constants/queries.js +21 -21
  906. package/es/constants/richMenu.d.ts +19 -19
  907. package/es/constants/richMenu.js +19 -19
  908. package/es/constants/storybook.d.ts +17 -17
  909. package/es/constants/storybook.js +36 -36
  910. package/es/constants/theme.d.ts +12 -12
  911. package/es/constants/theme.js +173 -173
  912. package/es/hooks/index.d.ts +3 -3
  913. package/es/hooks/index.js +22 -22
  914. package/es/hooks/useDebounce.d.ts +3 -3
  915. package/es/hooks/useDebounce.js +15 -15
  916. package/es/hooks/useDebounceCallback.d.ts +1 -1
  917. package/es/hooks/useDebounceCallback.js +5 -5
  918. package/es/hooks/useDebounceV2.d.ts +1 -1
  919. package/es/hooks/useDebounceV2.js +11 -11
  920. package/es/hooks/useDeepCompareEffect.d.ts +1 -1
  921. package/es/hooks/useDeepCompareEffect.js +21 -21
  922. package/es/hooks/useDeepCompareMemo.d.ts +2 -2
  923. package/es/hooks/useDeepCompareMemo.js +21 -21
  924. package/es/hooks/useOutsideClick.d.ts +4 -4
  925. package/es/hooks/useOutsideClick.js +18 -18
  926. package/es/hooks/usePrevious.d.ts +2 -2
  927. package/es/hooks/usePrevious.js +9 -9
  928. package/es/index.d.ts +1 -1
  929. package/es/index.js +1 -1
  930. package/es/locales/en/translation.json +232 -232
  931. package/es/locales/i18n.d.ts +307 -307
  932. package/es/locales/i18n.js +38 -38
  933. package/es/locales/translations.d.ts +236 -236
  934. package/es/locales/translations.js +35 -35
  935. package/es/locales/types.d.ts +15 -15
  936. package/es/locales/types.js +1 -1
  937. package/es/locales/vi/translation.json +67 -67
  938. package/es/models/BusinessObject.d.ts +116 -116
  939. package/es/models/BusinessObject.js +113 -113
  940. package/es/models/Currency.d.ts +9 -9
  941. package/es/models/Currency.js +10 -10
  942. package/es/models/CustomFunction.d.ts +19 -19
  943. package/es/models/CustomFunction.js +25 -25
  944. package/es/models/DynamicContentAttribute.d.ts +34 -34
  945. package/es/models/DynamicContentAttribute.js +9 -9
  946. package/es/models/EventTrackingAttribute.d.ts +11 -11
  947. package/es/models/EventTrackingAttribute.js +13 -13
  948. package/es/models/PromotionPool.d.ts +11 -11
  949. package/es/models/PromotionPool.js +12 -12
  950. package/es/models/SavedMedia.d.ts +34 -34
  951. package/es/models/SavedMedia.js +30 -30
  952. package/es/models/Upload.d.ts +34 -34
  953. package/es/models/Upload.js +24 -24
  954. package/es/models/model.d.ts +8 -8
  955. package/es/models/model.js +5 -5
  956. package/es/queries/BusinessObject/index.d.ts +6 -6
  957. package/es/queries/BusinessObject/index.js +6 -6
  958. package/es/queries/BusinessObject/useGetListAllEvents.d.ts +11 -11
  959. package/es/queries/BusinessObject/useGetListAllEvents.js +14 -14
  960. package/es/queries/BusinessObject/useGetListAttributeBO.d.ts +17 -17
  961. package/es/queries/BusinessObject/useGetListAttributeBO.js +41 -41
  962. package/es/queries/BusinessObject/useGetListBO.d.ts +6 -6
  963. package/es/queries/BusinessObject/useGetListBO.js +19 -19
  964. package/es/queries/BusinessObject/useGetListEventAttr.d.ts +4 -4
  965. package/es/queries/BusinessObject/useGetListEventAttr.js +15 -15
  966. package/es/queries/BusinessObject/useGetListPromotionCodeAttr.d.ts +6 -6
  967. package/es/queries/BusinessObject/useGetListPromotionCodeAttr.js +26 -26
  968. package/es/queries/BusinessObject/useGetListSourceByEvent.d.ts +13 -13
  969. package/es/queries/BusinessObject/useGetListSourceByEvent.js +11 -11
  970. package/es/queries/CustomFunction/index.d.ts +2 -2
  971. package/es/queries/CustomFunction/index.js +2 -2
  972. package/es/queries/CustomFunction/useCustomFunction.d.ts +19 -19
  973. package/es/queries/CustomFunction/useCustomFunction.js +53 -53
  974. package/es/queries/DynamicContentAttribute/index.d.ts +1 -1
  975. package/es/queries/DynamicContentAttribute/index.js +1 -1
  976. package/es/queries/DynamicContentAttribute/useGetDynamicContentAttr.d.ts +10 -10
  977. package/es/queries/DynamicContentAttribute/useGetDynamicContentAttr.js +21 -21
  978. package/es/queries/PromotionPool/index.d.ts +1 -1
  979. package/es/queries/PromotionPool/index.js +1 -1
  980. package/es/queries/PromotionPool/useGetListPromotionPool.d.ts +9 -9
  981. package/es/queries/PromotionPool/useGetListPromotionPool.js +62 -62
  982. package/es/queries/ThirdParty/index.d.ts +1 -1
  983. package/es/queries/ThirdParty/index.js +1 -1
  984. package/es/queries/ThirdParty/useGetEventTrackingAttributes.d.ts +14 -14
  985. package/es/queries/ThirdParty/useGetEventTrackingAttributes.js +15 -15
  986. package/es/queries/configs.d.ts +4 -4
  987. package/es/queries/configs.js +13 -13
  988. package/es/queries/index.d.ts +6 -6
  989. package/es/queries/index.js +6 -6
  990. package/es/services/MediaTemplateDesign/BusinessObject/index.d.ts +8 -8
  991. package/es/services/MediaTemplateDesign/BusinessObject/index.js +100 -100
  992. package/es/services/MediaTemplateDesign/CustomFunction/index.d.ts +15 -15
  993. package/es/services/MediaTemplateDesign/CustomFunction/index.js +135 -135
  994. package/es/services/MediaTemplateDesign/DynamicContentAttribute/index.d.ts +4 -4
  995. package/es/services/MediaTemplateDesign/DynamicContentAttribute/index.js +39 -39
  996. package/es/services/MediaTemplateDesign/ListCurrency/index.d.ts +6 -6
  997. package/es/services/MediaTemplateDesign/ListCurrency/index.js +34 -34
  998. package/es/services/MediaTemplateDesign/PromotionPool/index.d.ts +3 -3
  999. package/es/services/MediaTemplateDesign/PromotionPool/index.js +31 -31
  1000. package/es/services/MediaTemplateDesign/UploadFile/index.d.ts +6 -6
  1001. package/es/services/MediaTemplateDesign/UploadFile/index.js +93 -93
  1002. package/es/services/ThirParty/index.d.ts +8 -8
  1003. package/es/services/ThirParty/index.js +26 -26
  1004. package/es/services/Ticket.d.ts +67 -67
  1005. package/es/services/Ticket.js +73 -73
  1006. package/es/services/constants.d.ts +20 -20
  1007. package/es/services/constants.js +21 -21
  1008. package/es/services/index.d.ts +18 -18
  1009. package/es/services/index.js +108 -108
  1010. package/es/test.d.ts +14 -14
  1011. package/es/test.js +376 -376
  1012. package/es/types/index.d.ts +23 -23
  1013. package/es/types/index.js +2 -2
  1014. package/es/types/richMenu.d.ts +214 -214
  1015. package/es/types/richMenu.js +1 -1
  1016. package/es/types/variables.d.ts +2 -2
  1017. package/es/types/variables.js +1 -1
  1018. package/es/utils/color.d.ts +10 -10
  1019. package/es/utils/color.js +61 -61
  1020. package/es/utils/common.d.ts +58 -58
  1021. package/es/utils/common.js +379 -379
  1022. package/es/utils/handleError.d.ts +32 -32
  1023. package/es/utils/handleError.js +44 -44
  1024. package/es/utils/index.d.ts +3 -3
  1025. package/es/utils/index.js +3 -3
  1026. package/es/utils/loadable.d.ts +7 -7
  1027. package/es/utils/loadable.js +10 -10
  1028. package/es/utils/web.d.ts +10 -10
  1029. package/es/utils/web.js +26 -26
  1030. package/package.json +204 -204
@@ -1,736 +1,736 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- var __rest = (this && this.__rest) || function (s, e) {
11
- var t = {};
12
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
13
- t[p] = s[p];
14
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
15
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
16
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
17
- t[p[i]] = s[p[i]];
18
- }
19
- return t;
20
- };
21
- import React, { useState, useRef, useEffect } from 'react';
22
- import { Cell } from './components/Cell';
23
- import { GRID_TEMPLATE, MIN_SIZE, THREADHOLD, buildGrid } from './constant';
24
- import { StyledGrid, StyledMiddleLayer, StyledBGLayer, StyledLine } from './styled';
25
- import { useDeepCompareEffect } from '../../../hooks/useDeepCompareEffect';
26
- const defaultProps = {
27
- containerStyle: {},
28
- cellBorder: '1px dotted',
29
- cellStyle: {},
30
- cellActiveStyle: { background: '#2f79bf80' },
31
- isPreview: false,
32
- isCompact: false,
33
- delayUpdate: 200,
34
- selectColor: '#2f79bf80',
35
- };
36
- export const ResizeGrid = props => {
37
- const { containerStyle, cellBorder, cellStyle, cellActiveStyle, isPreview, renderCell, grid: initGrid, image, imageSize, imagePosition, isCompact, onChange, delayUpdate, selectColor, reCalculateFlag, } = props;
38
- const [grid, setGrid] = useState(buildGrid(initGrid || GRID_TEMPLATE.GRID_2_3));
39
- const startRef = useRef(null);
40
- const startCellRef = useRef(null);
41
- const selectRef = useRef(null);
42
- const selectEndRef = useRef(null);
43
- const gridRef = useRef();
44
- const containerRef = useRef(null);
45
- const verticalLineRef = useRef(null);
46
- const horizontalLineRef = useRef(null);
47
- const layersRef = useRef(null);
48
- const cellsRef = useRef({});
49
- const cordinatesRef = useRef({});
50
- const onChangeTimoutRef = useRef();
51
- const onChangeDelayRef = useRef();
52
- const acceptUpdateRef = useRef(false);
53
- const firstChangeRef = useRef(true);
54
- const ctrlKeyRef = useRef(false);
55
- const initRef = useRef(0);
56
- const initDoneRef = useRef(false);
57
- // console.log('grid', grid)
58
- function lineVertical(isShow = true, left = 0) {
59
- if (verticalLineRef.current && layersRef.current) {
60
- verticalLineRef.current.style.display = isShow ? 'block' : 'none';
61
- layersRef.current.style.opacity = isShow ? '.5' : '1';
62
- verticalLineRef.current.style.left = `${left}px`;
63
- }
64
- }
65
- function lineHorizontal(isShow = true, top = 0) {
66
- if (horizontalLineRef.current && layersRef.current) {
67
- horizontalLineRef.current.style.display = isShow ? 'block' : 'none';
68
- layersRef.current.style.opacity = isShow ? '.5' : '1';
69
- horizontalLineRef.current.style.top = `${top}px`;
70
- }
71
- }
72
- const handleChangeGrid = () => {
73
- clearTimeout(onChangeTimoutRef.current);
74
- onChangeTimoutRef.current = setTimeout(() => {
75
- if (containerRef.current && cellsRef.current && cellsRef.current[0]) {
76
- const container = containerRef.current.getBoundingClientRect();
77
- // Object.values(cordinatesRef.current);
78
- const childs = Object.values(cellsRef.current).map(cell => {
79
- if (!cell || !cell.current)
80
- return;
81
- const childBox = cell.current.getBoundingClientRect();
82
- return {
83
- width: childBox.width,
84
- height: childBox.height,
85
- x: childBox.x - container.x,
86
- y: childBox.y - container.y,
87
- };
88
- });
89
- if (typeof onChange === 'function') {
90
- onChange(grid, childs, firstChangeRef.current ? 'system' : 'user');
91
- acceptUpdateRef.current = false;
92
- firstChangeRef.current = false;
93
- clearTimeout(onChangeDelayRef.current);
94
- onChangeDelayRef.current = setTimeout(() => {
95
- acceptUpdateRef.current = true;
96
- }, delayUpdate);
97
- }
98
- }
99
- }, 300);
100
- };
101
- const isFollow = (cell, line, isCol = true) => isCol
102
- ? (cell.colEnd !== line || !cell.sizeX) && (cell.colStart !== line || !cell.sizeX)
103
- : (cell.rowEnd !== line || !cell.sizeY) && (cell.rowStart !== line || !cell.sizeY);
104
- const notFollow = (cell, line, isCol = true) => !isFollow(cell, line, isCol);
105
- const floorSize = size => Math.floor(size);
106
- useEffect(() => {
107
- handleChangeGrid();
108
- // eslint-disable-next-line react-hooks/exhaustive-deps
109
- }, [grid, reCalculateFlag]);
110
- useDeepCompareEffect(() => {
111
- // console.log('changed grid', initGrid, acceptUpdateRef.current, initGrid?.rows, initGrid?.cols)
112
- // console.log(initRef.current < 2,!initDoneRef.current, acceptUpdateRef.current)
113
- if ((initRef.current < 2 || !initDoneRef.current || acceptUpdateRef.current) &&
114
- (initGrid === null || initGrid === void 0 ? void 0 : initGrid.rows) &&
115
- (initGrid === null || initGrid === void 0 ? void 0 : initGrid.cols)) {
116
- // console.log('apply change...', buildGrid(initGrid))
117
- initRef.current += 1;
118
- firstChangeRef.current = true;
119
- setGrid(buildGrid(initGrid));
120
- resetBackgroundCellRef();
121
- }
122
- // eslint-disable-next-line react-hooks/exhaustive-deps
123
- }, [initGrid]);
124
- useEffect(() => {
125
- setTimeout(() => {
126
- initDoneRef.current = true;
127
- }, 3000);
128
- const handleMove = e => {
129
- // Resize Grid
130
- if (startRef.current && gridRef.current && containerRef.current) {
131
- const { type, line } = startRef.current;
132
- const idx = line - 1;
133
- const { gridTemplateRows, gridTemplateColumns, rows, cols, childs } = gridRef.current;
134
- if (idx <= 0 || (type === 'row' && idx >= rows) || (type === 'column' && idx >= cols))
135
- return;
136
- const { clientX, clientY } = e;
137
- if (type === 'row') {
138
- const gridHeight = containerRef.current.offsetHeight;
139
- const yDistant = clientY - startRef.current.clientY;
140
- const yPercentDistant = (100 * yDistant) / gridHeight;
141
- const minPercent = (100 * MIN_SIZE) / gridHeight;
142
- // console.log('move Y', clientY, yDistant, yPercentDistant);
143
- const newArr = [...gridTemplateRows];
144
- newArr[idx - 1] += yPercentDistant;
145
- newArr[idx] -= yPercentDistant;
146
- if (newArr[idx - 1] >= minPercent && newArr[idx] >= minPercent) {
147
- const newChilds = JSON.parse(JSON.stringify(childs));
148
- let isValidChildSize = true;
149
- newChilds.forEach((child, idx) => {
150
- var _a, _b;
151
- if (isValidChildSize && notFollow(child, (_a = startRef.current) === null || _a === void 0 ? void 0 : _a.line, false)) {
152
- if (child.rowStart === ((_b = startRef.current) === null || _b === void 0 ? void 0 : _b.line)) {
153
- if (child.transformY) {
154
- child.transformY = +child.transformY - yDistant;
155
- }
156
- else {
157
- child.sizeY = +child.sizeY - yDistant;
158
- }
159
- }
160
- else {
161
- child.transformY &&
162
- !child.movedBottom &&
163
- (child.sizeY = +child.sizeY + yDistant);
164
- }
165
- // console.log('check...', startRef.current.line, child.transformY, yDistant, +child.transformY - yDistant)
166
- if (child.sizeY < MIN_SIZE) {
167
- isValidChildSize = false;
168
- }
169
- }
170
- });
171
- isValidChildSize &&
172
- setGrid(Object.assign(Object.assign({}, gridRef.current), { gridTemplateRows: newArr, childs: newChilds }));
173
- }
174
- }
175
- else {
176
- const xDistant = clientX - startRef.current.clientX;
177
- const gridWidth = containerRef.current.offsetWidth;
178
- const xPercentDistant = (100 * xDistant) / gridWidth;
179
- const minPercent = (100 * MIN_SIZE) / gridWidth;
180
- // console.log('move X', clientX, xDistant, xPercentDistant);
181
- const newArr = [...gridTemplateColumns];
182
- newArr[idx - 1] += xPercentDistant;
183
- newArr[idx] -= xPercentDistant;
184
- if (newArr[idx - 1] >= minPercent && newArr[idx] >= minPercent) {
185
- const newChilds = JSON.parse(JSON.stringify(childs));
186
- let isValidChildSize = true;
187
- newChilds.forEach(child => {
188
- if (isValidChildSize && notFollow(child, line)) {
189
- if (child.colStart === line) {
190
- if (child.transformX) {
191
- child.transformX = +child.transformX - xDistant;
192
- }
193
- else {
194
- child.sizeX = +child.sizeX - xDistant;
195
- }
196
- }
197
- else {
198
- child.transformX && !child.movedRight && (child.sizeX = +child.sizeX + xDistant);
199
- }
200
- // console.log('check...', startRef.current.line, child.transformX, xDistant, +child.transformX - xDistant)
201
- if (child.sizeX < MIN_SIZE) {
202
- isValidChildSize = false;
203
- }
204
- }
205
- });
206
- isValidChildSize &&
207
- setGrid(Object.assign(Object.assign({}, gridRef.current), { gridTemplateColumns: newArr, childs: newChilds }));
208
- }
209
- }
210
- }
211
- //-------------------------------------------
212
- // Resize Cell
213
- if (startCellRef.current && gridRef.current) {
214
- const { clientX: startClientX, clientY: startClientY, direction, isRevert, leftCells, rightCells, } = startCellRef.current;
215
- // const { rowStart, rowEnd, colStart, colEnd, transformX, transformY } = cell;
216
- // const { gridTemplateRows, gridTemplateColumns, rows, cols, childs } = gridRef.current;
217
- // if (
218
- // idx < 0 ||
219
- // (direction === 'top' && rowStart === 1) ||
220
- // (direction === 'right' && colEnd === cols + 1) ||
221
- // (direction === 'bottom' && rowEnd === rows + 1) ||
222
- // (direction === 'left' && colStart === 1)
223
- // )
224
- // return;
225
- const { clientX, clientY } = e;
226
- if (['top', 'bottom'].includes(direction)) {
227
- // const cellHeight = cellRef.current.offsetHeight;
228
- let yDistant = clientY - startClientY;
229
- // console.log('move Y', clientY, yDistant);
230
- if (Math.abs(yDistant) > THREADHOLD) {
231
- startCellRef.current.fallback = true;
232
- }
233
- let isValid = true;
234
- const mapNewSizeTop = {};
235
- const mapNewSizeBottom = {};
236
- const leftKeys = Object.keys(leftCells);
237
- leftKeys.forEach(cellIdx => {
238
- const cell = leftCells[cellIdx];
239
- let newHeight = (cell.sizeY || 0) + yDistant;
240
- if (newHeight < MIN_SIZE) {
241
- isValid = false;
242
- }
243
- else {
244
- const cellCordinate = cordinatesRef.current[cellIdx];
245
- // const cell = gridRef.current.childs[cellIdx];
246
- const newYEnd = cellCordinate.y + newHeight;
247
- const nearestCells = Object.entries(cordinatesRef.current).filter(cor => gridRef.current &&
248
- gridRef.current.childs[cor[0]] &&
249
- !leftKeys.includes(cor[0]) &&
250
- gridRef.current.childs[cor[0]].colStart !== cell.colStart &&
251
- Math.abs(cor[1].yEnd - newYEnd) <= THREADHOLD);
252
- // console.log('nearestCells', nearestCells, newXEnd, leftKeys, cordinatesRef.current);
253
- if (nearestCells.length && startCellRef.current) {
254
- const nearestY = Math.abs(nearestCells[0][1].y - newYEnd) <= THREADHOLD
255
- ? nearestCells[0][1].y
256
- : nearestCells[0][1].yEnd;
257
- const delta = nearestY - newYEnd;
258
- if (startCellRef.current.fallback ||
259
- floorSize(cellCordinate.height) !== floorSize(newHeight + delta)) {
260
- newHeight += delta;
261
- yDistant += delta;
262
- lineHorizontal(true, nearestY - 1);
263
- }
264
- }
265
- else {
266
- lineHorizontal(false);
267
- }
268
- mapNewSizeTop[cellIdx] = newHeight;
269
- }
270
- });
271
- Object.keys(rightCells).forEach(cellIdx => {
272
- const nextCell = rightCells[cellIdx];
273
- const newHeightNextCell = (nextCell.sizeY || 0) - yDistant;
274
- if (newHeightNextCell < MIN_SIZE) {
275
- isValid = false;
276
- }
277
- mapNewSizeBottom[cellIdx] = [newHeightNextCell, nextCell];
278
- });
279
- if (isValid) {
280
- const newChilds = [...gridRef.current.childs];
281
- Object.keys(mapNewSizeTop).forEach(cellIdx => {
282
- newChilds[cellIdx] = Object.assign(Object.assign({}, newChilds[cellIdx]), { sizeY: mapNewSizeTop[cellIdx], movedBottom: true });
283
- });
284
- Object.keys(mapNewSizeBottom).forEach(cellIdx => {
285
- newChilds[cellIdx] = Object.assign(Object.assign({}, newChilds[cellIdx]), { sizeY: mapNewSizeBottom[cellIdx][0], transformY: (mapNewSizeBottom[cellIdx][1].transformY || 0) + yDistant, movedTop: true });
286
- });
287
- setGrid(Object.assign(Object.assign({}, gridRef.current), { childs: newChilds }));
288
- }
289
- }
290
- else {
291
- // const cellWidth = cellRef.current.offsetWidth;
292
- let xDistant = clientX - startClientX;
293
- // console.log('move X', clientX, xDistant);
294
- if (Math.abs(xDistant) > THREADHOLD) {
295
- startCellRef.current.fallback = true;
296
- }
297
- let isValid = true;
298
- const mapNewSizeLeft = {};
299
- const mapNewSizeRight = {};
300
- const mapReset = {};
301
- const leftKeys = Object.keys(leftCells);
302
- leftKeys.forEach(cellIdx => {
303
- const cell = leftCells[cellIdx];
304
- let newWidth = (cell.sizeX || 0) + xDistant;
305
- if (newWidth < MIN_SIZE) {
306
- isValid = false;
307
- }
308
- else if (gridRef.current) {
309
- const cellCordinate = cordinatesRef.current[cellIdx];
310
- // const cell = gridRef.current.childs[cellIdx];
311
- const newXEnd = cellCordinate.x + newWidth;
312
- const nearestCells = Object.entries(cordinatesRef.current).filter(cor => gridRef.current &&
313
- gridRef.current.childs[cor[0]] &&
314
- !leftKeys.includes(cor[0]) &&
315
- gridRef.current.childs[cor[0]].rowStart !== cell.rowStart &&
316
- Math.abs(cor[1].xEnd - newXEnd) <= THREADHOLD);
317
- // console.log('nearestCells', nearestCells, newXEnd, leftKeys, cordinatesRef.current);
318
- if (nearestCells.length && startCellRef.current) {
319
- const nearestX = Math.abs(nearestCells[0][1].x - newXEnd) <= THREADHOLD
320
- ? nearestCells[0][1].x
321
- : nearestCells[0][1].xEnd;
322
- const delta = nearestX - newXEnd;
323
- if (startCellRef.current.fallback ||
324
- floorSize(cellCordinate.width) !== floorSize(newWidth + delta)) {
325
- newWidth += delta;
326
- xDistant += delta;
327
- lineVertical(true, nearestX - 1);
328
- }
329
- }
330
- else {
331
- lineVertical(false);
332
- }
333
- mapNewSizeLeft[cellIdx] = newWidth;
334
- }
335
- });
336
- Object.keys(rightCells).forEach(cellIdx => {
337
- const nextCell = rightCells[cellIdx];
338
- const newWidthNextCell = (nextCell.sizeX || 0) - xDistant;
339
- if (newWidthNextCell < MIN_SIZE) {
340
- isValid = false;
341
- }
342
- mapNewSizeRight[cellIdx] = [newWidthNextCell, nextCell];
343
- });
344
- if (isValid) {
345
- const newChilds = [...gridRef.current.childs];
346
- Object.keys(mapNewSizeLeft).forEach(cellIdx => {
347
- newChilds[cellIdx] = Object.assign(Object.assign({}, newChilds[cellIdx]), { sizeX: mapNewSizeLeft[cellIdx], movedRight: true });
348
- });
349
- Object.keys(mapNewSizeRight).forEach(cellIdx => {
350
- newChilds[cellIdx] = Object.assign(Object.assign({}, newChilds[cellIdx]), { sizeX: mapNewSizeRight[cellIdx][0], transformX: (mapNewSizeRight[cellIdx][1].transformX || 0) + xDistant, movedLeft: true });
351
- });
352
- setGrid(Object.assign(Object.assign({}, gridRef.current), { childs: newChilds }));
353
- }
354
- }
355
- }
356
- //------------------------------------------
357
- // if (selectRef.current) {}
358
- };
359
- const handleUp = () => {
360
- startRef.current = null;
361
- startCellRef.current = null;
362
- lineVertical(false);
363
- lineHorizontal(false);
364
- };
365
- const isMac = () => navigator.platform.indexOf('Mac') >= 0;
366
- window.addEventListener('mousemove', handleMove);
367
- window.addEventListener('mouseup', handleUp);
368
- const handleKeyDown = e => {
369
- if (!ctrlKeyRef.current && ((isMac() && e.metaKey) || (!isMac() && e.key === 'Control'))) {
370
- ctrlKeyRef.current = true;
371
- // console.log('ctrlKeyRef', ctrlKeyRef.current);
372
- }
373
- };
374
- const handleKeyUp = () => {
375
- ctrlKeyRef.current = false;
376
- // console.log('ctrlKeyRef', ctrlKeyRef.current);
377
- };
378
- window.addEventListener('keydown', handleKeyDown);
379
- window.addEventListener('keyup', handleKeyUp);
380
- return () => {
381
- window.removeEventListener('mousemove', handleMove);
382
- window.removeEventListener('mouseup', handleUp);
383
- window.removeEventListener('keydown', handleKeyDown);
384
- window.removeEventListener('keyup', handleKeyUp);
385
- };
386
- }, []);
387
- // const rebaseCordinate = (x, y, ...rest) => {
388
- // if (containerRef.current) {
389
- // const container = containerRef.current.getBoundingClientRect();
390
- // console.log('rebased', x - container.x, y - container.y, ...rest);
391
- // }
392
- // };
393
- const activeCell = ({ idx }) => {
394
- setGrid(prev => (Object.assign(Object.assign({}, prev), { childs: prev.childs.map((c, i) => (Object.assign(Object.assign({}, c), { active: i === idx }))) })));
395
- };
396
- const findResizeCells = ({ type, line, direction, idx,
397
- // cell,
398
- isRevert, leftCols = [], rightCols = [], dones = [], level = 0, }) => {
399
- // left is current cell and right is the opposite
400
- if (dones.includes(idx)) {
401
- return null;
402
- }
403
- const { childs } = grid;
404
- const cellBox = cordinatesRef.current[idx];
405
- dones.push(idx);
406
- if (level === 0 && !leftCols.length) {
407
- leftCols.push(idx);
408
- }
409
- let isEnd = true;
410
- if (type === 'column') {
411
- childs.forEach((cell, i) => {
412
- if (((direction === 'left' &&
413
- cell.colEnd === line &&
414
- Math.abs(cellBox.x - cordinatesRef.current[i].xEnd) < 1) ||
415
- (direction === 'right' &&
416
- cell.colStart === line &&
417
- Math.abs(cellBox.xEnd - cordinatesRef.current[i].x) < 1)) &&
418
- !(floorSize(cordinatesRef.current[i].y) >= floorSize(cellBox.yEnd) ||
419
- floorSize(cordinatesRef.current[i].yEnd) <= floorSize(cellBox.y))) {
420
- if (!rightCols.includes(i)) {
421
- rightCols.push(i);
422
- // const cellIRef = cellsRef.current[i];
423
- // if (cellIRef.current) {
424
- // cellIRef.current.style.background = 'green';
425
- // }
426
- isEnd = false;
427
- }
428
- // else if (direction === 'right' && !leftCols.includes(i)) {
429
- // leftCols.push(i);
430
- // const cellIRef = cellsRef.current[i];
431
- // if (cellIRef.current) {
432
- // cellIRef.current.style.background = 'blue';
433
- // }
434
- // isEnd = false;
435
- // }
436
- }
437
- });
438
- }
439
- else {
440
- childs.forEach((cell, i) => {
441
- if (((direction === 'top' &&
442
- cell.rowEnd === line &&
443
- Math.abs(cellBox.y - cordinatesRef.current[i].yEnd) < 1) ||
444
- (direction === 'bottom' &&
445
- cell.rowStart === line &&
446
- Math.abs(cellBox.yEnd - cordinatesRef.current[i].y) < 1)) &&
447
- !(floorSize(cordinatesRef.current[i].x) >= floorSize(cellBox.xEnd) ||
448
- floorSize(cordinatesRef.current[i].xEnd) <= floorSize(cellBox.x))) {
449
- if (!rightCols.includes(i)) {
450
- rightCols.push(i);
451
- // const cellIRef = cellsRef.current[i];
452
- // if (cellIRef.current) {
453
- // cellIRef.current.style.background = 'green';
454
- // }
455
- isEnd = false;
456
- }
457
- // else if (direction === 'bottom' && !leftCols.includes(i)) {
458
- // leftCols.push(i);
459
- // const cellIRef = cellsRef.current[i];
460
- // if (cellIRef.current) {
461
- // cellIRef.current.style.background = 'blue';
462
- // }
463
- // isEnd = false;
464
- // }
465
- }
466
- });
467
- }
468
- // console.log(' find', direction, idx, leftCols, rightCols, dones, cordinatesRef.current);
469
- if (!isEnd) {
470
- // console.log('continue find', leftCols, rightCols);
471
- rightCols
472
- .filter(i => !dones.includes(i))
473
- .forEach(i => {
474
- findResizeCells({
475
- type,
476
- line,
477
- direction: { left: 'right', right: 'left', top: 'bottom', bottom: 'top' }[direction] || '',
478
- idx: i,
479
- isRevert,
480
- leftCols: rightCols,
481
- rightCols: leftCols,
482
- dones,
483
- level: level + 1,
484
- });
485
- });
486
- }
487
- return { leftCols, rightCols };
488
- };
489
- const handleDownCell = (e, type, line, idx, direction, cell, cellRef) => {
490
- const { clientX, clientY } = e;
491
- // rebaseCordinate(clientX, clientY, type, line);
492
- const isRevert = ['top', 'left'].includes(direction);
493
- // let newIdx = isRevert ? idx - 1 : idx;
494
- // let nextCellIdx = isRevert ? idx - 1 : idx + 1;
495
- const leftCols = [idx];
496
- const rightCols = [];
497
- findResizeCells({ type, line, direction, idx, isRevert, leftCols, rightCols });
498
- // console.log('change cell', leftCols, rightCols);
499
- // if (['top', 'bottom'].includes(direction)) {
500
- // nextCellIdx = grid.childs.findIndex(
501
- // b =>
502
- // b.colStart === cell.colStart &&
503
- // ((isRevert && b.rowEnd === cell.rowStart) || (!isRevert && b.rowStart === cell.rowEnd)),
504
- // );
505
- // newIdx = isRevert ? nextCellIdx : idx;
506
- // }
507
- // if (nextCellIdx < 0) return;
508
- if (!leftCols.length || !rightCols.length)
509
- return;
510
- const leftCells = {};
511
- const rightCells = {};
512
- leftCols.forEach(i => {
513
- var _a, _b;
514
- const cell = grid.childs[i];
515
- const cellRef = cellsRef.current[i];
516
- leftCells[i] = Object.assign({ sizeX: cell.sizeX || ((_a = cellRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth) || 0, sizeY: cell.sizeY || ((_b = cellRef.current) === null || _b === void 0 ? void 0 : _b.clientHeight) || 0, transformX: cell.transformX || 0, transformY: cell.transformY || 0, idx: i, cellRef }, cell);
517
- });
518
- rightCols.forEach(i => {
519
- var _a, _b;
520
- const cell = grid.childs[i];
521
- const cellRef = cellsRef.current[i];
522
- rightCells[i] = Object.assign({ sizeX: cell.sizeX || ((_a = cellRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth) || 0, sizeY: cell.sizeY || ((_b = cellRef.current) === null || _b === void 0 ? void 0 : _b.clientHeight) || 0, transformX: cell.transformX || 0, transformY: cell.transformY || 0, idx: i, cellRef }, cell);
523
- });
524
- const newDirection = isRevert
525
- ? {
526
- left: 'right',
527
- right: 'left',
528
- top: 'bottom',
529
- bottom: 'top',
530
- }[direction]
531
- : direction;
532
- startCellRef.current = {
533
- clientX,
534
- clientY,
535
- // idx: newIdx,
536
- direction: newDirection,
537
- isRevert,
538
- leftCells: isRevert ? rightCells : leftCells,
539
- rightCells: !isRevert ? rightCells : leftCells,
540
- };
541
- // console.log('down cell', clientX, clientY, idx, direction, cell, cellRef);
542
- gridRef.current = grid;
543
- };
544
- const handleDown = (e, type, line, idx, direction, cell, cellRef) => {
545
- const { clientX, clientY } = e;
546
- // rebaseCordinate(clientX, clientY, type, line);
547
- startRef.current = { clientX, clientY, type, line };
548
- // const isRevert = ['top', 'left'].includes(direction);
549
- // const { leftCols, rightCols } = findResizeCells({ type, line, direction, idx, isRevert });
550
- // console.log('change cell', leftCols, rightCols);
551
- // console.log('down', type, line, clientX, clientY);
552
- gridRef.current = JSON.parse(JSON.stringify(grid));
553
- };
554
- const handleUp = (e, direction, idx) => {
555
- // console.log('up', direction, idx, e);
556
- startRef.current = null;
557
- startCellRef.current = null;
558
- lineVertical(false);
559
- lineHorizontal(false);
560
- };
561
- const downSelect = (idx, cell) => {
562
- // console.log('dow select', idx, cell);
563
- if (isPreview)
564
- return;
565
- !cell.active && activeCell({ idx });
566
- selectRef.current = { idx, cell };
567
- gridRef.current = grid;
568
- };
569
- const unMerge = (cell, idx) => {
570
- if (isPreview)
571
- return;
572
- const { colStart, colEnd, rowStart, rowEnd } = cell;
573
- if (colStart + 1 === colEnd && rowStart + 1 === rowEnd) {
574
- return;
575
- }
576
- const newChilds = [...grid.childs];
577
- for (let i = rowStart; i < rowEnd; i++) {
578
- for (let j = colStart; j < colEnd; j++) {
579
- const rStart = i;
580
- const cStart = j;
581
- const rEnd = rStart + 1;
582
- const cEnd = cStart + 1;
583
- // console.log('merge', i, j, rStart, cStart, rEnd, cEnd)
584
- const newChild = {
585
- colStart: cStart,
586
- colEnd: cEnd,
587
- rowStart: rStart,
588
- rowEnd: rEnd,
589
- };
590
- if (i === rowStart && j === colStart) {
591
- newChilds[idx] = newChild;
592
- }
593
- else if (rStart !== rowStart ||
594
- rEnd !== rowEnd ||
595
- cStart !== colStart ||
596
- cEnd !== colEnd) {
597
- newChilds.splice(idx, 0, newChild);
598
- }
599
- }
600
- }
601
- setGrid(prev => (Object.assign(Object.assign({}, prev), { childs: newChilds })));
602
- };
603
- function resetBackgroundCellRef() {
604
- Object.values(cellsRef.current).forEach(r => {
605
- if (r.current) {
606
- r.current.style.background = 'unset';
607
- }
608
- });
609
- }
610
- const upSelect = (idx, cell) => {
611
- if (isPreview)
612
- return;
613
- // console.log('up select', idx, cell);
614
- if (selectRef.current &&
615
- selectEndRef.current &&
616
- gridRef.current &&
617
- selectRef.current.idx !== selectEndRef.current.idx &&
618
- (selectEndRef.current.cell.rowEnd > selectRef.current.cell.rowEnd ||
619
- selectEndRef.current.cell.colEnd > selectRef.current.cell.colEnd)) {
620
- resetBackgroundCellRef();
621
- // console.log('merge', selectRef.current, selectEndRef.current)
622
- const { cell: cellStart, idx: idxStart } = selectRef.current;
623
- const { cell: cellEnd, idx: idxEnd, hCells } = selectEndRef.current;
624
- const newChilds = JSON.parse(JSON.stringify(gridRef.current.childs));
625
- newChilds[idxStart].rowEnd = cellEnd.rowEnd;
626
- newChilds[idxStart].colEnd = cellEnd.colEnd;
627
- delete newChilds[idxStart].sizeX;
628
- delete newChilds[idxStart].sizeY;
629
- hCells.reverse().forEach(i => {
630
- if (i !== idxStart) {
631
- newChilds.splice(i, 1);
632
- delete cellsRef.current[i];
633
- delete cordinatesRef.current[i];
634
- // console.log('del corr', i, cordinatesRef.current)
635
- }
636
- });
637
- setGrid(Object.assign(Object.assign({}, gridRef.current), { childs: newChilds }));
638
- }
639
- selectRef.current = null;
640
- selectEndRef.current = null;
641
- };
642
- const hoverSelect = (idx, cell) => {
643
- if (isPreview)
644
- return;
645
- if (selectRef.current && gridRef.current) {
646
- // console.log('hover select', idx, cell);
647
- const { cell: cellStart, idx: idxStart } = selectRef.current;
648
- const hCells = [];
649
- gridRef.current.childs.forEach((child, i) => {
650
- if (child.rowStart >= cellStart.rowStart &&
651
- child.rowEnd <= cell.rowEnd &&
652
- child.colStart >= cellStart.colStart &&
653
- child.colEnd <= cell.colEnd) {
654
- hCells.push(i);
655
- }
656
- });
657
- // console.log('hCells', hCells)
658
- resetBackgroundCellRef();
659
- hCells.forEach(i => {
660
- const cellRef = cellsRef.current[i];
661
- if (cellRef && cellRef.current) {
662
- cellRef.current.style.background = selectColor || 'unset';
663
- }
664
- });
665
- selectEndRef.current = { cell, idx, hCells };
666
- gridRef.current = grid;
667
- }
668
- };
669
- const setRef = (idx, ref) => {
670
- cellsRef.current[idx] = ref;
671
- // console.log('cellsRef.current', cellsRef.current)
672
- };
673
- const setCordinate = (idx) => __awaiter(void 0, void 0, void 0, function* () {
674
- // while(!cellsRef[idx]) {
675
- // await new Promise(r => {setTimeout(r, 100)});
676
- // console.log('wait', idx, cellsRef[idx])
677
- // }
678
- var _b;
679
- if (containerRef.current) {
680
- const container = containerRef.current.getBoundingClientRect();
681
- const childRef = cellsRef.current[idx];
682
- const childBox = (_b = childRef.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
683
- if (childBox) {
684
- const cordinate = {
685
- width: childBox.width,
686
- height: childBox.height,
687
- x: childBox.x - container.x,
688
- y: childBox.y - container.y,
689
- xEnd: childBox.x - container.x + childBox.width,
690
- yEnd: childBox.y - container.y + childBox.height,
691
- };
692
- cordinatesRef.current[idx] = cordinate;
693
- // console.log('set cor', idx, cordinate);
694
- }
695
- }
696
- // console.log('set corr', idx, cordinatesRef.current)
697
- });
698
- const renderGrid = (style) => {
699
- const { gridTemplateColumns, gridTemplateRows, childs } = grid;
700
- // console.log('grid', { gridTemplateColumns, gridTemplateRows, childs });
701
- return (React.createElement("div", { className: "grid-container", ref: containerRef, style: Object.assign({ gridTemplateColumns: gridTemplateColumns.map(fr => `${fr}%`).join(' '), gridTemplateRows: gridTemplateRows.map(fr => `${fr}%`).join(' ') }, style) }, childs.map((cell, idx) => (React.createElement(Cell, { key: `${cell.rowStart}-${cell.colStart}-${cell.rowEnd}-${cell.colEnd}`, idx: idx, cell: cell, down: handleDown, downCell: handleDownCell, up: handleUp, setRef: setRef, setCordinate: setCordinate, downSelect: downSelect, upSelect: upSelect, hoverSelect: hoverSelect, unMerge: unMerge, renderCell: renderCell, borderStyle: cellBorder, style: cellStyle, activeStyle: cellActiveStyle, isPreview: isPreview, rowPercentage: grid.gridTemplateRows[cell.rowStart - 1], colPercentage: grid.gridTemplateColumns[cell.colStart - 1], ctrlKeyRef: ctrlKeyRef })))));
702
- };
703
- const handleUpLine = () => {
704
- lineVertical(false);
705
- lineHorizontal(false);
706
- };
707
- const _a = containerStyle || {}, { borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius, borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth, borderStyle, borderColor } = _a, rest = __rest(_a, ["borderTopLeftRadius", "borderTopRightRadius", "borderBottomRightRadius", "borderBottomLeftRadius", "borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth", "borderStyle", "borderColor"]);
708
- const renderLines = () => (React.createElement(React.Fragment, null,
709
- React.createElement(StyledLine, { ref: verticalLineRef, className: "vertical", onMouseUp: handleUpLine }),
710
- React.createElement(StyledLine, { ref: horizontalLineRef, className: "horizontal", onMouseUp: handleUpLine })));
711
- return (React.createElement(StyledGrid, { className: "grid-wrapper", isCompact: !!isCompact },
712
- React.createElement("div", { className: "layers", ref: layersRef },
713
- React.createElement(StyledBGLayer, { style: {
714
- backgroundImage: image ? `url(${image})` : 'unset',
715
- backgroundSize: imageSize === 'fill' ? '100% 100%' : imageSize,
716
- backgroundPosition: imagePosition,
717
- } }),
718
- React.createElement(StyledMiddleLayer, { style: {
719
- borderTopLeftRadius,
720
- borderTopRightRadius,
721
- borderBottomRightRadius,
722
- borderBottomLeftRadius,
723
- borderTopWidth,
724
- borderRightWidth,
725
- borderBottomWidth,
726
- borderLeftWidth,
727
- borderStyle,
728
- borderColor,
729
- } }),
730
- renderGrid(Object.assign(Object.assign({}, rest), { borderTopLeftRadius,
731
- borderTopRightRadius,
732
- borderBottomRightRadius,
733
- borderBottomLeftRadius }))),
734
- renderLines()));
735
- };
736
- ResizeGrid.defaultProps = defaultProps;
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __rest = (this && this.__rest) || function (s, e) {
11
+ var t = {};
12
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
13
+ t[p] = s[p];
14
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
15
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
16
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
17
+ t[p[i]] = s[p[i]];
18
+ }
19
+ return t;
20
+ };
21
+ import React, { useState, useRef, useEffect } from 'react';
22
+ import { Cell } from './components/Cell';
23
+ import { GRID_TEMPLATE, MIN_SIZE, THREADHOLD, buildGrid } from './constant';
24
+ import { StyledGrid, StyledMiddleLayer, StyledBGLayer, StyledLine } from './styled';
25
+ import { useDeepCompareEffect } from '../../../hooks/useDeepCompareEffect';
26
+ const defaultProps = {
27
+ containerStyle: {},
28
+ cellBorder: '1px dotted',
29
+ cellStyle: {},
30
+ cellActiveStyle: { background: '#2f79bf80' },
31
+ isPreview: false,
32
+ isCompact: false,
33
+ delayUpdate: 200,
34
+ selectColor: '#2f79bf80',
35
+ };
36
+ export const ResizeGrid = props => {
37
+ const { containerStyle, cellBorder, cellStyle, cellActiveStyle, isPreview, renderCell, grid: initGrid, image, imageSize, imagePosition, isCompact, onChange, delayUpdate, selectColor, reCalculateFlag, } = props;
38
+ const [grid, setGrid] = useState(buildGrid(initGrid || GRID_TEMPLATE.GRID_2_3));
39
+ const startRef = useRef(null);
40
+ const startCellRef = useRef(null);
41
+ const selectRef = useRef(null);
42
+ const selectEndRef = useRef(null);
43
+ const gridRef = useRef();
44
+ const containerRef = useRef(null);
45
+ const verticalLineRef = useRef(null);
46
+ const horizontalLineRef = useRef(null);
47
+ const layersRef = useRef(null);
48
+ const cellsRef = useRef({});
49
+ const cordinatesRef = useRef({});
50
+ const onChangeTimoutRef = useRef();
51
+ const onChangeDelayRef = useRef();
52
+ const acceptUpdateRef = useRef(false);
53
+ const firstChangeRef = useRef(true);
54
+ const ctrlKeyRef = useRef(false);
55
+ const initRef = useRef(0);
56
+ const initDoneRef = useRef(false);
57
+ // console.log('grid', grid)
58
+ function lineVertical(isShow = true, left = 0) {
59
+ if (verticalLineRef.current && layersRef.current) {
60
+ verticalLineRef.current.style.display = isShow ? 'block' : 'none';
61
+ layersRef.current.style.opacity = isShow ? '.5' : '1';
62
+ verticalLineRef.current.style.left = `${left}px`;
63
+ }
64
+ }
65
+ function lineHorizontal(isShow = true, top = 0) {
66
+ if (horizontalLineRef.current && layersRef.current) {
67
+ horizontalLineRef.current.style.display = isShow ? 'block' : 'none';
68
+ layersRef.current.style.opacity = isShow ? '.5' : '1';
69
+ horizontalLineRef.current.style.top = `${top}px`;
70
+ }
71
+ }
72
+ const handleChangeGrid = () => {
73
+ clearTimeout(onChangeTimoutRef.current);
74
+ onChangeTimoutRef.current = setTimeout(() => {
75
+ if (containerRef.current && cellsRef.current && cellsRef.current[0]) {
76
+ const container = containerRef.current.getBoundingClientRect();
77
+ // Object.values(cordinatesRef.current);
78
+ const childs = Object.values(cellsRef.current).map(cell => {
79
+ if (!cell || !cell.current)
80
+ return;
81
+ const childBox = cell.current.getBoundingClientRect();
82
+ return {
83
+ width: childBox.width,
84
+ height: childBox.height,
85
+ x: childBox.x - container.x,
86
+ y: childBox.y - container.y,
87
+ };
88
+ });
89
+ if (typeof onChange === 'function') {
90
+ onChange(grid, childs, firstChangeRef.current ? 'system' : 'user');
91
+ acceptUpdateRef.current = false;
92
+ firstChangeRef.current = false;
93
+ clearTimeout(onChangeDelayRef.current);
94
+ onChangeDelayRef.current = setTimeout(() => {
95
+ acceptUpdateRef.current = true;
96
+ }, delayUpdate);
97
+ }
98
+ }
99
+ }, 300);
100
+ };
101
+ const isFollow = (cell, line, isCol = true) => isCol
102
+ ? (cell.colEnd !== line || !cell.sizeX) && (cell.colStart !== line || !cell.sizeX)
103
+ : (cell.rowEnd !== line || !cell.sizeY) && (cell.rowStart !== line || !cell.sizeY);
104
+ const notFollow = (cell, line, isCol = true) => !isFollow(cell, line, isCol);
105
+ const floorSize = size => Math.floor(size);
106
+ useEffect(() => {
107
+ handleChangeGrid();
108
+ // eslint-disable-next-line react-hooks/exhaustive-deps
109
+ }, [grid, reCalculateFlag]);
110
+ useDeepCompareEffect(() => {
111
+ // console.log('changed grid', initGrid, acceptUpdateRef.current, initGrid?.rows, initGrid?.cols)
112
+ // console.log(initRef.current < 2,!initDoneRef.current, acceptUpdateRef.current)
113
+ if ((initRef.current < 2 || !initDoneRef.current || acceptUpdateRef.current) &&
114
+ (initGrid === null || initGrid === void 0 ? void 0 : initGrid.rows) &&
115
+ (initGrid === null || initGrid === void 0 ? void 0 : initGrid.cols)) {
116
+ // console.log('apply change...', buildGrid(initGrid))
117
+ initRef.current += 1;
118
+ firstChangeRef.current = true;
119
+ setGrid(buildGrid(initGrid));
120
+ resetBackgroundCellRef();
121
+ }
122
+ // eslint-disable-next-line react-hooks/exhaustive-deps
123
+ }, [initGrid]);
124
+ useEffect(() => {
125
+ setTimeout(() => {
126
+ initDoneRef.current = true;
127
+ }, 3000);
128
+ const handleMove = e => {
129
+ // Resize Grid
130
+ if (startRef.current && gridRef.current && containerRef.current) {
131
+ const { type, line } = startRef.current;
132
+ const idx = line - 1;
133
+ const { gridTemplateRows, gridTemplateColumns, rows, cols, childs } = gridRef.current;
134
+ if (idx <= 0 || (type === 'row' && idx >= rows) || (type === 'column' && idx >= cols))
135
+ return;
136
+ const { clientX, clientY } = e;
137
+ if (type === 'row') {
138
+ const gridHeight = containerRef.current.offsetHeight;
139
+ const yDistant = clientY - startRef.current.clientY;
140
+ const yPercentDistant = (100 * yDistant) / gridHeight;
141
+ const minPercent = (100 * MIN_SIZE) / gridHeight;
142
+ // console.log('move Y', clientY, yDistant, yPercentDistant);
143
+ const newArr = [...gridTemplateRows];
144
+ newArr[idx - 1] += yPercentDistant;
145
+ newArr[idx] -= yPercentDistant;
146
+ if (newArr[idx - 1] >= minPercent && newArr[idx] >= minPercent) {
147
+ const newChilds = JSON.parse(JSON.stringify(childs));
148
+ let isValidChildSize = true;
149
+ newChilds.forEach((child, idx) => {
150
+ var _a, _b;
151
+ if (isValidChildSize && notFollow(child, (_a = startRef.current) === null || _a === void 0 ? void 0 : _a.line, false)) {
152
+ if (child.rowStart === ((_b = startRef.current) === null || _b === void 0 ? void 0 : _b.line)) {
153
+ if (child.transformY) {
154
+ child.transformY = +child.transformY - yDistant;
155
+ }
156
+ else {
157
+ child.sizeY = +child.sizeY - yDistant;
158
+ }
159
+ }
160
+ else {
161
+ child.transformY &&
162
+ !child.movedBottom &&
163
+ (child.sizeY = +child.sizeY + yDistant);
164
+ }
165
+ // console.log('check...', startRef.current.line, child.transformY, yDistant, +child.transformY - yDistant)
166
+ if (child.sizeY < MIN_SIZE) {
167
+ isValidChildSize = false;
168
+ }
169
+ }
170
+ });
171
+ isValidChildSize &&
172
+ setGrid(Object.assign(Object.assign({}, gridRef.current), { gridTemplateRows: newArr, childs: newChilds }));
173
+ }
174
+ }
175
+ else {
176
+ const xDistant = clientX - startRef.current.clientX;
177
+ const gridWidth = containerRef.current.offsetWidth;
178
+ const xPercentDistant = (100 * xDistant) / gridWidth;
179
+ const minPercent = (100 * MIN_SIZE) / gridWidth;
180
+ // console.log('move X', clientX, xDistant, xPercentDistant);
181
+ const newArr = [...gridTemplateColumns];
182
+ newArr[idx - 1] += xPercentDistant;
183
+ newArr[idx] -= xPercentDistant;
184
+ if (newArr[idx - 1] >= minPercent && newArr[idx] >= minPercent) {
185
+ const newChilds = JSON.parse(JSON.stringify(childs));
186
+ let isValidChildSize = true;
187
+ newChilds.forEach(child => {
188
+ if (isValidChildSize && notFollow(child, line)) {
189
+ if (child.colStart === line) {
190
+ if (child.transformX) {
191
+ child.transformX = +child.transformX - xDistant;
192
+ }
193
+ else {
194
+ child.sizeX = +child.sizeX - xDistant;
195
+ }
196
+ }
197
+ else {
198
+ child.transformX && !child.movedRight && (child.sizeX = +child.sizeX + xDistant);
199
+ }
200
+ // console.log('check...', startRef.current.line, child.transformX, xDistant, +child.transformX - xDistant)
201
+ if (child.sizeX < MIN_SIZE) {
202
+ isValidChildSize = false;
203
+ }
204
+ }
205
+ });
206
+ isValidChildSize &&
207
+ setGrid(Object.assign(Object.assign({}, gridRef.current), { gridTemplateColumns: newArr, childs: newChilds }));
208
+ }
209
+ }
210
+ }
211
+ //-------------------------------------------
212
+ // Resize Cell
213
+ if (startCellRef.current && gridRef.current) {
214
+ const { clientX: startClientX, clientY: startClientY, direction, isRevert, leftCells, rightCells, } = startCellRef.current;
215
+ // const { rowStart, rowEnd, colStart, colEnd, transformX, transformY } = cell;
216
+ // const { gridTemplateRows, gridTemplateColumns, rows, cols, childs } = gridRef.current;
217
+ // if (
218
+ // idx < 0 ||
219
+ // (direction === 'top' && rowStart === 1) ||
220
+ // (direction === 'right' && colEnd === cols + 1) ||
221
+ // (direction === 'bottom' && rowEnd === rows + 1) ||
222
+ // (direction === 'left' && colStart === 1)
223
+ // )
224
+ // return;
225
+ const { clientX, clientY } = e;
226
+ if (['top', 'bottom'].includes(direction)) {
227
+ // const cellHeight = cellRef.current.offsetHeight;
228
+ let yDistant = clientY - startClientY;
229
+ // console.log('move Y', clientY, yDistant);
230
+ if (Math.abs(yDistant) > THREADHOLD) {
231
+ startCellRef.current.fallback = true;
232
+ }
233
+ let isValid = true;
234
+ const mapNewSizeTop = {};
235
+ const mapNewSizeBottom = {};
236
+ const leftKeys = Object.keys(leftCells);
237
+ leftKeys.forEach(cellIdx => {
238
+ const cell = leftCells[cellIdx];
239
+ let newHeight = (cell.sizeY || 0) + yDistant;
240
+ if (newHeight < MIN_SIZE) {
241
+ isValid = false;
242
+ }
243
+ else {
244
+ const cellCordinate = cordinatesRef.current[cellIdx];
245
+ // const cell = gridRef.current.childs[cellIdx];
246
+ const newYEnd = cellCordinate.y + newHeight;
247
+ const nearestCells = Object.entries(cordinatesRef.current).filter(cor => gridRef.current &&
248
+ gridRef.current.childs[cor[0]] &&
249
+ !leftKeys.includes(cor[0]) &&
250
+ gridRef.current.childs[cor[0]].colStart !== cell.colStart &&
251
+ Math.abs(cor[1].yEnd - newYEnd) <= THREADHOLD);
252
+ // console.log('nearestCells', nearestCells, newXEnd, leftKeys, cordinatesRef.current);
253
+ if (nearestCells.length && startCellRef.current) {
254
+ const nearestY = Math.abs(nearestCells[0][1].y - newYEnd) <= THREADHOLD
255
+ ? nearestCells[0][1].y
256
+ : nearestCells[0][1].yEnd;
257
+ const delta = nearestY - newYEnd;
258
+ if (startCellRef.current.fallback ||
259
+ floorSize(cellCordinate.height) !== floorSize(newHeight + delta)) {
260
+ newHeight += delta;
261
+ yDistant += delta;
262
+ lineHorizontal(true, nearestY - 1);
263
+ }
264
+ }
265
+ else {
266
+ lineHorizontal(false);
267
+ }
268
+ mapNewSizeTop[cellIdx] = newHeight;
269
+ }
270
+ });
271
+ Object.keys(rightCells).forEach(cellIdx => {
272
+ const nextCell = rightCells[cellIdx];
273
+ const newHeightNextCell = (nextCell.sizeY || 0) - yDistant;
274
+ if (newHeightNextCell < MIN_SIZE) {
275
+ isValid = false;
276
+ }
277
+ mapNewSizeBottom[cellIdx] = [newHeightNextCell, nextCell];
278
+ });
279
+ if (isValid) {
280
+ const newChilds = [...gridRef.current.childs];
281
+ Object.keys(mapNewSizeTop).forEach(cellIdx => {
282
+ newChilds[cellIdx] = Object.assign(Object.assign({}, newChilds[cellIdx]), { sizeY: mapNewSizeTop[cellIdx], movedBottom: true });
283
+ });
284
+ Object.keys(mapNewSizeBottom).forEach(cellIdx => {
285
+ newChilds[cellIdx] = Object.assign(Object.assign({}, newChilds[cellIdx]), { sizeY: mapNewSizeBottom[cellIdx][0], transformY: (mapNewSizeBottom[cellIdx][1].transformY || 0) + yDistant, movedTop: true });
286
+ });
287
+ setGrid(Object.assign(Object.assign({}, gridRef.current), { childs: newChilds }));
288
+ }
289
+ }
290
+ else {
291
+ // const cellWidth = cellRef.current.offsetWidth;
292
+ let xDistant = clientX - startClientX;
293
+ // console.log('move X', clientX, xDistant);
294
+ if (Math.abs(xDistant) > THREADHOLD) {
295
+ startCellRef.current.fallback = true;
296
+ }
297
+ let isValid = true;
298
+ const mapNewSizeLeft = {};
299
+ const mapNewSizeRight = {};
300
+ const mapReset = {};
301
+ const leftKeys = Object.keys(leftCells);
302
+ leftKeys.forEach(cellIdx => {
303
+ const cell = leftCells[cellIdx];
304
+ let newWidth = (cell.sizeX || 0) + xDistant;
305
+ if (newWidth < MIN_SIZE) {
306
+ isValid = false;
307
+ }
308
+ else if (gridRef.current) {
309
+ const cellCordinate = cordinatesRef.current[cellIdx];
310
+ // const cell = gridRef.current.childs[cellIdx];
311
+ const newXEnd = cellCordinate.x + newWidth;
312
+ const nearestCells = Object.entries(cordinatesRef.current).filter(cor => gridRef.current &&
313
+ gridRef.current.childs[cor[0]] &&
314
+ !leftKeys.includes(cor[0]) &&
315
+ gridRef.current.childs[cor[0]].rowStart !== cell.rowStart &&
316
+ Math.abs(cor[1].xEnd - newXEnd) <= THREADHOLD);
317
+ // console.log('nearestCells', nearestCells, newXEnd, leftKeys, cordinatesRef.current);
318
+ if (nearestCells.length && startCellRef.current) {
319
+ const nearestX = Math.abs(nearestCells[0][1].x - newXEnd) <= THREADHOLD
320
+ ? nearestCells[0][1].x
321
+ : nearestCells[0][1].xEnd;
322
+ const delta = nearestX - newXEnd;
323
+ if (startCellRef.current.fallback ||
324
+ floorSize(cellCordinate.width) !== floorSize(newWidth + delta)) {
325
+ newWidth += delta;
326
+ xDistant += delta;
327
+ lineVertical(true, nearestX - 1);
328
+ }
329
+ }
330
+ else {
331
+ lineVertical(false);
332
+ }
333
+ mapNewSizeLeft[cellIdx] = newWidth;
334
+ }
335
+ });
336
+ Object.keys(rightCells).forEach(cellIdx => {
337
+ const nextCell = rightCells[cellIdx];
338
+ const newWidthNextCell = (nextCell.sizeX || 0) - xDistant;
339
+ if (newWidthNextCell < MIN_SIZE) {
340
+ isValid = false;
341
+ }
342
+ mapNewSizeRight[cellIdx] = [newWidthNextCell, nextCell];
343
+ });
344
+ if (isValid) {
345
+ const newChilds = [...gridRef.current.childs];
346
+ Object.keys(mapNewSizeLeft).forEach(cellIdx => {
347
+ newChilds[cellIdx] = Object.assign(Object.assign({}, newChilds[cellIdx]), { sizeX: mapNewSizeLeft[cellIdx], movedRight: true });
348
+ });
349
+ Object.keys(mapNewSizeRight).forEach(cellIdx => {
350
+ newChilds[cellIdx] = Object.assign(Object.assign({}, newChilds[cellIdx]), { sizeX: mapNewSizeRight[cellIdx][0], transformX: (mapNewSizeRight[cellIdx][1].transformX || 0) + xDistant, movedLeft: true });
351
+ });
352
+ setGrid(Object.assign(Object.assign({}, gridRef.current), { childs: newChilds }));
353
+ }
354
+ }
355
+ }
356
+ //------------------------------------------
357
+ // if (selectRef.current) {}
358
+ };
359
+ const handleUp = () => {
360
+ startRef.current = null;
361
+ startCellRef.current = null;
362
+ lineVertical(false);
363
+ lineHorizontal(false);
364
+ };
365
+ const isMac = () => navigator.platform.indexOf('Mac') >= 0;
366
+ window.addEventListener('mousemove', handleMove);
367
+ window.addEventListener('mouseup', handleUp);
368
+ const handleKeyDown = e => {
369
+ if (!ctrlKeyRef.current && ((isMac() && e.metaKey) || (!isMac() && e.key === 'Control'))) {
370
+ ctrlKeyRef.current = true;
371
+ // console.log('ctrlKeyRef', ctrlKeyRef.current);
372
+ }
373
+ };
374
+ const handleKeyUp = () => {
375
+ ctrlKeyRef.current = false;
376
+ // console.log('ctrlKeyRef', ctrlKeyRef.current);
377
+ };
378
+ window.addEventListener('keydown', handleKeyDown);
379
+ window.addEventListener('keyup', handleKeyUp);
380
+ return () => {
381
+ window.removeEventListener('mousemove', handleMove);
382
+ window.removeEventListener('mouseup', handleUp);
383
+ window.removeEventListener('keydown', handleKeyDown);
384
+ window.removeEventListener('keyup', handleKeyUp);
385
+ };
386
+ }, []);
387
+ // const rebaseCordinate = (x, y, ...rest) => {
388
+ // if (containerRef.current) {
389
+ // const container = containerRef.current.getBoundingClientRect();
390
+ // console.log('rebased', x - container.x, y - container.y, ...rest);
391
+ // }
392
+ // };
393
+ const activeCell = ({ idx }) => {
394
+ setGrid(prev => (Object.assign(Object.assign({}, prev), { childs: prev.childs.map((c, i) => (Object.assign(Object.assign({}, c), { active: i === idx }))) })));
395
+ };
396
+ const findResizeCells = ({ type, line, direction, idx,
397
+ // cell,
398
+ isRevert, leftCols = [], rightCols = [], dones = [], level = 0, }) => {
399
+ // left is current cell and right is the opposite
400
+ if (dones.includes(idx)) {
401
+ return null;
402
+ }
403
+ const { childs } = grid;
404
+ const cellBox = cordinatesRef.current[idx];
405
+ dones.push(idx);
406
+ if (level === 0 && !leftCols.length) {
407
+ leftCols.push(idx);
408
+ }
409
+ let isEnd = true;
410
+ if (type === 'column') {
411
+ childs.forEach((cell, i) => {
412
+ if (((direction === 'left' &&
413
+ cell.colEnd === line &&
414
+ Math.abs(cellBox.x - cordinatesRef.current[i].xEnd) < 1) ||
415
+ (direction === 'right' &&
416
+ cell.colStart === line &&
417
+ Math.abs(cellBox.xEnd - cordinatesRef.current[i].x) < 1)) &&
418
+ !(floorSize(cordinatesRef.current[i].y) >= floorSize(cellBox.yEnd) ||
419
+ floorSize(cordinatesRef.current[i].yEnd) <= floorSize(cellBox.y))) {
420
+ if (!rightCols.includes(i)) {
421
+ rightCols.push(i);
422
+ // const cellIRef = cellsRef.current[i];
423
+ // if (cellIRef.current) {
424
+ // cellIRef.current.style.background = 'green';
425
+ // }
426
+ isEnd = false;
427
+ }
428
+ // else if (direction === 'right' && !leftCols.includes(i)) {
429
+ // leftCols.push(i);
430
+ // const cellIRef = cellsRef.current[i];
431
+ // if (cellIRef.current) {
432
+ // cellIRef.current.style.background = 'blue';
433
+ // }
434
+ // isEnd = false;
435
+ // }
436
+ }
437
+ });
438
+ }
439
+ else {
440
+ childs.forEach((cell, i) => {
441
+ if (((direction === 'top' &&
442
+ cell.rowEnd === line &&
443
+ Math.abs(cellBox.y - cordinatesRef.current[i].yEnd) < 1) ||
444
+ (direction === 'bottom' &&
445
+ cell.rowStart === line &&
446
+ Math.abs(cellBox.yEnd - cordinatesRef.current[i].y) < 1)) &&
447
+ !(floorSize(cordinatesRef.current[i].x) >= floorSize(cellBox.xEnd) ||
448
+ floorSize(cordinatesRef.current[i].xEnd) <= floorSize(cellBox.x))) {
449
+ if (!rightCols.includes(i)) {
450
+ rightCols.push(i);
451
+ // const cellIRef = cellsRef.current[i];
452
+ // if (cellIRef.current) {
453
+ // cellIRef.current.style.background = 'green';
454
+ // }
455
+ isEnd = false;
456
+ }
457
+ // else if (direction === 'bottom' && !leftCols.includes(i)) {
458
+ // leftCols.push(i);
459
+ // const cellIRef = cellsRef.current[i];
460
+ // if (cellIRef.current) {
461
+ // cellIRef.current.style.background = 'blue';
462
+ // }
463
+ // isEnd = false;
464
+ // }
465
+ }
466
+ });
467
+ }
468
+ // console.log(' find', direction, idx, leftCols, rightCols, dones, cordinatesRef.current);
469
+ if (!isEnd) {
470
+ // console.log('continue find', leftCols, rightCols);
471
+ rightCols
472
+ .filter(i => !dones.includes(i))
473
+ .forEach(i => {
474
+ findResizeCells({
475
+ type,
476
+ line,
477
+ direction: { left: 'right', right: 'left', top: 'bottom', bottom: 'top' }[direction] || '',
478
+ idx: i,
479
+ isRevert,
480
+ leftCols: rightCols,
481
+ rightCols: leftCols,
482
+ dones,
483
+ level: level + 1,
484
+ });
485
+ });
486
+ }
487
+ return { leftCols, rightCols };
488
+ };
489
+ const handleDownCell = (e, type, line, idx, direction, cell, cellRef) => {
490
+ const { clientX, clientY } = e;
491
+ // rebaseCordinate(clientX, clientY, type, line);
492
+ const isRevert = ['top', 'left'].includes(direction);
493
+ // let newIdx = isRevert ? idx - 1 : idx;
494
+ // let nextCellIdx = isRevert ? idx - 1 : idx + 1;
495
+ const leftCols = [idx];
496
+ const rightCols = [];
497
+ findResizeCells({ type, line, direction, idx, isRevert, leftCols, rightCols });
498
+ // console.log('change cell', leftCols, rightCols);
499
+ // if (['top', 'bottom'].includes(direction)) {
500
+ // nextCellIdx = grid.childs.findIndex(
501
+ // b =>
502
+ // b.colStart === cell.colStart &&
503
+ // ((isRevert && b.rowEnd === cell.rowStart) || (!isRevert && b.rowStart === cell.rowEnd)),
504
+ // );
505
+ // newIdx = isRevert ? nextCellIdx : idx;
506
+ // }
507
+ // if (nextCellIdx < 0) return;
508
+ if (!leftCols.length || !rightCols.length)
509
+ return;
510
+ const leftCells = {};
511
+ const rightCells = {};
512
+ leftCols.forEach(i => {
513
+ var _a, _b;
514
+ const cell = grid.childs[i];
515
+ const cellRef = cellsRef.current[i];
516
+ leftCells[i] = Object.assign({ sizeX: cell.sizeX || ((_a = cellRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth) || 0, sizeY: cell.sizeY || ((_b = cellRef.current) === null || _b === void 0 ? void 0 : _b.clientHeight) || 0, transformX: cell.transformX || 0, transformY: cell.transformY || 0, idx: i, cellRef }, cell);
517
+ });
518
+ rightCols.forEach(i => {
519
+ var _a, _b;
520
+ const cell = grid.childs[i];
521
+ const cellRef = cellsRef.current[i];
522
+ rightCells[i] = Object.assign({ sizeX: cell.sizeX || ((_a = cellRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth) || 0, sizeY: cell.sizeY || ((_b = cellRef.current) === null || _b === void 0 ? void 0 : _b.clientHeight) || 0, transformX: cell.transformX || 0, transformY: cell.transformY || 0, idx: i, cellRef }, cell);
523
+ });
524
+ const newDirection = isRevert
525
+ ? {
526
+ left: 'right',
527
+ right: 'left',
528
+ top: 'bottom',
529
+ bottom: 'top',
530
+ }[direction]
531
+ : direction;
532
+ startCellRef.current = {
533
+ clientX,
534
+ clientY,
535
+ // idx: newIdx,
536
+ direction: newDirection,
537
+ isRevert,
538
+ leftCells: isRevert ? rightCells : leftCells,
539
+ rightCells: !isRevert ? rightCells : leftCells,
540
+ };
541
+ // console.log('down cell', clientX, clientY, idx, direction, cell, cellRef);
542
+ gridRef.current = grid;
543
+ };
544
+ const handleDown = (e, type, line, idx, direction, cell, cellRef) => {
545
+ const { clientX, clientY } = e;
546
+ // rebaseCordinate(clientX, clientY, type, line);
547
+ startRef.current = { clientX, clientY, type, line };
548
+ // const isRevert = ['top', 'left'].includes(direction);
549
+ // const { leftCols, rightCols } = findResizeCells({ type, line, direction, idx, isRevert });
550
+ // console.log('change cell', leftCols, rightCols);
551
+ // console.log('down', type, line, clientX, clientY);
552
+ gridRef.current = JSON.parse(JSON.stringify(grid));
553
+ };
554
+ const handleUp = (e, direction, idx) => {
555
+ // console.log('up', direction, idx, e);
556
+ startRef.current = null;
557
+ startCellRef.current = null;
558
+ lineVertical(false);
559
+ lineHorizontal(false);
560
+ };
561
+ const downSelect = (idx, cell) => {
562
+ // console.log('dow select', idx, cell);
563
+ if (isPreview)
564
+ return;
565
+ !cell.active && activeCell({ idx });
566
+ selectRef.current = { idx, cell };
567
+ gridRef.current = grid;
568
+ };
569
+ const unMerge = (cell, idx) => {
570
+ if (isPreview)
571
+ return;
572
+ const { colStart, colEnd, rowStart, rowEnd } = cell;
573
+ if (colStart + 1 === colEnd && rowStart + 1 === rowEnd) {
574
+ return;
575
+ }
576
+ const newChilds = [...grid.childs];
577
+ for (let i = rowStart; i < rowEnd; i++) {
578
+ for (let j = colStart; j < colEnd; j++) {
579
+ const rStart = i;
580
+ const cStart = j;
581
+ const rEnd = rStart + 1;
582
+ const cEnd = cStart + 1;
583
+ // console.log('merge', i, j, rStart, cStart, rEnd, cEnd)
584
+ const newChild = {
585
+ colStart: cStart,
586
+ colEnd: cEnd,
587
+ rowStart: rStart,
588
+ rowEnd: rEnd,
589
+ };
590
+ if (i === rowStart && j === colStart) {
591
+ newChilds[idx] = newChild;
592
+ }
593
+ else if (rStart !== rowStart ||
594
+ rEnd !== rowEnd ||
595
+ cStart !== colStart ||
596
+ cEnd !== colEnd) {
597
+ newChilds.splice(idx, 0, newChild);
598
+ }
599
+ }
600
+ }
601
+ setGrid(prev => (Object.assign(Object.assign({}, prev), { childs: newChilds })));
602
+ };
603
+ function resetBackgroundCellRef() {
604
+ Object.values(cellsRef.current).forEach(r => {
605
+ if (r.current) {
606
+ r.current.style.background = 'unset';
607
+ }
608
+ });
609
+ }
610
+ const upSelect = (idx, cell) => {
611
+ if (isPreview)
612
+ return;
613
+ // console.log('up select', idx, cell);
614
+ if (selectRef.current &&
615
+ selectEndRef.current &&
616
+ gridRef.current &&
617
+ selectRef.current.idx !== selectEndRef.current.idx &&
618
+ (selectEndRef.current.cell.rowEnd > selectRef.current.cell.rowEnd ||
619
+ selectEndRef.current.cell.colEnd > selectRef.current.cell.colEnd)) {
620
+ resetBackgroundCellRef();
621
+ // console.log('merge', selectRef.current, selectEndRef.current)
622
+ const { cell: cellStart, idx: idxStart } = selectRef.current;
623
+ const { cell: cellEnd, idx: idxEnd, hCells } = selectEndRef.current;
624
+ const newChilds = JSON.parse(JSON.stringify(gridRef.current.childs));
625
+ newChilds[idxStart].rowEnd = cellEnd.rowEnd;
626
+ newChilds[idxStart].colEnd = cellEnd.colEnd;
627
+ delete newChilds[idxStart].sizeX;
628
+ delete newChilds[idxStart].sizeY;
629
+ hCells.reverse().forEach(i => {
630
+ if (i !== idxStart) {
631
+ newChilds.splice(i, 1);
632
+ delete cellsRef.current[i];
633
+ delete cordinatesRef.current[i];
634
+ // console.log('del corr', i, cordinatesRef.current)
635
+ }
636
+ });
637
+ setGrid(Object.assign(Object.assign({}, gridRef.current), { childs: newChilds }));
638
+ }
639
+ selectRef.current = null;
640
+ selectEndRef.current = null;
641
+ };
642
+ const hoverSelect = (idx, cell) => {
643
+ if (isPreview)
644
+ return;
645
+ if (selectRef.current && gridRef.current) {
646
+ // console.log('hover select', idx, cell);
647
+ const { cell: cellStart, idx: idxStart } = selectRef.current;
648
+ const hCells = [];
649
+ gridRef.current.childs.forEach((child, i) => {
650
+ if (child.rowStart >= cellStart.rowStart &&
651
+ child.rowEnd <= cell.rowEnd &&
652
+ child.colStart >= cellStart.colStart &&
653
+ child.colEnd <= cell.colEnd) {
654
+ hCells.push(i);
655
+ }
656
+ });
657
+ // console.log('hCells', hCells)
658
+ resetBackgroundCellRef();
659
+ hCells.forEach(i => {
660
+ const cellRef = cellsRef.current[i];
661
+ if (cellRef && cellRef.current) {
662
+ cellRef.current.style.background = selectColor || 'unset';
663
+ }
664
+ });
665
+ selectEndRef.current = { cell, idx, hCells };
666
+ gridRef.current = grid;
667
+ }
668
+ };
669
+ const setRef = (idx, ref) => {
670
+ cellsRef.current[idx] = ref;
671
+ // console.log('cellsRef.current', cellsRef.current)
672
+ };
673
+ const setCordinate = (idx) => __awaiter(void 0, void 0, void 0, function* () {
674
+ // while(!cellsRef[idx]) {
675
+ // await new Promise(r => {setTimeout(r, 100)});
676
+ // console.log('wait', idx, cellsRef[idx])
677
+ // }
678
+ var _b;
679
+ if (containerRef.current) {
680
+ const container = containerRef.current.getBoundingClientRect();
681
+ const childRef = cellsRef.current[idx];
682
+ const childBox = (_b = childRef.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
683
+ if (childBox) {
684
+ const cordinate = {
685
+ width: childBox.width,
686
+ height: childBox.height,
687
+ x: childBox.x - container.x,
688
+ y: childBox.y - container.y,
689
+ xEnd: childBox.x - container.x + childBox.width,
690
+ yEnd: childBox.y - container.y + childBox.height,
691
+ };
692
+ cordinatesRef.current[idx] = cordinate;
693
+ // console.log('set cor', idx, cordinate);
694
+ }
695
+ }
696
+ // console.log('set corr', idx, cordinatesRef.current)
697
+ });
698
+ const renderGrid = (style) => {
699
+ const { gridTemplateColumns, gridTemplateRows, childs } = grid;
700
+ // console.log('grid', { gridTemplateColumns, gridTemplateRows, childs });
701
+ return (React.createElement("div", { className: "grid-container", ref: containerRef, style: Object.assign({ gridTemplateColumns: gridTemplateColumns.map(fr => `${fr}%`).join(' '), gridTemplateRows: gridTemplateRows.map(fr => `${fr}%`).join(' ') }, style) }, childs.map((cell, idx) => (React.createElement(Cell, { key: `${cell.rowStart}-${cell.colStart}-${cell.rowEnd}-${cell.colEnd}`, idx: idx, cell: cell, down: handleDown, downCell: handleDownCell, up: handleUp, setRef: setRef, setCordinate: setCordinate, downSelect: downSelect, upSelect: upSelect, hoverSelect: hoverSelect, unMerge: unMerge, renderCell: renderCell, borderStyle: cellBorder, style: cellStyle, activeStyle: cellActiveStyle, isPreview: isPreview, rowPercentage: grid.gridTemplateRows[cell.rowStart - 1], colPercentage: grid.gridTemplateColumns[cell.colStart - 1], ctrlKeyRef: ctrlKeyRef })))));
702
+ };
703
+ const handleUpLine = () => {
704
+ lineVertical(false);
705
+ lineHorizontal(false);
706
+ };
707
+ const _a = containerStyle || {}, { borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius, borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth, borderStyle, borderColor } = _a, rest = __rest(_a, ["borderTopLeftRadius", "borderTopRightRadius", "borderBottomRightRadius", "borderBottomLeftRadius", "borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth", "borderStyle", "borderColor"]);
708
+ const renderLines = () => (React.createElement(React.Fragment, null,
709
+ React.createElement(StyledLine, { ref: verticalLineRef, className: "vertical", onMouseUp: handleUpLine }),
710
+ React.createElement(StyledLine, { ref: horizontalLineRef, className: "horizontal", onMouseUp: handleUpLine })));
711
+ return (React.createElement(StyledGrid, { className: "grid-wrapper", isCompact: !!isCompact },
712
+ React.createElement("div", { className: "layers", ref: layersRef },
713
+ React.createElement(StyledBGLayer, { style: {
714
+ backgroundImage: image ? `url(${image})` : 'unset',
715
+ backgroundSize: imageSize === 'fill' ? '100% 100%' : imageSize,
716
+ backgroundPosition: imagePosition,
717
+ } }),
718
+ React.createElement(StyledMiddleLayer, { style: {
719
+ borderTopLeftRadius,
720
+ borderTopRightRadius,
721
+ borderBottomRightRadius,
722
+ borderBottomLeftRadius,
723
+ borderTopWidth,
724
+ borderRightWidth,
725
+ borderBottomWidth,
726
+ borderLeftWidth,
727
+ borderStyle,
728
+ borderColor,
729
+ } }),
730
+ renderGrid(Object.assign(Object.assign({}, rest), { borderTopLeftRadius,
731
+ borderTopRightRadius,
732
+ borderBottomRightRadius,
733
+ borderBottomLeftRadius }))),
734
+ renderLines()));
735
+ };
736
+ ResizeGrid.defaultProps = defaultProps;