@iamsaroj/smart-ui 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/CHANGELOG.md +35 -0
- package/LICENSE +21 -0
- package/README.md +49 -0
- package/dist/calendar-engine/agenda-view.d.ts +8 -0
- package/dist/calendar-engine/agenda-view.d.ts.map +1 -0
- package/dist/calendar-engine/agenda-view.js +26 -0
- package/dist/calendar-engine/agenda-view.js.map +1 -0
- package/dist/calendar-engine/booking.d.ts +13 -0
- package/dist/calendar-engine/booking.d.ts.map +1 -0
- package/dist/calendar-engine/booking.js +45 -0
- package/dist/calendar-engine/booking.js.map +1 -0
- package/dist/calendar-engine/calendar-utils.d.ts +74 -0
- package/dist/calendar-engine/calendar-utils.d.ts.map +1 -0
- package/dist/calendar-engine/calendar-utils.js +221 -0
- package/dist/calendar-engine/calendar-utils.js.map +1 -0
- package/dist/calendar-engine/calendar.d.ts +62 -0
- package/dist/calendar-engine/calendar.d.ts.map +1 -0
- package/dist/calendar-engine/calendar.js +81 -0
- package/dist/calendar-engine/calendar.js.map +1 -0
- package/dist/calendar-engine/event-color.d.ts +20 -0
- package/dist/calendar-engine/event-color.d.ts.map +1 -0
- package/dist/calendar-engine/event-color.js +59 -0
- package/dist/calendar-engine/event-color.js.map +1 -0
- package/dist/calendar-engine/index.d.ts +11 -0
- package/dist/calendar-engine/index.d.ts.map +1 -0
- package/dist/calendar-engine/index.js +6 -0
- package/dist/calendar-engine/index.js.map +1 -0
- package/dist/calendar-engine/month-view.d.ts +10 -0
- package/dist/calendar-engine/month-view.d.ts.map +1 -0
- package/dist/calendar-engine/month-view.js +72 -0
- package/dist/calendar-engine/month-view.js.map +1 -0
- package/dist/calendar-engine/recurrence.d.ts +47 -0
- package/dist/calendar-engine/recurrence.d.ts.map +1 -0
- package/dist/calendar-engine/recurrence.js +209 -0
- package/dist/calendar-engine/recurrence.js.map +1 -0
- package/dist/calendar-engine/shared.d.ts +72 -0
- package/dist/calendar-engine/shared.d.ts.map +1 -0
- package/dist/calendar-engine/shared.js +34 -0
- package/dist/calendar-engine/shared.js.map +1 -0
- package/dist/calendar-engine/time-grid-view.d.ts +13 -0
- package/dist/calendar-engine/time-grid-view.d.ts.map +1 -0
- package/dist/calendar-engine/time-grid-view.js +203 -0
- package/dist/calendar-engine/time-grid-view.js.map +1 -0
- package/dist/calendar-engine/types.d.ts +138 -0
- package/dist/calendar-engine/types.d.ts.map +1 -0
- package/dist/calendar-engine/types.js +2 -0
- package/dist/calendar-engine/types.js.map +1 -0
- package/dist/calendar-engine/use-calendar.d.ts +7 -0
- package/dist/calendar-engine/use-calendar.d.ts.map +1 -0
- package/dist/calendar-engine/use-calendar.js +25 -0
- package/dist/calendar-engine/use-calendar.js.map +1 -0
- package/dist/components/accordion.d.ts +7 -0
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/accordion.js +10 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/alert-dialog.d.ts +19 -0
- package/dist/components/alert-dialog.d.ts.map +1 -0
- package/dist/components/alert-dialog.js +18 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/alert.d.ts +11 -0
- package/dist/components/alert.d.ts.map +1 -0
- package/dist/components/alert.js +20 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/aspect-ratio.d.ts +5 -0
- package/dist/components/aspect-ratio.d.ts.map +1 -0
- package/dist/components/aspect-ratio.js +7 -0
- package/dist/components/aspect-ratio.js.map +1 -0
- package/dist/components/avatar.d.ts +12 -0
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/avatar.js +11 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.d.ts +8 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +33 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/breadcrumb.d.ts +11 -0
- package/dist/components/breadcrumb.d.ts.map +1 -0
- package/dist/components/breadcrumb.js +23 -0
- package/dist/components/breadcrumb.js.map +1 -0
- package/dist/components/button.d.ts +9 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +34 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/calendar.d.ts +11 -0
- package/dist/components/calendar.d.ts.map +1 -0
- package/dist/components/calendar.js +77 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/card.d.ts +12 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +11 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/carousel.d.ts +29 -0
- package/dist/components/carousel.d.ts.map +1 -0
- package/dist/components/carousel.js +94 -0
- package/dist/components/carousel.js.map +1 -0
- package/dist/components/chart.d.ts +45 -0
- package/dist/components/chart.d.ts.map +1 -0
- package/dist/components/chart.js +133 -0
- package/dist/components/chart.js.map +1 -0
- package/dist/components/checkbox.d.ts +4 -0
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox.js +8 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/collapsible.d.ts +6 -0
- package/dist/components/collapsible.d.ts.map +1 -0
- package/dist/components/collapsible.js +7 -0
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/combobox.d.ts +35 -0
- package/dist/components/combobox.d.ts.map +1 -0
- package/dist/components/combobox.js +45 -0
- package/dist/components/combobox.js.map +1 -0
- package/dist/components/command.d.ts +20 -0
- package/dist/components/command.d.ts.map +1 -0
- package/dist/components/command.js +18 -0
- package/dist/components/command.js.map +1 -0
- package/dist/components/context-menu.d.ts +30 -0
- package/dist/components/context-menu.d.ts.map +1 -0
- package/dist/components/context-menu.js +22 -0
- package/dist/components/context-menu.js.map +1 -0
- package/dist/components/data-table.d.ts +12 -0
- package/dist/components/data-table.d.ts.map +1 -0
- package/dist/components/data-table.js +44 -0
- package/dist/components/data-table.js.map +1 -0
- package/dist/components/date-picker.d.ts +33 -0
- package/dist/components/date-picker.d.ts.map +1 -0
- package/dist/components/date-picker.js +29 -0
- package/dist/components/date-picker.js.map +1 -0
- package/dist/components/dialog.d.ts +18 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +18 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/drawer.d.ts +14 -0
- package/dist/components/drawer.d.ts.map +1 -0
- package/dist/components/drawer.js +15 -0
- package/dist/components/drawer.js.map +1 -0
- package/dist/components/dropdown-menu.d.ts +30 -0
- package/dist/components/dropdown-menu.d.ts.map +1 -0
- package/dist/components/dropdown-menu.js +22 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/hover-card.d.ts +6 -0
- package/dist/components/hover-card.d.ts.map +1 -0
- package/dist/components/hover-card.js +8 -0
- package/dist/components/hover-card.js.map +1 -0
- package/dist/components/input-group.d.ts +19 -0
- package/dist/components/input-group.d.ts.map +1 -0
- package/dist/components/input-group.js +46 -0
- package/dist/components/input-group.js.map +1 -0
- package/dist/components/input-otp.d.ts +12 -0
- package/dist/components/input-otp.d.ts.map +1 -0
- package/dist/components/input-otp.js +16 -0
- package/dist/components/input-otp.js.map +1 -0
- package/dist/components/input.d.ts +4 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +6 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/kbd.d.ts +5 -0
- package/dist/components/kbd.d.ts.map +1 -0
- package/dist/components/kbd.js +6 -0
- package/dist/components/kbd.js.map +1 -0
- package/dist/components/label.d.ts +4 -0
- package/dist/components/label.d.ts.map +1 -0
- package/dist/components/label.js +5 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/menubar.d.ts +30 -0
- package/dist/components/menubar.d.ts.map +1 -0
- package/dist/components/menubar.js +24 -0
- package/dist/components/menubar.js.map +1 -0
- package/dist/components/navigation-menu.d.ts +12 -0
- package/dist/components/navigation-menu.d.ts.map +1 -0
- package/dist/components/navigation-menu.js +18 -0
- package/dist/components/navigation-menu.js.map +1 -0
- package/dist/components/pagination.d.ts +18 -0
- package/dist/components/pagination.d.ts.map +1 -0
- package/dist/components/pagination.js +13 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/popover.d.ts +10 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +12 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/progress.d.ts +8 -0
- package/dist/components/progress.d.ts.map +1 -0
- package/dist/components/progress.js +10 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/radio-group.d.ts +6 -0
- package/dist/components/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group.js +9 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/scroll-area.d.ts +5 -0
- package/dist/components/scroll-area.d.ts.map +1 -0
- package/dist/components/scroll-area.js +8 -0
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/select.d.ts +16 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +16 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.d.ts +4 -0
- package/dist/components/separator.d.ts.map +1 -0
- package/dist/components/separator.js +6 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/sheet.d.ts +15 -0
- package/dist/components/sheet.d.ts.map +1 -0
- package/dist/components/sheet.js +18 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/sidebar.d.ts +64 -0
- package/dist/components/sidebar.d.ts.map +1 -0
- package/dist/components/sidebar.js +224 -0
- package/dist/components/sidebar.js.map +1 -0
- package/dist/components/skeleton.d.ts +3 -0
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton.js +5 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/slider.d.ts +4 -0
- package/dist/components/slider.d.ts.map +1 -0
- package/dist/components/slider.js +13 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/sonner.d.ts +4 -0
- package/dist/components/sonner.d.ts.map +1 -0
- package/dist/components/sonner.js +25 -0
- package/dist/components/sonner.js.map +1 -0
- package/dist/components/switch.d.ts +6 -0
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/switch.js +7 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/table.d.ts +11 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +12 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +11 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +23 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/textarea.d.ts +4 -0
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/textarea.js +5 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/toggle-group.d.ts +11 -0
- package/dist/components/toggle-group.d.ts.map +1 -0
- package/dist/components/toggle-group.js +22 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle.d.ts +9 -0
- package/dist/components/toggle.d.ts.map +1 -0
- package/dist/components/toggle.js +25 -0
- package/dist/components/toggle.js.map +1 -0
- package/dist/components/tooltip.d.ts +7 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +10 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/data-grid/action-column-cell.d.ts +41 -0
- package/dist/data-grid/action-column-cell.d.ts.map +1 -0
- package/dist/data-grid/action-column-cell.js +114 -0
- package/dist/data-grid/action-column-cell.js.map +1 -0
- package/dist/data-grid/action-column.d.ts +144 -0
- package/dist/data-grid/action-column.d.ts.map +1 -0
- package/dist/data-grid/action-column.js +156 -0
- package/dist/data-grid/action-column.js.map +1 -0
- package/dist/data-grid/create-page-fetcher.d.ts +57 -0
- package/dist/data-grid/create-page-fetcher.d.ts.map +1 -0
- package/dist/data-grid/create-page-fetcher.js +41 -0
- package/dist/data-grid/create-page-fetcher.js.map +1 -0
- package/dist/data-grid/data-grid.d.ts +65 -0
- package/dist/data-grid/data-grid.d.ts.map +1 -0
- package/dist/data-grid/data-grid.js +95 -0
- package/dist/data-grid/data-grid.js.map +1 -0
- package/dist/data-grid/empty-state.d.ts +13 -0
- package/dist/data-grid/empty-state.d.ts.map +1 -0
- package/dist/data-grid/empty-state.js +6 -0
- package/dist/data-grid/empty-state.js.map +1 -0
- package/dist/data-grid/formula-guard.d.ts +22 -0
- package/dist/data-grid/formula-guard.d.ts.map +1 -0
- package/dist/data-grid/formula-guard.js +28 -0
- package/dist/data-grid/formula-guard.js.map +1 -0
- package/dist/data-grid/grid-internals.d.ts +16 -0
- package/dist/data-grid/grid-internals.d.ts.map +1 -0
- package/dist/data-grid/grid-internals.js +73 -0
- package/dist/data-grid/grid-internals.js.map +1 -0
- package/dist/data-grid/grid-theme.d.ts +8 -0
- package/dist/data-grid/grid-theme.d.ts.map +1 -0
- package/dist/data-grid/grid-theme.js +23 -0
- package/dist/data-grid/grid-theme.js.map +1 -0
- package/dist/data-grid/grid-toolbar.d.ts +40 -0
- package/dist/data-grid/grid-toolbar.d.ts.map +1 -0
- package/dist/data-grid/grid-toolbar.js +13 -0
- package/dist/data-grid/grid-toolbar.js.map +1 -0
- package/dist/data-grid/index.d.ts +10 -0
- package/dist/data-grid/index.d.ts.map +1 -0
- package/dist/data-grid/index.js +9 -0
- package/dist/data-grid/index.js.map +1 -0
- package/dist/data-grid/pagination.d.ts +146 -0
- package/dist/data-grid/pagination.d.ts.map +1 -0
- package/dist/data-grid/pagination.js +128 -0
- package/dist/data-grid/pagination.js.map +1 -0
- package/dist/data-grid/server-data-grid.d.ts +109 -0
- package/dist/data-grid/server-data-grid.d.ts.map +1 -0
- package/dist/data-grid/server-data-grid.js +240 -0
- package/dist/data-grid/server-data-grid.js.map +1 -0
- package/dist/data-grid/server-grid-internals.d.ts +79 -0
- package/dist/data-grid/server-grid-internals.d.ts.map +1 -0
- package/dist/data-grid/server-grid-internals.js +137 -0
- package/dist/data-grid/server-grid-internals.js.map +1 -0
- package/dist/data-grid/use-action-column.d.ts +22 -0
- package/dist/data-grid/use-action-column.d.ts.map +1 -0
- package/dist/data-grid/use-action-column.js +63 -0
- package/dist/data-grid/use-action-column.js.map +1 -0
- package/dist/data-grid/use-server-grid-selection.d.ts +35 -0
- package/dist/data-grid/use-server-grid-selection.d.ts.map +1 -0
- package/dist/data-grid/use-server-grid-selection.js +81 -0
- package/dist/data-grid/use-server-grid-selection.js.map +1 -0
- package/dist/form-engine/base.d.ts +19 -0
- package/dist/form-engine/base.d.ts.map +1 -0
- package/dist/form-engine/base.js +2 -0
- package/dist/form-engine/base.js.map +1 -0
- package/dist/form-engine/field-registry.d.ts +285 -0
- package/dist/form-engine/field-registry.d.ts.map +1 -0
- package/dist/form-engine/field-registry.js +306 -0
- package/dist/form-engine/field-registry.js.map +1 -0
- package/dist/form-engine/field-types.d.ts +201 -0
- package/dist/form-engine/field-types.d.ts.map +1 -0
- package/dist/form-engine/field-types.js +14 -0
- package/dist/form-engine/field-types.js.map +1 -0
- package/dist/form-engine/index.d.ts +20 -0
- package/dist/form-engine/index.d.ts.map +1 -0
- package/dist/form-engine/index.js +21 -0
- package/dist/form-engine/index.js.map +1 -0
- package/dist/form-engine/smart-checkbox-field.d.ts +5 -0
- package/dist/form-engine/smart-checkbox-field.d.ts.map +1 -0
- package/dist/form-engine/smart-checkbox-field.js +9 -0
- package/dist/form-engine/smart-checkbox-field.js.map +1 -0
- package/dist/form-engine/smart-checkbox-group-field.d.ts +10 -0
- package/dist/form-engine/smart-checkbox-group-field.d.ts.map +1 -0
- package/dist/form-engine/smart-checkbox-group-field.js +5 -0
- package/dist/form-engine/smart-checkbox-group-field.js.map +1 -0
- package/dist/form-engine/smart-combobox-field.d.ts +11 -0
- package/dist/form-engine/smart-combobox-field.d.ts.map +1 -0
- package/dist/form-engine/smart-combobox-field.js +5 -0
- package/dist/form-engine/smart-combobox-field.js.map +1 -0
- package/dist/form-engine/smart-date-field.d.ts +8 -0
- package/dist/form-engine/smart-date-field.d.ts.map +1 -0
- package/dist/form-engine/smart-date-field.js +17 -0
- package/dist/form-engine/smart-date-field.js.map +1 -0
- package/dist/form-engine/smart-date-range-field.d.ts +15 -0
- package/dist/form-engine/smart-date-range-field.d.ts.map +1 -0
- package/dist/form-engine/smart-date-range-field.js +25 -0
- package/dist/form-engine/smart-date-range-field.js.map +1 -0
- package/dist/form-engine/smart-datetime-field.d.ts +12 -0
- package/dist/form-engine/smart-datetime-field.d.ts.map +1 -0
- package/dist/form-engine/smart-datetime-field.js +12 -0
- package/dist/form-engine/smart-datetime-field.js.map +1 -0
- package/dist/form-engine/smart-form-internals.d.ts +14 -0
- package/dist/form-engine/smart-form-internals.d.ts.map +1 -0
- package/dist/form-engine/smart-form-internals.js +64 -0
- package/dist/form-engine/smart-form-internals.js.map +1 -0
- package/dist/form-engine/smart-form.d.ts +55 -0
- package/dist/form-engine/smart-form.d.ts.map +1 -0
- package/dist/form-engine/smart-form.js +229 -0
- package/dist/form-engine/smart-form.js.map +1 -0
- package/dist/form-engine/smart-input-field.d.ts +9 -0
- package/dist/form-engine/smart-input-field.d.ts.map +1 -0
- package/dist/form-engine/smart-input-field.js +5 -0
- package/dist/form-engine/smart-input-field.js.map +1 -0
- package/dist/form-engine/smart-month-field.d.ts +8 -0
- package/dist/form-engine/smart-month-field.d.ts.map +1 -0
- package/dist/form-engine/smart-month-field.js +12 -0
- package/dist/form-engine/smart-month-field.js.map +1 -0
- package/dist/form-engine/smart-multi-select-field.d.ts +11 -0
- package/dist/form-engine/smart-multi-select-field.d.ts.map +1 -0
- package/dist/form-engine/smart-multi-select-field.js +5 -0
- package/dist/form-engine/smart-multi-select-field.js.map +1 -0
- package/dist/form-engine/smart-number-field.d.ts +22 -0
- package/dist/form-engine/smart-number-field.d.ts.map +1 -0
- package/dist/form-engine/smart-number-field.js +115 -0
- package/dist/form-engine/smart-number-field.js.map +1 -0
- package/dist/form-engine/smart-password-field.d.ts +7 -0
- package/dist/form-engine/smart-password-field.d.ts.map +1 -0
- package/dist/form-engine/smart-password-field.js +5 -0
- package/dist/form-engine/smart-password-field.js.map +1 -0
- package/dist/form-engine/smart-radio-group-field.d.ts +10 -0
- package/dist/form-engine/smart-radio-group-field.d.ts.map +1 -0
- package/dist/form-engine/smart-radio-group-field.js +5 -0
- package/dist/form-engine/smart-radio-group-field.js.map +1 -0
- package/dist/form-engine/smart-segmented-field.d.ts +9 -0
- package/dist/form-engine/smart-segmented-field.d.ts.map +1 -0
- package/dist/form-engine/smart-segmented-field.js +5 -0
- package/dist/form-engine/smart-segmented-field.js.map +1 -0
- package/dist/form-engine/smart-select-field.d.ts +10 -0
- package/dist/form-engine/smart-select-field.d.ts.map +1 -0
- package/dist/form-engine/smart-select-field.js +5 -0
- package/dist/form-engine/smart-select-field.js.map +1 -0
- package/dist/form-engine/smart-slug-field.d.ts +12 -0
- package/dist/form-engine/smart-slug-field.d.ts.map +1 -0
- package/dist/form-engine/smart-slug-field.js +14 -0
- package/dist/form-engine/smart-slug-field.js.map +1 -0
- package/dist/form-engine/smart-switch-field.d.ts +5 -0
- package/dist/form-engine/smart-switch-field.d.ts.map +1 -0
- package/dist/form-engine/smart-switch-field.js +9 -0
- package/dist/form-engine/smart-switch-field.js.map +1 -0
- package/dist/form-engine/smart-tel-field.d.ts +7 -0
- package/dist/form-engine/smart-tel-field.d.ts.map +1 -0
- package/dist/form-engine/smart-tel-field.js +6 -0
- package/dist/form-engine/smart-tel-field.js.map +1 -0
- package/dist/form-engine/smart-text-editor-field.d.ts +15 -0
- package/dist/form-engine/smart-text-editor-field.d.ts.map +1 -0
- package/dist/form-engine/smart-text-editor-field.js +5 -0
- package/dist/form-engine/smart-text-editor-field.js.map +1 -0
- package/dist/form-engine/smart-textarea-field.d.ts +8 -0
- package/dist/form-engine/smart-textarea-field.d.ts.map +1 -0
- package/dist/form-engine/smart-textarea-field.js +5 -0
- package/dist/form-engine/smart-textarea-field.js.map +1 -0
- package/dist/form-engine/smart-time-field.d.ts +10 -0
- package/dist/form-engine/smart-time-field.d.ts.map +1 -0
- package/dist/form-engine/smart-time-field.js +5 -0
- package/dist/form-engine/smart-time-field.js.map +1 -0
- package/dist/form-engine/smart-time-range-field.d.ts +13 -0
- package/dist/form-engine/smart-time-range-field.d.ts.map +1 -0
- package/dist/form-engine/smart-time-range-field.js +5 -0
- package/dist/form-engine/smart-time-range-field.js.map +1 -0
- package/dist/form-engine/smart-year-field.d.ts +8 -0
- package/dist/form-engine/smart-year-field.d.ts.map +1 -0
- package/dist/form-engine/smart-year-field.js +5 -0
- package/dist/form-engine/smart-year-field.js.map +1 -0
- package/dist/form-engine/smart-yesno-field.d.ts +12 -0
- package/dist/form-engine/smart-yesno-field.d.ts.map +1 -0
- package/dist/form-engine/smart-yesno-field.js +14 -0
- package/dist/form-engine/smart-yesno-field.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +17 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/lexical-text-editor/SmartTextEditor.d.ts +61 -0
- package/dist/lexical-text-editor/SmartTextEditor.d.ts.map +1 -0
- package/dist/lexical-text-editor/SmartTextEditor.js +145 -0
- package/dist/lexical-text-editor/SmartTextEditor.js.map +1 -0
- package/dist/lexical-text-editor/editor-nodes.d.ts +3 -0
- package/dist/lexical-text-editor/editor-nodes.d.ts.map +1 -0
- package/dist/lexical-text-editor/editor-nodes.js +25 -0
- package/dist/lexical-text-editor/editor-nodes.js.map +1 -0
- package/dist/lexical-text-editor/editor-theme.d.ts +3 -0
- package/dist/lexical-text-editor/editor-theme.d.ts.map +1 -0
- package/dist/lexical-text-editor/editor-theme.js +78 -0
- package/dist/lexical-text-editor/editor-theme.js.map +1 -0
- package/dist/lexical-text-editor/index.d.ts +8 -0
- package/dist/lexical-text-editor/index.d.ts.map +1 -0
- package/dist/lexical-text-editor/index.js +6 -0
- package/dist/lexical-text-editor/index.js.map +1 -0
- package/dist/lexical-text-editor/nodes/image-node.d.ts +41 -0
- package/dist/lexical-text-editor/nodes/image-node.d.ts.map +1 -0
- package/dist/lexical-text-editor/nodes/image-node.js +89 -0
- package/dist/lexical-text-editor/nodes/image-node.js.map +1 -0
- package/dist/lexical-text-editor/nodes/page-break-node.d.ts +25 -0
- package/dist/lexical-text-editor/nodes/page-break-node.d.ts.map +1 -0
- package/dist/lexical-text-editor/nodes/page-break-node.js +84 -0
- package/dist/lexical-text-editor/nodes/page-break-node.js.map +1 -0
- package/dist/lexical-text-editor/plugins/auto-link-plugin.d.ts +3 -0
- package/dist/lexical-text-editor/plugins/auto-link-plugin.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/auto-link-plugin.js +12 -0
- package/dist/lexical-text-editor/plugins/auto-link-plugin.js.map +1 -0
- package/dist/lexical-text-editor/plugins/code-highlight-plugin.d.ts +6 -0
- package/dist/lexical-text-editor/plugins/code-highlight-plugin.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/code-highlight-plugin.js +14 -0
- package/dist/lexical-text-editor/plugins/code-highlight-plugin.js.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/align-menu.d.ts +7 -0
- package/dist/lexical-text-editor/plugins/toolbar/align-menu.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/align-menu.js +8 -0
- package/dist/lexical-text-editor/plugins/toolbar/align-menu.js.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/block-format-menu.d.ts +20 -0
- package/dist/lexical-text-editor/plugins/toolbar/block-format-menu.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/block-format-menu.js +78 -0
- package/dist/lexical-text-editor/plugins/toolbar/block-format-menu.js.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/constants.d.ts +36 -0
- package/dist/lexical-text-editor/plugins/toolbar/constants.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/constants.js +67 -0
- package/dist/lexical-text-editor/plugins/toolbar/constants.js.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/inline-marks.d.ts +14 -0
- package/dist/lexical-text-editor/plugins/toolbar/inline-marks.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/inline-marks.js +129 -0
- package/dist/lexical-text-editor/plugins/toolbar/inline-marks.js.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/insert-menu.d.ts +8 -0
- package/dist/lexical-text-editor/plugins/toolbar/insert-menu.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/insert-menu.js +87 -0
- package/dist/lexical-text-editor/plugins/toolbar/insert-menu.js.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/link-editor.d.ts +11 -0
- package/dist/lexical-text-editor/plugins/toolbar/link-editor.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/link-editor.js +51 -0
- package/dist/lexical-text-editor/plugins/toolbar/link-editor.js.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/primitives.d.ts +39 -0
- package/dist/lexical-text-editor/plugins/toolbar/primitives.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/primitives.js +47 -0
- package/dist/lexical-text-editor/plugins/toolbar/primitives.js.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/use-insert-commands.d.ts +9 -0
- package/dist/lexical-text-editor/plugins/toolbar/use-insert-commands.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/use-insert-commands.js +29 -0
- package/dist/lexical-text-editor/plugins/toolbar/use-insert-commands.js.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/use-toolbar-state.d.ts +30 -0
- package/dist/lexical-text-editor/plugins/toolbar/use-toolbar-state.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/use-toolbar-state.js +128 -0
- package/dist/lexical-text-editor/plugins/toolbar/use-toolbar-state.js.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar-plugin.d.ts +8 -0
- package/dist/lexical-text-editor/plugins/toolbar-plugin.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar-plugin.js +51 -0
- package/dist/lexical-text-editor/plugins/toolbar-plugin.js.map +1 -0
- package/dist/lexical-text-editor/sanitize.d.ts +24 -0
- package/dist/lexical-text-editor/sanitize.d.ts.map +1 -0
- package/dist/lexical-text-editor/sanitize.js +140 -0
- package/dist/lexical-text-editor/sanitize.js.map +1 -0
- package/dist/lib/format.d.ts +17 -0
- package/dist/lib/format.d.ts.map +1 -0
- package/dist/lib/format.js +40 -0
- package/dist/lib/format.js.map +1 -0
- package/dist/lib/leading-space.d.ts +28 -0
- package/dist/lib/leading-space.d.ts.map +1 -0
- package/dist/lib/leading-space.js +34 -0
- package/dist/lib/leading-space.js.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +4 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/xlsx.d.ts +80 -0
- package/dist/lib/xlsx.d.ts.map +1 -0
- package/dist/lib/xlsx.js +377 -0
- package/dist/lib/xlsx.js.map +1 -0
- package/dist/search-engine/build-query.d.ts +29 -0
- package/dist/search-engine/build-query.d.ts.map +1 -0
- package/dist/search-engine/build-query.js +51 -0
- package/dist/search-engine/build-query.js.map +1 -0
- package/dist/search-engine/index.d.ts +15 -0
- package/dist/search-engine/index.d.ts.map +1 -0
- package/dist/search-engine/index.js +13 -0
- package/dist/search-engine/index.js.map +1 -0
- package/dist/search-engine/smart-search-form.d.ts +92 -0
- package/dist/search-engine/smart-search-form.d.ts.map +1 -0
- package/dist/search-engine/smart-search-form.js +136 -0
- package/dist/search-engine/smart-search-form.js.map +1 -0
- package/dist/search-engine/types.d.ts +40 -0
- package/dist/search-engine/types.d.ts.map +1 -0
- package/dist/search-engine/types.js +11 -0
- package/dist/search-engine/types.js.map +1 -0
- package/dist/smart-components/buttons/action-button.d.ts +66 -0
- package/dist/smart-components/buttons/action-button.d.ts.map +1 -0
- package/dist/smart-components/buttons/action-button.js +79 -0
- package/dist/smart-components/buttons/action-button.js.map +1 -0
- package/dist/smart-components/buttons/action-buttons.d.ts +122 -0
- package/dist/smart-components/buttons/action-buttons.d.ts.map +1 -0
- package/dist/smart-components/buttons/action-buttons.js +42 -0
- package/dist/smart-components/buttons/action-buttons.js.map +1 -0
- package/dist/smart-components/buttons/action-config.d.ts +181 -0
- package/dist/smart-components/buttons/action-config.d.ts.map +1 -0
- package/dist/smart-components/buttons/action-config.js +128 -0
- package/dist/smart-components/buttons/action-config.js.map +1 -0
- package/dist/smart-components/buttons/index.d.ts +4 -0
- package/dist/smart-components/buttons/index.d.ts.map +1 -0
- package/dist/smart-components/buttons/index.js +7 -0
- package/dist/smart-components/buttons/index.js.map +1 -0
- package/dist/smart-components/loading-overlay.d.ts +16 -0
- package/dist/smart-components/loading-overlay.d.ts.map +1 -0
- package/dist/smart-components/loading-overlay.js +13 -0
- package/dist/smart-components/loading-overlay.js.map +1 -0
- package/dist/smart-components/page/index.d.ts +19 -0
- package/dist/smart-components/page/index.d.ts.map +1 -0
- package/dist/smart-components/page/index.js +33 -0
- package/dist/smart-components/page/index.js.map +1 -0
- package/dist/smart-components/page/layouts/page-states.d.ts +17 -0
- package/dist/smart-components/page/layouts/page-states.d.ts.map +1 -0
- package/dist/smart-components/page/layouts/page-states.js +12 -0
- package/dist/smart-components/page/layouts/page-states.js.map +1 -0
- package/dist/smart-components/page/layouts/slot-buckets.d.ts +21 -0
- package/dist/smart-components/page/layouts/slot-buckets.d.ts.map +1 -0
- package/dist/smart-components/page/layouts/slot-buckets.js +2 -0
- package/dist/smart-components/page/layouts/slot-buckets.js.map +1 -0
- package/dist/smart-components/page/layouts/split-layout.d.ts +13 -0
- package/dist/smart-components/page/layouts/split-layout.d.ts.map +1 -0
- package/dist/smart-components/page/layouts/split-layout.js +14 -0
- package/dist/smart-components/page/layouts/split-layout.js.map +1 -0
- package/dist/smart-components/page/layouts/standard-layout.d.ts +18 -0
- package/dist/smart-components/page/layouts/standard-layout.d.ts.map +1 -0
- package/dist/smart-components/page/layouts/standard-layout.js +61 -0
- package/dist/smart-components/page/layouts/standard-layout.js.map +1 -0
- package/dist/smart-components/page/page-context.d.ts +51 -0
- package/dist/smart-components/page/page-context.d.ts.map +1 -0
- package/dist/smart-components/page/page-context.js +21 -0
- package/dist/smart-components/page/page-context.js.map +1 -0
- package/dist/smart-components/page/slot.d.ts +19 -0
- package/dist/smart-components/page/slot.d.ts.map +1 -0
- package/dist/smart-components/page/slot.js +18 -0
- package/dist/smart-components/page/slot.js.map +1 -0
- package/dist/smart-components/page/smart-grid-area.d.ts +75 -0
- package/dist/smart-components/page/smart-grid-area.d.ts.map +1 -0
- package/dist/smart-components/page/smart-grid-area.js +61 -0
- package/dist/smart-components/page/smart-grid-area.js.map +1 -0
- package/dist/smart-components/page/smart-page-container.d.ts +66 -0
- package/dist/smart-components/page/smart-page-container.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-container.js +93 -0
- package/dist/smart-components/page/smart-page-container.js.map +1 -0
- package/dist/smart-components/page/smart-page-content.d.ts +70 -0
- package/dist/smart-components/page/smart-page-content.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-content.js +78 -0
- package/dist/smart-components/page/smart-page-content.js.map +1 -0
- package/dist/smart-components/page/smart-page-empty.d.ts +47 -0
- package/dist/smart-components/page/smart-page-empty.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-empty.js +37 -0
- package/dist/smart-components/page/smart-page-empty.js.map +1 -0
- package/dist/smart-components/page/smart-page-error.d.ts +59 -0
- package/dist/smart-components/page/smart-page-error.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-error.js +45 -0
- package/dist/smart-components/page/smart-page-error.js.map +1 -0
- package/dist/smart-components/page/smart-page-filters.d.ts +38 -0
- package/dist/smart-components/page/smart-page-filters.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-filters.js +33 -0
- package/dist/smart-components/page/smart-page-filters.js.map +1 -0
- package/dist/smart-components/page/smart-page-footer.d.ts +49 -0
- package/dist/smart-components/page/smart-page-footer.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-footer.js +49 -0
- package/dist/smart-components/page/smart-page-footer.js.map +1 -0
- package/dist/smart-components/page/smart-page-header.d.ts +145 -0
- package/dist/smart-components/page/smart-page-header.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-header.js +129 -0
- package/dist/smart-components/page/smart-page-header.js.map +1 -0
- package/dist/smart-components/page/smart-page-hero.d.ts +43 -0
- package/dist/smart-components/page/smart-page-hero.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-hero.js +42 -0
- package/dist/smart-components/page/smart-page-hero.js.map +1 -0
- package/dist/smart-components/page/smart-page-loading.d.ts +31 -0
- package/dist/smart-components/page/smart-page-loading.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-loading.js +29 -0
- package/dist/smart-components/page/smart-page-loading.js.map +1 -0
- package/dist/smart-components/page/smart-page-search.d.ts +39 -0
- package/dist/smart-components/page/smart-page-search.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-search.js +38 -0
- package/dist/smart-components/page/smart-page-search.js.map +1 -0
- package/dist/smart-components/page/smart-page-section.d.ts +55 -0
- package/dist/smart-components/page/smart-page-section.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-section.js +41 -0
- package/dist/smart-components/page/smart-page-section.js.map +1 -0
- package/dist/smart-components/page/smart-page-status-bar.d.ts +34 -0
- package/dist/smart-components/page/smart-page-status-bar.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-status-bar.js +33 -0
- package/dist/smart-components/page/smart-page-status-bar.js.map +1 -0
- package/dist/smart-components/page/smart-page-tabs.d.ts +93 -0
- package/dist/smart-components/page/smart-page-tabs.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-tabs.js +87 -0
- package/dist/smart-components/page/smart-page-tabs.js.map +1 -0
- package/dist/smart-components/page/smart-page.d.ts +141 -0
- package/dist/smart-components/page/smart-page.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page.js +295 -0
- package/dist/smart-components/page/smart-page.js.map +1 -0
- package/dist/smart-components/page/smart-sidebar.d.ts +70 -0
- package/dist/smart-components/page/smart-sidebar.d.ts.map +1 -0
- package/dist/smart-components/page/smart-sidebar.js +54 -0
- package/dist/smart-components/page/smart-sidebar.js.map +1 -0
- package/dist/smart-components/page/smart-toolbar.d.ts +40 -0
- package/dist/smart-components/page/smart-toolbar.d.ts.map +1 -0
- package/dist/smart-components/page/smart-toolbar.js +39 -0
- package/dist/smart-components/page/smart-toolbar.js.map +1 -0
- package/dist/smart-components/search-input.d.ts +20 -0
- package/dist/smart-components/search-input.d.ts.map +1 -0
- package/dist/smart-components/search-input.js +12 -0
- package/dist/smart-components/search-input.js.map +1 -0
- package/dist/smart-components/smart-accordion.d.ts +53 -0
- package/dist/smart-components/smart-accordion.d.ts.map +1 -0
- package/dist/smart-components/smart-accordion.js +33 -0
- package/dist/smart-components/smart-accordion.js.map +1 -0
- package/dist/smart-components/smart-alert.d.ts +44 -0
- package/dist/smart-components/smart-alert.d.ts.map +1 -0
- package/dist/smart-components/smart-alert.js +27 -0
- package/dist/smart-components/smart-alert.js.map +1 -0
- package/dist/smart-components/smart-avatar.d.ts +3 -0
- package/dist/smart-components/smart-avatar.d.ts.map +1 -0
- package/dist/smart-components/smart-avatar.js +4 -0
- package/dist/smart-components/smart-avatar.js.map +1 -0
- package/dist/smart-components/smart-badge.d.ts +28 -0
- package/dist/smart-components/smart-badge.d.ts.map +1 -0
- package/dist/smart-components/smart-badge.js +24 -0
- package/dist/smart-components/smart-badge.js.map +1 -0
- package/dist/smart-components/smart-breadcrumb.d.ts +43 -0
- package/dist/smart-components/smart-breadcrumb.d.ts.map +1 -0
- package/dist/smart-components/smart-breadcrumb.js +37 -0
- package/dist/smart-components/smart-breadcrumb.js.map +1 -0
- package/dist/smart-components/smart-button.d.ts +22 -0
- package/dist/smart-components/smart-button.d.ts.map +1 -0
- package/dist/smart-components/smart-button.js +15 -0
- package/dist/smart-components/smart-button.js.map +1 -0
- package/dist/smart-components/smart-calendar.d.ts +78 -0
- package/dist/smart-components/smart-calendar.d.ts.map +1 -0
- package/dist/smart-components/smart-calendar.js +45 -0
- package/dist/smart-components/smart-calendar.js.map +1 -0
- package/dist/smart-components/smart-card.d.ts +55 -0
- package/dist/smart-components/smart-card.d.ts.map +1 -0
- package/dist/smart-components/smart-card.js +37 -0
- package/dist/smart-components/smart-card.js.map +1 -0
- package/dist/smart-components/smart-checkbox-group.d.ts +48 -0
- package/dist/smart-components/smart-checkbox-group.d.ts.map +1 -0
- package/dist/smart-components/smart-checkbox-group.js +48 -0
- package/dist/smart-components/smart-checkbox-group.js.map +1 -0
- package/dist/smart-components/smart-checkbox.d.ts +34 -0
- package/dist/smart-components/smart-checkbox.d.ts.map +1 -0
- package/dist/smart-components/smart-checkbox.js +34 -0
- package/dist/smart-components/smart-checkbox.js.map +1 -0
- package/dist/smart-components/smart-combobox.d.ts +36 -0
- package/dist/smart-components/smart-combobox.d.ts.map +1 -0
- package/dist/smart-components/smart-combobox.js +32 -0
- package/dist/smart-components/smart-combobox.js.map +1 -0
- package/dist/smart-components/smart-confirm-dialog.d.ts +63 -0
- package/dist/smart-components/smart-confirm-dialog.d.ts.map +1 -0
- package/dist/smart-components/smart-confirm-dialog.js +45 -0
- package/dist/smart-components/smart-confirm-dialog.js.map +1 -0
- package/dist/smart-components/smart-context-menu.d.ts +58 -0
- package/dist/smart-components/smart-context-menu.d.ts.map +1 -0
- package/dist/smart-components/smart-context-menu.js +38 -0
- package/dist/smart-components/smart-context-menu.js.map +1 -0
- package/dist/smart-components/smart-date-picker.d.ts +99 -0
- package/dist/smart-components/smart-date-picker.d.ts.map +1 -0
- package/dist/smart-components/smart-date-picker.js +78 -0
- package/dist/smart-components/smart-date-picker.js.map +1 -0
- package/dist/smart-components/smart-date-range-picker.d.ts +37 -0
- package/dist/smart-components/smart-date-range-picker.d.ts.map +1 -0
- package/dist/smart-components/smart-date-range-picker.js +38 -0
- package/dist/smart-components/smart-date-range-picker.js.map +1 -0
- package/dist/smart-components/smart-dialog.d.ts +75 -0
- package/dist/smart-components/smart-dialog.d.ts.map +1 -0
- package/dist/smart-components/smart-dialog.js +61 -0
- package/dist/smart-components/smart-dialog.js.map +1 -0
- package/dist/smart-components/smart-drawer.d.ts +48 -0
- package/dist/smart-components/smart-drawer.d.ts.map +1 -0
- package/dist/smart-components/smart-drawer.js +32 -0
- package/dist/smart-components/smart-drawer.js.map +1 -0
- package/dist/smart-components/smart-field.d.ts +47 -0
- package/dist/smart-components/smart-field.d.ts.map +1 -0
- package/dist/smart-components/smart-field.js +44 -0
- package/dist/smart-components/smart-field.js.map +1 -0
- package/dist/smart-components/smart-input-group.d.ts +60 -0
- package/dist/smart-components/smart-input-group.d.ts.map +1 -0
- package/dist/smart-components/smart-input-group.js +40 -0
- package/dist/smart-components/smart-input-group.js.map +1 -0
- package/dist/smart-components/smart-input.d.ts +46 -0
- package/dist/smart-components/smart-input.d.ts.map +1 -0
- package/dist/smart-components/smart-input.js +36 -0
- package/dist/smart-components/smart-input.js.map +1 -0
- package/dist/smart-components/smart-label.d.ts +22 -0
- package/dist/smart-components/smart-label.d.ts.map +1 -0
- package/dist/smart-components/smart-label.js +17 -0
- package/dist/smart-components/smart-label.js.map +1 -0
- package/dist/smart-components/smart-month-picker.d.ts +30 -0
- package/dist/smart-components/smart-month-picker.d.ts.map +1 -0
- package/dist/smart-components/smart-month-picker.js +53 -0
- package/dist/smart-components/smart-month-picker.js.map +1 -0
- package/dist/smart-components/smart-multi-select.d.ts +38 -0
- package/dist/smart-components/smart-multi-select.d.ts.map +1 -0
- package/dist/smart-components/smart-multi-select.js +56 -0
- package/dist/smart-components/smart-multi-select.js.map +1 -0
- package/dist/smart-components/smart-native-select.d.ts +45 -0
- package/dist/smart-components/smart-native-select.d.ts.map +1 -0
- package/dist/smart-components/smart-native-select.js +33 -0
- package/dist/smart-components/smart-native-select.js.map +1 -0
- package/dist/smart-components/smart-nav-sidebar.d.ts +47 -0
- package/dist/smart-components/smart-nav-sidebar.d.ts.map +1 -0
- package/dist/smart-components/smart-nav-sidebar.js +37 -0
- package/dist/smart-components/smart-nav-sidebar.js.map +1 -0
- package/dist/smart-components/smart-password-input.d.ts +31 -0
- package/dist/smart-components/smart-password-input.d.ts.map +1 -0
- package/dist/smart-components/smart-password-input.js +30 -0
- package/dist/smart-components/smart-password-input.js.map +1 -0
- package/dist/smart-components/smart-radio-group.d.ts +58 -0
- package/dist/smart-components/smart-radio-group.d.ts.map +1 -0
- package/dist/smart-components/smart-radio-group.js +49 -0
- package/dist/smart-components/smart-radio-group.js.map +1 -0
- package/dist/smart-components/smart-segmented.d.ts +33 -0
- package/dist/smart-components/smart-segmented.d.ts.map +1 -0
- package/dist/smart-components/smart-segmented.js +25 -0
- package/dist/smart-components/smart-segmented.js.map +1 -0
- package/dist/smart-components/smart-select.d.ts +71 -0
- package/dist/smart-components/smart-select.d.ts.map +1 -0
- package/dist/smart-components/smart-select.js +44 -0
- package/dist/smart-components/smart-select.js.map +1 -0
- package/dist/smart-components/smart-separator.d.ts +3 -0
- package/dist/smart-components/smart-separator.d.ts.map +1 -0
- package/dist/smart-components/smart-separator.js +4 -0
- package/dist/smart-components/smart-separator.js.map +1 -0
- package/dist/smart-components/smart-sheet.d.ts +79 -0
- package/dist/smart-components/smart-sheet.d.ts.map +1 -0
- package/dist/smart-components/smart-sheet.js +47 -0
- package/dist/smart-components/smart-sheet.js.map +1 -0
- package/dist/smart-components/smart-stat-card.d.ts +47 -0
- package/dist/smart-components/smart-stat-card.d.ts.map +1 -0
- package/dist/smart-components/smart-stat-card.js +35 -0
- package/dist/smart-components/smart-stat-card.js.map +1 -0
- package/dist/smart-components/smart-stepper.d.ts +24 -0
- package/dist/smart-components/smart-stepper.d.ts.map +1 -0
- package/dist/smart-components/smart-stepper.js +24 -0
- package/dist/smart-components/smart-stepper.js.map +1 -0
- package/dist/smart-components/smart-switch.d.ts +34 -0
- package/dist/smart-components/smart-switch.d.ts.map +1 -0
- package/dist/smart-components/smart-switch.js +34 -0
- package/dist/smart-components/smart-switch.js.map +1 -0
- package/dist/smart-components/smart-textarea.d.ts +38 -0
- package/dist/smart-components/smart-textarea.d.ts.map +1 -0
- package/dist/smart-components/smart-textarea.js +28 -0
- package/dist/smart-components/smart-textarea.js.map +1 -0
- package/dist/smart-components/smart-time-picker.d.ts +59 -0
- package/dist/smart-components/smart-time-picker.d.ts.map +1 -0
- package/dist/smart-components/smart-time-picker.js +129 -0
- package/dist/smart-components/smart-time-picker.js.map +1 -0
- package/dist/smart-components/smart-time-range-picker.d.ts +39 -0
- package/dist/smart-components/smart-time-range-picker.d.ts.map +1 -0
- package/dist/smart-components/smart-time-range-picker.js +26 -0
- package/dist/smart-components/smart-time-range-picker.js.map +1 -0
- package/dist/smart-components/smart-toaster.d.ts +10 -0
- package/dist/smart-components/smart-toaster.d.ts.map +1 -0
- package/dist/smart-components/smart-toaster.js +21 -0
- package/dist/smart-components/smart-toaster.js.map +1 -0
- package/dist/smart-components/smart-year-picker.d.ts +29 -0
- package/dist/smart-components/smart-year-picker.d.ts.map +1 -0
- package/dist/smart-components/smart-year-picker.js +43 -0
- package/dist/smart-components/smart-year-picker.js.map +1 -0
- package/dist/smart-components/spinner.d.ts +10 -0
- package/dist/smart-components/spinner.d.ts.map +1 -0
- package/dist/smart-components/spinner.js +5 -0
- package/dist/smart-components/spinner.js.map +1 -0
- package/dist/transfer-list-engine/index.d.ts +5 -0
- package/dist/transfer-list-engine/index.d.ts.map +1 -0
- package/dist/transfer-list-engine/index.js +3 -0
- package/dist/transfer-list-engine/index.js.map +1 -0
- package/dist/transfer-list-engine/transfer-list.d.ts +53 -0
- package/dist/transfer-list-engine/transfer-list.d.ts.map +1 -0
- package/dist/transfer-list-engine/transfer-list.js +190 -0
- package/dist/transfer-list-engine/transfer-list.js.map +1 -0
- package/dist/transfer-list-engine/transfer-utils.d.ts +30 -0
- package/dist/transfer-list-engine/transfer-utils.d.ts.map +1 -0
- package/dist/transfer-list-engine/transfer-utils.js +69 -0
- package/dist/transfer-list-engine/transfer-utils.js.map +1 -0
- package/dist/transfer-list-engine/types.d.ts +51 -0
- package/dist/transfer-list-engine/types.d.ts.map +1 -0
- package/dist/transfer-list-engine/types.js +2 -0
- package/dist/transfer-list-engine/types.js.map +1 -0
- package/dist/tree-engine/index.d.ts +6 -0
- package/dist/tree-engine/index.d.ts.map +1 -0
- package/dist/tree-engine/index.js +3 -0
- package/dist/tree-engine/index.js.map +1 -0
- package/dist/tree-engine/tree-utils.d.ts +84 -0
- package/dist/tree-engine/tree-utils.d.ts.map +1 -0
- package/dist/tree-engine/tree-utils.js +271 -0
- package/dist/tree-engine/tree-utils.js.map +1 -0
- package/dist/tree-engine/tree.d.ts +98 -0
- package/dist/tree-engine/tree.d.ts.map +1 -0
- package/dist/tree-engine/tree.js +430 -0
- package/dist/tree-engine/tree.js.map +1 -0
- package/dist/tree-engine/types.d.ts +85 -0
- package/dist/tree-engine/types.d.ts.map +1 -0
- package/dist/tree-engine/types.js +2 -0
- package/dist/tree-engine/types.js.map +1 -0
- package/dist/tree-engine/use-tree.d.ts +12 -0
- package/dist/tree-engine/use-tree.d.ts.map +1 -0
- package/dist/tree-engine/use-tree.js +34 -0
- package/dist/tree-engine/use-tree.js.map +1 -0
- package/package.json +158 -0
- package/src/styles/globals.css +161 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { CalendarDaysIcon, ChevronLeftIcon, ChevronRightIcon, } from "lucide-react";
|
|
5
|
+
import { Button } from "@iamsaroj/smart-ui/components/button";
|
|
6
|
+
import { cn } from "@iamsaroj/smart-ui/lib/utils";
|
|
7
|
+
import { useControllable } from "./use-calendar";
|
|
8
|
+
import { buildWeekDays, stepDate, viewRange, viewTitle } from "./calendar-utils";
|
|
9
|
+
import { expandEvents } from "./recurrence";
|
|
10
|
+
import { MonthView } from "./month-view";
|
|
11
|
+
import { TimeGridView } from "./time-grid-view";
|
|
12
|
+
import { AgendaView } from "./agenda-view";
|
|
13
|
+
const VIEW_LABELS = {
|
|
14
|
+
month: "Month",
|
|
15
|
+
week: "Week",
|
|
16
|
+
day: "Day",
|
|
17
|
+
agenda: "Agenda",
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* `SmartCalendar` — a declarative calendar & booking surface with month, week,
|
|
21
|
+
* day, and agenda views. Date, view, and events are each independently
|
|
22
|
+
* controllable or uncontrolled; navigation, view switching, slot selection, and
|
|
23
|
+
* event activation are exposed through callbacks and an imperative
|
|
24
|
+
* `SmartCalendarHandle`.
|
|
25
|
+
*/
|
|
26
|
+
export function SmartCalendar({ events = [], date, defaultDate, onDateChange, view, defaultView = "month", onViewChange, views = ["month", "week", "day", "agenda"], size = "md", weekStartsOn = 0, minHour = 0, maxHour = 24, slotMinutes = 30, defaultDurationMinutes = 60, businessHours, maxEventsPerDay = 3, editable = false, onEventChange, availability, slotCapacity = 1, onSlotBook, onEventClick, onSlotSelect, renderEvent, hideToolbar, toolbarExtra, className, ref, }) {
|
|
27
|
+
const [anchor, setAnchor] = useControllable(date, defaultDate ?? new Date(), onDateChange);
|
|
28
|
+
const [activeView, setActiveView] = useControllable(view, defaultView, onViewChange);
|
|
29
|
+
// A stable "now" for today-highlighting; refreshed each minute so the time
|
|
30
|
+
// indicator drifts without re-rendering on every tick.
|
|
31
|
+
const [now, setNow] = React.useState(() => new Date());
|
|
32
|
+
React.useEffect(() => {
|
|
33
|
+
const id = setInterval(() => setNow(new Date()), 60_000);
|
|
34
|
+
return () => clearInterval(id);
|
|
35
|
+
}, []);
|
|
36
|
+
React.useImperativeHandle(ref, () => ({
|
|
37
|
+
next: () => setAnchor((d) => stepDate(d, activeView, 1)),
|
|
38
|
+
prev: () => setAnchor((d) => stepDate(d, activeView, -1)),
|
|
39
|
+
today: () => setAnchor(new Date()),
|
|
40
|
+
goToDate: (d) => setAnchor(d),
|
|
41
|
+
setView: (v) => setActiveView(v),
|
|
42
|
+
getDate: () => anchor,
|
|
43
|
+
getView: () => activeView,
|
|
44
|
+
}), [activeView, anchor, setAnchor, setActiveView]);
|
|
45
|
+
// Expand recurrence + scope to the visible range once, so each view filters a
|
|
46
|
+
// smaller, already-concrete set of events.
|
|
47
|
+
const visibleEvents = React.useMemo(() => {
|
|
48
|
+
const range = viewRange(anchor, activeView, weekStartsOn);
|
|
49
|
+
return expandEvents(events, range, defaultDurationMinutes);
|
|
50
|
+
}, [events, anchor, activeView, weekStartsOn, defaultDurationMinutes]);
|
|
51
|
+
const viewProps = {
|
|
52
|
+
date: anchor,
|
|
53
|
+
events: visibleEvents,
|
|
54
|
+
size,
|
|
55
|
+
weekStartsOn,
|
|
56
|
+
minHour,
|
|
57
|
+
maxHour,
|
|
58
|
+
slotMinutes,
|
|
59
|
+
defaultDurationMinutes,
|
|
60
|
+
businessHours,
|
|
61
|
+
now,
|
|
62
|
+
onEventClick,
|
|
63
|
+
onSlotSelect,
|
|
64
|
+
onDateClick: (d) => {
|
|
65
|
+
setAnchor(d);
|
|
66
|
+
if (views.includes("day"))
|
|
67
|
+
setActiveView("day");
|
|
68
|
+
},
|
|
69
|
+
renderEvent,
|
|
70
|
+
maxEventsPerDay,
|
|
71
|
+
editable,
|
|
72
|
+
onEventChange,
|
|
73
|
+
availability,
|
|
74
|
+
slotCapacity,
|
|
75
|
+
onSlotBook,
|
|
76
|
+
};
|
|
77
|
+
return (_jsxs("div", { className: cn("flex h-full min-h-0 flex-col overflow-hidden rounded-lg border border-border bg-card text-card-foreground", className), children: [!hideToolbar && (_jsxs("div", { className: "flex flex-wrap items-center gap-2 border-b border-border px-3 py-2", children: [_jsxs("div", { className: "flex items-center gap-1", children: [_jsx(Button, { variant: "outline", size: "sm", onClick: () => setAnchor(new Date()), children: "Today" }), _jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": "Previous", onClick: () => setAnchor((d) => stepDate(d, activeView, -1)), children: _jsx(ChevronLeftIcon, {}) }), _jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": "Next", onClick: () => setAnchor((d) => stepDate(d, activeView, 1)), children: _jsx(ChevronRightIcon, {}) })] }), _jsxs("div", { className: "flex items-center gap-1.5 text-sm font-semibold", children: [_jsx(CalendarDaysIcon, { className: "size-4 text-muted-foreground" }), viewTitle(anchor, activeView, weekStartsOn)] }), _jsxs("div", { className: "ml-auto flex items-center gap-2", children: [toolbarExtra, views.length > 1 && (_jsx("div", { className: "flex items-center rounded-md border border-border p-0.5", children: views.map((v) => (_jsx("button", { type: "button", onClick: () => setActiveView(v), className: cn("rounded px-2.5 py-1 text-xs font-medium transition-colors", activeView === v
|
|
78
|
+
? "bg-primary text-primary-foreground"
|
|
79
|
+
: "text-muted-foreground hover:text-foreground"), children: VIEW_LABELS[v] }, v))) }))] })] })), activeView === "month" && _jsx(MonthView, { ...viewProps }), activeView === "week" && (_jsx(TimeGridView, { ...viewProps, days: buildWeekDays(anchor, weekStartsOn) })), activeView === "day" && _jsx(TimeGridView, { ...viewProps, days: [anchor] }), activeView === "agenda" && _jsx(AgendaView, { ...viewProps })] }));
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=calendar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../src/calendar-engine/calendar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,gBAAgB,GACjB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAA;AAC7D,OAAO,EAAE,EAAE,EAAE,MAAM,8BAA8B,CAAA;AAajD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,YAAY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,YAE3D,KAAC,gBAAgB,KAAG,GACb,IACL,EAEN,eAAK,SAAS,EAAC,iDAAiD,aAC9D,KAAC,gBAAgB,IAAC,SAAS,EAAC,8BAA8B,GAAG,EAC5D,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,YAAY,CAAC,IACxC,EAEN,eAAK,SAAS,EAAC,iCAAiC,aAC7C,YAAY,EACZ,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,CACnB,cAAK,SAAS,EAAC,yDAAyD,YACrE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAChB,iBAEE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,EAC/B,SAAS,EAAE,EAAE,CACX,2DAA2D,EAC3D,UAAU,KAAK,CAAC;wCACd,CAAC,CAAC,oCAAoC;wCACtC,CAAC,CAAC,6CAA6C,CAClD,YAEA,WAAW,CAAC,CAAC,CAAC,IAVV,CAAC,CAWC,CACV,CAAC,GACE,CACP,IACG,IACF,CACP,EAEA,UAAU,KAAK,OAAO,IAAI,KAAC,SAAS,OAAK,SAAS,GAAI,EACtD,UAAU,KAAK,MAAM,IAAI,CACxB,KAAC,YAAY,OACP,SAAS,EACb,IAAI,EAAE,aAAa,CAAC,MAAM,EAAE,YAAY,CAAC,GACzC,CACH,EACA,UAAU,KAAK,KAAK,IAAI,KAAC,YAAY,OAAK,SAAS,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,GAAI,EACvE,UAAU,KAAK,QAAQ,IAAI,KAAC,UAAU,OAAK,SAAS,GAAI,IACrD,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CalendarEventColor } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Themed class sets for each preset color token. Kept out of the components so
|
|
4
|
+
* both the month "pill" and the time-grid "block" share one source of truth and
|
|
5
|
+
* stay legible in light and dark mode.
|
|
6
|
+
*
|
|
7
|
+
* - `block` — filled block used in week/day/agenda (solid-ish background).
|
|
8
|
+
* - `pill` — compact month-cell chip (softer background + colored dot).
|
|
9
|
+
* - `dot` — the leading indicator dot in the month/agenda rows.
|
|
10
|
+
*/
|
|
11
|
+
export interface EventColorClasses {
|
|
12
|
+
block: string;
|
|
13
|
+
pill: string;
|
|
14
|
+
dot: string;
|
|
15
|
+
}
|
|
16
|
+
/** Resolve the class set for a color token, defaulting to blue. */
|
|
17
|
+
export declare function eventColorClasses(color: CalendarEventColor | undefined): EventColorClasses;
|
|
18
|
+
/** All available color tokens, in a stable presentation order. */
|
|
19
|
+
export declare const EVENT_COLORS: CalendarEventColor[];
|
|
20
|
+
//# sourceMappingURL=event-color.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-color.d.ts","sourceRoot":"","sources":["../../src/calendar-engine/event-color.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAEjD;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;CACZ;AAsDD,mEAAmE;AACnE,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,kBAAkB,GAAG,SAAS,GACpC,iBAAiB,CAEnB;AAED,kEAAkE;AAClE,eAAO,MAAM,YAAY,EAAE,kBAAkB,EAS5C,CAAA"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const COLORS = {
|
|
2
|
+
blue: {
|
|
3
|
+
block: "bg-blue-500/15 text-blue-700 border-blue-500/30 dark:text-blue-200 dark:bg-blue-500/25",
|
|
4
|
+
pill: "hover:bg-blue-500/10 text-blue-700 dark:text-blue-200",
|
|
5
|
+
dot: "bg-blue-500",
|
|
6
|
+
},
|
|
7
|
+
green: {
|
|
8
|
+
block: "bg-emerald-500/15 text-emerald-700 border-emerald-500/30 dark:text-emerald-200 dark:bg-emerald-500/25",
|
|
9
|
+
pill: "hover:bg-emerald-500/10 text-emerald-700 dark:text-emerald-200",
|
|
10
|
+
dot: "bg-emerald-500",
|
|
11
|
+
},
|
|
12
|
+
amber: {
|
|
13
|
+
block: "bg-amber-500/15 text-amber-700 border-amber-500/30 dark:text-amber-200 dark:bg-amber-500/25",
|
|
14
|
+
pill: "hover:bg-amber-500/10 text-amber-700 dark:text-amber-200",
|
|
15
|
+
dot: "bg-amber-500",
|
|
16
|
+
},
|
|
17
|
+
red: {
|
|
18
|
+
block: "bg-red-500/15 text-red-700 border-red-500/30 dark:text-red-200 dark:bg-red-500/25",
|
|
19
|
+
pill: "hover:bg-red-500/10 text-red-700 dark:text-red-200",
|
|
20
|
+
dot: "bg-red-500",
|
|
21
|
+
},
|
|
22
|
+
violet: {
|
|
23
|
+
block: "bg-violet-500/15 text-violet-700 border-violet-500/30 dark:text-violet-200 dark:bg-violet-500/25",
|
|
24
|
+
pill: "hover:bg-violet-500/10 text-violet-700 dark:text-violet-200",
|
|
25
|
+
dot: "bg-violet-500",
|
|
26
|
+
},
|
|
27
|
+
pink: {
|
|
28
|
+
block: "bg-pink-500/15 text-pink-700 border-pink-500/30 dark:text-pink-200 dark:bg-pink-500/25",
|
|
29
|
+
pill: "hover:bg-pink-500/10 text-pink-700 dark:text-pink-200",
|
|
30
|
+
dot: "bg-pink-500",
|
|
31
|
+
},
|
|
32
|
+
cyan: {
|
|
33
|
+
block: "bg-cyan-500/15 text-cyan-700 border-cyan-500/30 dark:text-cyan-200 dark:bg-cyan-500/25",
|
|
34
|
+
pill: "hover:bg-cyan-500/10 text-cyan-700 dark:text-cyan-200",
|
|
35
|
+
dot: "bg-cyan-500",
|
|
36
|
+
},
|
|
37
|
+
gray: {
|
|
38
|
+
block: "bg-muted text-foreground border-border dark:bg-muted/60",
|
|
39
|
+
pill: "hover:bg-muted text-foreground",
|
|
40
|
+
dot: "bg-muted-foreground",
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
const FALLBACK = "blue";
|
|
44
|
+
/** Resolve the class set for a color token, defaulting to blue. */
|
|
45
|
+
export function eventColorClasses(color) {
|
|
46
|
+
return COLORS[color ?? FALLBACK] ?? COLORS[FALLBACK];
|
|
47
|
+
}
|
|
48
|
+
/** All available color tokens, in a stable presentation order. */
|
|
49
|
+
export const EVENT_COLORS = [
|
|
50
|
+
"blue",
|
|
51
|
+
"green",
|
|
52
|
+
"amber",
|
|
53
|
+
"red",
|
|
54
|
+
"violet",
|
|
55
|
+
"pink",
|
|
56
|
+
"cyan",
|
|
57
|
+
"gray",
|
|
58
|
+
];
|
|
59
|
+
//# sourceMappingURL=event-color.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-color.js","sourceRoot":"","sources":["../../src/calendar-engine/event-color.ts"],"names":[],"mappings":"AAiBA,MAAM,MAAM,GAAkD;IAC5D,IAAI,EAAE;QACJ,KAAK,EACH,wFAAwF;QAC1F,IAAI,EAAE,uDAAuD;QAC7D,GAAG,EAAE,aAAa;KACnB;IACD,KAAK,EAAE;QACL,KAAK,EACH,uGAAuG;QACzG,IAAI,EAAE,gEAAgE;QACtE,GAAG,EAAE,gBAAgB;KACtB;IACD,KAAK,EAAE;QACL,KAAK,EACH,6FAA6F;QAC/F,IAAI,EAAE,0DAA0D;QAChE,GAAG,EAAE,cAAc;KACpB;IACD,GAAG,EAAE;QACH,KAAK,EACH,mFAAmF;QACrF,IAAI,EAAE,oDAAoD;QAC1D,GAAG,EAAE,YAAY;KAClB;IACD,MAAM,EAAE;QACN,KAAK,EACH,kGAAkG;QACpG,IAAI,EAAE,6DAA6D;QACnE,GAAG,EAAE,eAAe;KACrB;IACD,IAAI,EAAE;QACJ,KAAK,EACH,wFAAwF;QAC1F,IAAI,EAAE,uDAAuD;QAC7D,GAAG,EAAE,aAAa;KACnB;IACD,IAAI,EAAE;QACJ,KAAK,EACH,wFAAwF;QAC1F,IAAI,EAAE,uDAAuD;QAC7D,GAAG,EAAE,aAAa;KACnB;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,yDAAyD;QAChE,IAAI,EAAE,gCAAgC;QACtC,GAAG,EAAE,qBAAqB;KAC3B;CACF,CAAA;AAED,MAAM,QAAQ,GAAuB,MAAM,CAAA;AAE3C,mEAAmE;AACnE,MAAM,UAAU,iBAAiB,CAC/B,KAAqC;IAErC,OAAO,MAAM,CAAC,KAAK,IAAI,QAAQ,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAA;AACtD,CAAC;AAED,kEAAkE;AAClE,MAAM,CAAC,MAAM,YAAY,GAAyB;IAChD,MAAM;IACN,OAAO;IACP,OAAO;IACP,KAAK;IACL,QAAQ;IACR,MAAM;IACN,MAAM;IACN,MAAM;CACP,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { SmartCalendar } from "./calendar";
|
|
2
|
+
export type { SmartCalendarProps } from "./calendar";
|
|
3
|
+
export type { CalendarEvent, CalendarEventColor, CalendarView, CalendarSize, CalendarSlot, TimeRange, Weekday, SmartCalendarHandle, RecurrenceRule, RecurrenceFreq, AvailabilityWindow, FreeSlot, EventChangeMeta, } from "./types";
|
|
4
|
+
export { expandRecurring, expandEvents, detachOccurrence, splitSeries, updateSeries, } from "./recurrence";
|
|
5
|
+
export type { EventPatch } from "./recurrence";
|
|
6
|
+
export { generateFreeSlots, windowsForDay } from "./booking";
|
|
7
|
+
export { eventColorClasses, EVENT_COLORS } from "./event-color";
|
|
8
|
+
export type { EventColorClasses } from "./event-color";
|
|
9
|
+
export { buildMonthGrid, buildWeekDays, viewRange, stepDate, eventEnd, isMultiDay, sortEvents, eventsForDay, partitionDayEvents, minutesSinceMidnight, layoutDayEvents, hourLabels, viewTitle, formatEventTime, groupEventsByDay, isInRange, } from "./calendar-utils";
|
|
10
|
+
export type { DateRange, PositionedEvent } from "./calendar-utils";
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/calendar-engine/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAC1C,YAAY,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAEpD,YAAY,EACV,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,OAAO,EACP,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,QAAQ,EACR,eAAe,GAChB,MAAM,SAAS,CAAA;AAEhB,OAAO,EACL,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,YAAY,GACb,MAAM,cAAc,CAAA;AACrB,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAE5D,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC/D,YAAY,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAEtD,OAAO,EACL,cAAc,EACd,aAAa,EACb,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,UAAU,EACV,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,SAAS,GACV,MAAM,kBAAkB,CAAA;AACzB,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { SmartCalendar } from "./calendar";
|
|
2
|
+
export { expandRecurring, expandEvents, detachOccurrence, splitSeries, updateSeries, } from "./recurrence";
|
|
3
|
+
export { generateFreeSlots, windowsForDay } from "./booking";
|
|
4
|
+
export { eventColorClasses, EVENT_COLORS } from "./event-color";
|
|
5
|
+
export { buildMonthGrid, buildWeekDays, viewRange, stepDate, eventEnd, isMultiDay, sortEvents, eventsForDay, partitionDayEvents, minutesSinceMidnight, layoutDayEvents, hourLabels, viewTitle, formatEventTime, groupEventsByDay, isInRange, } from "./calendar-utils";
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/calendar-engine/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAmB1C,OAAO,EACL,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,YAAY,GACb,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAE5D,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAG/D,OAAO,EACL,cAAc,EACd,aAAa,EACb,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,UAAU,EACV,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,SAAS,GACV,MAAM,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CalendarViewProps } from "./shared";
|
|
2
|
+
/**
|
|
3
|
+
* Month grid: a 6×7 matrix of day cells. Each cell lists up to `maxEventsPerDay`
|
|
4
|
+
* event pills; the rest collapse into a "+N more" button that drills into the
|
|
5
|
+
* day view. Clicking a day number or empty space fires `onSlotSelect`/`onDateClick`.
|
|
6
|
+
* When `editable`, pills can be dragged onto another day to reschedule (whole
|
|
7
|
+
* days, preserving the time of day).
|
|
8
|
+
*/
|
|
9
|
+
export declare function MonthView<T>(props: CalendarViewProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=month-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"month-view.d.ts","sourceRoot":"","sources":["../../src/calendar-engine/month-view.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAIjD;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,2CAsKvD"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { addDays, differenceInCalendarDays, endOfDay, format, isSameDay, isSameMonth, startOfDay, startOfWeek, } from "date-fns";
|
|
4
|
+
import { cn } from "@iamsaroj/smart-ui/lib/utils";
|
|
5
|
+
import { MonthEventPill } from "./shared";
|
|
6
|
+
import { buildMonthGrid, eventEnd, eventsForDay } from "./calendar-utils";
|
|
7
|
+
/**
|
|
8
|
+
* Month grid: a 6×7 matrix of day cells. Each cell lists up to `maxEventsPerDay`
|
|
9
|
+
* event pills; the rest collapse into a "+N more" button that drills into the
|
|
10
|
+
* day view. Clicking a day number or empty space fires `onSlotSelect`/`onDateClick`.
|
|
11
|
+
* When `editable`, pills can be dragged onto another day to reschedule (whole
|
|
12
|
+
* days, preserving the time of day).
|
|
13
|
+
*/
|
|
14
|
+
export function MonthView(props) {
|
|
15
|
+
const { date, events, size, weekStartsOn, now, onEventClick, onSlotSelect, onDateClick, maxEventsPerDay, renderEvent, editable, onEventChange, } = props;
|
|
16
|
+
// Which event is mid-drag, and the day currently hovered as a drop target.
|
|
17
|
+
const dragEventRef = React.useRef(null);
|
|
18
|
+
const [dropDayKey, setDropDayKey] = React.useState(null);
|
|
19
|
+
const rescheduleTo = (targetDay) => {
|
|
20
|
+
const event = dragEventRef.current;
|
|
21
|
+
dragEventRef.current = null;
|
|
22
|
+
setDropDayKey(null);
|
|
23
|
+
if (!event || !onEventChange)
|
|
24
|
+
return;
|
|
25
|
+
const dayDelta = differenceInCalendarDays(startOfDay(targetDay), startOfDay(event.start));
|
|
26
|
+
if (dayDelta === 0)
|
|
27
|
+
return;
|
|
28
|
+
const start = addDays(event.start, dayDelta);
|
|
29
|
+
const end = addDays(eventEnd(event), dayDelta);
|
|
30
|
+
onEventChange({ event, start, end, kind: "move" });
|
|
31
|
+
};
|
|
32
|
+
const weeks = React.useMemo(() => buildMonthGrid(date, weekStartsOn), [date, weekStartsOn]);
|
|
33
|
+
const weekdayLabels = React.useMemo(() => {
|
|
34
|
+
const start = startOfWeek(date, { weekStartsOn });
|
|
35
|
+
return Array.from({ length: 7 }, (_, i) => format(addDays(start, i), "EEE"));
|
|
36
|
+
}, [date, weekStartsOn]);
|
|
37
|
+
return (_jsxs("div", { className: "flex min-h-0 flex-1 flex-col", children: [_jsx("div", { className: "grid grid-cols-7 border-b border-border", children: weekdayLabels.map((label) => (_jsx("div", { className: "px-2 py-2 text-center text-xs font-medium text-muted-foreground", children: label }, label))) }), _jsx("div", { className: "grid min-h-0 flex-1 auto-rows-fr grid-rows-6", children: weeks.map((week, wi) => (_jsx("div", { className: "grid grid-cols-7 border-b border-border last:border-b-0", children: week.map((day) => {
|
|
38
|
+
const inMonth = isSameMonth(day, date);
|
|
39
|
+
const isToday = isSameDay(day, now);
|
|
40
|
+
const dayEvents = eventsForDay(events, day);
|
|
41
|
+
const shown = dayEvents.slice(0, maxEventsPerDay);
|
|
42
|
+
const overflow = dayEvents.length - shown.length;
|
|
43
|
+
const dayKey = day.toISOString();
|
|
44
|
+
return (_jsxs("div", { className: cn("group/cell flex min-h-24 flex-col gap-0.5 border-r border-border p-1 last:border-r-0", !inMonth && "bg-muted/30 text-muted-foreground", dropDayKey === dayKey &&
|
|
45
|
+
"bg-primary/10 ring-1 ring-primary/40 ring-inset"), onClick: (e) => {
|
|
46
|
+
// Only fire slot-select for clicks on empty cell space.
|
|
47
|
+
if (e.target === e.currentTarget)
|
|
48
|
+
onSlotSelect?.({
|
|
49
|
+
start: startOfDay(day),
|
|
50
|
+
end: endOfDay(day),
|
|
51
|
+
allDay: true,
|
|
52
|
+
});
|
|
53
|
+
}, onDragOver: editable
|
|
54
|
+
? (e) => {
|
|
55
|
+
if (!dragEventRef.current)
|
|
56
|
+
return;
|
|
57
|
+
e.preventDefault();
|
|
58
|
+
if (dropDayKey !== dayKey)
|
|
59
|
+
setDropDayKey(dayKey);
|
|
60
|
+
}
|
|
61
|
+
: undefined, onDrop: editable ? () => rescheduleTo(day) : undefined, children: [_jsx("div", { className: "flex items-center justify-between px-1", children: _jsx("button", { type: "button", onClick: () => onDateClick?.(day), className: cn("flex size-6 items-center justify-center rounded-full text-xs tabular-nums transition-colors hover:bg-accent", isToday &&
|
|
62
|
+
"bg-primary font-semibold text-primary-foreground hover:bg-primary/90", !inMonth && "opacity-60"), children: format(day, "d") }) }), _jsxs("div", { className: "flex flex-col gap-0.5 overflow-hidden", children: [shown.map((event) => renderEvent ? (_jsx(React.Fragment, { children: renderEvent(event) }, event.id)) : (_jsx(MonthEventPill, { event: event, size: size, showTime: true, draggable: editable &&
|
|
63
|
+
event.editable !== false &&
|
|
64
|
+
!event.disabled, onDragStart: () => {
|
|
65
|
+
dragEventRef.current = event;
|
|
66
|
+
}, onClick: (e) => {
|
|
67
|
+
e.stopPropagation();
|
|
68
|
+
onEventClick?.(event, e);
|
|
69
|
+
} }, event.id))), overflow > 0 && (_jsxs("button", { type: "button", onClick: () => onDateClick?.(day), className: "px-1.5 text-left text-[11px] font-medium text-muted-foreground hover:text-foreground", children: ["+", overflow, " more"] }))] })] }, dayKey));
|
|
70
|
+
}) }, wi))) })] }));
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=month-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"month-view.js","sourceRoot":"","sources":["../../src/calendar-engine/month-view.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EACL,OAA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EAAsE,EACxE,CAAC,OAAO,IAAI,YAAY,CACzB,YAEA,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GACV,GACL,EAEN,eAAK,SAAS,EAAC,uCAAuC,aACnD,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACnB,WAAW,CAAC,CAAC,CAAC,CACZ,KAAC,KAAK,CAAC,QAAQ,cACZ,WAAW,CAAC,KAAK,CAAC,IADA,KAAK,CAAC,EAAE,CAEZ,CAClB,CAAC,CAAC,CAAC,CACF,KAAC,cAAc,IAEb,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,QAAQ,QACR,SAAS,EACP,QAAQ;gDACR,KAAK,CAAC,QAAQ,KAAK,KAAK;gDACxB,CAAC,KAAK,CAAC,QAAQ,EAEjB,WAAW,EAAE,GAAG,EAAE;gDAChB,YAAY,CAAC,OAAO,GAAG,KAAK,CAAA;4CAC9B,CAAC,EACD,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;gDACb,CAAC,CAAC,eAAe,EAAE,CAAA;gDACnB,YAAY,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;4CAC1B,CAAC,IAfI,KAAK,CAAC,EAAE,CAgBb,CACH,CACF,EACA,QAAQ,GAAG,CAAC,IAAI,CACf,kBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,EACjC,SAAS,EAAC,sFAAsF,kBAE9F,QAAQ,aACH,CACV,IACG,KA9ED,MAAM,CA+EP,CACP,CAAA;oBACH,CAAC,CAAC,IAjGG,EAAE,CAkGH,CACP,CAAC,GACE,IACF,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { CalendarEvent } from "./types";
|
|
2
|
+
import type { DateRange } from "./calendar-utils";
|
|
3
|
+
/**
|
|
4
|
+
* Expand a single recurring template into concrete instances that intersect
|
|
5
|
+
* `range`. Non-recurring events are handled by `expandEvents`; this assumes
|
|
6
|
+
* `event.recurrence` is set.
|
|
7
|
+
*
|
|
8
|
+
* The walk is bounded three ways so it always terminates: the rule's `count`,
|
|
9
|
+
* its `until`, and a hard safety cap. Occurrences are generated from the
|
|
10
|
+
* template start forward; only those overlapping the range are emitted.
|
|
11
|
+
*/
|
|
12
|
+
export declare function expandRecurring<T>(event: CalendarEvent<T>, range: DateRange, defaultDurationMinutes?: number): CalendarEvent<T>[];
|
|
13
|
+
/**
|
|
14
|
+
* Expand every event against a range: recurring templates become instances,
|
|
15
|
+
* plain events pass through when they overlap the range. The single entry point
|
|
16
|
+
* the calendar uses before rendering a view.
|
|
17
|
+
*/
|
|
18
|
+
export declare function expandEvents<T>(events: CalendarEvent<T>[], range: DateRange, defaultDurationMinutes?: number): CalendarEvent<T>[];
|
|
19
|
+
/** A patch applied to an event when editing (times and/or presentational fields). */
|
|
20
|
+
export type EventPatch<T = unknown> = Partial<Pick<CalendarEvent<T>, "start" | "end" | "title" | "color" | "location" | "allDay" | "data">>;
|
|
21
|
+
/**
|
|
22
|
+
* **This event only.** Carve `occurrenceDate` out of the series (adding it to
|
|
23
|
+
* `exceptions`) and return that exception-bearing template alongside a new
|
|
24
|
+
* standalone event carrying the change. The series keeps repeating; this one
|
|
25
|
+
* date becomes an independent event.
|
|
26
|
+
*/
|
|
27
|
+
export declare function detachOccurrence<T>(template: CalendarEvent<T>, occurrenceDate: Date, patch: EventPatch<T>, newId?: string): {
|
|
28
|
+
template: CalendarEvent<T>;
|
|
29
|
+
event: CalendarEvent<T>;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* **This and following.** End the existing series the day before `fromDate`
|
|
33
|
+
* (via `until`) and return a *new* template that starts at `fromDate` with the
|
|
34
|
+
* change applied — carrying the same recurrence pattern forward. Splits one
|
|
35
|
+
* series into two. Any original `count` is converted to an `until` boundary.
|
|
36
|
+
*/
|
|
37
|
+
export declare function splitSeries<T>(template: CalendarEvent<T>, fromDate: Date, patch: EventPatch<T>, newId?: string): {
|
|
38
|
+
previous: CalendarEvent<T>;
|
|
39
|
+
following: CalendarEvent<T>;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* **The whole series.** Merge a patch into the template itself. When the patch
|
|
43
|
+
* moves `start`, the whole series shifts by the same delta (so every occurrence
|
|
44
|
+
* keeps its relative offset); presentational fields are applied as-is.
|
|
45
|
+
*/
|
|
46
|
+
export declare function updateSeries<T>(template: CalendarEvent<T>, patch: EventPatch<T>): CalendarEvent<T>;
|
|
47
|
+
//# sourceMappingURL=recurrence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recurrence.d.ts","sourceRoot":"","sources":["../../src/calendar-engine/recurrence.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAW,MAAM,SAAS,CAAA;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAwBjD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAC/B,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EACvB,KAAK,EAAE,SAAS,EAChB,sBAAsB,SAAK,GAC1B,aAAa,CAAC,CAAC,CAAC,EAAE,CAoFpB;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,EAC1B,KAAK,EAAE,SAAS,EAChB,sBAAsB,SAAK,GAC1B,aAAa,CAAC,CAAC,CAAC,EAAE,CAcpB;AASD,qFAAqF;AACrF,MAAM,MAAM,UAAU,CAAC,CAAC,GAAG,OAAO,IAAI,OAAO,CAC3C,IAAI,CACF,aAAa,CAAC,CAAC,CAAC,EAChB,OAAO,GAAG,KAAK,GAAG,OAAO,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,GAAG,MAAM,CACrE,CACF,CAAA;AAiBD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAC1B,cAAc,EAAE,IAAI,EACpB,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,EACpB,KAAK,SAA2E,GAC/E;IAAE,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;CAAE,CASzD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAC1B,QAAQ,EAAE,IAAI,EACd,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,EACpB,KAAK,SAAiE,GACrE;IAAE,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAAC,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;CAAE,CAmC7D;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAC1B,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,GACnB,aAAa,CAAC,CAAC,CAAC,CAWlB"}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { addDays, addMonths, isSameDay, startOfDay } from "date-fns";
|
|
2
|
+
/** Copy the clock time (h/m/s/ms) of `source` onto the calendar day of `day`. */
|
|
3
|
+
function withTimeOf(day, source) {
|
|
4
|
+
const d = new Date(day);
|
|
5
|
+
d.setHours(source.getHours(), source.getMinutes(), source.getSeconds(), source.getMilliseconds());
|
|
6
|
+
return d;
|
|
7
|
+
}
|
|
8
|
+
/** Duration of an event in ms, using an explicit end or a default duration. */
|
|
9
|
+
function durationMs(event, defaultDurationMinutes) {
|
|
10
|
+
if (event.end && event.end > event.start)
|
|
11
|
+
return event.end.getTime() - event.start.getTime();
|
|
12
|
+
return defaultDurationMinutes * 60_000;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Expand a single recurring template into concrete instances that intersect
|
|
16
|
+
* `range`. Non-recurring events are handled by `expandEvents`; this assumes
|
|
17
|
+
* `event.recurrence` is set.
|
|
18
|
+
*
|
|
19
|
+
* The walk is bounded three ways so it always terminates: the rule's `count`,
|
|
20
|
+
* its `until`, and a hard safety cap. Occurrences are generated from the
|
|
21
|
+
* template start forward; only those overlapping the range are emitted.
|
|
22
|
+
*/
|
|
23
|
+
export function expandRecurring(event, range, defaultDurationMinutes = 60) {
|
|
24
|
+
const rule = event.recurrence;
|
|
25
|
+
if (!rule)
|
|
26
|
+
return [event];
|
|
27
|
+
const interval = Math.max(1, rule.interval ?? 1);
|
|
28
|
+
const dur = durationMs(event, defaultDurationMinutes);
|
|
29
|
+
const exceptions = rule.exceptions ?? [];
|
|
30
|
+
const isException = (d) => exceptions.some((ex) => isSameDay(ex, d));
|
|
31
|
+
const byWeekday = rule.freq === "weekly" && rule.byWeekday && rule.byWeekday.length > 0
|
|
32
|
+
? [...rule.byWeekday].sort((a, b) => a - b)
|
|
33
|
+
: [event.start.getDay()];
|
|
34
|
+
const out = [];
|
|
35
|
+
let emitted = 0;
|
|
36
|
+
const cap = 1000; // hard safety bound on iterations
|
|
37
|
+
const pushIf = (day) => {
|
|
38
|
+
const start = withTimeOf(day, event.start);
|
|
39
|
+
const end = new Date(start.getTime() + dur);
|
|
40
|
+
// Stop conditions evaluated per-occurrence.
|
|
41
|
+
if (rule.until && startOfDay(start) > startOfDay(rule.until))
|
|
42
|
+
return;
|
|
43
|
+
// Count is by generated occurrence, regardless of range visibility.
|
|
44
|
+
if (rule.count != null && emitted >= rule.count)
|
|
45
|
+
return;
|
|
46
|
+
// An excepted date still consumes a count (RFC 5545 EXDATE semantics) but
|
|
47
|
+
// is not emitted.
|
|
48
|
+
emitted++;
|
|
49
|
+
if (isException(day))
|
|
50
|
+
return;
|
|
51
|
+
// Only keep occurrences that overlap the requested range.
|
|
52
|
+
if (start <= range.end && end >= range.start) {
|
|
53
|
+
out.push({
|
|
54
|
+
...event,
|
|
55
|
+
id: `${event.id}::${start.toISOString().slice(0, 10)}`,
|
|
56
|
+
start,
|
|
57
|
+
end,
|
|
58
|
+
recurrence: undefined,
|
|
59
|
+
occurrence: { templateId: event.id, date: start },
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
const reachedLimit = () => (rule.count != null && emitted >= rule.count) || out.length > cap;
|
|
64
|
+
if (rule.freq === "weekly") {
|
|
65
|
+
// Walk week by week from the week of the start; within each active week,
|
|
66
|
+
// emit the configured weekdays in order.
|
|
67
|
+
let weekAnchor = startOfDay(event.start);
|
|
68
|
+
// Back up to the template's weekday-0 reference for stable stepping.
|
|
69
|
+
let iterations = 0;
|
|
70
|
+
while (iterations < cap && !reachedLimit()) {
|
|
71
|
+
for (const wd of byWeekday) {
|
|
72
|
+
const delta = (wd - weekAnchor.getDay() + 7) % 7;
|
|
73
|
+
const day = addDays(weekAnchor, delta);
|
|
74
|
+
if (day < startOfDay(event.start))
|
|
75
|
+
continue; // don't emit before start
|
|
76
|
+
if (rule.until && startOfDay(day) > startOfDay(rule.until)) {
|
|
77
|
+
return out;
|
|
78
|
+
}
|
|
79
|
+
pushIf(day);
|
|
80
|
+
if (reachedLimit())
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
weekAnchor = addDays(weekAnchor, 7 * interval);
|
|
84
|
+
if (rule.until && startOfDay(weekAnchor) > startOfDay(rule.until))
|
|
85
|
+
break;
|
|
86
|
+
if (weekAnchor > range.end && emitted > 0)
|
|
87
|
+
break;
|
|
88
|
+
iterations++;
|
|
89
|
+
}
|
|
90
|
+
return out;
|
|
91
|
+
}
|
|
92
|
+
// daily / monthly: single cursor stepped by interval.
|
|
93
|
+
let cursor = startOfDay(event.start);
|
|
94
|
+
let iterations = 0;
|
|
95
|
+
while (iterations < cap && !reachedLimit()) {
|
|
96
|
+
if (rule.until && startOfDay(cursor) > startOfDay(rule.until))
|
|
97
|
+
break;
|
|
98
|
+
pushIf(cursor);
|
|
99
|
+
if (cursor > range.end && emitted > 0)
|
|
100
|
+
break;
|
|
101
|
+
cursor =
|
|
102
|
+
rule.freq === "daily"
|
|
103
|
+
? addDays(cursor, interval)
|
|
104
|
+
: addMonths(cursor, interval);
|
|
105
|
+
iterations++;
|
|
106
|
+
}
|
|
107
|
+
return out;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Expand every event against a range: recurring templates become instances,
|
|
111
|
+
* plain events pass through when they overlap the range. The single entry point
|
|
112
|
+
* the calendar uses before rendering a view.
|
|
113
|
+
*/
|
|
114
|
+
export function expandEvents(events, range, defaultDurationMinutes = 60) {
|
|
115
|
+
const out = [];
|
|
116
|
+
for (const event of events) {
|
|
117
|
+
if (event.recurrence) {
|
|
118
|
+
out.push(...expandRecurring(event, range, defaultDurationMinutes));
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
const end = event.end && event.end > event.start
|
|
122
|
+
? event.end
|
|
123
|
+
: new Date(event.start.getTime() + defaultDurationMinutes * 60_000);
|
|
124
|
+
if (event.start <= range.end && end >= range.start)
|
|
125
|
+
out.push(event);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return out;
|
|
129
|
+
}
|
|
130
|
+
/** Apply a patch, dropping recurrence/occurrence markers to make a plain event. */
|
|
131
|
+
function asPlainEvent(event, patch, id) {
|
|
132
|
+
return {
|
|
133
|
+
...event,
|
|
134
|
+
...patch,
|
|
135
|
+
id,
|
|
136
|
+
recurrence: undefined,
|
|
137
|
+
occurrence: undefined,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* **This event only.** Carve `occurrenceDate` out of the series (adding it to
|
|
142
|
+
* `exceptions`) and return that exception-bearing template alongside a new
|
|
143
|
+
* standalone event carrying the change. The series keeps repeating; this one
|
|
144
|
+
* date becomes an independent event.
|
|
145
|
+
*/
|
|
146
|
+
export function detachOccurrence(template, occurrenceDate, patch, newId = `${template.id}::detached::${occurrenceDate.toISOString().slice(0, 10)}`) {
|
|
147
|
+
const rule = template.recurrence;
|
|
148
|
+
const exceptions = [...(rule?.exceptions ?? []), startOfDay(occurrenceDate)];
|
|
149
|
+
return {
|
|
150
|
+
template: rule
|
|
151
|
+
? { ...template, recurrence: { ...rule, exceptions } }
|
|
152
|
+
: template,
|
|
153
|
+
event: asPlainEvent(template, patch, newId),
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* **This and following.** End the existing series the day before `fromDate`
|
|
158
|
+
* (via `until`) and return a *new* template that starts at `fromDate` with the
|
|
159
|
+
* change applied — carrying the same recurrence pattern forward. Splits one
|
|
160
|
+
* series into two. Any original `count` is converted to an `until` boundary.
|
|
161
|
+
*/
|
|
162
|
+
export function splitSeries(template, fromDate, patch, newId = `${template.id}::from::${fromDate.toISOString().slice(0, 10)}`) {
|
|
163
|
+
const rule = template.recurrence;
|
|
164
|
+
const previous = rule
|
|
165
|
+
? {
|
|
166
|
+
...template,
|
|
167
|
+
recurrence: {
|
|
168
|
+
...rule,
|
|
169
|
+
count: undefined,
|
|
170
|
+
until: addDays(startOfDay(fromDate), -1),
|
|
171
|
+
},
|
|
172
|
+
}
|
|
173
|
+
: template;
|
|
174
|
+
const start = patch.start ?? withTimeOf(fromDate, template.start);
|
|
175
|
+
const end = patch.end ??
|
|
176
|
+
new Date(start.getTime() +
|
|
177
|
+
(template.end && template.end > template.start
|
|
178
|
+
? template.end.getTime() - template.start.getTime()
|
|
179
|
+
: 60 * 60_000));
|
|
180
|
+
const following = {
|
|
181
|
+
...template,
|
|
182
|
+
...patch,
|
|
183
|
+
id: newId,
|
|
184
|
+
start,
|
|
185
|
+
end,
|
|
186
|
+
occurrence: undefined,
|
|
187
|
+
recurrence: rule
|
|
188
|
+
? { ...rule, count: undefined, until: rule.until }
|
|
189
|
+
: undefined,
|
|
190
|
+
};
|
|
191
|
+
return { previous, following };
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* **The whole series.** Merge a patch into the template itself. When the patch
|
|
195
|
+
* moves `start`, the whole series shifts by the same delta (so every occurrence
|
|
196
|
+
* keeps its relative offset); presentational fields are applied as-is.
|
|
197
|
+
*/
|
|
198
|
+
export function updateSeries(template, patch) {
|
|
199
|
+
const next = { ...template, ...patch };
|
|
200
|
+
if (patch.start && !patch.end) {
|
|
201
|
+
// Preserve duration when only the start moved.
|
|
202
|
+
const dur = template.end && template.end > template.start
|
|
203
|
+
? template.end.getTime() - template.start.getTime()
|
|
204
|
+
: 60 * 60_000;
|
|
205
|
+
next.end = new Date(patch.start.getTime() + dur);
|
|
206
|
+
}
|
|
207
|
+
return next;
|
|
208
|
+
}
|
|
209
|
+
//# sourceMappingURL=recurrence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recurrence.js","sourceRoot":"","sources":["../../src/calendar-engine/recurrence.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAIpE,iFAAiF;AACjF,SAAS,UAAU,CAAC,GAAS,EAAE,MAAY;IACzC,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,CAAA;IACvB,CAAC,CAAC,QAAQ,CACR,MAAM,CAAC,QAAQ,EAAE,EACjB,MAAM,CAAC,UAAU,EAAE,EACnB,MAAM,CAAC,UAAU,EAAE,EACnB,MAAM,CAAC,eAAe,EAAE,CACzB,CAAA;IACD,OAAO,CAAC,CAAA;AACV,CAAC;AAED,+EAA+E;AAC/E,SAAS,UAAU,CACjB,KAAoB,EACpB,sBAA8B;IAE9B,IAAI,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,KAAK;QACtC,OAAO,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAA;IACpD,OAAO,sBAAsB,GAAG,MAAM,CAA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