funda-ui 4.5.712 → 4.5.766

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 (501) hide show
  1. package/Chatbox/index.d.ts +54 -0
  2. package/{publish/lib/cjs/Date → Chatbox}/index.js +2465 -3802
  3. package/README.md +4 -105
  4. package/Utils/useStreamController.d.ts +71 -0
  5. package/Utils/useStreamController.js +494 -0
  6. package/{publish/all.d.ts → all.d.ts} +1 -0
  7. package/{publish/all.js → all.js} +1 -0
  8. package/lib/cjs/Chatbox/index.d.ts +54 -0
  9. package/lib/cjs/Chatbox/index.js +4863 -0
  10. package/lib/cjs/Utils/useStreamController.d.ts +71 -0
  11. package/lib/cjs/Utils/useStreamController.js +494 -0
  12. package/lib/cjs/index.d.ts +1 -0
  13. package/lib/cjs/index.js +1 -0
  14. package/lib/esm/Chatbox/PureLoader.tsx +45 -0
  15. package/lib/esm/Chatbox/TypingEffect.tsx +32 -0
  16. package/lib/esm/Chatbox/index.scss +502 -0
  17. package/lib/esm/Chatbox/index.tsx +1171 -0
  18. package/lib/esm/Chatbox/useStreamController.tsx +277 -0
  19. package/lib/esm/Chatbox/utils/func.ts +107 -0
  20. package/lib/esm/Textarea/index.tsx +1 -0
  21. package/lib/esm/Utils/hooks/useStreamController.tsx +277 -0
  22. package/lib/esm/index.js +1 -0
  23. package/package.json +44 -41
  24. package/.gitattributes +0 -2
  25. package/README_PUBLISH.md +0 -126
  26. package/logo.png +0 -0
  27. package/preview.png +0 -0
  28. package/publish/LICENSE +0 -21
  29. package/publish/README.md +0 -126
  30. package/publish/lib/cjs/Accordion/index.d.ts +0 -2
  31. package/publish/lib/cjs/Accordion/index.js +0 -1035
  32. package/publish/lib/cjs/BackToTop/index.d.ts +0 -17
  33. package/publish/lib/cjs/BackToTop/index.js +0 -904
  34. package/publish/lib/cjs/CascadingSelect/index.d.ts +0 -60
  35. package/publish/lib/cjs/CascadingSelect/index.js +0 -2943
  36. package/publish/lib/cjs/CascadingSelectE2E/index.d.ts +0 -71
  37. package/publish/lib/cjs/CascadingSelectE2E/index.js +0 -3540
  38. package/publish/lib/cjs/Checkbox/index.d.ts +0 -28
  39. package/publish/lib/cjs/Checkbox/index.js +0 -662
  40. package/publish/lib/cjs/ColorPicker/index.d.ts +0 -27
  41. package/publish/lib/cjs/ColorPicker/index.js +0 -662
  42. package/publish/lib/cjs/Date/index.d.ts +0 -70
  43. package/publish/lib/cjs/DigitalClock/index.d.ts +0 -7
  44. package/publish/lib/cjs/DigitalClock/index.js +0 -402
  45. package/publish/lib/cjs/DragDropList/index.d.ts +0 -44
  46. package/publish/lib/cjs/DragDropList/index.js +0 -1587
  47. package/publish/lib/cjs/DropdownMenu/index.d.ts +0 -38
  48. package/publish/lib/cjs/DropdownMenu/index.js +0 -1498
  49. package/publish/lib/cjs/DynamicFields/index.d.ts +0 -40
  50. package/publish/lib/cjs/DynamicFields/index.js +0 -810
  51. package/publish/lib/cjs/EventCalendar/index.d.ts +0 -61
  52. package/publish/lib/cjs/EventCalendar/index.js +0 -3740
  53. package/publish/lib/cjs/EventCalendarTimeline/index.d.ts +0 -100
  54. package/publish/lib/cjs/EventCalendarTimeline/index.js +0 -6084
  55. package/publish/lib/cjs/File/index.d.ts +0 -40
  56. package/publish/lib/cjs/File/index.js +0 -1751
  57. package/publish/lib/cjs/HorizontalScrollContent/index.d.ts +0 -14
  58. package/publish/lib/cjs/HorizontalScrollContent/index.js +0 -426
  59. package/publish/lib/cjs/Input/index.d.ts +0 -59
  60. package/publish/lib/cjs/Input/index.js +0 -1455
  61. package/publish/lib/cjs/LiveSearch/index.d.ts +0 -69
  62. package/publish/lib/cjs/LiveSearch/index.js +0 -3626
  63. package/publish/lib/cjs/MasonryLayout/index.d.ts +0 -14
  64. package/publish/lib/cjs/MasonryLayout/index.js +0 -689
  65. package/publish/lib/cjs/ModalDialog/index.d.ts +0 -79
  66. package/publish/lib/cjs/ModalDialog/index.js +0 -1695
  67. package/publish/lib/cjs/ModeSwitch/index.d.ts +0 -17
  68. package/publish/lib/cjs/ModeSwitch/index.js +0 -202
  69. package/publish/lib/cjs/MultilevelDropdownMenu/index.d.ts +0 -20
  70. package/publish/lib/cjs/MultilevelDropdownMenu/index.js +0 -930
  71. package/publish/lib/cjs/MultipleCheckboxes/index.d.ts +0 -41
  72. package/publish/lib/cjs/MultipleCheckboxes/index.js +0 -1717
  73. package/publish/lib/cjs/MultipleSelect/index.d.ts +0 -65
  74. package/publish/lib/cjs/MultipleSelect/index.js +0 -3704
  75. package/publish/lib/cjs/NativeSelect/index.d.ts +0 -37
  76. package/publish/lib/cjs/NativeSelect/index.js +0 -1631
  77. package/publish/lib/cjs/NumberInput/index.d.ts +0 -40
  78. package/publish/lib/cjs/NumberInput/index.js +0 -1188
  79. package/publish/lib/cjs/Pagination/index.d.ts +0 -51
  80. package/publish/lib/cjs/Pagination/index.js +0 -612
  81. package/publish/lib/cjs/Radio/index.d.ts +0 -45
  82. package/publish/lib/cjs/Radio/index.js +0 -1391
  83. package/publish/lib/cjs/RangeSlider/index.d.ts +0 -22
  84. package/publish/lib/cjs/RangeSlider/index.js +0 -2665
  85. package/publish/lib/cjs/RootPortal/index.d.ts +0 -8
  86. package/publish/lib/cjs/RootPortal/index.js +0 -141
  87. package/publish/lib/cjs/ScrollReveal/index.d.ts +0 -21
  88. package/publish/lib/cjs/ScrollReveal/index.js +0 -401
  89. package/publish/lib/cjs/Scrollbar/index.d.ts +0 -17
  90. package/publish/lib/cjs/Scrollbar/index.js +0 -1107
  91. package/publish/lib/cjs/SearchBar/index.d.ts +0 -41
  92. package/publish/lib/cjs/SearchBar/index.js +0 -701
  93. package/publish/lib/cjs/Select/index.d.ts +0 -99
  94. package/publish/lib/cjs/Select/index.js +0 -5697
  95. package/publish/lib/cjs/ShowMoreLess/index.d.ts +0 -36
  96. package/publish/lib/cjs/ShowMoreLess/index.js +0 -387
  97. package/publish/lib/cjs/Switch/index.d.ts +0 -25
  98. package/publish/lib/cjs/Switch/index.js +0 -628
  99. package/publish/lib/cjs/Table/index.d.ts +0 -12
  100. package/publish/lib/cjs/Table/index.js +0 -2062
  101. package/publish/lib/cjs/Tabs/index.d.ts +0 -3
  102. package/publish/lib/cjs/Tabs/index.js +0 -771
  103. package/publish/lib/cjs/TagInput/index.d.ts +0 -31
  104. package/publish/lib/cjs/TagInput/index.js +0 -1144
  105. package/publish/lib/cjs/Textarea/index.d.ts +0 -50
  106. package/publish/lib/cjs/Textarea/index.js +0 -1784
  107. package/publish/lib/cjs/Toast/index.d.ts +0 -34
  108. package/publish/lib/cjs/Toast/index.js +0 -861
  109. package/publish/lib/cjs/Tooltip/index.d.ts +0 -23
  110. package/publish/lib/cjs/Tooltip/index.js +0 -1674
  111. package/publish/lib/cjs/Tree/index.d.ts +0 -62
  112. package/publish/lib/cjs/Tree/index.js +0 -1960
  113. package/publish/lib/cjs/Utils/anim.d.ts +0 -11
  114. package/publish/lib/cjs/Utils/anim.js +0 -400
  115. package/publish/lib/cjs/Utils/bodyScrollLock.d.ts +0 -8
  116. package/publish/lib/cjs/Utils/bodyScrollLock.js +0 -311
  117. package/publish/lib/cjs/Utils/buffer.d.ts +0 -67
  118. package/publish/lib/cjs/Utils/buffer.js +0 -343
  119. package/publish/lib/cjs/Utils/cls.d.ts +0 -15
  120. package/publish/lib/cjs/Utils/cls.js +0 -124
  121. package/publish/lib/cjs/Utils/convert.d.ts +0 -25
  122. package/publish/lib/cjs/Utils/convert.js +0 -109
  123. package/publish/lib/cjs/Utils/date.d.ts +0 -217
  124. package/publish/lib/cjs/Utils/date.js +0 -567
  125. package/publish/lib/cjs/Utils/dom.d.ts +0 -13
  126. package/publish/lib/cjs/Utils/dom.js +0 -215
  127. package/publish/lib/cjs/Utils/easing.d.ts +0 -29
  128. package/publish/lib/cjs/Utils/easing.js +0 -221
  129. package/publish/lib/cjs/Utils/extract.d.ts +0 -28
  130. package/publish/lib/cjs/Utils/extract.js +0 -130
  131. package/publish/lib/cjs/Utils/getElementProperty.d.ts +0 -52
  132. package/publish/lib/cjs/Utils/getElementProperty.js +0 -189
  133. package/publish/lib/cjs/Utils/guid.d.ts +0 -7
  134. package/publish/lib/cjs/Utils/guid.js +0 -67
  135. package/publish/lib/cjs/Utils/initDefaultOptions.d.ts +0 -21
  136. package/publish/lib/cjs/Utils/initDefaultOptions.js +0 -131
  137. package/publish/lib/cjs/Utils/inputsCalculation.d.ts +0 -28
  138. package/publish/lib/cjs/Utils/inputsCalculation.js +0 -188
  139. package/publish/lib/cjs/Utils/math.d.ts +0 -77
  140. package/publish/lib/cjs/Utils/math.js +0 -305
  141. package/publish/lib/cjs/Utils/object.d.ts +0 -18
  142. package/publish/lib/cjs/Utils/object.js +0 -120
  143. package/publish/lib/cjs/Utils/os.d.ts +0 -2
  144. package/publish/lib/cjs/Utils/os.js +0 -104
  145. package/publish/lib/cjs/Utils/performance.d.ts +0 -3
  146. package/publish/lib/cjs/Utils/performance.js +0 -94
  147. package/publish/lib/cjs/Utils/tree.d.ts +0 -40
  148. package/publish/lib/cjs/Utils/tree.js +0 -195
  149. package/publish/lib/cjs/Utils/useAutosizeTextArea.d.ts +0 -10
  150. package/publish/lib/cjs/Utils/useAutosizeTextArea.js +0 -227
  151. package/publish/lib/cjs/Utils/useBoundedDrag.d.ts +0 -125
  152. package/publish/lib/cjs/Utils/useBoundedDrag.js +0 -380
  153. package/publish/lib/cjs/Utils/useClickOutside.d.ts +0 -33
  154. package/publish/lib/cjs/Utils/useClickOutside.js +0 -166
  155. package/publish/lib/cjs/Utils/useComId.d.ts +0 -6
  156. package/publish/lib/cjs/Utils/useComId.js +0 -114
  157. package/publish/lib/cjs/Utils/useDebounce.d.ts +0 -20
  158. package/publish/lib/cjs/Utils/useDebounce.js +0 -138
  159. package/publish/lib/cjs/Utils/useDragDropPosition.d.ts +0 -169
  160. package/publish/lib/cjs/Utils/useDragDropPosition.js +0 -456
  161. package/publish/lib/cjs/Utils/useDraggable.d.ts +0 -62
  162. package/publish/lib/cjs/Utils/useDraggable.js +0 -348
  163. package/publish/lib/cjs/Utils/useInterval.d.ts +0 -5
  164. package/publish/lib/cjs/Utils/useInterval.js +0 -168
  165. package/publish/lib/cjs/Utils/useIsMobile.d.ts +0 -2
  166. package/publish/lib/cjs/Utils/useIsMobile.js +0 -168
  167. package/publish/lib/cjs/Utils/useKeyPress.d.ts +0 -44
  168. package/publish/lib/cjs/Utils/useKeyPress.js +0 -200
  169. package/publish/lib/cjs/Utils/useThrottle.d.ts +0 -2
  170. package/publish/lib/cjs/Utils/useThrottle.js +0 -136
  171. package/publish/lib/cjs/Utils/useWindowScroll.d.ts +0 -12
  172. package/publish/lib/cjs/Utils/useWindowScroll.js +0 -217
  173. package/publish/lib/cjs/Utils/viewport.d.ts +0 -7
  174. package/publish/lib/cjs/Utils/viewport.js +0 -64
  175. package/publish/lib/cjs/index.d.ts +0 -45
  176. package/publish/lib/cjs/index.js +0 -46
  177. package/publish/lib/css/BackToTop/index.css +0 -34
  178. package/publish/lib/css/CascadingSelect/index.css +0 -216
  179. package/publish/lib/css/CascadingSelectE2E/index.css +0 -216
  180. package/publish/lib/css/ColorPicker/index.css +0 -58
  181. package/publish/lib/css/Date/index.css +0 -434
  182. package/publish/lib/css/DragDropList/index.css +0 -188
  183. package/publish/lib/css/DropdownMenu/index.css +0 -151
  184. package/publish/lib/css/EventCalendar/index.css +0 -300
  185. package/publish/lib/css/EventCalendarTimeline/index.css +0 -694
  186. package/publish/lib/css/HorizontalScrollContent/index.css +0 -70
  187. package/publish/lib/css/LiveSearch/index.css +0 -55
  188. package/publish/lib/css/MultilevelDropdownMenu/index.css +0 -38
  189. package/publish/lib/css/MultipleSelect/index.css +0 -313
  190. package/publish/lib/css/RangeSlider/index.css +0 -150
  191. package/publish/lib/css/Scrollbar/index.css +0 -176
  192. package/publish/lib/css/Select/index.css +0 -368
  193. package/publish/lib/css/ShowMoreLess/index.css +0 -23
  194. package/publish/lib/css/Table/index.css +0 -584
  195. package/publish/lib/css/TagInput/index.css +0 -91
  196. package/publish/lib/css/Toast/index.css +0 -201
  197. package/publish/lib/css/Tooltip/index.css +0 -197
  198. package/publish/lib/css/Tree/index.css +0 -232
  199. package/publish/lib/esm/Accordion/Accordion.tsx +0 -184
  200. package/publish/lib/esm/Accordion/AccordionItem.tsx +0 -143
  201. package/publish/lib/esm/Accordion/index.tsx +0 -2
  202. package/publish/lib/esm/BackToTop/index.scss +0 -47
  203. package/publish/lib/esm/BackToTop/index.tsx +0 -177
  204. package/publish/lib/esm/CascadingSelect/Group.tsx +0 -82
  205. package/publish/lib/esm/CascadingSelect/index.scss +0 -291
  206. package/publish/lib/esm/CascadingSelect/index.tsx +0 -1203
  207. package/publish/lib/esm/CascadingSelectE2E/Group.tsx +0 -83
  208. package/publish/lib/esm/CascadingSelectE2E/index.scss +0 -293
  209. package/publish/lib/esm/CascadingSelectE2E/index.tsx +0 -1471
  210. package/publish/lib/esm/Checkbox/index.tsx +0 -193
  211. package/publish/lib/esm/ColorPicker/index.scss +0 -91
  212. package/publish/lib/esm/ColorPicker/index.tsx +0 -204
  213. package/publish/lib/esm/Date/Calendar.tsx +0 -723
  214. package/publish/lib/esm/Date/index.scss +0 -567
  215. package/publish/lib/esm/Date/index.tsx +0 -1683
  216. package/publish/lib/esm/Date/localization/en_US.js +0 -13
  217. package/publish/lib/esm/Date/localization/zh_CN.js +0 -12
  218. package/publish/lib/esm/DigitalClock/index.tsx +0 -74
  219. package/publish/lib/esm/DragDropList/index.scss +0 -245
  220. package/publish/lib/esm/DragDropList/index.tsx +0 -494
  221. package/publish/lib/esm/DropdownMenu/Option.tsx +0 -55
  222. package/publish/lib/esm/DropdownMenu/index.scss +0 -205
  223. package/publish/lib/esm/DropdownMenu/index.tsx +0 -377
  224. package/publish/lib/esm/DynamicFields/index.tsx +0 -404
  225. package/publish/lib/esm/EventCalendar/index.scss +0 -407
  226. package/publish/lib/esm/EventCalendar/index.tsx +0 -1004
  227. package/publish/lib/esm/EventCalendarTimeline/index.scss +0 -926
  228. package/publish/lib/esm/EventCalendarTimeline/index.tsx +0 -2683
  229. package/publish/lib/esm/File/index.tsx +0 -477
  230. package/publish/lib/esm/HorizontalScrollContent/index.scss +0 -87
  231. package/publish/lib/esm/HorizontalScrollContent/index.tsx +0 -171
  232. package/publish/lib/esm/Input/index.tsx +0 -614
  233. package/publish/lib/esm/LiveSearch/index.scss +0 -82
  234. package/publish/lib/esm/LiveSearch/index.tsx +0 -960
  235. package/publish/lib/esm/MasonryLayout/index.tsx +0 -326
  236. package/publish/lib/esm/ModalDialog/index.tsx +0 -552
  237. package/publish/lib/esm/ModeSwitch/index.tsx +0 -82
  238. package/publish/lib/esm/MultilevelDropdownMenu/ItemList.tsx +0 -265
  239. package/publish/lib/esm/MultilevelDropdownMenu/index.scss +0 -79
  240. package/publish/lib/esm/MultilevelDropdownMenu/index.tsx +0 -77
  241. package/publish/lib/esm/MultipleCheckboxes/index.tsx +0 -669
  242. package/publish/lib/esm/MultipleSelect/index.scss +0 -398
  243. package/publish/lib/esm/MultipleSelect/index.tsx +0 -766
  244. package/publish/lib/esm/MultipleSelect/utils/func.ts +0 -61
  245. package/publish/lib/esm/NativeSelect/index.tsx +0 -396
  246. package/publish/lib/esm/NativeSelect/utils/func.ts +0 -49
  247. package/publish/lib/esm/NumberInput/index.tsx +0 -385
  248. package/publish/lib/esm/Pagination/index.tsx +0 -286
  249. package/publish/lib/esm/Pagination/pagination-navigators.tsx +0 -60
  250. package/publish/lib/esm/Radio/index.tsx +0 -670
  251. package/publish/lib/esm/RangeSlider/index.scss +0 -186
  252. package/publish/lib/esm/RangeSlider/index.tsx +0 -241
  253. package/publish/lib/esm/RootPortal/index.tsx +0 -53
  254. package/publish/lib/esm/ScrollReveal/index.tsx +0 -148
  255. package/publish/lib/esm/Scrollbar/index.scss +0 -221
  256. package/publish/lib/esm/Scrollbar/index.tsx +0 -561
  257. package/publish/lib/esm/SearchBar/index.tsx +0 -253
  258. package/publish/lib/esm/Select/index.scss +0 -553
  259. package/publish/lib/esm/Select/index.tsx +0 -2816
  260. package/publish/lib/esm/Select/utils/func.ts +0 -106
  261. package/publish/lib/esm/ShowMoreLess/index.scss +0 -27
  262. package/publish/lib/esm/ShowMoreLess/index.tsx +0 -145
  263. package/publish/lib/esm/Switch/index.tsx +0 -147
  264. package/publish/lib/esm/Table/Table.tsx +0 -257
  265. package/publish/lib/esm/Table/TableBody.tsx +0 -41
  266. package/publish/lib/esm/Table/TableCaption.tsx +0 -34
  267. package/publish/lib/esm/Table/TableCell.tsx +0 -123
  268. package/publish/lib/esm/Table/TableColgroup.tsx +0 -38
  269. package/publish/lib/esm/Table/TableContext.tsx +0 -26
  270. package/publish/lib/esm/Table/TableFoot.tsx +0 -28
  271. package/publish/lib/esm/Table/TableHead.tsx +0 -28
  272. package/publish/lib/esm/Table/TableRow.tsx +0 -76
  273. package/publish/lib/esm/Table/index.scss +0 -418
  274. package/publish/lib/esm/Table/index.tsx +0 -14
  275. package/publish/lib/esm/Table/utils/DragHandleSprite.tsx +0 -46
  276. package/publish/lib/esm/Table/utils/SortSprite.tsx +0 -57
  277. package/publish/lib/esm/Table/utils/TableFilter.tsx +0 -56
  278. package/publish/lib/esm/Table/utils/ToggleSelection.tsx +0 -225
  279. package/publish/lib/esm/Table/utils/func.ts +0 -171
  280. package/publish/lib/esm/Table/utils/hooks/useTableDraggable.tsx +0 -342
  281. package/publish/lib/esm/Table/utils/hooks/useTableKeyPress.tsx +0 -154
  282. package/publish/lib/esm/Table/utils/hooks/useTableResponsive.tsx +0 -92
  283. package/publish/lib/esm/Table/utils/hooks/useTableSort.tsx +0 -143
  284. package/publish/lib/esm/Tabs/TabList.tsx +0 -50
  285. package/publish/lib/esm/Tabs/TabPanel.tsx +0 -44
  286. package/publish/lib/esm/Tabs/Tabs.tsx +0 -282
  287. package/publish/lib/esm/Tabs/index.tsx +0 -3
  288. package/publish/lib/esm/TagInput/index.scss +0 -126
  289. package/publish/lib/esm/TagInput/index.tsx +0 -352
  290. package/publish/lib/esm/Textarea/index.tsx +0 -608
  291. package/publish/lib/esm/Toast/Item.tsx +0 -124
  292. package/publish/lib/esm/Toast/index.scss +0 -269
  293. package/publish/lib/esm/Toast/index.tsx +0 -374
  294. package/publish/lib/esm/Tooltip/index.scss +0 -269
  295. package/publish/lib/esm/Tooltip/index.tsx +0 -312
  296. package/publish/lib/esm/Tree/TreeList.tsx +0 -616
  297. package/publish/lib/esm/Tree/index.scss +0 -386
  298. package/publish/lib/esm/Tree/index.tsx +0 -396
  299. package/publish/lib/esm/Tree/init-height.tsx +0 -27
  300. package/publish/lib/esm/Tree/utils/func.ts +0 -15
  301. package/publish/lib/esm/Utils/hooks/useAutosizeTextArea.tsx +0 -125
  302. package/publish/lib/esm/Utils/hooks/useBoundedDrag.tsx +0 -301
  303. package/publish/lib/esm/Utils/hooks/useClickOutside.tsx +0 -69
  304. package/publish/lib/esm/Utils/hooks/useComId.tsx +0 -13
  305. package/publish/lib/esm/Utils/hooks/useDebounce.tsx +0 -40
  306. package/publish/lib/esm/Utils/hooks/useDragDropPosition.tsx +0 -420
  307. package/publish/lib/esm/Utils/hooks/useDraggable.tsx +0 -265
  308. package/publish/lib/esm/Utils/hooks/useInterval.tsx +0 -74
  309. package/publish/lib/esm/Utils/hooks/useIsMobile.tsx +0 -56
  310. package/publish/lib/esm/Utils/hooks/useKeyPress.tsx +0 -104
  311. package/publish/lib/esm/Utils/hooks/useThrottle.tsx +0 -39
  312. package/publish/lib/esm/Utils/hooks/useWindowScroll.tsx +0 -83
  313. package/publish/lib/esm/Utils/libs/anim.ts +0 -96
  314. package/publish/lib/esm/Utils/libs/buffer.ts +0 -262
  315. package/publish/lib/esm/Utils/libs/cls.ts +0 -64
  316. package/publish/lib/esm/Utils/libs/convert.ts +0 -59
  317. package/publish/lib/esm/Utils/libs/date.ts +0 -578
  318. package/publish/lib/esm/Utils/libs/dom.ts +0 -150
  319. package/publish/lib/esm/Utils/libs/easing.ts +0 -201
  320. package/publish/lib/esm/Utils/libs/extract.ts +0 -86
  321. package/publish/lib/esm/Utils/libs/getElementProperty.ts +0 -150
  322. package/publish/lib/esm/Utils/libs/guid.ts +0 -16
  323. package/publish/lib/esm/Utils/libs/initDefaultOptions.ts +0 -104
  324. package/publish/lib/esm/Utils/libs/inputsCalculation.ts +0 -160
  325. package/publish/lib/esm/Utils/libs/math.ts +0 -276
  326. package/publish/lib/esm/Utils/libs/object.ts +0 -68
  327. package/publish/lib/esm/Utils/libs/os.ts +0 -63
  328. package/publish/lib/esm/Utils/libs/performance.ts +0 -47
  329. package/publish/lib/esm/Utils/libs/tree.ts +0 -119
  330. package/publish/lib/esm/Utils/libs/viewport.ts +0 -20
  331. package/publish/lib/esm/Utils/plugins/bodyScrollLock.ts +0 -286
  332. package/publish/lib/esm/index.js +0 -43
  333. package/publish/package.json +0 -1
  334. /package/{publish/Accordion → Accordion}/index.d.ts +0 -0
  335. /package/{publish/Accordion → Accordion}/index.js +0 -0
  336. /package/{publish/BackToTop → BackToTop}/index.css +0 -0
  337. /package/{publish/BackToTop → BackToTop}/index.d.ts +0 -0
  338. /package/{publish/BackToTop → BackToTop}/index.js +0 -0
  339. /package/{publish/CascadingSelect → CascadingSelect}/index.css +0 -0
  340. /package/{publish/CascadingSelect → CascadingSelect}/index.d.ts +0 -0
  341. /package/{publish/CascadingSelect → CascadingSelect}/index.js +0 -0
  342. /package/{publish/CascadingSelectE2E → CascadingSelectE2E}/index.css +0 -0
  343. /package/{publish/CascadingSelectE2E → CascadingSelectE2E}/index.d.ts +0 -0
  344. /package/{publish/CascadingSelectE2E → CascadingSelectE2E}/index.js +0 -0
  345. /package/{publish/Checkbox → Checkbox}/index.d.ts +0 -0
  346. /package/{publish/Checkbox → Checkbox}/index.js +0 -0
  347. /package/{publish/ColorPicker → ColorPicker}/index.css +0 -0
  348. /package/{publish/ColorPicker → ColorPicker}/index.d.ts +0 -0
  349. /package/{publish/ColorPicker → ColorPicker}/index.js +0 -0
  350. /package/{publish/Date → Date}/index.css +0 -0
  351. /package/{publish/Date → Date}/index.d.ts +0 -0
  352. /package/{publish/Date → Date}/index.js +0 -0
  353. /package/{publish/DigitalClock → DigitalClock}/index.d.ts +0 -0
  354. /package/{publish/DigitalClock → DigitalClock}/index.js +0 -0
  355. /package/{publish/DragDropList → DragDropList}/index.css +0 -0
  356. /package/{publish/DragDropList → DragDropList}/index.d.ts +0 -0
  357. /package/{publish/DragDropList → DragDropList}/index.js +0 -0
  358. /package/{publish/DropdownMenu → DropdownMenu}/index.css +0 -0
  359. /package/{publish/DropdownMenu → DropdownMenu}/index.d.ts +0 -0
  360. /package/{publish/DropdownMenu → DropdownMenu}/index.js +0 -0
  361. /package/{publish/DynamicFields → DynamicFields}/index.d.ts +0 -0
  362. /package/{publish/DynamicFields → DynamicFields}/index.js +0 -0
  363. /package/{publish/EventCalendar → EventCalendar}/index.css +0 -0
  364. /package/{publish/EventCalendar → EventCalendar}/index.d.ts +0 -0
  365. /package/{publish/EventCalendar → EventCalendar}/index.js +0 -0
  366. /package/{publish/EventCalendarTimeline → EventCalendarTimeline}/index.css +0 -0
  367. /package/{publish/EventCalendarTimeline → EventCalendarTimeline}/index.d.ts +0 -0
  368. /package/{publish/EventCalendarTimeline → EventCalendarTimeline}/index.js +0 -0
  369. /package/{publish/File → File}/index.d.ts +0 -0
  370. /package/{publish/File → File}/index.js +0 -0
  371. /package/{publish/HorizontalScrollContent → HorizontalScrollContent}/index.css +0 -0
  372. /package/{publish/HorizontalScrollContent → HorizontalScrollContent}/index.d.ts +0 -0
  373. /package/{publish/HorizontalScrollContent → HorizontalScrollContent}/index.js +0 -0
  374. /package/{publish/Input → Input}/index.d.ts +0 -0
  375. /package/{publish/Input → Input}/index.js +0 -0
  376. /package/{publish/LiveSearch → LiveSearch}/index.css +0 -0
  377. /package/{publish/LiveSearch → LiveSearch}/index.d.ts +0 -0
  378. /package/{publish/LiveSearch → LiveSearch}/index.js +0 -0
  379. /package/{publish/MasonryLayout → MasonryLayout}/index.d.ts +0 -0
  380. /package/{publish/MasonryLayout → MasonryLayout}/index.js +0 -0
  381. /package/{publish/ModalDialog → ModalDialog}/index.d.ts +0 -0
  382. /package/{publish/ModalDialog → ModalDialog}/index.js +0 -0
  383. /package/{publish/ModeSwitch → ModeSwitch}/index.d.ts +0 -0
  384. /package/{publish/ModeSwitch → ModeSwitch}/index.js +0 -0
  385. /package/{publish/MultilevelDropdownMenu → MultilevelDropdownMenu}/index.css +0 -0
  386. /package/{publish/MultilevelDropdownMenu → MultilevelDropdownMenu}/index.d.ts +0 -0
  387. /package/{publish/MultilevelDropdownMenu → MultilevelDropdownMenu}/index.js +0 -0
  388. /package/{publish/MultipleCheckboxes → MultipleCheckboxes}/index.d.ts +0 -0
  389. /package/{publish/MultipleCheckboxes → MultipleCheckboxes}/index.js +0 -0
  390. /package/{publish/MultipleSelect → MultipleSelect}/index.css +0 -0
  391. /package/{publish/MultipleSelect → MultipleSelect}/index.d.ts +0 -0
  392. /package/{publish/MultipleSelect → MultipleSelect}/index.js +0 -0
  393. /package/{publish/NativeSelect → NativeSelect}/index.d.ts +0 -0
  394. /package/{publish/NativeSelect → NativeSelect}/index.js +0 -0
  395. /package/{publish/NumberInput → NumberInput}/index.d.ts +0 -0
  396. /package/{publish/NumberInput → NumberInput}/index.js +0 -0
  397. /package/{publish/Pagination → Pagination}/index.d.ts +0 -0
  398. /package/{publish/Pagination → Pagination}/index.js +0 -0
  399. /package/{publish/Radio → Radio}/index.d.ts +0 -0
  400. /package/{publish/Radio → Radio}/index.js +0 -0
  401. /package/{publish/RangeSlider → RangeSlider}/index.css +0 -0
  402. /package/{publish/RangeSlider → RangeSlider}/index.d.ts +0 -0
  403. /package/{publish/RangeSlider → RangeSlider}/index.js +0 -0
  404. /package/{publish/RootPortal → RootPortal}/index.d.ts +0 -0
  405. /package/{publish/RootPortal → RootPortal}/index.js +0 -0
  406. /package/{publish/ScrollReveal → ScrollReveal}/index.d.ts +0 -0
  407. /package/{publish/ScrollReveal → ScrollReveal}/index.js +0 -0
  408. /package/{publish/Scrollbar → Scrollbar}/index.css +0 -0
  409. /package/{publish/Scrollbar → Scrollbar}/index.d.ts +0 -0
  410. /package/{publish/Scrollbar → Scrollbar}/index.js +0 -0
  411. /package/{publish/SearchBar → SearchBar}/index.d.ts +0 -0
  412. /package/{publish/SearchBar → SearchBar}/index.js +0 -0
  413. /package/{publish/Select → Select}/index.css +0 -0
  414. /package/{publish/Select → Select}/index.d.ts +0 -0
  415. /package/{publish/Select → Select}/index.js +0 -0
  416. /package/{publish/ShowMoreLess → ShowMoreLess}/index.css +0 -0
  417. /package/{publish/ShowMoreLess → ShowMoreLess}/index.d.ts +0 -0
  418. /package/{publish/ShowMoreLess → ShowMoreLess}/index.js +0 -0
  419. /package/{publish/Switch → Switch}/index.d.ts +0 -0
  420. /package/{publish/Switch → Switch}/index.js +0 -0
  421. /package/{publish/Table → Table}/index.css +0 -0
  422. /package/{publish/Table → Table}/index.d.ts +0 -0
  423. /package/{publish/Table → Table}/index.js +0 -0
  424. /package/{publish/Tabs → Tabs}/index.d.ts +0 -0
  425. /package/{publish/Tabs → Tabs}/index.js +0 -0
  426. /package/{publish/TagInput → TagInput}/index.css +0 -0
  427. /package/{publish/TagInput → TagInput}/index.d.ts +0 -0
  428. /package/{publish/TagInput → TagInput}/index.js +0 -0
  429. /package/{publish/Textarea → Textarea}/index.d.ts +0 -0
  430. /package/{publish/Textarea → Textarea}/index.js +0 -0
  431. /package/{publish/Toast → Toast}/index.css +0 -0
  432. /package/{publish/Toast → Toast}/index.d.ts +0 -0
  433. /package/{publish/Toast → Toast}/index.js +0 -0
  434. /package/{publish/Tooltip → Tooltip}/index.css +0 -0
  435. /package/{publish/Tooltip → Tooltip}/index.d.ts +0 -0
  436. /package/{publish/Tooltip → Tooltip}/index.js +0 -0
  437. /package/{publish/Tree → Tree}/index.css +0 -0
  438. /package/{publish/Tree → Tree}/index.d.ts +0 -0
  439. /package/{publish/Tree → Tree}/index.js +0 -0
  440. /package/{publish/Utils → Utils}/anim.d.ts +0 -0
  441. /package/{publish/Utils → Utils}/anim.js +0 -0
  442. /package/{publish/Utils → Utils}/bodyScrollLock.d.ts +0 -0
  443. /package/{publish/Utils → Utils}/bodyScrollLock.js +0 -0
  444. /package/{publish/Utils → Utils}/buffer.d.ts +0 -0
  445. /package/{publish/Utils → Utils}/buffer.js +0 -0
  446. /package/{publish/Utils → Utils}/cls.d.ts +0 -0
  447. /package/{publish/Utils → Utils}/cls.js +0 -0
  448. /package/{publish/Utils → Utils}/convert.d.ts +0 -0
  449. /package/{publish/Utils → Utils}/convert.js +0 -0
  450. /package/{publish/Utils → Utils}/date.d.ts +0 -0
  451. /package/{publish/Utils → Utils}/date.js +0 -0
  452. /package/{publish/Utils → Utils}/dom.d.ts +0 -0
  453. /package/{publish/Utils → Utils}/dom.js +0 -0
  454. /package/{publish/Utils → Utils}/easing.d.ts +0 -0
  455. /package/{publish/Utils → Utils}/easing.js +0 -0
  456. /package/{publish/Utils → Utils}/extract.d.ts +0 -0
  457. /package/{publish/Utils → Utils}/extract.js +0 -0
  458. /package/{publish/Utils → Utils}/getElementProperty.d.ts +0 -0
  459. /package/{publish/Utils → Utils}/getElementProperty.js +0 -0
  460. /package/{publish/Utils → Utils}/guid.d.ts +0 -0
  461. /package/{publish/Utils → Utils}/guid.js +0 -0
  462. /package/{publish/Utils → Utils}/initDefaultOptions.d.ts +0 -0
  463. /package/{publish/Utils → Utils}/initDefaultOptions.js +0 -0
  464. /package/{publish/Utils → Utils}/inputsCalculation.d.ts +0 -0
  465. /package/{publish/Utils → Utils}/inputsCalculation.js +0 -0
  466. /package/{publish/Utils → Utils}/math.d.ts +0 -0
  467. /package/{publish/Utils → Utils}/math.js +0 -0
  468. /package/{publish/Utils → Utils}/object.d.ts +0 -0
  469. /package/{publish/Utils → Utils}/object.js +0 -0
  470. /package/{publish/Utils → Utils}/os.d.ts +0 -0
  471. /package/{publish/Utils → Utils}/os.js +0 -0
  472. /package/{publish/Utils → Utils}/performance.d.ts +0 -0
  473. /package/{publish/Utils → Utils}/performance.js +0 -0
  474. /package/{publish/Utils → Utils}/tree.d.ts +0 -0
  475. /package/{publish/Utils → Utils}/tree.js +0 -0
  476. /package/{publish/Utils → Utils}/useAutosizeTextArea.d.ts +0 -0
  477. /package/{publish/Utils → Utils}/useAutosizeTextArea.js +0 -0
  478. /package/{publish/Utils → Utils}/useBoundedDrag.d.ts +0 -0
  479. /package/{publish/Utils → Utils}/useBoundedDrag.js +0 -0
  480. /package/{publish/Utils → Utils}/useClickOutside.d.ts +0 -0
  481. /package/{publish/Utils → Utils}/useClickOutside.js +0 -0
  482. /package/{publish/Utils → Utils}/useComId.d.ts +0 -0
  483. /package/{publish/Utils → Utils}/useComId.js +0 -0
  484. /package/{publish/Utils → Utils}/useDebounce.d.ts +0 -0
  485. /package/{publish/Utils → Utils}/useDebounce.js +0 -0
  486. /package/{publish/Utils → Utils}/useDragDropPosition.d.ts +0 -0
  487. /package/{publish/Utils → Utils}/useDragDropPosition.js +0 -0
  488. /package/{publish/Utils → Utils}/useDraggable.d.ts +0 -0
  489. /package/{publish/Utils → Utils}/useDraggable.js +0 -0
  490. /package/{publish/Utils → Utils}/useInterval.d.ts +0 -0
  491. /package/{publish/Utils → Utils}/useInterval.js +0 -0
  492. /package/{publish/Utils → Utils}/useIsMobile.d.ts +0 -0
  493. /package/{publish/Utils → Utils}/useIsMobile.js +0 -0
  494. /package/{publish/Utils → Utils}/useKeyPress.d.ts +0 -0
  495. /package/{publish/Utils → Utils}/useKeyPress.js +0 -0
  496. /package/{publish/Utils → Utils}/useThrottle.d.ts +0 -0
  497. /package/{publish/Utils → Utils}/useThrottle.js +0 -0
  498. /package/{publish/Utils → Utils}/useWindowScroll.d.ts +0 -0
  499. /package/{publish/Utils → Utils}/useWindowScroll.js +0 -0
  500. /package/{publish/Utils → Utils}/viewport.d.ts +0 -0
  501. /package/{publish/Utils → Utils}/viewport.js +0 -0
@@ -1,1004 +0,0 @@
1
- import React, { useState, useRef, useEffect, useMemo, useImperativeHandle } from 'react';
2
-
3
- import { getTodayDate, getCalendarDate, isValidDate, padZero } from 'funda-utils/dist/cjs/date';
4
- import { clsWrite, combinedCls } from 'funda-utils/dist/cjs/cls';
5
- import ModalDialog from 'funda-modaldialog';
6
-
7
-
8
-
9
- export interface EventsValueConfig {
10
- id: string | number;
11
- date: string,
12
- time: string,
13
- data: string,
14
- eventStyles?: React.CSSProperties;
15
- callback?: () => void;
16
- }
17
-
18
- export interface TimelineCellListConfig {
19
- date: string;
20
- list: EventsValueConfig[];
21
- }
22
-
23
- export type EventCalendarProps = {
24
- contentRef?: React.ForwardedRef<any>;
25
- calendarWrapperClassName?: string;
26
- customTodayDate?: string;
27
- eventsValue?: any[];
28
- langWeek?: string[];
29
- langWeekFull?: string[];
30
- langMonths?: string[];
31
- langMonthsFull?: string[];
32
- langToday?: string;
33
- iconRemove?: React.ReactNode | string;
34
- iconAdd?: React.ReactNode | string;
35
- cellCloseBtnClassName?: string;
36
- cellCloseBtnLabel?: string | React.ReactNode;
37
- cellAddBtnClassName?: string;
38
- cellAddBtnLabel?: string | React.ReactNode;
39
- onChangeDate?: (e: any, currentData: any) => void;
40
- onChangeMonth?: (currentData: any) => void;
41
- onChangeYear?: (currentData: any) => void;
42
- onChangeToday?: (currentData: any) => void;
43
- onListRenderComplete?: () => void;
44
-
45
- // modal dialog
46
- modalMaskOpacity?: string;
47
- modalMaxWidth?: number | string;
48
- modalMinHeight?: number | string;
49
- modalHeading?: React.ReactNode;
50
- modalContent?: React.ReactNode;
51
- modalDeleteContent?: React.ReactNode;
52
- modalCloseBtnClassName?: string;
53
- modalCloseBtnLabel?: string | React.ReactNode;
54
- modalSubmitBtnClassName?: string;
55
- modalSubmitBtnLabel?: string | React.ReactNode;
56
- modalSubmitDeleteBtnClassName?: string;
57
- modalSubmitDeleteBtnLabel?: string | React.ReactNode;
58
- onModalEditOpen?: (currentData: any, openwin: any, type: 'normal' | 'new') => void;
59
- onModalEditClose?: (currentData: any) => void;
60
- onModalDeleteOpen?: (currentData: any, openwin: any) => void;
61
- onModalDeleteClose?: (currentData: any) => void;
62
- onModalEditEvent?: (currentData: any, closewin: any) => void;
63
- onModalDeleteEvent?: (currentData: any, closewin: any) => void;
64
- //
65
- onCellMouseEnter?: (el: any) => void;
66
- onCellMouseLeave?: (el: any) => void;
67
- onCellClick?: (el: any) => void;
68
- onCellDoubleClick?: (el: any) => void;
69
- onCellMouseUp?: (el: any) => void;
70
- onKeyPressed?: (el: any) => void;
71
-
72
- }
73
-
74
-
75
- const EventCalendar = (props: EventCalendarProps) => {
76
- const {
77
- contentRef,
78
- calendarWrapperClassName,
79
- customTodayDate,
80
- eventsValue,
81
- langWeek,
82
- langWeekFull,
83
- langMonths,
84
- langMonthsFull,
85
- langToday,
86
- onChangeDate,
87
- onChangeMonth,
88
- onChangeYear,
89
- onChangeToday,
90
- onListRenderComplete,
91
-
92
- //
93
- iconRemove,
94
- iconAdd,
95
- cellCloseBtnClassName,
96
- cellCloseBtnLabel,
97
- cellAddBtnClassName,
98
- cellAddBtnLabel,
99
-
100
- //
101
- modalMaskOpacity,
102
- modalMaxWidth,
103
- modalMinHeight,
104
- modalHeading,
105
- modalContent,
106
- modalDeleteContent,
107
- modalCloseBtnClassName,
108
- modalCloseBtnLabel,
109
- modalSubmitBtnClassName,
110
- modalSubmitBtnLabel,
111
- modalSubmitDeleteBtnClassName,
112
- modalSubmitDeleteBtnLabel,
113
- onModalEditOpen,
114
- onModalEditClose,
115
- onModalDeleteOpen,
116
- onModalDeleteClose,
117
- onModalEditEvent,
118
- onModalDeleteEvent,
119
-
120
- //
121
- onCellMouseEnter,
122
- onCellMouseLeave,
123
- onCellClick,
124
- onCellDoubleClick,
125
- onCellMouseUp,
126
- onKeyPressed
127
- } = props;
128
-
129
- const DAYS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
130
- const DAYS_LEAP = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
131
- const WEEK = langWeek || ['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN'];
132
- const WEEK_FULL = langWeekFull || ['MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY'];
133
- const MONTHS = langMonths || ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'];
134
- const MONTHS_FULL = langMonthsFull || ['January', 'Febuary', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
135
- const START_WEEK_ON = 1; // represents "Monday/1" in JavaScript
136
-
137
- // orginal data
138
- const [orginalData, setOrginalData] = useState<TimelineCellListConfig[]>([]);
139
-
140
- const now = useMemo(() => new Date(), []);
141
- const [date, setDate] = useState<Date>(now);
142
- const [day, setDay] = useState<number>(date.getDate());
143
- const [month, setMonth] = useState<number>(date.getMonth());
144
- const [year, setYear] = useState<number>(date.getFullYear());
145
- const [startDay, setStartDay] = useState<number>(getStartDayOfMonth(date));
146
-
147
-
148
- // selection tab
149
- // gets the today date time object
150
- const [selectedMonth, setSelectedMonth] = useState<number>(now.getMonth());
151
- const [selectedYear, setSelectedYear] = useState<number>(now.getFullYear());
152
- const [yearsArray, setYearsCollection] = useState<number[]>([]);
153
-
154
- //
155
- const [winYear, setWinYear] = useState<boolean>(false);
156
- const [winMonth, setWinMonth] = useState<boolean>(false);
157
-
158
- // modal dialog
159
- const modalEditHandleRef = useRef<any>();
160
- const modalDeleteHandleRef = useRef<any>();
161
- const EVENTS_ENABLED = typeof modalContent !== 'undefined';
162
- const EVENTS_DELETE_ENABLED = typeof modalDeleteContent !== 'undefined';
163
- const [showEdit, setShowEdit] = useState<boolean>(false);
164
- const [showDelete, setShowDelete] = useState<boolean>(false);
165
-
166
- // Open temporary storage for pop-ups
167
- const [tableCellId, setTableCellId] = useState<number>(-1);
168
-
169
-
170
- const findMondayAndTruncate = (dates: string[]) => {
171
- const _res = dates.map((s: string) => new Date(s));
172
- // Find the first Monday in the sequence
173
- for (let i = 0; i < _res.length; i++) {
174
- const date = _res[i];
175
- if (date.getDay() === START_WEEK_ON) {
176
- // Return dates starting from Monday onwards
177
- return dates.slice(i);
178
- }
179
- }
180
-
181
- return []; // Return empty array if no Monday found
182
- }
183
-
184
-
185
-
186
- // exposes the following methods
187
- useImperativeHandle(
188
- contentRef,
189
- () => ({
190
- today: () => {
191
- handleTodayChange();
192
- },
193
- next: () => {
194
- handleNextChange();
195
- },
196
- prev: () => {
197
- handlePrevChange();
198
- },
199
- closeModal: () => {
200
- if (modalEditHandleRef.current) modalEditHandleRef.current.close();
201
- if (modalDeleteHandleRef.current) modalDeleteHandleRef.current.close();
202
- }
203
- }),
204
- [contentRef],
205
- );
206
-
207
-
208
- // helper buttons
209
- const _delBtn = () => <>
210
- {iconRemove ? <>{iconRemove}</> : <><svg width="20px" height="20px" viewBox="0 0 24 24" fill="none"><path fillRule="evenodd" clipRule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10ZM8 11a1 1 0 1 0 0 2h8a1 1 0 1 0 0-2H8Z" fill="#000" /></svg></>}
211
- {cellCloseBtnLabel || ''}
212
- </>;
213
-
214
- const _addBtn = () => <>
215
- {iconAdd ? <>{iconAdd}</> : <><svg width="20px" height="20px" viewBox="0 0 32 32"><g stroke="none" strokeWidth="1" fill="none" fillRule="evenodd"><g transform="translate(-102.000000, -1037.000000)" fill="#000000"><path d="M124,1054 L119,1054 L119,1059 C119,1059.55 118.552,1060 118,1060 C117.448,1060 117,1059.55 117,1059 L117,1054 L112,1054 C111.448,1054 111,1053.55 111,1053 C111,1052.45 111.448,1052 112,1052 L117,1052 L117,1047 C117,1046.45 117.448,1046 118,1046 C118.552,1046 119,1046.45 119,1047 L119,1052 L124,1052 C124.552,1052 125,1052.45 125,1053 C125,1053.55 124.552,1054 124,1054 L124,1054 Z M130,1037 L106,1037 C103.791,1037 102,1038.79 102,1041 L102,1065 C102,1067.21 103.791,1069 106,1069 L130,1069 C132.209,1069 134,1067.21 134,1065 L134,1041 C134,1038.79 132.209,1037 130,1037 L130,1037 Z"></path></g></g></svg></>}
216
- {cellAddBtnLabel || ''}
217
- </>;
218
-
219
-
220
-
221
- const queryItemObj = () => {
222
- const _perData = orginalData.filter((item: any) => getCalendarDate(item.date as string) === getCalendarDate(`${year}-${month + 1}-${day}`));
223
-
224
- let _currentData: any = undefined;
225
- if (_perData[0]) {
226
- const _items = _perData[0].list;
227
-
228
-
229
- if (tableCellId === -1) {
230
- // add new
231
- _currentData = {
232
- id: 0,
233
- date: getCalendarDate(`${year}-${month + 1}-${day}`)
234
- };
235
- } else {
236
- // edit or delete
237
- _currentData = _items.filter((item: any) => item.id == tableCellId)[0];
238
- }
239
-
240
- }
241
-
242
- return _perData[0] ? _currentData : {
243
- id: 0,
244
- date: getCalendarDate(`${year}-${month + 1}-${day}`)
245
- };
246
- };
247
-
248
-
249
-
250
-
251
- // cell
252
- const getCells = (type: 'none' | 'forward' | 'back' = 'none') => {
253
-
254
- let currentMonth: any = month;
255
- let currentStartDay: any = startDay;
256
-
257
- // previous month
258
- if (type === 'forward') {
259
- const _date = new Date(year, currentMonth - 1, day);
260
- currentMonth = _date.getMonth();
261
- currentStartDay = getStartDayOfMonth(_date);
262
- }
263
-
264
- // next month
265
- if (type === 'back') {
266
- const _date = new Date(year, currentMonth + 1, day);
267
- currentMonth = _date.getMonth();
268
- currentStartDay = getStartDayOfMonth(_date);
269
- }
270
-
271
-
272
- //
273
- const allDays = Array(days[currentMonth] + (currentStartDay - 1)).fill(null).map((_: any, i: number) => i); // [0,1,..,30,31]
274
- const rows = Math.ceil(allDays.length / 7); // 5
275
-
276
- //
277
- const _tempCells: any[] = Array.from({ length: rows }).fill(null);
278
-
279
-
280
- const _getForwardFill = (_year: number, _month: number) => {
281
- // Get the last day of the previous month
282
- const lastDayOfLastMonth = new Date(_year, _month - 1, 0);
283
- const last7Days: Date[] = [];
284
-
285
- // Rewind 7 days forward from the last day
286
- for (let i = 0; i < 7; i++) {
287
- last7Days.unshift(new Date(lastDayOfLastMonth));
288
- lastDayOfLastMonth.setDate(lastDayOfLastMonth.getDate() - 1);
289
- }
290
- return last7Days.map((v: Date) => getCalendarDate(v));
291
- };
292
-
293
- const _getBackFill = (_year: number, _month: number) => {
294
- // Get the first day of the next month
295
- const firstDayOfNextMonth = new Date(_year, _month, 1);
296
- const first7Days: Date[] = [];
297
-
298
- // Rewind 7 days forward from the first day of the next month
299
- for (let i = 0; i < 7; i++) {
300
- first7Days.push(new Date(firstDayOfNextMonth));
301
- firstDayOfNextMonth.setDate(firstDayOfNextMonth.getDate() + 1);
302
- }
303
-
304
- return first7Days.map((v: Date) => getCalendarDate(v));
305
- };
306
-
307
-
308
-
309
- // The remaining date of the previous month
310
- // If the number is 7, the calendar does not include the date of the previous month
311
- const remainPrevDate = findMondayAndTruncate(_getForwardFill(year, month+1));
312
- const remainPrevDateTotal = remainPrevDate.length === 7 ? 0 : remainPrevDate.length;
313
-
314
-
315
- return {
316
- rowsTotal: orginalData.length,
317
- colsTotal: allDays.length,
318
- forwardFillTotal: remainPrevDateTotal,
319
- list: _tempCells.map((_: any, j: number) => {
320
- const _col = allDays.slice(j * 7, (j + 1) * 7);
321
-
322
-
323
- // back fill
324
- const backFillArr: null[] = [];
325
- for (let k = 0; k < 7 - _col.length; k++) {
326
- backFillArr.push(null);
327
- }
328
- _col.splice(_col.length, 0, ...backFillArr as any);
329
-
330
-
331
- //
332
- const isFirstGroup = j === 0;
333
- const isLastGroup = j === _tempCells.length - 1;
334
-
335
-
336
- // forward fill
337
- const __forwardFillDate: string[] = _getForwardFill(year, month + 1);
338
-
339
- // back fill
340
- const __backFillDate: string[] = _getBackFill(year, month + 1);
341
-
342
-
343
- const _getDateShow = (_dayIndex: number, _m: number, _startDay: number, _month: number) => {
344
- const currentDay = typeof _dayIndex === 'number' ? _dayIndex - (_startDay - 2) : 0; // ..., -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, ...
345
-
346
- // date
347
- let _dateShow: any = currentDay > 0 ? `${year}-${_month + 1}-${currentDay}` : '';
348
-
349
- // forward & back
350
- if (isFirstGroup && _dateShow === '') {
351
- _dateShow = __forwardFillDate.at(currentDay - 1);
352
- }
353
-
354
- if (isLastGroup && _dateShow === '') {
355
- _dateShow = __backFillDate.at(_m);
356
- }
357
-
358
-
359
- return {
360
- date: getCalendarDate(_dateShow),
361
- firstGroup: isFirstGroup,
362
- lastGroup: isLastGroup,
363
- validDisplayDate: currentDay > 0 && currentDay <= days[month]
364
- };
365
-
366
- }
367
-
368
- //
369
- return {
370
- month: currentMonth,
371
- startDay: currentStartDay,
372
- row: j,
373
- col: _col,
374
- dateInfo: _col.map((k: number, m: number) => {
375
- const _lastWeekDays: number = _col.filter(Boolean).length;
376
- return _getDateShow(k, m - _lastWeekDays, currentStartDay, currentMonth);
377
- }),
378
- weekDisplay: _col.map((k: number, m: number) => {
379
- return WEEK[m]
380
- }),
381
- week: _col.map((k: number, m: number) => {
382
- return m
383
- }),
384
-
385
- }
386
- })
387
- }
388
-
389
- };
390
-
391
-
392
- function updateTodayDate(inputDate: Date) {
393
- setDay(inputDate.getDate());
394
- setMonth(inputDate.getMonth());
395
- setYear(inputDate.getFullYear());
396
- setStartDay(getStartDayOfMonth(inputDate));
397
-
398
- // update selector
399
- setSelectedMonth(inputDate.getMonth());
400
- setSelectedYear(inputDate.getFullYear());
401
-
402
- }
403
-
404
-
405
- function getStartDayOfMonth(date: Date) {
406
- const startDate = new Date(date.getFullYear(), date.getMonth(), 1).getDay();
407
- return startDate === 0 ? 7 : startDate;
408
- }
409
-
410
- function isLeapYear(year: number) {
411
- return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
412
- }
413
-
414
- const days = isLeapYear(year) ? DAYS_LEAP : DAYS;
415
-
416
-
417
-
418
- function handlePrevChange() {
419
- setDate((prevState) => {
420
- const _date = new Date(year, month - 1, day);
421
-
422
- // update
423
- setSelectedMonth(_date.getMonth());
424
- setSelectedYear(_date.getFullYear());
425
-
426
- //
427
- onChangeMonth?.({
428
- day: padZero(day),
429
- month: padZero(_date.getMonth() + 1),
430
- year: _date.getFullYear().toString()
431
- });
432
-
433
-
434
- return _date;
435
- });
436
-
437
-
438
- }
439
-
440
- function handleNextChange() {
441
- setDate((prevState) => {
442
- const _date = new Date(year, month + 1, day);
443
-
444
- // update
445
- setSelectedMonth(_date.getMonth());
446
- setSelectedYear(_date.getFullYear());
447
-
448
- //
449
- onChangeMonth?.({
450
- day: padZero(day),
451
- month: padZero(_date.getMonth() + 1),
452
- year: _date.getFullYear().toString()
453
- });
454
-
455
- return _date;
456
- });
457
- }
458
- function handleDayChange(e: React.MouseEvent, currentDay: number) {
459
- setDate(new Date(year, month, currentDay));
460
- }
461
-
462
-
463
- function handleYearChange(currentValue: number) {
464
- setSelectedYear(currentValue);
465
- setYear(currentValue);
466
- setDate(new Date(currentValue, month, day));
467
-
468
- // close win
469
- setWinYear(false);
470
-
471
- }
472
-
473
-
474
- function handleMonthChange(currentIndex: number) {
475
- setSelectedMonth(currentIndex);
476
- setMonth(currentIndex);
477
- setDate(new Date(year, currentIndex, day));
478
-
479
- // close win
480
- setWinMonth(false);
481
-
482
-
483
- //
484
- onChangeMonth?.({
485
- day: padZero(day),
486
- month: padZero(currentIndex + 1),
487
- year: year.toString()
488
- });
489
-
490
- }
491
-
492
-
493
- function handleTodayChange() {
494
- setSelectedMonth(now.getMonth());
495
- setSelectedYear(now.getFullYear());
496
- updateTodayDate(now);
497
-
498
- //
499
- const _now = getTodayDate().split('-');
500
- onChangeToday?.({
501
- day: _now[2],
502
- month: _now[1],
503
- year: _now[0]
504
- });
505
-
506
- }
507
-
508
-
509
- function handleShowWinYear() {
510
- setWinYear((prevState: boolean) => !prevState);
511
- }
512
-
513
- function handleShowWinMonth() {
514
- setWinMonth((prevState: boolean) => !prevState);
515
- }
516
-
517
-
518
-
519
- //if user change the selectedYear, then udate the years array that is displayed on year tab view
520
- useEffect(() => {
521
- const years: number[] = [];
522
- for (let y = selectedYear - 10; y < selectedYear + 10; y++) {
523
- years.push(y as never)
524
- }
525
- setYearsCollection(years);
526
- }, [selectedYear]);
527
-
528
-
529
- useEffect(() => {
530
- // Guaranteed year change triggered by the front and rear buttons
531
- onChangeYear?.({
532
- day: padZero(day),
533
- month: padZero(month + 1),
534
- year: year.toString()
535
- });
536
- }, [year]);
537
-
538
-
539
-
540
- useEffect(() => {
541
- updateTodayDate(date);
542
- }, [date]);
543
-
544
-
545
- useEffect(() => {
546
-
547
- // update events value
548
- if (Array.isArray(eventsValue)) setOrginalData(eventsValue);
549
-
550
- // update current today
551
- if (typeof customTodayDate === 'string' && customTodayDate !== '' && isValidDate(customTodayDate)) {
552
- const _customNow = new Date(customTodayDate);
553
- updateTodayDate(_customNow);
554
- }
555
-
556
- // Call a function when the list has been rendered completely
557
- onListRenderComplete?.();
558
-
559
- }, [eventsValue, customTodayDate]);
560
-
561
-
562
- return (
563
- <>
564
-
565
- <div
566
- className={combinedCls(
567
- "custom-event-cal__wrapper",
568
- calendarWrapperClassName
569
- )}
570
- onKeyDown={(e: React.KeyboardEvent<HTMLDivElement>) => {
571
- onKeyPressed?.(e);
572
- }}
573
- tabIndex={-1}
574
- >
575
-
576
-
577
- {/*++++++++++++++++ MAIN ++++++++++++++++*/}
578
- <div className="custom-event-cal__header bg-body-tertiary">
579
- <button tabIndex={-1} type="button" className="custom-event-cal__btn custom-event-cal__btn--prev" onClick={handlePrevChange}>
580
- <svg width="20px" height="20px" viewBox="0 0 24 24" fill="none">
581
- <path d="M14.2893 5.70708C13.8988 5.31655 13.2657 5.31655 12.8751 5.70708L7.98768 10.5993C7.20729 11.3805 7.2076 12.6463 7.98837 13.427L12.8787 18.3174C13.2693 18.7079 13.9024 18.7079 14.293 18.3174C14.6835 17.9269 14.6835 17.2937 14.293 16.9032L10.1073 12.7175C9.71678 12.327 9.71678 11.6939 10.1073 11.3033L14.2893 7.12129C14.6799 6.73077 14.6799 6.0976 14.2893 5.70708Z" fill="#000" />
582
- </svg>
583
- </button>
584
- <div className="custom-event-cal__header__btns">
585
- <button tabIndex={-1} type="button" className={`custom-event-cal__btn ${winMonth ? 'active' : ''}`} onClick={handleShowWinMonth}>
586
- {MONTHS[month]}
587
- <svg width="12px" height="12px" viewBox="0 0 24 24"><path d="M11.178 19.569a.998.998 0 0 0 1.644 0l9-13A.999.999 0 0 0 21 5H3a1.002 1.002 0 0 0-.822 1.569l9 13z" fill="#000000" /></svg>
588
- </button>
589
- <button tabIndex={-1} type="button" className={`custom-event-cal__btn ${winYear ? 'active' : ''}`} onClick={handleShowWinYear}>
590
- {year}
591
- <svg width="12px" height="12px" viewBox="0 0 24 24"><path d="M11.178 19.569a.998.998 0 0 0 1.644 0l9-13A.999.999 0 0 0 21 5H3a1.002 1.002 0 0 0-.822 1.569l9 13z" fill="#000000" /></svg>
592
- </button>
593
- </div>
594
- <button tabIndex={-1} type="button" className="custom-event-cal__btn custom-event-cal__btn--next" onClick={handleNextChange}>
595
- <svg width="20px" height="20px" viewBox="0 0 24 24" fill="none">
596
- <path d="M9.71069 18.2929C10.1012 18.6834 10.7344 18.6834 11.1249 18.2929L16.0123 13.4006C16.7927 12.6195 16.7924 11.3537 16.0117 10.5729L11.1213 5.68254C10.7308 5.29202 10.0976 5.29202 9.70708 5.68254C9.31655 6.07307 9.31655 6.70623 9.70708 7.09676L13.8927 11.2824C14.2833 11.6729 14.2833 12.3061 13.8927 12.6966L9.71069 16.8787C9.32016 17.2692 9.32016 17.9023 9.71069 18.2929Z" fill="#000" />
597
- </svg>
598
- </button>
599
- </div>
600
- <div className="custom-event-cal__body">
601
-
602
- {/* week */}
603
- <div className="custom-event-cal__row">
604
- {WEEK.map((s: string, i: number) => (
605
- <div
606
- className={combinedCls(
607
- 'custom-event-cal__cell custom-event-cal__day custom-event-cal__day--week custom-event-cal__day--disabled bg-secondary-subtle empty',
608
- {
609
- 'last-cell': i === WEEK.length - 1
610
- }
611
- )}
612
- key={i}
613
- data-week={i}
614
- dangerouslySetInnerHTML={{
615
- __html: s
616
- }}
617
- />
618
- ))}
619
- </div>
620
- {/* /week */}
621
-
622
- {/* day */}
623
- {getCells().list.map((item: any, j: number) => {
624
-
625
- const isLastRow = j === getCells().list.length - 1;
626
-
627
- return <div key={'row' + item.row} className="custom-event-cal__row">
628
- {item.col.map((dayIndex: number | null, i: number) => {
629
-
630
- const isLastCell = i === item.col.length - 1;
631
-
632
- // date
633
- const _dateShow = item.dateInfo[i].date;
634
- const _dateDayShow = _dateShow.split('-').at(-1);
635
-
636
- // week day
637
- const weekDay = item.week[i];
638
-
639
- // helper
640
- const d = parseFloat(_dateDayShow);
641
- const _currentData = orginalData.filter((item: any) => getCalendarDate(item.date as string) === _dateShow);
642
- const isInteractive = item.dateInfo[i].validDisplayDate; // The date on which the user interaction can occur, e.g. click, modify
643
- const isForward = item.dateInfo[i].firstGroup && !isInteractive;
644
- const isBack = item.dateInfo[i].lastGroup && !isInteractive;
645
-
646
-
647
- const _eventContent = () => {
648
-
649
- if (
650
- _currentData.length === 0 ||
651
- !Array.isArray(_currentData) ||
652
- typeof _currentData[0].list === 'undefined'
653
- ) {
654
- return null;
655
- }
656
-
657
- //
658
- const _items = _currentData[0].list;
659
-
660
- return _items.map((cellItem: any, cellItemIndex: number) => {
661
-
662
- return <div
663
- className={combinedCls(
664
- `custom-event-cal__cell-item custom-event-cal__cell-item-${cellItemIndex}`,
665
- {
666
- 'first': cellItemIndex === 0,
667
- 'last': cellItemIndex === _items.length - 1
668
- }
669
- )}
670
- key={`cell-item-${cellItemIndex}}`}
671
- data-date={_dateShow}
672
- data-day={_dateDayShow}
673
- data-week={weekDay}
674
- onClick={(e: React.MouseEvent) => {
675
- e.stopPropagation();
676
-
677
- // update cell data
678
- setTableCellId(cellItem.id);
679
-
680
- // Callback
681
- cellItem.callback?.();
682
-
683
-
684
- if (isInteractive) {
685
- handleDayChange(e, d); // update current day
686
-
687
- //
688
- const _now = cellItem.date.split('-');
689
- onChangeDate?.(e, {
690
- ...cellItem,
691
- day: _now[2],
692
- month: _now[1],
693
- year: _now[0]
694
- });
695
-
696
- if (EVENTS_ENABLED) {
697
- onModalEditOpen?.(cellItem, () => setShowEdit(true), 'normal');
698
- }
699
- }
700
- }}
701
- >
702
-
703
- {/* ITEM */}
704
- <div
705
- className="custom-event-cal__day__event"
706
- style={typeof cellItem !== 'undefined' && (cellItem as any).eventStyles !== 'undefined' ? cellItem.eventStyles : {}}
707
- dangerouslySetInnerHTML={typeof cellItem.data === 'string' ? {
708
- __html: cellItem.data
709
- } : undefined}
710
- >
711
- {React.isValidElement(cellItem.data) ? <>{cellItem.data}</> : null}
712
- </div>
713
- {/* /ITEM */}
714
-
715
- {/* DELETE BUTTON */}
716
- <div
717
- className={`custom-event-cal__day__eventdel ${cellCloseBtnClassName || ''}`}
718
- >
719
- <a
720
- href="#"
721
- tabIndex={-1}
722
- className="align-middle"
723
- data-date={getCalendarDate(_dateShow)}
724
- data-day={padZero(d)}
725
- data-week={i}
726
- onClick={(e: React.MouseEvent) => {
727
- e.preventDefault();
728
- e.stopPropagation();
729
-
730
- // update cell data
731
- setTableCellId(cellItem.id);
732
-
733
-
734
- const _existsContent = cellItem;
735
-
736
- //
737
- if (isInteractive) {
738
- handleDayChange(e, d); // update current day
739
-
740
-
741
- //
742
- const _now = getCalendarDate(`${year}-${month + 1}-${d}`).split('-');
743
- onChangeDate?.(e, {
744
- id: 0,
745
- date: getCalendarDate(`${year}-${month + 1}-${d}`),
746
- day: _now[2],
747
- month: _now[1],
748
- year: _now[0]
749
- });
750
-
751
- if (EVENTS_DELETE_ENABLED) {
752
- onModalDeleteOpen?.(_existsContent, () => setShowDelete(true));
753
- }
754
- }
755
-
756
- }}
757
- >
758
- {_delBtn()}
759
- </a>
760
-
761
- </div>
762
- {/* /DELETE BUTTON */}
763
- </div>
764
- });
765
- };
766
-
767
-
768
- return (
769
- <div
770
- className={combinedCls(
771
- 'custom-event-cal__cell custom-event-cal__day',
772
- {
773
- 'empty': !isInteractive,
774
- 'today': d === now.getDate(),
775
- 'selected': d === day,
776
- 'last-cell': isLastCell,
777
- 'last-row': isLastRow,
778
- }
779
- )}
780
- key={"col" + i}
781
- data-date={getCalendarDate(_dateShow)}
782
- data-day={padZero(d)}
783
- data-week={i}
784
- onMouseEnter={(e: React.MouseEvent) => {
785
- onCellMouseEnter?.(e);
786
- }}
787
- onMouseDown={(e: React.MouseEvent) => {
788
- //
789
- onCellClick?.(e);
790
-
791
- if (isInteractive) {
792
- handleDayChange(e, d); // update current day
793
- onChangeDate?.(e, null);
794
- }
795
- }}
796
- onDoubleClick={(e: React.MouseEvent) => {
797
- //
798
- onCellDoubleClick?.(e);
799
- }}
800
- onMouseLeave={(e: React.MouseEvent) => {
801
- onCellMouseLeave?.(e);
802
- }}
803
- onMouseUp={(e: React.MouseEvent) => {
804
- onCellMouseUp?.(e);
805
- }}
806
-
807
- >
808
-
809
- {/* forward fill & day & back fill */}
810
- <span
811
- className={combinedCls(
812
- {
813
- 'disabled': !isInteractive
814
- }
815
- )}
816
- >
817
- {d}
818
- </span>
819
-
820
- {/*++++++++++++++++ EVENT ++++++++++++++++*/}
821
- {_eventContent()}
822
- {/*++++++++++++++++ /EVENT ++++++++++++++++*/}
823
-
824
- {/* ADD BUTTON */}
825
- {isForward || isBack ? null : <>
826
- <div
827
- className={`custom-event-cal__day__eventadd ${cellAddBtnClassName || ''}`}
828
- >
829
- <a
830
- href="#"
831
- tabIndex={-1}
832
- className="align-middle"
833
- data-date={getCalendarDate(_dateShow)}
834
- data-day={padZero(d)}
835
- data-week={i}
836
- onClick={(e: React.MouseEvent) => {
837
- e.preventDefault();
838
- e.stopPropagation();
839
-
840
- // update cell data
841
- setTableCellId(-1);
842
-
843
- //
844
- if (isInteractive) {
845
- handleDayChange(e, d); // update current day
846
-
847
-
848
- //
849
- const _now = getCalendarDate(`${year}-${month + 1}-${d}`).split('-');
850
- onChangeDate?.(e, {
851
- id: 0,
852
- date: getCalendarDate(`${year}-${month + 1}-${d}`),
853
- day: _now[2],
854
- month: _now[1],
855
- year: _now[0]
856
- });
857
-
858
- if (EVENTS_ENABLED) {
859
- onModalEditOpen?.({
860
- id: 0,
861
- date: getCalendarDate(`${year}-${month + 1}-${d}`)
862
- }, () => setShowEdit(true), 'new');
863
- }
864
- }
865
- }}
866
- >
867
- {_addBtn()}
868
- </a>
869
-
870
- </div>
871
- </>}
872
- {/* /ADD BUTTON */}
873
-
874
- </div>
875
- );
876
- })}
877
- </div>;
878
-
879
- })}
880
-
881
- {/* /day */}
882
-
883
- </div>
884
- {/*++++++++++++++++ /MAIN ++++++++++++++++*/}
885
-
886
-
887
- {/*++++++++++++++++ MONTH SELECTION TAB ++++++++++++++++*/}
888
- <div className={`custom-event-cal__month-wrapper shadow p-3 mb-5 bg-body-tertiary rounded ${winMonth ? 'active' : ''}`}>
889
- <div className="custom-event-cal__month-container">
890
- {MONTHS_FULL.map((month, index) => {
891
- return <div
892
- data-month={padZero(index + 1)}
893
- className={`custom-event-cal__month ${selectedMonth === index ? ' selected' : ''}`}
894
- key={month + index}
895
- onClick={() => { handleMonthChange(index) }}
896
- >{month}</div>
897
- })}
898
- </div>
899
- </div>
900
- {/*++++++++++++++++ /MONTH SELECTION TAB ++++++++++++++++*/}
901
-
902
- {/*++++++++++++++++ YEAR SELECTION TAB ++++++++++++++++*/}
903
- <div className={`custom-event-cal__year-wrapper shadow p-3 mb-5 bg-body-tertiary rounded ${winYear ? 'active' : ''}`}>
904
- <div className="custom-event-cal__year-container bg-body-tertiary">
905
- {yearsArray.map((year, index) => {
906
- return <div
907
- data-year={year}
908
- className={`custom-event-cal__year ${selectedYear === year ? ' selected' : ''}`}
909
- key={year + index}
910
- onClick={() => { handleYearChange(year) }}
911
- >{year}</div>
912
- })}
913
- </div>
914
-
915
- </div>
916
- {/*++++++++++++++++ /YEAR SELECTION TAB ++++++++++++++++*/}
917
-
918
-
919
-
920
- {/*++++++++++++++++ TODAY SELECTION TAB ++++++++++++++++*/}
921
- <div className="custom-event-cal__today-wrapper p-2 bg-body-tertiary">
922
- <button tabIndex={-1} type="button" className="custom-event-cal__btn custom-event-cal__btn--today" onClick={handleTodayChange}>
923
- {langToday || 'Today'}
924
- </button>
925
- </div>
926
- {/*++++++++++++++++ /TODAY SELECTION TAB ++++++++++++++++*/}
927
-
928
-
929
- </div>
930
-
931
-
932
- {/*++++++++++++++++ MODAL ++++++++++++++++*/}
933
- {EVENTS_ENABLED ? <>
934
-
935
- {/*<!-- DELETE -->*/}
936
- <ModalDialog
937
- ref={modalDeleteHandleRef}
938
- show={showDelete}
939
- maskOpacity={modalMaskOpacity}
940
- triggerClassName=""
941
- triggerContent=""
942
- closeBtnClassName={modalCloseBtnClassName || 'btn btn-secondary'}
943
- closeBtnLabel={modalCloseBtnLabel || 'Close'}
944
- submitBtnClassName={modalSubmitDeleteBtnClassName || 'btn btn-danger'}
945
- submitBtnLabel={modalSubmitDeleteBtnLabel || <>Delete</>}
946
- onClose={(e) => {
947
-
948
- setTimeout(() => {
949
- setShowDelete(false);
950
- onModalDeleteClose?.(queryItemObj());
951
- }, 350);
952
- }}
953
- onSubmit={async (e: any, closewin: Function, data: any) => {
954
- onModalDeleteEvent?.(queryItemObj(), closewin);
955
-
956
- }}
957
- >
958
- {modalDeleteContent || 'Are you sure?'}
959
-
960
- </ModalDialog>
961
- {/*<!-- /DELETE -->*/}
962
-
963
-
964
- {/*<!-- EDIT -->*/}
965
- <ModalDialog
966
- ref={modalEditHandleRef}
967
- show={showEdit}
968
- maskOpacity={modalMaskOpacity}
969
- heading={modalHeading}
970
- maxWidth={modalMaxWidth}
971
- minHeight={modalMinHeight}
972
- triggerClassName=""
973
- triggerContent=""
974
- closeBtnClassName={modalCloseBtnClassName || 'btn btn-secondary'}
975
- closeBtnLabel={modalCloseBtnLabel || 'Close'}
976
- submitBtnClassName={modalSubmitBtnClassName || 'btn btn-primary'}
977
- submitBtnLabel={modalSubmitBtnLabel || <>Save</>}
978
- onClose={(e) => {
979
- setTimeout(() => {
980
- setShowEdit(false);
981
- onModalEditClose?.(queryItemObj());
982
- }, 350);
983
- }}
984
- onSubmit={async (e: any, closewin: Function, data: any) => {
985
- onModalEditEvent?.(queryItemObj(), closewin);
986
-
987
- }}
988
- >
989
- {modalContent}
990
-
991
- </ModalDialog>
992
- {/*<!-- /EDIT -->*/}
993
-
994
-
995
- </> : null}
996
- {/*++++++++++++++++ /MODAL ++++++++++++++++*/}
997
-
998
-
999
- </>
1000
- )
1001
- };
1002
-
1003
-
1004
- export default EventCalendar;