@kumix/ui 0.1.3 → 0.2.1
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 +42 -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,817 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { mergeEventCalendarI18n } from "./event-calendar-i18n.js";
|
|
3
|
+
import { buildEventIndex, defaultEventOrder, eventsOverlap, getDayKey, getRangeKey, getViewDateRange, stepDate, toZoned, zonedStartOfDay } from "./event-calendar-lib.js";
|
|
4
|
+
import { createContext, useCallback, useContext, useEffect, useLayoutEffect, useRef, useState, useSyncExternalStore } from "react";
|
|
5
|
+
import { cn } from "@kumix/utils";
|
|
6
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
8
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
9
|
+
import { addDays } from "date-fns";
|
|
10
|
+
//#region src/components/reui/event-calendar/event-calendar.tsx
|
|
11
|
+
const BASE_VIEWS = [
|
|
12
|
+
"month",
|
|
13
|
+
"week",
|
|
14
|
+
"day",
|
|
15
|
+
"days",
|
|
16
|
+
"agenda"
|
|
17
|
+
];
|
|
18
|
+
const ALL_VIEWS = [...BASE_VIEWS, "resource"];
|
|
19
|
+
const DEFAULT_INTERACTIONS = {
|
|
20
|
+
drag: true,
|
|
21
|
+
resize: true,
|
|
22
|
+
selectSlot: true
|
|
23
|
+
};
|
|
24
|
+
const EMPTY_SELECTION = {
|
|
25
|
+
eventKeys: [],
|
|
26
|
+
slot: null
|
|
27
|
+
};
|
|
28
|
+
function resolveSettings(options) {
|
|
29
|
+
const { events: _e, defaultEvents: _de, view: _v, defaultView: _dv, date: _d, defaultDate: _dd, dayCount: _dc, defaultDayCount: _ddc, selection: _s, defaultSelection: _ds, interactions: _i, defaultInteractions: _di, viewSettings: _vs, defaultViewSettings: _dvs, loading: _l, ...rest } = options;
|
|
30
|
+
return {
|
|
31
|
+
...rest,
|
|
32
|
+
timeZone: options.timeZone ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
33
|
+
locale: options.locale,
|
|
34
|
+
weekStartsOn: options.weekStartsOn ?? 0,
|
|
35
|
+
views: options.views ?? (options.resources?.length ? ALL_VIEWS : BASE_VIEWS),
|
|
36
|
+
dayStartHour: options.dayStartHour ?? 0,
|
|
37
|
+
dayEndHour: options.dayEndHour ?? 24,
|
|
38
|
+
slotDuration: options.slotDuration ?? 30,
|
|
39
|
+
snapDuration: options.snapDuration ?? 15,
|
|
40
|
+
agendaDayCount: options.agendaDayCount ?? 30,
|
|
41
|
+
fixedWeeks: options.fixedWeeks ?? true,
|
|
42
|
+
showOutsideDays: options.showOutsideDays ?? true,
|
|
43
|
+
i18n: mergeEventCalendarI18n(options.i18n),
|
|
44
|
+
resources: options.resources ?? [],
|
|
45
|
+
getEventPriority: options.getEventPriority ?? ((event) => event.priority ?? 0),
|
|
46
|
+
eventOrder: options.eventOrder ?? defaultEventOrder,
|
|
47
|
+
getOccurrences: options.getOccurrences,
|
|
48
|
+
weekendDays: options.weekendDays ?? [0, 6],
|
|
49
|
+
activation: options.activation
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
const warned = /* @__PURE__ */ new Set();
|
|
53
|
+
function warnOnce(key, message) {
|
|
54
|
+
if (process.env.NODE_ENV !== "production" && !warned.has(key)) {
|
|
55
|
+
warned.add(key);
|
|
56
|
+
console.warn(`[event-calendar] ${message}`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function createEventCalendarStore(initial) {
|
|
60
|
+
let options = initial;
|
|
61
|
+
let settings = resolveSettings(initial);
|
|
62
|
+
let settingsVersion = 0;
|
|
63
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
64
|
+
const resolveView = (view) => {
|
|
65
|
+
if (settings.views.includes(view)) return view;
|
|
66
|
+
const fallback = settings.views[0] ?? "month";
|
|
67
|
+
warnOnce(`view-${view}`, `view "${view}" is not in views [${settings.views.join(", ")}]; falling back to "${fallback}".`);
|
|
68
|
+
return fallback;
|
|
69
|
+
};
|
|
70
|
+
const internal = {
|
|
71
|
+
view: resolveView(initial.defaultView ?? "month"),
|
|
72
|
+
date: initial.defaultDate ?? /* @__PURE__ */ new Date(),
|
|
73
|
+
dayCount: initial.defaultDayCount ?? 3,
|
|
74
|
+
events: initial.defaultEvents ?? [],
|
|
75
|
+
selection: initial.defaultSelection ?? EMPTY_SELECTION,
|
|
76
|
+
interactions: {
|
|
77
|
+
...DEFAULT_INTERACTIONS,
|
|
78
|
+
...initial.defaultInteractions
|
|
79
|
+
},
|
|
80
|
+
viewSettings: initial.defaultViewSettings ?? {},
|
|
81
|
+
drag: null,
|
|
82
|
+
slotDraft: null
|
|
83
|
+
};
|
|
84
|
+
let snapshot = null;
|
|
85
|
+
let indexCache = null;
|
|
86
|
+
let scrollHandler = null;
|
|
87
|
+
let rootEl = null;
|
|
88
|
+
let lastEmittedRangeKey = null;
|
|
89
|
+
let interactionsCache = null;
|
|
90
|
+
const mergedInteractions = (input) => {
|
|
91
|
+
if (interactionsCache?.input !== input) interactionsCache = {
|
|
92
|
+
input,
|
|
93
|
+
merged: {
|
|
94
|
+
...DEFAULT_INTERACTIONS,
|
|
95
|
+
...input
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
return interactionsCache.merged;
|
|
99
|
+
};
|
|
100
|
+
const invalidate = () => {
|
|
101
|
+
snapshot = null;
|
|
102
|
+
};
|
|
103
|
+
const notify = () => {
|
|
104
|
+
for (const listener of listeners) listener();
|
|
105
|
+
emitRangeIfChanged();
|
|
106
|
+
};
|
|
107
|
+
const getState = () => {
|
|
108
|
+
if (snapshot) return snapshot;
|
|
109
|
+
const view = resolveView(options.view ?? internal.view);
|
|
110
|
+
const date = options.date ?? internal.date;
|
|
111
|
+
const dayCount = Math.max(1, options.dayCount ?? internal.dayCount);
|
|
112
|
+
const { visibleRange, activeRange } = getViewDateRange(view, date, {
|
|
113
|
+
timeZone: settings.timeZone,
|
|
114
|
+
weekStartsOn: settings.weekStartsOn,
|
|
115
|
+
dayCount,
|
|
116
|
+
agendaDayCount: settings.agendaDayCount,
|
|
117
|
+
fixedWeeks: settings.fixedWeeks
|
|
118
|
+
});
|
|
119
|
+
snapshot = {
|
|
120
|
+
view,
|
|
121
|
+
date,
|
|
122
|
+
dayCount,
|
|
123
|
+
visibleRange,
|
|
124
|
+
activeRange,
|
|
125
|
+
events: options.events ?? internal.events,
|
|
126
|
+
selection: options.selection ?? internal.selection,
|
|
127
|
+
interactions: options.interactions ? mergedInteractions(options.interactions) : internal.interactions,
|
|
128
|
+
loading: options.loading ?? false,
|
|
129
|
+
drag: internal.drag,
|
|
130
|
+
slotDraft: internal.slotDraft,
|
|
131
|
+
viewSettings: options.viewSettings ?? internal.viewSettings
|
|
132
|
+
};
|
|
133
|
+
return snapshot;
|
|
134
|
+
};
|
|
135
|
+
const emitRangeIfChanged = () => {
|
|
136
|
+
if (!settings.onRangeChange) return;
|
|
137
|
+
const state = getState();
|
|
138
|
+
const key = `${state.view}:${getRangeKey(state.visibleRange)}:${settings.timeZone}`;
|
|
139
|
+
if (key === lastEmittedRangeKey) return;
|
|
140
|
+
lastEmittedRangeKey = key;
|
|
141
|
+
settings.onRangeChange({
|
|
142
|
+
range: state.visibleRange,
|
|
143
|
+
activeRange: state.activeRange,
|
|
144
|
+
view: state.view,
|
|
145
|
+
date: state.date,
|
|
146
|
+
timeZone: settings.timeZone
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
const setField = (key, value) => {
|
|
150
|
+
const controlled = options[key] !== void 0;
|
|
151
|
+
if (!controlled) {
|
|
152
|
+
internal[key] = value;
|
|
153
|
+
invalidate();
|
|
154
|
+
}
|
|
155
|
+
({
|
|
156
|
+
view: settings.onViewChange,
|
|
157
|
+
date: settings.onDateChange,
|
|
158
|
+
dayCount: settings.onDayCountChange,
|
|
159
|
+
events: settings.onEventsChange,
|
|
160
|
+
selection: settings.onSelectionChange,
|
|
161
|
+
interactions: settings.onInteractionsChange,
|
|
162
|
+
viewSettings: settings.onViewSettingsChange
|
|
163
|
+
})[key]?.(value);
|
|
164
|
+
if (!controlled) notify();
|
|
165
|
+
};
|
|
166
|
+
const applyProposedUpdate = (update, extraPatch) => {
|
|
167
|
+
const result = settings.onEventUpdate?.(update);
|
|
168
|
+
if (result === false) return false;
|
|
169
|
+
const adjusted = result && typeof result === "object" ? {
|
|
170
|
+
start: result.start ?? update.start,
|
|
171
|
+
end: result.end ?? update.end,
|
|
172
|
+
allDay: result.allDay ?? update.allDay
|
|
173
|
+
} : {
|
|
174
|
+
start: update.start,
|
|
175
|
+
end: update.end,
|
|
176
|
+
allDay: update.allDay
|
|
177
|
+
};
|
|
178
|
+
if (update.resourceId !== void 0) adjusted.resourceId = update.resourceId;
|
|
179
|
+
const next = getState().events.map((event) => event.id === update.event.id ? {
|
|
180
|
+
...event,
|
|
181
|
+
...extraPatch,
|
|
182
|
+
...adjusted
|
|
183
|
+
} : event);
|
|
184
|
+
setField("events", next);
|
|
185
|
+
return true;
|
|
186
|
+
};
|
|
187
|
+
const getIndex = () => {
|
|
188
|
+
const state = getState();
|
|
189
|
+
const rangeKey = getRangeKey(state.visibleRange);
|
|
190
|
+
if (indexCache && indexCache.events === state.events && indexCache.rangeKey === rangeKey && indexCache.timeZone === settings.timeZone && indexCache.weekStartsOn === settings.weekStartsOn) return indexCache.index;
|
|
191
|
+
const index = buildEventIndex(state.events, state.visibleRange, {
|
|
192
|
+
timeZone: settings.timeZone,
|
|
193
|
+
weekStartsOn: settings.weekStartsOn,
|
|
194
|
+
eventOrder: settings.eventOrder,
|
|
195
|
+
getOccurrences: settings.getOccurrences
|
|
196
|
+
});
|
|
197
|
+
indexCache = {
|
|
198
|
+
events: state.events,
|
|
199
|
+
rangeKey,
|
|
200
|
+
timeZone: settings.timeZone,
|
|
201
|
+
weekStartsOn: settings.weekStartsOn,
|
|
202
|
+
index
|
|
203
|
+
};
|
|
204
|
+
return index;
|
|
205
|
+
};
|
|
206
|
+
const api = {
|
|
207
|
+
next() {
|
|
208
|
+
const state = getState();
|
|
209
|
+
setField("date", stepDate(state.view, state.date, 1, {
|
|
210
|
+
timeZone: settings.timeZone,
|
|
211
|
+
dayCount: state.dayCount,
|
|
212
|
+
agendaDayCount: settings.agendaDayCount
|
|
213
|
+
}));
|
|
214
|
+
},
|
|
215
|
+
prev() {
|
|
216
|
+
const state = getState();
|
|
217
|
+
setField("date", stepDate(state.view, state.date, -1, {
|
|
218
|
+
timeZone: settings.timeZone,
|
|
219
|
+
dayCount: state.dayCount,
|
|
220
|
+
agendaDayCount: settings.agendaDayCount
|
|
221
|
+
}));
|
|
222
|
+
},
|
|
223
|
+
today() {
|
|
224
|
+
setField("date", /* @__PURE__ */ new Date());
|
|
225
|
+
},
|
|
226
|
+
goTo(date) {
|
|
227
|
+
setField("date", date);
|
|
228
|
+
},
|
|
229
|
+
setView(view, opts) {
|
|
230
|
+
if (opts?.dayCount !== void 0) setField("dayCount", Math.max(1, opts.dayCount));
|
|
231
|
+
setField("view", resolveView(view));
|
|
232
|
+
},
|
|
233
|
+
setDayCount(count) {
|
|
234
|
+
setField("dayCount", Math.max(1, count));
|
|
235
|
+
},
|
|
236
|
+
getEvents() {
|
|
237
|
+
return getState().events;
|
|
238
|
+
},
|
|
239
|
+
getEvent(id) {
|
|
240
|
+
return getState().events.find((event) => event.id === id);
|
|
241
|
+
},
|
|
242
|
+
setEvents(events) {
|
|
243
|
+
setField("events", events);
|
|
244
|
+
},
|
|
245
|
+
addEvent(event) {
|
|
246
|
+
setField("events", [...getState().events, event]);
|
|
247
|
+
},
|
|
248
|
+
updateEvent(id, patch) {
|
|
249
|
+
const event = api.getEvent(id);
|
|
250
|
+
if (!event) return;
|
|
251
|
+
const merged = {
|
|
252
|
+
...event,
|
|
253
|
+
...patch
|
|
254
|
+
};
|
|
255
|
+
if ((patch.start !== void 0 || patch.end !== void 0 || patch.allDay !== void 0) && settings.onEventUpdate) {
|
|
256
|
+
const rest = { ...patch };
|
|
257
|
+
delete rest.start;
|
|
258
|
+
delete rest.end;
|
|
259
|
+
delete rest.allDay;
|
|
260
|
+
applyProposedUpdate({
|
|
261
|
+
event: merged,
|
|
262
|
+
occurrence: null,
|
|
263
|
+
start: merged.start,
|
|
264
|
+
end: merged.end,
|
|
265
|
+
allDay: merged.allDay ?? false,
|
|
266
|
+
source: "api"
|
|
267
|
+
}, rest);
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
setField("events", getState().events.map((e) => e.id === id ? merged : e));
|
|
271
|
+
},
|
|
272
|
+
removeEvent(id) {
|
|
273
|
+
setField("events", getState().events.filter((event) => event.id !== id));
|
|
274
|
+
},
|
|
275
|
+
getOccurrences(range) {
|
|
276
|
+
if (!range) return getIndex().occurrences;
|
|
277
|
+
const state = getState();
|
|
278
|
+
if (range.start >= state.visibleRange.start && range.end <= state.visibleRange.end) return getIndex().occurrences.filter((occ) => eventsOverlap(occ, range));
|
|
279
|
+
return buildEventIndex(state.events, range, {
|
|
280
|
+
timeZone: settings.timeZone,
|
|
281
|
+
weekStartsOn: settings.weekStartsOn,
|
|
282
|
+
eventOrder: settings.eventOrder,
|
|
283
|
+
getOccurrences: settings.getOccurrences
|
|
284
|
+
}).occurrences;
|
|
285
|
+
},
|
|
286
|
+
getOccurrencesForDay(day) {
|
|
287
|
+
const bucket = getIndex().byDay.get(getDayKey(day, settings.timeZone));
|
|
288
|
+
if (!bucket) return [];
|
|
289
|
+
const seen = /* @__PURE__ */ new Set();
|
|
290
|
+
const result = [];
|
|
291
|
+
for (const seg of [...bucket.allDay, ...bucket.timed]) {
|
|
292
|
+
if (seen.has(seg.occurrence.key)) continue;
|
|
293
|
+
seen.add(seg.occurrence.key);
|
|
294
|
+
result.push(seg.occurrence);
|
|
295
|
+
}
|
|
296
|
+
return result;
|
|
297
|
+
},
|
|
298
|
+
findOverlapping({ start, end, excludeEventId }) {
|
|
299
|
+
return api.getOccurrences({
|
|
300
|
+
start,
|
|
301
|
+
end
|
|
302
|
+
}).filter((occ) => occ.eventId !== excludeEventId);
|
|
303
|
+
},
|
|
304
|
+
select(partial) {
|
|
305
|
+
const current = getState().selection;
|
|
306
|
+
setField("selection", {
|
|
307
|
+
eventKeys: partial.eventKeys ?? current.eventKeys,
|
|
308
|
+
slot: partial.slot !== void 0 ? partial.slot : current.slot
|
|
309
|
+
});
|
|
310
|
+
},
|
|
311
|
+
selectEvent(key, opts) {
|
|
312
|
+
const current = getState().selection;
|
|
313
|
+
const eventKeys = opts?.additive ? current.eventKeys.includes(key) ? current.eventKeys.filter((k) => k !== key) : [...current.eventKeys, key] : [key];
|
|
314
|
+
setField("selection", {
|
|
315
|
+
...current,
|
|
316
|
+
eventKeys
|
|
317
|
+
});
|
|
318
|
+
},
|
|
319
|
+
clearSelection() {
|
|
320
|
+
setField("selection", EMPTY_SELECTION);
|
|
321
|
+
},
|
|
322
|
+
setInteractions(patch) {
|
|
323
|
+
setField("interactions", {
|
|
324
|
+
...getState().interactions,
|
|
325
|
+
...patch
|
|
326
|
+
});
|
|
327
|
+
},
|
|
328
|
+
setViewSettings(patch) {
|
|
329
|
+
setField("viewSettings", {
|
|
330
|
+
...getState().viewSettings,
|
|
331
|
+
...patch
|
|
332
|
+
});
|
|
333
|
+
},
|
|
334
|
+
getVisibleRange() {
|
|
335
|
+
return getState().visibleRange;
|
|
336
|
+
},
|
|
337
|
+
getActiveRange() {
|
|
338
|
+
return getState().activeRange;
|
|
339
|
+
},
|
|
340
|
+
toZoned(date) {
|
|
341
|
+
return toZoned(date, settings.timeZone);
|
|
342
|
+
},
|
|
343
|
+
scrollToTime(time) {
|
|
344
|
+
scrollHandler?.(time);
|
|
345
|
+
}
|
|
346
|
+
};
|
|
347
|
+
const instance = {
|
|
348
|
+
getState,
|
|
349
|
+
subscribe(listener) {
|
|
350
|
+
listeners.add(listener);
|
|
351
|
+
return () => listeners.delete(listener);
|
|
352
|
+
},
|
|
353
|
+
api,
|
|
354
|
+
get settings() {
|
|
355
|
+
return settings;
|
|
356
|
+
},
|
|
357
|
+
internals: {
|
|
358
|
+
getIndex,
|
|
359
|
+
setDrag(drag) {
|
|
360
|
+
internal.drag = drag;
|
|
361
|
+
invalidate();
|
|
362
|
+
notify();
|
|
363
|
+
},
|
|
364
|
+
setSlotDraft(draft) {
|
|
365
|
+
internal.slotDraft = draft;
|
|
366
|
+
invalidate();
|
|
367
|
+
notify();
|
|
368
|
+
},
|
|
369
|
+
registerScrollHandler(handler) {
|
|
370
|
+
scrollHandler = handler;
|
|
371
|
+
},
|
|
372
|
+
applyProposedUpdate,
|
|
373
|
+
getSettingsVersion() {
|
|
374
|
+
return settingsVersion;
|
|
375
|
+
},
|
|
376
|
+
getRootEl() {
|
|
377
|
+
return rootEl;
|
|
378
|
+
},
|
|
379
|
+
setRootEl(el) {
|
|
380
|
+
rootEl = el;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
const STATE_KEYS = [
|
|
385
|
+
"events",
|
|
386
|
+
"view",
|
|
387
|
+
"date",
|
|
388
|
+
"dayCount",
|
|
389
|
+
"selection",
|
|
390
|
+
"interactions",
|
|
391
|
+
"viewSettings",
|
|
392
|
+
"loading"
|
|
393
|
+
];
|
|
394
|
+
const SETTINGS_KEYS = [
|
|
395
|
+
"timeZone",
|
|
396
|
+
"locale",
|
|
397
|
+
"weekStartsOn",
|
|
398
|
+
"views",
|
|
399
|
+
"dayStartHour",
|
|
400
|
+
"dayEndHour",
|
|
401
|
+
"slotDuration",
|
|
402
|
+
"snapDuration",
|
|
403
|
+
"agendaDayCount",
|
|
404
|
+
"fixedWeeks",
|
|
405
|
+
"showOutsideDays",
|
|
406
|
+
"i18n",
|
|
407
|
+
"resources",
|
|
408
|
+
"getEventPriority",
|
|
409
|
+
"eventOrder",
|
|
410
|
+
"getOccurrences"
|
|
411
|
+
];
|
|
412
|
+
return {
|
|
413
|
+
instance,
|
|
414
|
+
setOptions(next) {
|
|
415
|
+
const prev = options;
|
|
416
|
+
options = next;
|
|
417
|
+
let changed = false;
|
|
418
|
+
for (const key of STATE_KEYS) if (prev[key] !== next[key]) {
|
|
419
|
+
changed = true;
|
|
420
|
+
break;
|
|
421
|
+
}
|
|
422
|
+
let settingsChanged = false;
|
|
423
|
+
for (const key of SETTINGS_KEYS) if (prev[key] !== next[key]) {
|
|
424
|
+
settingsChanged = true;
|
|
425
|
+
break;
|
|
426
|
+
}
|
|
427
|
+
settings = resolveSettings(next);
|
|
428
|
+
if (settingsChanged) {
|
|
429
|
+
settingsVersion++;
|
|
430
|
+
changed = true;
|
|
431
|
+
}
|
|
432
|
+
if (changed) invalidate();
|
|
433
|
+
return changed;
|
|
434
|
+
},
|
|
435
|
+
notify,
|
|
436
|
+
emitRangeIfChanged
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* Headless root hook - the full calendar engine without any markup.
|
|
441
|
+
* Pass the returned instance to <EventCalendar calendar={instance}> or drive
|
|
442
|
+
* fully custom UI from instance.getState()/subscribe/api.
|
|
443
|
+
*/
|
|
444
|
+
function useEventCalendarState(options = {}) {
|
|
445
|
+
const [store] = useState(() => createEventCalendarStore(options));
|
|
446
|
+
const changed = store.setOptions(options);
|
|
447
|
+
const changedRef = useRef(false);
|
|
448
|
+
if (changed) changedRef.current = true;
|
|
449
|
+
useLayoutEffect(() => {
|
|
450
|
+
if (changedRef.current) {
|
|
451
|
+
changedRef.current = false;
|
|
452
|
+
store.notify();
|
|
453
|
+
}
|
|
454
|
+
});
|
|
455
|
+
useEffect(() => {
|
|
456
|
+
store.emitRangeIfChanged();
|
|
457
|
+
}, [store.emitRangeIfChanged]);
|
|
458
|
+
return store.instance;
|
|
459
|
+
}
|
|
460
|
+
const EventCalendarContext = createContext(null);
|
|
461
|
+
/** The stable calendar instance; throws outside <EventCalendar>. */
|
|
462
|
+
function useEventCalendar() {
|
|
463
|
+
const instance = useContext(EventCalendarContext);
|
|
464
|
+
if (!instance) throw new Error("useEventCalendar must be used within <EventCalendar>");
|
|
465
|
+
return instance;
|
|
466
|
+
}
|
|
467
|
+
/** Fine-grained subscription with equality memoization (Object.is default). */
|
|
468
|
+
function useEventCalendarSelector(selector, options) {
|
|
469
|
+
const contextInstance = useContext(EventCalendarContext);
|
|
470
|
+
const instance = options?.calendar ?? contextInstance;
|
|
471
|
+
if (!instance) throw new Error("useEventCalendarSelector needs an <EventCalendar> ancestor or an explicit `calendar` option");
|
|
472
|
+
const isEqual = options?.isEqual ?? Object.is;
|
|
473
|
+
const lastRef = useRef(null);
|
|
474
|
+
const selectorRef = useRef(selector);
|
|
475
|
+
selectorRef.current = selector;
|
|
476
|
+
const getSnapshot = () => {
|
|
477
|
+
const next = selectorRef.current(instance.getState());
|
|
478
|
+
if (lastRef.current && isEqual(lastRef.current.value, next)) return lastRef.current.value;
|
|
479
|
+
lastRef.current = { value: next };
|
|
480
|
+
return next;
|
|
481
|
+
};
|
|
482
|
+
return useSyncExternalStore(instance.subscribe, getSnapshot, getSnapshot);
|
|
483
|
+
}
|
|
484
|
+
function useEventCalendarView() {
|
|
485
|
+
const instance = useEventCalendar();
|
|
486
|
+
const view = useEventCalendarSelector((state) => state.view);
|
|
487
|
+
const dayCount = useEventCalendarSelector((state) => state.dayCount);
|
|
488
|
+
useEventCalendarSettingsVersion(instance);
|
|
489
|
+
return {
|
|
490
|
+
view,
|
|
491
|
+
dayCount,
|
|
492
|
+
availableViews: instance.settings.views,
|
|
493
|
+
setView: instance.api.setView
|
|
494
|
+
};
|
|
495
|
+
}
|
|
496
|
+
function useEventCalendarNavigation() {
|
|
497
|
+
const instance = useEventCalendar();
|
|
498
|
+
const { settings } = instance;
|
|
499
|
+
const slice = useEventCalendarSelector((state) => ({
|
|
500
|
+
date: state.date,
|
|
501
|
+
view: state.view,
|
|
502
|
+
visibleRange: state.visibleRange,
|
|
503
|
+
activeRange: state.activeRange
|
|
504
|
+
}), { isEqual: (a, b) => a.date.getTime() === b.date.getTime() && a.view === b.view && getRangeKey(a.visibleRange) === getRangeKey(b.visibleRange) });
|
|
505
|
+
useEventCalendarSettingsVersion(instance);
|
|
506
|
+
const now = /* @__PURE__ */ new Date();
|
|
507
|
+
return {
|
|
508
|
+
date: slice.date,
|
|
509
|
+
title: settings.i18n.functions.formatTitle(slice.view, {
|
|
510
|
+
date: toZoned(slice.date, settings.timeZone),
|
|
511
|
+
activeRange: slice.activeRange,
|
|
512
|
+
visibleRange: slice.visibleRange,
|
|
513
|
+
locale: settings.locale
|
|
514
|
+
}),
|
|
515
|
+
visibleRange: slice.visibleRange,
|
|
516
|
+
activeRange: slice.activeRange,
|
|
517
|
+
next: instance.api.next,
|
|
518
|
+
prev: instance.api.prev,
|
|
519
|
+
today: instance.api.today,
|
|
520
|
+
goTo: instance.api.goTo,
|
|
521
|
+
isToday: now >= slice.activeRange.start && now < slice.activeRange.end
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
function useEventCalendarSelection() {
|
|
525
|
+
const instance = useEventCalendar();
|
|
526
|
+
return {
|
|
527
|
+
selection: useEventCalendarSelector((state) => state.selection),
|
|
528
|
+
select: instance.api.select,
|
|
529
|
+
selectEvent: instance.api.selectEvent,
|
|
530
|
+
clearSelection: instance.api.clearSelection
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
function useEventCalendarInteractions() {
|
|
534
|
+
const instance = useEventCalendar();
|
|
535
|
+
return {
|
|
536
|
+
interactions: useEventCalendarSelector((state) => state.interactions),
|
|
537
|
+
setInteractions: instance.api.setInteractions
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
/** Expanded, sorted occurrences; defaults to the visible range. */
|
|
541
|
+
function useEventCalendarOccurrences(range) {
|
|
542
|
+
const instance = useEventCalendar();
|
|
543
|
+
return useEventCalendarSelector(() => instance.api.getOccurrences(range), {
|
|
544
|
+
calendar: instance,
|
|
545
|
+
isEqual: (a, b) => a === b || a.length === b.length && a.every((occ, i) => occ === b[i])
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
const EMPTY_BUCKET = {
|
|
549
|
+
allDay: [],
|
|
550
|
+
timed: []
|
|
551
|
+
};
|
|
552
|
+
/** Per-cell subscription: only cells whose segments changed re-render. */
|
|
553
|
+
function useEventCalendarDay(day) {
|
|
554
|
+
const instance = useEventCalendar();
|
|
555
|
+
const { timeZone } = instance.settings;
|
|
556
|
+
const dayKey = getDayKey(day, timeZone);
|
|
557
|
+
const bucket = useEventCalendarSelector(() => instance.internals.getIndex().byDay.get(dayKey) ?? EMPTY_BUCKET, {
|
|
558
|
+
calendar: instance,
|
|
559
|
+
isEqual: (a, b) => a === b || a.allDay.length === b.allDay.length && a.timed.length === b.timed.length && a.allDay.every((segment, i) => segment === b.allDay[i]) && a.timed.every((segment, i) => segment === b.timed[i])
|
|
560
|
+
});
|
|
561
|
+
const activeRange = useEventCalendarSelector((state) => state.activeRange, {
|
|
562
|
+
calendar: instance,
|
|
563
|
+
isEqual: (a, b) => getRangeKey(a) === getRangeKey(b)
|
|
564
|
+
});
|
|
565
|
+
const dayStart = zonedStartOfDay(day, timeZone);
|
|
566
|
+
return {
|
|
567
|
+
segments: bucket,
|
|
568
|
+
isToday: getDayKey(/* @__PURE__ */ new Date(), timeZone) === dayKey,
|
|
569
|
+
isOutside: dayStart < activeRange.start || dayStart >= activeRange.end
|
|
570
|
+
};
|
|
571
|
+
}
|
|
572
|
+
const EMPTY_BARS = [];
|
|
573
|
+
/**
|
|
574
|
+
* Per-week-row subscription for the month view: the laned multi-day/all-day
|
|
575
|
+
* bar segments (one per occurrence per row, colStart/colSpan/lane set) that
|
|
576
|
+
* render as continuous cross-day bars. `laneCount` is the row's bar height.
|
|
577
|
+
* Matched by CONTAINMENT - any day inside the row resolves it - so a
|
|
578
|
+
* weekends-hidden month (first visible day Monday) still finds its row;
|
|
579
|
+
* `rowStart` returns the row's TRUE start for colStart/colSpan day math.
|
|
580
|
+
*/
|
|
581
|
+
function useEventCalendarWeek(day) {
|
|
582
|
+
const instance = useEventCalendar();
|
|
583
|
+
const { timeZone } = instance.settings;
|
|
584
|
+
const dayStartMs = zonedStartOfDay(day, timeZone).getTime();
|
|
585
|
+
const row = useEventCalendarSelector(() => {
|
|
586
|
+
const match = instance.internals.getIndex().weekRows.find((r) => {
|
|
587
|
+
const startMs = zonedStartOfDay(r.rowStart, timeZone).getTime();
|
|
588
|
+
const endMs = zonedStartOfDay(addDays(toZoned(r.rowStart, timeZone), 7), timeZone).getTime();
|
|
589
|
+
return dayStartMs >= startMs && dayStartMs < endMs;
|
|
590
|
+
});
|
|
591
|
+
return {
|
|
592
|
+
bars: match?.bars ?? EMPTY_BARS,
|
|
593
|
+
rowStart: match?.rowStart ?? null
|
|
594
|
+
};
|
|
595
|
+
}, {
|
|
596
|
+
calendar: instance,
|
|
597
|
+
isEqual: (a, b) => (a.rowStart?.getTime() ?? 0) === (b.rowStart?.getTime() ?? 0) && (a.bars === b.bars || a.bars.length === b.bars.length && a.bars.every((segment, i) => segment === b.bars[i]))
|
|
598
|
+
});
|
|
599
|
+
const laneCount = row.bars.reduce((m, s) => Math.max(m, (s.lane ?? 0) + 1), 0);
|
|
600
|
+
return {
|
|
601
|
+
bars: row.bars,
|
|
602
|
+
laneCount,
|
|
603
|
+
rowStart: row.rowStart
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* User view settings (weekends, week numbers, now line, off days, schedule
|
|
608
|
+
* hint) + the effective values after falling back to the root view-config
|
|
609
|
+
* props. Drives the nav submenu; fully controllable from outside via
|
|
610
|
+
* `viewSettings`/`onViewSettingsChange` or api.setViewSettings.
|
|
611
|
+
*/
|
|
612
|
+
function useEventCalendarViewSettings() {
|
|
613
|
+
const instance = useEventCalendar();
|
|
614
|
+
const viewConfig = useEventCalendarViewConfig();
|
|
615
|
+
const viewSettings = useEventCalendarSelector((state) => state.viewSettings);
|
|
616
|
+
return {
|
|
617
|
+
viewSettings,
|
|
618
|
+
setViewSettings: instance.api.setViewSettings,
|
|
619
|
+
effective: {
|
|
620
|
+
weekends: viewSettings.weekends ?? true,
|
|
621
|
+
weekNumbers: viewSettings.weekNumbers ?? viewConfig.showWeekNumbers,
|
|
622
|
+
nowIndicator: viewSettings.nowIndicator ?? viewConfig.nowIndicator,
|
|
623
|
+
offDays: viewSettings.offDays ?? (viewConfig.offDays !== void 0 && viewConfig.offDays !== false)
|
|
624
|
+
}
|
|
625
|
+
};
|
|
626
|
+
}
|
|
627
|
+
/** Subscribes to settings changes only (version counter, not state). */
|
|
628
|
+
function useEventCalendarSettingsVersion(instance) {
|
|
629
|
+
return useSyncExternalStore(instance.subscribe, instance.internals.getSettingsVersion, instance.internals.getSettingsVersion);
|
|
630
|
+
}
|
|
631
|
+
/** Resolved settings incl. merged i18n; re-renders only when settings change. */
|
|
632
|
+
function useEventCalendarSettings() {
|
|
633
|
+
const instance = useEventCalendar();
|
|
634
|
+
useEventCalendarSettingsVersion(instance);
|
|
635
|
+
return instance.settings;
|
|
636
|
+
}
|
|
637
|
+
const EventCalendarViewContext = createContext(null);
|
|
638
|
+
const DEFAULT_VIEW_CONFIG = {
|
|
639
|
+
scrollToHour: 7,
|
|
640
|
+
nowIndicator: true,
|
|
641
|
+
interval: 60,
|
|
642
|
+
maxEventsPerCell: "auto",
|
|
643
|
+
showWeekNumbers: false,
|
|
644
|
+
enableShortcuts: true,
|
|
645
|
+
shortcutsScope: "focus-within",
|
|
646
|
+
scrollMode: "contained",
|
|
647
|
+
stickyNav: false,
|
|
648
|
+
showDayAddButton: false,
|
|
649
|
+
scrollbars: "custom",
|
|
650
|
+
navButtonVariant: "ghost",
|
|
651
|
+
navButtonSize: "sm",
|
|
652
|
+
dayCountPresets: [5],
|
|
653
|
+
eventTooltip: false,
|
|
654
|
+
compactEventMinutes: 45,
|
|
655
|
+
morePopoverAlign: "start",
|
|
656
|
+
nowIndicatorInterval: 3e4,
|
|
657
|
+
agendaSummaryMaxDots: 6
|
|
658
|
+
};
|
|
659
|
+
const EventCalendarViewConfigContext = createContext(DEFAULT_VIEW_CONFIG);
|
|
660
|
+
/** Root-level display props + render overrides, for view components. */
|
|
661
|
+
function useEventCalendarViewConfig() {
|
|
662
|
+
return useContext(EventCalendarViewConfigContext);
|
|
663
|
+
}
|
|
664
|
+
const VIEW_CONFIG_KEYS = [
|
|
665
|
+
"scrollToHour",
|
|
666
|
+
"nowIndicator",
|
|
667
|
+
"interval",
|
|
668
|
+
"maxEventsPerCell",
|
|
669
|
+
"showWeekNumbers",
|
|
670
|
+
"enableShortcuts",
|
|
671
|
+
"shortcutsScope",
|
|
672
|
+
"scrollMode",
|
|
673
|
+
"stickyNav",
|
|
674
|
+
"dayClassName",
|
|
675
|
+
"todayClassName",
|
|
676
|
+
"showDayAddButton",
|
|
677
|
+
"scrollbars",
|
|
678
|
+
"navButtonVariant",
|
|
679
|
+
"navButtonSize",
|
|
680
|
+
"offDays",
|
|
681
|
+
"classNames",
|
|
682
|
+
"components",
|
|
683
|
+
"renderEvent",
|
|
684
|
+
"renderAgendaEvent",
|
|
685
|
+
"renderEventTooltip",
|
|
686
|
+
"renderDragPreview",
|
|
687
|
+
"renderMonthCell",
|
|
688
|
+
"renderDayColumnBackground",
|
|
689
|
+
"renderDayHeader",
|
|
690
|
+
"renderTimeGutterSlot",
|
|
691
|
+
"renderAllDaySection",
|
|
692
|
+
"renderMoreIndicator",
|
|
693
|
+
"renderMoreContent",
|
|
694
|
+
"renderNowIndicator",
|
|
695
|
+
"renderNoEvents",
|
|
696
|
+
"renderAgendaEventDetails",
|
|
697
|
+
"renderResourceHeader",
|
|
698
|
+
"renderAgendaDayHeader",
|
|
699
|
+
"renderAgendaDaySummary",
|
|
700
|
+
"dayCountPresets",
|
|
701
|
+
"navTooltips",
|
|
702
|
+
"eventTooltip",
|
|
703
|
+
"compactEventMinutes",
|
|
704
|
+
"morePopoverAlign",
|
|
705
|
+
"nowIndicatorInterval",
|
|
706
|
+
"agendaSummaryMaxDots"
|
|
707
|
+
];
|
|
708
|
+
/** The rendering view of the nearest view component ("month", "week", ...). */
|
|
709
|
+
function useEventCalendarViewContext() {
|
|
710
|
+
const ctx = useContext(EventCalendarViewContext);
|
|
711
|
+
if (!ctx) throw new Error("useEventCalendarViewContext must be used inside a calendar view");
|
|
712
|
+
return ctx;
|
|
713
|
+
}
|
|
714
|
+
const OPTION_KEYS = [
|
|
715
|
+
"events",
|
|
716
|
+
"defaultEvents",
|
|
717
|
+
"view",
|
|
718
|
+
"defaultView",
|
|
719
|
+
"date",
|
|
720
|
+
"defaultDate",
|
|
721
|
+
"dayCount",
|
|
722
|
+
"defaultDayCount",
|
|
723
|
+
"selection",
|
|
724
|
+
"defaultSelection",
|
|
725
|
+
"interactions",
|
|
726
|
+
"defaultInteractions",
|
|
727
|
+
"viewSettings",
|
|
728
|
+
"defaultViewSettings",
|
|
729
|
+
"loading",
|
|
730
|
+
"views",
|
|
731
|
+
"timeZone",
|
|
732
|
+
"locale",
|
|
733
|
+
"weekStartsOn",
|
|
734
|
+
"dayStartHour",
|
|
735
|
+
"dayEndHour",
|
|
736
|
+
"slotDuration",
|
|
737
|
+
"snapDuration",
|
|
738
|
+
"agendaDayCount",
|
|
739
|
+
"fixedWeeks",
|
|
740
|
+
"showOutsideDays",
|
|
741
|
+
"i18n",
|
|
742
|
+
"resources",
|
|
743
|
+
"getEventPriority",
|
|
744
|
+
"eventOrder",
|
|
745
|
+
"getOccurrences",
|
|
746
|
+
"weekendDays",
|
|
747
|
+
"activation",
|
|
748
|
+
"onEventClick",
|
|
749
|
+
"onEventDoubleClick",
|
|
750
|
+
"onEventUpdate",
|
|
751
|
+
"canDropEvent",
|
|
752
|
+
"onDragBlocked",
|
|
753
|
+
"onSlotClick",
|
|
754
|
+
"onSelectSlot",
|
|
755
|
+
"canSelectSlot",
|
|
756
|
+
"onRangeChange",
|
|
757
|
+
"onViewChange",
|
|
758
|
+
"onDateChange",
|
|
759
|
+
"onDayCountChange",
|
|
760
|
+
"onSelectionChange",
|
|
761
|
+
"onInteractionsChange",
|
|
762
|
+
"onViewSettingsChange",
|
|
763
|
+
"onEventsChange",
|
|
764
|
+
"onMoreClick"
|
|
765
|
+
];
|
|
766
|
+
function splitOptions(props) {
|
|
767
|
+
const options = {};
|
|
768
|
+
const viewConfig = { ...DEFAULT_VIEW_CONFIG };
|
|
769
|
+
const rest = {};
|
|
770
|
+
for (const [key, value] of Object.entries(props)) if (OPTION_KEYS.includes(key)) options[key] = value;
|
|
771
|
+
else if (VIEW_CONFIG_KEYS.includes(key)) {
|
|
772
|
+
if (value !== void 0) viewConfig[key] = value;
|
|
773
|
+
} else rest[key] = value;
|
|
774
|
+
return {
|
|
775
|
+
options,
|
|
776
|
+
viewConfig,
|
|
777
|
+
rest
|
|
778
|
+
};
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* Root provider + container. Composition contract:
|
|
782
|
+
* <EventCalendar><EventCalendarNav/><EventCalendarToolbar/><EventCalendarContent/></EventCalendar>
|
|
783
|
+
*/
|
|
784
|
+
function EventCalendar({ calendar, apiRef, className, render, children, ...props }) {
|
|
785
|
+
const { options, viewConfig, rest } = splitOptions(props);
|
|
786
|
+
if (calendar && Object.keys(options).length > 0) warnOnce("calendar-and-options", "both `calendar` and option props were passed; option props are ignored when adopting an instance.");
|
|
787
|
+
const own = useEventCalendarState(calendar ? {} : options);
|
|
788
|
+
const instance = calendar ?? own;
|
|
789
|
+
useEffect(() => {
|
|
790
|
+
if (apiRef) apiRef.current = instance.api;
|
|
791
|
+
}, [apiRef, instance]);
|
|
792
|
+
const defaultProps = {
|
|
793
|
+
"data-slot": "event-calendar",
|
|
794
|
+
ref: useCallback((el) => instance.internals.setRootEl(el), [instance]),
|
|
795
|
+
className: cn("flex min-h-0 min-w-0 flex-col text-xs", className),
|
|
796
|
+
children: /* @__PURE__ */ jsxs(Fragment$1, { children: [children, /* @__PURE__ */ jsx("div", {
|
|
797
|
+
"data-slot": "event-calendar-announcer",
|
|
798
|
+
"aria-live": "polite",
|
|
799
|
+
className: "sr-only"
|
|
800
|
+
})] })
|
|
801
|
+
};
|
|
802
|
+
return /* @__PURE__ */ jsx(EventCalendarContext.Provider, {
|
|
803
|
+
value: instance,
|
|
804
|
+
children: /* @__PURE__ */ jsx(EventCalendarViewConfigContext.Provider, {
|
|
805
|
+
value: viewConfig,
|
|
806
|
+
children: useRender({
|
|
807
|
+
defaultTagName: "div",
|
|
808
|
+
render,
|
|
809
|
+
props: mergeProps(defaultProps, rest)
|
|
810
|
+
})
|
|
811
|
+
})
|
|
812
|
+
});
|
|
813
|
+
}
|
|
814
|
+
//#endregion
|
|
815
|
+
export { ALL_VIEWS, BASE_VIEWS, DEFAULT_VIEW_CONFIG, EventCalendar, EventCalendarContext, EventCalendarViewConfigContext, EventCalendarViewContext, useEventCalendar, useEventCalendarDay, useEventCalendarInteractions, useEventCalendarNavigation, useEventCalendarOccurrences, useEventCalendarSelection, useEventCalendarSelector, useEventCalendarSettings, useEventCalendarSettingsVersion, useEventCalendarState, useEventCalendarView, useEventCalendarViewConfig, useEventCalendarViewContext, useEventCalendarViewSettings, useEventCalendarWeek };
|
|
816
|
+
|
|
817
|
+
//# sourceMappingURL=event-calendar.js.map
|