impact-ui 4.0.0-alpha.2 → 4.0.0-alpha.21

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 (1009) hide show
  1. package/MIGRATION_GUIDE.md +37 -7
  2. package/README.md +6 -6
  3. package/bin/migrate.js +5 -5
  4. package/codemods/transform.js +17 -23
  5. package/dist/_virtual/BookmarkBorderOutlined.js +4 -0
  6. package/dist/_virtual/ChevronLeftOutlined.js +4 -0
  7. package/dist/_virtual/CloseRounded.js +4 -0
  8. package/dist/_virtual/FilterAltOutlined.js +4 -0
  9. package/dist/_virtual/FilterListOutlined.js +4 -0
  10. package/dist/_virtual/KeyboardRounded.js +4 -0
  11. package/dist/_virtual/index.js +4 -2
  12. package/dist/_virtual/index10.js +3 -3
  13. package/dist/_virtual/index11.js +3 -3
  14. package/dist/_virtual/index12.js +3 -3
  15. package/dist/_virtual/index13.js +2 -4
  16. package/dist/_virtual/index14.js +2 -2
  17. package/dist/_virtual/index15.js +2 -2
  18. package/dist/_virtual/index16.js +2 -2
  19. package/dist/_virtual/index2.js +2 -4
  20. package/dist/_virtual/index3.js +2 -2
  21. package/dist/_virtual/index4.js +4 -2
  22. package/dist/_virtual/index5.js +3 -3
  23. package/dist/_virtual/index6.js +2 -4
  24. package/dist/_virtual/index7.js +4 -2
  25. package/dist/_virtual/index8.js +3 -3
  26. package/dist/_virtual/index9.js +3 -3
  27. package/dist/components/Accordion/index.d.ts.map +1 -1
  28. package/dist/components/Accordion/index.js +45 -31
  29. package/dist/components/AccordionModern/SortableAccordionComp.js +3 -3
  30. package/dist/components/AccordionModern/index.js +2 -1
  31. package/dist/components/Alert/index.js +3 -2
  32. package/dist/components/Avatar/index.js +2 -1
  33. package/dist/components/Badge/filled/filledIconLabelBadges/index.js +2 -1
  34. package/dist/components/Badge/filled/filledOnlyIconBadges/index.js +2 -1
  35. package/dist/components/Badge/filled/filledOnlyLabelBadges/index.js +2 -1
  36. package/dist/components/Badge/index.js +3 -2
  37. package/dist/components/Badge/stroke/strokeIconLabelBadges/index.js +2 -1
  38. package/dist/components/Badge/stroke/strokeOnlyIconBadges/index.js +2 -1
  39. package/dist/components/Badge/stroke/strokeOnlyLabelBadges/index.js +2 -1
  40. package/dist/components/Badge/subtle/subtleIOnlyIconBadges/index.js +2 -1
  41. package/dist/components/Badge/subtle/subtleIconLabelBadges/index.js +2 -1
  42. package/dist/components/Badge/subtle/subtleOnlyLabelBadges/index.js +2 -1
  43. package/dist/components/BottomSheet/index.js +2 -1
  44. package/dist/components/Breadcrumbs/index.d.ts +1 -1
  45. package/dist/components/Breadcrumbs/index.d.ts.map +1 -1
  46. package/dist/components/Breadcrumbs/index.js +10 -2
  47. package/dist/components/Button/Button.types.d.ts +4 -0
  48. package/dist/components/Button/Button.types.d.ts.map +1 -1
  49. package/dist/components/Button/index.d.ts.map +1 -1
  50. package/dist/components/Button/index.js +4 -1
  51. package/dist/components/ButtonGroup/ButtonGroup.types.d.ts +1 -1
  52. package/dist/components/ButtonGroup/ButtonGroup.types.d.ts.map +1 -1
  53. package/dist/components/ButtonGroup/index.d.ts +1 -1
  54. package/dist/components/ButtonGroup/index.d.ts.map +1 -1
  55. package/dist/components/ButtonGroup/index.js +7 -2
  56. package/dist/components/Card/index.js +2 -1
  57. package/dist/components/Chart/Chart.types.d.ts +2 -2
  58. package/dist/components/Chart/index.d.ts +1 -1
  59. package/dist/components/Chart/index.d.ts.map +1 -1
  60. package/dist/components/Chart/index.js +22 -14
  61. package/dist/components/Chatbot/Chatbot.types.d.ts +16 -1
  62. package/dist/components/Chatbot/Chatbot.types.d.ts.map +1 -1
  63. package/dist/components/Chatbot/bookMarkPanel.d.ts.map +1 -1
  64. package/dist/components/Chatbot/bookMarkPanel.js +4 -3
  65. package/dist/components/Chatbot/chatInput.d.ts.map +1 -1
  66. package/dist/components/Chatbot/chatInput.js +8 -7
  67. package/dist/components/Chatbot/chatbotModuleMenu.d.ts.map +1 -1
  68. package/dist/components/Chatbot/chatbotModuleMenu.js +6 -5
  69. package/dist/components/Chatbot/constant.d.ts.map +1 -1
  70. package/dist/components/Chatbot/constant.js +6 -5
  71. package/dist/components/Chatbot/historyPanel.d.ts.map +1 -1
  72. package/dist/components/Chatbot/historyPanel.js +2 -1
  73. package/dist/components/Chatbot/index.d.ts +1 -1
  74. package/dist/components/Chatbot/index.d.ts.map +1 -1
  75. package/dist/components/Chatbot/index.js +66 -9
  76. package/dist/components/Chatbot/newChatComponent.d.ts.map +1 -1
  77. package/dist/components/Chatbot/newChatComponent.js +3 -2
  78. package/dist/components/Checkbox/Checkbox.types.d.ts +2 -0
  79. package/dist/components/Checkbox/Checkbox.types.d.ts.map +1 -1
  80. package/dist/components/Checkbox/Default.d.ts +1 -1
  81. package/dist/components/Checkbox/Default.d.ts.map +1 -1
  82. package/dist/components/Checkbox/Default.js +4 -0
  83. package/dist/components/Checkbox/index.js +2 -1
  84. package/dist/components/Chips/index.js +2 -1
  85. package/dist/components/CreateItemFlow/index.d.ts.map +1 -1
  86. package/dist/components/CreateItemFlow/index.js +4 -2
  87. package/dist/components/DatePicker/datePickerDropdown.js +2 -1
  88. package/dist/components/DatePicker/datePickerInput.d.ts +2 -0
  89. package/dist/components/DatePicker/datePickerInput.d.ts.map +1 -1
  90. package/dist/components/DatePicker/datePickerInput.js +4 -0
  91. package/dist/components/DatePicker/index.d.ts.map +1 -1
  92. package/dist/components/DatePicker/index.js +7 -2
  93. package/dist/components/DatePicker/showMonthYearSelect.d.ts.map +1 -1
  94. package/dist/components/DatePicker/showMonthYearSelect.js +31 -0
  95. package/dist/components/DateRangePicker/dateRangePickerDropdown.d.ts +4 -1
  96. package/dist/components/DateRangePicker/dateRangePickerDropdown.d.ts.map +1 -1
  97. package/dist/components/DateRangePicker/dateRangePickerDropdown.js +20 -5
  98. package/dist/components/DateRangePicker/dateRangePickerInput.d.ts +4 -1
  99. package/dist/components/DateRangePicker/dateRangePickerInput.d.ts.map +1 -1
  100. package/dist/components/DateRangePicker/dateRangePickerInput.js +18 -4
  101. package/dist/components/DateRangePicker/index.d.ts.map +1 -1
  102. package/dist/components/DateRangePicker/index.js +31 -5
  103. package/dist/components/DynamicLayout/index.js +2 -1
  104. package/dist/components/EmptyState/EmptyState.types.d.ts +2 -2
  105. package/dist/components/EmptyState/EmptyStateImage.d.ts +0 -1
  106. package/dist/components/EmptyState/EmptyStateImage.d.ts.map +1 -1
  107. package/dist/components/EmptyState/EmptyStateImage.js +19 -37
  108. package/dist/components/EmptyState/index.d.ts +1 -2
  109. package/dist/components/EmptyState/index.d.ts.map +1 -1
  110. package/dist/components/EmptyState/index.js +35 -21
  111. package/dist/components/FileUpload/FileUpload.types.d.ts +10 -2
  112. package/dist/components/FileUpload/FileUpload.types.d.ts.map +1 -1
  113. package/dist/components/FileUpload/TemplatePreview.d.ts +9 -0
  114. package/dist/components/FileUpload/TemplatePreview.d.ts.map +1 -0
  115. package/dist/components/FileUpload/TemplatePreview.js +31 -0
  116. package/dist/components/FileUpload/fileUploadAssets.loader.d.ts +1 -3
  117. package/dist/components/FileUpload/fileUploadAssets.loader.d.ts.map +1 -1
  118. package/dist/components/FileUpload/fileUploadAssets.loader.js +17 -48
  119. package/dist/components/FileUpload/fileUploadUtils.d.ts +4 -0
  120. package/dist/components/FileUpload/fileUploadUtils.d.ts.map +1 -0
  121. package/dist/components/FileUpload/fileUploadUtils.js +14 -0
  122. package/dist/components/FileUpload/index.d.ts +1 -1
  123. package/dist/components/FileUpload/index.d.ts.map +1 -1
  124. package/dist/components/FileUpload/index.js +115 -10
  125. package/dist/components/FileUpload/useFileUploadTemplateState.d.ts +14 -0
  126. package/dist/components/FileUpload/useFileUploadTemplateState.d.ts.map +1 -0
  127. package/dist/components/FileUpload/useFileUploadTemplateState.js +46 -0
  128. package/dist/components/FilterPanel/index.d.ts.map +1 -1
  129. package/dist/components/FilterPanel/index.js +34 -1
  130. package/dist/components/FiltersStrip/FiltersStrip.types.d.ts +2 -2
  131. package/dist/components/FiltersStrip/index.d.ts +1 -1
  132. package/dist/components/FiltersStrip/index.d.ts.map +1 -1
  133. package/dist/components/FiltersStrip/index.js +10 -3
  134. package/dist/components/Header/Header.types.d.ts +2 -2
  135. package/dist/components/Header/index.d.ts +1 -1
  136. package/dist/components/Header/index.d.ts.map +1 -1
  137. package/dist/components/Header/index.js +148 -135
  138. package/dist/components/HomePage/constants.d.ts.map +1 -1
  139. package/dist/components/HomePage/constants.js +67 -66
  140. package/dist/components/HomePage/index.d.ts.map +1 -1
  141. package/dist/components/HomePage/index.js +66 -10
  142. package/dist/components/Input/InputWithIcon.d.ts +1 -1
  143. package/dist/components/Input/InputWithIcon.d.ts.map +1 -1
  144. package/dist/components/Input/InputWithIcon.js +20 -2
  145. package/dist/components/Input/VanillaInput.d.ts +1 -1
  146. package/dist/components/Input/VanillaInput.d.ts.map +1 -1
  147. package/dist/components/Input/VanillaInput.js +20 -2
  148. package/dist/components/Input/index.js +2 -1
  149. package/dist/components/KeyboardShortCuts/Keycombo.d.ts +12 -0
  150. package/dist/components/KeyboardShortCuts/Keycombo.d.ts.map +1 -0
  151. package/dist/components/KeyboardShortCuts/Keycombo.js +20 -0
  152. package/dist/components/KeyboardShortCuts/ShortcutLandingPage.d.ts +7 -0
  153. package/dist/components/KeyboardShortCuts/ShortcutLandingPage.d.ts.map +1 -0
  154. package/dist/components/KeyboardShortCuts/ShortcutLandingPage.js +69 -0
  155. package/dist/components/KeyboardShortCuts/ShortcutModal.d.ts +7 -0
  156. package/dist/components/KeyboardShortCuts/ShortcutModal.d.ts.map +1 -0
  157. package/dist/components/KeyboardShortCuts/ShortcutModal.js +167 -0
  158. package/dist/components/KeyboardShortCuts/StarOutlineIcon.d.ts +3 -0
  159. package/dist/components/KeyboardShortCuts/StarOutlineIcon.d.ts.map +1 -0
  160. package/dist/components/KeyboardShortCuts/allSetBox.d.ts +6 -0
  161. package/dist/components/KeyboardShortCuts/allSetBox.d.ts.map +1 -0
  162. package/dist/components/KeyboardShortCuts/allSetBox.js +32 -0
  163. package/dist/components/KeyboardShortCuts/index.d.ts +14 -0
  164. package/dist/components/KeyboardShortCuts/index.d.ts.map +1 -0
  165. package/dist/components/KeyboardShortCuts/index.js +187 -0
  166. package/dist/components/KeyboardShortCuts/screen2.d.ts +4 -0
  167. package/dist/components/KeyboardShortCuts/screen2.d.ts.map +1 -0
  168. package/dist/components/KeyboardShortCuts/screen2.js +19 -0
  169. package/dist/components/KeyboardShortCuts/screen3.d.ts +4 -0
  170. package/dist/components/KeyboardShortCuts/screen3.d.ts.map +1 -0
  171. package/dist/components/KeyboardShortCuts/screen3.js +19 -0
  172. package/dist/components/KeyboardShortCuts/tutorial.d.ts +7 -0
  173. package/dist/components/KeyboardShortCuts/tutorial.d.ts.map +1 -0
  174. package/dist/components/KeyboardShortCuts/tutorial.js +161 -0
  175. package/dist/components/Loader/Loader.types.d.ts +2 -2
  176. package/dist/components/Loader/index.d.ts +1 -1
  177. package/dist/components/Loader/index.d.ts.map +1 -1
  178. package/dist/components/Loader/index.js +57 -37
  179. package/dist/components/Menu/IconMenuItem.js +2 -1
  180. package/dist/components/Menu/Menu.types.d.ts +3 -1
  181. package/dist/components/Menu/Menu.types.d.ts.map +1 -1
  182. package/dist/components/Menu/MenuHeaderInfo.d.ts.map +1 -1
  183. package/dist/components/Menu/MenuHeaderInfo.js +4 -2
  184. package/dist/components/Menu/NestedMenuItem.js +2 -1
  185. package/dist/components/Menu/index.d.ts.map +1 -1
  186. package/dist/components/Menu/index.js +8 -4
  187. package/dist/components/Menu/nestedMenuItemsFromObject.js +2 -1
  188. package/dist/components/Modal/index.js +2 -1
  189. package/dist/components/MonthPicker/DefaultYearSelect.js +10 -0
  190. package/dist/components/MonthPicker/constants.js +4 -0
  191. package/dist/components/MonthPicker/index.js +324 -0
  192. package/dist/components/MonthRangePicker/MonthRangePicker.types.d.ts +30 -0
  193. package/dist/components/MonthRangePicker/MonthRangePicker.types.d.ts.map +1 -0
  194. package/dist/components/MonthRangePicker/constants.d.ts +2 -0
  195. package/dist/components/MonthRangePicker/constants.d.ts.map +1 -0
  196. package/dist/components/MonthRangePicker/constants.js +4 -0
  197. package/dist/components/MonthRangePicker/index.d.ts +22 -0
  198. package/dist/components/MonthRangePicker/index.d.ts.map +1 -0
  199. package/dist/components/MonthRangePicker/index.js +613 -0
  200. package/dist/components/Notification/Notification.types.d.ts +35 -5
  201. package/dist/components/Notification/Notification.types.d.ts.map +1 -1
  202. package/dist/components/Notification/NotificationBody/NotificationList/NotificationChipsList.d.ts +21 -0
  203. package/dist/components/Notification/NotificationBody/NotificationList/NotificationChipsList.d.ts.map +1 -0
  204. package/dist/components/Notification/NotificationBody/NotificationList/NotificationChipsList.js +49 -0
  205. package/dist/components/Notification/NotificationBody/NotificationList/NotificationList.d.ts +30 -0
  206. package/dist/components/Notification/NotificationBody/NotificationList/NotificationList.d.ts.map +1 -0
  207. package/dist/components/Notification/NotificationBody/NotificationList/NotificationList.js +212 -0
  208. package/dist/components/Notification/NotificationBody/NotificationList/NotificationListItem.d.ts +14 -0
  209. package/dist/components/Notification/NotificationBody/NotificationList/NotificationListItem.d.ts.map +1 -0
  210. package/dist/components/Notification/NotificationBody/NotificationList/NotificationListItem.js +299 -0
  211. package/dist/components/Notification/NotificationBody/NotificationPanelContent.d.ts +9 -0
  212. package/dist/components/Notification/NotificationBody/NotificationPanelContent.d.ts.map +1 -0
  213. package/dist/components/Notification/NotificationBody/NotificationPanelContent.js +71 -0
  214. package/dist/components/Notification/NotificationBody/NotificationTaskList.d.ts +43 -0
  215. package/dist/components/Notification/NotificationBody/NotificationTaskList.d.ts.map +1 -0
  216. package/dist/components/Notification/NotificationBody/NotificationTaskList.js +245 -0
  217. package/dist/components/Notification/NotificationBody/index.d.ts +2 -3
  218. package/dist/components/Notification/NotificationBody/index.d.ts.map +1 -1
  219. package/dist/components/Notification/NotificationBody/index.js +21 -11
  220. package/dist/components/Notification/index.js +2 -1
  221. package/dist/components/Notification/mockData.d.ts +14 -0
  222. package/dist/components/Notification/mockData.d.ts.map +1 -0
  223. package/dist/components/Panel/index.js +2 -1
  224. package/dist/components/Popover/index.js +2 -1
  225. package/dist/components/Portal/index.d.ts +1 -1
  226. package/dist/components/Portal/index.d.ts.map +1 -1
  227. package/dist/components/Portal/index.js +2 -1
  228. package/dist/components/ProgressBar/ProgressBar.types.d.ts +2 -2
  229. package/dist/components/ProgressBar/index.d.ts +1 -1
  230. package/dist/components/ProgressBar/index.d.ts.map +1 -1
  231. package/dist/components/ProgressBar/index.js +31 -14
  232. package/dist/components/Prompt/index.js +2 -1
  233. package/dist/components/RadioButtonGroup/index.d.ts +1 -1
  234. package/dist/components/RadioButtonGroup/index.d.ts.map +1 -1
  235. package/dist/components/RadioButtonGroup/index.js +11 -2
  236. package/dist/components/Select/SearchFilter.d.ts.map +1 -1
  237. package/dist/components/Select/SearchFilter.js +140 -28
  238. package/dist/components/Select/Select.types.d.ts +46 -1
  239. package/dist/components/Select/Select.types.d.ts.map +1 -1
  240. package/dist/components/Select/customGroupHeading.js +1 -1
  241. package/dist/components/Select/dropdown.d.ts +1 -1
  242. package/dist/components/Select/dropdown.d.ts.map +1 -1
  243. package/dist/components/Select/dropdown.js +3 -2
  244. package/dist/components/Select/hooks/index.d.ts +3 -0
  245. package/dist/components/Select/hooks/index.d.ts.map +1 -1
  246. package/dist/components/Select/hooks/useKeyboardNavigation.d.ts +22 -0
  247. package/dist/components/Select/hooks/useKeyboardNavigation.d.ts.map +1 -0
  248. package/dist/components/Select/hooks/useKeyboardNavigation.js +160 -0
  249. package/dist/components/Select/hooks/useScrollIntoView.d.ts +11 -0
  250. package/dist/components/Select/hooks/useScrollIntoView.d.ts.map +1 -0
  251. package/dist/components/Select/hooks/useScrollIntoView.js +28 -0
  252. package/dist/components/Select/hooks/useTypeahead.d.ts +11 -0
  253. package/dist/components/Select/hooks/useTypeahead.d.ts.map +1 -0
  254. package/dist/components/Select/hooks/useTypeahead.js +41 -0
  255. package/dist/components/Select/index.d.ts.map +1 -1
  256. package/dist/components/Select/index.js +529 -151
  257. package/dist/components/Select/menuList.d.ts +2 -7
  258. package/dist/components/Select/menuList.d.ts.map +1 -1
  259. package/dist/components/Select/menuList.js +70 -18
  260. package/dist/components/Select/optionList.js +1 -1
  261. package/dist/components/Select/utils.d.ts +2 -2
  262. package/dist/components/Select/utils.d.ts.map +1 -1
  263. package/dist/components/Select/utils.js +3 -32
  264. package/dist/components/Shortcuts/ShortcutContext.d.ts +3 -0
  265. package/dist/components/Shortcuts/ShortcutContext.d.ts.map +1 -0
  266. package/dist/components/Shortcuts/ShortcutContext.js +5 -0
  267. package/dist/components/Shortcuts/ShortcutHint.d.ts +9 -0
  268. package/dist/components/Shortcuts/ShortcutHint.d.ts.map +1 -0
  269. package/dist/components/Shortcuts/ShortcutHint.js +33 -0
  270. package/dist/components/Shortcuts/ShortcutScope.d.ts +9 -0
  271. package/dist/components/Shortcuts/ShortcutScope.d.ts.map +1 -0
  272. package/dist/components/Shortcuts/ShortcutScope.js +10 -0
  273. package/dist/components/Shortcuts/ShortcutsConfigContext.d.ts +7 -0
  274. package/dist/components/Shortcuts/ShortcutsConfigContext.d.ts.map +1 -0
  275. package/dist/components/Shortcuts/ShortcutsConfigContext.js +8 -0
  276. package/dist/components/Shortcuts/ShortcutsProvider.d.ts +9 -0
  277. package/dist/components/Shortcuts/ShortcutsProvider.d.ts.map +1 -0
  278. package/dist/components/Shortcuts/ShortcutsProvider.js +18 -0
  279. package/dist/components/Shortcuts/index.d.ts +13 -0
  280. package/dist/components/Shortcuts/index.d.ts.map +1 -0
  281. package/dist/components/Shortcuts/useShortcut.d.ts +6 -0
  282. package/dist/components/Shortcuts/useShortcut.d.ts.map +1 -0
  283. package/dist/components/Shortcuts/useShortcut.js +92 -0
  284. package/dist/components/Shortcuts/useShortcutScope.d.ts +5 -0
  285. package/dist/components/Shortcuts/useShortcutScope.d.ts.map +1 -0
  286. package/dist/components/Shortcuts/useShortcutScope.js +25 -0
  287. package/dist/components/Sidebar/ChildMenu.js +1 -1
  288. package/dist/components/Sidebar/ParentMenu.js +1 -1
  289. package/dist/components/Sidebar/SidebarActions.d.ts.map +1 -1
  290. package/dist/components/Sidebar/SidebarActions.js +2 -1
  291. package/dist/components/Sidebar/index.d.ts +1 -1
  292. package/dist/components/Sidebar/index.d.ts.map +1 -1
  293. package/dist/components/Sidebar/index.js +64 -5
  294. package/dist/components/Slider/index.d.ts +1 -1
  295. package/dist/components/Slider/index.d.ts.map +1 -1
  296. package/dist/components/Slider/index.js +4 -2
  297. package/dist/components/Stepper/index.js +2 -1
  298. package/dist/components/Switch/index.d.ts.map +1 -1
  299. package/dist/components/Switch/index.js +8 -3
  300. package/dist/components/Table/AdvanceSortModal.d.ts +8 -0
  301. package/dist/components/Table/AdvanceSortModal.d.ts.map +1 -0
  302. package/dist/components/Table/AdvanceSortModal.js +285 -0
  303. package/dist/components/Table/AgGridHeader.d.ts.map +1 -1
  304. package/dist/components/Table/AgGridHeader.js +98 -65
  305. package/dist/components/Table/CommentsPortal.d.ts +1 -3
  306. package/dist/components/Table/CommentsPortal.d.ts.map +1 -1
  307. package/dist/components/Table/CommentsPortal.js +7 -7
  308. package/dist/components/Table/NewAdvanceSearchModal/NewAdvanceSearchModal.d.ts +14 -11
  309. package/dist/components/Table/NewAdvanceSearchModal/NewAdvanceSearchModal.d.ts.map +1 -1
  310. package/dist/components/Table/NewAdvanceSearchModal/NewAdvanceSearchModal.js +2 -7
  311. package/dist/components/Table/NewAdvanceSearchModal/NewAdvanceSearchModalItem.d.ts +11 -10
  312. package/dist/components/Table/NewAdvanceSearchModal/NewAdvanceSearchModalItem.d.ts.map +1 -1
  313. package/dist/components/Table/NewAdvanceSearchModal/NewAdvanceSearchModalItem.js +4 -3
  314. package/dist/components/Table/NoComments.d.ts.map +1 -1
  315. package/dist/components/Table/NoComments.js +3 -1
  316. package/dist/components/Table/Table.types.d.ts +13 -0
  317. package/dist/components/Table/Table.types.d.ts.map +1 -1
  318. package/dist/components/Table/TableImpl.d.ts +1 -2
  319. package/dist/components/Table/TableImpl.d.ts.map +1 -1
  320. package/dist/components/Table/TableImpl.js +334 -141
  321. package/dist/components/Table/actionBar.d.ts +12 -0
  322. package/dist/components/Table/actionBar.d.ts.map +1 -0
  323. package/dist/components/Table/actionBar.js +44 -0
  324. package/dist/components/Table/advanceSearchModal.d.ts.map +1 -1
  325. package/dist/components/Table/commentPanel.d.ts +2 -1
  326. package/dist/components/Table/commentPanel.d.ts.map +1 -1
  327. package/dist/components/Table/commentPanel.js +13 -8
  328. package/dist/components/Table/filterUtils.d.ts +2 -0
  329. package/dist/components/Table/filterUtils.d.ts.map +1 -1
  330. package/dist/components/Table/filterUtils.js +23 -1
  331. package/dist/components/Table/tableFunctions.d.ts +1 -3
  332. package/dist/components/Table/tableFunctions.d.ts.map +1 -1
  333. package/dist/components/Table/tableFunctions.js +13 -12
  334. package/dist/components/Table/tableHeader.d.ts +6 -1
  335. package/dist/components/Table/tableHeader.d.ts.map +1 -1
  336. package/dist/components/Table/tableHeader.js +13 -3
  337. package/dist/components/Table/tableMoreOptions.d.ts +3 -1
  338. package/dist/components/Table/tableMoreOptions.d.ts.map +1 -1
  339. package/dist/components/Table/tableMoreOptions.js +29 -2
  340. package/dist/components/Table/tableSettings.d.ts.map +1 -1
  341. package/dist/components/Table/tableSettings.js +1 -1
  342. package/dist/components/Table/withCommentIcon.d.ts.map +1 -1
  343. package/dist/components/Table/withCommentIcon.js +2 -1
  344. package/dist/components/TableChat/EmptyContainer.js +2 -1
  345. package/dist/components/TableChat/TableChatSidePanel.d.ts.map +1 -1
  346. package/dist/components/TableChat/TableChatSidePanel.js +6 -3
  347. package/dist/components/TableChat/components/ChatMessageSkeleton/ChatFooterSkeleton.js +2 -1
  348. package/dist/components/TableChat/components/ChatMessageSkeleton/ChatHeaderSkeleton.js +2 -1
  349. package/dist/components/TableChat/components/ChatMessageSkeleton/ChatMessageListSkeleton.js +2 -1
  350. package/dist/components/TableChat/components/ChatMessageSkeleton/ChatSkeleton.js +2 -1
  351. package/dist/components/TableChat/components/TableChatLeftSection/AddChatContainer/AddChatContainer.d.ts.map +1 -1
  352. package/dist/components/TableChat/components/TableChatLeftSection/AddChatContainer/AddChatContainer.js +15 -16
  353. package/dist/components/TableChat/components/TableChatLeftSection/ChatChannelItem.d.ts.map +1 -1
  354. package/dist/components/TableChat/components/TableChatLeftSection/ChatChannelItem.js +3 -2
  355. package/dist/components/TableChat/components/TableChatLeftSection/ChatHeaderNavigation.d.ts.map +1 -1
  356. package/dist/components/TableChat/components/TableChatLeftSection/ChatHeaderNavigation.js +4 -1
  357. package/dist/components/TableChat/components/TableChatLeftSection/TableChatChannelHeader.js +2 -1
  358. package/dist/components/TableChat/components/TableChatRightSection/AvatarGroup/AvatarGroup.js +2 -1
  359. package/dist/components/TableChat/components/TableChatRightSection/ChatDefaultMessageType/ChatDefaultMessageType.d.ts.map +1 -1
  360. package/dist/components/TableChat/components/TableChatRightSection/ChatDefaultMessageType/ChatDefaultMessageType.js +14 -12
  361. package/dist/components/TableChat/components/TableChatRightSection/ChatDeleteMessageType/ChatDeletedMessageType.js +2 -1
  362. package/dist/components/TableChat/components/TableChatRightSection/ChatEditedMessageType /ChatEditedMessageType.d.ts.map +1 -1
  363. package/dist/components/TableChat/components/TableChatRightSection/ChatEditedMessageType /ChatEditedMessageType.js +5 -4
  364. package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeader.d.ts.map +1 -1
  365. package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeader.js +4 -2
  366. package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderAction.d.ts.map +1 -1
  367. package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderAction.js +7 -6
  368. package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderInfo.d.ts.map +1 -1
  369. package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderInfo.js +2 -0
  370. package/dist/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.d.ts.map +1 -1
  371. package/dist/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.js +18 -14
  372. package/dist/components/TableChat/components/TableChatRightSection/ChatMessageAvatar/ChatMessageAvatar.js +2 -1
  373. package/dist/components/TableChat/components/TableChatRightSection/ChatMessages/ChatMessage.d.ts.map +1 -1
  374. package/dist/components/TableChat/components/TableChatRightSection/ChatMessages/ChatMessage.js +7 -3
  375. package/dist/components/TableChat/components/TableChatRightSection/ChatNotificationSettings/ChatNotificationSettings.js +2 -1
  376. package/dist/components/TableChat/components/TableChatRightSection/DateSeparator/DateSeparator.js +2 -1
  377. package/dist/components/TableChat/components/TableChatRightSection/EmojiPicker/EmojiPicker.js +2 -2
  378. package/dist/components/TableChat/components/TableChatRightSection/PinedChatPanel/PinedChatPanel.d.ts.map +1 -1
  379. package/dist/components/TableChat/components/TableChatRightSection/PinedChatPanel/PinedChatPanel.js +10 -21
  380. package/dist/components/TableChat/components/TableChatRightSection/ReplyBadge/ReplyBadge.d.ts.map +1 -1
  381. package/dist/components/TableChat/components/TableChatRightSection/TableChatRightSection.d.ts.map +1 -1
  382. package/dist/components/TableChat/components/TableChatRightSection/TableChatRightSection.js +4 -6
  383. package/dist/components/TableChat/components/TextEditor/EditorToolbar.js +2 -1
  384. package/dist/components/TableChat/components/TextEditor/Mention.d.ts.map +1 -1
  385. package/dist/components/TableChat/components/TextEditor/Mention.js +12 -10
  386. package/dist/components/TableChat/components/TextEditor/MentionList.js +2 -1
  387. package/dist/components/TableChat/components/TextEditor/suggestion.js +2 -2
  388. package/dist/components/TableOld/AgGridHeader.d.ts +12 -0
  389. package/dist/components/TableOld/AgGridHeader.d.ts.map +1 -0
  390. package/dist/components/TableOld/actionBar.d.ts +7 -0
  391. package/dist/components/TableOld/actionBar.d.ts.map +1 -0
  392. package/dist/components/TableOld/index.d.ts +3 -0
  393. package/dist/components/TableOld/index.d.ts.map +1 -0
  394. package/dist/components/TableOld/mockData.d.ts +39 -0
  395. package/dist/components/TableOld/mockData.d.ts.map +1 -0
  396. package/dist/components/TableOld/tableFunctions.d.ts +56 -0
  397. package/dist/components/TableOld/tableFunctions.d.ts.map +1 -0
  398. package/dist/components/TableOld/tableHeader.d.ts +48 -0
  399. package/dist/components/TableOld/tableHeader.d.ts.map +1 -0
  400. package/dist/components/TableOld/tableIcons.d.ts +3 -0
  401. package/dist/components/TableOld/tableIcons.d.ts.map +1 -0
  402. package/dist/components/TableOld/tablePagination.d.ts +8 -0
  403. package/dist/components/TableOld/tablePagination.d.ts.map +1 -0
  404. package/dist/components/TableOld/tableSettings.d.ts +11 -0
  405. package/dist/components/TableOld/tableSettings.d.ts.map +1 -0
  406. package/dist/components/Tabs/index.js +2 -1
  407. package/dist/components/Tag/Tag.types.d.ts +4 -0
  408. package/dist/components/Tag/Tag.types.d.ts.map +1 -1
  409. package/dist/components/Tag/filled.d.ts +1 -1
  410. package/dist/components/Tag/filled.d.ts.map +1 -1
  411. package/dist/components/Tag/filled.js +18 -2
  412. package/dist/components/Tag/index.d.ts.map +1 -1
  413. package/dist/components/Tag/index.js +30 -28
  414. package/dist/components/Tag/solid.d.ts +1 -1
  415. package/dist/components/Tag/solid.d.ts.map +1 -1
  416. package/dist/components/Tag/solid.js +9 -1
  417. package/dist/components/Tag/stroke.d.ts +1 -1
  418. package/dist/components/Tag/stroke.d.ts.map +1 -1
  419. package/dist/components/Tag/stroke.js +9 -1
  420. package/dist/components/TagGroup/TagGroup.types.d.ts +2 -2
  421. package/dist/components/TagGroup/index.d.ts +1 -1
  422. package/dist/components/TagGroup/index.d.ts.map +1 -1
  423. package/dist/components/TagGroup/index.js +12 -2
  424. package/dist/components/TextArea/index.d.ts +1 -1
  425. package/dist/components/TextArea/index.d.ts.map +1 -1
  426. package/dist/components/TextArea/index.js +28 -39
  427. package/dist/components/Toast/index.js +2 -1
  428. package/dist/components/Tooltip/index.d.ts.map +1 -1
  429. package/dist/components/Tooltip/index.js +5 -4
  430. package/dist/components/YearSelect/index.js +83 -0
  431. package/dist/components/common/HelperText/HelperText.types.d.ts +2 -2
  432. package/dist/components/common/HelperText/index.d.ts +1 -1
  433. package/dist/components/common/HelperText/index.d.ts.map +1 -1
  434. package/dist/components/common/HelperText/index.js +12 -2
  435. package/dist/components/index.d.ts +11 -3
  436. package/dist/components/index.d.ts.map +1 -1
  437. package/dist/components/index.js +37 -4
  438. package/dist/mcp-component-registry.json +3870 -0
  439. package/dist/node_modules/@emotion/react/dist/emotion-element-f0de968e.browser.esm.js +1 -0
  440. package/dist/node_modules/@emotion/react/dist/emotion-react.browser.esm.js +2 -1
  441. package/dist/node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.esm.js +1 -1
  442. package/dist/node_modules/@emotion/styled/dist/emotion-styled.browser.esm.js +1 -0
  443. package/dist/node_modules/@mui/icons-material/Add.js +2 -2
  444. package/dist/node_modules/@mui/icons-material/AttachFile.js +2 -2
  445. package/dist/node_modules/@mui/icons-material/AutoFixHigh.js +2 -2
  446. package/dist/node_modules/@mui/icons-material/Block.js +2 -2
  447. package/dist/node_modules/@mui/icons-material/BookmarkBorderOutlined.js +17 -0
  448. package/dist/node_modules/@mui/icons-material/Brush.js +2 -2
  449. package/dist/node_modules/@mui/icons-material/Cancel.js +2 -2
  450. package/dist/node_modules/@mui/icons-material/CheckCircle.js +2 -2
  451. package/dist/node_modules/@mui/icons-material/ChevronLeft.js +2 -2
  452. package/dist/node_modules/@mui/icons-material/ChevronLeftOutlined.js +17 -0
  453. package/dist/node_modules/@mui/icons-material/ChevronRight.js +2 -2
  454. package/dist/node_modules/@mui/icons-material/ChevronRightOutlined.js +2 -2
  455. package/dist/node_modules/@mui/icons-material/Clear.js +2 -2
  456. package/dist/node_modules/@mui/icons-material/Close.js +2 -2
  457. package/dist/node_modules/@mui/icons-material/CloseOutlined.js +2 -2
  458. package/dist/node_modules/@mui/icons-material/CloseRounded.js +17 -0
  459. package/dist/node_modules/@mui/icons-material/DeleteOutlineOutlined.js +2 -2
  460. package/dist/node_modules/@mui/icons-material/DeleteOutlined.js +2 -2
  461. package/dist/node_modules/@mui/icons-material/DragIndicator.js +2 -2
  462. package/dist/node_modules/@mui/icons-material/ErrorOutline.js +2 -2
  463. package/dist/node_modules/@mui/icons-material/ExpandLess.js +2 -2
  464. package/dist/node_modules/@mui/icons-material/ExpandMore.js +2 -2
  465. package/dist/node_modules/@mui/icons-material/FileDownloadOutlined.js +2 -2
  466. package/dist/node_modules/@mui/icons-material/FilterAltOutlined.js +17 -0
  467. package/dist/node_modules/@mui/icons-material/FilterList.js +2 -2
  468. package/dist/node_modules/@mui/icons-material/FilterListOutlined.js +17 -0
  469. package/dist/node_modules/@mui/icons-material/FormatBold.js +2 -2
  470. package/dist/node_modules/@mui/icons-material/FormatColorTextOutlined.js +2 -2
  471. package/dist/node_modules/@mui/icons-material/FormatItalic.js +2 -2
  472. package/dist/node_modules/@mui/icons-material/FormatListBulleted.js +2 -2
  473. package/dist/node_modules/@mui/icons-material/FormatListNumbered.js +2 -2
  474. package/dist/node_modules/@mui/icons-material/Image.js +2 -2
  475. package/dist/node_modules/@mui/icons-material/Info.js +2 -2
  476. package/dist/node_modules/@mui/icons-material/InsertEmoticon.js +2 -2
  477. package/dist/node_modules/@mui/icons-material/KeyboardArrowDown.js +2 -2
  478. package/dist/node_modules/@mui/icons-material/KeyboardArrowDownOutlined.js +2 -2
  479. package/dist/node_modules/@mui/icons-material/KeyboardArrowLeft.js +2 -2
  480. package/dist/node_modules/@mui/icons-material/KeyboardArrowRight.js +2 -2
  481. package/dist/node_modules/@mui/icons-material/KeyboardArrowRightOutlined.js +2 -2
  482. package/dist/node_modules/@mui/icons-material/KeyboardArrowUp.js +2 -2
  483. package/dist/node_modules/@mui/icons-material/KeyboardRounded.js +17 -0
  484. package/dist/node_modules/@mui/icons-material/Link.js +2 -2
  485. package/dist/node_modules/@mui/icons-material/Looks3.js +2 -2
  486. package/dist/node_modules/@mui/icons-material/Looks4.js +2 -2
  487. package/dist/node_modules/@mui/icons-material/Looks5.js +2 -2
  488. package/dist/node_modules/@mui/icons-material/Looks6.js +2 -2
  489. package/dist/node_modules/@mui/icons-material/LooksOne.js +2 -2
  490. package/dist/node_modules/@mui/icons-material/LooksTwo.js +2 -2
  491. package/dist/node_modules/@mui/icons-material/MoreHoriz.js +2 -2
  492. package/dist/node_modules/@mui/icons-material/MoreVert.js +2 -2
  493. package/dist/node_modules/@mui/icons-material/North.js +2 -2
  494. package/dist/node_modules/@mui/icons-material/NotificationsOff.js +2 -2
  495. package/dist/node_modules/@mui/icons-material/SaveOutlined.js +2 -2
  496. package/dist/node_modules/@mui/icons-material/Search.js +2 -2
  497. package/dist/node_modules/@mui/icons-material/SearchOutlined.js +2 -2
  498. package/dist/node_modules/@mui/icons-material/SettingsOutlined.js +2 -2
  499. package/dist/node_modules/@mui/icons-material/StrikethroughS.js +2 -2
  500. package/dist/node_modules/@mui/icons-material/TableChartOutlined.js +2 -2
  501. package/dist/node_modules/@mui/icons-material/Tune.js +2 -2
  502. package/dist/node_modules/@mui/icons-material/ViewColumnOutlined.js +2 -2
  503. package/dist/node_modules/@mui/icons-material/Warning.js +2 -2
  504. package/dist/node_modules/@mui/icons-material/utils/createSvgIcon.js +1 -1
  505. package/dist/node_modules/@mui/material/Accordion/Accordion.js +2 -2
  506. package/dist/node_modules/@mui/material/AccordionDetails/AccordionDetails.js +2 -2
  507. package/dist/node_modules/@mui/material/AccordionSummary/AccordionSummary.js +2 -2
  508. package/dist/node_modules/@mui/material/Alert/Alert.js +2 -2
  509. package/dist/node_modules/@mui/material/AlertTitle/AlertTitle.js +2 -2
  510. package/dist/node_modules/@mui/material/Avatar/Avatar.js +2 -2
  511. package/dist/node_modules/@mui/material/Backdrop/Backdrop.js +2 -2
  512. package/dist/node_modules/@mui/material/Badge/Badge.js +2 -2
  513. package/dist/node_modules/@mui/material/Breadcrumbs/BreadcrumbCollapsed.js +2 -2
  514. package/dist/node_modules/@mui/material/Breadcrumbs/Breadcrumbs.js +2 -2
  515. package/dist/node_modules/@mui/material/Button/Button.js +2 -2
  516. package/dist/node_modules/@mui/material/ButtonBase/ButtonBase.js +2 -2
  517. package/dist/node_modules/@mui/material/ButtonBase/TouchRipple.js +2 -2
  518. package/dist/node_modules/@mui/material/Card/Card.js +2 -2
  519. package/dist/node_modules/@mui/material/Checkbox/Checkbox.js +2 -2
  520. package/dist/node_modules/@mui/material/Chip/Chip.js +2 -2
  521. package/dist/node_modules/@mui/material/CircularProgress/CircularProgress.js +2 -2
  522. package/dist/node_modules/@mui/material/Collapse/Collapse.js +2 -2
  523. package/dist/node_modules/@mui/material/DefaultPropsProvider/DefaultPropsProvider.js +1 -0
  524. package/dist/node_modules/@mui/material/Dialog/Dialog.js +2 -2
  525. package/dist/node_modules/@mui/material/DialogActions/DialogActions.js +2 -2
  526. package/dist/node_modules/@mui/material/DialogContent/DialogContent.js +2 -2
  527. package/dist/node_modules/@mui/material/DialogContentText/DialogContentText.js +2 -2
  528. package/dist/node_modules/@mui/material/DialogTitle/DialogTitle.js +2 -2
  529. package/dist/node_modules/@mui/material/Drawer/Drawer.js +2 -2
  530. package/dist/node_modules/@mui/material/Fade/Fade.js +2 -2
  531. package/dist/node_modules/@mui/material/FilledInput/FilledInput.js +2 -2
  532. package/dist/node_modules/@mui/material/FilledInput/filledInputClasses.js +1 -1
  533. package/dist/node_modules/@mui/material/FormControl/FormControl.js +2 -2
  534. package/dist/node_modules/@mui/material/FormControlLabel/FormControlLabel.js +2 -2
  535. package/dist/node_modules/@mui/material/FormGroup/FormGroup.js +2 -2
  536. package/dist/node_modules/@mui/material/FormHelperText/FormHelperText.js +2 -2
  537. package/dist/node_modules/@mui/material/GlobalStyles/GlobalStyles.js +1 -1
  538. package/dist/node_modules/@mui/material/Grow/Grow.js +2 -2
  539. package/dist/node_modules/@mui/material/IconButton/IconButton.js +2 -2
  540. package/dist/node_modules/@mui/material/Input/Input.js +2 -2
  541. package/dist/node_modules/@mui/material/Input/inputClasses.js +1 -1
  542. package/dist/node_modules/@mui/material/InputBase/InputBase.js +2 -2
  543. package/dist/node_modules/@mui/material/LinearProgress/LinearProgress.js +2 -2
  544. package/dist/node_modules/@mui/material/Link/Link.js +2 -2
  545. package/dist/node_modules/@mui/material/List/List.js +2 -2
  546. package/dist/node_modules/@mui/material/ListItemIcon/ListItemIcon.js +2 -2
  547. package/dist/node_modules/@mui/material/Menu/Menu.js +2 -2
  548. package/dist/node_modules/@mui/material/MenuItem/MenuItem.js +2 -2
  549. package/dist/node_modules/@mui/material/MenuList/MenuList.js +2 -2
  550. package/dist/node_modules/@mui/material/Modal/Modal.js +2 -2
  551. package/dist/node_modules/@mui/material/Modal/useModal.js +1 -1
  552. package/dist/node_modules/@mui/material/NativeSelect/NativeSelectInput.js +2 -2
  553. package/dist/node_modules/@mui/material/OutlinedInput/NotchedOutline.js +2 -2
  554. package/dist/node_modules/@mui/material/OutlinedInput/OutlinedInput.js +2 -2
  555. package/dist/node_modules/@mui/material/OutlinedInput/outlinedInputClasses.js +1 -1
  556. package/dist/node_modules/@mui/material/Paper/Paper.js +2 -2
  557. package/dist/node_modules/@mui/material/Popover/Popover.js +2 -2
  558. package/dist/node_modules/@mui/material/Popper/BasePopper.js +3 -3
  559. package/dist/node_modules/@mui/material/Popper/Popper.js +2 -2
  560. package/dist/node_modules/@mui/material/Radio/Radio.js +2 -2
  561. package/dist/node_modules/@mui/material/Radio/RadioButtonIcon.js +1 -1
  562. package/dist/node_modules/@mui/material/RadioGroup/RadioGroup.js +2 -2
  563. package/dist/node_modules/@mui/material/Select/Select.js +2 -2
  564. package/dist/node_modules/@mui/material/Select/SelectInput.js +2 -2
  565. package/dist/node_modules/@mui/material/Skeleton/Skeleton.js +2 -2
  566. package/dist/node_modules/@mui/material/Slide/Slide.js +2 -2
  567. package/dist/node_modules/@mui/material/Slider/Slider.js +2 -2
  568. package/dist/node_modules/@mui/material/Slider/useSlider.js +1 -1
  569. package/dist/node_modules/@mui/material/Snackbar/Snackbar.js +2 -2
  570. package/dist/node_modules/@mui/material/Snackbar/useSnackbar.js +1 -1
  571. package/dist/node_modules/@mui/material/SnackbarContent/SnackbarContent.js +2 -2
  572. package/dist/node_modules/@mui/material/Step/Step.js +2 -2
  573. package/dist/node_modules/@mui/material/StepConnector/StepConnector.js +2 -2
  574. package/dist/node_modules/@mui/material/StepIcon/StepIcon.js +2 -2
  575. package/dist/node_modules/@mui/material/StepLabel/StepLabel.js +2 -2
  576. package/dist/node_modules/@mui/material/Stepper/Stepper.js +2 -2
  577. package/dist/node_modules/@mui/material/SvgIcon/SvgIcon.js +2 -2
  578. package/dist/node_modules/@mui/material/Switch/Switch.js +2 -2
  579. package/dist/node_modules/@mui/material/Tab/Tab.js +2 -2
  580. package/dist/node_modules/@mui/material/TabScrollButton/TabScrollButton.js +2 -2
  581. package/dist/node_modules/@mui/material/Tabs/ScrollbarSize.js +2 -2
  582. package/dist/node_modules/@mui/material/Tabs/Tabs.js +2 -2
  583. package/dist/node_modules/@mui/material/TextareaAutosize/TextareaAutosize.js +2 -2
  584. package/dist/node_modules/@mui/material/ToggleButton/ToggleButton.js +2 -2
  585. package/dist/node_modules/@mui/material/ToggleButtonGroup/ToggleButtonGroup.js +2 -2
  586. package/dist/node_modules/@mui/material/Tooltip/Tooltip.js +2 -2
  587. package/dist/node_modules/@mui/material/Typography/Typography.js +2 -2
  588. package/dist/node_modules/@mui/material/internal/SwitchBase.js +2 -2
  589. package/dist/node_modules/@mui/material/node_modules/@mui/utils/esm/appendOwnerState/appendOwnerState.js +1 -1
  590. package/dist/node_modules/@mui/material/node_modules/@mui/utils/esm/deepmerge/deepmerge.js +1 -1
  591. package/dist/node_modules/@mui/material/node_modules/@mui/utils/esm/exactProp/exactProp.js +1 -1
  592. package/dist/node_modules/@mui/material/node_modules/@mui/utils/esm/mergeSlotProps/mergeSlotProps.js +1 -1
  593. package/dist/node_modules/@mui/material/node_modules/@mui/utils/esm/requirePropFactory/requirePropFactory.js +1 -1
  594. package/dist/node_modules/@mui/material/node_modules/@mui/utils/esm/resolveProps/resolveProps.js +1 -1
  595. package/dist/node_modules/@mui/material/node_modules/@mui/utils/esm/useSlotProps/useSlotProps.js +2 -2
  596. package/dist/node_modules/@mui/material/styles/createMixins.js +1 -1
  597. package/dist/node_modules/@mui/material/styles/createPalette.js +2 -2
  598. package/dist/node_modules/@mui/material/styles/createTheme.js +2 -2
  599. package/dist/node_modules/@mui/material/styles/createTransitions.js +2 -2
  600. package/dist/node_modules/@mui/material/styles/createTypography.js +2 -2
  601. package/dist/node_modules/@mui/material/utils/createSvgIcon.js +1 -1
  602. package/dist/node_modules/@mui/material/utils/useSlot.js +2 -2
  603. package/dist/node_modules/@mui/system/colorManipulator.js +4 -4
  604. package/dist/node_modules/@mui/system/createStyled.js +11 -11
  605. package/dist/node_modules/@mui/system/esm/RtlProvider/index.js +2 -0
  606. package/dist/node_modules/@mui/system/esm/Stack/createStack.js +2 -2
  607. package/dist/node_modules/@mui/system/esm/breakpoints.js +1 -0
  608. package/dist/node_modules/@mui/system/esm/createBox.js +2 -2
  609. package/dist/node_modules/@mui/system/esm/createStyled.js +2 -2
  610. package/dist/node_modules/@mui/system/esm/createTheme/createBreakpoints.js +2 -2
  611. package/dist/node_modules/@mui/system/esm/createTheme/createTheme.js +2 -2
  612. package/dist/node_modules/@mui/system/esm/styleFunctionSx/extendSxProp.js +2 -2
  613. package/dist/node_modules/@mui/system/node_modules/@mui/utils/esm/deepmerge/deepmerge.js +1 -1
  614. package/dist/node_modules/@mui/system/node_modules/@mui/utils/esm/resolveProps/resolveProps.js +1 -1
  615. package/dist/node_modules/@mui/system/useThemeWithoutDefault.js +1 -1
  616. package/dist/node_modules/call-bind/index.js +1 -1
  617. package/dist/node_modules/hoist-non-react-statics/node_modules/react-is/index.js +1 -1
  618. package/dist/node_modules/is-symbol/index.js +1 -1
  619. package/dist/node_modules/prop-types/index.js +1 -1
  620. package/dist/node_modules/prop-types/node_modules/react-is/index.js +1 -1
  621. package/dist/node_modules/react-dates/lib/initialize.js +2 -2
  622. package/dist/node_modules/react-dates/lib/utils/registerCSSInterfaceWithDefaultTheme.js +2 -2
  623. package/dist/node_modules/react-dates/lib/utils/registerInterfaceWithDefaultTheme.js +2 -2
  624. package/dist/node_modules/react-is/index.js +1 -1
  625. package/dist/node_modules/react-transition-group/esm/Transition.js +2 -2
  626. package/dist/node_modules/react-transition-group/esm/TransitionGroup.js +4 -4
  627. package/dist/node_modules/react-with-styles-interface-css/dist/index.js +3 -3
  628. package/dist/storybook-utils/rootAttributes.d.ts +33 -0
  629. package/dist/storybook-utils/rootAttributes.d.ts.map +1 -0
  630. package/dist/storybook-utils.d.ts +2 -1
  631. package/dist/storybook-utils.d.ts.map +1 -1
  632. package/dist/styles/entry.d.ts +2 -0
  633. package/dist/styles/entry.d.ts.map +1 -0
  634. package/dist/styles/entry.js +1 -0
  635. package/dist/styles/style.css +1 -1
  636. package/dist/test-utils/itForwardsRootId.d.ts +15 -0
  637. package/dist/test-utils/itForwardsRootId.d.ts.map +1 -0
  638. package/dist/test-utils/rootAttributes.d.ts +22 -0
  639. package/dist/test-utils/rootAttributes.d.ts.map +1 -0
  640. package/dist/types/index.d.ts +4 -0
  641. package/dist/types/index.d.ts.map +1 -1
  642. package/dist/utils/assetBase.d.ts +7 -0
  643. package/dist/utils/assetBase.d.ts.map +1 -0
  644. package/dist/utils/assetBase.js +14 -0
  645. package/dist/utils/debounce.d.ts +7 -2
  646. package/dist/utils/debounce.d.ts.map +1 -1
  647. package/dist/utils/debounce.js +8 -1
  648. package/dist/utils/pickRootDomAttributes.d.ts +18 -0
  649. package/dist/utils/pickRootDomAttributes.d.ts.map +1 -0
  650. package/dist/utils/shortcuts/ShortcutManager.d.ts +34 -0
  651. package/dist/utils/shortcuts/ShortcutManager.d.ts.map +1 -0
  652. package/dist/utils/shortcuts/ShortcutManager.js +159 -0
  653. package/dist/utils/shortcuts/constants.d.ts +10 -0
  654. package/dist/utils/shortcuts/constants.d.ts.map +1 -0
  655. package/dist/utils/shortcuts/constants.js +46 -0
  656. package/dist/utils/shortcuts/format.d.ts +3 -0
  657. package/dist/utils/shortcuts/format.d.ts.map +1 -0
  658. package/dist/utils/shortcuts/format.js +27 -0
  659. package/dist/utils/shortcuts/index.d.ts +8 -0
  660. package/dist/utils/shortcuts/index.d.ts.map +1 -0
  661. package/dist/utils/shortcuts/match.d.ts +9 -0
  662. package/dist/utils/shortcuts/match.d.ts.map +1 -0
  663. package/dist/utils/shortcuts/match.js +52 -0
  664. package/dist/utils/shortcuts/parse.d.ts +10 -0
  665. package/dist/utils/shortcuts/parse.d.ts.map +1 -0
  666. package/dist/utils/shortcuts/parse.js +50 -0
  667. package/dist/utils/shortcuts/platform.d.ts +2 -0
  668. package/dist/utils/shortcuts/platform.d.ts.map +1 -0
  669. package/dist/utils/shortcuts/platform.js +5 -0
  670. package/dist/utils/shortcuts/shortcuts.test.d.ts +2 -0
  671. package/dist/utils/shortcuts/shortcuts.test.d.ts.map +1 -0
  672. package/dist/utils/shortcuts/types.d.ts +50 -0
  673. package/dist/utils/shortcuts/types.d.ts.map +1 -0
  674. package/eslint-plugin/rules/no-barrel-import.js +21 -9
  675. package/package.json +21 -8
  676. package/dist/_virtual/extends.js +0 -6
  677. package/dist/_virtual/heatmap.js +0 -4
  678. package/dist/_virtual/highcharts-3d.js +0 -4
  679. package/dist/_virtual/highcharts-more.js +0 -4
  680. package/dist/_virtual/highcharts-react.min.js +0 -4
  681. package/dist/_virtual/highcharts.js +0 -4
  682. package/dist/_virtual/index17.js +0 -4
  683. package/dist/_virtual/interopRequireDefault.js +0 -4
  684. package/dist/_virtual/objectWithoutPropertiesLoose.js +0 -4
  685. package/dist/_virtual/stock.js +0 -4
  686. package/dist/_virtual/treemap.js +0 -4
  687. package/dist/_virtual/venn.js +0 -4
  688. package/dist/assets/Chart-dropdown.svg.js +0 -4
  689. package/dist/assets/CheckTickAll.svg.js +0 -4
  690. package/dist/assets/Collapse.svg.js +0 -4
  691. package/dist/assets/Comment.svg.js +0 -4
  692. package/dist/assets/Down.svg.js +0 -4
  693. package/dist/assets/IA_Logo.svg.js +0 -4
  694. package/dist/assets/MoreHorizontal.svg.js +0 -4
  695. package/dist/assets/Up.svg.js +0 -4
  696. package/dist/assets/active-notificationIcon.svg.js +0 -4
  697. package/dist/assets/activeModuleIcon.svg.js +0 -4
  698. package/dist/assets/bell.svg.js +0 -4
  699. package/dist/assets/bookmarkIcon.svg.js +0 -4
  700. package/dist/assets/calendar.svg.js +0 -4
  701. package/dist/assets/chat-home-icon.svg.js +0 -4
  702. package/dist/assets/chatBotMicIcon.svg.js +0 -4
  703. package/dist/assets/chatBotRefreshIcon.svg.js +0 -4
  704. package/dist/assets/chatBotSendIcon.svg.js +0 -4
  705. package/dist/assets/chatIcon.svg.js +0 -4
  706. package/dist/assets/chatbotBannerIcon.svg.js +0 -4
  707. package/dist/assets/chatbotStopIcon.svg.js +0 -4
  708. package/dist/assets/checkBlueIcon.svg.js +0 -4
  709. package/dist/assets/checkGreeIcon.svg.js +0 -4
  710. package/dist/assets/checkIcon.svg.js +0 -4
  711. package/dist/assets/clientLogos/Balsam.svg.js +0 -4
  712. package/dist/assets/clientLogos/Starboard.svg.js +0 -4
  713. package/dist/assets/clientLogos/figs.svg.js +0 -4
  714. package/dist/assets/close.svg.js +0 -4
  715. package/dist/assets/collapse-icon.svg.js +0 -4
  716. package/dist/assets/comment-indicator.svg.js +0 -4
  717. package/dist/assets/commentEmptyStateIcon.svg.js +0 -4
  718. package/dist/assets/createFlowImage.svg.js +0 -4
  719. package/dist/assets/csv-icon.svg.js +0 -4
  720. package/dist/assets/defaultViewIcon.svg.js +0 -4
  721. package/dist/assets/defaultViewIconActive.svg.js +0 -4
  722. package/dist/assets/delete-black.svg.js +0 -4
  723. package/dist/assets/deleteIcon.svg.js +0 -4
  724. package/dist/assets/deleteRedIcon.svg.js +0 -4
  725. package/dist/assets/downArrow.svg.js +0 -4
  726. package/dist/assets/edit-black.svg.js +0 -4
  727. package/dist/assets/editYellowIcon.svg.js +0 -4
  728. package/dist/assets/excel-icon.svg.js +0 -4
  729. package/dist/assets/expand-icon.svg.js +0 -4
  730. package/dist/assets/failed-csv-icon.svg.js +0 -4
  731. package/dist/assets/failed-excel-icon.svg.js +0 -4
  732. package/dist/assets/file-upload-error.svg.js +0 -4
  733. package/dist/assets/file-upload.svg.js +0 -4
  734. package/dist/assets/fileUploadDownloadIcon.svg.js +0 -4
  735. package/dist/assets/fileUploadRetryIcon.svg.js +0 -4
  736. package/dist/assets/hamburger-close.svg.js +0 -4
  737. package/dist/assets/help-icon.svg.js +0 -4
  738. package/dist/assets/historyIcon.svg.js +0 -4
  739. package/dist/assets/landingPageAssets/agenticIcons/starIcon1.svg.js +0 -4
  740. package/dist/assets/landingPageAssets/agenticIcons/starIcon2.svg.js +0 -4
  741. package/dist/assets/landingPageAssets/agenticIcons/starIcon3.svg.js +0 -4
  742. package/dist/assets/landingPageAssets/agenticIcons/starIcon4.svg.js +0 -4
  743. package/dist/assets/landingPageAssets/agenticIcons/starIcon5.svg.js +0 -4
  744. package/dist/assets/landingPageAssets/book-demo.svg.js +0 -4
  745. package/dist/assets/landingPageAssets/configuration_icon.svg.js +0 -4
  746. package/dist/assets/landingPageAssets/launch.svg.js +0 -4
  747. package/dist/assets/listIcon.svg.js +0 -4
  748. package/dist/assets/logout-icon.svg.js +0 -4
  749. package/dist/assets/material-symbols_sort.svg.js +0 -4
  750. package/dist/assets/message-icon-disabled.svg.js +0 -4
  751. package/dist/assets/message-icon.svg.js +0 -4
  752. package/dist/assets/newChatIcon.svg.js +0 -4
  753. package/dist/assets/no-filter-results.svg.js +0 -4
  754. package/dist/assets/notAllowedGreenIcon.svg.js +0 -4
  755. package/dist/assets/notification-dnd.svg.js +0 -4
  756. package/dist/assets/pageIcon.svg.js +0 -4
  757. package/dist/assets/pencilIcon.svg.js +0 -4
  758. package/dist/assets/pinedIcon.svg.js +0 -4
  759. package/dist/assets/pinnedIcon.svg.js +0 -4
  760. package/dist/assets/saveViewDeleteIcon.svg.js +0 -4
  761. package/dist/assets/saveViewEditIcon.svg.js +0 -4
  762. package/dist/assets/saveViewIcon.svg.js +0 -4
  763. package/dist/assets/search.svg.js +0 -4
  764. package/dist/assets/searchIcon.svg.js +0 -4
  765. package/dist/assets/searchIconTable.svg.js +0 -4
  766. package/dist/assets/sendIcon.svg.js +0 -4
  767. package/dist/assets/smartBotAlan.svg.js +0 -4
  768. package/dist/assets/success-fill.svg.js +0 -4
  769. package/dist/assets/success-gray.svg.js +0 -4
  770. package/dist/assets/sun.png.js +0 -4
  771. package/dist/assets/tableSettingIcon.svg.js +0 -4
  772. package/dist/assets/tableSortIcon.svg.js +0 -4
  773. package/dist/assets/text-icon.svg.js +0 -4
  774. package/dist/assets/thumbsUpYellowIcon.svg.js +0 -4
  775. package/dist/assets/thumbsupBlueIcon.svg.js +0 -4
  776. package/dist/assets/treadChatIcon.svg.js +0 -4
  777. package/dist/assets/treedotIcon.svg.js +0 -4
  778. package/dist/assets/unpinedIcon.svg.js +0 -4
  779. package/dist/assets/upload-close-icon.svg.js +0 -4
  780. package/dist/assets/upload-pause-icon.svg.js +0 -4
  781. package/dist/assets/uploadDownloadIcon.svg.js +0 -4
  782. package/dist/assets/userPlusIcon1.svg.js +0 -4
  783. package/dist/assets/warningRedIcon.svg.js +0 -4
  784. package/dist/assets/webp/clientLogos/PACSUN.webp.js +0 -4
  785. package/dist/assets/webp/clientLogos/aaa.webp.js +0 -4
  786. package/dist/assets/webp/clientLogos/al-futtaim.webp.js +0 -4
  787. package/dist/assets/webp/clientLogos/arhaus.webp.js +0 -4
  788. package/dist/assets/webp/clientLogos/asley-stewart.webp.js +0 -4
  789. package/dist/assets/webp/clientLogos/briscoe.webp.js +0 -4
  790. package/dist/assets/webp/clientLogos/carters.webp.js +0 -4
  791. package/dist/assets/webp/clientLogos/cb.webp.js +0 -4
  792. package/dist/assets/webp/clientLogos/coach.webp.js +0 -4
  793. package/dist/assets/webp/clientLogos/dollargeneral.webp.js +0 -4
  794. package/dist/assets/webp/clientLogos/fossil.webp.js +0 -4
  795. package/dist/assets/webp/clientLogos/jared.webp.js +0 -4
  796. package/dist/assets/webp/clientLogos/katespade.webp.js +0 -4
  797. package/dist/assets/webp/clientLogos/kay.webp.js +0 -4
  798. package/dist/assets/webp/clientLogos/kik.webp.js +0 -4
  799. package/dist/assets/webp/clientLogos/leslies.webp.js +0 -4
  800. package/dist/assets/webp/clientLogos/lovisa_1.webp.js +0 -4
  801. package/dist/assets/webp/clientLogos/lsco_logo_red.webp.js +0 -4
  802. package/dist/assets/webp/clientLogos/m-s.webp.js +0 -4
  803. package/dist/assets/webp/clientLogos/oshkosh.webp.js +0 -4
  804. package/dist/assets/webp/clientLogos/pantagonia.webp.js +0 -4
  805. package/dist/assets/webp/clientLogos/pink.webp.js +0 -4
  806. package/dist/assets/webp/clientLogos/pitta-roso.webp.js +0 -4
  807. package/dist/assets/webp/clientLogos/psp.webp.js +0 -4
  808. package/dist/assets/webp/clientLogos/ralphlauren.webp.js +0 -4
  809. package/dist/assets/webp/clientLogos/rebel.webp.js +0 -4
  810. package/dist/assets/webp/clientLogos/scarpe.webp.js +0 -4
  811. package/dist/assets/webp/clientLogos/signet.webp.js +0 -4
  812. package/dist/assets/webp/clientLogos/so5.webp.js +0 -4
  813. package/dist/assets/webp/clientLogos/spanx.webp.js +0 -4
  814. package/dist/assets/webp/clientLogos/stevemadden.webp.js +0 -4
  815. package/dist/assets/webp/clientLogos/stuart.webp.js +0 -4
  816. package/dist/assets/webp/clientLogos/tillys.webp.js +0 -4
  817. package/dist/assets/webp/clientLogos/tommy-bahama.webp.js +0 -4
  818. package/dist/assets/webp/clientLogos/vs.webp.js +0 -4
  819. package/dist/assets/webp/clientLogos/zales.webp.js +0 -4
  820. package/dist/assets/webp/emptyState1.webp.js +0 -4
  821. package/dist/assets/webp/emptyState2.webp.js +0 -4
  822. package/dist/assets/webp/emptyState3.webp.js +0 -4
  823. package/dist/assets/webp/emptyState4.webp.js +0 -4
  824. package/dist/assets/webp/emptyState5.webp.js +0 -4
  825. package/dist/assets/webp/emptyState6.webp.js +0 -4
  826. package/dist/assets/webp/landingPageAssets/agenticIcons/1.webp.js +0 -4
  827. package/dist/assets/webp/landingPageAssets/agenticIcons/10.webp.js +0 -4
  828. package/dist/assets/webp/landingPageAssets/agenticIcons/11.webp.js +0 -4
  829. package/dist/assets/webp/landingPageAssets/agenticIcons/12.webp.js +0 -4
  830. package/dist/assets/webp/landingPageAssets/agenticIcons/13.webp.js +0 -4
  831. package/dist/assets/webp/landingPageAssets/agenticIcons/14.webp.js +0 -4
  832. package/dist/assets/webp/landingPageAssets/agenticIcons/15.webp.js +0 -4
  833. package/dist/assets/webp/landingPageAssets/agenticIcons/17.webp.js +0 -4
  834. package/dist/assets/webp/landingPageAssets/agenticIcons/19.webp.js +0 -4
  835. package/dist/assets/webp/landingPageAssets/agenticIcons/2.webp.js +0 -4
  836. package/dist/assets/webp/landingPageAssets/agenticIcons/20.webp.js +0 -4
  837. package/dist/assets/webp/landingPageAssets/agenticIcons/21.webp.js +0 -4
  838. package/dist/assets/webp/landingPageAssets/agenticIcons/22.webp.js +0 -4
  839. package/dist/assets/webp/landingPageAssets/agenticIcons/23.webp.js +0 -4
  840. package/dist/assets/webp/landingPageAssets/agenticIcons/24.webp.js +0 -4
  841. package/dist/assets/webp/landingPageAssets/agenticIcons/3.webp.js +0 -4
  842. package/dist/assets/webp/landingPageAssets/agenticIcons/4.webp.js +0 -4
  843. package/dist/assets/webp/landingPageAssets/agenticIcons/5.webp.js +0 -4
  844. package/dist/assets/webp/landingPageAssets/agenticIcons/6.webp.js +0 -4
  845. package/dist/assets/webp/landingPageAssets/agenticIcons/7.webp.js +0 -4
  846. package/dist/assets/webp/landingPageAssets/agenticIcons/8.webp.js +0 -4
  847. package/dist/assets/webp/landingPageAssets/carouselImages/image-2.webp.js +0 -4
  848. package/dist/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +0 -8
  849. package/dist/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js +0 -6
  850. package/dist/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js +0 -7
  851. package/dist/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +0 -7
  852. package/dist/node_modules/@babel/runtime/helpers/esm/classCallCheck.js +0 -6
  853. package/dist/node_modules/@babel/runtime/helpers/esm/createClass.js +0 -15
  854. package/dist/node_modules/@babel/runtime/helpers/esm/createSuper.js +0 -17
  855. package/dist/node_modules/@babel/runtime/helpers/esm/defineProperty.js +0 -12
  856. package/dist/node_modules/@babel/runtime/helpers/esm/extends.js +0 -12
  857. package/dist/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js +0 -8
  858. package/dist/node_modules/@babel/runtime/helpers/esm/inherits.js +0 -16
  859. package/dist/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +0 -7
  860. package/dist/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js +0 -13
  861. package/dist/node_modules/@babel/runtime/helpers/esm/iterableToArray.js +0 -6
  862. package/dist/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js +0 -24
  863. package/dist/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js +0 -6
  864. package/dist/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js +0 -6
  865. package/dist/node_modules/@babel/runtime/helpers/esm/objectSpread2.js +0 -25
  866. package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js +0 -13
  867. package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +0 -12
  868. package/dist/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js +0 -10
  869. package/dist/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +0 -8
  870. package/dist/node_modules/@babel/runtime/helpers/esm/slicedToArray.js +0 -10
  871. package/dist/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js +0 -10
  872. package/dist/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js +0 -10
  873. package/dist/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +0 -14
  874. package/dist/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +0 -9
  875. package/dist/node_modules/@babel/runtime/helpers/esm/typeof.js +0 -11
  876. package/dist/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +0 -11
  877. package/dist/node_modules/@babel/runtime/helpers/interopRequireDefault.js +0 -13
  878. package/dist/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js +0 -22
  879. package/dist/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +0 -59
  880. package/dist/node_modules/@dnd-kit/core/dist/core.esm.js +0 -3405
  881. package/dist/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +0 -418
  882. package/dist/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +0 -301
  883. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -257
  884. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -122
  885. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -34
  886. package/dist/node_modules/@popperjs/core/lib/createPopper.js +0 -149
  887. package/dist/node_modules/@popperjs/core/lib/dom-utils/contains.js +0 -19
  888. package/dist/node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js +0 -38
  889. package/dist/node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js +0 -61
  890. package/dist/node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js +0 -53
  891. package/dist/node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js +0 -7
  892. package/dist/node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js +0 -10
  893. package/dist/node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js +0 -27
  894. package/dist/node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js +0 -9
  895. package/dist/node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js +0 -21
  896. package/dist/node_modules/@popperjs/core/lib/dom-utils/getNodeName.js +0 -6
  897. package/dist/node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js +0 -14
  898. package/dist/node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js +0 -51
  899. package/dist/node_modules/@popperjs/core/lib/dom-utils/getParentNode.js +0 -21
  900. package/dist/node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js +0 -16
  901. package/dist/node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js +0 -31
  902. package/dist/node_modules/@popperjs/core/lib/dom-utils/getWindow.js +0 -13
  903. package/dist/node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js +0 -13
  904. package/dist/node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js +0 -9
  905. package/dist/node_modules/@popperjs/core/lib/dom-utils/instanceOf.js +0 -21
  906. package/dist/node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js +0 -7
  907. package/dist/node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js +0 -8
  908. package/dist/node_modules/@popperjs/core/lib/dom-utils/isTableElement.js +0 -7
  909. package/dist/node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js +0 -22
  910. package/dist/node_modules/@popperjs/core/lib/enums.js +0 -54
  911. package/dist/node_modules/@popperjs/core/lib/modifiers/applyStyles.js +0 -71
  912. package/dist/node_modules/@popperjs/core/lib/modifiers/arrow.js +0 -72
  913. package/dist/node_modules/@popperjs/core/lib/modifiers/computeStyles.js +0 -131
  914. package/dist/node_modules/@popperjs/core/lib/modifiers/eventListeners.js +0 -40
  915. package/dist/node_modules/@popperjs/core/lib/modifiers/flip.js +0 -113
  916. package/dist/node_modules/@popperjs/core/lib/modifiers/hide.js +0 -57
  917. package/dist/node_modules/@popperjs/core/lib/modifiers/offset.js +0 -43
  918. package/dist/node_modules/@popperjs/core/lib/modifiers/popperOffsets.js +0 -19
  919. package/dist/node_modules/@popperjs/core/lib/modifiers/preventOverflow.js +0 -105
  920. package/dist/node_modules/@popperjs/core/lib/popper.js +0 -28
  921. package/dist/node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js +0 -35
  922. package/dist/node_modules/@popperjs/core/lib/utils/computeOffsets.js +0 -59
  923. package/dist/node_modules/@popperjs/core/lib/utils/debounce.js +0 -17
  924. package/dist/node_modules/@popperjs/core/lib/utils/detectOverflow.js +0 -47
  925. package/dist/node_modules/@popperjs/core/lib/utils/expandToHashMap.js +0 -9
  926. package/dist/node_modules/@popperjs/core/lib/utils/getAltAxis.js +0 -6
  927. package/dist/node_modules/@popperjs/core/lib/utils/getBasePlacement.js +0 -6
  928. package/dist/node_modules/@popperjs/core/lib/utils/getFreshSideObject.js +0 -11
  929. package/dist/node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js +0 -6
  930. package/dist/node_modules/@popperjs/core/lib/utils/getOppositePlacement.js +0 -14
  931. package/dist/node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js +0 -12
  932. package/dist/node_modules/@popperjs/core/lib/utils/getVariation.js +0 -6
  933. package/dist/node_modules/@popperjs/core/lib/utils/math.js +0 -8
  934. package/dist/node_modules/@popperjs/core/lib/utils/mergeByName.js +0 -16
  935. package/dist/node_modules/@popperjs/core/lib/utils/mergePaddingObject.js +0 -7
  936. package/dist/node_modules/@popperjs/core/lib/utils/orderModifiers.js +0 -39
  937. package/dist/node_modules/@popperjs/core/lib/utils/rectToClientRect.js +0 -11
  938. package/dist/node_modules/@popperjs/core/lib/utils/userAgent.js +0 -12
  939. package/dist/node_modules/@popperjs/core/lib/utils/within.js +0 -12
  940. package/dist/node_modules/@remix-run/router/dist/router.js +0 -400
  941. package/dist/node_modules/@tiptap/core/dist/index.js +0 -4252
  942. package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js +0 -52
  943. package/dist/node_modules/@tiptap/extension-bold/dist/index.js +0 -86
  944. package/dist/node_modules/@tiptap/extension-bullet-list/dist/index.js +0 -68
  945. package/dist/node_modules/@tiptap/extension-code/dist/index.js +0 -62
  946. package/dist/node_modules/@tiptap/extension-code-block/dist/index.js +0 -196
  947. package/dist/node_modules/@tiptap/extension-document/dist/index.js +0 -10
  948. package/dist/node_modules/@tiptap/extension-dropcursor/dist/index.js +0 -21
  949. package/dist/node_modules/@tiptap/extension-gapcursor/dist/index.js +0 -25
  950. package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js +0 -60
  951. package/dist/node_modules/@tiptap/extension-heading/dist/index.js +0 -71
  952. package/dist/node_modules/@tiptap/extension-highlight/dist/index.js +0 -82
  953. package/dist/node_modules/@tiptap/extension-history/dist/index.js +0 -40
  954. package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +0 -79
  955. package/dist/node_modules/@tiptap/extension-image/dist/index.js +0 -69
  956. package/dist/node_modules/@tiptap/extension-italic/dist/index.js +0 -85
  957. package/dist/node_modules/@tiptap/extension-link/dist/index.js +0 -360
  958. package/dist/node_modules/@tiptap/extension-list-item/dist/index.js +0 -34
  959. package/dist/node_modules/@tiptap/extension-mention/dist/index.js +0 -213
  960. package/dist/node_modules/@tiptap/extension-ordered-list/dist/index.js +0 -86
  961. package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js +0 -36
  962. package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js +0 -60
  963. package/dist/node_modules/@tiptap/extension-strike/dist/index.js +0 -72
  964. package/dist/node_modules/@tiptap/extension-text/dist/index.js +0 -9
  965. package/dist/node_modules/@tiptap/react/dist/index.js +0 -1077
  966. package/dist/node_modules/@tiptap/starter-kit/dist/index.js +0 -84
  967. package/dist/node_modules/@tiptap/suggestion/dist/index.js +0 -224
  968. package/dist/node_modules/dompurify/dist/purify.es.js +0 -1012
  969. package/dist/node_modules/emoji-picker-react/dist/emoji-picker-react.esm.js +0 -25708
  970. package/dist/node_modules/flairup/dist/esm/index.js +0 -334
  971. package/dist/node_modules/highcharts/highcharts-3d.js +0 -768
  972. package/dist/node_modules/highcharts/highcharts-more.js +0 -1814
  973. package/dist/node_modules/highcharts/highcharts.js +0 -5153
  974. package/dist/node_modules/highcharts/modules/heatmap.js +0 -416
  975. package/dist/node_modules/highcharts/modules/stock.js +0 -2095
  976. package/dist/node_modules/highcharts/modules/treemap.js +0 -558
  977. package/dist/node_modules/highcharts/modules/venn.js +0 -434
  978. package/dist/node_modules/highcharts-border-radius/index.js +0 -92
  979. package/dist/node_modules/highcharts-react-official/dist/highcharts-react.min.js +0 -106
  980. package/dist/node_modules/linkifyjs/dist/linkify.js +0 -1158
  981. package/dist/node_modules/memoize-one/dist/memoize-one.esm.js +0 -52
  982. package/dist/node_modules/orderedmap/dist/index.js +0 -119
  983. package/dist/node_modules/prosemirror-commands/dist/index.js +0 -526
  984. package/dist/node_modules/prosemirror-dropcursor/dist/index.js +0 -136
  985. package/dist/node_modules/prosemirror-gapcursor/dist/index.js +0 -220
  986. package/dist/node_modules/prosemirror-history/dist/index.js +0 -356
  987. package/dist/node_modules/prosemirror-keymap/dist/index.js +0 -83
  988. package/dist/node_modules/prosemirror-model/dist/index.js +0 -3208
  989. package/dist/node_modules/prosemirror-schema-list/dist/index.js +0 -130
  990. package/dist/node_modules/prosemirror-state/dist/index.js +0 -935
  991. package/dist/node_modules/prosemirror-transform/dist/index.js +0 -1861
  992. package/dist/node_modules/prosemirror-view/dist/index.js +0 -5223
  993. package/dist/node_modules/react-hook-form/dist/index.esm.js +0 -2089
  994. package/dist/node_modules/react-router/dist/index.js +0 -375
  995. package/dist/node_modules/react-router-dom/dist/index.js +0 -521
  996. package/dist/node_modules/react-select/dist/Select-ef7c0426.esm.js +0 -2317
  997. package/dist/node_modules/react-select/dist/index-641ee5b8.esm.js +0 -1071
  998. package/dist/node_modules/react-select/dist/react-select.esm.js +0 -20
  999. package/dist/node_modules/react-select/dist/useStateManager-7e1e8489.esm.js +0 -51
  1000. package/dist/node_modules/react-textarea-autosize/dist/react-textarea-autosize.browser.esm.js +0 -213
  1001. package/dist/node_modules/react-window/dist/index.esm.js +0 -505
  1002. package/dist/node_modules/react-window/node_modules/memoize-one/dist/memoize-one.esm.js +0 -50
  1003. package/dist/node_modules/rope-sequence/dist/index.js +0 -183
  1004. package/dist/node_modules/tippy.js/dist/tippy.esm.js +0 -1283
  1005. package/dist/node_modules/use-composed-ref/dist/use-composed-ref.esm.js +0 -25
  1006. package/dist/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.js +0 -5
  1007. package/dist/node_modules/use-latest/dist/use-latest.esm.js +0 -12
  1008. package/dist/node_modules/w3c-keyname/index.js +0 -105
  1009. package/dist/stats.html +0 -4950
@@ -1,2089 +0,0 @@
1
- import React__default from "react";
2
- var isCheckBoxInput = (element) => element.type === "checkbox";
3
- var isDateObject = (value) => value instanceof Date;
4
- var isNullOrUndefined = (value) => value == null;
5
- const isObjectType = (value) => typeof value === "object";
6
- var isObject = (value) => !isNullOrUndefined(value) && !Array.isArray(value) && isObjectType(value) && !isDateObject(value);
7
- var getEventValue = (event) => isObject(event) && event.target ? isCheckBoxInput(event.target) ? event.target.checked : event.target.value : event;
8
- var getNodeParentName = (name) => name.substring(0, name.search(/\.\d+(\.|$)/)) || name;
9
- var isNameInFieldArray = (names, name) => names.has(getNodeParentName(name));
10
- var isPlainObject = (tempObject) => {
11
- const prototypeCopy = tempObject.constructor && tempObject.constructor.prototype;
12
- return isObject(prototypeCopy) && prototypeCopy.hasOwnProperty("isPrototypeOf");
13
- };
14
- var isWeb = typeof window !== "undefined" && typeof window.HTMLElement !== "undefined" && typeof document !== "undefined";
15
- function cloneObject(data) {
16
- if (data instanceof Date) {
17
- return new Date(data);
18
- }
19
- const isFileListInstance = typeof FileList !== "undefined" && data instanceof FileList;
20
- if (isWeb && (data instanceof Blob || isFileListInstance)) {
21
- return data;
22
- }
23
- const isArray = Array.isArray(data);
24
- if (!isArray && !(isObject(data) && isPlainObject(data))) {
25
- return data;
26
- }
27
- const copy = isArray ? [] : Object.create(Object.getPrototypeOf(data));
28
- for (const key in data) {
29
- if (Object.prototype.hasOwnProperty.call(data, key)) {
30
- copy[key] = cloneObject(data[key]);
31
- }
32
- }
33
- return copy;
34
- }
35
- var isKey = (value) => /^\w*$/.test(value);
36
- var isUndefined = (val) => val === void 0;
37
- var compact = (value) => Array.isArray(value) ? value.filter(Boolean) : [];
38
- var stringToPath = (input) => compact(input.replace(/["|']|\]/g, "").split(/\.|\[/));
39
- var get = (object, path, defaultValue) => {
40
- if (!path || !isObject(object)) {
41
- return defaultValue;
42
- }
43
- const result = (isKey(path) ? [path] : stringToPath(path)).reduce((result2, key) => isNullOrUndefined(result2) ? result2 : result2[key], object);
44
- return isUndefined(result) || result === object ? isUndefined(object[path]) ? defaultValue : object[path] : result;
45
- };
46
- var isBoolean = (value) => typeof value === "boolean";
47
- var isFunction = (value) => typeof value === "function";
48
- var set = (object, path, value) => {
49
- let index = -1;
50
- const tempPath = isKey(path) ? [path] : stringToPath(path);
51
- const length = tempPath.length;
52
- const lastIndex = length - 1;
53
- while (++index < length) {
54
- const key = tempPath[index];
55
- let newValue = value;
56
- if (index !== lastIndex) {
57
- const objValue = object[key];
58
- newValue = isObject(objValue) || Array.isArray(objValue) ? objValue : !isNaN(+tempPath[index + 1]) ? [] : {};
59
- }
60
- if (key === "__proto__" || key === "constructor" || key === "prototype") {
61
- return;
62
- }
63
- object[key] = newValue;
64
- object = object[key];
65
- }
66
- };
67
- const EVENTS = {
68
- BLUR: "blur",
69
- FOCUS_OUT: "focusout",
70
- CHANGE: "change"
71
- };
72
- const VALIDATION_MODE = {
73
- onBlur: "onBlur",
74
- onChange: "onChange",
75
- onSubmit: "onSubmit",
76
- onTouched: "onTouched",
77
- all: "all"
78
- };
79
- const INPUT_VALIDATION_RULES = {
80
- max: "max",
81
- min: "min",
82
- maxLength: "maxLength",
83
- minLength: "minLength",
84
- pattern: "pattern",
85
- required: "required",
86
- validate: "validate"
87
- };
88
- const HookFormControlContext = React__default.createContext(null);
89
- HookFormControlContext.displayName = "HookFormControlContext";
90
- const useFormControlContext = () => React__default.useContext(HookFormControlContext);
91
- var getProxyFormState = (formState, control, localProxyFormState, isRoot = true) => {
92
- const result = {
93
- defaultValues: control._defaultValues
94
- };
95
- for (const key in formState) {
96
- Object.defineProperty(result, key, {
97
- get: () => {
98
- const _key = key;
99
- if (control._proxyFormState[_key] !== VALIDATION_MODE.all) {
100
- control._proxyFormState[_key] = !isRoot || VALIDATION_MODE.all;
101
- }
102
- localProxyFormState && (localProxyFormState[_key] = true);
103
- return formState[_key];
104
- }
105
- });
106
- }
107
- return result;
108
- };
109
- const useIsomorphicLayoutEffect = typeof window !== "undefined" ? React__default.useLayoutEffect : React__default.useEffect;
110
- function useFormState(props) {
111
- const formControl = useFormControlContext();
112
- const { control = formControl, disabled, name, exact } = props || {};
113
- const [formState, updateFormState] = React__default.useState(control._formState);
114
- const _localProxyFormState = React__default.useRef({
115
- isDirty: false,
116
- isLoading: false,
117
- dirtyFields: false,
118
- touchedFields: false,
119
- validatingFields: false,
120
- isValidating: false,
121
- isValid: false,
122
- errors: false
123
- });
124
- useIsomorphicLayoutEffect(() => control._subscribe({
125
- name,
126
- formState: _localProxyFormState.current,
127
- exact,
128
- callback: (formState2) => {
129
- !disabled && updateFormState({
130
- ...control._formState,
131
- ...formState2
132
- });
133
- }
134
- }), [name, disabled, exact]);
135
- React__default.useEffect(() => {
136
- _localProxyFormState.current.isValid && control._setValid(true);
137
- }, [control]);
138
- return React__default.useMemo(() => getProxyFormState(formState, control, _localProxyFormState.current, false), [formState, control]);
139
- }
140
- var isString = (value) => typeof value === "string";
141
- var generateWatchOutput = (names, _names, formValues, isGlobal, defaultValue) => {
142
- if (isString(names)) {
143
- isGlobal && _names.watch.add(names);
144
- return get(formValues, names, defaultValue);
145
- }
146
- if (Array.isArray(names)) {
147
- return names.map((fieldName) => (isGlobal && _names.watch.add(fieldName), get(formValues, fieldName)));
148
- }
149
- isGlobal && (_names.watchAll = true);
150
- return formValues;
151
- };
152
- var isPrimitive = (value) => isNullOrUndefined(value) || !isObjectType(value);
153
- function deepEqual(object1, object2, _internal_visited = /* @__PURE__ */ new WeakSet()) {
154
- if (isPrimitive(object1) || isPrimitive(object2)) {
155
- return Object.is(object1, object2);
156
- }
157
- if (isDateObject(object1) && isDateObject(object2)) {
158
- return Object.is(object1.getTime(), object2.getTime());
159
- }
160
- const keys1 = Object.keys(object1);
161
- const keys2 = Object.keys(object2);
162
- if (keys1.length !== keys2.length) {
163
- return false;
164
- }
165
- if (_internal_visited.has(object1) || _internal_visited.has(object2)) {
166
- return true;
167
- }
168
- _internal_visited.add(object1);
169
- _internal_visited.add(object2);
170
- for (const key of keys1) {
171
- const val1 = object1[key];
172
- if (!keys2.includes(key)) {
173
- return false;
174
- }
175
- if (key !== "ref") {
176
- const val2 = object2[key];
177
- if (isDateObject(val1) && isDateObject(val2) || isObject(val1) && isObject(val2) || Array.isArray(val1) && Array.isArray(val2) ? !deepEqual(val1, val2, _internal_visited) : !Object.is(val1, val2)) {
178
- return false;
179
- }
180
- }
181
- }
182
- return true;
183
- }
184
- function useWatch(props) {
185
- const formControl = useFormControlContext();
186
- const { control = formControl, name, defaultValue, disabled, exact, compute } = props || {};
187
- const _defaultValue = React__default.useRef(defaultValue);
188
- const _compute = React__default.useRef(compute);
189
- const _computeFormValues = React__default.useRef(void 0);
190
- const _prevControl = React__default.useRef(control);
191
- const _prevName = React__default.useRef(name);
192
- _compute.current = compute;
193
- const [value, updateValue] = React__default.useState(() => {
194
- const defaultValue2 = control._getWatch(name, _defaultValue.current);
195
- return _compute.current ? _compute.current(defaultValue2) : defaultValue2;
196
- });
197
- const getCurrentOutput = React__default.useCallback((values) => {
198
- const formValues = generateWatchOutput(name, control._names, values || control._formValues, false, _defaultValue.current);
199
- return _compute.current ? _compute.current(formValues) : formValues;
200
- }, [control._formValues, control._names, name]);
201
- const refreshValue = React__default.useCallback((values) => {
202
- if (!disabled) {
203
- const formValues = generateWatchOutput(name, control._names, values || control._formValues, false, _defaultValue.current);
204
- if (_compute.current) {
205
- const computedFormValues = _compute.current(formValues);
206
- if (!deepEqual(computedFormValues, _computeFormValues.current)) {
207
- updateValue(computedFormValues);
208
- _computeFormValues.current = computedFormValues;
209
- }
210
- } else {
211
- updateValue(formValues);
212
- }
213
- }
214
- }, [control._formValues, control._names, disabled, name]);
215
- useIsomorphicLayoutEffect(() => {
216
- if (_prevControl.current !== control || !deepEqual(_prevName.current, name)) {
217
- _prevControl.current = control;
218
- _prevName.current = name;
219
- refreshValue();
220
- }
221
- return control._subscribe({
222
- name,
223
- formState: {
224
- values: true
225
- },
226
- exact,
227
- callback: (formState) => {
228
- refreshValue(formState.values);
229
- }
230
- });
231
- }, [control, exact, name, refreshValue]);
232
- React__default.useEffect(() => control._removeUnmounted());
233
- const controlChanged = _prevControl.current !== control;
234
- const prevName = _prevName.current;
235
- const computedOutput = React__default.useMemo(() => {
236
- if (disabled) {
237
- return null;
238
- }
239
- const nameChanged = !controlChanged && !deepEqual(prevName, name);
240
- const shouldReturnImmediate = controlChanged || nameChanged;
241
- return shouldReturnImmediate ? getCurrentOutput() : null;
242
- }, [disabled, controlChanged, name, prevName, getCurrentOutput]);
243
- return computedOutput !== null ? computedOutput : value;
244
- }
245
- function useController(props) {
246
- const formControl = useFormControlContext();
247
- const { name, disabled, control = formControl, shouldUnregister, defaultValue, exact = true } = props;
248
- const isArrayField = isNameInFieldArray(control._names.array, name);
249
- const defaultValueMemo = React__default.useMemo(() => get(control._formValues, name, get(control._defaultValues, name, defaultValue)), [control, name, defaultValue]);
250
- const value = useWatch({
251
- control,
252
- name,
253
- defaultValue: defaultValueMemo,
254
- exact
255
- });
256
- const formState = useFormState({
257
- control,
258
- name,
259
- exact
260
- });
261
- const _props = React__default.useRef(props);
262
- const _previousNameRef = React__default.useRef(void 0);
263
- const _registerProps = React__default.useRef(control.register(name, {
264
- ...props.rules,
265
- value,
266
- ...isBoolean(props.disabled) ? { disabled: props.disabled } : {}
267
- }));
268
- _props.current = props;
269
- const fieldState = React__default.useMemo(() => Object.defineProperties({}, {
270
- invalid: {
271
- enumerable: true,
272
- get: () => !!get(formState.errors, name)
273
- },
274
- isDirty: {
275
- enumerable: true,
276
- get: () => !!get(formState.dirtyFields, name)
277
- },
278
- isTouched: {
279
- enumerable: true,
280
- get: () => !!get(formState.touchedFields, name)
281
- },
282
- isValidating: {
283
- enumerable: true,
284
- get: () => !!get(formState.validatingFields, name)
285
- },
286
- error: {
287
- enumerable: true,
288
- get: () => get(formState.errors, name)
289
- }
290
- }), [formState, name]);
291
- const onChange = React__default.useCallback((event) => _registerProps.current.onChange({
292
- target: {
293
- value: getEventValue(event),
294
- name
295
- },
296
- type: EVENTS.CHANGE
297
- }), [name]);
298
- const onBlur = React__default.useCallback(() => _registerProps.current.onBlur({
299
- target: {
300
- value: get(control._formValues, name),
301
- name
302
- },
303
- type: EVENTS.BLUR
304
- }), [name, control._formValues]);
305
- const ref = React__default.useCallback((elm) => {
306
- const field2 = get(control._fields, name);
307
- if (field2 && field2._f && elm) {
308
- field2._f.ref = {
309
- focus: () => isFunction(elm.focus) && elm.focus(),
310
- select: () => isFunction(elm.select) && elm.select(),
311
- setCustomValidity: (message) => isFunction(elm.setCustomValidity) && elm.setCustomValidity(message),
312
- reportValidity: () => isFunction(elm.reportValidity) && elm.reportValidity()
313
- };
314
- }
315
- }, [control._fields, name]);
316
- const field = React__default.useMemo(() => ({
317
- name,
318
- value,
319
- ...isBoolean(disabled) || formState.disabled ? { disabled: formState.disabled || disabled } : {},
320
- onChange,
321
- onBlur,
322
- ref
323
- }), [name, disabled, formState.disabled, onChange, onBlur, ref, value]);
324
- React__default.useEffect(() => {
325
- const _shouldUnregisterField = control._options.shouldUnregister || shouldUnregister;
326
- const previousName = _previousNameRef.current;
327
- if (previousName && previousName !== name && !isArrayField) {
328
- control.unregister(previousName);
329
- }
330
- control.register(name, {
331
- ..._props.current.rules,
332
- ...isBoolean(_props.current.disabled) ? { disabled: _props.current.disabled } : {}
333
- });
334
- const updateMounted = (name2, value2) => {
335
- const field2 = get(control._fields, name2);
336
- if (field2 && field2._f) {
337
- field2._f.mount = value2;
338
- }
339
- };
340
- updateMounted(name, true);
341
- if (_shouldUnregisterField) {
342
- const value2 = cloneObject(get(control._options.defaultValues, name, _props.current.defaultValue));
343
- set(control._defaultValues, name, value2);
344
- if (isUndefined(get(control._formValues, name))) {
345
- set(control._formValues, name, value2);
346
- }
347
- }
348
- !isArrayField && control.register(name);
349
- _previousNameRef.current = name;
350
- return () => {
351
- (isArrayField ? _shouldUnregisterField && !control._state.action : _shouldUnregisterField) ? control.unregister(name) : updateMounted(name, false);
352
- };
353
- }, [name, control, isArrayField, shouldUnregister]);
354
- React__default.useEffect(() => {
355
- control._setDisabledField({
356
- disabled,
357
- name
358
- });
359
- }, [disabled, name, control]);
360
- return React__default.useMemo(() => ({
361
- field,
362
- formState,
363
- fieldState
364
- }), [field, formState, fieldState]);
365
- }
366
- const Controller = (props) => props.render(useController(props));
367
- const HookFormContext = React__default.createContext(null);
368
- HookFormContext.displayName = "HookFormContext";
369
- var appendErrors = (name, validateAllFieldCriteria, errors, type, message) => validateAllFieldCriteria ? {
370
- ...errors[name],
371
- types: {
372
- ...errors[name] && errors[name].types ? errors[name].types : {},
373
- [type]: message || true
374
- }
375
- } : {};
376
- var convertToArrayPayload = (value) => Array.isArray(value) ? value : [value];
377
- var createSubject = () => {
378
- let _observers = [];
379
- const next = (value) => {
380
- for (const observer of _observers) {
381
- observer.next && observer.next(value);
382
- }
383
- };
384
- const subscribe = (observer) => {
385
- _observers.push(observer);
386
- return {
387
- unsubscribe: () => {
388
- _observers = _observers.filter((o) => o !== observer);
389
- }
390
- };
391
- };
392
- const unsubscribe = () => {
393
- _observers = [];
394
- };
395
- return {
396
- get observers() {
397
- return _observers;
398
- },
399
- next,
400
- subscribe,
401
- unsubscribe
402
- };
403
- };
404
- function extractFormValues(fieldsState, formValues) {
405
- const values = {};
406
- for (const key in fieldsState) {
407
- if (fieldsState.hasOwnProperty(key)) {
408
- const fieldState = fieldsState[key];
409
- const fieldValue = formValues[key];
410
- if (fieldState && isObject(fieldState) && fieldValue) {
411
- const nestedFieldsState = extractFormValues(fieldState, fieldValue);
412
- if (isObject(nestedFieldsState)) {
413
- values[key] = nestedFieldsState;
414
- }
415
- } else if (fieldsState[key]) {
416
- values[key] = fieldValue;
417
- }
418
- }
419
- }
420
- return values;
421
- }
422
- var isEmptyObject = (value) => isObject(value) && !Object.keys(value).length;
423
- var isFileInput = (element) => element.type === "file";
424
- var isHTMLElement = (value) => {
425
- if (!isWeb) {
426
- return false;
427
- }
428
- const owner = value ? value.ownerDocument : 0;
429
- return value instanceof (owner && owner.defaultView ? owner.defaultView.HTMLElement : HTMLElement);
430
- };
431
- var isMultipleSelect = (element) => element.type === `select-multiple`;
432
- var isRadioInput = (element) => element.type === "radio";
433
- var isRadioOrCheckbox = (ref) => isRadioInput(ref) || isCheckBoxInput(ref);
434
- var live = (ref) => isHTMLElement(ref) && ref.isConnected;
435
- function baseGet(object, updatePath) {
436
- const length = updatePath.slice(0, -1).length;
437
- let index = 0;
438
- while (index < length) {
439
- object = isUndefined(object) ? index++ : object[updatePath[index++]];
440
- }
441
- return object;
442
- }
443
- function isEmptyArray(obj) {
444
- for (const key in obj) {
445
- if (obj.hasOwnProperty(key) && !isUndefined(obj[key])) {
446
- return false;
447
- }
448
- }
449
- return true;
450
- }
451
- function unset(object, path) {
452
- const paths = Array.isArray(path) ? path : isKey(path) ? [path] : stringToPath(path);
453
- const childObject = paths.length === 1 ? object : baseGet(object, paths);
454
- const index = paths.length - 1;
455
- const key = paths[index];
456
- if (childObject) {
457
- delete childObject[key];
458
- }
459
- if (index !== 0 && (isObject(childObject) && isEmptyObject(childObject) || Array.isArray(childObject) && isEmptyArray(childObject))) {
460
- unset(object, paths.slice(0, -1));
461
- }
462
- return object;
463
- }
464
- var objectHasFunction = (data) => {
465
- for (const key in data) {
466
- if (isFunction(data[key])) {
467
- return true;
468
- }
469
- }
470
- return false;
471
- };
472
- function isTraversable(value) {
473
- return Array.isArray(value) || isObject(value) && !objectHasFunction(value);
474
- }
475
- function markFieldsDirty(data, fields = {}) {
476
- for (const key in data) {
477
- const value = data[key];
478
- if (isTraversable(value)) {
479
- fields[key] = Array.isArray(value) ? [] : {};
480
- markFieldsDirty(value, fields[key]);
481
- } else if (!isUndefined(value)) {
482
- fields[key] = true;
483
- }
484
- }
485
- return fields;
486
- }
487
- function getDirtyFields(data, formValues, dirtyFieldsFromValues) {
488
- if (!dirtyFieldsFromValues) {
489
- dirtyFieldsFromValues = markFieldsDirty(formValues);
490
- }
491
- for (const key in data) {
492
- const value = data[key];
493
- if (isTraversable(value)) {
494
- if (isUndefined(formValues) || isPrimitive(dirtyFieldsFromValues[key])) {
495
- dirtyFieldsFromValues[key] = markFieldsDirty(value, Array.isArray(value) ? [] : {});
496
- } else {
497
- getDirtyFields(value, isNullOrUndefined(formValues) ? {} : formValues[key], dirtyFieldsFromValues[key]);
498
- }
499
- } else {
500
- const formValue = formValues[key];
501
- dirtyFieldsFromValues[key] = !deepEqual(value, formValue);
502
- }
503
- }
504
- return dirtyFieldsFromValues;
505
- }
506
- const defaultResult = {
507
- value: false,
508
- isValid: false
509
- };
510
- const validResult = { value: true, isValid: true };
511
- var getCheckboxValue = (options) => {
512
- if (Array.isArray(options)) {
513
- if (options.length > 1) {
514
- const values = options.filter((option) => option && option.checked && !option.disabled).map((option) => option.value);
515
- return { value: values, isValid: !!values.length };
516
- }
517
- return options[0].checked && !options[0].disabled ? (
518
- // @ts-expect-error expected to work in the browser
519
- options[0].attributes && !isUndefined(options[0].attributes.value) ? isUndefined(options[0].value) || options[0].value === "" ? validResult : { value: options[0].value, isValid: true } : validResult
520
- ) : defaultResult;
521
- }
522
- return defaultResult;
523
- };
524
- var getFieldValueAs = (value, { valueAsNumber, valueAsDate, setValueAs }) => isUndefined(value) ? value : valueAsNumber ? value === "" ? NaN : value ? +value : value : valueAsDate && isString(value) ? new Date(value) : setValueAs ? setValueAs(value) : value;
525
- const defaultReturn = {
526
- isValid: false,
527
- value: null
528
- };
529
- var getRadioValue = (options) => Array.isArray(options) ? options.reduce((previous, option) => option && option.checked && !option.disabled ? {
530
- isValid: true,
531
- value: option.value
532
- } : previous, defaultReturn) : defaultReturn;
533
- function getFieldValue(_f) {
534
- const ref = _f.ref;
535
- if (isFileInput(ref)) {
536
- return ref.files;
537
- }
538
- if (isRadioInput(ref)) {
539
- return getRadioValue(_f.refs).value;
540
- }
541
- if (isMultipleSelect(ref)) {
542
- return [...ref.selectedOptions].map(({ value }) => value);
543
- }
544
- if (isCheckBoxInput(ref)) {
545
- return getCheckboxValue(_f.refs).value;
546
- }
547
- return getFieldValueAs(isUndefined(ref.value) ? _f.ref.value : ref.value, _f);
548
- }
549
- var getResolverOptions = (fieldsNames, _fields, criteriaMode, shouldUseNativeValidation) => {
550
- const fields = {};
551
- for (const name of fieldsNames) {
552
- const field = get(_fields, name);
553
- field && set(fields, name, field._f);
554
- }
555
- return {
556
- criteriaMode,
557
- names: [...fieldsNames],
558
- fields,
559
- shouldUseNativeValidation
560
- };
561
- };
562
- var isRegex = (value) => value instanceof RegExp;
563
- var getRuleValue = (rule) => isUndefined(rule) ? rule : isRegex(rule) ? rule.source : isObject(rule) ? isRegex(rule.value) ? rule.value.source : rule.value : rule;
564
- var getValidationModes = (mode) => ({
565
- isOnSubmit: !mode || mode === VALIDATION_MODE.onSubmit,
566
- isOnBlur: mode === VALIDATION_MODE.onBlur,
567
- isOnChange: mode === VALIDATION_MODE.onChange,
568
- isOnAll: mode === VALIDATION_MODE.all,
569
- isOnTouch: mode === VALIDATION_MODE.onTouched
570
- });
571
- const ASYNC_FUNCTION = "AsyncFunction";
572
- var hasPromiseValidation = (fieldReference) => !!fieldReference && !!fieldReference.validate && !!(isFunction(fieldReference.validate) && fieldReference.validate.constructor.name === ASYNC_FUNCTION || isObject(fieldReference.validate) && Object.values(fieldReference.validate).find((validateFunction) => validateFunction.constructor.name === ASYNC_FUNCTION));
573
- var hasValidation = (options) => options.mount && (options.required || options.min || options.max || options.maxLength || options.minLength || options.pattern || options.validate);
574
- var isWatched = (name, _names, isBlurEvent) => !isBlurEvent && (_names.watchAll || _names.watch.has(name) || [..._names.watch].some((watchName) => name.startsWith(watchName) && /^\.\w+/.test(name.slice(watchName.length))));
575
- const iterateFieldsByAction = (fields, action, fieldsNames, abortEarly) => {
576
- for (const key of fieldsNames || Object.keys(fields)) {
577
- const field = get(fields, key);
578
- if (field) {
579
- const { _f, ...currentField } = field;
580
- if (_f) {
581
- if (_f.refs && _f.refs[0] && action(_f.refs[0], key) && !abortEarly) {
582
- return true;
583
- } else if (_f.ref && action(_f.ref, _f.name) && !abortEarly) {
584
- return true;
585
- } else {
586
- if (iterateFieldsByAction(currentField, action)) {
587
- break;
588
- }
589
- }
590
- } else if (isObject(currentField)) {
591
- if (iterateFieldsByAction(currentField, action)) {
592
- break;
593
- }
594
- }
595
- }
596
- }
597
- return;
598
- };
599
- function schemaErrorLookup(errors, _fields, name) {
600
- const error = get(errors, name);
601
- if (error || isKey(name)) {
602
- return {
603
- error,
604
- name
605
- };
606
- }
607
- const names = name.split(".");
608
- while (names.length) {
609
- const fieldName = names.join(".");
610
- const field = get(_fields, fieldName);
611
- const foundError = get(errors, fieldName);
612
- if (field && !Array.isArray(field) && name !== fieldName) {
613
- return { name };
614
- }
615
- if (foundError && foundError.type) {
616
- return {
617
- name: fieldName,
618
- error: foundError
619
- };
620
- }
621
- if (foundError && foundError.root && foundError.root.type) {
622
- return {
623
- name: `${fieldName}.root`,
624
- error: foundError.root
625
- };
626
- }
627
- names.pop();
628
- }
629
- return {
630
- name
631
- };
632
- }
633
- var shouldRenderFormState = (formStateData, _proxyFormState, updateFormState, isRoot) => {
634
- updateFormState(formStateData);
635
- const { name, ...formState } = formStateData;
636
- return isEmptyObject(formState) || Object.keys(formState).length >= Object.keys(_proxyFormState).length || Object.keys(formState).find((key) => _proxyFormState[key] === (!isRoot || VALIDATION_MODE.all));
637
- };
638
- var shouldSubscribeByName = (name, signalName, exact) => !name || !signalName || name === signalName || convertToArrayPayload(name).some((currentName) => currentName && (exact ? currentName === signalName : currentName.startsWith(signalName) || signalName.startsWith(currentName)));
639
- var skipValidation = (isBlurEvent, isTouched, isSubmitted, reValidateMode, mode) => {
640
- if (mode.isOnAll) {
641
- return false;
642
- } else if (!isSubmitted && mode.isOnTouch) {
643
- return !(isTouched || isBlurEvent);
644
- } else if (isSubmitted ? reValidateMode.isOnBlur : mode.isOnBlur) {
645
- return !isBlurEvent;
646
- } else if (isSubmitted ? reValidateMode.isOnChange : mode.isOnChange) {
647
- return isBlurEvent;
648
- }
649
- return true;
650
- };
651
- var unsetEmptyArray = (ref, name) => !compact(get(ref, name)).length && unset(ref, name);
652
- var updateFieldArrayRootError = (errors, error, name) => {
653
- const fieldArrayErrors = convertToArrayPayload(get(errors, name));
654
- set(fieldArrayErrors, "root", error[name]);
655
- set(errors, name, fieldArrayErrors);
656
- return errors;
657
- };
658
- function getValidateError(result, ref, type = "validate") {
659
- if (isString(result) || Array.isArray(result) && result.every(isString) || isBoolean(result) && !result) {
660
- return {
661
- type,
662
- message: isString(result) ? result : "",
663
- ref
664
- };
665
- }
666
- }
667
- var getValueAndMessage = (validationData) => isObject(validationData) && !isRegex(validationData) ? validationData : {
668
- value: validationData,
669
- message: ""
670
- };
671
- var validateField = async (field, disabledFieldNames, formValues, validateAllFieldCriteria, shouldUseNativeValidation, isFieldArray) => {
672
- const { ref, refs, required, maxLength, minLength, min, max, pattern, validate, name, valueAsNumber, mount } = field._f;
673
- const inputValue = get(formValues, name);
674
- if (!mount || disabledFieldNames.has(name)) {
675
- return {};
676
- }
677
- const inputRef = refs ? refs[0] : ref;
678
- const setCustomValidity = (message) => {
679
- if (shouldUseNativeValidation && inputRef.reportValidity) {
680
- inputRef.setCustomValidity(isBoolean(message) ? "" : message || "");
681
- inputRef.reportValidity();
682
- }
683
- };
684
- const error = {};
685
- const isRadio = isRadioInput(ref);
686
- const isCheckBox = isCheckBoxInput(ref);
687
- const isRadioOrCheckbox2 = isRadio || isCheckBox;
688
- const isEmpty = (valueAsNumber || isFileInput(ref)) && isUndefined(ref.value) && isUndefined(inputValue) || isHTMLElement(ref) && ref.value === "" || inputValue === "" || Array.isArray(inputValue) && !inputValue.length;
689
- const appendErrorsCurry = appendErrors.bind(null, name, validateAllFieldCriteria, error);
690
- const getMinMaxMessage = (exceedMax, maxLengthMessage, minLengthMessage, maxType = INPUT_VALIDATION_RULES.maxLength, minType = INPUT_VALIDATION_RULES.minLength) => {
691
- const message = exceedMax ? maxLengthMessage : minLengthMessage;
692
- error[name] = {
693
- type: exceedMax ? maxType : minType,
694
- message,
695
- ref,
696
- ...appendErrorsCurry(exceedMax ? maxType : minType, message)
697
- };
698
- };
699
- if (isFieldArray ? !Array.isArray(inputValue) || !inputValue.length : required && (!isRadioOrCheckbox2 && (isEmpty || isNullOrUndefined(inputValue)) || isBoolean(inputValue) && !inputValue || isCheckBox && !getCheckboxValue(refs).isValid || isRadio && !getRadioValue(refs).isValid)) {
700
- const { value, message } = isString(required) ? { value: !!required, message: required } : getValueAndMessage(required);
701
- if (value) {
702
- error[name] = {
703
- type: INPUT_VALIDATION_RULES.required,
704
- message,
705
- ref: inputRef,
706
- ...appendErrorsCurry(INPUT_VALIDATION_RULES.required, message)
707
- };
708
- if (!validateAllFieldCriteria) {
709
- setCustomValidity(message);
710
- return error;
711
- }
712
- }
713
- }
714
- if (!isEmpty && (!isNullOrUndefined(min) || !isNullOrUndefined(max))) {
715
- let exceedMax;
716
- let exceedMin;
717
- const maxOutput = getValueAndMessage(max);
718
- const minOutput = getValueAndMessage(min);
719
- if (!isNullOrUndefined(inputValue) && !isNaN(inputValue)) {
720
- const valueNumber = ref.valueAsNumber || (inputValue ? +inputValue : inputValue);
721
- if (!isNullOrUndefined(maxOutput.value)) {
722
- exceedMax = valueNumber > maxOutput.value;
723
- }
724
- if (!isNullOrUndefined(minOutput.value)) {
725
- exceedMin = valueNumber < minOutput.value;
726
- }
727
- } else {
728
- const valueDate = ref.valueAsDate || new Date(inputValue);
729
- const convertTimeToDate = (time) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + time);
730
- const isTime = ref.type == "time";
731
- const isWeek = ref.type == "week";
732
- if (isString(maxOutput.value) && inputValue) {
733
- exceedMax = isTime ? convertTimeToDate(inputValue) > convertTimeToDate(maxOutput.value) : isWeek ? inputValue > maxOutput.value : valueDate > new Date(maxOutput.value);
734
- }
735
- if (isString(minOutput.value) && inputValue) {
736
- exceedMin = isTime ? convertTimeToDate(inputValue) < convertTimeToDate(minOutput.value) : isWeek ? inputValue < minOutput.value : valueDate < new Date(minOutput.value);
737
- }
738
- }
739
- if (exceedMax || exceedMin) {
740
- getMinMaxMessage(!!exceedMax, maxOutput.message, minOutput.message, INPUT_VALIDATION_RULES.max, INPUT_VALIDATION_RULES.min);
741
- if (!validateAllFieldCriteria) {
742
- setCustomValidity(error[name].message);
743
- return error;
744
- }
745
- }
746
- }
747
- if ((maxLength || minLength) && !isEmpty && (isString(inputValue) || isFieldArray && Array.isArray(inputValue))) {
748
- const maxLengthOutput = getValueAndMessage(maxLength);
749
- const minLengthOutput = getValueAndMessage(minLength);
750
- const exceedMax = !isNullOrUndefined(maxLengthOutput.value) && inputValue.length > +maxLengthOutput.value;
751
- const exceedMin = !isNullOrUndefined(minLengthOutput.value) && inputValue.length < +minLengthOutput.value;
752
- if (exceedMax || exceedMin) {
753
- getMinMaxMessage(exceedMax, maxLengthOutput.message, minLengthOutput.message);
754
- if (!validateAllFieldCriteria) {
755
- setCustomValidity(error[name].message);
756
- return error;
757
- }
758
- }
759
- }
760
- if (pattern && !isEmpty && isString(inputValue)) {
761
- const { value: patternValue, message } = getValueAndMessage(pattern);
762
- if (isRegex(patternValue) && !inputValue.match(patternValue)) {
763
- error[name] = {
764
- type: INPUT_VALIDATION_RULES.pattern,
765
- message,
766
- ref,
767
- ...appendErrorsCurry(INPUT_VALIDATION_RULES.pattern, message)
768
- };
769
- if (!validateAllFieldCriteria) {
770
- setCustomValidity(message);
771
- return error;
772
- }
773
- }
774
- }
775
- if (validate) {
776
- if (isFunction(validate)) {
777
- const result = await validate(inputValue, formValues);
778
- const validateError = getValidateError(result, inputRef);
779
- if (validateError) {
780
- error[name] = {
781
- ...validateError,
782
- ...appendErrorsCurry(INPUT_VALIDATION_RULES.validate, validateError.message)
783
- };
784
- if (!validateAllFieldCriteria) {
785
- setCustomValidity(validateError.message);
786
- return error;
787
- }
788
- }
789
- } else if (isObject(validate)) {
790
- let validationResult = {};
791
- for (const key in validate) {
792
- if (!isEmptyObject(validationResult) && !validateAllFieldCriteria) {
793
- break;
794
- }
795
- const validateError = getValidateError(await validate[key](inputValue, formValues), inputRef, key);
796
- if (validateError) {
797
- validationResult = {
798
- ...validateError,
799
- ...appendErrorsCurry(key, validateError.message)
800
- };
801
- setCustomValidity(validateError.message);
802
- if (validateAllFieldCriteria) {
803
- error[name] = validationResult;
804
- }
805
- }
806
- }
807
- if (!isEmptyObject(validationResult)) {
808
- error[name] = {
809
- ref: inputRef,
810
- ...validationResult
811
- };
812
- if (!validateAllFieldCriteria) {
813
- return error;
814
- }
815
- }
816
- }
817
- }
818
- setCustomValidity(true);
819
- return error;
820
- };
821
- const defaultOptions = {
822
- mode: VALIDATION_MODE.onSubmit,
823
- reValidateMode: VALIDATION_MODE.onChange,
824
- shouldFocusError: true
825
- };
826
- function createFormControl(props = {}) {
827
- let _options = {
828
- ...defaultOptions,
829
- ...props
830
- };
831
- let _formState = {
832
- submitCount: 0,
833
- isDirty: false,
834
- isReady: false,
835
- isLoading: isFunction(_options.defaultValues),
836
- isValidating: false,
837
- isSubmitted: false,
838
- isSubmitting: false,
839
- isSubmitSuccessful: false,
840
- isValid: false,
841
- touchedFields: {},
842
- dirtyFields: {},
843
- validatingFields: {},
844
- errors: _options.errors || {},
845
- disabled: _options.disabled || false
846
- };
847
- let _fields = {};
848
- let _defaultValues = isObject(_options.defaultValues) || isObject(_options.values) ? cloneObject(_options.defaultValues || _options.values) || {} : {};
849
- let _formValues = _options.shouldUnregister ? {} : cloneObject(_defaultValues);
850
- let _state = {
851
- action: false,
852
- mount: false,
853
- watch: false,
854
- keepIsValid: false
855
- };
856
- let _names = {
857
- mount: /* @__PURE__ */ new Set(),
858
- disabled: /* @__PURE__ */ new Set(),
859
- unMount: /* @__PURE__ */ new Set(),
860
- array: /* @__PURE__ */ new Set(),
861
- watch: /* @__PURE__ */ new Set()
862
- };
863
- let delayErrorCallback;
864
- let timer = 0;
865
- const defaultProxyFormState = {
866
- isDirty: false,
867
- dirtyFields: false,
868
- validatingFields: false,
869
- touchedFields: false,
870
- isValidating: false,
871
- isValid: false,
872
- errors: false
873
- };
874
- const _proxyFormState = {
875
- ...defaultProxyFormState
876
- };
877
- let _proxySubscribeFormState = {
878
- ..._proxyFormState
879
- };
880
- const _subjects = {
881
- array: createSubject(),
882
- state: createSubject()
883
- };
884
- const shouldDisplayAllAssociatedErrors = _options.criteriaMode === VALIDATION_MODE.all;
885
- const debounce = (callback) => (wait) => {
886
- clearTimeout(timer);
887
- timer = setTimeout(callback, wait);
888
- };
889
- const _setValid = async (shouldUpdateValid) => {
890
- if (_state.keepIsValid) {
891
- return;
892
- }
893
- if (!_options.disabled && (_proxyFormState.isValid || _proxySubscribeFormState.isValid || shouldUpdateValid)) {
894
- let isValid;
895
- if (_options.resolver) {
896
- isValid = isEmptyObject((await _runSchema()).errors);
897
- _updateIsValidating();
898
- } else {
899
- isValid = await executeBuiltInValidation(_fields, true);
900
- }
901
- if (isValid !== _formState.isValid) {
902
- _subjects.state.next({
903
- isValid
904
- });
905
- }
906
- }
907
- };
908
- const _updateIsValidating = (names, isValidating) => {
909
- if (!_options.disabled && (_proxyFormState.isValidating || _proxyFormState.validatingFields || _proxySubscribeFormState.isValidating || _proxySubscribeFormState.validatingFields)) {
910
- (names || Array.from(_names.mount)).forEach((name) => {
911
- if (name) {
912
- isValidating ? set(_formState.validatingFields, name, isValidating) : unset(_formState.validatingFields, name);
913
- }
914
- });
915
- _subjects.state.next({
916
- validatingFields: _formState.validatingFields,
917
- isValidating: !isEmptyObject(_formState.validatingFields)
918
- });
919
- }
920
- };
921
- const _setFieldArray = (name, values = [], method, args, shouldSetValues = true, shouldUpdateFieldsAndState = true) => {
922
- if (args && method && !_options.disabled) {
923
- _state.action = true;
924
- if (shouldUpdateFieldsAndState && Array.isArray(get(_fields, name))) {
925
- const fieldValues = method(get(_fields, name), args.argA, args.argB);
926
- shouldSetValues && set(_fields, name, fieldValues);
927
- }
928
- if (shouldUpdateFieldsAndState && Array.isArray(get(_formState.errors, name))) {
929
- const errors = method(get(_formState.errors, name), args.argA, args.argB);
930
- shouldSetValues && set(_formState.errors, name, errors);
931
- unsetEmptyArray(_formState.errors, name);
932
- }
933
- if ((_proxyFormState.touchedFields || _proxySubscribeFormState.touchedFields) && shouldUpdateFieldsAndState && Array.isArray(get(_formState.touchedFields, name))) {
934
- const touchedFields = method(get(_formState.touchedFields, name), args.argA, args.argB);
935
- shouldSetValues && set(_formState.touchedFields, name, touchedFields);
936
- }
937
- if (_proxyFormState.dirtyFields || _proxySubscribeFormState.dirtyFields) {
938
- _formState.dirtyFields = getDirtyFields(_defaultValues, _formValues);
939
- }
940
- _subjects.state.next({
941
- name,
942
- isDirty: _getDirty(name, values),
943
- dirtyFields: _formState.dirtyFields,
944
- errors: _formState.errors,
945
- isValid: _formState.isValid
946
- });
947
- } else {
948
- set(_formValues, name, values);
949
- }
950
- };
951
- const updateErrors = (name, error) => {
952
- set(_formState.errors, name, error);
953
- _subjects.state.next({
954
- errors: _formState.errors
955
- });
956
- };
957
- const _setErrors = (errors) => {
958
- _formState.errors = errors;
959
- _subjects.state.next({
960
- errors: _formState.errors,
961
- isValid: false
962
- });
963
- };
964
- const updateValidAndValue = (name, shouldSkipSetValueAs, value, ref) => {
965
- const field = get(_fields, name);
966
- if (field) {
967
- const defaultValue = get(_formValues, name, isUndefined(value) ? get(_defaultValues, name) : value);
968
- isUndefined(defaultValue) || ref && ref.defaultChecked || shouldSkipSetValueAs ? set(_formValues, name, shouldSkipSetValueAs ? defaultValue : getFieldValue(field._f)) : setFieldValue(name, defaultValue);
969
- _state.mount && !_state.action && _setValid();
970
- }
971
- };
972
- const updateTouchAndDirty = (name, fieldValue, isBlurEvent, shouldDirty, shouldRender) => {
973
- let shouldUpdateField = false;
974
- let isPreviousDirty = false;
975
- const output = {
976
- name
977
- };
978
- if (!_options.disabled) {
979
- if (!isBlurEvent || shouldDirty) {
980
- if (_proxyFormState.isDirty || _proxySubscribeFormState.isDirty) {
981
- isPreviousDirty = _formState.isDirty;
982
- _formState.isDirty = output.isDirty = _getDirty();
983
- shouldUpdateField = isPreviousDirty !== output.isDirty;
984
- }
985
- const isCurrentFieldPristine = deepEqual(get(_defaultValues, name), fieldValue);
986
- isPreviousDirty = !!get(_formState.dirtyFields, name);
987
- isCurrentFieldPristine ? unset(_formState.dirtyFields, name) : set(_formState.dirtyFields, name, true);
988
- output.dirtyFields = _formState.dirtyFields;
989
- shouldUpdateField = shouldUpdateField || (_proxyFormState.dirtyFields || _proxySubscribeFormState.dirtyFields) && isPreviousDirty !== !isCurrentFieldPristine;
990
- }
991
- if (isBlurEvent) {
992
- const isPreviousFieldTouched = get(_formState.touchedFields, name);
993
- if (!isPreviousFieldTouched) {
994
- set(_formState.touchedFields, name, isBlurEvent);
995
- output.touchedFields = _formState.touchedFields;
996
- shouldUpdateField = shouldUpdateField || (_proxyFormState.touchedFields || _proxySubscribeFormState.touchedFields) && isPreviousFieldTouched !== isBlurEvent;
997
- }
998
- }
999
- shouldUpdateField && shouldRender && _subjects.state.next(output);
1000
- }
1001
- return shouldUpdateField ? output : {};
1002
- };
1003
- const shouldRenderByError = (name, isValid, error, fieldState) => {
1004
- const previousFieldError = get(_formState.errors, name);
1005
- const shouldUpdateValid = (_proxyFormState.isValid || _proxySubscribeFormState.isValid) && isBoolean(isValid) && _formState.isValid !== isValid;
1006
- if (_options.delayError && error) {
1007
- delayErrorCallback = debounce(() => updateErrors(name, error));
1008
- delayErrorCallback(_options.delayError);
1009
- } else {
1010
- clearTimeout(timer);
1011
- delayErrorCallback = null;
1012
- error ? set(_formState.errors, name, error) : unset(_formState.errors, name);
1013
- }
1014
- if ((error ? !deepEqual(previousFieldError, error) : previousFieldError) || !isEmptyObject(fieldState) || shouldUpdateValid) {
1015
- const updatedFormState = {
1016
- ...fieldState,
1017
- ...shouldUpdateValid && isBoolean(isValid) ? { isValid } : {},
1018
- errors: _formState.errors,
1019
- name
1020
- };
1021
- _formState = {
1022
- ..._formState,
1023
- ...updatedFormState
1024
- };
1025
- _subjects.state.next(updatedFormState);
1026
- }
1027
- };
1028
- const _runSchema = async (name) => {
1029
- _updateIsValidating(name, true);
1030
- const result = await _options.resolver(_formValues, _options.context, getResolverOptions(name || _names.mount, _fields, _options.criteriaMode, _options.shouldUseNativeValidation));
1031
- return result;
1032
- };
1033
- const executeSchemaAndUpdateState = async (names) => {
1034
- const { errors } = await _runSchema(names);
1035
- _updateIsValidating(names);
1036
- if (names) {
1037
- for (const name of names) {
1038
- const error = get(errors, name);
1039
- error ? set(_formState.errors, name, error) : unset(_formState.errors, name);
1040
- }
1041
- } else {
1042
- _formState.errors = errors;
1043
- }
1044
- return errors;
1045
- };
1046
- const executeBuiltInValidation = async (fields, shouldOnlyCheckValid, context = {
1047
- valid: true
1048
- }) => {
1049
- for (const name in fields) {
1050
- const field = fields[name];
1051
- if (field) {
1052
- const { _f, ...fieldValue } = field;
1053
- if (_f) {
1054
- const isFieldArrayRoot = _names.array.has(_f.name);
1055
- const isPromiseFunction = field._f && hasPromiseValidation(field._f);
1056
- if (isPromiseFunction && _proxyFormState.validatingFields) {
1057
- _updateIsValidating([_f.name], true);
1058
- }
1059
- const fieldError = await validateField(field, _names.disabled, _formValues, shouldDisplayAllAssociatedErrors, _options.shouldUseNativeValidation && !shouldOnlyCheckValid, isFieldArrayRoot);
1060
- if (isPromiseFunction && _proxyFormState.validatingFields) {
1061
- _updateIsValidating([_f.name]);
1062
- }
1063
- if (fieldError[_f.name]) {
1064
- context.valid = false;
1065
- if (shouldOnlyCheckValid || props.shouldUseNativeValidation) {
1066
- break;
1067
- }
1068
- }
1069
- !shouldOnlyCheckValid && (get(fieldError, _f.name) ? isFieldArrayRoot ? updateFieldArrayRootError(_formState.errors, fieldError, _f.name) : set(_formState.errors, _f.name, fieldError[_f.name]) : unset(_formState.errors, _f.name));
1070
- }
1071
- !isEmptyObject(fieldValue) && await executeBuiltInValidation(fieldValue, shouldOnlyCheckValid, context);
1072
- }
1073
- }
1074
- return context.valid;
1075
- };
1076
- const _removeUnmounted = () => {
1077
- for (const name of _names.unMount) {
1078
- const field = get(_fields, name);
1079
- field && (field._f.refs ? field._f.refs.every((ref) => !live(ref)) : !live(field._f.ref)) && unregister(name);
1080
- }
1081
- _names.unMount = /* @__PURE__ */ new Set();
1082
- };
1083
- const _getDirty = (name, data) => !_options.disabled && (name && data && set(_formValues, name, data), !deepEqual(getValues(), _defaultValues));
1084
- const _getWatch = (names, defaultValue, isGlobal) => generateWatchOutput(names, _names, {
1085
- ..._state.mount ? _formValues : isUndefined(defaultValue) ? _defaultValues : isString(names) ? { [names]: defaultValue } : defaultValue
1086
- }, isGlobal, defaultValue);
1087
- const _getFieldArray = (name) => compact(get(_state.mount ? _formValues : _defaultValues, name, _options.shouldUnregister ? get(_defaultValues, name, []) : []));
1088
- const setFieldValue = (name, value, options = {}) => {
1089
- const field = get(_fields, name);
1090
- let fieldValue = value;
1091
- if (field) {
1092
- const fieldReference = field._f;
1093
- if (fieldReference) {
1094
- !fieldReference.disabled && set(_formValues, name, getFieldValueAs(value, fieldReference));
1095
- fieldValue = isHTMLElement(fieldReference.ref) && isNullOrUndefined(value) ? "" : value;
1096
- if (isMultipleSelect(fieldReference.ref)) {
1097
- [...fieldReference.ref.options].forEach((optionRef) => optionRef.selected = fieldValue.includes(optionRef.value));
1098
- } else if (fieldReference.refs) {
1099
- if (isCheckBoxInput(fieldReference.ref)) {
1100
- fieldReference.refs.forEach((checkboxRef) => {
1101
- if (!checkboxRef.defaultChecked || !checkboxRef.disabled) {
1102
- if (Array.isArray(fieldValue)) {
1103
- checkboxRef.checked = !!fieldValue.find((data) => data === checkboxRef.value);
1104
- } else {
1105
- checkboxRef.checked = fieldValue === checkboxRef.value || !!fieldValue;
1106
- }
1107
- }
1108
- });
1109
- } else {
1110
- fieldReference.refs.forEach((radioRef) => radioRef.checked = radioRef.value === fieldValue);
1111
- }
1112
- } else if (isFileInput(fieldReference.ref)) {
1113
- fieldReference.ref.value = "";
1114
- } else {
1115
- fieldReference.ref.value = fieldValue;
1116
- if (!fieldReference.ref.type) {
1117
- _subjects.state.next({
1118
- name,
1119
- values: cloneObject(_formValues)
1120
- });
1121
- }
1122
- }
1123
- }
1124
- }
1125
- (options.shouldDirty || options.shouldTouch) && updateTouchAndDirty(name, fieldValue, options.shouldTouch, options.shouldDirty, true);
1126
- options.shouldValidate && trigger(name);
1127
- };
1128
- const setValues = (name, value, options) => {
1129
- for (const fieldKey in value) {
1130
- if (!value.hasOwnProperty(fieldKey)) {
1131
- return;
1132
- }
1133
- const fieldValue = value[fieldKey];
1134
- const fieldName = name + "." + fieldKey;
1135
- const field = get(_fields, fieldName);
1136
- (_names.array.has(name) || isObject(fieldValue) || field && !field._f) && !isDateObject(fieldValue) ? setValues(fieldName, fieldValue, options) : setFieldValue(fieldName, fieldValue, options);
1137
- }
1138
- };
1139
- const setValue = (name, value, options = {}) => {
1140
- const field = get(_fields, name);
1141
- const isFieldArray = _names.array.has(name);
1142
- const cloneValue = cloneObject(value);
1143
- set(_formValues, name, cloneValue);
1144
- if (isFieldArray) {
1145
- _subjects.array.next({
1146
- name,
1147
- values: cloneObject(_formValues)
1148
- });
1149
- if ((_proxyFormState.isDirty || _proxyFormState.dirtyFields || _proxySubscribeFormState.isDirty || _proxySubscribeFormState.dirtyFields) && options.shouldDirty) {
1150
- _subjects.state.next({
1151
- name,
1152
- dirtyFields: getDirtyFields(_defaultValues, _formValues),
1153
- isDirty: _getDirty(name, cloneValue)
1154
- });
1155
- }
1156
- } else {
1157
- field && !field._f && !isNullOrUndefined(cloneValue) ? setValues(name, cloneValue, options) : setFieldValue(name, cloneValue, options);
1158
- }
1159
- if (isWatched(name, _names)) {
1160
- _subjects.state.next({
1161
- ..._formState,
1162
- name,
1163
- values: cloneObject(_formValues)
1164
- });
1165
- } else {
1166
- _subjects.state.next({
1167
- name: _state.mount ? name : void 0,
1168
- values: cloneObject(_formValues)
1169
- });
1170
- }
1171
- };
1172
- const onChange = async (event) => {
1173
- _state.mount = true;
1174
- const target = event.target;
1175
- let name = target.name;
1176
- let isFieldValueUpdated = true;
1177
- const field = get(_fields, name);
1178
- const _updateIsFieldValueUpdated = (fieldValue) => {
1179
- isFieldValueUpdated = Number.isNaN(fieldValue) || isDateObject(fieldValue) && isNaN(fieldValue.getTime()) || deepEqual(fieldValue, get(_formValues, name, fieldValue));
1180
- };
1181
- const validationModeBeforeSubmit = getValidationModes(_options.mode);
1182
- const validationModeAfterSubmit = getValidationModes(_options.reValidateMode);
1183
- if (field) {
1184
- let error;
1185
- let isValid;
1186
- const fieldValue = target.type ? getFieldValue(field._f) : getEventValue(event);
1187
- const isBlurEvent = event.type === EVENTS.BLUR || event.type === EVENTS.FOCUS_OUT;
1188
- const shouldSkipValidation = !hasValidation(field._f) && !_options.resolver && !get(_formState.errors, name) && !field._f.deps || skipValidation(isBlurEvent, get(_formState.touchedFields, name), _formState.isSubmitted, validationModeAfterSubmit, validationModeBeforeSubmit);
1189
- const watched = isWatched(name, _names, isBlurEvent);
1190
- set(_formValues, name, fieldValue);
1191
- if (isBlurEvent) {
1192
- if (!target || !target.readOnly) {
1193
- field._f.onBlur && field._f.onBlur(event);
1194
- delayErrorCallback && delayErrorCallback(0);
1195
- }
1196
- } else if (field._f.onChange) {
1197
- field._f.onChange(event);
1198
- }
1199
- const fieldState = updateTouchAndDirty(name, fieldValue, isBlurEvent);
1200
- const shouldRender = !isEmptyObject(fieldState) || watched;
1201
- !isBlurEvent && _subjects.state.next({
1202
- name,
1203
- type: event.type,
1204
- values: cloneObject(_formValues)
1205
- });
1206
- if (shouldSkipValidation) {
1207
- if (_proxyFormState.isValid || _proxySubscribeFormState.isValid) {
1208
- if (_options.mode === "onBlur") {
1209
- if (isBlurEvent) {
1210
- _setValid();
1211
- }
1212
- } else if (!isBlurEvent) {
1213
- _setValid();
1214
- }
1215
- }
1216
- return shouldRender && _subjects.state.next({ name, ...watched ? {} : fieldState });
1217
- }
1218
- !isBlurEvent && watched && _subjects.state.next({ ..._formState });
1219
- if (_options.resolver) {
1220
- const { errors } = await _runSchema([name]);
1221
- _updateIsValidating([name]);
1222
- _updateIsFieldValueUpdated(fieldValue);
1223
- if (isFieldValueUpdated) {
1224
- const previousErrorLookupResult = schemaErrorLookup(_formState.errors, _fields, name);
1225
- const errorLookupResult = schemaErrorLookup(errors, _fields, previousErrorLookupResult.name || name);
1226
- error = errorLookupResult.error;
1227
- name = errorLookupResult.name;
1228
- isValid = isEmptyObject(errors);
1229
- }
1230
- } else {
1231
- _updateIsValidating([name], true);
1232
- error = (await validateField(field, _names.disabled, _formValues, shouldDisplayAllAssociatedErrors, _options.shouldUseNativeValidation))[name];
1233
- _updateIsValidating([name]);
1234
- _updateIsFieldValueUpdated(fieldValue);
1235
- if (isFieldValueUpdated) {
1236
- if (error) {
1237
- isValid = false;
1238
- } else if (_proxyFormState.isValid || _proxySubscribeFormState.isValid) {
1239
- isValid = await executeBuiltInValidation(_fields, true);
1240
- }
1241
- }
1242
- }
1243
- if (isFieldValueUpdated) {
1244
- field._f.deps && (!Array.isArray(field._f.deps) || field._f.deps.length > 0) && trigger(field._f.deps);
1245
- shouldRenderByError(name, isValid, error, fieldState);
1246
- }
1247
- }
1248
- };
1249
- const _focusInput = (ref, key) => {
1250
- if (get(_formState.errors, key) && ref.focus) {
1251
- ref.focus();
1252
- return 1;
1253
- }
1254
- return;
1255
- };
1256
- const trigger = async (name, options = {}) => {
1257
- let isValid;
1258
- let validationResult;
1259
- const fieldNames = convertToArrayPayload(name);
1260
- if (_options.resolver) {
1261
- const errors = await executeSchemaAndUpdateState(isUndefined(name) ? name : fieldNames);
1262
- isValid = isEmptyObject(errors);
1263
- validationResult = name ? !fieldNames.some((name2) => get(errors, name2)) : isValid;
1264
- } else if (name) {
1265
- validationResult = (await Promise.all(fieldNames.map(async (fieldName) => {
1266
- const field = get(_fields, fieldName);
1267
- return await executeBuiltInValidation(field && field._f ? { [fieldName]: field } : field);
1268
- }))).every(Boolean);
1269
- !(!validationResult && !_formState.isValid) && _setValid();
1270
- } else {
1271
- validationResult = isValid = await executeBuiltInValidation(_fields);
1272
- }
1273
- _subjects.state.next({
1274
- ...!isString(name) || (_proxyFormState.isValid || _proxySubscribeFormState.isValid) && isValid !== _formState.isValid ? {} : { name },
1275
- ..._options.resolver || !name ? { isValid } : {},
1276
- errors: _formState.errors
1277
- });
1278
- options.shouldFocus && !validationResult && iterateFieldsByAction(_fields, _focusInput, name ? fieldNames : _names.mount);
1279
- return validationResult;
1280
- };
1281
- const getValues = (fieldNames, config) => {
1282
- let values = {
1283
- ..._state.mount ? _formValues : _defaultValues
1284
- };
1285
- if (config) {
1286
- values = extractFormValues(config.dirtyFields ? _formState.dirtyFields : _formState.touchedFields, values);
1287
- }
1288
- return isUndefined(fieldNames) ? values : isString(fieldNames) ? get(values, fieldNames) : fieldNames.map((name) => get(values, name));
1289
- };
1290
- const getFieldState = (name, formState) => ({
1291
- invalid: !!get((formState || _formState).errors, name),
1292
- isDirty: !!get((formState || _formState).dirtyFields, name),
1293
- error: get((formState || _formState).errors, name),
1294
- isValidating: !!get(_formState.validatingFields, name),
1295
- isTouched: !!get((formState || _formState).touchedFields, name)
1296
- });
1297
- const clearErrors = (name) => {
1298
- const names = name ? convertToArrayPayload(name) : void 0;
1299
- names === null || names === void 0 ? void 0 : names.forEach((inputName) => unset(_formState.errors, inputName));
1300
- if (names) {
1301
- names.forEach((inputName) => {
1302
- _subjects.state.next({
1303
- name: inputName,
1304
- errors: _formState.errors
1305
- });
1306
- });
1307
- } else {
1308
- _subjects.state.next({
1309
- errors: {}
1310
- });
1311
- }
1312
- };
1313
- const setError = (name, error, options) => {
1314
- const ref = (get(_fields, name, { _f: {} })._f || {}).ref;
1315
- const currentError = get(_formState.errors, name) || {};
1316
- const { ref: currentRef, message, type, ...restOfErrorTree } = currentError;
1317
- set(_formState.errors, name, {
1318
- ...restOfErrorTree,
1319
- ...error,
1320
- ref
1321
- });
1322
- _subjects.state.next({
1323
- name,
1324
- errors: _formState.errors,
1325
- isValid: false
1326
- });
1327
- options && options.shouldFocus && ref && ref.focus && ref.focus();
1328
- };
1329
- const watch = (name, defaultValue) => isFunction(name) ? _subjects.state.subscribe({
1330
- next: (payload) => "values" in payload && name(_getWatch(void 0, defaultValue), payload)
1331
- }) : _getWatch(name, defaultValue, true);
1332
- const _subscribe = (props2) => _subjects.state.subscribe({
1333
- next: (formState) => {
1334
- if (shouldSubscribeByName(props2.name, formState.name, props2.exact) && shouldRenderFormState(formState, props2.formState || _proxyFormState, _setFormState, props2.reRenderRoot)) {
1335
- props2.callback({
1336
- values: { ..._formValues },
1337
- ..._formState,
1338
- ...formState,
1339
- defaultValues: _defaultValues
1340
- });
1341
- }
1342
- }
1343
- }).unsubscribe;
1344
- const subscribe = (props2) => {
1345
- _state.mount = true;
1346
- _proxySubscribeFormState = {
1347
- ..._proxySubscribeFormState,
1348
- ...props2.formState
1349
- };
1350
- return _subscribe({
1351
- ...props2,
1352
- formState: {
1353
- ...defaultProxyFormState,
1354
- ...props2.formState
1355
- }
1356
- });
1357
- };
1358
- const unregister = (name, options = {}) => {
1359
- for (const fieldName of name ? convertToArrayPayload(name) : _names.mount) {
1360
- _names.mount.delete(fieldName);
1361
- _names.array.delete(fieldName);
1362
- if (!options.keepValue) {
1363
- unset(_fields, fieldName);
1364
- unset(_formValues, fieldName);
1365
- }
1366
- !options.keepError && unset(_formState.errors, fieldName);
1367
- !options.keepDirty && unset(_formState.dirtyFields, fieldName);
1368
- !options.keepTouched && unset(_formState.touchedFields, fieldName);
1369
- !options.keepIsValidating && unset(_formState.validatingFields, fieldName);
1370
- !_options.shouldUnregister && !options.keepDefaultValue && unset(_defaultValues, fieldName);
1371
- }
1372
- _subjects.state.next({
1373
- values: cloneObject(_formValues)
1374
- });
1375
- _subjects.state.next({
1376
- ..._formState,
1377
- ...!options.keepDirty ? {} : { isDirty: _getDirty() }
1378
- });
1379
- !options.keepIsValid && _setValid();
1380
- };
1381
- const _setDisabledField = ({ disabled, name }) => {
1382
- if (isBoolean(disabled) && _state.mount || !!disabled || _names.disabled.has(name)) {
1383
- const wasDisabled = _names.disabled.has(name);
1384
- const isDisabled = !!disabled;
1385
- const disabledStateChanged = wasDisabled !== isDisabled;
1386
- disabled ? _names.disabled.add(name) : _names.disabled.delete(name);
1387
- disabledStateChanged && _state.mount && !_state.action && _setValid();
1388
- }
1389
- };
1390
- const register = (name, options = {}) => {
1391
- let field = get(_fields, name);
1392
- const disabledIsDefined = isBoolean(options.disabled) || isBoolean(_options.disabled);
1393
- set(_fields, name, {
1394
- ...field || {},
1395
- _f: {
1396
- ...field && field._f ? field._f : { ref: { name } },
1397
- name,
1398
- mount: true,
1399
- ...options
1400
- }
1401
- });
1402
- _names.mount.add(name);
1403
- if (field) {
1404
- _setDisabledField({
1405
- disabled: isBoolean(options.disabled) ? options.disabled : _options.disabled,
1406
- name
1407
- });
1408
- } else {
1409
- updateValidAndValue(name, true, options.value);
1410
- }
1411
- return {
1412
- ...disabledIsDefined ? { disabled: options.disabled || _options.disabled } : {},
1413
- ..._options.progressive ? {
1414
- required: !!options.required,
1415
- min: getRuleValue(options.min),
1416
- max: getRuleValue(options.max),
1417
- minLength: getRuleValue(options.minLength),
1418
- maxLength: getRuleValue(options.maxLength),
1419
- pattern: getRuleValue(options.pattern)
1420
- } : {},
1421
- name,
1422
- onChange,
1423
- onBlur: onChange,
1424
- ref: (ref) => {
1425
- if (ref) {
1426
- register(name, options);
1427
- field = get(_fields, name);
1428
- const fieldRef = isUndefined(ref.value) ? ref.querySelectorAll ? ref.querySelectorAll("input,select,textarea")[0] || ref : ref : ref;
1429
- const radioOrCheckbox = isRadioOrCheckbox(fieldRef);
1430
- const refs = field._f.refs || [];
1431
- if (radioOrCheckbox ? refs.find((option) => option === fieldRef) : fieldRef === field._f.ref) {
1432
- return;
1433
- }
1434
- set(_fields, name, {
1435
- _f: {
1436
- ...field._f,
1437
- ...radioOrCheckbox ? {
1438
- refs: [
1439
- ...refs.filter(live),
1440
- fieldRef,
1441
- ...Array.isArray(get(_defaultValues, name)) ? [{}] : []
1442
- ],
1443
- ref: { type: fieldRef.type, name }
1444
- } : { ref: fieldRef }
1445
- }
1446
- });
1447
- updateValidAndValue(name, false, void 0, fieldRef);
1448
- } else {
1449
- field = get(_fields, name, {});
1450
- if (field._f) {
1451
- field._f.mount = false;
1452
- }
1453
- (_options.shouldUnregister || options.shouldUnregister) && !(isNameInFieldArray(_names.array, name) && _state.action) && _names.unMount.add(name);
1454
- }
1455
- }
1456
- };
1457
- };
1458
- const _focusError = () => _options.shouldFocusError && iterateFieldsByAction(_fields, _focusInput, _names.mount);
1459
- const _disableForm = (disabled) => {
1460
- if (isBoolean(disabled)) {
1461
- _subjects.state.next({ disabled });
1462
- iterateFieldsByAction(_fields, (ref, name) => {
1463
- const currentField = get(_fields, name);
1464
- if (currentField) {
1465
- ref.disabled = currentField._f.disabled || disabled;
1466
- if (Array.isArray(currentField._f.refs)) {
1467
- currentField._f.refs.forEach((inputRef) => {
1468
- inputRef.disabled = currentField._f.disabled || disabled;
1469
- });
1470
- }
1471
- }
1472
- }, 0, false);
1473
- }
1474
- };
1475
- const handleSubmit = (onValid, onInvalid) => async (e) => {
1476
- let onValidError = void 0;
1477
- if (e) {
1478
- e.preventDefault && e.preventDefault();
1479
- e.persist && e.persist();
1480
- }
1481
- let fieldValues = cloneObject(_formValues);
1482
- _subjects.state.next({
1483
- isSubmitting: true
1484
- });
1485
- if (_options.resolver) {
1486
- const { errors, values } = await _runSchema();
1487
- _updateIsValidating();
1488
- _formState.errors = errors;
1489
- fieldValues = cloneObject(values);
1490
- } else {
1491
- await executeBuiltInValidation(_fields);
1492
- }
1493
- if (_names.disabled.size) {
1494
- for (const name of _names.disabled) {
1495
- unset(fieldValues, name);
1496
- }
1497
- }
1498
- unset(_formState.errors, "root");
1499
- if (isEmptyObject(_formState.errors)) {
1500
- _subjects.state.next({
1501
- errors: {}
1502
- });
1503
- try {
1504
- await onValid(fieldValues, e);
1505
- } catch (error) {
1506
- onValidError = error;
1507
- }
1508
- } else {
1509
- if (onInvalid) {
1510
- await onInvalid({ ..._formState.errors }, e);
1511
- }
1512
- _focusError();
1513
- setTimeout(_focusError);
1514
- }
1515
- _subjects.state.next({
1516
- isSubmitted: true,
1517
- isSubmitting: false,
1518
- isSubmitSuccessful: isEmptyObject(_formState.errors) && !onValidError,
1519
- submitCount: _formState.submitCount + 1,
1520
- errors: _formState.errors
1521
- });
1522
- if (onValidError) {
1523
- throw onValidError;
1524
- }
1525
- };
1526
- const resetField = (name, options = {}) => {
1527
- if (get(_fields, name)) {
1528
- if (isUndefined(options.defaultValue)) {
1529
- setValue(name, cloneObject(get(_defaultValues, name)));
1530
- } else {
1531
- setValue(name, options.defaultValue);
1532
- set(_defaultValues, name, cloneObject(options.defaultValue));
1533
- }
1534
- if (!options.keepTouched) {
1535
- unset(_formState.touchedFields, name);
1536
- }
1537
- if (!options.keepDirty) {
1538
- unset(_formState.dirtyFields, name);
1539
- _formState.isDirty = options.defaultValue ? _getDirty(name, cloneObject(get(_defaultValues, name))) : _getDirty();
1540
- }
1541
- if (!options.keepError) {
1542
- unset(_formState.errors, name);
1543
- _proxyFormState.isValid && _setValid();
1544
- }
1545
- _subjects.state.next({ ..._formState });
1546
- }
1547
- };
1548
- const _reset = (formValues, keepStateOptions = {}) => {
1549
- const updatedValues = formValues ? cloneObject(formValues) : _defaultValues;
1550
- const cloneUpdatedValues = cloneObject(updatedValues);
1551
- const isEmptyResetValues = isEmptyObject(formValues);
1552
- const values = isEmptyResetValues ? _defaultValues : cloneUpdatedValues;
1553
- if (!keepStateOptions.keepDefaultValues) {
1554
- _defaultValues = updatedValues;
1555
- }
1556
- if (!keepStateOptions.keepValues) {
1557
- if (keepStateOptions.keepDirtyValues) {
1558
- const fieldsToCheck = /* @__PURE__ */ new Set([
1559
- ..._names.mount,
1560
- ...Object.keys(getDirtyFields(_defaultValues, _formValues))
1561
- ]);
1562
- for (const fieldName of Array.from(fieldsToCheck)) {
1563
- const isDirty = get(_formState.dirtyFields, fieldName);
1564
- const existingValue = get(_formValues, fieldName);
1565
- const newValue = get(values, fieldName);
1566
- if (isDirty && !isUndefined(existingValue)) {
1567
- set(values, fieldName, existingValue);
1568
- } else if (!isDirty && !isUndefined(newValue)) {
1569
- setValue(fieldName, newValue);
1570
- }
1571
- }
1572
- } else {
1573
- if (isWeb && isUndefined(formValues)) {
1574
- for (const name of _names.mount) {
1575
- const field = get(_fields, name);
1576
- if (field && field._f) {
1577
- const fieldReference = Array.isArray(field._f.refs) ? field._f.refs[0] : field._f.ref;
1578
- if (isHTMLElement(fieldReference)) {
1579
- const form = fieldReference.closest("form");
1580
- if (form) {
1581
- form.reset();
1582
- break;
1583
- }
1584
- }
1585
- }
1586
- }
1587
- }
1588
- if (keepStateOptions.keepFieldsRef) {
1589
- for (const fieldName of _names.mount) {
1590
- setValue(fieldName, get(values, fieldName));
1591
- }
1592
- } else {
1593
- _fields = {};
1594
- }
1595
- }
1596
- _formValues = _options.shouldUnregister ? keepStateOptions.keepDefaultValues ? cloneObject(_defaultValues) : {} : cloneObject(values);
1597
- _subjects.array.next({
1598
- values: { ...values }
1599
- });
1600
- _subjects.state.next({
1601
- values: { ...values }
1602
- });
1603
- }
1604
- _names = {
1605
- mount: keepStateOptions.keepDirtyValues ? _names.mount : /* @__PURE__ */ new Set(),
1606
- unMount: /* @__PURE__ */ new Set(),
1607
- array: /* @__PURE__ */ new Set(),
1608
- disabled: /* @__PURE__ */ new Set(),
1609
- watch: /* @__PURE__ */ new Set(),
1610
- watchAll: false,
1611
- focus: ""
1612
- };
1613
- _state.mount = !_proxyFormState.isValid || !!keepStateOptions.keepIsValid || !!keepStateOptions.keepDirtyValues || !_options.shouldUnregister && !isEmptyObject(values);
1614
- _state.watch = !!_options.shouldUnregister;
1615
- _state.keepIsValid = !!keepStateOptions.keepIsValid;
1616
- _state.action = false;
1617
- if (!keepStateOptions.keepErrors) {
1618
- _formState.errors = {};
1619
- }
1620
- _subjects.state.next({
1621
- submitCount: keepStateOptions.keepSubmitCount ? _formState.submitCount : 0,
1622
- isDirty: isEmptyResetValues ? false : keepStateOptions.keepDirty ? _formState.isDirty : !!(keepStateOptions.keepDefaultValues && !deepEqual(formValues, _defaultValues)),
1623
- isSubmitted: keepStateOptions.keepIsSubmitted ? _formState.isSubmitted : false,
1624
- dirtyFields: isEmptyResetValues ? {} : keepStateOptions.keepDirtyValues ? keepStateOptions.keepDefaultValues && _formValues ? getDirtyFields(_defaultValues, _formValues) : _formState.dirtyFields : keepStateOptions.keepDefaultValues && formValues ? getDirtyFields(_defaultValues, formValues) : keepStateOptions.keepDirty ? _formState.dirtyFields : {},
1625
- touchedFields: keepStateOptions.keepTouched ? _formState.touchedFields : {},
1626
- errors: keepStateOptions.keepErrors ? _formState.errors : {},
1627
- isSubmitSuccessful: keepStateOptions.keepIsSubmitSuccessful ? _formState.isSubmitSuccessful : false,
1628
- isSubmitting: false,
1629
- defaultValues: _defaultValues
1630
- });
1631
- };
1632
- const reset = (formValues, keepStateOptions) => _reset(isFunction(formValues) ? formValues(_formValues) : formValues, { ..._options.resetOptions, ...keepStateOptions });
1633
- const setFocus = (name, options = {}) => {
1634
- const field = get(_fields, name);
1635
- const fieldReference = field && field._f;
1636
- if (fieldReference) {
1637
- const fieldRef = fieldReference.refs ? fieldReference.refs[0] : fieldReference.ref;
1638
- if (fieldRef.focus) {
1639
- setTimeout(() => {
1640
- fieldRef.focus();
1641
- options.shouldSelect && isFunction(fieldRef.select) && fieldRef.select();
1642
- });
1643
- }
1644
- }
1645
- };
1646
- const _setFormState = (updatedFormState) => {
1647
- _formState = {
1648
- ..._formState,
1649
- ...updatedFormState
1650
- };
1651
- };
1652
- const _resetDefaultValues = () => isFunction(_options.defaultValues) && _options.defaultValues().then((values) => {
1653
- reset(values, _options.resetOptions);
1654
- _subjects.state.next({
1655
- isLoading: false
1656
- });
1657
- });
1658
- const methods = {
1659
- control: {
1660
- register,
1661
- unregister,
1662
- getFieldState,
1663
- handleSubmit,
1664
- setError,
1665
- _subscribe,
1666
- _runSchema,
1667
- _updateIsValidating,
1668
- _focusError,
1669
- _getWatch,
1670
- _getDirty,
1671
- _setValid,
1672
- _setFieldArray,
1673
- _setDisabledField,
1674
- _setErrors,
1675
- _getFieldArray,
1676
- _reset,
1677
- _resetDefaultValues,
1678
- _removeUnmounted,
1679
- _disableForm,
1680
- _subjects,
1681
- _proxyFormState,
1682
- get _fields() {
1683
- return _fields;
1684
- },
1685
- get _formValues() {
1686
- return _formValues;
1687
- },
1688
- get _state() {
1689
- return _state;
1690
- },
1691
- set _state(value) {
1692
- _state = value;
1693
- },
1694
- get _defaultValues() {
1695
- return _defaultValues;
1696
- },
1697
- get _names() {
1698
- return _names;
1699
- },
1700
- set _names(value) {
1701
- _names = value;
1702
- },
1703
- get _formState() {
1704
- return _formState;
1705
- },
1706
- get _options() {
1707
- return _options;
1708
- },
1709
- set _options(value) {
1710
- _options = {
1711
- ..._options,
1712
- ...value
1713
- };
1714
- }
1715
- },
1716
- subscribe,
1717
- trigger,
1718
- register,
1719
- handleSubmit,
1720
- watch,
1721
- setValue,
1722
- getValues,
1723
- reset,
1724
- resetField,
1725
- clearErrors,
1726
- unregister,
1727
- setError,
1728
- setFocus,
1729
- getFieldState
1730
- };
1731
- return {
1732
- ...methods,
1733
- formControl: methods
1734
- };
1735
- }
1736
- var generateId = () => {
1737
- if (typeof crypto !== "undefined" && crypto.randomUUID) {
1738
- return crypto.randomUUID();
1739
- }
1740
- const d = typeof performance === "undefined" ? Date.now() : performance.now() * 1e3;
1741
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
1742
- const r = (Math.random() * 16 + d) % 16 | 0;
1743
- return (c == "x" ? r : r & 3 | 8).toString(16);
1744
- });
1745
- };
1746
- var getFocusFieldName = (name, index, options = {}) => options.shouldFocus || isUndefined(options.shouldFocus) ? options.focusName || `${name}.${isUndefined(options.focusIndex) ? index : options.focusIndex}.` : "";
1747
- var appendAt = (data, value) => [
1748
- ...data,
1749
- ...convertToArrayPayload(value)
1750
- ];
1751
- var fillEmptyArray = (value) => Array.isArray(value) ? value.map(() => void 0) : void 0;
1752
- function insert(data, index, value) {
1753
- return [
1754
- ...data.slice(0, index),
1755
- ...convertToArrayPayload(value),
1756
- ...data.slice(index)
1757
- ];
1758
- }
1759
- var moveArrayAt = (data, from, to) => {
1760
- if (!Array.isArray(data)) {
1761
- return [];
1762
- }
1763
- if (isUndefined(data[to])) {
1764
- data[to] = void 0;
1765
- }
1766
- data.splice(to, 0, data.splice(from, 1)[0]);
1767
- return data;
1768
- };
1769
- var prependAt = (data, value) => [
1770
- ...convertToArrayPayload(value),
1771
- ...convertToArrayPayload(data)
1772
- ];
1773
- function removeAtIndexes(data, indexes) {
1774
- let i = 0;
1775
- const temp = [...data];
1776
- for (const index of indexes) {
1777
- temp.splice(index - i, 1);
1778
- i++;
1779
- }
1780
- return compact(temp).length ? temp : [];
1781
- }
1782
- var removeArrayAt = (data, index) => isUndefined(index) ? [] : removeAtIndexes(data, convertToArrayPayload(index).sort((a, b) => a - b));
1783
- var swapArrayAt = (data, indexA, indexB) => {
1784
- [data[indexA], data[indexB]] = [data[indexB], data[indexA]];
1785
- };
1786
- var updateAt = (fieldValues, index, value) => {
1787
- fieldValues[index] = value;
1788
- return fieldValues;
1789
- };
1790
- function useFieldArray(props) {
1791
- const formControl = useFormControlContext();
1792
- const { control = formControl, name, keyName = "id", shouldUnregister, rules } = props;
1793
- const [fields, setFields] = React__default.useState(control._getFieldArray(name));
1794
- const ids = React__default.useRef(control._getFieldArray(name).map(generateId));
1795
- const _actioned = React__default.useRef(false);
1796
- control._names.array.add(name);
1797
- React__default.useMemo(() => rules && fields.length >= 0 && control.register(name, rules), [control, name, fields.length, rules]);
1798
- useIsomorphicLayoutEffect(() => control._subjects.array.subscribe({
1799
- next: ({ values, name: fieldArrayName }) => {
1800
- if (fieldArrayName === name || !fieldArrayName) {
1801
- const fieldValues = get(values, name);
1802
- if (Array.isArray(fieldValues)) {
1803
- setFields(fieldValues);
1804
- ids.current = fieldValues.map(generateId);
1805
- }
1806
- }
1807
- }
1808
- }).unsubscribe, [control, name]);
1809
- const updateValues = React__default.useCallback((updatedFieldArrayValues) => {
1810
- _actioned.current = true;
1811
- control._setFieldArray(name, updatedFieldArrayValues);
1812
- }, [control, name]);
1813
- const append = (value, options) => {
1814
- const appendValue = convertToArrayPayload(cloneObject(value));
1815
- const updatedFieldArrayValues = appendAt(control._getFieldArray(name), appendValue);
1816
- control._names.focus = getFocusFieldName(name, updatedFieldArrayValues.length - 1, options);
1817
- ids.current = appendAt(ids.current, appendValue.map(generateId));
1818
- updateValues(updatedFieldArrayValues);
1819
- setFields(updatedFieldArrayValues);
1820
- control._setFieldArray(name, updatedFieldArrayValues, appendAt, {
1821
- argA: fillEmptyArray(value)
1822
- });
1823
- };
1824
- const prepend = (value, options) => {
1825
- const prependValue = convertToArrayPayload(cloneObject(value));
1826
- const updatedFieldArrayValues = prependAt(control._getFieldArray(name), prependValue);
1827
- control._names.focus = getFocusFieldName(name, 0, options);
1828
- ids.current = prependAt(ids.current, prependValue.map(generateId));
1829
- updateValues(updatedFieldArrayValues);
1830
- setFields(updatedFieldArrayValues);
1831
- control._setFieldArray(name, updatedFieldArrayValues, prependAt, {
1832
- argA: fillEmptyArray(value)
1833
- });
1834
- };
1835
- const remove = (index) => {
1836
- const updatedFieldArrayValues = removeArrayAt(control._getFieldArray(name), index);
1837
- ids.current = removeArrayAt(ids.current, index);
1838
- updateValues(updatedFieldArrayValues);
1839
- setFields(updatedFieldArrayValues);
1840
- !Array.isArray(get(control._fields, name)) && set(control._fields, name, void 0);
1841
- control._setFieldArray(name, updatedFieldArrayValues, removeArrayAt, {
1842
- argA: index
1843
- });
1844
- };
1845
- const insert$1 = (index, value, options) => {
1846
- const insertValue = convertToArrayPayload(cloneObject(value));
1847
- const updatedFieldArrayValues = insert(control._getFieldArray(name), index, insertValue);
1848
- control._names.focus = getFocusFieldName(name, index, options);
1849
- ids.current = insert(ids.current, index, insertValue.map(generateId));
1850
- updateValues(updatedFieldArrayValues);
1851
- setFields(updatedFieldArrayValues);
1852
- control._setFieldArray(name, updatedFieldArrayValues, insert, {
1853
- argA: index,
1854
- argB: fillEmptyArray(value)
1855
- });
1856
- };
1857
- const swap = (indexA, indexB) => {
1858
- const updatedFieldArrayValues = control._getFieldArray(name);
1859
- swapArrayAt(updatedFieldArrayValues, indexA, indexB);
1860
- swapArrayAt(ids.current, indexA, indexB);
1861
- updateValues(updatedFieldArrayValues);
1862
- setFields(updatedFieldArrayValues);
1863
- control._setFieldArray(name, updatedFieldArrayValues, swapArrayAt, {
1864
- argA: indexA,
1865
- argB: indexB
1866
- }, false);
1867
- };
1868
- const move = (from, to) => {
1869
- const updatedFieldArrayValues = control._getFieldArray(name);
1870
- moveArrayAt(updatedFieldArrayValues, from, to);
1871
- moveArrayAt(ids.current, from, to);
1872
- updateValues(updatedFieldArrayValues);
1873
- setFields(updatedFieldArrayValues);
1874
- control._setFieldArray(name, updatedFieldArrayValues, moveArrayAt, {
1875
- argA: from,
1876
- argB: to
1877
- }, false);
1878
- };
1879
- const update = (index, value) => {
1880
- const updateValue = cloneObject(value);
1881
- const updatedFieldArrayValues = updateAt(control._getFieldArray(name), index, updateValue);
1882
- ids.current = [...updatedFieldArrayValues].map((item, i) => !item || i === index ? generateId() : ids.current[i]);
1883
- updateValues(updatedFieldArrayValues);
1884
- setFields([...updatedFieldArrayValues]);
1885
- control._setFieldArray(name, updatedFieldArrayValues, updateAt, {
1886
- argA: index,
1887
- argB: updateValue
1888
- }, true, false);
1889
- };
1890
- const replace = (value) => {
1891
- const updatedFieldArrayValues = convertToArrayPayload(cloneObject(value));
1892
- ids.current = updatedFieldArrayValues.map(generateId);
1893
- updateValues([...updatedFieldArrayValues]);
1894
- setFields([...updatedFieldArrayValues]);
1895
- control._setFieldArray(name, [...updatedFieldArrayValues], (data) => data, {}, true, false);
1896
- };
1897
- React__default.useEffect(() => {
1898
- control._state.action = false;
1899
- isWatched(name, control._names) && control._subjects.state.next({
1900
- ...control._formState
1901
- });
1902
- if (_actioned.current && (!getValidationModes(control._options.mode).isOnSubmit || control._formState.isSubmitted) && !getValidationModes(control._options.reValidateMode).isOnSubmit) {
1903
- if (control._options.resolver) {
1904
- control._runSchema([name]).then((result) => {
1905
- control._updateIsValidating([name]);
1906
- const error = get(result.errors, name);
1907
- const existingError = get(control._formState.errors, name);
1908
- if (existingError ? !error && existingError.type || error && (existingError.type !== error.type || existingError.message !== error.message) : error && error.type) {
1909
- error ? set(control._formState.errors, name, error) : unset(control._formState.errors, name);
1910
- control._subjects.state.next({
1911
- errors: control._formState.errors
1912
- });
1913
- }
1914
- });
1915
- } else {
1916
- const field = get(control._fields, name);
1917
- if (field && field._f && !(getValidationModes(control._options.reValidateMode).isOnSubmit && getValidationModes(control._options.mode).isOnSubmit)) {
1918
- validateField(field, control._names.disabled, control._formValues, control._options.criteriaMode === VALIDATION_MODE.all, control._options.shouldUseNativeValidation, true).then((error) => !isEmptyObject(error) && control._subjects.state.next({
1919
- errors: updateFieldArrayRootError(control._formState.errors, error, name)
1920
- }));
1921
- }
1922
- }
1923
- }
1924
- control._subjects.state.next({
1925
- name,
1926
- values: cloneObject(control._formValues)
1927
- });
1928
- control._names.focus && iterateFieldsByAction(control._fields, (ref, key) => {
1929
- if (control._names.focus && key.startsWith(control._names.focus) && ref.focus) {
1930
- ref.focus();
1931
- return 1;
1932
- }
1933
- return;
1934
- });
1935
- control._names.focus = "";
1936
- control._setValid();
1937
- _actioned.current = false;
1938
- }, [fields, name, control]);
1939
- React__default.useEffect(() => {
1940
- !get(control._formValues, name) && control._setFieldArray(name);
1941
- return () => {
1942
- const updateMounted = (name2, value) => {
1943
- const field = get(control._fields, name2);
1944
- if (field && field._f) {
1945
- field._f.mount = value;
1946
- }
1947
- };
1948
- control._options.shouldUnregister || shouldUnregister ? control.unregister(name) : updateMounted(name, false);
1949
- };
1950
- }, [name, control, keyName, shouldUnregister]);
1951
- return {
1952
- swap: React__default.useCallback(swap, [updateValues, name, control]),
1953
- move: React__default.useCallback(move, [updateValues, name, control]),
1954
- prepend: React__default.useCallback(prepend, [updateValues, name, control]),
1955
- append: React__default.useCallback(append, [updateValues, name, control]),
1956
- remove: React__default.useCallback(remove, [updateValues, name, control]),
1957
- insert: React__default.useCallback(insert$1, [updateValues, name, control]),
1958
- update: React__default.useCallback(update, [updateValues, name, control]),
1959
- replace: React__default.useCallback(replace, [updateValues, name, control]),
1960
- fields: React__default.useMemo(() => fields.map((field, index) => ({
1961
- ...field,
1962
- [keyName]: ids.current[index] || generateId()
1963
- })), [fields, keyName])
1964
- };
1965
- }
1966
- function useForm(props = {}) {
1967
- const _formControl = React__default.useRef(void 0);
1968
- const _values = React__default.useRef(void 0);
1969
- const [formState, updateFormState] = React__default.useState({
1970
- isDirty: false,
1971
- isValidating: false,
1972
- isLoading: isFunction(props.defaultValues),
1973
- isSubmitted: false,
1974
- isSubmitting: false,
1975
- isSubmitSuccessful: false,
1976
- isValid: false,
1977
- submitCount: 0,
1978
- dirtyFields: {},
1979
- touchedFields: {},
1980
- validatingFields: {},
1981
- errors: props.errors || {},
1982
- disabled: props.disabled || false,
1983
- isReady: false,
1984
- defaultValues: isFunction(props.defaultValues) ? void 0 : props.defaultValues
1985
- });
1986
- if (!_formControl.current) {
1987
- if (props.formControl) {
1988
- _formControl.current = {
1989
- ...props.formControl,
1990
- formState
1991
- };
1992
- if (props.defaultValues && !isFunction(props.defaultValues)) {
1993
- props.formControl.reset(props.defaultValues, props.resetOptions);
1994
- }
1995
- } else {
1996
- const { formControl, ...rest } = createFormControl(props);
1997
- _formControl.current = {
1998
- ...rest,
1999
- formState
2000
- };
2001
- }
2002
- }
2003
- const control = _formControl.current.control;
2004
- control._options = props;
2005
- useIsomorphicLayoutEffect(() => {
2006
- const sub = control._subscribe({
2007
- formState: control._proxyFormState,
2008
- callback: () => updateFormState({ ...control._formState }),
2009
- reRenderRoot: true
2010
- });
2011
- updateFormState((data) => ({
2012
- ...data,
2013
- isReady: true
2014
- }));
2015
- control._formState.isReady = true;
2016
- return sub;
2017
- }, [control]);
2018
- React__default.useEffect(() => control._disableForm(props.disabled), [control, props.disabled]);
2019
- React__default.useEffect(() => {
2020
- if (props.mode) {
2021
- control._options.mode = props.mode;
2022
- }
2023
- if (props.reValidateMode) {
2024
- control._options.reValidateMode = props.reValidateMode;
2025
- }
2026
- }, [control, props.mode, props.reValidateMode]);
2027
- React__default.useEffect(() => {
2028
- if (props.errors) {
2029
- control._setErrors(props.errors);
2030
- control._focusError();
2031
- }
2032
- }, [control, props.errors]);
2033
- React__default.useEffect(() => {
2034
- props.shouldUnregister && control._subjects.state.next({
2035
- values: control._getWatch()
2036
- });
2037
- }, [control, props.shouldUnregister]);
2038
- React__default.useEffect(() => {
2039
- if (control._proxyFormState.isDirty) {
2040
- const isDirty = control._getDirty();
2041
- if (isDirty !== formState.isDirty) {
2042
- control._subjects.state.next({
2043
- isDirty
2044
- });
2045
- }
2046
- }
2047
- }, [control, formState.isDirty]);
2048
- React__default.useEffect(() => {
2049
- var _a;
2050
- if (props.values && !deepEqual(props.values, _values.current)) {
2051
- control._reset(props.values, {
2052
- keepFieldsRef: true,
2053
- ...control._options.resetOptions
2054
- });
2055
- if (!((_a = control._options.resetOptions) === null || _a === void 0 ? void 0 : _a.keepIsValid)) {
2056
- control._setValid();
2057
- }
2058
- _values.current = props.values;
2059
- updateFormState((state) => ({ ...state }));
2060
- } else {
2061
- control._resetDefaultValues();
2062
- }
2063
- }, [control, props.values]);
2064
- React__default.useEffect(() => {
2065
- if (!control._state.mount) {
2066
- control._setValid();
2067
- control._state.mount = true;
2068
- }
2069
- if (control._state.watch) {
2070
- control._state.watch = false;
2071
- control._subjects.state.next({ ...control._formState });
2072
- }
2073
- control._removeUnmounted();
2074
- });
2075
- _formControl.current.formState = React__default.useMemo(() => getProxyFormState(formState, control), [control, formState]);
2076
- return _formControl.current;
2077
- }
2078
- export {
2079
- Controller,
2080
- appendErrors,
2081
- createFormControl,
2082
- get,
2083
- set,
2084
- useController,
2085
- useFieldArray,
2086
- useForm,
2087
- useFormState,
2088
- useWatch
2089
- };