@kumix/ui 0.1.3 → 0.2.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.
- package/README.md +115 -95
- package/dist/components/reui/alert.d.ts +12 -0
- package/dist/components/reui/alert.d.ts.map +1 -0
- package/dist/components/reui/alert.js +58 -0
- package/dist/components/reui/alert.js.map +1 -0
- package/dist/components/reui/autocomplete.d.ts +43 -0
- package/dist/components/reui/autocomplete.d.ts.map +1 -0
- package/dist/components/reui/autocomplete.js +165 -0
- package/dist/components/reui/autocomplete.js.map +1 -0
- package/dist/components/reui/badge.d.ts +17 -0
- package/dist/components/reui/badge.d.ts.map +1 -0
- package/dist/components/reui/badge.js +75 -0
- package/dist/components/reui/badge.js.map +1 -0
- package/dist/components/reui/data-grid/data-grid-column-filter.d.ts +17 -0
- package/dist/components/reui/data-grid/data-grid-column-filter.d.ts.map +1 -0
- package/dist/components/reui/data-grid/data-grid-column-filter.js +127 -0
- package/dist/components/reui/data-grid/data-grid-column-filter.js.map +1 -0
- package/dist/components/reui/data-grid/data-grid-column-header.d.ts +18 -0
- package/dist/components/reui/data-grid/data-grid-column-header.d.ts.map +1 -0
- package/dist/components/reui/data-grid/data-grid-column-header.js +228 -0
- package/dist/components/reui/data-grid/data-grid-column-header.js.map +1 -0
- package/dist/components/reui/data-grid/data-grid-column-visibility.d.ts +10 -0
- package/dist/components/reui/data-grid/data-grid-column-visibility.d.ts.map +1 -0
- package/dist/components/reui/data-grid/data-grid-column-visibility.js +28 -0
- package/dist/components/reui/data-grid/data-grid-column-visibility.js.map +1 -0
- package/dist/components/reui/data-grid/data-grid-pagination.d.ts +22 -0
- package/dist/components/reui/data-grid/data-grid-pagination.d.ts.map +1 -0
- package/dist/components/reui/data-grid/data-grid-pagination.js +144 -0
- package/dist/components/reui/data-grid/data-grid-pagination.js.map +1 -0
- package/dist/components/reui/data-grid/data-grid-scroll-area.d.ts +12 -0
- package/dist/components/reui/data-grid/data-grid-scroll-area.d.ts.map +1 -0
- package/dist/components/reui/data-grid/data-grid-scroll-area.js +289 -0
- package/dist/components/reui/data-grid/data-grid-scroll-area.js.map +1 -0
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.d.ts +14 -0
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.d.ts.map +1 -0
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js +166 -0
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js.map +1 -0
- package/dist/components/reui/data-grid/data-grid-table-dnd.d.ts +10 -0
- package/dist/components/reui/data-grid/data-grid-table-dnd.d.ts.map +1 -0
- package/dist/components/reui/data-grid/data-grid-table-dnd.js +171 -0
- package/dist/components/reui/data-grid/data-grid-table-dnd.js.map +1 -0
- package/dist/components/reui/data-grid/data-grid-table-virtual.d.ts +29 -0
- package/dist/components/reui/data-grid/data-grid-table-virtual.d.ts.map +1 -0
- package/dist/components/reui/data-grid/data-grid-table-virtual.js +269 -0
- package/dist/components/reui/data-grid/data-grid-table-virtual.js.map +1 -0
- package/dist/components/reui/data-grid/data-grid-table.d.ts +116 -0
- package/dist/components/reui/data-grid/data-grid-table.d.ts.map +1 -0
- package/dist/components/reui/data-grid/data-grid-table.js +864 -0
- package/dist/components/reui/data-grid/data-grid-table.js.map +1 -0
- package/dist/components/reui/data-grid/data-grid.d.ts +112 -0
- package/dist/components/reui/data-grid/data-grid.d.ts.map +1 -0
- package/dist/components/reui/data-grid/data-grid.js +134 -0
- package/dist/components/reui/data-grid/data-grid.js.map +1 -0
- package/dist/components/reui/date-selector.d.ts +131 -0
- package/dist/components/reui/date-selector.d.ts.map +1 -0
- package/dist/components/reui/date-selector.js +783 -0
- package/dist/components/reui/date-selector.js.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-agenda-view.d.ts +7 -0
- package/dist/components/reui/event-calendar/event-calendar-agenda-view.d.ts.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-agenda-view.js +108 -0
- package/dist/components/reui/event-calendar/event-calendar-agenda-view.js.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-content.d.ts +15 -0
- package/dist/components/reui/event-calendar/event-calendar-content.d.ts.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-content.js +44 -0
- package/dist/components/reui/event-calendar/event-calendar-content.js.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-dnd.d.ts +30 -0
- package/dist/components/reui/event-calendar/event-calendar-dnd.d.ts.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-dnd.js +581 -0
- package/dist/components/reui/event-calendar/event-calendar-dnd.js.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-event.d.ts +73 -0
- package/dist/components/reui/event-calendar/event-calendar-event.d.ts.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-event.js +299 -0
- package/dist/components/reui/event-calendar/event-calendar-event.js.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-i18n.d.ts +103 -0
- package/dist/components/reui/event-calendar/event-calendar-i18n.d.ts.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-i18n.js +141 -0
- package/dist/components/reui/event-calendar/event-calendar-i18n.js.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-lib.d.ts +111 -0
- package/dist/components/reui/event-calendar/event-calendar-lib.d.ts.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-lib.js +398 -0
- package/dist/components/reui/event-calendar/event-calendar-lib.js.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-month-view.d.ts +29 -0
- package/dist/components/reui/event-calendar/event-calendar-month-view.d.ts.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-month-view.js +530 -0
- package/dist/components/reui/event-calendar/event-calendar-month-view.js.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-nav.d.ts +71 -0
- package/dist/components/reui/event-calendar/event-calendar-nav.d.ts.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-nav.js +319 -0
- package/dist/components/reui/event-calendar/event-calendar-nav.js.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-recurrence.d.ts +32 -0
- package/dist/components/reui/event-calendar/event-calendar-recurrence.d.ts.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-recurrence.js +300 -0
- package/dist/components/reui/event-calendar/event-calendar-recurrence.js.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-resource-view.d.ts +14 -0
- package/dist/components/reui/event-calendar/event-calendar-resource-view.d.ts.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-resource-view.js +355 -0
- package/dist/components/reui/event-calendar/event-calendar-resource-view.js.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-time-grid.d.ts +35 -0
- package/dist/components/reui/event-calendar/event-calendar-time-grid.d.ts.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-time-grid.js +651 -0
- package/dist/components/reui/event-calendar/event-calendar-time-grid.js.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-types.d.ts +236 -0
- package/dist/components/reui/event-calendar/event-calendar-types.d.ts.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-types.js +2 -0
- package/dist/components/reui/event-calendar/event-calendar.d.ts +561 -0
- package/dist/components/reui/event-calendar/event-calendar.d.ts.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar.js +817 -0
- package/dist/components/reui/event-calendar/event-calendar.js.map +1 -0
- package/dist/components/reui/filters.d.ts +176 -0
- package/dist/components/reui/filters.d.ts.map +1 -0
- package/dist/components/reui/filters.js +1216 -0
- package/dist/components/reui/filters.js.map +1 -0
- package/dist/components/reui/frame.d.ts +32 -0
- package/dist/components/reui/frame.d.ts.map +1 -0
- package/dist/components/reui/frame.js +115 -0
- package/dist/components/reui/frame.js.map +1 -0
- package/dist/components/reui/gantt/gantt-bar.d.ts +44 -0
- package/dist/components/reui/gantt/gantt-bar.d.ts.map +1 -0
- package/dist/components/reui/gantt/gantt-bar.js +229 -0
- package/dist/components/reui/gantt/gantt-bar.js.map +1 -0
- package/dist/components/reui/gantt/gantt-dnd.d.ts +36 -0
- package/dist/components/reui/gantt/gantt-dnd.d.ts.map +1 -0
- package/dist/components/reui/gantt/gantt-dnd.js +615 -0
- package/dist/components/reui/gantt/gantt-dnd.js.map +1 -0
- package/dist/components/reui/gantt/gantt-i18n.d.ts +91 -0
- package/dist/components/reui/gantt/gantt-i18n.d.ts.map +1 -0
- package/dist/components/reui/gantt/gantt-i18n.js +131 -0
- package/dist/components/reui/gantt/gantt-i18n.js.map +1 -0
- package/dist/components/reui/gantt/gantt-lib.d.ts +123 -0
- package/dist/components/reui/gantt/gantt-lib.d.ts.map +1 -0
- package/dist/components/reui/gantt/gantt-lib.js +354 -0
- package/dist/components/reui/gantt/gantt-lib.js.map +1 -0
- package/dist/components/reui/gantt/gantt-nav.d.ts +60 -0
- package/dist/components/reui/gantt/gantt-nav.d.ts.map +1 -0
- package/dist/components/reui/gantt/gantt-nav.js +266 -0
- package/dist/components/reui/gantt/gantt-nav.js.map +1 -0
- package/dist/components/reui/gantt/gantt-recurrence.d.ts +37 -0
- package/dist/components/reui/gantt/gantt-recurrence.d.ts.map +1 -0
- package/dist/components/reui/gantt/gantt-recurrence.js +230 -0
- package/dist/components/reui/gantt/gantt-recurrence.js.map +1 -0
- package/dist/components/reui/gantt/gantt-types.d.ts +251 -0
- package/dist/components/reui/gantt/gantt-types.d.ts.map +1 -0
- package/dist/components/reui/gantt/gantt-types.js +2 -0
- package/dist/components/reui/gantt/gantt-view.d.ts +10 -0
- package/dist/components/reui/gantt/gantt-view.d.ts.map +1 -0
- package/dist/components/reui/gantt/gantt-view.js +2193 -0
- package/dist/components/reui/gantt/gantt-view.js.map +1 -0
- package/dist/components/reui/gantt/gantt.d.ts +602 -0
- package/dist/components/reui/gantt/gantt.d.ts.map +1 -0
- package/dist/components/reui/gantt/gantt.js +796 -0
- package/dist/components/reui/gantt/gantt.js.map +1 -0
- package/dist/components/reui/icon-stack.d.ts +7 -0
- package/dist/components/reui/icon-stack.d.ts.map +1 -0
- package/dist/components/reui/icon-stack.js +76 -0
- package/dist/components/reui/icon-stack.js.map +1 -0
- package/dist/components/reui/kanban.d.ts +70 -0
- package/dist/components/reui/kanban.d.ts.map +1 -0
- package/dist/components/reui/kanban.js +519 -0
- package/dist/components/reui/kanban.js.map +1 -0
- package/dist/components/reui/number-field.d.ts +29 -0
- package/dist/components/reui/number-field.d.ts.map +1 -0
- package/dist/components/reui/number-field.js +127 -0
- package/dist/components/reui/number-field.js.map +1 -0
- package/dist/components/reui/phone-input.d.ts +13 -0
- package/dist/components/reui/phone-input.d.ts.map +1 -0
- package/dist/components/reui/phone-input.js +126 -0
- package/dist/components/reui/phone-input.js.map +1 -0
- package/dist/components/reui/rating.d.ts +34 -0
- package/dist/components/reui/rating.d.ts.map +1 -0
- package/dist/components/reui/rating.js +94 -0
- package/dist/components/reui/rating.js.map +1 -0
- package/dist/components/reui/scrollspy.d.ts +17 -0
- package/dist/components/reui/scrollspy.d.ts.map +1 -0
- package/dist/components/reui/scrollspy.js +130 -0
- package/dist/components/reui/scrollspy.js.map +1 -0
- package/dist/components/reui/sortable.d.ts +48 -0
- package/dist/components/reui/sortable.d.ts.map +1 -0
- package/dist/components/reui/sortable.js +230 -0
- package/dist/components/reui/sortable.js.map +1 -0
- package/dist/components/reui/stepper.d.ts +63 -0
- package/dist/components/reui/stepper.d.ts.map +1 -0
- package/dist/components/reui/stepper.js +234 -0
- package/dist/components/reui/stepper.js.map +1 -0
- package/dist/components/reui/timeline.d.ts +24 -0
- package/dist/components/reui/timeline.d.ts.map +1 -0
- package/dist/components/reui/timeline.js +123 -0
- package/dist/components/reui/timeline.js.map +1 -0
- package/dist/components/reui/tree.d.ts +23 -0
- package/dist/components/reui/tree.d.ts.map +1 -0
- package/dist/components/reui/tree.js +115 -0
- package/dist/components/reui/tree.js.map +1 -0
- package/dist/components/ui/accordion.d.ts +9 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion.js +56 -0
- package/dist/components/ui/accordion.js.map +1 -0
- package/dist/components/ui/alert-dialog.d.ts +21 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog.js +96 -0
- package/dist/components/ui/alert-dialog.js.map +1 -0
- package/dist/components/ui/alert.d.ts +13 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/alert.js +45 -0
- package/dist/components/ui/alert.js.map +1 -0
- package/dist/components/ui/aspect-ratio.d.ts +8 -0
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/components/ui/aspect-ratio.js +16 -0
- package/dist/components/ui/aspect-ratio.js.map +1 -0
- package/dist/components/ui/attachment.d.ts +26 -0
- package/dist/components/ui/attachment.d.ts.map +1 -0
- package/dist/components/ui/attachment.js +106 -0
- package/dist/components/ui/attachment.js.map +1 -0
- package/dist/components/ui/avatar.d.ts +14 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/avatar.js +52 -0
- package/dist/components/ui/avatar.js.map +1 -0
- package/dist/components/ui/badge.d.ts +10 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.js +32 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/breadcrumb.d.ts +13 -0
- package/dist/components/ui/breadcrumb.d.ts.map +1 -0
- package/dist/components/ui/breadcrumb.js +72 -0
- package/dist/components/ui/breadcrumb.js.map +1 -0
- package/dist/components/ui/bubble.d.ts +19 -0
- package/dist/components/ui/bubble.d.ts.map +1 -0
- package/dist/components/ui/bubble.js +75 -0
- package/dist/components/ui/bubble.js.map +1 -0
- package/dist/components/ui/button-group.d.ts +14 -0
- package/dist/components/ui/button-group.d.ts.map +1 -0
- package/dist/components/ui/button-group.js +44 -0
- package/dist/components/ui/button-group.js.map +1 -0
- package/dist/components/ui/button.d.ts +11 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +47 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/calendar.d.ts +13 -0
- package/dist/components/ui/calendar.d.ts.map +1 -0
- package/dist/components/ui/calendar.js +110 -0
- package/dist/components/ui/calendar.js.map +1 -0
- package/dist/components/ui/card.d.ts +14 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/card.js +58 -0
- package/dist/components/ui/card.js.map +1 -0
- package/dist/components/ui/carousel.d.ts +31 -0
- package/dist/components/ui/carousel.d.ts.map +1 -0
- package/dist/components/ui/carousel.js +135 -0
- package/dist/components/ui/carousel.js.map +1 -0
- package/dist/components/ui/chart.d.ts +47 -0
- package/dist/components/ui/chart.d.ts.map +1 -0
- package/dist/components/ui/chart.js +151 -0
- package/dist/components/ui/chart.js.map +1 -0
- package/dist/components/ui/checkbox.d.ts +6 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox.js +22 -0
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/collapsible.d.ts +8 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/collapsible.js +26 -0
- package/dist/components/ui/collapsible.js.map +1 -0
- package/dist/components/ui/combobox.d.ts +27 -0
- package/dist/components/ui/combobox.d.ts.map +1 -0
- package/dist/components/ui/combobox.js +164 -0
- package/dist/components/ui/combobox.js.map +1 -0
- package/dist/components/ui/command.d.ts +22 -0
- package/dist/components/ui/command.d.ts.map +1 -0
- package/dist/components/ui/command.js +89 -0
- package/dist/components/ui/command.js.map +1 -0
- package/dist/components/ui/context-menu.d.ts +32 -0
- package/dist/components/ui/context-menu.d.ts.map +1 -0
- package/dist/components/ui/context-menu.js +134 -0
- package/dist/components/ui/context-menu.js.map +1 -0
- package/dist/components/ui/dialog.d.ts +20 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dialog.js +93 -0
- package/dist/components/ui/dialog.js.map +1 -0
- package/dist/components/ui/direction.d.ts +2 -0
- package/dist/components/ui/direction.js +3 -0
- package/dist/components/ui/drawer.d.ts +19 -0
- package/dist/components/ui/drawer.d.ts.map +1 -0
- package/dist/components/ui/drawer.js +125 -0
- package/dist/components/ui/drawer.js.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +32 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.js +138 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/empty.d.ts +15 -0
- package/dist/components/ui/empty.d.ts.map +1 -0
- package/dist/components/ui/empty.js +62 -0
- package/dist/components/ui/empty.js.map +1 -0
- package/dist/components/ui/field.d.ts +28 -0
- package/dist/components/ui/field.d.ts.map +1 -0
- package/dist/components/ui/field.js +112 -0
- package/dist/components/ui/field.js.map +1 -0
- package/dist/components/ui/hover-card.d.ts +8 -0
- package/dist/components/ui/hover-card.d.ts.map +1 -0
- package/dist/components/ui/hover-card.js +38 -0
- package/dist/components/ui/hover-card.js.map +1 -0
- package/dist/components/ui/input-group.d.ts +21 -0
- package/dist/components/ui/input-group.d.ts.map +1 -0
- package/dist/components/ui/input-group.js +80 -0
- package/dist/components/ui/input-group.js.map +1 -0
- package/dist/components/ui/input-otp.d.ts +14 -0
- package/dist/components/ui/input-otp.d.ts.map +1 -0
- package/dist/components/ui/input-otp.js +49 -0
- package/dist/components/ui/input-otp.js.map +1 -0
- package/dist/components/ui/input.d.ts +6 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +17 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/item.d.ts +25 -0
- package/dist/components/ui/item.d.ts.map +1 -0
- package/dist/components/ui/item.js +123 -0
- package/dist/components/ui/item.js.map +1 -0
- package/dist/components/ui/kbd.d.ts +7 -0
- package/dist/components/ui/kbd.d.ts.map +1 -0
- package/dist/components/ui/kbd.js +22 -0
- package/dist/components/ui/kbd.js.map +1 -0
- package/dist/components/ui/label.d.ts +6 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/label.js +15 -0
- package/dist/components/ui/label.js.map +1 -0
- package/dist/components/ui/marker.d.ts +13 -0
- package/dist/components/ui/marker.d.ts.map +1 -0
- package/dist/components/ui/marker.js +45 -0
- package/dist/components/ui/marker.js.map +1 -0
- package/dist/components/ui/menubar.d.ts +32 -0
- package/dist/components/ui/menubar.d.ts.map +1 -0
- package/dist/components/ui/menubar.js +137 -0
- package/dist/components/ui/menubar.js.map +1 -0
- package/dist/components/ui/message-scroller.d.ts +13 -0
- package/dist/components/ui/message-scroller.d.ts.map +1 -0
- package/dist/components/ui/message-scroller.js +62 -0
- package/dist/components/ui/message-scroller.js.map +1 -0
- package/dist/components/ui/message.d.ts +13 -0
- package/dist/components/ui/message.d.ts.map +1 -0
- package/dist/components/ui/message.js +51 -0
- package/dist/components/ui/message.js.map +1 -0
- package/dist/components/ui/native-select.d.ts +11 -0
- package/dist/components/ui/native-select.d.ts.map +1 -0
- package/dist/components/ui/native-select.js +40 -0
- package/dist/components/ui/native-select.js.map +1 -0
- package/dist/components/ui/navigation-menu.d.ts +15 -0
- package/dist/components/ui/navigation-menu.d.ts.map +1 -0
- package/dist/components/ui/navigation-menu.js +85 -0
- package/dist/components/ui/navigation-menu.js.map +1 -0
- package/dist/components/ui/pagination.d.ts +20 -0
- package/dist/components/ui/pagination.d.ts.map +1 -0
- package/dist/components/ui/pagination.js +81 -0
- package/dist/components/ui/pagination.js.map +1 -0
- package/dist/components/ui/popover.d.ts +12 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/popover.js +56 -0
- package/dist/components/ui/popover.js.map +1 -0
- package/dist/components/ui/progress.d.ts +10 -0
- package/dist/components/ui/progress.d.ts.map +1 -0
- package/dist/components/ui/progress.js +46 -0
- package/dist/components/ui/progress.js.map +1 -0
- package/dist/components/ui/radio-group.d.ts +8 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -0
- package/dist/components/ui/radio-group.js +29 -0
- package/dist/components/ui/radio-group.js.map +1 -0
- package/dist/components/ui/resizable.d.ts +10 -0
- package/dist/components/ui/resizable.d.ts.map +1 -0
- package/dist/components/ui/resizable.js +30 -0
- package/dist/components/ui/resizable.js.map +1 -0
- package/dist/components/ui/scroll-area.d.ts +7 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.js +38 -0
- package/dist/components/ui/scroll-area.js.map +1 -0
- package/dist/components/ui/select.d.ts +18 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.js +99 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/separator.d.ts +6 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +17 -0
- package/dist/components/ui/separator.js.map +1 -0
- package/dist/components/ui/sheet.d.ts +17 -0
- package/dist/components/ui/sheet.d.ts.map +1 -0
- package/dist/components/ui/sheet.js +90 -0
- package/dist/components/ui/sheet.js.map +1 -0
- package/dist/components/ui/sidebar.d.ts +66 -0
- package/dist/components/ui/sidebar.d.ts.map +1 -0
- package/dist/components/ui/sidebar.js +383 -0
- package/dist/components/ui/sidebar.js.map +1 -0
- package/dist/components/ui/skeleton.d.ts +6 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeleton.js +15 -0
- package/dist/components/ui/skeleton.js.map +1 -0
- package/dist/components/ui/slider.d.ts +6 -0
- package/dist/components/ui/slider.d.ts.map +1 -0
- package/dist/components/ui/slider.js +36 -0
- package/dist/components/ui/slider.js.map +1 -0
- package/dist/components/ui/sonner.d.ts +7 -0
- package/dist/components/ui/sonner.d.ts.map +1 -0
- package/dist/components/ui/sonner.js +32 -0
- package/dist/components/ui/sonner.js.map +1 -0
- package/dist/components/ui/spinner.d.ts +6 -0
- package/dist/components/ui/spinner.d.ts.map +1 -0
- package/dist/components/ui/spinner.js +18 -0
- package/dist/components/ui/spinner.js.map +1 -0
- package/dist/components/ui/switch.d.ts +8 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/switch.js +21 -0
- package/dist/components/ui/switch.js.map +1 -0
- package/dist/components/ui/table.d.ts +13 -0
- package/dist/components/ui/table.d.ts.map +1 -0
- package/dist/components/ui/table.js +68 -0
- package/dist/components/ui/table.js.map +1 -0
- package/dist/components/ui/tabs.d.ts +13 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/tabs.js +47 -0
- package/dist/components/ui/tabs.js.map +1 -0
- package/dist/components/ui/textarea.d.ts +6 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/textarea.js +15 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/components/ui/toggle-group.d.ts +14 -0
- package/dist/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/components/ui/toggle-group.js +54 -0
- package/dist/components/ui/toggle-group.js.map +1 -0
- package/dist/components/ui/toggle.d.ts +11 -0
- package/dist/components/ui/toggle.d.ts.map +1 -0
- package/dist/components/ui/toggle.js +38 -0
- package/dist/components/ui/toggle.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +9 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip.js +43 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/hooks/use-body-classes.d.ts +27 -0
- package/dist/hooks/use-body-classes.d.ts.map +1 -0
- package/dist/hooks/use-body-classes.js +52 -0
- package/dist/hooks/use-body-classes.js.map +1 -0
- package/dist/hooks/use-copy-to-clipboard.d.ts +43 -0
- package/dist/hooks/use-copy-to-clipboard.d.ts.map +1 -0
- package/dist/hooks/use-copy-to-clipboard.js +69 -0
- package/dist/hooks/use-copy-to-clipboard.js.map +1 -0
- package/dist/hooks/use-file-upload.d.ts +49 -0
- package/dist/hooks/use-file-upload.d.ts.map +1 -0
- package/dist/hooks/use-file-upload.js +227 -0
- package/dist/hooks/use-file-upload.js.map +1 -0
- package/dist/hooks/use-hydrated.d.ts +37 -0
- package/dist/hooks/use-hydrated.d.ts.map +1 -0
- package/dist/hooks/use-hydrated.js +50 -0
- package/dist/hooks/use-hydrated.js.map +1 -0
- package/dist/hooks/use-intersection-observer.d.ts +55 -0
- package/dist/hooks/use-intersection-observer.d.ts.map +1 -0
- package/dist/hooks/use-intersection-observer.js +144 -0
- package/dist/hooks/use-intersection-observer.js.map +1 -0
- package/dist/hooks/use-is-mac.d.ts +28 -0
- package/dist/hooks/use-is-mac.d.ts.map +1 -0
- package/dist/hooks/use-is-mac.js +38 -0
- package/dist/hooks/use-is-mac.js.map +1 -0
- package/dist/hooks/use-media-query.d.ts +44 -0
- package/dist/hooks/use-media-query.d.ts.map +1 -0
- package/dist/hooks/use-media-query.js +58 -0
- package/dist/hooks/use-media-query.js.map +1 -0
- package/dist/hooks/use-meta-color.d.ts +78 -0
- package/dist/hooks/use-meta-color.d.ts.map +1 -0
- package/dist/hooks/use-meta-color.js +138 -0
- package/dist/hooks/use-meta-color.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +5 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +21 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/hooks/use-mutation-observer.d.ts +61 -0
- package/dist/hooks/use-mutation-observer.d.ts.map +1 -0
- package/dist/hooks/use-mutation-observer.js +96 -0
- package/dist/hooks/use-mutation-observer.js.map +1 -0
- package/dist/hooks/use-scroll-position.d.ts +76 -0
- package/dist/hooks/use-scroll-position.d.ts.map +1 -0
- package/dist/hooks/use-scroll-position.js +97 -0
- package/dist/hooks/use-scroll-position.js.map +1 -0
- package/dist/hooks/use-slider-input.d.ts +94 -0
- package/dist/hooks/use-slider-input.d.ts.map +1 -0
- package/dist/hooks/use-slider-input.js +116 -0
- package/dist/hooks/use-slider-input.js.map +1 -0
- package/dist/hooks/use-viewport.d.ts +72 -0
- package/dist/hooks/use-viewport.d.ts.map +1 -0
- package/dist/hooks/use-viewport.js +91 -0
- package/dist/hooks/use-viewport.js.map +1 -0
- package/dist/style.css +0 -247
- package/dist/theme.css +244 -0
- package/dist/theme.css.d.ts +3 -0
- package/package.json +101 -40
- package/dist/hooks.d.ts +0 -957
- package/dist/hooks.d.ts.map +0 -1
- package/dist/hooks.js +0 -1391
- package/dist/hooks.js.map +0 -1
- package/dist/index.d.ts +0 -1993
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -10647
- package/dist/index.js.map +0 -1
- package/dist/source.css +0 -1
- package/dist/source.css.d.ts +0 -3
- package/dist/use-is-mobile-Dln4-L1O.js +0 -210
- package/dist/use-is-mobile-Dln4-L1O.js.map +0 -1
|
@@ -0,0 +1,651 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { ScrollArea } from "../../ui/scroll-area.js";
|
|
3
|
+
import { getDayKey, getDayTotalMinutes, getRangeKey, resolveOffDay, snapMinutes, toZoned, zonedStartOfDay } from "./event-calendar-lib.js";
|
|
4
|
+
import { EventCalendarViewContext, useEventCalendar, useEventCalendarDay, useEventCalendarSelector, useEventCalendarSettings, useEventCalendarViewConfig, useEventCalendarViewContext, useEventCalendarViewSettings } from "./event-calendar.js";
|
|
5
|
+
import { useEventCalendarGestures, wasRecentChipPress, wasRecentDrag } from "./event-calendar-dnd.js";
|
|
6
|
+
import { EVENT_CALENDAR_GHOST, EventCalendarEvent } from "./event-calendar-event.js";
|
|
7
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
8
|
+
import { cn } from "@kumix/utils";
|
|
9
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
11
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
12
|
+
import { addDays, addMinutes, differenceInMinutes, format } from "date-fns";
|
|
13
|
+
//#region src/components/reui/event-calendar/event-calendar-time-grid.tsx
|
|
14
|
+
/** Current time, refreshed on an interval and on tab focus. */
|
|
15
|
+
function useNow(intervalMs = 3e4) {
|
|
16
|
+
const [now, setNow] = useState(() => /* @__PURE__ */ new Date());
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
const tick = () => setNow(/* @__PURE__ */ new Date());
|
|
19
|
+
const id = setInterval(tick, intervalMs);
|
|
20
|
+
document.addEventListener("visibilitychange", tick);
|
|
21
|
+
window.addEventListener("focus", tick);
|
|
22
|
+
return () => {
|
|
23
|
+
clearInterval(id);
|
|
24
|
+
document.removeEventListener("visibilitychange", tick);
|
|
25
|
+
window.removeEventListener("focus", tick);
|
|
26
|
+
};
|
|
27
|
+
}, [intervalMs]);
|
|
28
|
+
return now;
|
|
29
|
+
}
|
|
30
|
+
const EMPTY_ALL_DAY_SEGMENTS = [];
|
|
31
|
+
function EventCalendarTimeGrid({ view, className, render, dayStartHour, dayEndHour, showAllDay = true, interval: intervalProp, ...props }) {
|
|
32
|
+
const instance = useEventCalendar();
|
|
33
|
+
const settings = useEventCalendarSettings();
|
|
34
|
+
const viewConfig = useEventCalendarViewConfig();
|
|
35
|
+
const visibleRange = useEventCalendarSelector((state) => state.visibleRange, { isEqual: (a, b) => getRangeKey(a) === getRangeKey(b) });
|
|
36
|
+
const startHour = dayStartHour ?? settings.dayStartHour;
|
|
37
|
+
const endHour = dayEndHour ?? settings.dayEndHour;
|
|
38
|
+
const interval = Math.min(Math.max(intervalProp ?? viewConfig.interval, 5), 240);
|
|
39
|
+
const contained = viewConfig.scrollMode !== "page";
|
|
40
|
+
const { effective } = useEventCalendarViewSettings();
|
|
41
|
+
const days = useMemo(() => {
|
|
42
|
+
const result = [];
|
|
43
|
+
let cursor = zonedStartOfDay(visibleRange.start, settings.timeZone);
|
|
44
|
+
while (cursor < visibleRange.end) {
|
|
45
|
+
result.push(cursor);
|
|
46
|
+
cursor = zonedStartOfDay(addDays(toZoned(cursor, settings.timeZone), 1), settings.timeZone);
|
|
47
|
+
}
|
|
48
|
+
if (effective.weekends || view === "day") return result;
|
|
49
|
+
return result.filter((day) => ![0, 6].includes(toZoned(day, settings.timeZone).getDay()));
|
|
50
|
+
}, [
|
|
51
|
+
visibleRange,
|
|
52
|
+
settings.timeZone,
|
|
53
|
+
effective.weekends,
|
|
54
|
+
view
|
|
55
|
+
]);
|
|
56
|
+
const scrollRef = useRef(null);
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
if (!contained) return;
|
|
59
|
+
const el = scrollRef.current;
|
|
60
|
+
if (!el) return;
|
|
61
|
+
const viewport = el.querySelector("[data-slot=scroll-area-viewport]");
|
|
62
|
+
const pxPerMinute = (el.querySelector("[data-slot=event-calendar-time-gutter] > div")?.getBoundingClientRect().height || 64) / interval;
|
|
63
|
+
const scrollTo = (minutes) => {
|
|
64
|
+
viewport?.scrollTo({ top: Math.max(0, (minutes - startHour * 60) * pxPerMinute - 12) });
|
|
65
|
+
};
|
|
66
|
+
scrollTo(viewConfig.scrollToHour * 60);
|
|
67
|
+
instance.internals.registerScrollHandler((time) => {
|
|
68
|
+
const minutes = typeof time === "number" ? time : toZoned(time, settings.timeZone).getHours() * 60 + toZoned(time, settings.timeZone).getMinutes();
|
|
69
|
+
scrollTo(minutes);
|
|
70
|
+
});
|
|
71
|
+
const root = el.closest("[data-slot=event-calendar-time-grid], [data-slot=event-calendar-resource-view]");
|
|
72
|
+
const syncScrollbarGutter = () => {
|
|
73
|
+
root?.style.setProperty("--ec-scrollbar-w", `${viewport ? viewport.offsetWidth - viewport.clientWidth : 0}px`);
|
|
74
|
+
};
|
|
75
|
+
syncScrollbarGutter();
|
|
76
|
+
const gutterObserver = viewport ? new ResizeObserver(syncScrollbarGutter) : null;
|
|
77
|
+
if (viewport) gutterObserver?.observe(viewport);
|
|
78
|
+
return () => {
|
|
79
|
+
instance.internals.registerScrollHandler(null);
|
|
80
|
+
gutterObserver?.disconnect();
|
|
81
|
+
};
|
|
82
|
+
}, [
|
|
83
|
+
contained,
|
|
84
|
+
instance,
|
|
85
|
+
settings.timeZone,
|
|
86
|
+
startHour,
|
|
87
|
+
interval,
|
|
88
|
+
viewConfig.scrollToHour
|
|
89
|
+
]);
|
|
90
|
+
const slots = useMemo(() => {
|
|
91
|
+
const result = [];
|
|
92
|
+
for (let m = startHour * 60; m < endHour * 60; m += interval) result.push(m);
|
|
93
|
+
return result;
|
|
94
|
+
}, [
|
|
95
|
+
startHour,
|
|
96
|
+
endHour,
|
|
97
|
+
interval
|
|
98
|
+
]);
|
|
99
|
+
const allDaySegments = useEventCalendarSelector(() => {
|
|
100
|
+
if (!viewConfig.renderAllDaySection) return EMPTY_ALL_DAY_SEGMENTS;
|
|
101
|
+
const byDay = instance.internals.getIndex().byDay;
|
|
102
|
+
const result = days.flatMap((day) => byDay.get(getDayKey(day, settings.timeZone))?.allDay ?? []);
|
|
103
|
+
return result.length ? result : EMPTY_ALL_DAY_SEGMENTS;
|
|
104
|
+
}, { isEqual: (a, b) => a === b || a.length === b.length && a.every((segment, i) => segment === b[i]) });
|
|
105
|
+
const gridTemplateColumns = `repeat(${days.length}, minmax(var(--ec-day-col-min,0px), 1fr))`;
|
|
106
|
+
const track = /* @__PURE__ */ jsxs("div", {
|
|
107
|
+
className: "relative flex",
|
|
108
|
+
children: [
|
|
109
|
+
/* @__PURE__ */ jsx(EventCalendarTimeGutter, {
|
|
110
|
+
days,
|
|
111
|
+
slots,
|
|
112
|
+
startHour,
|
|
113
|
+
interval
|
|
114
|
+
}),
|
|
115
|
+
/* @__PURE__ */ jsx("div", {
|
|
116
|
+
className: "grid min-w-0 flex-1",
|
|
117
|
+
style: { gridTemplateColumns },
|
|
118
|
+
children: days.map((day) => /* @__PURE__ */ jsx(EventCalendarDayColumn, {
|
|
119
|
+
day,
|
|
120
|
+
startHour,
|
|
121
|
+
endHour,
|
|
122
|
+
interval
|
|
123
|
+
}, day.getTime()))
|
|
124
|
+
}),
|
|
125
|
+
effective.nowIndicator && /* @__PURE__ */ jsx(EventCalendarNowIndicator, {
|
|
126
|
+
days,
|
|
127
|
+
startHour,
|
|
128
|
+
endHour
|
|
129
|
+
})
|
|
130
|
+
]
|
|
131
|
+
});
|
|
132
|
+
const defaultProps = {
|
|
133
|
+
"data-slot": "event-calendar-time-grid",
|
|
134
|
+
"data-view": view,
|
|
135
|
+
className: cn("flex flex-col border-t", contained && "min-h-0 flex-1 overflow-hidden", viewConfig.classNames?.timeGrid, className),
|
|
136
|
+
style: { "--ec-hour-height": "4rem" },
|
|
137
|
+
children: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
138
|
+
/* @__PURE__ */ jsxs("div", {
|
|
139
|
+
className: cn("flex border-b pe-(--ec-scrollbar-w,0px)", !contained && "sticky top-(--ec-sticky-offset,0px) z-20 bg-background", viewConfig.classNames?.timeGridHeader),
|
|
140
|
+
children: [/* @__PURE__ */ jsx("div", { className: "w-(--ec-gutter-width,4.5rem) shrink-0 border-e" }), /* @__PURE__ */ jsx("div", {
|
|
141
|
+
className: "grid min-w-0 flex-1",
|
|
142
|
+
style: { gridTemplateColumns },
|
|
143
|
+
children: days.map((day) => /* @__PURE__ */ jsx(EventCalendarDayHeader, {
|
|
144
|
+
day,
|
|
145
|
+
view
|
|
146
|
+
}, day.getTime()))
|
|
147
|
+
})]
|
|
148
|
+
}),
|
|
149
|
+
showAllDay && /* @__PURE__ */ jsx("div", {
|
|
150
|
+
"data-slot": "event-calendar-all-day-section",
|
|
151
|
+
className: cn("flex border-b pe-(--ec-scrollbar-w,0px)", viewConfig.classNames?.allDaySection),
|
|
152
|
+
children: viewConfig.renderAllDaySection?.({
|
|
153
|
+
days,
|
|
154
|
+
segments: allDaySegments
|
|
155
|
+
}) ?? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
|
|
156
|
+
className: cn("w-(--ec-gutter-width,4.5rem) shrink-0 border-e ps-2 pe-2.5 pt-1.5 text-muted-foreground", viewConfig.classNames?.allDayLabel),
|
|
157
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
158
|
+
className: "flex h-[calc(var(--ec-month-bar-h,1.625rem)-0.125rem)] items-center justify-end",
|
|
159
|
+
children: settings.i18n.labels.allDay
|
|
160
|
+
})
|
|
161
|
+
}), /* @__PURE__ */ jsx(EventCalendarAllDayBars, {
|
|
162
|
+
days,
|
|
163
|
+
gridTemplateColumns
|
|
164
|
+
})] })
|
|
165
|
+
}),
|
|
166
|
+
contained ? /* @__PURE__ */ jsx("div", {
|
|
167
|
+
ref: scrollRef,
|
|
168
|
+
className: "min-h-0 flex-1",
|
|
169
|
+
children: viewConfig.scrollbars === "native" ? /* @__PURE__ */ jsx("div", {
|
|
170
|
+
"data-slot": "scroll-area-viewport",
|
|
171
|
+
"data-ec-native-scroll": "",
|
|
172
|
+
className: "h-full overflow-y-auto",
|
|
173
|
+
children: track
|
|
174
|
+
}) : /* @__PURE__ */ jsx(ScrollArea, {
|
|
175
|
+
className: "h-full",
|
|
176
|
+
children: track
|
|
177
|
+
})
|
|
178
|
+
}) : track
|
|
179
|
+
] })
|
|
180
|
+
};
|
|
181
|
+
return /* @__PURE__ */ jsx(EventCalendarViewContext.Provider, {
|
|
182
|
+
value: { view },
|
|
183
|
+
children: useRender({
|
|
184
|
+
defaultTagName: "div",
|
|
185
|
+
render,
|
|
186
|
+
props: mergeProps(defaultProps, props)
|
|
187
|
+
})
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
function EventCalendarDayHeader({ day, view }) {
|
|
191
|
+
const settings = useEventCalendarSettings();
|
|
192
|
+
const viewConfig = useEventCalendarViewConfig();
|
|
193
|
+
const { isToday } = useEventCalendarDay(day);
|
|
194
|
+
return /* @__PURE__ */ jsx("div", {
|
|
195
|
+
"data-slot": "event-calendar-day-header",
|
|
196
|
+
"data-today": isToday || void 0,
|
|
197
|
+
className: cn("min-w-0 truncate border-e px-2 py-1.5 font-medium last:border-e-0 data-today:text-primary", isToday && viewConfig.todayClassName),
|
|
198
|
+
children: viewConfig.renderDayHeader?.({
|
|
199
|
+
day,
|
|
200
|
+
view,
|
|
201
|
+
isToday
|
|
202
|
+
}) ?? format(toZoned(day, settings.timeZone), settings.i18n.formats.timeGridDayHeader, { locale: settings.locale })
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Continuous all-day bars for the week/N-days all-day row: consecutive-day
|
|
207
|
+
* segments of one occurrence merge into a single bar spanning its columns
|
|
208
|
+
* (same treatment as the month view), lane-packed. Returns CLONED segments -
|
|
209
|
+
* the shared per-day segments must stay pristine (see packWeekRowLanes).
|
|
210
|
+
*/
|
|
211
|
+
function useEventCalendarAllDayBars(days) {
|
|
212
|
+
const instance = useEventCalendar();
|
|
213
|
+
const settings = useEventCalendarSettings();
|
|
214
|
+
return useEventCalendarSelector(() => {
|
|
215
|
+
const byDay = instance.internals.getIndex().byDay;
|
|
216
|
+
const merged = /* @__PURE__ */ new Map();
|
|
217
|
+
days.forEach((day, col) => {
|
|
218
|
+
for (const seg of byDay.get(getDayKey(day, settings.timeZone))?.allDay ?? []) {
|
|
219
|
+
const key = seg.occurrence.key;
|
|
220
|
+
const bar = merged.get(key);
|
|
221
|
+
if (bar) {
|
|
222
|
+
bar.colEnd = col;
|
|
223
|
+
bar.isEnd = seg.isEnd;
|
|
224
|
+
} else merged.set(key, {
|
|
225
|
+
seg,
|
|
226
|
+
colStart: col,
|
|
227
|
+
colEnd: col,
|
|
228
|
+
isStart: seg.isStart,
|
|
229
|
+
isEnd: seg.isEnd,
|
|
230
|
+
lane: 0
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
const packed = Array.from(merged.values()).sort((a, b) => a.colStart - b.colStart || b.colEnd - b.colStart - (a.colEnd - a.colStart) || a.seg.occurrence.key.localeCompare(b.seg.occurrence.key));
|
|
235
|
+
const lanes = [];
|
|
236
|
+
for (const bar of packed) {
|
|
237
|
+
let lane = 0;
|
|
238
|
+
for (;;) {
|
|
239
|
+
lanes[lane] ??= new Array(days.length).fill(false);
|
|
240
|
+
let free = true;
|
|
241
|
+
for (let c = bar.colStart; c <= bar.colEnd; c++) if (lanes[lane][c]) {
|
|
242
|
+
free = false;
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
if (free) break;
|
|
246
|
+
lane++;
|
|
247
|
+
}
|
|
248
|
+
for (let c = bar.colStart; c <= bar.colEnd; c++) lanes[lane][c] = true;
|
|
249
|
+
bar.lane = lane;
|
|
250
|
+
}
|
|
251
|
+
return {
|
|
252
|
+
bars: packed.map((bar) => ({
|
|
253
|
+
...bar.seg,
|
|
254
|
+
isStart: bar.isStart,
|
|
255
|
+
isEnd: bar.isEnd,
|
|
256
|
+
continuesBefore: !bar.isStart,
|
|
257
|
+
continuesAfter: !bar.isEnd,
|
|
258
|
+
colStart: bar.colStart,
|
|
259
|
+
colSpan: bar.colEnd - bar.colStart + 1,
|
|
260
|
+
lane: bar.lane
|
|
261
|
+
})),
|
|
262
|
+
laneCount: lanes.length
|
|
263
|
+
};
|
|
264
|
+
}, {
|
|
265
|
+
calendar: instance,
|
|
266
|
+
isEqual: (a, b) => a.laneCount === b.laneCount && a.bars.length === b.bars.length && a.bars.every((s, i) => {
|
|
267
|
+
const o = b.bars[i];
|
|
268
|
+
return s.occurrence === o.occurrence && s.colStart === o.colStart && s.colSpan === o.colSpan && s.lane === o.lane && s.isStart === o.isStart && s.isEnd === o.isEnd;
|
|
269
|
+
})
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* The all-day row body: drop-target cells underneath, one continuous bar per
|
|
274
|
+
* occurrence in an overlay grid on top (month-view treatment), plus the
|
|
275
|
+
* standardized day-granular drag ghost for moves/resizes in this lane.
|
|
276
|
+
*/
|
|
277
|
+
function EventCalendarAllDayBars({ days, gridTemplateColumns }) {
|
|
278
|
+
const settings = useEventCalendarSettings();
|
|
279
|
+
const viewConfig = useEventCalendarViewConfig();
|
|
280
|
+
const { bars, laneCount } = useEventCalendarAllDayBars(days);
|
|
281
|
+
const dragGhost = useEventCalendarSelector((state) => {
|
|
282
|
+
const drag = state.drag;
|
|
283
|
+
if (!drag?.proposedDayGranular) return null;
|
|
284
|
+
const tz = settings.timeZone;
|
|
285
|
+
const startMs = zonedStartOfDay(drag.proposedStart, tz).getTime();
|
|
286
|
+
const lastMs = zonedStartOfDay(/* @__PURE__ */ new Date(drag.proposedEnd.getTime() - 1), tz).getTime();
|
|
287
|
+
let colStart = -1;
|
|
288
|
+
let colEnd = -1;
|
|
289
|
+
days.forEach((day, i) => {
|
|
290
|
+
const t = zonedStartOfDay(day, tz).getTime();
|
|
291
|
+
if (t >= startMs && t <= lastMs) {
|
|
292
|
+
if (colStart === -1) colStart = i;
|
|
293
|
+
colEnd = i;
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
if (colStart === -1) return null;
|
|
297
|
+
return {
|
|
298
|
+
kind: drag.kind,
|
|
299
|
+
valid: drag.valid,
|
|
300
|
+
occurrence: drag.occurrence,
|
|
301
|
+
proposedStart: drag.proposedStart,
|
|
302
|
+
proposedEnd: drag.proposedEnd,
|
|
303
|
+
colStart,
|
|
304
|
+
colSpan: colEnd - colStart + 1,
|
|
305
|
+
isStart: zonedStartOfDay(days[colStart], tz).getTime() <= startMs,
|
|
306
|
+
isEnd: zonedStartOfDay(days[colEnd], tz).getTime() >= lastMs,
|
|
307
|
+
color: drag.occurrence.event.color
|
|
308
|
+
};
|
|
309
|
+
}, { isEqual: (a, b) => a === b || a !== null && b !== null && a.colStart === b.colStart && a.colSpan === b.colSpan && a.valid === b.valid && a.kind === b.kind && a.proposedStart.getTime() === b.proposedStart.getTime() && a.proposedEnd.getTime() === b.proposedEnd.getTime() });
|
|
310
|
+
const ghostLane = dragGhost ? bars.find((s) => s.occurrence.key === dragGhost.occurrence.key)?.lane ?? laneCount : 0;
|
|
311
|
+
const effectiveLanes = Math.max(laneCount, dragGhost ? ghostLane + 1 : 0);
|
|
312
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
313
|
+
className: "relative min-w-0 flex-1",
|
|
314
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
315
|
+
className: "grid h-full",
|
|
316
|
+
style: {
|
|
317
|
+
gridTemplateColumns,
|
|
318
|
+
minHeight: `calc(${Math.max(effectiveLanes, 1)} * var(--ec-month-bar-h, 1.625rem) + 0.625rem)`
|
|
319
|
+
},
|
|
320
|
+
children: days.map((day) => /* @__PURE__ */ jsx(EventCalendarAllDayCell, { day }, day.getTime()))
|
|
321
|
+
}), (bars.length > 0 || dragGhost) && /* @__PURE__ */ jsxs("div", {
|
|
322
|
+
"data-slot": "event-calendar-all-day-bar-overlay",
|
|
323
|
+
className: "pointer-events-none absolute inset-x-0 top-0 grid pt-1.5",
|
|
324
|
+
style: {
|
|
325
|
+
gridTemplateColumns,
|
|
326
|
+
gridAutoRows: "var(--ec-month-bar-h, 1.625rem)"
|
|
327
|
+
},
|
|
328
|
+
children: [bars.map((segment) => /* @__PURE__ */ jsx("div", {
|
|
329
|
+
className: cn("pointer-events-auto min-w-0 px-1", viewConfig.classNames?.monthBar),
|
|
330
|
+
style: {
|
|
331
|
+
gridColumn: `${(segment.colStart ?? 0) + 1} / span ${segment.colSpan ?? 1}`,
|
|
332
|
+
gridRow: (segment.lane ?? 0) + 1
|
|
333
|
+
},
|
|
334
|
+
children: /* @__PURE__ */ jsx(EventCalendarEvent, {
|
|
335
|
+
segment,
|
|
336
|
+
className: "h-[calc(var(--ec-month-bar-h,1.625rem)-0.125rem)]"
|
|
337
|
+
})
|
|
338
|
+
}, segment.occurrence.key)), dragGhost && /* @__PURE__ */ jsx("div", {
|
|
339
|
+
"aria-hidden": true,
|
|
340
|
+
className: cn("min-w-0 px-1", viewConfig.classNames?.monthBar),
|
|
341
|
+
style: {
|
|
342
|
+
gridColumn: `${dragGhost.colStart + 1} / span ${dragGhost.colSpan}`,
|
|
343
|
+
gridRow: ghostLane + 1
|
|
344
|
+
},
|
|
345
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
346
|
+
"data-slot": "event-calendar-drag-ghost",
|
|
347
|
+
"data-kind": dragGhost.kind,
|
|
348
|
+
"data-drop-invalid": !dragGhost.valid || void 0,
|
|
349
|
+
className: cn("h-[calc(var(--ec-month-bar-h,1.625rem)-0.125rem)]", dragGhost.kind === "move" ? cn(EVENT_CALENDAR_GHOST.move, !dragGhost.valid && EVENT_CALENDAR_GHOST.invalid) : cn(EVENT_CALENDAR_GHOST.resize, !dragGhost.valid && EVENT_CALENDAR_GHOST.invalidResize), viewConfig.classNames?.dragGhost),
|
|
350
|
+
style: { "--ec-event-color": dragGhost.color ?? "var(--color-primary)" },
|
|
351
|
+
children: dragGhost.kind !== "move" && /* @__PURE__ */ jsx(EventCalendarEvent, {
|
|
352
|
+
preview: true,
|
|
353
|
+
segment: {
|
|
354
|
+
occurrence: {
|
|
355
|
+
...dragGhost.occurrence,
|
|
356
|
+
start: dragGhost.proposedStart,
|
|
357
|
+
end: dragGhost.proposedEnd
|
|
358
|
+
},
|
|
359
|
+
day: days[dragGhost.colStart] ?? days[0],
|
|
360
|
+
isStart: dragGhost.isStart,
|
|
361
|
+
isEnd: dragGhost.isEnd,
|
|
362
|
+
continuesBefore: !dragGhost.isStart,
|
|
363
|
+
continuesAfter: !dragGhost.isEnd
|
|
364
|
+
},
|
|
365
|
+
className: cn("inset-ring-0 h-full", !dragGhost.valid && EVENT_CALENDAR_GHOST.invalidContent)
|
|
366
|
+
})
|
|
367
|
+
})
|
|
368
|
+
})]
|
|
369
|
+
})]
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
function EventCalendarAllDayCell({ day }) {
|
|
373
|
+
const settings = useEventCalendarSettings();
|
|
374
|
+
const viewConfig = useEventCalendarViewConfig();
|
|
375
|
+
const { view } = useEventCalendarViewContext();
|
|
376
|
+
const { effective } = useEventCalendarViewSettings();
|
|
377
|
+
const gestures = useEventCalendarGestures();
|
|
378
|
+
const dayStart = zonedStartOfDay(day, settings.timeZone);
|
|
379
|
+
const dayEnd = addDays(toZoned(dayStart, settings.timeZone), 1);
|
|
380
|
+
const isOff = resolveOffDay(day, settings.timeZone, effective.offDays ? typeof viewConfig.offDays === "object" ? viewConfig.offDays : true : false);
|
|
381
|
+
const offClassName = typeof viewConfig.offDays === "object" && viewConfig.offDays.className || "bg-muted/25";
|
|
382
|
+
const isDropTarget = useEventCalendarSelector((state) => {
|
|
383
|
+
const drag = state.drag;
|
|
384
|
+
if (!drag?.proposedDayGranular) return null;
|
|
385
|
+
if (!(drag.proposedStart < dayEnd && drag.proposedEnd > dayStart)) return null;
|
|
386
|
+
return drag.valid ? "valid" : "invalid";
|
|
387
|
+
});
|
|
388
|
+
const inDraft = useEventCalendarSelector((state) => {
|
|
389
|
+
const draft = state.slotDraft;
|
|
390
|
+
if (!draft?.allDay) return null;
|
|
391
|
+
if (draft.start >= dayEnd || draft.end <= dayStart) return null;
|
|
392
|
+
return {
|
|
393
|
+
isStart: draft.start >= dayStart,
|
|
394
|
+
isEnd: draft.end <= dayEnd
|
|
395
|
+
};
|
|
396
|
+
}, { isEqual: (a, b) => a === b || a !== null && b !== null && a.isStart === b.isStart && a.isEnd === b.isEnd });
|
|
397
|
+
return /* @__PURE__ */ jsx("div", {
|
|
398
|
+
"data-slot": "event-calendar-all-day-cell",
|
|
399
|
+
"data-ec-day": dayStart.getTime(),
|
|
400
|
+
"data-drop-target": isDropTarget ?? void 0,
|
|
401
|
+
"data-off": isOff || void 0,
|
|
402
|
+
className: cn("relative flex min-w-0 flex-col gap-0.5 border-e px-1 py-1.5 last:border-e-0", isOff && offClassName, viewConfig.dayClassName?.(day), inDraft && cn("bg-primary/10", viewConfig.classNames?.slotDraft), viewConfig.classNames?.allDayCell),
|
|
403
|
+
onPointerDown: (e) => {
|
|
404
|
+
if (e.target === e.currentTarget) gestures.beginCreate(e, day, true);
|
|
405
|
+
},
|
|
406
|
+
onClick: (e) => {
|
|
407
|
+
if (e.target === e.currentTarget && !wasRecentDrag() && !wasRecentChipPress()) settings.onSlotClick?.({
|
|
408
|
+
date: dayStart,
|
|
409
|
+
allDay: true,
|
|
410
|
+
view
|
|
411
|
+
}, e);
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
function EventCalendarTimeGutter({ days, slots, startHour, interval }) {
|
|
416
|
+
const settings = useEventCalendarSettings();
|
|
417
|
+
const viewConfig = useEventCalendarViewConfig();
|
|
418
|
+
const referenceDay = days[0] ?? /* @__PURE__ */ new Date();
|
|
419
|
+
const labelFormat = interval % 60 === 0 ? settings.i18n.formats.timeGutter : settings.i18n.formats.timeGutterMinute;
|
|
420
|
+
return /* @__PURE__ */ jsx("div", {
|
|
421
|
+
"data-slot": "event-calendar-time-gutter",
|
|
422
|
+
className: cn("relative w-(--ec-gutter-width,4.5rem) shrink-0 border-e", viewConfig.classNames?.timeGutter),
|
|
423
|
+
children: slots.map((minutes) => {
|
|
424
|
+
const time = addMinutes(zonedStartOfDay(referenceDay, settings.timeZone), minutes);
|
|
425
|
+
const label = viewConfig.renderTimeGutterSlot?.({
|
|
426
|
+
time,
|
|
427
|
+
hour: Math.floor(minutes / 60),
|
|
428
|
+
minute: minutes % 60
|
|
429
|
+
}) ?? (minutes > startHour * 60 ? format(time, labelFormat, { locale: settings.locale }) : null);
|
|
430
|
+
return /* @__PURE__ */ jsx("div", {
|
|
431
|
+
className: "relative",
|
|
432
|
+
style: { height: `calc(var(--ec-hour-height) * ${interval / 60})` },
|
|
433
|
+
children: label != null && /* @__PURE__ */ jsx("span", {
|
|
434
|
+
className: cn("absolute end-2.5 -top-2 text-muted-foreground", viewConfig.classNames?.timeGutterLabel),
|
|
435
|
+
children: label
|
|
436
|
+
})
|
|
437
|
+
}, minutes);
|
|
438
|
+
})
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
/** Absolute overlay block positioned by minutes (ghosts + drafts). */
|
|
442
|
+
function minuteBlockStyle(startMin, endMin, boundsStartMin) {
|
|
443
|
+
const top = (startMin - boundsStartMin) / 60;
|
|
444
|
+
const height = Math.max((endMin - startMin) / 60, .25);
|
|
445
|
+
return {
|
|
446
|
+
top: `calc(var(--ec-hour-height) * ${top})`,
|
|
447
|
+
height: `calc(var(--ec-hour-height) * ${height})`
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
function EventCalendarDayColumn({ day, startHour, endHour, interval }) {
|
|
451
|
+
const settings = useEventCalendarSettings();
|
|
452
|
+
const viewConfig = useEventCalendarViewConfig();
|
|
453
|
+
const { effective } = useEventCalendarViewSettings();
|
|
454
|
+
const { view } = useEventCalendarViewContext();
|
|
455
|
+
const gestures = useEventCalendarGestures();
|
|
456
|
+
const { segments, isToday } = useEventCalendarDay(day);
|
|
457
|
+
const isOff = resolveOffDay(day, settings.timeZone, effective.offDays ? typeof viewConfig.offDays === "object" ? viewConfig.offDays : true : false);
|
|
458
|
+
const offClassName = typeof viewConfig.offDays === "object" && viewConfig.offDays.className || "bg-muted/25";
|
|
459
|
+
const timeZone = settings.timeZone;
|
|
460
|
+
const dayStart = zonedStartOfDay(day, timeZone);
|
|
461
|
+
const dayEnd = addDays(toZoned(dayStart, timeZone), 1);
|
|
462
|
+
const totalMinutes = getDayTotalMinutes(day, timeZone);
|
|
463
|
+
const boundsStartMin = startHour * 60;
|
|
464
|
+
const boundsEndMin = Math.min(endHour * 60, totalMinutes);
|
|
465
|
+
const boundsMinutes = Math.max(60, boundsEndMin - boundsStartMin);
|
|
466
|
+
const windowFor = (start, end) => {
|
|
467
|
+
if (start >= dayEnd || end <= dayStart) return null;
|
|
468
|
+
const from = Math.max(differenceInMinutes(start > dayStart ? start : dayStart, dayStart), boundsStartMin);
|
|
469
|
+
const to = Math.min(differenceInMinutes(end < dayEnd ? end : dayEnd, dayStart), boundsEndMin);
|
|
470
|
+
return to > from ? [from, to] : null;
|
|
471
|
+
};
|
|
472
|
+
const dragGhost = useEventCalendarSelector((state) => {
|
|
473
|
+
const drag = state.drag;
|
|
474
|
+
if (!drag || drag.proposedDayGranular) return null;
|
|
475
|
+
const window = windowFor(drag.proposedStart, drag.proposedEnd);
|
|
476
|
+
if (!window) return null;
|
|
477
|
+
return {
|
|
478
|
+
valid: drag.valid,
|
|
479
|
+
kind: drag.kind,
|
|
480
|
+
occurrence: drag.occurrence,
|
|
481
|
+
proposedStart: drag.proposedStart,
|
|
482
|
+
proposedEnd: drag.proposedEnd,
|
|
483
|
+
window,
|
|
484
|
+
color: drag.occurrence.event.color,
|
|
485
|
+
title: drag.occurrence.event.title
|
|
486
|
+
};
|
|
487
|
+
}, { isEqual: (a, b) => a === b || a !== null && b !== null && a.window[0] === b.window[0] && a.window[1] === b.window[1] && a.valid === b.valid && a.kind === b.kind && a.proposedStart.getTime() === b.proposedStart.getTime() && a.proposedEnd.getTime() === b.proposedEnd.getTime() });
|
|
488
|
+
const draftWindow = useEventCalendarSelector((state) => {
|
|
489
|
+
const draft = state.slotDraft;
|
|
490
|
+
if (!draft || draft.allDay) return null;
|
|
491
|
+
return windowFor(draft.start, draft.end);
|
|
492
|
+
}, { isEqual: (a, b) => a === b || a !== null && b !== null && a[0] === b[0] && a[1] === b[1] });
|
|
493
|
+
const slotFromPointer = (e) => {
|
|
494
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
495
|
+
const pxPerMinute = rect.height / boundsMinutes;
|
|
496
|
+
const minutes = snapMinutes(boundsStartMin + (e.clientY - rect.top) / pxPerMinute, settings.snapDuration);
|
|
497
|
+
const clamped = Math.min(Math.max(minutes, boundsStartMin), boundsEndMin - settings.slotDuration);
|
|
498
|
+
return {
|
|
499
|
+
date: addMinutes(dayStart, clamped),
|
|
500
|
+
end: addMinutes(dayStart, clamped + settings.slotDuration)
|
|
501
|
+
};
|
|
502
|
+
};
|
|
503
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
504
|
+
"data-slot": "event-calendar-day-column",
|
|
505
|
+
"data-today": isToday || void 0,
|
|
506
|
+
"data-off": isOff || void 0,
|
|
507
|
+
"data-ec-day": dayStart.getTime(),
|
|
508
|
+
"data-ec-bounds-start": boundsStartMin,
|
|
509
|
+
"data-ec-bounds-end": boundsEndMin,
|
|
510
|
+
role: "group",
|
|
511
|
+
"aria-label": format(toZoned(day, timeZone), settings.i18n.formats.dayAria, { locale: settings.locale }),
|
|
512
|
+
className: cn("relative min-w-0 border-e last:border-e-0", isOff && offClassName, isToday && viewConfig.todayClassName, viewConfig.dayClassName?.(day), viewConfig.classNames?.dayColumn),
|
|
513
|
+
style: {
|
|
514
|
+
height: `calc(var(--ec-hour-height) * ${boundsMinutes / 60})`,
|
|
515
|
+
backgroundImage: `repeating-linear-gradient(to bottom, transparent, transparent calc(var(--ec-hour-height) * ${interval / 60} - var(--ec-slot-line-width, 1px)), var(--ec-slot-line-color, var(--color-border)) calc(var(--ec-hour-height) * ${interval / 60} - var(--ec-slot-line-width, 1px)), var(--ec-slot-line-color, var(--color-border)) calc(var(--ec-hour-height) * ${interval / 60}))`
|
|
516
|
+
},
|
|
517
|
+
onPointerDown: (e) => {
|
|
518
|
+
if (e.target === e.currentTarget) gestures.beginCreate(e, day, false);
|
|
519
|
+
},
|
|
520
|
+
onClick: (e) => {
|
|
521
|
+
if (e.target !== e.currentTarget || wasRecentDrag() || wasRecentChipPress()) return;
|
|
522
|
+
const slot = slotFromPointer(e);
|
|
523
|
+
settings.onSlotClick?.({
|
|
524
|
+
...slot,
|
|
525
|
+
allDay: false,
|
|
526
|
+
view
|
|
527
|
+
}, e);
|
|
528
|
+
},
|
|
529
|
+
children: [
|
|
530
|
+
viewConfig.renderDayColumnBackground && /* @__PURE__ */ jsx("div", {
|
|
531
|
+
className: "pointer-events-none absolute inset-0",
|
|
532
|
+
children: viewConfig.renderDayColumnBackground({
|
|
533
|
+
day,
|
|
534
|
+
boundsStartMin,
|
|
535
|
+
boundsEndMin,
|
|
536
|
+
totalMinutes
|
|
537
|
+
})
|
|
538
|
+
}),
|
|
539
|
+
segments.timed.map((segment) => {
|
|
540
|
+
const startMin = Math.max(segment.startMin ?? 0, boundsStartMin);
|
|
541
|
+
const endMin = Math.min(segment.endMin ?? startMin, boundsEndMin);
|
|
542
|
+
if (endMin <= boundsStartMin || startMin >= boundsEndMin) return null;
|
|
543
|
+
const columnCount = segment.columnCount ?? 1;
|
|
544
|
+
const column = segment.column ?? 0;
|
|
545
|
+
const span = segment.columnSpan ?? 1;
|
|
546
|
+
const zIndex = segment.occurrence.event.zIndex ?? 10 + column;
|
|
547
|
+
const colPct = 100 / columnCount;
|
|
548
|
+
return /* @__PURE__ */ jsx("div", {
|
|
549
|
+
className: "absolute z-(--ec-z) min-h-(--ec-event-min-h,1.5rem) px-0.5 hover:z-40",
|
|
550
|
+
style: {
|
|
551
|
+
...minuteBlockStyle(startMin, endMin, boundsStartMin),
|
|
552
|
+
left: `${column * colPct}%`,
|
|
553
|
+
width: `${span * colPct}%`,
|
|
554
|
+
"--ec-z": zIndex
|
|
555
|
+
},
|
|
556
|
+
children: /* @__PURE__ */ jsx(EventCalendarEvent, {
|
|
557
|
+
segment,
|
|
558
|
+
className: cn(columnCount > 1 && "ring-1 ring-background", endMin - startMin < viewConfig.compactEventMinutes ? "h-full gap-1 py-0 leading-4" : "h-full flex-col items-start justify-start gap-0 py-1", viewConfig.classNames?.timedChip)
|
|
559
|
+
})
|
|
560
|
+
}, segment.occurrence.key);
|
|
561
|
+
}),
|
|
562
|
+
dragGhost && /* @__PURE__ */ jsx("div", {
|
|
563
|
+
"data-slot": "event-calendar-drag-ghost",
|
|
564
|
+
"data-kind": dragGhost.kind,
|
|
565
|
+
"data-drop-invalid": !dragGhost.valid || void 0,
|
|
566
|
+
className: cn("pointer-events-none absolute inset-x-0.5 z-50 min-h-(--ec-event-min-h,1.5rem)", dragGhost.kind === "move" ? cn(EVENT_CALENDAR_GHOST.move, !dragGhost.valid && EVENT_CALENDAR_GHOST.invalid) : cn(EVENT_CALENDAR_GHOST.resize, !dragGhost.valid && EVENT_CALENDAR_GHOST.invalidResize), viewConfig.classNames?.dragGhost),
|
|
567
|
+
style: {
|
|
568
|
+
...minuteBlockStyle(dragGhost.window[0], dragGhost.window[1], boundsStartMin),
|
|
569
|
+
"--ec-event-color": dragGhost.color ?? "var(--color-primary)"
|
|
570
|
+
},
|
|
571
|
+
children: dragGhost.kind !== "move" && /* @__PURE__ */ jsx(EventCalendarEvent, {
|
|
572
|
+
preview: true,
|
|
573
|
+
segment: {
|
|
574
|
+
occurrence: {
|
|
575
|
+
...dragGhost.occurrence,
|
|
576
|
+
start: dragGhost.proposedStart,
|
|
577
|
+
end: dragGhost.proposedEnd,
|
|
578
|
+
allDay: false
|
|
579
|
+
},
|
|
580
|
+
day,
|
|
581
|
+
isStart: true,
|
|
582
|
+
isEnd: true,
|
|
583
|
+
continuesBefore: false,
|
|
584
|
+
continuesAfter: false,
|
|
585
|
+
startMin: dragGhost.window[0],
|
|
586
|
+
endMin: dragGhost.window[1]
|
|
587
|
+
},
|
|
588
|
+
className: cn(dragGhost.window[1] - dragGhost.window[0] < viewConfig.compactEventMinutes ? "h-full gap-1 py-0 leading-4" : "h-full flex-col items-start justify-start gap-0 py-1", viewConfig.classNames?.timedChip, "inset-ring-0", !dragGhost.valid && EVENT_CALENDAR_GHOST.invalidContent)
|
|
589
|
+
})
|
|
590
|
+
}),
|
|
591
|
+
draftWindow && /* @__PURE__ */ jsx("div", {
|
|
592
|
+
"data-slot": "event-calendar-slot-draft",
|
|
593
|
+
className: cn("pointer-events-none absolute inset-x-0.5 z-40 rounded-sm border border-primary/40 border-dashed bg-primary/5", viewConfig.classNames?.slotDraft),
|
|
594
|
+
style: minuteBlockStyle(draftWindow[0], draftWindow[1], boundsStartMin)
|
|
595
|
+
})
|
|
596
|
+
]
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
function EventCalendarNowIndicator({ days, startHour, endHour }) {
|
|
600
|
+
const settings = useEventCalendarSettings();
|
|
601
|
+
const viewConfig = useEventCalendarViewConfig();
|
|
602
|
+
const now = useNow(viewConfig.nowIndicatorInterval);
|
|
603
|
+
const timeZone = settings.timeZone;
|
|
604
|
+
const todayKey = getDayKey(now, timeZone);
|
|
605
|
+
const todayIndex = days.findIndex((day) => getDayKey(day, timeZone) === todayKey);
|
|
606
|
+
if (todayIndex === -1) return null;
|
|
607
|
+
const minutes = differenceInMinutes(now, zonedStartOfDay(now, timeZone));
|
|
608
|
+
if (minutes < startHour * 60 || minutes > endHour * 60) return null;
|
|
609
|
+
const top = minutes / 60 - startHour;
|
|
610
|
+
if (viewConfig.renderNowIndicator) return /* @__PURE__ */ jsx("div", {
|
|
611
|
+
className: "pointer-events-none absolute inset-x-0 z-40",
|
|
612
|
+
style: { top: `calc(var(--ec-hour-height) * ${top})` },
|
|
613
|
+
children: viewConfig.renderNowIndicator({ time: now })
|
|
614
|
+
});
|
|
615
|
+
const columnWidthPct = 100 / days.length;
|
|
616
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
617
|
+
"data-slot": "event-calendar-now-indicator",
|
|
618
|
+
className: "pointer-events-none absolute inset-x-0 z-40",
|
|
619
|
+
style: { top: `calc(var(--ec-hour-height) * ${top})` },
|
|
620
|
+
children: [/* @__PURE__ */ jsx("div", { className: "absolute start-(--ec-gutter-width,4.5rem) end-0 h-px bg-destructive/40" }), /* @__PURE__ */ jsxs("div", {
|
|
621
|
+
className: "absolute h-px",
|
|
622
|
+
style: {
|
|
623
|
+
left: `calc(var(--ec-gutter-width, 4.5rem) + (100% - var(--ec-gutter-width, 4.5rem)) * ${todayIndex * columnWidthPct / 100})`,
|
|
624
|
+
width: `calc((100% - var(--ec-gutter-width, 4.5rem)) * ${columnWidthPct / 100})`
|
|
625
|
+
},
|
|
626
|
+
children: [/* @__PURE__ */ jsx("div", { className: "absolute inset-x-0 top-0 h-px bg-destructive" }), /* @__PURE__ */ jsx("div", { className: "absolute -start-1 top-0 size-1.5 -translate-y-1/2 rounded-full bg-destructive" })]
|
|
627
|
+
})]
|
|
628
|
+
});
|
|
629
|
+
}
|
|
630
|
+
function EventCalendarWeekView(props) {
|
|
631
|
+
return /* @__PURE__ */ jsx(EventCalendarTimeGrid, {
|
|
632
|
+
view: "week",
|
|
633
|
+
...props
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
function EventCalendarDayView(props) {
|
|
637
|
+
return /* @__PURE__ */ jsx(EventCalendarTimeGrid, {
|
|
638
|
+
view: "day",
|
|
639
|
+
...props
|
|
640
|
+
});
|
|
641
|
+
}
|
|
642
|
+
function EventCalendarDaysView(props) {
|
|
643
|
+
return /* @__PURE__ */ jsx(EventCalendarTimeGrid, {
|
|
644
|
+
view: "days",
|
|
645
|
+
...props
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
//#endregion
|
|
649
|
+
export { EventCalendarDayView, EventCalendarDaysView, EventCalendarNowIndicator, EventCalendarTimeGrid, EventCalendarTimeGutter, EventCalendarWeekView, minuteBlockStyle, useNow };
|
|
650
|
+
|
|
651
|
+
//# sourceMappingURL=event-calendar-time-grid.js.map
|