ezux 1.0.0

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 (293) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +56 -0
  3. package/dist/EzEventModal-DtpvYwGr.js +684 -0
  4. package/dist/EzGroupingPanel-CFwKUrF_.js +59 -0
  5. package/dist/EzTableEditDialog-BIk_mNpI.js +60 -0
  6. package/dist/components/EzKanban/EzKanban.types.d.ts +789 -0
  7. package/dist/components/EzKanban/components/CardEditorModal.d.ts +23 -0
  8. package/dist/components/EzKanban/components/EzKanbanErrorFallback.d.ts +1 -0
  9. package/dist/components/EzKanban/components/FilterPopover.d.ts +10 -0
  10. package/dist/components/EzKanban/components/KanbanBoard.d.ts +62 -0
  11. package/dist/components/EzKanban/components/KanbanCard.d.ts +38 -0
  12. package/dist/components/EzKanban/components/KanbanColumn.d.ts +55 -0
  13. package/dist/components/EzKanban/components/KanbanSwimlane.d.ts +46 -0
  14. package/dist/components/EzKanban/components/KanbanToolbar.d.ts +41 -0
  15. package/dist/components/EzKanban/exports.d.ts +4 -0
  16. package/dist/components/EzKanban/hooks/useKanbanCards.d.ts +36 -0
  17. package/dist/components/EzKanban/hooks/useKanbanColumns.d.ts +27 -0
  18. package/dist/components/EzKanban/hooks/useKanbanDragDrop.d.ts +31 -0
  19. package/dist/components/EzKanban/hooks/useKanbanFilters.d.ts +23 -0
  20. package/dist/components/EzKanban/hooks/useKanbanState.d.ts +79 -0
  21. package/dist/components/EzKanban/hooks/useKanbanSwimlanes.d.ts +27 -0
  22. package/dist/components/EzKanban/hooks/useKanbanVirtualization.d.ts +16 -0
  23. package/dist/components/EzKanban/index.d.ts +45 -0
  24. package/dist/components/EzKanban/services/KanbanService.d.ts +30 -0
  25. package/dist/components/EzKanban/state/kanban.store.d.ts +33 -0
  26. package/dist/components/EzKanban/useEzKanban.d.ts +162 -0
  27. package/dist/components/EzKanban/views/KanbanTimelineView.d.ts +15 -0
  28. package/dist/components/EzLayout/Authentication/AuthSlider.d.ts +13 -0
  29. package/dist/components/EzLayout/Authentication/InputPassword.d.ts +7 -0
  30. package/dist/components/EzLayout/Authentication/SignInForm.d.ts +21 -0
  31. package/dist/components/EzLayout/Authentication/SignUpForm.d.ts +20 -0
  32. package/dist/components/EzLayout/EzHeader.d.ts +33 -0
  33. package/dist/components/EzLayout/EzLanguageSwitcher.d.ts +4 -0
  34. package/dist/components/EzLayout/EzLayout.types.d.ts +223 -0
  35. package/dist/components/EzLayout/EzSidebar.d.ts +14 -0
  36. package/dist/components/EzLayout/EzThemeColorChanger.d.ts +9 -0
  37. package/dist/components/EzLayout/EzThemeSwitcher.d.ts +8 -0
  38. package/dist/components/EzLayout/EzUserProfile.d.ts +23 -0
  39. package/dist/components/EzLayout/components/MainContent.d.ts +13 -0
  40. package/dist/components/EzLayout/hooks/useLayoutImperative.d.ts +17 -0
  41. package/dist/components/EzLayout/hooks/useLayoutState.d.ts +25 -0
  42. package/dist/components/EzLayout/index.d.ts +19 -0
  43. package/dist/components/EzLayout/useEzLayout.d.ts +26 -0
  44. package/dist/components/EzScheduler/EzScheduler.types.d.ts +1658 -0
  45. package/dist/components/EzScheduler/EzSchedulerToolbar.d.ts +117 -0
  46. package/dist/components/EzScheduler/components/EzEventModal.d.ts +17 -0
  47. package/dist/components/EzScheduler/components/EzOverlapAlert.d.ts +12 -0
  48. package/dist/components/EzScheduler/components/EzQuickInfoPopup.d.ts +22 -0
  49. package/dist/components/EzScheduler/components/EzResourceSidebar.d.ts +33 -0
  50. package/dist/components/EzScheduler/components/EzSchedulerContent.d.ts +123 -0
  51. package/dist/components/EzScheduler/components/EzSchedulerQuickAdd.d.ts +17 -0
  52. package/dist/components/EzScheduler/components/RecurrenceEditor.d.ts +7 -0
  53. package/dist/components/EzScheduler/components/SchedulerLoadingSpinner.d.ts +2 -0
  54. package/dist/components/EzScheduler/components/dnd/DraggableEvent.d.ts +21 -0
  55. package/dist/components/EzScheduler/components/dnd/DroppableSlot.d.ts +19 -0
  56. package/dist/components/EzScheduler/hooks/useRecurrence.d.ts +2 -0
  57. package/dist/components/EzScheduler/hooks/useSchedulerEventHandlers.d.ts +11 -0
  58. package/dist/components/EzScheduler/hooks/useSchedulerEvents.d.ts +26 -0
  59. package/dist/components/EzScheduler/hooks/useSchedulerImperative.d.ts +15 -0
  60. package/dist/components/EzScheduler/hooks/useSchedulerNavigation.d.ts +9 -0
  61. package/dist/components/EzScheduler/hooks/useSchedulerResources.d.ts +10 -0
  62. package/dist/components/EzScheduler/hooks/useSchedulerState.d.ts +14 -0
  63. package/dist/components/EzScheduler/hooks/useSchedulerVirtualization.d.ts +9 -0
  64. package/dist/components/EzScheduler/index.d.ts +41 -0
  65. package/dist/components/EzScheduler/models/EventSettings.d.ts +11 -0
  66. package/dist/components/EzScheduler/models/View.d.ts +49 -0
  67. package/dist/components/EzScheduler/models/index.d.ts +2 -0
  68. package/dist/components/EzScheduler/services/AttendeeService.d.ts +15 -0
  69. package/dist/components/EzScheduler/services/AuditService.d.ts +15 -0
  70. package/dist/components/EzScheduler/services/CollisionDetectionService.d.ts +19 -0
  71. package/dist/components/EzScheduler/services/DragAndDropService.d.ts +16 -0
  72. package/dist/components/EzScheduler/services/HistoryService.d.ts +31 -0
  73. package/dist/components/EzScheduler/services/ICalendarImportService.d.ts +16 -0
  74. package/dist/components/EzScheduler/services/PrintService.d.ts +7 -0
  75. package/dist/components/EzScheduler/services/RecurrenceEngine.d.ts +7 -0
  76. package/dist/components/EzScheduler/services/ReminderService.d.ts +17 -0
  77. package/dist/components/EzScheduler/services/SchedulerService.d.ts +69 -0
  78. package/dist/components/EzScheduler/services/SearchService.d.ts +11 -0
  79. package/dist/components/EzScheduler/services/SecurityService.d.ts +25 -0
  80. package/dist/components/EzScheduler/services/TimezoneService.d.ts +20 -0
  81. package/dist/components/EzScheduler/services/VirtualScrollingService.d.ts +34 -0
  82. package/dist/components/EzScheduler/state/scheduler.store.d.ts +27 -0
  83. package/dist/components/EzScheduler/templates/CellTemplate.d.ts +42 -0
  84. package/dist/components/EzScheduler/templates/EditorTemplate.d.ts +32 -0
  85. package/dist/components/EzScheduler/templates/HeaderTemplate.d.ts +36 -0
  86. package/dist/components/EzScheduler/tests/phase1_rendering.spec.d.ts +1 -0
  87. package/dist/components/EzScheduler/tests/phase2_events.spec.d.ts +1 -0
  88. package/dist/components/EzScheduler/tests/phase3_templates.spec.d.ts +1 -0
  89. package/dist/components/EzScheduler/tests/phase4_export.spec.d.ts +1 -0
  90. package/dist/components/EzScheduler/tests/phase5_advanced.spec.d.ts +1 -0
  91. package/dist/components/EzScheduler/tests/phase6_security.spec.d.ts +1 -0
  92. package/dist/components/EzScheduler/tests/phase7_regression.spec.d.ts +1 -0
  93. package/dist/components/EzScheduler/useEzScheduler.d.ts +152 -0
  94. package/dist/components/EzScheduler/utils/createDragConstraint.d.ts +7 -0
  95. package/dist/components/EzScheduler/utils/getWeekNumber.d.ts +8 -0
  96. package/dist/components/EzScheduler/utils/sanitizeHtml.d.ts +17 -0
  97. package/dist/components/EzScheduler/views/AgendaView.d.ts +33 -0
  98. package/dist/components/EzScheduler/views/DayWeekView.d.ts +182 -0
  99. package/dist/components/EzScheduler/views/MonthView.d.ts +65 -0
  100. package/dist/components/EzScheduler/views/TimelineView.d.ts +121 -0
  101. package/dist/components/EzSignature/EzSignature.d.ts +42 -0
  102. package/dist/components/EzSignature/EzSignature.test.d.ts +1 -0
  103. package/dist/components/EzSignature/EzSignature.types.d.ts +132 -0
  104. package/dist/components/EzSignature/index.d.ts +2 -0
  105. package/dist/components/EzTable/EzColumnMenu.d.ts +7 -0
  106. package/dist/components/EzTable/EzDateFilterTree.d.ts +7 -0
  107. package/dist/components/EzTable/EzExcelFilter.d.ts +6 -0
  108. package/dist/components/EzTable/EzFilterBuilder.d.ts +12 -0
  109. package/dist/components/EzTable/EzGroupingPanel.d.ts +9 -0
  110. package/dist/components/EzTable/EzHeaderContextMenu.d.ts +8 -0
  111. package/dist/components/EzTable/EzPagination.d.ts +19 -0
  112. package/dist/components/EzTable/EzTable.types.d.ts +1481 -0
  113. package/dist/components/EzTable/EzTableEditDialog.d.ts +15 -0
  114. package/dist/components/EzTable/EzTableFooter.d.ts +10 -0
  115. package/dist/components/EzTable/EzTableOverlays.d.ts +11 -0
  116. package/dist/components/EzTable/EzTableStatusBar.d.ts +6 -0
  117. package/dist/components/EzTable/EzTableToolbar.d.ts +58 -0
  118. package/dist/components/EzTable/SmartCell.d.ts +7 -0
  119. package/dist/components/EzTable/__tests__/EzTableDX.test.d.ts +0 -0
  120. package/dist/components/EzTable/__tests__/EzTableEnterprise.test.d.ts +1 -0
  121. package/dist/components/EzTable/__tests__/useEzTable.test.d.ts +1 -0
  122. package/dist/components/EzTable/components/AdvancedColumnFilter.d.ts +16 -0
  123. package/dist/components/EzTable/components/BooleanFilterSection.d.ts +7 -0
  124. package/dist/components/EzTable/components/DraggableHeader.d.ts +10 -0
  125. package/dist/components/EzTable/components/EzTableBodySection.d.ts +70 -0
  126. package/dist/components/EzTable/components/EzTableCell.d.ts +46 -0
  127. package/dist/components/EzTable/components/EzTableHeaderSection.d.ts +22 -0
  128. package/dist/components/EzTable/components/EzTablePaginationSection.d.ts +31 -0
  129. package/dist/components/EzTable/components/EzTableRow.d.ts +56 -0
  130. package/dist/components/EzTable/components/FilterActionButtons.d.ts +16 -0
  131. package/dist/components/EzTable/components/FilterRuleSelect.d.ts +26 -0
  132. package/dist/components/EzTable/components/SelectAllCheckbox.d.ts +21 -0
  133. package/dist/components/EzTable/components/SelectFilterSection.d.ts +18 -0
  134. package/dist/components/EzTable/components/VirtualizedFilterList.d.ts +21 -0
  135. package/dist/components/EzTable/constants/filterOptions.d.ts +47 -0
  136. package/dist/components/EzTable/context/EzTableContext.d.ts +10 -0
  137. package/dist/components/EzTable/context/TableConfigContext.d.ts +13 -0
  138. package/dist/components/EzTable/context/TableStore.d.ts +17 -0
  139. package/dist/components/EzTable/filterUtils.d.ts +5 -0
  140. package/dist/components/EzTable/hooks/useAutoFit.d.ts +4 -0
  141. package/dist/components/EzTable/hooks/useCellEventHandlers.d.ts +16 -0
  142. package/dist/components/EzTable/hooks/useColumnSizeVars.d.ts +6 -0
  143. package/dist/components/EzTable/hooks/useContainerResize.d.ts +11 -0
  144. package/dist/components/EzTable/hooks/useDialogStateInitialization.d.ts +8 -0
  145. package/dist/components/EzTable/hooks/useFilterSelection.d.ts +12 -0
  146. package/dist/components/EzTable/hooks/useTableFiltering.d.ts +23 -0
  147. package/dist/components/EzTable/hooks/useTableHistory.d.ts +87 -0
  148. package/dist/components/EzTable/hooks/useTableImperative.d.ts +42 -0
  149. package/dist/components/EzTable/hooks/useTableSelection.d.ts +32 -0
  150. package/dist/components/EzTable/hooks/useTableState.d.ts +31 -0
  151. package/dist/components/EzTable/hooks/useTableVirtualization.d.ts +33 -0
  152. package/dist/components/EzTable/index.d.ts +50 -0
  153. package/dist/components/EzTable/renderers/index.d.ts +6 -0
  154. package/dist/components/EzTable/services/TableService.d.ts +26 -0
  155. package/dist/components/EzTable/useEzTable.d.ts +17 -0
  156. package/dist/components/EzTable/utils/TextMeasurer.d.ts +1 -0
  157. package/dist/components/EzTable/utils/TruncatedTooltip.d.ts +7 -0
  158. package/dist/components/EzTable/utils/columnTypeDetector.d.ts +5 -0
  159. package/dist/components/EzTable/utils/filterTypeGuards.d.ts +3 -0
  160. package/dist/components/EzTable/utils/index.d.ts +1 -0
  161. package/dist/components/EzTreeView/EzTreeView.types.d.ts +395 -0
  162. package/dist/components/EzTreeView/EzTreeViewItem.d.ts +77 -0
  163. package/dist/components/EzTreeView/EzVirtualTree.d.ts +72 -0
  164. package/dist/components/EzTreeView/components/EzTreeViewLoadingSpinner.d.ts +2 -0
  165. package/dist/components/EzTreeView/hooks/useTreeDragDrop.d.ts +31 -0
  166. package/dist/components/EzTreeView/hooks/useTreeExpansion.d.ts +21 -0
  167. package/dist/components/EzTreeView/hooks/useTreeImperative.d.ts +28 -0
  168. package/dist/components/EzTreeView/hooks/useTreeSelection.d.ts +31 -0
  169. package/dist/components/EzTreeView/hooks/useTreeState.d.ts +21 -0
  170. package/dist/components/EzTreeView/hooks/useTreeVirtualization.d.ts +18 -0
  171. package/dist/components/EzTreeView/index.d.ts +40 -0
  172. package/dist/components/EzTreeView/services/TreeService.d.ts +11 -0
  173. package/dist/components/EzTreeView/useEzTreeView.d.ts +62 -0
  174. package/dist/components/EzTreeView/utils/treeUtils.d.ts +17 -0
  175. package/dist/components/shared/components/EzErrorBoundary.d.ts +18 -0
  176. package/dist/components/shared/components/EzLayoutErrorFallback.d.ts +2 -0
  177. package/dist/components/shared/components/EzLoadingSpinner.d.ts +8 -0
  178. package/dist/components/shared/components/EzSchedulerErrorFallback.d.ts +2 -0
  179. package/dist/components/shared/components/EzTableErrorFallback.d.ts +2 -0
  180. package/dist/components/shared/components/EzTreeViewErrorFallback.d.ts +2 -0
  181. package/dist/components/ui/avatar.d.ts +5 -0
  182. package/dist/components/ui/badge.d.ts +9 -0
  183. package/dist/components/ui/breadcrumb.d.ts +19 -0
  184. package/dist/components/ui/button.d.ts +12 -0
  185. package/dist/components/ui/calendar.d.ts +15 -0
  186. package/dist/components/ui/card.d.ts +8 -0
  187. package/dist/components/ui/checkbox.d.ts +7 -0
  188. package/dist/components/ui/command.d.ts +78 -0
  189. package/dist/components/ui/context-menu.d.ts +27 -0
  190. package/dist/components/ui/date-time-picker.d.ts +13 -0
  191. package/dist/components/ui/dropdown-menu.d.ts +27 -0
  192. package/dist/components/ui/index.d.ts +26 -0
  193. package/dist/components/ui/input.d.ts +5 -0
  194. package/dist/components/ui/label.d.ts +5 -0
  195. package/dist/components/ui/modal.d.ts +9 -0
  196. package/dist/components/ui/password-input.d.ts +5 -0
  197. package/dist/components/ui/popover.d.ts +4 -0
  198. package/dist/components/ui/progress.d.ts +7 -0
  199. package/dist/components/ui/radio-group.d.ts +5 -0
  200. package/dist/components/ui/scroll-area.d.ts +5 -0
  201. package/dist/components/ui/select.d.ts +24 -0
  202. package/dist/components/ui/skeleton.d.ts +2 -0
  203. package/dist/components/ui/switch.d.ts +4 -0
  204. package/dist/components/ui/table.d.ts +10 -0
  205. package/dist/components/ui/tabs.d.ts +14 -0
  206. package/dist/components/ui/textarea.d.ts +5 -0
  207. package/dist/components/ui/tooltip.d.ts +7 -0
  208. package/dist/ezux.es.js +149 -0
  209. package/dist/ezux.umd.js +68 -0
  210. package/dist/index-DBwoXp4n.js +30656 -0
  211. package/dist/index.d.ts +70 -0
  212. package/dist/lib/perfect-freehand.d.ts +221 -0
  213. package/dist/lib/utils.d.ts +2 -0
  214. package/dist/shared/components/AnimatedText.d.ts +44 -0
  215. package/dist/shared/components/BaseCell.d.ts +14 -0
  216. package/dist/shared/components/BooleanRenderer.d.ts +34 -0
  217. package/dist/shared/components/ChartRenderer.d.ts +19 -0
  218. package/dist/shared/components/DeleteConfirmationModal.d.ts +11 -0
  219. package/dist/shared/components/EzContextMenu.d.ts +12 -0
  220. package/dist/shared/components/EzNotificationDropdown.d.ts +1 -0
  221. package/dist/shared/components/HighlightText.d.ts +4 -0
  222. package/dist/shared/components/Modal.d.ts +13 -0
  223. package/dist/shared/components/NotificationPanel.d.ts +2 -0
  224. package/dist/shared/components/PrimitiveRenderer.d.ts +39 -0
  225. package/dist/shared/components/SearchableSelect.d.ts +13 -0
  226. package/dist/shared/components/SelectRenderer.d.ts +33 -0
  227. package/dist/shared/components/StatusBadge.d.ts +12 -0
  228. package/dist/shared/components/TooltipWrapper.d.ts +12 -0
  229. package/dist/shared/components/index.d.ts +9 -0
  230. package/dist/shared/hooks/index.d.ts +56 -0
  231. package/dist/shared/hooks/useBaseComponent.d.ts +60 -0
  232. package/dist/shared/hooks/useComponentImperativeAPI.d.ts +11 -0
  233. package/dist/shared/hooks/useComponentState.d.ts +39 -0
  234. package/dist/shared/hooks/useCurrentTime.d.ts +6 -0
  235. package/dist/shared/hooks/useDataChangeEvents.d.ts +53 -0
  236. package/dist/shared/hooks/useDebounce.d.ts +10 -0
  237. package/dist/shared/hooks/useDeleteConfirmation.d.ts +9 -0
  238. package/dist/shared/hooks/useDialogState.d.ts +21 -0
  239. package/dist/shared/hooks/useDndHandlers.d.ts +17 -0
  240. package/dist/shared/hooks/useEditing.d.ts +107 -0
  241. package/dist/shared/hooks/useEventHandlers.d.ts +61 -0
  242. package/dist/shared/hooks/useEzTheme.d.ts +22 -0
  243. package/dist/shared/hooks/useFieldValidation.d.ts +24 -0
  244. package/dist/shared/hooks/useHistory.d.ts +13 -0
  245. package/dist/shared/hooks/useI18n.d.ts +9 -0
  246. package/dist/shared/hooks/useImperativeAPI.d.ts +8 -0
  247. package/dist/shared/hooks/useInitCoreServices.d.ts +5 -0
  248. package/dist/shared/hooks/useKeyboardNavigation.d.ts +36 -0
  249. package/dist/shared/hooks/useKeyboardShortcuts.d.ts +14 -0
  250. package/dist/shared/hooks/useLifecycleEvents.d.ts +22 -0
  251. package/dist/shared/hooks/useLoadingState.d.ts +17 -0
  252. package/dist/shared/hooks/useMediaQuery.d.ts +6 -0
  253. package/dist/shared/hooks/useNotificationService.d.ts +8 -0
  254. package/dist/shared/hooks/usePerformanceMonitor.d.ts +15 -0
  255. package/dist/shared/hooks/useRowSelectionEvents.d.ts +44 -0
  256. package/dist/shared/hooks/useSelection.d.ts +73 -0
  257. package/dist/shared/hooks/useService.d.ts +12 -0
  258. package/dist/shared/hooks/useServiceState.d.ts +12 -0
  259. package/dist/shared/hooks/useStateChangeEvents.d.ts +61 -0
  260. package/dist/shared/hooks/useTheme.d.ts +13 -0
  261. package/dist/shared/hooks/useVirtualization.d.ts +85 -0
  262. package/dist/shared/services/BaseService.d.ts +56 -0
  263. package/dist/shared/services/ContextMenuService.d.ts +58 -0
  264. package/dist/shared/services/ExportService.d.ts +35 -0
  265. package/dist/shared/services/FocusManagerService.d.ts +33 -0
  266. package/dist/shared/services/HierarchyService.d.ts +43 -0
  267. package/dist/shared/services/I18nService.d.ts +65 -0
  268. package/dist/shared/services/LayoutService.d.ts +80 -0
  269. package/dist/shared/services/NotificationService.d.ts +44 -0
  270. package/dist/shared/services/PersistenceService.d.ts +69 -0
  271. package/dist/shared/services/ServiceRegistry.d.ts +51 -0
  272. package/dist/shared/services/ThemeService.d.ts +49 -0
  273. package/dist/shared/services/VirtualizationService.d.ts +51 -0
  274. package/dist/shared/state/store.d.ts +10 -0
  275. package/dist/shared/themes.d.ts +25 -0
  276. package/dist/shared/types/BaseProps.d.ts +18 -0
  277. package/dist/shared/types/common.d.ts +292 -0
  278. package/dist/shared/types/commonTypes.d.ts +101 -0
  279. package/dist/shared/types/index.d.ts +2 -0
  280. package/dist/shared/utils/canvasUtils.d.ts +16 -0
  281. package/dist/shared/utils/commonUtils.d.ts +28 -0
  282. package/dist/shared/utils/csvUtils.d.ts +7 -0
  283. package/dist/shared/utils/dateUtils.d.ts +5 -0
  284. package/dist/shared/utils/dndUtils.d.ts +16 -0
  285. package/dist/shared/utils/ezStyleUtils.d.ts +64 -0
  286. package/dist/shared/utils/formatUtils.d.ts +20 -0
  287. package/dist/shared/utils/imperativeApiUtils.d.ts +36 -0
  288. package/dist/shared/utils/index.d.ts +11 -0
  289. package/dist/shared/utils/renderUtils.d.ts +6 -0
  290. package/dist/shared/utils/serviceUtils.d.ts +10 -0
  291. package/dist/shared/utils/styleUtils.d.ts +66 -0
  292. package/dist/shared/utils/validationUtils.d.ts +16 -0
  293. package/package.json +101 -0
@@ -0,0 +1,684 @@
1
+ import { j as e, B as u, L as i, I as g, c as m, D as b } from "./index-DBwoXp4n.js";
2
+ import { useEffect as k } from "react";
3
+ import { useForm as D } from "@tanstack/react-form";
4
+ import { createPortal as E } from "react-dom";
5
+ import { X as A, Paperclip as v, Trash2 as z } from "lucide-react";
6
+ const S = [
7
+ { label: "S", value: "SU" },
8
+ { label: "M", value: "MO" },
9
+ { label: "T", value: "TU" },
10
+ { label: "W", value: "WE" },
11
+ { label: "T", value: "TH" },
12
+ { label: "F", value: "FR" },
13
+ { label: "S", value: "SA" }
14
+ ], _ = ({
15
+ isOpen: x,
16
+ onClose: c,
17
+ mode: d,
18
+ event: n,
19
+ onSave: w,
20
+ onDelete: f,
21
+ locale: p,
22
+ editorTemplate: j,
23
+ headerTemplate: y,
24
+ footerTemplate: N
25
+ }) => {
26
+ const s = D({
27
+ defaultValues: {
28
+ title: n?.title || "",
29
+ start: n?.start,
30
+ end: n?.end,
31
+ resourceIds: n?.resourceIds || (n?.resourceId ? [n.resourceId] : []) || [],
32
+ location: n?.location || "",
33
+ isAllDay: !!n?.allDay || !!n?.isAllDay || !1,
34
+ description: n?.description || "",
35
+ isTimezoneEnabled: !!n?.timezone,
36
+ startTimezone: n?.timezone?.start || "Asia/Calcutta",
37
+ endTimezone: n?.timezone?.end || "Asia/Calcutta",
38
+ repeatFrequency: n?.recurrence?.frequency || "Never",
39
+ repeatInterval: n?.recurrence?.interval || 1,
40
+ repeatDays: n?.recurrence?.days || [],
41
+ repeatBy: n?.recurrence?.repeatBy || "day",
42
+ repeatEndLevel: n?.recurrence?.end || "Never",
43
+ repeatEndCount: n?.recurrence?.endCount || 1,
44
+ repeatEndUntil: n?.recurrence?.endUntil,
45
+ attachments: n?.attachments || []
46
+ },
47
+ onSubmit: async ({ value: t }) => {
48
+ w({
49
+ ...n,
50
+ title: t.title,
51
+ start: t.start,
52
+ end: t.end,
53
+ resourceId: t.resourceIds[0],
54
+ resourceIds: t.resourceIds,
55
+ location: t.location,
56
+ allDay: t.isAllDay,
57
+ description: t.description,
58
+ timezone: t.isTimezoneEnabled ? { start: t.startTimezone, end: t.endTimezone } : void 0,
59
+ recurrence: t.repeatFrequency !== "Never" ? {
60
+ frequency: t.repeatFrequency,
61
+ interval: t.repeatInterval,
62
+ unit: t.repeatFrequency.replace("ly", "") + "(s)",
63
+ end: t.repeatEndLevel,
64
+ endCount: t.repeatEndLevel === "Count" ? t.repeatEndCount : void 0,
65
+ endUntil: t.repeatEndLevel === "Until" ? t.repeatEndUntil : void 0,
66
+ days: t.repeatFrequency === "Weekly" ? t.repeatDays : void 0,
67
+ repeatBy: t.repeatFrequency === "Monthly" || t.repeatFrequency === "Yearly" ? t.repeatBy : void 0
68
+ } : void 0,
69
+ attachments: t.attachments
70
+ }), c();
71
+ }
72
+ });
73
+ if (k(() => {
74
+ x && s.reset();
75
+ }, [x, n, s]), !x) return null;
76
+ const C = (t) => {
77
+ t.preventDefault(), t.stopPropagation(), s.handleSubmit();
78
+ }, o = d === "view", F = /* @__PURE__ */ e.jsxs(
79
+ "div",
80
+ {
81
+ "data-testid": "ez-event-modal",
82
+ style: {
83
+ position: "fixed",
84
+ top: 0,
85
+ left: 0,
86
+ width: "100vw",
87
+ height: "100vh",
88
+ zIndex: 1e4,
89
+ backgroundColor: "rgba(0, 0, 0, 0.4)",
90
+ backdropFilter: "blur(2px)",
91
+ pointerEvents: "auto"
92
+ },
93
+ children: [
94
+ /* @__PURE__ */ e.jsx(
95
+ "div",
96
+ {
97
+ style: { position: "absolute", inset: 0 },
98
+ onClick: c
99
+ }
100
+ ),
101
+ /* @__PURE__ */ e.jsxs(
102
+ "div",
103
+ {
104
+ className: m(
105
+ "bg-background rounded-xl shadow-2xl flex flex-col border border-border overflow-hidden",
106
+ "animate-in zoom-in-95 fade-in duration-300 ease-out"
107
+ ),
108
+ style: {
109
+ backgroundColor: "white",
110
+ width: "650px",
111
+ maxWidth: "95vw",
112
+ maxHeight: "92vh",
113
+ position: "absolute",
114
+ top: "50%",
115
+ left: "50%",
116
+ transform: "translate(-50%, -50%)",
117
+ zIndex: 10001
118
+ },
119
+ children: [
120
+ /* @__PURE__ */ e.jsx(
121
+ "div",
122
+ {
123
+ className: "flex items-center justify-between shrink-0 bg-background",
124
+ style: { padding: "16px 40px" },
125
+ children: y ? y(n || {}, d) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
126
+ /* @__PURE__ */ e.jsxs("h2", { className: "text-xl font-bold tracking-tight text-foreground", children: [
127
+ d === "create" && "New Event",
128
+ d === "edit" && "Edit Event",
129
+ d === "view" && "Event Details"
130
+ ] }),
131
+ /* @__PURE__ */ e.jsx(u, { variant: "ghost", size: "icon", className: "h-9 w-9 rounded-full hover:bg-muted text-muted-foreground mr-[-8px]", onClick: c, children: /* @__PURE__ */ e.jsx(A, { className: "w-5 h-5" }) })
132
+ ] })
133
+ }
134
+ ),
135
+ j ? /* @__PURE__ */ e.jsx("div", { className: "overflow-y-auto custom-scrollbar flex-1 bg-background", style: { padding: "8px 40px 32px 40px" }, children: j(n || {}) }) : /* @__PURE__ */ e.jsxs(
136
+ "form",
137
+ {
138
+ onSubmit: C,
139
+ className: "space-y-6 overflow-y-auto custom-scrollbar flex-1 bg-background",
140
+ style: { padding: "8px 40px 32px 40px" },
141
+ children: [
142
+ /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
143
+ /* @__PURE__ */ e.jsx(
144
+ s.Field,
145
+ {
146
+ name: "title",
147
+ validators: {
148
+ onChange: ({ value: t }) => t ? void 0 : "Title is required"
149
+ },
150
+ children: (t) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
151
+ /* @__PURE__ */ e.jsx(i, { htmlFor: "title", className: "text-[13px] font-semibold text-foreground/70", children: "Title" }),
152
+ /* @__PURE__ */ e.jsx(
153
+ g,
154
+ {
155
+ id: "title",
156
+ placeholder: "Add title",
157
+ value: t.state.value,
158
+ onChange: (r) => t.handleChange(r.target.value),
159
+ onBlur: t.handleBlur,
160
+ disabled: o,
161
+ className: m(
162
+ "h-10 rounded-md border-slate-100 focus-visible:border-primary focus-visible:ring-1 focus-visible:ring-primary/20 bg-background transition-all",
163
+ t.state.meta.errors.length > 0 && "border-destructive focus-visible:border-destructive ring-destructive/20"
164
+ )
165
+ }
166
+ ),
167
+ t.state.meta.errors.length > 0 && /* @__PURE__ */ e.jsx("p", { className: "text-[12px] font-medium text-destructive mt-1.5 animate-in fade-in slide-in-from-top-1", children: t.state.meta.errors.join(", ") })
168
+ ] })
169
+ }
170
+ ),
171
+ /* @__PURE__ */ e.jsx(
172
+ s.Field,
173
+ {
174
+ name: "location",
175
+ children: (t) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
176
+ /* @__PURE__ */ e.jsx(i, { htmlFor: "location", className: "text-[13px] font-semibold text-foreground/70", children: "Location" }),
177
+ /* @__PURE__ */ e.jsx(
178
+ g,
179
+ {
180
+ id: "location",
181
+ placeholder: "Add location",
182
+ value: t.state.value,
183
+ onChange: (r) => t.handleChange(r.target.value),
184
+ disabled: o,
185
+ className: "h-10 rounded-md border-slate-100 focus-visible:border-primary focus-visible:ring-1 focus-visible:ring-primary/20 bg-background transition-all"
186
+ }
187
+ )
188
+ ] })
189
+ }
190
+ )
191
+ ] }),
192
+ /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
193
+ /* @__PURE__ */ e.jsx(
194
+ s.Field,
195
+ {
196
+ name: "start",
197
+ validators: {
198
+ onChange: ({ value: t }) => t ? void 0 : "Start date is required"
199
+ },
200
+ children: (t) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
201
+ /* @__PURE__ */ e.jsx(i, { className: "text-[13px] font-semibold text-foreground/70", children: "Start" }),
202
+ /* @__PURE__ */ e.jsx(
203
+ b,
204
+ {
205
+ date: t.state.value,
206
+ setDate: (r) => t.handleChange(r),
207
+ disabled: o,
208
+ required: !0,
209
+ locale: p,
210
+ mode: s.getFieldValue("isAllDay") ? "date" : "datetime",
211
+ className: "border-slate-200 focus-visible:border-primary focus-visible:ring-1 focus-visible:ring-primary/20"
212
+ }
213
+ ),
214
+ t.state.meta.errors.length > 0 && /* @__PURE__ */ e.jsx("p", { className: "text-[12px] font-medium text-destructive mt-1.5", children: t.state.meta.errors.join(", ") })
215
+ ] })
216
+ }
217
+ ),
218
+ /* @__PURE__ */ e.jsx(
219
+ s.Field,
220
+ {
221
+ name: "end",
222
+ validators: {
223
+ onChange: ({ value: t, fieldApi: r }) => {
224
+ if (!t) return "End date is required";
225
+ const a = r.form.getFieldValue("start");
226
+ if (a && t <= a) return "End time must be after start time";
227
+ }
228
+ },
229
+ children: (t) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
230
+ /* @__PURE__ */ e.jsx(i, { className: "text-[13px] font-semibold text-foreground/70", children: "End" }),
231
+ /* @__PURE__ */ e.jsx(
232
+ b,
233
+ {
234
+ date: t.state.value,
235
+ setDate: (r) => t.handleChange(r),
236
+ disabled: o,
237
+ required: !0,
238
+ locale: p,
239
+ mode: s.getFieldValue("isAllDay") ? "date" : "datetime",
240
+ minDate: s.getFieldValue("start"),
241
+ className: m(
242
+ "border-slate-200 focus-visible:border-primary focus-visible:ring-1 focus-visible:ring-primary/20",
243
+ t.state.meta.errors.length > 0 && "border-destructive focus-visible:border-destructive ring-destructive/20"
244
+ )
245
+ }
246
+ ),
247
+ t.state.meta.errors.length > 0 && /* @__PURE__ */ e.jsx("p", { className: "text-[12px] font-medium text-destructive mt-1.5 animate-in fade-in slide-in-from-top-1", children: t.state.meta.errors.join(", ") })
248
+ ] })
249
+ }
250
+ )
251
+ ] }),
252
+ /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
253
+ /* @__PURE__ */ e.jsx(
254
+ s.Field,
255
+ {
256
+ name: "isAllDay",
257
+ children: (t) => /* @__PURE__ */ e.jsx("div", { className: "flex items-center h-10", children: /* @__PURE__ */ e.jsxs("label", { className: "flex items-center space-x-3 cursor-pointer group select-none", children: [
258
+ /* @__PURE__ */ e.jsx(
259
+ "input",
260
+ {
261
+ type: "checkbox",
262
+ checked: t.state.value,
263
+ onChange: (r) => t.handleChange(r.target.checked),
264
+ disabled: o,
265
+ className: "h-4 w-4 rounded border-slate-300 text-primary focus:ring-primary/30 accent-primary transition-all cursor-pointer"
266
+ }
267
+ ),
268
+ /* @__PURE__ */ e.jsx("span", { className: "text-[14px] font-medium text-foreground/70 group-hover:text-foreground", children: "All day event" })
269
+ ] }) })
270
+ }
271
+ ),
272
+ /* @__PURE__ */ e.jsx(
273
+ s.Field,
274
+ {
275
+ name: "isTimezoneEnabled",
276
+ children: (t) => /* @__PURE__ */ e.jsx("div", { className: "flex items-center h-10", children: /* @__PURE__ */ e.jsxs("label", { className: "flex items-center space-x-3 cursor-pointer group select-none", children: [
277
+ /* @__PURE__ */ e.jsx(
278
+ "input",
279
+ {
280
+ type: "checkbox",
281
+ checked: t.state.value,
282
+ onChange: (r) => t.handleChange(r.target.checked),
283
+ disabled: o,
284
+ className: "h-4 w-4 rounded border-slate-300 text-primary focus:ring-primary/30 accent-primary transition-all cursor-pointer"
285
+ }
286
+ ),
287
+ /* @__PURE__ */ e.jsx("span", { className: "text-[14px] font-medium text-foreground/70 group-hover:text-foreground", children: "Enable timezone" })
288
+ ] }) })
289
+ }
290
+ )
291
+ ] }),
292
+ /* @__PURE__ */ e.jsx(
293
+ s.Subscribe,
294
+ {
295
+ selector: (t) => [t.values.isTimezoneEnabled],
296
+ children: ([t]) => t && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6 p-6 bg-slate-50/50 rounded-lg border border-slate-100 animate-in slide-in-from-top-2 duration-300", children: [
297
+ /* @__PURE__ */ e.jsx(
298
+ s.Field,
299
+ {
300
+ name: "startTimezone",
301
+ children: (r) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
302
+ /* @__PURE__ */ e.jsx(i, { className: "text-[13px] font-semibold text-foreground/70", children: "Start Timezone" }),
303
+ /* @__PURE__ */ e.jsxs(
304
+ "select",
305
+ {
306
+ className: "w-full h-10 px-3 rounded-md border-slate-100 bg-background text-sm focus:outline-none focus-visible:ring-1 focus-visible:ring-primary/20 focus-visible:border-primary appearance-none bg-[url('data:image/svg+xml;charset=utf-8,%3Csvg%20xlmns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20fill%3D%27none%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20stroke%3D%27%236b7280%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%20stroke-width%3D%271.5%27%20d%3D%27m6%208%204%204%204-4%27%2F%3E%3C%2Fsvg%3E')] bg-[length:20px] bg-[right_8px_center] bg-no-repeat transition-all",
307
+ value: r.state.value,
308
+ onChange: (a) => r.handleChange(a.target.value),
309
+ children: [
310
+ /* @__PURE__ */ e.jsx("option", { value: "Asia/Calcutta", children: "Asia/Calcutta" }),
311
+ /* @__PURE__ */ e.jsx("option", { value: "UTC", children: "UTC" }),
312
+ /* @__PURE__ */ e.jsx("option", { value: "America/New_York", children: "America/New_York" })
313
+ ]
314
+ }
315
+ )
316
+ ] })
317
+ }
318
+ ),
319
+ /* @__PURE__ */ e.jsx(
320
+ s.Field,
321
+ {
322
+ name: "endTimezone",
323
+ children: (r) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
324
+ /* @__PURE__ */ e.jsx(i, { className: "text-[13px] font-semibold text-foreground/70", children: "End Timezone" }),
325
+ /* @__PURE__ */ e.jsxs(
326
+ "select",
327
+ {
328
+ className: "w-full h-10 px-3 rounded-md border-slate-100 bg-background text-sm focus:outline-none focus-visible:ring-1 focus-visible:ring-primary/20 focus-visible:border-primary appearance-none bg-[url('data:image/svg+xml;charset=utf-8,%3Csvg%20xlmns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20fill%3D%27none%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20stroke%3D%27%236b7280%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%20stroke-width%3D%271.5%27%20d%3D%27m6%208%204%204%204-4%27%2F%3E%3C%2Fsvg%3E')] bg-[length:20px] bg-[right_8px_center] bg-no-repeat transition-all",
329
+ value: r.state.value,
330
+ onChange: (a) => r.handleChange(a.target.value),
331
+ children: [
332
+ /* @__PURE__ */ e.jsx("option", { value: "Asia/Calcutta", children: "Asia/Calcutta" }),
333
+ /* @__PURE__ */ e.jsx("option", { value: "UTC", children: "UTC" }),
334
+ /* @__PURE__ */ e.jsx("option", { value: "America/New_York", children: "America/New_York" })
335
+ ]
336
+ }
337
+ )
338
+ ] })
339
+ }
340
+ )
341
+ ] })
342
+ }
343
+ ),
344
+ /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
345
+ /* @__PURE__ */ e.jsx(
346
+ s.Field,
347
+ {
348
+ name: "repeatFrequency",
349
+ children: (t) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
350
+ /* @__PURE__ */ e.jsx(i, { className: "text-[13px] font-semibold text-foreground/70", children: "Repeat" }),
351
+ /* @__PURE__ */ e.jsxs(
352
+ "select",
353
+ {
354
+ className: "w-full h-10 px-3 rounded-md border-slate-100 bg-background text-sm focus:outline-none focus-visible:ring-1 focus-visible:ring-primary/20 focus-visible:border-primary appearance-none bg-[url('data:image/svg+xml;charset=utf-8,%3Csvg%20xlmns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20fill%3D%27none%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20stroke%3D%27%236b7280%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%20stroke-width%3D%271.5%27%20d%3D%27m6%208%204%204%204-4%27%2F%3E%3C%2Fsvg%3E')] bg-[length:20px] bg-[right_8px_center] bg-no-repeat transition-all",
355
+ value: t.state.value,
356
+ onChange: (r) => t.handleChange(r.target.value),
357
+ children: [
358
+ /* @__PURE__ */ e.jsx("option", { value: "Never", children: "Never" }),
359
+ /* @__PURE__ */ e.jsx("option", { value: "Daily", children: "Daily" }),
360
+ /* @__PURE__ */ e.jsx("option", { value: "Weekly", children: "Weekly" }),
361
+ /* @__PURE__ */ e.jsx("option", { value: "Monthly", children: "Monthly" }),
362
+ /* @__PURE__ */ e.jsx("option", { value: "Yearly", children: "Yearly" })
363
+ ]
364
+ }
365
+ )
366
+ ] })
367
+ }
368
+ ),
369
+ /* @__PURE__ */ e.jsx(
370
+ s.Subscribe,
371
+ {
372
+ selector: (t) => [t.values.repeatFrequency],
373
+ children: ([t]) => t !== "Never" && /* @__PURE__ */ e.jsx(
374
+ s.Field,
375
+ {
376
+ name: "repeatEndLevel",
377
+ children: (r) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2 animate-in slide-in-from-top-2 duration-300", children: [
378
+ /* @__PURE__ */ e.jsx(i, { className: "text-[13px] font-semibold text-foreground/70", children: "End" }),
379
+ /* @__PURE__ */ e.jsxs(
380
+ "select",
381
+ {
382
+ className: "w-full h-10 px-3 rounded-md border-slate-100 bg-background text-sm focus:outline-none focus-visible:ring-1 focus-visible:ring-primary/20 focus-visible:border-primary appearance-none bg-[url('data:image/svg+xml;charset=utf-8,%3Csvg%20xlmns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20fill%3D%27none%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20stroke%3D%27%236b7280%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%20stroke-width%3D%271.5%27%20d%3D%27m6%208%204%204%204-4%27%2F%3E%3C%2Fsvg%3E')] bg-[length:20px] bg-[right_8px_center] bg-no-repeat transition-all",
383
+ value: r.state.value,
384
+ onChange: (a) => r.handleChange(a.target.value),
385
+ children: [
386
+ /* @__PURE__ */ e.jsx("option", { value: "Never", children: "Never" }),
387
+ /* @__PURE__ */ e.jsx("option", { value: "Until", children: "Until" }),
388
+ /* @__PURE__ */ e.jsx("option", { value: "Count", children: "Count" })
389
+ ]
390
+ }
391
+ )
392
+ ] })
393
+ }
394
+ )
395
+ }
396
+ )
397
+ ] }),
398
+ /* @__PURE__ */ e.jsx(
399
+ s.Subscribe,
400
+ {
401
+ selector: (t) => [t.values.repeatFrequency, t.values.repeatEndLevel],
402
+ children: ([t, r]) => t !== "Never" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6 animate-in slide-in-from-top-2 duration-300", children: [
403
+ /* @__PURE__ */ e.jsx(
404
+ s.Field,
405
+ {
406
+ name: "repeatInterval",
407
+ children: (a) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
408
+ /* @__PURE__ */ e.jsx(i, { className: "text-[13px] font-semibold text-foreground/70", children: "Repeat every" }),
409
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
410
+ /* @__PURE__ */ e.jsx(
411
+ "select",
412
+ {
413
+ className: "flex-1 h-10 px-3 rounded-md border-slate-100 bg-background text-sm focus:outline-none focus-visible:ring-1 focus-visible:ring-primary/20 focus-visible:border-primary appearance-none bg-[url('data:image/svg+xml;charset=utf-8,%3Csvg%20xlmns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20fill%3D%27none%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20stroke%3D%27%236b7280%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%20stroke-width%3D%271.5%27%20d%3D%27m6%208%204%204%204-4%27%2F%3E%3C%2Fsvg%3E')] bg-[length:20px] bg-[right_8px_center] bg-no-repeat transition-all",
414
+ value: a.state.value,
415
+ onChange: (l) => a.handleChange(parseInt(l.target.value)),
416
+ children: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 20, 30].map((l) => /* @__PURE__ */ e.jsx("option", { value: l, children: l }, l))
417
+ }
418
+ ),
419
+ /* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium text-muted-foreground whitespace-nowrap", children: t === "Daily" ? "Day(s)" : t.replace("ly", "") + "(s)" })
420
+ ] })
421
+ ] })
422
+ }
423
+ ),
424
+ r === "Until" && /* @__PURE__ */ e.jsx(
425
+ s.Field,
426
+ {
427
+ name: "repeatEndUntil",
428
+ children: (a) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2 animate-in slide-in-from-top-1", children: [
429
+ /* @__PURE__ */ e.jsx(i, { className: "text-[13px] font-semibold text-foreground/70", children: "Until" }),
430
+ /* @__PURE__ */ e.jsx(
431
+ b,
432
+ {
433
+ date: a.state.value,
434
+ setDate: (l) => a.handleChange(l),
435
+ disabled: o,
436
+ locale: p,
437
+ mode: "date",
438
+ minDate: s.getFieldValue("start"),
439
+ className: "border-slate-100 focus:border-primary"
440
+ }
441
+ )
442
+ ] })
443
+ }
444
+ ),
445
+ r === "Count" && /* @__PURE__ */ e.jsx(
446
+ s.Field,
447
+ {
448
+ name: "repeatEndCount",
449
+ children: (a) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2 animate-in slide-in-from-top-1", children: [
450
+ /* @__PURE__ */ e.jsx(i, { className: "text-[13px] font-semibold text-foreground/70", children: "Occurrences" }),
451
+ /* @__PURE__ */ e.jsx(
452
+ g,
453
+ {
454
+ type: "number",
455
+ min: 1,
456
+ value: a.state.value,
457
+ onChange: (l) => a.handleChange(parseInt(l.target.value)),
458
+ className: "h-10 rounded-md border-slate-100 focus-visible:border-primary focus-visible:ring-1 focus-visible:ring-primary/20 bg-background transition-all"
459
+ }
460
+ )
461
+ ] })
462
+ }
463
+ )
464
+ ] })
465
+ }
466
+ ),
467
+ /* @__PURE__ */ e.jsx(
468
+ s.Subscribe,
469
+ {
470
+ selector: (t) => [t.values.repeatFrequency],
471
+ children: ([t]) => t === "Weekly" && /* @__PURE__ */ e.jsx(
472
+ s.Field,
473
+ {
474
+ name: "repeatDays",
475
+ children: (r) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-3 animate-in fade-in duration-300", children: [
476
+ /* @__PURE__ */ e.jsx(i, { className: "text-[13px] font-semibold text-foreground/70", children: "Repeat On" }),
477
+ /* @__PURE__ */ e.jsx("div", { className: "flex flex-wrap gap-2", children: S.map((a) => /* @__PURE__ */ e.jsx(
478
+ "button",
479
+ {
480
+ type: "button",
481
+ onClick: () => {
482
+ const l = r.state.value || [];
483
+ l.includes(a.value) ? r.handleChange(l.filter((h) => h !== a.value)) : r.handleChange([...l, a.value]);
484
+ },
485
+ className: m(
486
+ "w-9 h-9 rounded-full flex items-center justify-center text-sm font-bold transition-all border",
487
+ (r.state.value || []).includes(a.value) ? "bg-primary text-white border-primary shadow-sm" : "bg-background text-foreground/60 border-border/60 hover:border-primary/40 hover:text-primary"
488
+ ),
489
+ children: a.label
490
+ },
491
+ a.value
492
+ )) })
493
+ ] })
494
+ }
495
+ )
496
+ }
497
+ ),
498
+ /* @__PURE__ */ e.jsx(
499
+ s.Subscribe,
500
+ {
501
+ selector: (t) => [t.values.repeatFrequency],
502
+ children: ([t]) => (t === "Monthly" || t === "Yearly") && /* @__PURE__ */ e.jsx(
503
+ s.Field,
504
+ {
505
+ name: "repeatBy",
506
+ children: (r) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 animate-in fade-in duration-300", children: [
507
+ /* @__PURE__ */ e.jsx(i, { className: "text-[13px] font-semibold text-foreground/70", children: "Repeat On" }),
508
+ /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
509
+ /* @__PURE__ */ e.jsxs("label", { className: "flex items-center space-x-3 cursor-pointer group", children: [
510
+ /* @__PURE__ */ e.jsx(
511
+ "input",
512
+ {
513
+ type: "radio",
514
+ name: "repeatBy",
515
+ checked: r.state.value === "day",
516
+ onChange: () => r.handleChange("day"),
517
+ className: "h-4 w-4 border-border text-primary focus:ring-primary"
518
+ }
519
+ ),
520
+ /* @__PURE__ */ e.jsx("span", { className: "text-sm text-foreground/80", children: "Day of the month" })
521
+ ] }),
522
+ /* @__PURE__ */ e.jsxs("label", { className: "flex items-center space-x-3 cursor-pointer group", children: [
523
+ /* @__PURE__ */ e.jsx(
524
+ "input",
525
+ {
526
+ type: "radio",
527
+ name: "repeatBy",
528
+ checked: r.state.value === "ordinal",
529
+ onChange: () => r.handleChange("ordinal"),
530
+ className: "h-4 w-4 border-border text-primary focus:ring-primary"
531
+ }
532
+ ),
533
+ /* @__PURE__ */ e.jsx("span", { className: "text-sm text-foreground/80", children: "Ordinal position" })
534
+ ] })
535
+ ] })
536
+ ] })
537
+ }
538
+ )
539
+ }
540
+ ),
541
+ /* @__PURE__ */ e.jsx(
542
+ s.Field,
543
+ {
544
+ name: "description",
545
+ children: (t) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
546
+ /* @__PURE__ */ e.jsx(i, { htmlFor: "description", className: "text-[13px] font-semibold text-foreground/70", children: "Description" }),
547
+ /* @__PURE__ */ e.jsx(
548
+ "textarea",
549
+ {
550
+ id: "description",
551
+ placeholder: "Add description",
552
+ className: "flex min-h-[100px] w-full rounded-md border-slate-100 bg-background px-4 py-3 text-sm placeholder:text-muted-foreground focus:outline-none focus-visible:ring-1 focus-visible:ring-primary/20 focus-visible:border-primary disabled:cursor-not-allowed disabled:opacity-50 resize-none transition-all hover:border-slate-200",
553
+ value: t.state.value,
554
+ onChange: (r) => t.handleChange(r.target.value),
555
+ disabled: o
556
+ }
557
+ )
558
+ ] })
559
+ }
560
+ ),
561
+ /* @__PURE__ */ e.jsx(
562
+ s.Field,
563
+ {
564
+ name: "attachments",
565
+ children: (t) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 pt-4 pb-2", children: [
566
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
567
+ /* @__PURE__ */ e.jsxs(i, { className: "text-[13px] font-semibold text-foreground/70 flex items-center gap-2", children: [
568
+ /* @__PURE__ */ e.jsx(v, { className: "w-4 h-4" }),
569
+ " Attachments"
570
+ ] }),
571
+ /* @__PURE__ */ e.jsx(
572
+ "input",
573
+ {
574
+ type: "file",
575
+ id: "file-upload",
576
+ multiple: !0,
577
+ className: "hidden",
578
+ onChange: (r) => {
579
+ r.target.files && t.handleChange([...t.state.value || [], ...Array.from(r.target.files)]);
580
+ }
581
+ }
582
+ ),
583
+ /* @__PURE__ */ e.jsxs(
584
+ u,
585
+ {
586
+ type: "button",
587
+ variant: "outline",
588
+ size: "sm",
589
+ className: "h-8 text-xs font-semibold gap-2 border-dashed border-slate-300 hover:border-indigo-600/40 hover:text-indigo-600 transition-all",
590
+ onClick: () => document.getElementById("file-upload")?.click(),
591
+ children: [
592
+ /* @__PURE__ */ e.jsx(v, { className: "w-3 h-3" }),
593
+ " Add Files"
594
+ ]
595
+ }
596
+ )
597
+ ] }),
598
+ (t.state.value || []).length > 0 && /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-1 gap-3", children: (t.state.value || []).map((r, a) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between p-3 rounded-lg bg-slate-50 border border-slate-100 group hover:border-slate-200 transition-all", children: [
599
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3 overflow-hidden", children: [
600
+ /* @__PURE__ */ e.jsx("div", { className: "w-9 h-9 rounded-md bg-white border border-slate-200 flex items-center justify-center shrink-0 shadow-sm", children: /* @__PURE__ */ e.jsx(v, { className: "w-4 h-4 text-slate-400" }) }),
601
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col overflow-hidden", children: [
602
+ /* @__PURE__ */ e.jsx("span", { className: "text-[13px] font-medium text-slate-700 truncate", children: r.name }),
603
+ /* @__PURE__ */ e.jsxs("span", { className: "text-[11px] text-slate-400 font-medium", children: [
604
+ (r.size / 1024).toFixed(1),
605
+ " KB"
606
+ ] })
607
+ ] })
608
+ ] }),
609
+ /* @__PURE__ */ e.jsx(
610
+ u,
611
+ {
612
+ type: "button",
613
+ variant: "ghost",
614
+ size: "icon",
615
+ className: "h-8 w-8 text-slate-300 hover:text-destructive hover:bg-destructive/10 opacity-0 group-hover:opacity-100 transition-all",
616
+ onClick: () => t.handleChange((t.state.value || []).filter((l, h) => h !== a)),
617
+ children: /* @__PURE__ */ e.jsx(z, { className: "w-4 h-4" })
618
+ }
619
+ )
620
+ ] }, a)) })
621
+ ] })
622
+ }
623
+ )
624
+ ]
625
+ }
626
+ ),
627
+ N ? N(n || {}, d, () => C({}), c) : /* @__PURE__ */ e.jsxs("div", { style: {
628
+ display: "flex",
629
+ alignItems: "center",
630
+ justifyContent: "flex-end",
631
+ padding: "24px 40px",
632
+ backgroundColor: "#fafbfc",
633
+ gap: "12px",
634
+ width: "100%",
635
+ flexShrink: 0
636
+ }, children: [
637
+ !o && f && d === "edit" && /* @__PURE__ */ e.jsx(u, { type: "button", variant: "ghost", className: "text-destructive hover:bg-destructive/10 hover:text-destructive h-10 px-5 font-bold mr-auto", onClick: () => {
638
+ f(n?.id), c();
639
+ }, children: "Delete" }),
640
+ /* @__PURE__ */ e.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [
641
+ !o && /* @__PURE__ */ e.jsx(
642
+ s.Subscribe,
643
+ {
644
+ selector: (t) => [t.canSubmit, t.isSubmitting],
645
+ children: ([t, r]) => /* @__PURE__ */ e.jsx(
646
+ u,
647
+ {
648
+ type: "submit",
649
+ variant: "default",
650
+ className: "h-10 px-10 font-bold rounded-md shrink-0 flex items-center justify-center transition-all hover:opacity-90",
651
+ style: { minWidth: "120px" },
652
+ disabled: !t || r,
653
+ onClick: (a) => {
654
+ a.preventDefault(), a.stopPropagation(), s.handleSubmit();
655
+ },
656
+ children: r ? "Saving..." : "Save"
657
+ }
658
+ )
659
+ }
660
+ ),
661
+ /* @__PURE__ */ e.jsx(
662
+ u,
663
+ {
664
+ type: "button",
665
+ variant: "outline",
666
+ className: "h-10 px-8 font-bold border border-slate-200 hover:bg-slate-50 text-slate-700 shrink-0 rounded-md transition-all",
667
+ style: { minWidth: "100px" },
668
+ onClick: c,
669
+ children: "Cancel"
670
+ }
671
+ )
672
+ ] })
673
+ ] })
674
+ ]
675
+ }
676
+ )
677
+ ]
678
+ }
679
+ );
680
+ return E(F, document.body);
681
+ };
682
+ export {
683
+ _ as EzEventModal
684
+ };