@tulip-systems/core 0.6.0 → 0.7.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/LICENSE +662 -0
- package/dist/commands/client.d.mts +2 -1
- package/dist/commands/client.mjs +2 -1
- package/dist/components/client.d.mts +19 -3
- package/dist/components/client.mjs +18 -2
- package/dist/components/editor/components/menu-nodes.client.mjs +3 -3
- package/dist/components/editor/components/menu-nodes.client.mjs.map +1 -1
- package/dist/components/editor/components/menu.client.mjs +3 -3
- package/dist/components/editor/components/menu.client.mjs.map +1 -1
- package/dist/components/emails/forget-password-email.mjs +6 -6
- package/dist/components/emails/forget-password-email.mjs.map +1 -1
- package/dist/components/header/back-button.client.mjs +2 -2
- package/dist/components/header/back-button.client.mjs.map +1 -1
- package/dist/components/header/bottom-bar.client.mjs +2 -2
- package/dist/components/header/bottom-bar.client.mjs.map +1 -1
- package/dist/components/header/breadcrumbs.client.mjs +1 -1
- package/dist/components/header/breadcrumbs.client.mjs.map +1 -1
- package/dist/components/header/header.client.mjs +1 -1
- package/dist/components/header/header.client.mjs.map +1 -1
- package/dist/components/layouts/empty-page.mjs +2 -2
- package/dist/components/layouts/empty-page.mjs.map +1 -1
- package/dist/components/layouts/error-page.mjs +3 -3
- package/dist/components/layouts/error-page.mjs.map +1 -1
- package/dist/components/layouts/providers.client.d.mts.map +1 -1
- package/dist/components/layouts/providers.client.mjs +3 -2
- package/dist/components/layouts/providers.client.mjs.map +1 -1
- package/dist/components/layouts/root-loading.mjs +2 -2
- package/dist/components/layouts/root-loading.mjs.map +1 -1
- package/dist/components/layouts/tab-layout.mjs +1 -1
- package/dist/components/layouts/tab-layout.mjs.map +1 -1
- package/dist/components/lists/data-list.mjs +1 -1
- package/dist/components/lists/data-list.mjs.map +1 -1
- package/dist/components/lists/data-stack.mjs +1 -1
- package/dist/components/lists/data-stack.mjs.map +1 -1
- package/dist/components/navigation/admin-sidebar-header.client.mjs +3 -3
- package/dist/components/navigation/admin-sidebar-header.client.mjs.map +1 -1
- package/dist/components/navigation/admin-sidebar-skeleton.mjs +1 -1
- package/dist/components/navigation/admin-sidebar-skeleton.mjs.map +1 -1
- package/dist/components/ui/accordion.client.d.mts +26 -0
- package/dist/components/ui/accordion.client.d.mts.map +1 -0
- package/dist/components/ui/accordion.client.mjs +58 -0
- package/dist/components/ui/accordion.client.mjs.map +1 -0
- package/dist/components/ui/alert-dialog.client.d.mts +61 -0
- package/dist/components/ui/alert-dialog.client.d.mts.map +1 -0
- package/dist/components/ui/alert-dialog.client.mjs +104 -0
- package/dist/components/ui/alert-dialog.client.mjs.map +1 -0
- package/dist/components/ui/alert.d.mts +5 -1
- package/dist/components/ui/alert.d.mts.map +1 -1
- package/dist/components/ui/alert.mjs +13 -6
- package/dist/components/ui/alert.mjs.map +1 -1
- package/dist/components/ui/aspect-ratio.client.d.mts +10 -0
- package/dist/components/ui/aspect-ratio.client.d.mts.map +1 -0
- package/dist/components/ui/aspect-ratio.client.mjs +16 -0
- package/dist/components/ui/aspect-ratio.client.mjs.map +1 -0
- package/dist/components/ui/avatar.client.d.mts +21 -6
- package/dist/components/ui/avatar.client.d.mts.map +1 -1
- package/dist/components/ui/avatar.client.mjs +31 -9
- package/dist/components/ui/avatar.client.mjs.map +1 -1
- package/dist/components/ui/badge.d.mts +1 -1
- package/dist/components/ui/badge.d.mts.map +1 -1
- package/dist/components/ui/badge.mjs +11 -8
- package/dist/components/ui/badge.mjs.map +1 -1
- package/dist/components/ui/breadcrumb.d.mts +3 -1
- package/dist/components/ui/breadcrumb.d.mts.map +1 -1
- package/dist/components/ui/breadcrumb.mjs +7 -7
- package/dist/components/ui/breadcrumb.mjs.map +1 -1
- package/dist/components/ui/button-group.d.mts +29 -0
- package/dist/components/ui/button-group.d.mts.map +1 -0
- package/dist/components/ui/button-group.mjs +41 -0
- package/dist/components/ui/button-group.mjs.map +1 -0
- package/dist/components/ui/button.d.mts +1 -1
- package/dist/components/ui/button.d.mts.map +1 -1
- package/dist/components/ui/button.mjs +19 -13
- package/dist/components/ui/button.mjs.map +1 -1
- package/dist/components/ui/{calendar.d.mts → calendar.client.d.mts} +7 -4
- package/dist/components/ui/calendar.client.d.mts.map +1 -0
- package/dist/components/ui/{calendar.mjs → calendar.client.mjs} +22 -19
- package/dist/components/ui/calendar.client.mjs.map +1 -0
- package/dist/components/ui/card.d.mts +9 -2
- package/dist/components/ui/card.d.mts.map +1 -1
- package/dist/components/ui/card.mjs +15 -7
- package/dist/components/ui/card.mjs.map +1 -1
- package/dist/components/ui/{carousel.d.mts → carousel.client.d.mts} +12 -3
- package/dist/components/ui/carousel.client.d.mts.map +1 -0
- package/dist/components/ui/{carousel.mjs → carousel.client.mjs} +10 -10
- package/dist/components/ui/carousel.client.mjs.map +1 -0
- package/dist/components/ui/chart.client.d.mts.map +1 -1
- package/dist/components/ui/chart.client.mjs +11 -11
- package/dist/components/ui/chart.client.mjs.map +1 -1
- package/dist/components/ui/checkbox.client.d.mts +12 -0
- package/dist/components/ui/checkbox.client.d.mts.map +1 -0
- package/dist/components/ui/checkbox.client.mjs +24 -0
- package/dist/components/ui/checkbox.client.mjs.map +1 -0
- package/dist/components/ui/collapsible.client.d.mts +6 -6
- package/dist/components/ui/collapsible.client.d.mts.map +1 -1
- package/dist/components/ui/collapsible.client.mjs +6 -6
- package/dist/components/ui/collapsible.client.mjs.map +1 -1
- package/dist/components/ui/combobox-dropdown.client.d.mts +1 -1
- package/dist/components/ui/combobox-dropdown.client.mjs +2 -2
- package/dist/components/ui/combobox-dropdown.client.mjs.map +1 -1
- package/dist/components/ui/combobox.client.mjs +4 -4
- package/dist/components/ui/combobox.client.mjs.map +1 -1
- package/dist/components/ui/{command.d.mts → command.client.d.mts} +8 -2
- package/dist/components/ui/command.client.d.mts.map +1 -0
- package/dist/components/ui/command.client.mjs +91 -0
- package/dist/components/ui/command.client.mjs.map +1 -0
- package/dist/components/ui/context-menu.client.d.mts +86 -0
- package/dist/components/ui/context-menu.client.d.mts.map +1 -0
- package/dist/components/ui/context-menu.client.mjs +128 -0
- package/dist/components/ui/context-menu.client.mjs.map +1 -0
- package/dist/components/ui/date-picker.client.mjs +2 -2
- package/dist/components/ui/date-picker.client.mjs.map +1 -1
- package/dist/components/ui/dialog.client.d.mts +19 -12
- package/dist/components/ui/dialog.client.d.mts.map +1 -1
- package/dist/components/ui/dialog.client.mjs +40 -29
- package/dist/components/ui/dialog.client.mjs.map +1 -1
- package/dist/components/ui/drawer.client.d.mts.map +1 -1
- package/dist/components/ui/drawer.client.mjs +5 -5
- package/dist/components/ui/drawer.client.mjs.map +1 -1
- package/dist/components/ui/dropdown-menu.client.d.mts +85 -0
- package/dist/components/ui/dropdown-menu.client.d.mts.map +1 -0
- package/dist/components/ui/dropdown-menu.client.mjs +131 -0
- package/dist/components/ui/dropdown-menu.client.mjs.map +1 -0
- package/dist/components/ui/empty.d.mts +36 -0
- package/dist/components/ui/empty.d.mts.map +1 -0
- package/dist/components/ui/empty.mjs +62 -0
- package/dist/components/ui/empty.mjs.map +1 -0
- package/dist/components/ui/field.client.d.mts +65 -0
- package/dist/components/ui/field.client.d.mts.map +1 -0
- package/dist/components/ui/field.client.mjs +114 -0
- package/dist/components/ui/field.client.mjs.map +1 -0
- package/dist/components/ui/form.client.d.mts +3 -4
- package/dist/components/ui/form.client.d.mts.map +1 -1
- package/dist/components/ui/form.client.mjs +4 -4
- package/dist/components/ui/form.client.mjs.map +1 -1
- package/dist/components/ui/hover-card.client.d.mts +6 -6
- package/dist/components/ui/hover-card.client.d.mts.map +1 -1
- package/dist/components/ui/hover-card.client.mjs +14 -11
- package/dist/components/ui/hover-card.client.mjs.map +1 -1
- package/dist/components/ui/{input-date-time.d.mts → input-date-time.client.d.mts} +7 -7
- package/dist/components/ui/input-date-time.client.d.mts.map +1 -0
- package/dist/components/ui/{input-date-time.mjs → input-date-time.client.mjs} +8 -8
- package/dist/components/ui/input-date-time.client.mjs.map +1 -0
- package/dist/components/ui/input-date.d.mts +1 -1
- package/dist/components/ui/input-date.d.mts.map +1 -1
- package/dist/components/ui/input-date.mjs.map +1 -1
- package/dist/components/ui/input-group.client.d.mts +59 -0
- package/dist/components/ui/input-group.client.d.mts.map +1 -0
- package/dist/components/ui/input-group.client.mjs +106 -0
- package/dist/components/ui/input-group.client.mjs.map +1 -0
- package/dist/components/ui/input-recipient.mjs +11 -11
- package/dist/components/ui/input-recipient.mjs.map +1 -1
- package/dist/components/ui/input-time.d.mts +1 -1
- package/dist/components/ui/input-time.d.mts.map +1 -1
- package/dist/components/ui/input-time.mjs.map +1 -1
- package/dist/components/ui/input.d.mts.map +1 -1
- package/dist/components/ui/input.mjs +1 -1
- package/dist/components/ui/input.mjs.map +1 -1
- package/dist/components/ui/item.d.mts +63 -0
- package/dist/components/ui/item.d.mts.map +1 -0
- package/dist/components/ui/item.mjs +119 -0
- package/dist/components/ui/item.mjs.map +1 -0
- package/dist/components/ui/kbd.d.mts +14 -0
- package/dist/components/ui/kbd.d.mts.map +1 -0
- package/dist/components/ui/kbd.mjs +22 -0
- package/dist/components/ui/kbd.mjs.map +1 -0
- package/dist/components/ui/label.d.mts +4 -4
- package/dist/components/ui/label.d.mts.map +1 -1
- package/dist/components/ui/label.mjs +5 -5
- package/dist/components/ui/label.mjs.map +1 -1
- package/dist/components/ui/loader.d.mts +7 -0
- package/dist/components/ui/loader.d.mts.map +1 -0
- package/dist/components/ui/loader.mjs +63 -0
- package/dist/components/ui/loader.mjs.map +1 -0
- package/dist/components/ui/navigation-menu.d.mts +11 -11
- package/dist/components/ui/navigation-menu.d.mts.map +1 -1
- package/dist/components/ui/navigation-menu.mjs +18 -20
- package/dist/components/ui/navigation-menu.mjs.map +1 -1
- package/dist/components/ui/pagination.d.mts +8 -2
- package/dist/components/ui/pagination.d.mts.map +1 -1
- package/dist/components/ui/pagination.mjs +29 -21
- package/dist/components/ui/pagination.mjs.map +1 -1
- package/dist/components/ui/popover.client.d.mts +35 -0
- package/dist/components/ui/popover.client.d.mts.map +1 -0
- package/dist/components/ui/popover.client.mjs +59 -0
- package/dist/components/ui/popover.client.mjs.map +1 -0
- package/dist/components/ui/progress.client.d.mts +4 -4
- package/dist/components/ui/progress.client.d.mts.map +1 -1
- package/dist/components/ui/progress.client.mjs +7 -7
- package/dist/components/ui/progress.client.mjs.map +1 -1
- package/dist/components/ui/radio-group.d.mts +5 -5
- package/dist/components/ui/radio-group.d.mts.map +1 -1
- package/dist/components/ui/radio-group.mjs +10 -11
- package/dist/components/ui/radio-group.mjs.map +1 -1
- package/dist/components/ui/resizable.client.d.mts +3 -4
- package/dist/components/ui/resizable.client.d.mts.map +1 -1
- package/dist/components/ui/resizable.client.mjs +5 -9
- package/dist/components/ui/resizable.client.mjs.map +1 -1
- package/dist/components/ui/scroll-area.d.mts +5 -5
- package/dist/components/ui/scroll-area.d.mts.map +1 -1
- package/dist/components/ui/scroll-area.mjs +12 -11
- package/dist/components/ui/scroll-area.mjs.map +1 -1
- package/dist/components/ui/select.client.d.mts +18 -13
- package/dist/components/ui/select.client.d.mts.map +1 -1
- package/dist/components/ui/select.client.mjs +37 -32
- package/dist/components/ui/select.client.mjs.map +1 -1
- package/dist/components/ui/separator.d.mts +4 -4
- package/dist/components/ui/separator.d.mts.map +1 -1
- package/dist/components/ui/separator.mjs +6 -6
- package/dist/components/ui/separator.mjs.map +1 -1
- package/dist/components/ui/sheet.client.d.mts +9 -7
- package/dist/components/ui/sheet.client.d.mts.map +1 -1
- package/dist/components/ui/sheet.client.mjs +30 -20
- package/dist/components/ui/sheet.client.mjs.map +1 -1
- package/dist/components/ui/sidebar.client.mjs +28 -28
- package/dist/components/ui/sidebar.client.mjs.map +1 -1
- package/dist/components/ui/skeleton.mjs +1 -1
- package/dist/components/ui/skeleton.mjs.map +1 -1
- package/dist/components/ui/slider.d.mts +4 -4
- package/dist/components/ui/slider.d.mts.map +1 -1
- package/dist/components/ui/slider.mjs +11 -11
- package/dist/components/ui/slider.mjs.map +1 -1
- package/dist/components/ui/spinner.d.mts +10 -0
- package/dist/components/ui/spinner.d.mts.map +1 -0
- package/dist/components/ui/spinner.mjs +9 -55
- package/dist/components/ui/spinner.mjs.map +1 -1
- package/dist/components/ui/switch.client.d.mts +15 -0
- package/dist/components/ui/switch.client.d.mts.map +1 -0
- package/dist/components/ui/switch.client.mjs +23 -0
- package/dist/components/ui/switch.client.mjs.map +1 -0
- package/dist/components/ui/tabs.client.d.mts +31 -0
- package/dist/components/ui/tabs.client.d.mts.map +1 -0
- package/dist/components/ui/tabs.client.mjs +49 -0
- package/dist/components/ui/tabs.client.mjs.map +1 -0
- package/dist/components/ui/textarea.d.mts.map +1 -1
- package/dist/components/ui/textarea.mjs +1 -1
- package/dist/components/ui/textarea.mjs.map +1 -1
- package/dist/components/ui/toggle-group.client.d.mts +11 -6
- package/dist/components/ui/toggle-group.client.d.mts.map +1 -1
- package/dist/components/ui/toggle-group.client.mjs +20 -12
- package/dist/components/ui/toggle-group.client.mjs.map +1 -1
- package/dist/components/ui/{toggle.d.mts → toggle.client.d.mts} +6 -6
- package/dist/components/ui/toggle.client.d.mts.map +1 -0
- package/dist/components/ui/toggle.client.mjs +40 -0
- package/dist/components/ui/toggle.client.mjs.map +1 -0
- package/dist/components/ui/tooltip.client.d.mts +7 -7
- package/dist/components/ui/tooltip.client.d.mts.map +1 -1
- package/dist/components/ui/tooltip.client.mjs +10 -10
- package/dist/components/ui/tooltip.client.mjs.map +1 -1
- package/dist/components.d.mts +12 -20
- package/dist/components.mjs +12 -20
- package/dist/inline-edit/client.d.mts +3 -3
- package/dist/lib/hooks/use-indicator.d.mts.map +1 -1
- package/dist/lib/hooks/use-indicator.mjs +11 -8
- package/dist/lib/hooks/use-indicator.mjs.map +1 -1
- package/dist/modules/auth/components/auth-layout.server.mjs +3 -3
- package/dist/modules/auth/components/auth-layout.server.mjs.map +1 -1
- package/dist/modules/auth/components/create-first-user-page.client.mjs +3 -3
- package/dist/modules/auth/components/create-first-user-page.client.mjs.map +1 -1
- package/dist/modules/auth/components/forget-password-page.client.mjs +1 -1
- package/dist/modules/auth/components/forget-password-page.client.mjs.map +1 -1
- package/dist/modules/auth/components/login-page.client.mjs +5 -5
- package/dist/modules/auth/components/login-page.client.mjs.map +1 -1
- package/dist/modules/auth/components/reset-password-page.client.mjs +5 -5
- package/dist/modules/auth/components/reset-password-page.client.mjs.map +1 -1
- package/dist/modules/commands/components/alert-dialog-command.client.d.mts +9 -9
- package/dist/modules/commands/components/alert-dialog-command.client.d.mts.map +1 -1
- package/dist/modules/commands/components/alert-dialog-command.client.mjs +3 -3
- package/dist/modules/commands/components/alert-dialog-command.client.mjs.map +1 -1
- package/dist/modules/commands/components/click-command.client.mjs +2 -2
- package/dist/modules/commands/components/click-command.client.mjs.map +1 -1
- package/dist/modules/commands/components/dialog-command.client.d.mts +8 -8
- package/dist/modules/commands/components/dialog-command.client.d.mts.map +1 -1
- package/dist/modules/commands/components/dialog-command.client.mjs +2 -2
- package/dist/modules/commands/components/dialog-command.client.mjs.map +1 -1
- package/dist/modules/commands/components/dropdown-command.client.mjs +2 -2
- package/dist/modules/commands/components/dropdown-command.client.mjs.map +1 -1
- package/dist/modules/commands/components/empty-command.client.mjs +2 -2
- package/dist/modules/commands/components/empty-command.client.mjs.map +1 -1
- package/dist/modules/commands/components/form-dialog-command.client.d.mts +11 -9
- package/dist/modules/commands/components/form-dialog-command.client.d.mts.map +1 -1
- package/dist/modules/commands/components/form-dialog-command.client.mjs +8 -6
- package/dist/modules/commands/components/form-dialog-command.client.mjs.map +1 -1
- package/dist/modules/commands/hooks/use-command-menu.client.d.mts +8 -1
- package/dist/modules/commands/hooks/use-command-menu.client.d.mts.map +1 -1
- package/dist/modules/commands/hooks/use-command-menu.client.mjs.map +1 -1
- package/dist/modules/commands/menus/context-menu.client.d.mts +3 -3
- package/dist/modules/commands/menus/context-menu.client.d.mts.map +1 -1
- package/dist/modules/commands/menus/context-menu.client.mjs +1 -1
- package/dist/modules/commands/menus/context-menu.client.mjs.map +1 -1
- package/dist/modules/commands/menus/dropdown-menu.client.mjs +2 -2
- package/dist/modules/commands/menus/dropdown-menu.client.mjs.map +1 -1
- package/dist/modules/commands/menus/floating-menu.client.d.mts +19 -0
- package/dist/modules/commands/menus/floating-menu.client.d.mts.map +1 -0
- package/dist/modules/commands/menus/{data-table-menu.client.mjs → floating-menu.client.mjs} +11 -11
- package/dist/modules/commands/menus/floating-menu.client.mjs.map +1 -0
- package/dist/modules/commands/utils/archive-command.client.mjs +1 -1
- package/dist/modules/commands/utils/archive-command.client.mjs.map +1 -1
- package/dist/modules/commands/utils/delete-command.client.mjs +1 -1
- package/dist/modules/commands/utils/delete-command.client.mjs.map +1 -1
- package/dist/modules/data-tables/components/cell/select.client.mjs +1 -1
- package/dist/modules/data-tables/components/cell/select.client.mjs.map +1 -1
- package/dist/modules/data-tables/components/column-header.mjs +5 -5
- package/dist/modules/data-tables/components/column-header.mjs.map +1 -1
- package/dist/modules/data-tables/components/filters/combobox.client.mjs +6 -6
- package/dist/modules/data-tables/components/filters/combobox.client.mjs.map +1 -1
- package/dist/modules/data-tables/components/filters/slider.client.mjs +2 -2
- package/dist/modules/data-tables/components/filters/slider.client.mjs.map +1 -1
- package/dist/modules/data-tables/components/header.mjs +1 -1
- package/dist/modules/data-tables/components/header.mjs.map +1 -1
- package/dist/modules/data-tables/components/skeleton.mjs +2 -2
- package/dist/modules/data-tables/components/skeleton.mjs.map +1 -1
- package/dist/modules/data-tables/components/table.mjs +3 -3
- package/dist/modules/data-tables/components/table.mjs.map +1 -1
- package/dist/modules/data-tables/components/toolbar.mjs +1 -1
- package/dist/modules/data-tables/components/toolbar.mjs.map +1 -1
- package/dist/modules/data-tables/strategies/pagination/components.mjs +3 -3
- package/dist/modules/data-tables/strategies/pagination/components.mjs.map +1 -1
- package/dist/modules/data-tables/tables/data-table/components/table.mjs +8 -2
- package/dist/modules/data-tables/tables/data-table/components/table.mjs.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/common.mjs +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/common.mjs.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.mjs +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.mjs.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/read-only.mjs +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/read-only.mjs.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/table.mjs +8 -2
- package/dist/modules/data-tables/tables/inline-table/components/table.mjs.map +1 -1
- package/dist/modules/inline-edit/components/combobox-dropdown.client.mjs +5 -1
- package/dist/modules/inline-edit/components/combobox-dropdown.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/combobox.client.mjs +5 -1
- package/dist/modules/inline-edit/components/combobox.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/date-input.client.mjs +8 -4
- package/dist/modules/inline-edit/components/date-input.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/date-picker.client.mjs +7 -3
- package/dist/modules/inline-edit/components/date-picker.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/date-time.client.d.mts +1 -1
- package/dist/modules/inline-edit/components/date-time.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/date-time.client.mjs +7 -2
- package/dist/modules/inline-edit/components/date-time.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/editor.client.mjs +5 -1
- package/dist/modules/inline-edit/components/editor.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/input-recipient.client.mjs +5 -1
- package/dist/modules/inline-edit/components/input-recipient.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/input-toggle.client.mjs +7 -3
- package/dist/modules/inline-edit/components/input-toggle.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/input.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/input.client.mjs +18 -6
- package/dist/modules/inline-edit/components/input.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/select.client.d.mts +8 -11
- package/dist/modules/inline-edit/components/select.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/select.client.mjs +5 -1
- package/dist/modules/inline-edit/components/select.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/switch.client.d.mts +3 -2
- package/dist/modules/inline-edit/components/switch.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/switch.client.mjs +6 -2
- package/dist/modules/inline-edit/components/switch.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/toggle.client.mjs +6 -2
- package/dist/modules/inline-edit/components/toggle.client.mjs.map +1 -1
- package/dist/modules/inline-edit/hooks/use-inline.client.d.mts +20 -5
- package/dist/modules/inline-edit/hooks/use-inline.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/hooks/use-inline.client.mjs +11 -8
- package/dist/modules/inline-edit/hooks/use-inline.client.mjs.map +1 -1
- package/dist/modules/inline-edit/lib/variants.mjs +1 -1
- package/dist/modules/inline-edit/lib/variants.mjs.map +1 -1
- package/dist/modules/storage/components/dropzone.client.d.mts +2 -2
- package/dist/modules/storage/components/dropzone.client.d.mts.map +1 -1
- package/dist/modules/storage/components/dropzone.client.mjs +8 -8
- package/dist/modules/storage/components/dropzone.client.mjs.map +1 -1
- package/dist/modules/storage/components/image-grid.client.mjs +5 -5
- package/dist/modules/storage/components/image-grid.client.mjs.map +1 -1
- package/dist/modules/storage/components/upload-zone-context.client.d.mts +1 -0
- package/dist/modules/storage/components/upload-zone-context.client.d.mts.map +1 -1
- package/dist/modules/storage/components/upload-zone-context.client.mjs.map +1 -1
- package/dist/modules/storage/components/upload-zone.client.d.mts +2 -1
- package/dist/modules/storage/components/upload-zone.client.d.mts.map +1 -1
- package/dist/modules/storage/components/upload-zone.client.mjs +6 -4
- package/dist/modules/storage/components/upload-zone.client.mjs.map +1 -1
- package/package.json +6 -31
- package/src/components/editor/components/menu-nodes.client.tsx +3 -3
- package/src/components/editor/components/menu.client.tsx +3 -3
- package/src/components/emails/forget-password-email.tsx +6 -6
- package/src/components/entry.client.ts +16 -0
- package/src/components/entry.ts +6 -14
- package/src/components/header/back-button.client.tsx +2 -2
- package/src/components/header/bottom-bar.client.tsx +2 -2
- package/src/components/header/breadcrumbs.client.tsx +1 -1
- package/src/components/header/header.client.tsx +1 -1
- package/src/components/layouts/empty-page.tsx +2 -2
- package/src/components/layouts/error-page.tsx +3 -3
- package/src/components/layouts/providers.client.tsx +8 -5
- package/src/components/layouts/root-loading.tsx +2 -2
- package/src/components/layouts/tab-layout.tsx +1 -1
- package/src/components/lists/data-list.tsx +1 -1
- package/src/components/lists/data-stack.tsx +1 -1
- package/src/components/navigation/admin-sidebar-header.client.tsx +3 -3
- package/src/components/navigation/admin-sidebar-skeleton.tsx +1 -1
- package/src/components/navigation/admin-sidebar.client.tsx +1 -0
- package/src/components/ui/accordion.client.tsx +83 -0
- package/src/components/ui/alert-dialog.client.tsx +181 -0
- package/src/components/ui/alert.tsx +15 -7
- package/src/components/ui/aspect-ratio.client.tsx +9 -0
- package/src/components/ui/avatar.client.tsx +61 -6
- package/src/components/ui/badge.tsx +17 -11
- package/src/components/ui/breadcrumb.tsx +9 -10
- package/src/components/ui/button-group.tsx +78 -0
- package/src/components/ui/button.tsx +26 -16
- package/src/components/ui/{calendar.tsx → calendar.client.tsx} +27 -20
- package/src/components/ui/card.tsx +41 -8
- package/src/components/ui/{carousel.tsx → carousel.client.tsx} +12 -12
- package/src/components/ui/chart.client.tsx +105 -103
- package/src/components/ui/checkbox.client.tsx +28 -0
- package/src/components/ui/collapsible.client.tsx +2 -2
- package/src/components/ui/combobox-dropdown.client.tsx +2 -2
- package/src/components/ui/combobox.client.tsx +6 -6
- package/src/components/ui/command.client.tsx +179 -0
- package/src/components/ui/{context-menu.tsx → context-menu.client.tsx} +86 -64
- package/src/components/ui/date-picker.client.tsx +2 -2
- package/src/components/ui/dialog.client.tsx +43 -20
- package/src/components/ui/drawer.client.tsx +13 -15
- package/src/components/ui/{dropdown-menu.tsx → dropdown-menu.client.tsx} +45 -24
- package/src/components/ui/empty.tsx +93 -0
- package/src/components/ui/field.client.tsx +224 -0
- package/src/components/ui/form.client.tsx +4 -4
- package/src/components/ui/hover-card.client.tsx +14 -13
- package/src/components/ui/{input-date-time.tsx → input-date-time.client.tsx} +18 -11
- package/src/components/ui/input-date.tsx +1 -1
- package/src/components/ui/input-group.client.tsx +191 -0
- package/src/components/ui/input-recipient.tsx +12 -12
- package/src/components/ui/input-time.tsx +1 -1
- package/src/components/ui/input.tsx +2 -4
- package/src/components/ui/item.tsx +182 -0
- package/src/components/ui/kbd.tsx +26 -0
- package/src/components/ui/label.tsx +2 -3
- package/src/components/ui/loader.tsx +51 -0
- package/src/components/ui/navigation-menu.tsx +14 -17
- package/src/components/ui/pagination.tsx +31 -26
- package/src/components/ui/popover.client.tsx +73 -0
- package/src/components/ui/progress.client.tsx +6 -4
- package/src/components/ui/radio-group.tsx +5 -7
- package/src/components/ui/resizable.client.tsx +9 -19
- package/src/components/ui/scroll-area.tsx +5 -7
- package/src/components/ui/select.client.tsx +40 -22
- package/src/components/ui/separator.tsx +3 -4
- package/src/components/ui/sheet.client.tsx +19 -18
- package/src/components/ui/sidebar.client.tsx +27 -27
- package/src/components/ui/skeleton.tsx +1 -1
- package/src/components/ui/slider.tsx +5 -10
- package/src/components/ui/spinner.tsx +12 -48
- package/src/components/ui/switch.client.tsx +32 -0
- package/src/components/ui/tabs.client.tsx +79 -0
- package/src/components/ui/textarea.tsx +1 -2
- package/src/components/ui/toggle-group.client.tsx +26 -10
- package/src/components/ui/toggle.client.tsx +44 -0
- package/src/components/ui/tooltip.client.tsx +4 -9
- package/src/lib/hooks/use-indicator.tsx +14 -8
- package/src/modules/auth/components/auth-layout.server.tsx +3 -3
- package/src/modules/auth/components/create-first-user-page.client.tsx +4 -4
- package/src/modules/auth/components/forget-password-page.client.tsx +1 -1
- package/src/modules/auth/components/login-page.client.tsx +6 -6
- package/src/modules/auth/components/reset-password-page.client.tsx +7 -7
- package/src/modules/commands/components/alert-dialog-command.client.tsx +20 -16
- package/src/modules/commands/components/click-command.client.tsx +2 -2
- package/src/modules/commands/components/dialog-command.client.tsx +11 -10
- package/src/modules/commands/components/dropdown-command.client.tsx +2 -2
- package/src/modules/commands/components/empty-command.client.tsx +2 -2
- package/src/modules/commands/components/form-dialog-command.client.tsx +29 -13
- package/src/modules/commands/entry.client.ts +16 -0
- package/src/modules/commands/hooks/use-command-menu.client.tsx +2 -0
- package/src/modules/commands/menus/context-menu.client.tsx +3 -4
- package/src/modules/commands/menus/dropdown-menu.client.tsx +2 -2
- package/src/modules/commands/menus/floating-menu.client.tsx +54 -0
- package/src/modules/commands/utils/archive-command.client.tsx +1 -1
- package/src/modules/commands/utils/delete-command.client.tsx +1 -1
- package/src/modules/data-tables/components/cell/select.client.tsx +1 -1
- package/src/modules/data-tables/components/column-header.tsx +5 -5
- package/src/modules/data-tables/components/filters/combobox.client.tsx +6 -6
- package/src/modules/data-tables/components/filters/slider.client.tsx +2 -2
- package/src/modules/data-tables/components/header.tsx +1 -1
- package/src/modules/data-tables/components/skeleton.tsx +2 -2
- package/src/modules/data-tables/components/table.tsx +3 -3
- package/src/modules/data-tables/components/toolbar.tsx +1 -1
- package/src/modules/data-tables/strategies/pagination/components.tsx +3 -3
- package/src/modules/data-tables/tables/data-table/components/table.tsx +11 -2
- package/src/modules/data-tables/tables/inline-table/components/cells/common.tsx +1 -1
- package/src/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.tsx +1 -1
- package/src/modules/data-tables/tables/inline-table/components/cells/read-only.tsx +1 -1
- package/src/modules/data-tables/tables/inline-table/components/table.tsx +11 -2
- package/src/modules/inline-edit/components/combobox-dropdown.client.tsx +4 -0
- package/src/modules/inline-edit/components/combobox.client.tsx +4 -0
- package/src/modules/inline-edit/components/date-input.client.tsx +7 -3
- package/src/modules/inline-edit/components/date-picker.client.tsx +6 -2
- package/src/modules/inline-edit/components/date-time.client.tsx +16 -2
- package/src/modules/inline-edit/components/editor.client.tsx +4 -0
- package/src/modules/inline-edit/components/input-recipient.client.tsx +4 -0
- package/src/modules/inline-edit/components/input-toggle.client.tsx +6 -2
- package/src/modules/inline-edit/components/input.client.tsx +15 -3
- package/src/modules/inline-edit/components/select.client.tsx +10 -20
- package/src/modules/inline-edit/components/switch.client.tsx +7 -3
- package/src/modules/inline-edit/components/toggle.client.tsx +5 -1
- package/src/modules/inline-edit/hooks/use-inline.client.tsx +37 -13
- package/src/modules/inline-edit/lib/parsers.ts +9 -0
- package/src/modules/inline-edit/lib/variants.ts +1 -1
- package/src/modules/storage/components/dropzone.client.tsx +8 -8
- package/src/modules/storage/components/image-grid.client.tsx +5 -5
- package/src/modules/storage/components/upload-zone-context.client.tsx +1 -0
- package/src/modules/storage/components/upload-zone.client.tsx +9 -3
- package/src/styles.css +1 -3
- package/dist/components/ui/accordion.d.mts +0 -25
- package/dist/components/ui/accordion.d.mts.map +0 -1
- package/dist/components/ui/accordion.mjs +0 -46
- package/dist/components/ui/accordion.mjs.map +0 -1
- package/dist/components/ui/alert-dialog.d.mts +0 -43
- package/dist/components/ui/alert-dialog.d.mts.map +0 -1
- package/dist/components/ui/alert-dialog.mjs +0 -84
- package/dist/components/ui/alert-dialog.mjs.map +0 -1
- package/dist/components/ui/aspect-ratio.d.mts +0 -8
- package/dist/components/ui/aspect-ratio.d.mts.map +0 -1
- package/dist/components/ui/aspect-ratio.mjs +0 -16
- package/dist/components/ui/aspect-ratio.mjs.map +0 -1
- package/dist/components/ui/calendar.d.mts.map +0 -1
- package/dist/components/ui/calendar.mjs.map +0 -1
- package/dist/components/ui/carousel.d.mts.map +0 -1
- package/dist/components/ui/carousel.mjs.map +0 -1
- package/dist/components/ui/checkbox.d.mts +0 -12
- package/dist/components/ui/checkbox.d.mts.map +0 -1
- package/dist/components/ui/checkbox.mjs +0 -24
- package/dist/components/ui/checkbox.mjs.map +0 -1
- package/dist/components/ui/command.d.mts.map +0 -1
- package/dist/components/ui/command.mjs +0 -88
- package/dist/components/ui/command.mjs.map +0 -1
- package/dist/components/ui/context-menu.d.mts +0 -77
- package/dist/components/ui/context-menu.d.mts.map +0 -1
- package/dist/components/ui/context-menu.mjs +0 -125
- package/dist/components/ui/context-menu.mjs.map +0 -1
- package/dist/components/ui/dropdown-menu.d.mts +0 -78
- package/dist/components/ui/dropdown-menu.d.mts.map +0 -1
- package/dist/components/ui/dropdown-menu.mjs +0 -126
- package/dist/components/ui/dropdown-menu.mjs.map +0 -1
- package/dist/components/ui/input-date-time.d.mts.map +0 -1
- package/dist/components/ui/input-date-time.mjs.map +0 -1
- package/dist/components/ui/popover.d.mts +0 -23
- package/dist/components/ui/popover.d.mts.map +0 -1
- package/dist/components/ui/popover.mjs +0 -38
- package/dist/components/ui/popover.mjs.map +0 -1
- package/dist/components/ui/switch.d.mts +0 -12
- package/dist/components/ui/switch.d.mts.map +0 -1
- package/dist/components/ui/switch.mjs +0 -22
- package/dist/components/ui/switch.mjs.map +0 -1
- package/dist/components/ui/tabs.d.mts +0 -24
- package/dist/components/ui/tabs.d.mts.map +0 -1
- package/dist/components/ui/tabs.mjs +0 -39
- package/dist/components/ui/tabs.mjs.map +0 -1
- package/dist/components/ui/toggle.d.mts.map +0 -1
- package/dist/components/ui/toggle.mjs +0 -40
- package/dist/components/ui/toggle.mjs.map +0 -1
- package/dist/modules/commands/menus/data-table-menu.client.mjs.map +0 -1
- package/src/components/ui/accordion.tsx +0 -63
- package/src/components/ui/alert-dialog.tsx +0 -133
- package/src/components/ui/aspect-ratio.tsx +0 -9
- package/src/components/ui/checkbox.tsx +0 -29
- package/src/components/ui/command.tsx +0 -154
- package/src/components/ui/popover.tsx +0 -42
- package/src/components/ui/switch.tsx +0 -28
- package/src/components/ui/tabs.tsx +0 -54
- package/src/components/ui/toggle.tsx +0 -46
- package/src/modules/commands/menus/data-table-menu.client.tsx +0 -46
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.mjs","names":[],"sources":["../../../../../src/modules/data-tables/strategies/pagination/components.tsx"],"sourcesContent":["\"use client\";\n\nimport type { Table } from \"@tanstack/react-table\";\nimport { ChevronLeft, ChevronRight, ChevronsLeft, ChevronsRight, XIcon } from \"lucide-react\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"@/components/ui/select.client\";\n\nexport function PaginationTableFooter<TData extends { id: string }>({\n table,\n}: {\n table: Table<TData>;\n}) {\n const selected = Object.keys(table.getState().rowSelection).length;\n const total = table.getRowCount();\n\n return (\n <div className=\"flex flex-col gap-y-4 px-2 md:flex-row md:items-center md:justify-between\">\n <div className=\"flex items-center gap-2\">\n {selected > 0 && (\n <Button\n type=\"button\"\n size=\"icon\"\n variant=\"ghost\"\n className=\"h-4 w-4 rounded-full\"\n onClick={() => table.resetRowSelection()}\n >\n <XIcon className=\"h-2 w-2\" />\n </Button>\n )}\n\n <div className=\"text-muted-foreground
|
|
1
|
+
{"version":3,"file":"components.mjs","names":[],"sources":["../../../../../src/modules/data-tables/strategies/pagination/components.tsx"],"sourcesContent":["\"use client\";\n\nimport type { Table } from \"@tanstack/react-table\";\nimport { ChevronLeft, ChevronRight, ChevronsLeft, ChevronsRight, XIcon } from \"lucide-react\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"@/components/ui/select.client\";\n\nexport function PaginationTableFooter<TData extends { id: string }>({\n table,\n}: {\n table: Table<TData>;\n}) {\n const selected = Object.keys(table.getState().rowSelection).length;\n const total = table.getRowCount();\n\n return (\n <div className=\"flex flex-col gap-y-4 px-2 md:flex-row md:items-center md:justify-between\">\n <div className=\"flex items-center gap-2\">\n {selected > 0 && (\n <Button\n type=\"button\"\n size=\"icon\"\n variant=\"ghost\"\n className=\"h-4 w-4 rounded-full\"\n onClick={() => table.resetRowSelection()}\n >\n <XIcon className=\"h-2 w-2\" />\n </Button>\n )}\n\n <div className=\"flex-1 text-muted-foreground text-sm\">\n {selected ?? table.getFilteredSelectedRowModel().rows.length} of{\" \"}\n {total ?? table.getFilteredRowModel().rows.length} row(s) selected.\n </div>\n </div>\n\n <div className=\"flex items-center justify-between gap-x-6 md:justify-start lg:space-x-8\">\n <div className=\"hidden items-center space-x-2 md:flex\">\n <p className=\"font-medium text-sm\">Rows per page</p>\n <Select\n value={`${table.getState().pagination.pageSize}`}\n onValueChange={(value) => {\n table.setPageSize(Number(value));\n }}\n >\n <SelectTrigger className=\"h-8 w-[70px]\">\n <SelectValue placeholder={table.getState().pagination.pageSize} />\n </SelectTrigger>\n <SelectContent side=\"top\">\n {[10, 20, 30, 40, 50, 100, 300, 500].map((pageSize) => (\n <SelectItem key={pageSize} value={`${pageSize}`}>\n {pageSize}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n\n <div className=\"flex items-center justify-center font-medium text-sm\">\n Page {table.getState().pagination.pageIndex + 1} of {table.getPageCount()}\n </div>\n\n <div className=\"flex items-center space-x-2\">\n <Button\n type=\"button\"\n variant=\"outline\"\n className=\"hidden h-8 w-8 p-0 lg:flex\"\n onClick={() => table.setPageIndex(0)}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to first page</span>\n <ChevronsLeft className=\"h-4 w-4\" />\n </Button>\n\n <Button\n type=\"button\"\n variant=\"outline\"\n className=\"h-8 w-8 p-0\"\n onClick={() => table.previousPage()}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to previous page</span>\n <ChevronLeft className=\"h-4 w-4\" />\n </Button>\n\n <Button\n type=\"button\"\n variant=\"outline\"\n className=\"h-8 w-8 p-0\"\n onClick={() => table.nextPage()}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to next page</span>\n <ChevronRight className=\"h-4 w-4\" />\n </Button>\n\n <Button\n type=\"button\"\n variant=\"outline\"\n className=\"hidden h-8 w-8 p-0 lg:flex\"\n onClick={() => table.setPageIndex(table.getPageCount() - 1)}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to last page</span>\n <ChevronsRight className=\"h-4 w-4\" />\n </Button>\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAaA,SAAgB,sBAAoD,EAClE,SAGC;CACD,MAAM,WAAW,OAAO,KAAK,MAAM,UAAU,CAAC,aAAa,CAAC;CAC5D,MAAM,QAAQ,MAAM,aAAa;AAEjC,QACE,qBAAC;EAAI,WAAU;aACb,qBAAC;GAAI,WAAU;cACZ,WAAW,KACV,oBAAC;IACC,MAAK;IACL,MAAK;IACL,SAAQ;IACR,WAAU;IACV,eAAe,MAAM,mBAAmB;cAExC,oBAAC,SAAM,WAAU,YAAY;KACtB,EAGX,qBAAC;IAAI,WAAU;;KACZ,YAAY,MAAM,6BAA6B,CAAC,KAAK;KAAO;KAAI;KAChE,SAAS,MAAM,qBAAqB,CAAC,KAAK;KAAO;;KAC9C;IACF,EAEN,qBAAC;GAAI,WAAU;;IACb,qBAAC;KAAI,WAAU;gBACb,oBAAC;MAAE,WAAU;gBAAsB;OAAiB,EACpD,qBAAC;MACC,OAAO,GAAG,MAAM,UAAU,CAAC,WAAW;MACtC,gBAAgB,UAAU;AACxB,aAAM,YAAY,OAAO,MAAM,CAAC;;iBAGlC,oBAAC;OAAc,WAAU;iBACvB,oBAAC,eAAY,aAAa,MAAM,UAAU,CAAC,WAAW,WAAY;QACpD,EAChB,oBAAC;OAAc,MAAK;iBACjB;QAAC;QAAI;QAAI;QAAI;QAAI;QAAI;QAAK;QAAK;QAAI,CAAC,KAAK,aACxC,oBAAC;QAA0B,OAAO,GAAG;kBAClC;UADc,SAEJ,CACb;QACY;OACT;MACL;IAEN,qBAAC;KAAI,WAAU;;MAAuD;MAC9D,MAAM,UAAU,CAAC,WAAW,YAAY;MAAE;MAAK,MAAM,cAAc;;MACrE;IAEN,qBAAC;KAAI,WAAU;;MACb,qBAAC;OACC,MAAK;OACL,SAAQ;OACR,WAAU;OACV,eAAe,MAAM,aAAa,EAAE;OACpC,UAAU,CAAC,MAAM,oBAAoB;kBAErC,oBAAC;QAAK,WAAU;kBAAU;SAAuB,EACjD,oBAAC,gBAAa,WAAU,YAAY;QAC7B;MAET,qBAAC;OACC,MAAK;OACL,SAAQ;OACR,WAAU;OACV,eAAe,MAAM,cAAc;OACnC,UAAU,CAAC,MAAM,oBAAoB;kBAErC,oBAAC;QAAK,WAAU;kBAAU;SAA0B,EACpD,oBAAC,eAAY,WAAU,YAAY;QAC5B;MAET,qBAAC;OACC,MAAK;OACL,SAAQ;OACR,WAAU;OACV,eAAe,MAAM,UAAU;OAC/B,UAAU,CAAC,MAAM,gBAAgB;kBAEjC,oBAAC;QAAK,WAAU;kBAAU;SAAsB,EAChD,oBAAC,gBAAa,WAAU,YAAY;QAC7B;MAET,qBAAC;OACC,MAAK;OACL,SAAQ;OACR,WAAU;OACV,eAAe,MAAM,aAAa,MAAM,cAAc,GAAG,EAAE;OAC3D,UAAU,CAAC,MAAM,gBAAgB;kBAEjC,oBAAC;QAAK,WAAU;kBAAU;SAAsB,EAChD,oBAAC,iBAAc,WAAU,YAAY;QAC9B;;MACL;;IACF;GACF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
+
import { FloatingCommandMenu } from "../../../../commands/menus/floating-menu.client.mjs";
|
|
3
4
|
import { Table } from "../../../components/table.mjs";
|
|
4
5
|
import { useTable } from "../../../hooks/use-table.client.mjs";
|
|
5
|
-
import { TableCommandMenu } from "../../../../commands/menus/data-table-menu.client.mjs";
|
|
6
6
|
import { TableBottombar, TableFooter } from "../../../components/footer.mjs";
|
|
7
7
|
import { DataTableBody } from "./body.mjs";
|
|
8
8
|
import { DataTableHeader } from "./header.mjs";
|
|
@@ -27,7 +27,13 @@ function DataTable(props) {
|
|
|
27
27
|
})
|
|
28
28
|
}),
|
|
29
29
|
/* @__PURE__ */ jsx(TableBottombar, { table }),
|
|
30
|
-
meta.commands && /* @__PURE__ */ jsx(
|
|
30
|
+
meta.commands && /* @__PURE__ */ jsx(FloatingCommandMenu, {
|
|
31
|
+
data: meta.selectedData,
|
|
32
|
+
commands: meta.commands,
|
|
33
|
+
meta,
|
|
34
|
+
state: meta.selectedData?.length ? "open" : "closed",
|
|
35
|
+
onSuccess: () => table.resetRowSelection()
|
|
36
|
+
})
|
|
31
37
|
]
|
|
32
38
|
});
|
|
33
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.mjs","names":[],"sources":["../../../../../../src/modules/data-tables/tables/data-table/components/table.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"table.mjs","names":[],"sources":["../../../../../../src/modules/data-tables/tables/data-table/components/table.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport { FloatingCommandMenu } from \"@/modules/commands/menus/floating-menu.client\";\nimport { TableBottombar, TableFooter } from \"@/modules/data-tables/components/footer\";\nimport { Table } from \"@/modules/data-tables/components/table\";\nimport type { TableMeta } from \"@/modules/data-tables/entry\";\nimport { useTable } from \"@/modules/data-tables/hooks/use-table.client\";\nimport { DataTableBody } from \"./body\";\nimport { DataTableHeader } from \"./header\";\n\nexport function DataTable<TData extends { id: string }>(props: ComponentProps<typeof Table>) {\n const table = useTable<TData>();\n const meta = table.options.meta as TableMeta<TData>;\n\n return (\n <div className=\"space-y-4\">\n <div className=\"rounded-md border\">\n <Table {...props}>\n <DataTableHeader table={table} />\n <DataTableBody table={table} />\n <TableFooter table={table} />\n </Table>\n </div>\n\n <TableBottombar table={table} />\n\n {meta.commands && (\n <FloatingCommandMenu\n data={meta.selectedData}\n commands={meta.commands}\n meta={meta}\n state={meta.selectedData?.length ? \"open\" : \"closed\"}\n onSuccess={() => table.resetRowSelection()}\n />\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAWA,SAAgB,UAAwC,OAAqC;CAC3F,MAAM,QAAQ,UAAiB;CAC/B,MAAM,OAAO,MAAM,QAAQ;AAE3B,QACE,qBAAC;EAAI,WAAU;;GACb,oBAAC;IAAI,WAAU;cACb,qBAAC;KAAM,GAAI;;MACT,oBAAC,mBAAuB,QAAS;MACjC,oBAAC,iBAAqB,QAAS;MAC/B,oBAAC,eAAmB,QAAS;;MACvB;KACJ;GAEN,oBAAC,kBAAsB,QAAS;GAE/B,KAAK,YACJ,oBAAC;IACC,MAAM,KAAK;IACX,UAAU,KAAK;IACT;IACN,OAAO,KAAK,cAAc,SAAS,SAAS;IAC5C,iBAAiB,MAAM,mBAAmB;KAC1C;;GAEA"}
|
|
@@ -5,7 +5,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
5
5
|
//#region src/modules/data-tables/tables/inline-table/components/cells/common.tsx
|
|
6
6
|
function TableInlineCell({ className, ...props }) {
|
|
7
7
|
return /* @__PURE__ */ jsx(TableCell, {
|
|
8
|
-
className: cn("
|
|
8
|
+
className: cn("h-8 border-l p-0 align-middle first:border-0 focus-within:bg-accent focus-within:text-accent-foreground [&:has([role=checkbox])]:pr-0", className),
|
|
9
9
|
...props
|
|
10
10
|
});
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.mjs","names":[],"sources":["../../../../../../../src/modules/data-tables/tables/inline-table/components/cells/common.tsx"],"sourcesContent":["import type * as React from \"react\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { TableCell } from \"../../../../components/table\";\n\nexport function TableInlineCell({ className, ...props }: React.ComponentProps<typeof TableCell>) {\n return (\n <TableCell\n className={cn(\n \"
|
|
1
|
+
{"version":3,"file":"common.mjs","names":[],"sources":["../../../../../../../src/modules/data-tables/tables/inline-table/components/cells/common.tsx"],"sourcesContent":["import type * as React from \"react\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { TableCell } from \"../../../../components/table\";\n\nexport function TableInlineCell({ className, ...props }: React.ComponentProps<typeof TableCell>) {\n return (\n <TableCell\n className={cn(\n \"h-8 border-l p-0 align-middle first:border-0 focus-within:bg-accent focus-within:text-accent-foreground [&:has([role=checkbox])]:pr-0\",\n className,\n )}\n {...props}\n />\n );\n}\n"],"mappings":";;;;;AAIA,SAAgB,gBAAgB,EAAE,WAAW,GAAG,SAAiD;AAC/F,QACE,oBAAC;EACC,WAAW,GACT,yIACA,UACD;EACD,GAAI;GACJ"}
|
package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.mjs
CHANGED
|
@@ -20,7 +20,7 @@ function TableDragHandle({ row, className, disabled }) {
|
|
|
20
20
|
type: "button",
|
|
21
21
|
className: cn("h-full w-8 rounded-none border-none", className),
|
|
22
22
|
disabled,
|
|
23
|
-
children: /* @__PURE__ */ jsx(GripIcon, { className: "fill-muted
|
|
23
|
+
children: /* @__PURE__ */ jsx(GripIcon, { className: "size-4 fill-muted" })
|
|
24
24
|
})
|
|
25
25
|
});
|
|
26
26
|
}
|
package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drag-handle.client.mjs","names":[],"sources":["../../../../../../../src/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.tsx"],"sourcesContent":["import { useSortable } from \"@dnd-kit/sortable\";\nimport type { CellContext } from \"@tanstack/react-table\";\nimport { GripIcon } from \"lucide-react\";\nimport { Button } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/entry\";\nimport { createTableCell } from \"../../../../lib/helpers/create-column\";\nimport { TableInlineCell } from \"./common\";\n\n/**\n * Create a new column with the drag handle\n */\nexport type TableDragHandleProps<TData, TValue> = Pick<CellContext<TData, TValue>, \"row\"> & {\n className?: string;\n disabled?: boolean;\n};\n\nexport function TableDragHandle<TData, TValue>({\n row,\n className,\n disabled,\n}: TableDragHandleProps<TData, TValue>) {\n const rowId = (row.original as { id: string }).id;\n\n const { attributes, listeners } = useSortable({ id: rowId });\n\n return (\n <TableInlineCell className=\"w-8\">\n <Button\n {...attributes}\n {...listeners}\n variant=\"ghost\"\n size=\"icon\"\n type=\"button\"\n className={cn(\"h-full w-8 rounded-none border-none\", className)}\n disabled={disabled}\n >\n <GripIcon className=\"fill-muted
|
|
1
|
+
{"version":3,"file":"drag-handle.client.mjs","names":[],"sources":["../../../../../../../src/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.tsx"],"sourcesContent":["import { useSortable } from \"@dnd-kit/sortable\";\nimport type { CellContext } from \"@tanstack/react-table\";\nimport { GripIcon } from \"lucide-react\";\nimport { Button } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/entry\";\nimport { createTableCell } from \"../../../../lib/helpers/create-column\";\nimport { TableInlineCell } from \"./common\";\n\n/**\n * Create a new column with the drag handle\n */\nexport type TableDragHandleProps<TData, TValue> = Pick<CellContext<TData, TValue>, \"row\"> & {\n className?: string;\n disabled?: boolean;\n};\n\nexport function TableDragHandle<TData, TValue>({\n row,\n className,\n disabled,\n}: TableDragHandleProps<TData, TValue>) {\n const rowId = (row.original as { id: string }).id;\n\n const { attributes, listeners } = useSortable({ id: rowId });\n\n return (\n <TableInlineCell className=\"w-8\">\n <Button\n {...attributes}\n {...listeners}\n variant=\"ghost\"\n size=\"icon\"\n type=\"button\"\n className={cn(\"h-full w-8 rounded-none border-none\", className)}\n disabled={disabled}\n >\n <GripIcon className=\"size-4 fill-muted\" />\n </Button>\n </TableInlineCell>\n );\n}\n\n/**\n * Create a new column with the drag handle\n */\nexport const createTableDragHandleCell = createTableCell({\n id: \"dragHandle\",\n cell: TableDragHandle,\n enableHiding: false,\n enableSorting: false,\n});\n"],"mappings":";;;;;;;;;AAgBA,SAAgB,gBAA+B,EAC7C,KACA,WACA,YACsC;CACtC,MAAM,QAAS,IAAI,SAA4B;CAE/C,MAAM,EAAE,YAAY,cAAc,YAAY,EAAE,IAAI,OAAO,CAAC;AAE5D,QACE,oBAAC;EAAgB,WAAU;YACzB,oBAAC;GACC,GAAI;GACJ,GAAI;GACJ,SAAQ;GACR,MAAK;GACL,MAAK;GACL,WAAW,GAAG,uCAAuC,UAAU;GACrD;aAEV,oBAAC,YAAS,WAAU,sBAAsB;IACnC;GACO;;;;;AAOtB,MAAa,4BAA4B,gBAAgB;CACvD,IAAI;CACJ,MAAM;CACN,cAAc;CACd,eAAe;CAChB,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
5
5
|
function InlineDataTableReadOnly({ className, children, ...props }) {
|
|
6
6
|
return /* @__PURE__ */ jsx("span", {
|
|
7
7
|
...props,
|
|
8
|
-
className: cn("
|
|
8
|
+
className: cn("flex h-full w-full items-center truncate bg-muted/50 px-3", className),
|
|
9
9
|
children
|
|
10
10
|
});
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-only.mjs","names":[],"sources":["../../../../../../../src/modules/data-tables/tables/inline-table/components/cells/read-only.tsx"],"sourcesContent":["import type React from \"react\";\nimport { cn } from \"@/lib/utils/cn\";\n\nexport function InlineDataTableReadOnly({\n className,\n children,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) {\n return (\n <span\n {...props}\n className={cn(\"
|
|
1
|
+
{"version":3,"file":"read-only.mjs","names":[],"sources":["../../../../../../../src/modules/data-tables/tables/inline-table/components/cells/read-only.tsx"],"sourcesContent":["import type React from \"react\";\nimport { cn } from \"@/lib/utils/cn\";\n\nexport function InlineDataTableReadOnly({\n className,\n children,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) {\n return (\n <span\n {...props}\n className={cn(\"flex h-full w-full items-center truncate bg-muted/50 px-3\", className)}\n >\n {children}\n </span>\n );\n}\n"],"mappings":";;;;AAGA,SAAgB,wBAAwB,EACtC,WACA,UACA,GAAG,SACqC;AACxC,QACE,oBAAC;EACC,GAAI;EACJ,WAAW,GAAG,6DAA6D,UAAU;EAEpF;GACI"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
+
import { FloatingCommandMenu } from "../../../../commands/menus/floating-menu.client.mjs";
|
|
3
4
|
import { Table } from "../../../components/table.mjs";
|
|
4
5
|
import { useTable } from "../../../hooks/use-table.client.mjs";
|
|
5
|
-
import { TableCommandMenu } from "../../../../commands/menus/data-table-menu.client.mjs";
|
|
6
6
|
import { TableBottombar, TableFooter } from "../../../components/footer.mjs";
|
|
7
7
|
import { InlineTableProvider } from "../hooks/context.client.mjs";
|
|
8
8
|
import { InlineTableBody } from "./body.mjs";
|
|
@@ -35,7 +35,13 @@ function InlineTable({ disabledColumns, moveRowAction, ...props }) {
|
|
|
35
35
|
})
|
|
36
36
|
}),
|
|
37
37
|
/* @__PURE__ */ jsx(TableBottombar, { table }),
|
|
38
|
-
meta.commands && /* @__PURE__ */ jsx(
|
|
38
|
+
meta.commands && /* @__PURE__ */ jsx(FloatingCommandMenu, {
|
|
39
|
+
data: meta.selectedData,
|
|
40
|
+
commands: meta.commands,
|
|
41
|
+
meta,
|
|
42
|
+
state: meta.selectedData?.length ? "open" : "closed",
|
|
43
|
+
onSuccess: () => table.resetRowSelection()
|
|
44
|
+
})
|
|
39
45
|
]
|
|
40
46
|
})
|
|
41
47
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.mjs","names":[],"sources":["../../../../../../src/modules/data-tables/tables/inline-table/components/table.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport { HotkeysProvider } from \"react-hotkeys-hook\";\nimport {
|
|
1
|
+
{"version":3,"file":"table.mjs","names":[],"sources":["../../../../../../src/modules/data-tables/tables/inline-table/components/table.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport { HotkeysProvider } from \"react-hotkeys-hook\";\nimport { FloatingCommandMenu } from \"@/modules/commands/menus/floating-menu.client\";\nimport { TableBottombar, TableFooter } from \"@/modules/data-tables/components/footer\";\nimport { Table } from \"@/modules/data-tables/components/table\";\nimport type { TableMeta } from \"@/modules/data-tables/entry\";\nimport { useTable } from \"@/modules/data-tables/hooks/use-table.client\";\nimport { InlineTableProvider } from \"../hooks/context.client\";\nimport { InlineTableBody } from \"./body\";\nimport { InlineTableHeader } from \"./header\";\n\nexport function InlineTable<TData extends { id: string }>({\n disabledColumns,\n moveRowAction,\n ...props\n}: ComponentProps<typeof Table> & ComponentProps<typeof InlineTableProvider>) {\n const table = useTable<TData>();\n const meta = table.options.meta as TableMeta<TData>;\n\n return (\n <InlineTableProvider disabledColumns={disabledColumns} moveRowAction={moveRowAction}>\n <div className=\"space-y-4\">\n <div className=\"rounded-md border\">\n <Table {...props}>\n <InlineTableHeader table={table} />\n\n <HotkeysProvider initiallyActiveScopes={[\"inline-data-table\"]}>\n <InlineTableBody table={table} />\n </HotkeysProvider>\n\n <TableFooter table={table} />\n </Table>\n </div>\n\n <TableBottombar table={table} />\n\n {meta.commands && (\n <FloatingCommandMenu\n data={meta.selectedData}\n commands={meta.commands}\n meta={meta}\n state={meta.selectedData?.length ? \"open\" : \"closed\"}\n onSuccess={() => table.resetRowSelection()}\n />\n )}\n </div>\n </InlineTableProvider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAaA,SAAgB,YAA0C,EACxD,iBACA,eACA,GAAG,SACyE;CAC5E,MAAM,QAAQ,UAAiB;CAC/B,MAAM,OAAO,MAAM,QAAQ;AAE3B,QACE,oBAAC;EAAqC;EAAgC;YACpE,qBAAC;GAAI,WAAU;;IACb,oBAAC;KAAI,WAAU;eACb,qBAAC;MAAM,GAAI;;OACT,oBAAC,qBAAyB,QAAS;OAEnC,oBAAC;QAAgB,uBAAuB,CAAC,oBAAoB;kBAC3D,oBAAC,mBAAuB,QAAS;SACjB;OAElB,oBAAC,eAAmB,QAAS;;OACvB;MACJ;IAEN,oBAAC,kBAAsB,QAAS;IAE/B,KAAK,YACJ,oBAAC;KACC,MAAM,KAAK;KACX,UAAU,KAAK;KACT;KACN,OAAO,KAAK,cAAc,SAAS,SAAS;KAC5C,iBAAiB,MAAM,mBAAmB;MAC1C;;IAEA;GACc"}
|
|
@@ -13,7 +13,11 @@ function InlineComboboxDropdown({ selectedItem, variant, className, onSelect, in
|
|
|
13
13
|
action,
|
|
14
14
|
permission,
|
|
15
15
|
updateStrategy,
|
|
16
|
-
isRequired
|
|
16
|
+
isRequired,
|
|
17
|
+
parser: {
|
|
18
|
+
decode: (value) => value,
|
|
19
|
+
encode: (value) => value
|
|
20
|
+
}
|
|
17
21
|
});
|
|
18
22
|
const initialSelectedItem = props.items.find((item) => item.id === initialValue);
|
|
19
23
|
return /* @__PURE__ */ jsx(ComboboxDropdown, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-dropdown.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/combobox-dropdown.client.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ComboboxDropdown,\n type ComboboxDropdownItem,\n type ComboboxDropdownProps,\n} from \"@/components/ui/combobox-dropdown.client\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\nexport type InlineEditComboboxDropdownProps<\n TValue extends ComboboxDropdownItem,\n Required extends boolean = false,\n> = useInlineEditOptions<string, Required> &\n InlineEditVariantsProps &\n Omit<ComboboxDropdownProps<TValue>, \"onSelect\"> & {\n onSelect?: ComboboxDropdownProps<TValue>[\"onSelect\"];\n };\n\nexport function InlineComboboxDropdown<\n TValue extends ComboboxDropdownItem,\n Required extends boolean,\n>({\n selectedItem,\n variant,\n className,\n onSelect,\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n disabled,\n ...props\n}: InlineEditComboboxDropdownProps<TValue, Required>) {\n const { handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n });\n\n const initialSelectedItem = props.items.find((item) => item.id === initialValue);\n\n return (\n <ComboboxDropdown\n {...props}\n className={cn(inlineEditVariants({ variant, status }), className)}\n disabled={disabled || !isAllowed}\n selectedItem={selectedItem ?? initialSelectedItem}\n onSelect={(event) => {\n handleChange(event.id ?? null);\n handleBlur(event.id ?? null);\n onSelect?.(event);\n }}\n />\n );\n}\n"],"mappings":";;;;;;;;;AAoBA,SAAgB,uBAGd,EACA,cACA,SACA,WACA,UACA,cACA,QACA,YACA,gBACA,YACA,UACA,GAAG,SACiD;CACpD,MAAM,EAAE,cAAc,YAAY,WAAW,WAAW,cAAc;EACpE;EACA;EACA;EACA;EACA;
|
|
1
|
+
{"version":3,"file":"combobox-dropdown.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/combobox-dropdown.client.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ComboboxDropdown,\n type ComboboxDropdownItem,\n type ComboboxDropdownProps,\n} from \"@/components/ui/combobox-dropdown.client\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\nexport type InlineEditComboboxDropdownProps<\n TValue extends ComboboxDropdownItem,\n Required extends boolean = false,\n> = useInlineEditOptions<string, Required> &\n InlineEditVariantsProps &\n Omit<ComboboxDropdownProps<TValue>, \"onSelect\"> & {\n onSelect?: ComboboxDropdownProps<TValue>[\"onSelect\"];\n };\n\nexport function InlineComboboxDropdown<\n TValue extends ComboboxDropdownItem,\n Required extends boolean,\n>({\n selectedItem,\n variant,\n className,\n onSelect,\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n disabled,\n ...props\n}: InlineEditComboboxDropdownProps<TValue, Required>) {\n const { handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n const initialSelectedItem = props.items.find((item) => item.id === initialValue);\n\n return (\n <ComboboxDropdown\n {...props}\n className={cn(inlineEditVariants({ variant, status }), className)}\n disabled={disabled || !isAllowed}\n selectedItem={selectedItem ?? initialSelectedItem}\n onSelect={(event) => {\n handleChange(event.id ?? null);\n handleBlur(event.id ?? null);\n onSelect?.(event);\n }}\n />\n );\n}\n"],"mappings":";;;;;;;;;AAoBA,SAAgB,uBAGd,EACA,cACA,SACA,WACA,UACA,cACA,QACA,YACA,gBACA,YACA,UACA,GAAG,SACiD;CACpD,MAAM,EAAE,cAAc,YAAY,WAAW,WAAW,cAAc;EACpE;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;CAEF,MAAM,sBAAsB,MAAM,MAAM,MAAM,SAAS,KAAK,OAAO,aAAa;AAEhF,QACE,oBAAC;EACC,GAAI;EACJ,WAAW,GAAG,mBAAmB;GAAE;GAAS;GAAQ,CAAC,EAAE,UAAU;EACjE,UAAU,YAAY,CAAC;EACvB,cAAc,gBAAgB;EAC9B,WAAW,UAAU;AACnB,gBAAa,MAAM,MAAM,KAAK;AAC9B,cAAW,MAAM,MAAM,KAAK;AAC5B,cAAW,MAAM;;GAEnB"}
|
|
@@ -11,7 +11,11 @@ function InlineCombobox({ initialValue, action, permission, onSelect, onBlur, di
|
|
|
11
11
|
action,
|
|
12
12
|
permission,
|
|
13
13
|
updateStrategy,
|
|
14
|
-
isRequired
|
|
14
|
+
isRequired,
|
|
15
|
+
parser: {
|
|
16
|
+
decode: (value) => value,
|
|
17
|
+
encode: (value) => value
|
|
18
|
+
}
|
|
15
19
|
});
|
|
16
20
|
return /* @__PURE__ */ jsx(Combobox, {
|
|
17
21
|
...props,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/combobox.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Combobox, type ComboboxProps } from \"@/components/ui/combobox.client\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\n\nexport type InlineComboboxProps<TValue, Required extends boolean = false> = useInlineEditOptions<\n string,\n Required\n> &\n Omit<ComboboxProps<TValue>, \"value\">;\n\nexport function InlineCombobox<TValue, Required extends boolean>({\n initialValue,\n action,\n permission,\n onSelect,\n onBlur,\n disabled,\n updateStrategy,\n isRequired,\n ...props\n}: InlineComboboxProps<TValue, Required>) {\n const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n });\n\n return (\n <Combobox\n {...props}\n value={value}\n disabled={disabled || !isAllowed}\n onSelect={(value) => {\n handleChange(value ?? null);\n onSelect?.(value as TValue);\n }}\n onBlur={(e) => {\n handleBlur(e.target.value ?? null);\n onBlur?.(e);\n }}\n />\n );\n}\n"],"mappings":";;;;;;;AAWA,SAAgB,eAAiD,EAC/D,cACA,QACA,YACA,UACA,QACA,UACA,gBACA,YACA,GAAG,SACqC;CACxC,MAAM,EAAE,OAAO,cAAc,YAAY,cAAc,cAAc;EACnE;EACA;EACA;EACA;EACA;
|
|
1
|
+
{"version":3,"file":"combobox.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/combobox.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Combobox, type ComboboxProps } from \"@/components/ui/combobox.client\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\n\nexport type InlineComboboxProps<TValue, Required extends boolean = false> = useInlineEditOptions<\n string,\n Required\n> &\n Omit<ComboboxProps<TValue>, \"value\">;\n\nexport function InlineCombobox<TValue, Required extends boolean>({\n initialValue,\n action,\n permission,\n onSelect,\n onBlur,\n disabled,\n updateStrategy,\n isRequired,\n ...props\n}: InlineComboboxProps<TValue, Required>) {\n const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <Combobox\n {...props}\n value={value}\n disabled={disabled || !isAllowed}\n onSelect={(value) => {\n handleChange(value ?? null);\n onSelect?.(value as TValue);\n }}\n onBlur={(e) => {\n handleBlur(e.target.value ?? null);\n onBlur?.(e);\n }}\n />\n );\n}\n"],"mappings":";;;;;;;AAWA,SAAgB,eAAiD,EAC/D,cACA,QACA,YACA,UACA,QACA,UACA,gBACA,YACA,GAAG,SACqC;CACxC,MAAM,EAAE,OAAO,cAAc,YAAY,cAAc,cAAc;EACnE;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,oBAAC;EACC,GAAI;EACG;EACP,UAAU,YAAY,CAAC;EACvB,WAAW,UAAU;AACnB,gBAAa,SAAS,KAAK;AAC3B,cAAW,MAAgB;;EAE7B,SAAS,MAAM;AACb,cAAW,EAAE,OAAO,SAAS,KAAK;AAClC,YAAS,EAAE;;GAEb"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import { cn } from "../../../lib/utils/cn.mjs";
|
|
4
4
|
import { Button } from "../../../components/ui/button.mjs";
|
|
5
|
-
import { Popover, PopoverContent, PopoverTrigger } from "../../../components/ui/popover.mjs";
|
|
5
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../../../components/ui/popover.client.mjs";
|
|
6
6
|
import { Input } from "../../../components/ui/input.mjs";
|
|
7
|
-
import { Calendar as Calendar$1 } from "../../../components/ui/calendar.mjs";
|
|
7
|
+
import { Calendar as Calendar$1 } from "../../../components/ui/calendar.client.mjs";
|
|
8
8
|
import { useInlineEdit } from "../hooks/use-inline.client.mjs";
|
|
9
9
|
import { inlineEditVariants } from "../lib/variants.mjs";
|
|
10
10
|
import { CalendarIcon } from "lucide-react";
|
|
@@ -23,7 +23,11 @@ function InlineDateInput({ initialValue, action, permission, variant, className,
|
|
|
23
23
|
action,
|
|
24
24
|
permission,
|
|
25
25
|
updateStrategy,
|
|
26
|
-
isRequired
|
|
26
|
+
isRequired,
|
|
27
|
+
parser: {
|
|
28
|
+
decode: (value) => value,
|
|
29
|
+
encode: (value) => value
|
|
30
|
+
}
|
|
27
31
|
});
|
|
28
32
|
const [stringDate, setStringDate] = React.useState(initialValue ? formatDate(initialValue) : "");
|
|
29
33
|
/**
|
|
@@ -65,7 +69,7 @@ function InlineDateInput({ initialValue, action, permission, variant, className,
|
|
|
65
69
|
variant: "ghost",
|
|
66
70
|
tabIndex: -1,
|
|
67
71
|
disabled: !isAllowed,
|
|
68
|
-
className: cn("absolute
|
|
72
|
+
className: cn("absolute top-0 right-0 bottom-0 opacity-50", !value && "text-muted-foreground"),
|
|
69
73
|
children: /* @__PURE__ */ jsx(CalendarIcon, { className: "h-4 w-4" })
|
|
70
74
|
})
|
|
71
75
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-input.client.mjs","names":["Calendar"],"sources":["../../../../src/modules/inline-edit/components/date-input.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { format } from \"date-fns\";\nimport { CalendarIcon } from \"lucide-react\";\nimport React, { type ComponentProps } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Calendar } from \"@/components/ui/calendar\";\nimport { Input } from \"@/components/ui/input\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/ui/popover\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\nconst formatDate = (value: Date) => format(value, \"dd/MM/yyyy\");\nconst parseDate = (value: string) => new Date(value.split(\"/\").reverse().join(\"-\"));\nconst isValidDate = (date: Date) => date instanceof Date && date.toString() !== \"Invalid Date\";\n\nexport function InlineDateInput<Required extends boolean = false>({\n initialValue,\n action,\n permission,\n variant,\n className,\n updateStrategy,\n isRequired,\n ...props\n}: ComponentProps<\"div\"> & useInlineEditOptions<Date, Required> & InlineEditVariantsProps) {\n const [inValid, setInValid] = React.useState<boolean>(false);\n\n const { value, setValue, handleChange, handleBlur, status, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n });\n\n const [stringDate, setStringDate] = React.useState<string>(\n initialValue ? formatDate(initialValue) : \"\",\n );\n\n /**\n * Update string date when value changes\n */\n React.useEffect(() => {\n if (value) setStringDate(formatDate(value));\n }, [value]);\n\n return (\n <Popover>\n <div {...props} className={cn(\"relative h-full\", className)}>\n <Input\n data-input\n type=\"string\"\n value={stringDate}\n className={cn(inlineEditVariants({ variant, status }), inValid && \"text-destructive\")}\n disabled={!isAllowed}\n onChange={(e) => {\n setStringDate(e.target.value);\n const parsedDate = parseDate(e.target.value);\n\n if (!isValidDate(parsedDate)) {\n setInValid(true);\n setValue(undefined);\n } else {\n setInValid(false);\n setValue(parsedDate);\n }\n }}\n onBlur={(e) => {\n const parsedDate = parseDate(e.target.value);\n handleBlur(isValidDate(parsedDate) ? parsedDate : null);\n }}\n />\n\n <PopoverTrigger asChild>\n <Button\n variant=\"ghost\"\n tabIndex={-1}\n disabled={!isAllowed}\n className={cn(\n \"absolute
|
|
1
|
+
{"version":3,"file":"date-input.client.mjs","names":["Calendar"],"sources":["../../../../src/modules/inline-edit/components/date-input.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { format } from \"date-fns\";\nimport { CalendarIcon } from \"lucide-react\";\nimport React, { type ComponentProps } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Calendar } from \"@/components/ui/calendar.client\";\nimport { Input } from \"@/components/ui/input\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/ui/popover.client\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\nconst formatDate = (value: Date) => format(value, \"dd/MM/yyyy\");\nconst parseDate = (value: string) => new Date(value.split(\"/\").reverse().join(\"-\"));\nconst isValidDate = (date: Date) => date instanceof Date && date.toString() !== \"Invalid Date\";\n\nexport function InlineDateInput<Required extends boolean = false>({\n initialValue,\n action,\n permission,\n variant,\n className,\n updateStrategy,\n isRequired,\n ...props\n}: ComponentProps<\"div\"> & useInlineEditOptions<Date, Required> & InlineEditVariantsProps) {\n const [inValid, setInValid] = React.useState<boolean>(false);\n\n const { value, setValue, handleChange, handleBlur, status, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n const [stringDate, setStringDate] = React.useState<string>(\n initialValue ? formatDate(initialValue) : \"\",\n );\n\n /**\n * Update string date when value changes\n */\n React.useEffect(() => {\n if (value) setStringDate(formatDate(value));\n }, [value]);\n\n return (\n <Popover>\n <div {...props} className={cn(\"relative h-full\", className)}>\n <Input\n data-input\n type=\"string\"\n value={stringDate}\n className={cn(inlineEditVariants({ variant, status }), inValid && \"text-destructive\")}\n disabled={!isAllowed}\n onChange={(e) => {\n setStringDate(e.target.value);\n const parsedDate = parseDate(e.target.value);\n\n if (!isValidDate(parsedDate)) {\n setInValid(true);\n setValue(undefined);\n } else {\n setInValid(false);\n setValue(parsedDate);\n }\n }}\n onBlur={(e) => {\n const parsedDate = parseDate(e.target.value);\n handleBlur(isValidDate(parsedDate) ? parsedDate : null);\n }}\n />\n\n <PopoverTrigger asChild>\n <Button\n variant=\"ghost\"\n tabIndex={-1}\n disabled={!isAllowed}\n className={cn(\n \"absolute top-0 right-0 bottom-0 opacity-50\",\n !value && \"text-muted-foreground\",\n )}\n >\n <CalendarIcon className=\"h-4 w-4\" />\n </Button>\n </PopoverTrigger>\n </div>\n\n <PopoverContent className=\"w-auto p-0\">\n <Calendar\n mode=\"single\"\n autoFocus\n selected={value ?? undefined}\n defaultMonth={value ?? undefined}\n disabled={!isAllowed}\n onSelect={(selectedDate) => {\n if (!selectedDate) return;\n\n setStringDate(formatDate(selectedDate));\n\n handleChange(selectedDate ?? null);\n handleBlur(selectedDate ?? null);\n\n setInValid(false);\n }}\n />\n </PopoverContent>\n </Popover>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAaA,MAAM,cAAc,UAAgB,OAAO,OAAO,aAAa;AAC/D,MAAM,aAAa,UAAkB,IAAI,KAAK,MAAM,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;AACnF,MAAM,eAAe,SAAe,gBAAgB,QAAQ,KAAK,UAAU,KAAK;AAEhF,SAAgB,gBAAkD,EAChE,cACA,QACA,YACA,SACA,WACA,gBACA,YACA,GAAG,SACsF;CACzF,MAAM,CAAC,SAAS,cAAc,MAAM,SAAkB,MAAM;CAE5D,MAAM,EAAE,OAAO,UAAU,cAAc,YAAY,QAAQ,cAAc,cAAc;EACrF;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;CAEF,MAAM,CAAC,YAAY,iBAAiB,MAAM,SACxC,eAAe,WAAW,aAAa,GAAG,GAC3C;;;;AAKD,OAAM,gBAAgB;AACpB,MAAI,MAAO,eAAc,WAAW,MAAM,CAAC;IAC1C,CAAC,MAAM,CAAC;AAEX,QACE,qBAAC,sBACC,qBAAC;EAAI,GAAI;EAAO,WAAW,GAAG,mBAAmB,UAAU;aACzD,oBAAC;GACC;GACA,MAAK;GACL,OAAO;GACP,WAAW,GAAG,mBAAmB;IAAE;IAAS;IAAQ,CAAC,EAAE,WAAW,mBAAmB;GACrF,UAAU,CAAC;GACX,WAAW,MAAM;AACf,kBAAc,EAAE,OAAO,MAAM;IAC7B,MAAM,aAAa,UAAU,EAAE,OAAO,MAAM;AAE5C,QAAI,CAAC,YAAY,WAAW,EAAE;AAC5B,gBAAW,KAAK;AAChB,cAAS,OAAU;WACd;AACL,gBAAW,MAAM;AACjB,cAAS,WAAW;;;GAGxB,SAAS,MAAM;IACb,MAAM,aAAa,UAAU,EAAE,OAAO,MAAM;AAC5C,eAAW,YAAY,WAAW,GAAG,aAAa,KAAK;;IAEzD,EAEF,oBAAC;GAAe;aACd,oBAAC;IACC,SAAQ;IACR,UAAU;IACV,UAAU,CAAC;IACX,WAAW,GACT,8CACA,CAAC,SAAS,wBACX;cAED,oBAAC,gBAAa,WAAU,YAAY;KAC7B;IACM;GACb,EAEN,oBAAC;EAAe,WAAU;YACxB,oBAACA;GACC,MAAK;GACL;GACA,UAAU,SAAS;GACnB,cAAc,SAAS;GACvB,UAAU,CAAC;GACX,WAAW,iBAAiB;AAC1B,QAAI,CAAC,aAAc;AAEnB,kBAAc,WAAW,aAAa,CAAC;AAEvC,iBAAa,gBAAgB,KAAK;AAClC,eAAW,gBAAgB,KAAK;AAEhC,eAAW,MAAM;;IAEnB;GACa,IACT"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { cn } from "../../../lib/utils/cn.mjs";
|
|
4
4
|
import { Button } from "../../../components/ui/button.mjs";
|
|
5
5
|
import { formatDate } from "../../../lib/utils/format.mjs";
|
|
6
|
-
import { Popover, PopoverContent, PopoverTrigger } from "../../../components/ui/popover.mjs";
|
|
7
|
-
import { Calendar as Calendar$1 } from "../../../components/ui/calendar.mjs";
|
|
6
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../../../components/ui/popover.client.mjs";
|
|
7
|
+
import { Calendar as Calendar$1 } from "../../../components/ui/calendar.client.mjs";
|
|
8
8
|
import { useInlineEdit } from "../hooks/use-inline.client.mjs";
|
|
9
9
|
import { inlineEditVariants } from "../lib/variants.mjs";
|
|
10
10
|
import { CalendarIcon } from "lucide-react";
|
|
@@ -19,7 +19,11 @@ function InlineDatePicker({ initialValue, action, permission, variant, className
|
|
|
19
19
|
action,
|
|
20
20
|
permission,
|
|
21
21
|
updateStrategy,
|
|
22
|
-
isRequired
|
|
22
|
+
isRequired,
|
|
23
|
+
parser: {
|
|
24
|
+
decode: (value) => value,
|
|
25
|
+
encode: (value) => value
|
|
26
|
+
}
|
|
23
27
|
});
|
|
24
28
|
return /* @__PURE__ */ jsxs(Popover, {
|
|
25
29
|
open,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.client.mjs","names":["Calendar"],"sources":["../../../../src/modules/inline-edit/components/date-picker.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { CalendarIcon } from \"lucide-react\";\nimport React, { type ComponentProps } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Calendar } from \"@/components/ui/calendar\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/ui/popover\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { formatDate } from \"@/lib/utils/format\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\ntype InlineEditDatePickerProps<Required extends boolean> = ComponentProps<typeof Button> &\n useInlineEditOptions<Date, Required> &\n InlineEditVariantsProps;\n\nexport function InlineDatePicker<Required extends boolean = false>({\n initialValue,\n action,\n permission,\n variant,\n className,\n disabled,\n updateStrategy,\n isRequired,\n ...props\n}: InlineEditDatePickerProps<Required>) {\n const [open, setOpen] = React.useState(false);\n\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n });\n\n return (\n <Popover\n open={open}\n onOpenChange={(open) => {\n setOpen(open);\n if (!open && value) handleBlur(value);\n }}\n >\n <PopoverTrigger asChild>\n <Button\n {...props}\n type=\"button\"\n variant=\"outline\"\n className={cn(\"w-full\", inlineEditVariants({ variant, status }), className)}\n disabled={disabled || !isAllowed}\n >\n <CalendarIcon className=\"mr-2 h-4 w-4\" />\n {value ? formatDate(value) : <span>Kies een datum</span>}\n </Button>\n </PopoverTrigger>\n\n <PopoverContent className=\"w-auto p-0\">\n <Calendar\n mode=\"single\"\n autoFocus\n selected={value ? new Date(value) : undefined}\n onSelect={(date) => handleChange(date ?? null)}\n />\n </PopoverContent>\n </Popover>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAgBA,SAAgB,iBAAmD,EACjE,cACA,QACA,YACA,SACA,WACA,UACA,gBACA,YACA,GAAG,SACmC;CACtC,MAAM,CAAC,MAAM,WAAW,MAAM,SAAS,MAAM;CAE7C,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;
|
|
1
|
+
{"version":3,"file":"date-picker.client.mjs","names":["Calendar"],"sources":["../../../../src/modules/inline-edit/components/date-picker.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { CalendarIcon } from \"lucide-react\";\nimport React, { type ComponentProps } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Calendar } from \"@/components/ui/calendar.client\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/ui/popover.client\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { formatDate } from \"@/lib/utils/format\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\ntype InlineEditDatePickerProps<Required extends boolean> = ComponentProps<typeof Button> &\n useInlineEditOptions<Date, Required> &\n InlineEditVariantsProps;\n\nexport function InlineDatePicker<Required extends boolean = false>({\n initialValue,\n action,\n permission,\n variant,\n className,\n disabled,\n updateStrategy,\n isRequired,\n ...props\n}: InlineEditDatePickerProps<Required>) {\n const [open, setOpen] = React.useState(false);\n\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <Popover\n open={open}\n onOpenChange={(open) => {\n setOpen(open);\n if (!open && value) handleBlur(value);\n }}\n >\n <PopoverTrigger asChild>\n <Button\n {...props}\n type=\"button\"\n variant=\"outline\"\n className={cn(\"w-full\", inlineEditVariants({ variant, status }), className)}\n disabled={disabled || !isAllowed}\n >\n <CalendarIcon className=\"mr-2 h-4 w-4\" />\n {value ? formatDate(value) : <span>Kies een datum</span>}\n </Button>\n </PopoverTrigger>\n\n <PopoverContent className=\"w-auto p-0\">\n <Calendar\n mode=\"single\"\n autoFocus\n selected={value ? new Date(value) : undefined}\n onSelect={(date) => handleChange(date ?? null)}\n />\n </PopoverContent>\n </Popover>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAgBA,SAAgB,iBAAmD,EACjE,cACA,QACA,YACA,SACA,WACA,UACA,gBACA,YACA,GAAG,SACmC;CACtC,MAAM,CAAC,MAAM,WAAW,MAAM,SAAS,MAAM;CAE7C,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,qBAAC;EACO;EACN,eAAe,SAAS;AACtB,WAAQ,KAAK;AACb,OAAI,CAAC,QAAQ,MAAO,YAAW,MAAM;;aAGvC,oBAAC;GAAe;aACd,qBAAC;IACC,GAAI;IACJ,MAAK;IACL,SAAQ;IACR,WAAW,GAAG,UAAU,mBAAmB;KAAE;KAAS;KAAQ,CAAC,EAAE,UAAU;IAC3E,UAAU,YAAY,CAAC;eAEvB,oBAAC,gBAAa,WAAU,iBAAiB,EACxC,QAAQ,WAAW,MAAM,GAAG,oBAAC,oBAAK,mBAAqB;KACjD;IACM,EAEjB,oBAAC;GAAe,WAAU;aACxB,oBAACA;IACC,MAAK;IACL;IACA,UAAU,QAAQ,IAAI,KAAK,MAAM,GAAG;IACpC,WAAW,SAAS,aAAa,QAAQ,KAAK;KAC9C;IACa;GACT"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DateTimeInput } from "../../../components/ui/input-date-time.mjs";
|
|
1
|
+
import { DateTimeInput } from "../../../components/ui/input-date-time.client.mjs";
|
|
2
2
|
import { useInlineEditOptions } from "../hooks/use-inline.client.mjs";
|
|
3
3
|
import { InlineEditVariantsProps } from "../lib/variants.mjs";
|
|
4
4
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-time.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/date-time.client.tsx"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"date-time.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/date-time.client.tsx"],"mappings":";;;;;;;iBASgB,mBAAA,kCAAA,CAAA;EACd,YAAA;EACA,MAAA;EACA,UAAA;EACA,OAAA;EACA,SAAA;EACA,cAAA;EACA,UAAA;EACA,QAAA;EAAA,GACG;AAAA,GACF,cAAA,QAAsB,aAAA,IACvB,oBAAA,CAAqB,IAAA,EAAM,QAAA,IAC3B,uBAAA,GAAuB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { cn } from "../../../lib/utils/cn.mjs";
|
|
4
|
-
import { DateTimeInput } from "../../../components/ui/input-date-time.mjs";
|
|
4
|
+
import { DateTimeInput } from "../../../components/ui/input-date-time.client.mjs";
|
|
5
5
|
import { useInlineEdit } from "../hooks/use-inline.client.mjs";
|
|
6
6
|
import { inlineEditVariants } from "../lib/variants.mjs";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
import { format } from "date-fns";
|
|
8
9
|
|
|
9
10
|
//#region src/modules/inline-edit/components/date-time.client.tsx
|
|
10
11
|
function InlineDateTimeInput({ initialValue, action, permission, variant, className, updateStrategy, isRequired, disabled, ...props }) {
|
|
@@ -13,7 +14,11 @@ function InlineDateTimeInput({ initialValue, action, permission, variant, classN
|
|
|
13
14
|
action,
|
|
14
15
|
permission,
|
|
15
16
|
updateStrategy,
|
|
16
|
-
isRequired
|
|
17
|
+
isRequired,
|
|
18
|
+
parser: {
|
|
19
|
+
decode: (value) => value instanceof Date ? format(value, "yyyy-MM-dd'T'HH:mm") : typeof value === "string" ? value : void 0,
|
|
20
|
+
encode: (value) => value ? new Date(value) : null
|
|
21
|
+
}
|
|
17
22
|
});
|
|
18
23
|
return /* @__PURE__ */ jsx(DateTimeInput, {
|
|
19
24
|
value: value ?? void 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-time.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/date-time.client.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport { DateTimeInput } from \"@/components/ui/input-date-time\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\nexport function InlineDateTimeInput<Required extends boolean = false>({\n initialValue,\n action,\n permission,\n variant,\n className,\n updateStrategy,\n isRequired,\n disabled,\n ...props\n}: ComponentProps<typeof DateTimeInput> &\n useInlineEditOptions<Date, Required> &\n InlineEditVariantsProps) {\n const { value, handleChange, handleBlur, status, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n });\n\n return (\n <DateTimeInput\n value={value ?? undefined}\n className={cn(inlineEditVariants({ variant, status }), className)}\n disabled={disabled || !isAllowed}\n onValueChange={(date) => handleChange(date ?? null)}\n onValueBlur={(date) => handleBlur(date ?? null)}\n {...props}\n />\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"date-time.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/date-time.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { format } from \"date-fns\";\nimport type { ComponentProps } from \"react\";\nimport { DateTimeInput } from \"@/components/ui/input-date-time.client\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\nexport function InlineDateTimeInput<Required extends boolean = false>({\n initialValue,\n action,\n permission,\n variant,\n className,\n updateStrategy,\n isRequired,\n disabled,\n ...props\n}: ComponentProps<typeof DateTimeInput> &\n useInlineEditOptions<Date, Required> &\n InlineEditVariantsProps) {\n const { value, handleChange, handleBlur, status, isAllowed } = useInlineEdit<\n string,\n Date,\n Required\n >({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) =>\n (value instanceof Date\n ? format(value, \"yyyy-MM-dd'T'HH:mm\")\n : typeof value === \"string\"\n ? value\n : undefined) as string,\n encode: (value) => (value ? new Date(value) : null) as Date,\n },\n });\n\n return (\n <DateTimeInput\n value={value ?? undefined}\n className={cn(inlineEditVariants({ variant, status }), className)}\n disabled={disabled || !isAllowed}\n onValueChange={(date) => handleChange(date ?? null)}\n onValueBlur={(date) => handleBlur(date ?? null)}\n {...props}\n />\n );\n}\n"],"mappings":";;;;;;;;;;AASA,SAAgB,oBAAsD,EACpE,cACA,QACA,YACA,SACA,WACA,gBACA,YACA,UACA,GAAG,SAGsB;CACzB,MAAM,EAAE,OAAO,cAAc,YAAY,QAAQ,cAAc,cAI7D;EACA;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UACN,iBAAiB,OACd,OAAO,OAAO,qBAAqB,GACnC,OAAO,UAAU,WACf,QACA;GACR,SAAS,UAAW,QAAQ,IAAI,KAAK,MAAM,GAAG;GAC/C;EACF,CAAC;AAEF,QACE,oBAAC;EACC,OAAO,SAAS;EAChB,WAAW,GAAG,mBAAmB;GAAE;GAAS;GAAQ,CAAC,EAAE,UAAU;EACjE,UAAU,YAAY,CAAC;EACvB,gBAAgB,SAAS,aAAa,QAAQ,KAAK;EACnD,cAAc,SAAS,WAAW,QAAQ,KAAK;EAC/C,GAAI;GACJ"}
|
|
@@ -13,7 +13,11 @@ function InlineEditor({ initialValue, action, extensions, variant, disabled, per
|
|
|
13
13
|
action,
|
|
14
14
|
permission,
|
|
15
15
|
updateStrategy,
|
|
16
|
-
isRequired
|
|
16
|
+
isRequired,
|
|
17
|
+
parser: {
|
|
18
|
+
decode: (value) => value,
|
|
19
|
+
encode: (value) => value
|
|
20
|
+
}
|
|
17
21
|
});
|
|
18
22
|
return /* @__PURE__ */ jsx(Editor, {
|
|
19
23
|
value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/editor.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Editor, type EditorProps } from \"@/components/editor/components/editor.client\";\nimport type { EditorJSONContent } from \"@/components/editor/lib/types\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\nexport type InlineEditorProps<Required extends boolean = false> = useInlineEditOptions<\n EditorJSONContent,\n Required\n> &\n InlineEditVariantsProps &\n Omit<EditorProps, \"value\" | \"onUpdate\" | \"onBlur\" | \"variant\">;\n\nexport function InlineEditor<Required extends boolean = false>({\n initialValue,\n action,\n extensions,\n variant,\n disabled,\n permission,\n updateStrategy,\n isRequired,\n className,\n children,\n}: InlineEditorProps<Required>) {\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n });\n\n return (\n <Editor\n value={value}\n extensions={extensions}\n onUpdate={(value) => handleChange(value)}\n onBlur={(value) => handleBlur(value)}\n className={cn(inlineEditVariants({ variant, status }), className)}\n disabled={disabled || !isAllowed}\n variant={variant}\n >\n {children}\n </Editor>\n );\n}\n"],"mappings":";;;;;;;;;AAeA,SAAgB,aAA+C,EAC7D,cACA,QACA,YACA,SACA,UACA,YACA,gBACA,YACA,WACA,YAC8B;CAC9B,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;
|
|
1
|
+
{"version":3,"file":"editor.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/editor.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Editor, type EditorProps } from \"@/components/editor/components/editor.client\";\nimport type { EditorJSONContent } from \"@/components/editor/lib/types\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\nexport type InlineEditorProps<Required extends boolean = false> = useInlineEditOptions<\n EditorJSONContent,\n Required\n> &\n InlineEditVariantsProps &\n Omit<EditorProps, \"value\" | \"onUpdate\" | \"onBlur\" | \"variant\">;\n\nexport function InlineEditor<Required extends boolean = false>({\n initialValue,\n action,\n extensions,\n variant,\n disabled,\n permission,\n updateStrategy,\n isRequired,\n className,\n children,\n}: InlineEditorProps<Required>) {\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <Editor\n value={value}\n extensions={extensions}\n onUpdate={(value) => handleChange(value)}\n onBlur={(value) => handleBlur(value)}\n className={cn(inlineEditVariants({ variant, status }), className)}\n disabled={disabled || !isAllowed}\n variant={variant}\n >\n {children}\n </Editor>\n );\n}\n"],"mappings":";;;;;;;;;AAeA,SAAgB,aAA+C,EAC7D,cACA,QACA,YACA,SACA,UACA,YACA,gBACA,YACA,WACA,YAC8B;CAC9B,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,oBAAC;EACQ;EACK;EACZ,WAAW,UAAU,aAAa,MAAM;EACxC,SAAS,UAAU,WAAW,MAAM;EACpC,WAAW,GAAG,mBAAmB;GAAE;GAAS;GAAQ,CAAC,EAAE,UAAU;EACjE,UAAU,YAAY,CAAC;EACd;EAER;GACM"}
|
|
@@ -16,7 +16,11 @@ function InlineRecipientInput({ initialValue, action, variant, disabled, contact
|
|
|
16
16
|
action,
|
|
17
17
|
permission,
|
|
18
18
|
updateStrategy,
|
|
19
|
-
isRequired
|
|
19
|
+
isRequired,
|
|
20
|
+
parser: {
|
|
21
|
+
decode: (value) => value,
|
|
22
|
+
encode: (value) => value
|
|
23
|
+
}
|
|
20
24
|
});
|
|
21
25
|
return /* @__PURE__ */ jsx(RecipientInput, {
|
|
22
26
|
...props,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-recipient.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/input-recipient.client.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport { type Contact, RecipientInput } from \"@/components/ui/input-recipient\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\ntype InlineRecipientInputProps<Required extends boolean = false> = Omit<\n ComponentProps<typeof RecipientInput>,\n \"value\" | \"onChange\"\n> &\n useInlineEditOptions<string[], Required> &\n InlineEditVariantsProps & {\n contacts: Contact[];\n };\n\n/**\n * The inline edit recipient input component.\n */\nexport function InlineRecipientInput<Required extends boolean = false>({\n initialValue,\n action,\n variant,\n disabled,\n contacts,\n permission,\n updateStrategy,\n isRequired,\n className,\n ...props\n}: InlineRecipientInputProps<Required>) {\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n });\n\n return (\n <RecipientInput\n {...props}\n contacts={contacts}\n value={value ?? []}\n onChange={(newValue) => {\n handleChange(newValue);\n handleBlur(newValue);\n }}\n disabled={disabled || !isAllowed}\n className={cn(inlineEditVariants({ variant, status }), className)}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;AAoBA,SAAgB,qBAAuD,EACrE,cACA,QACA,SACA,UACA,UACA,YACA,gBACA,YACA,WACA,GAAG,SACmC;CACtC,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;
|
|
1
|
+
{"version":3,"file":"input-recipient.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/input-recipient.client.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport { type Contact, RecipientInput } from \"@/components/ui/input-recipient\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\ntype InlineRecipientInputProps<Required extends boolean = false> = Omit<\n ComponentProps<typeof RecipientInput>,\n \"value\" | \"onChange\"\n> &\n useInlineEditOptions<string[], Required> &\n InlineEditVariantsProps & {\n contacts: Contact[];\n };\n\n/**\n * The inline edit recipient input component.\n */\nexport function InlineRecipientInput<Required extends boolean = false>({\n initialValue,\n action,\n variant,\n disabled,\n contacts,\n permission,\n updateStrategy,\n isRequired,\n className,\n ...props\n}: InlineRecipientInputProps<Required>) {\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <RecipientInput\n {...props}\n contacts={contacts}\n value={value ?? []}\n onChange={(newValue) => {\n handleChange(newValue);\n handleBlur(newValue);\n }}\n disabled={disabled || !isAllowed}\n className={cn(inlineEditVariants({ variant, status }), className)}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;AAoBA,SAAgB,qBAAuD,EACrE,cACA,QACA,SACA,UACA,UACA,YACA,gBACA,YACA,WACA,GAAG,SACmC;CACtC,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,oBAAC;EACC,GAAI;EACM;EACV,OAAO,SAAS,EAAE;EAClB,WAAW,aAAa;AACtB,gBAAa,SAAS;AACtB,cAAW,SAAS;;EAEtB,UAAU,YAAY,CAAC;EACvB,WAAW,GAAG,mBAAmB;GAAE;GAAS;GAAQ,CAAC,EAAE,UAAU;GACjE"}
|
|
@@ -16,7 +16,11 @@ function InlineStringInputToggle({ initialValue, action, disabled, permission, u
|
|
|
16
16
|
action,
|
|
17
17
|
permission,
|
|
18
18
|
updateStrategy,
|
|
19
|
-
isRequired
|
|
19
|
+
isRequired,
|
|
20
|
+
parser: {
|
|
21
|
+
decode: (value) => value,
|
|
22
|
+
encode: (value) => value
|
|
23
|
+
}
|
|
20
24
|
});
|
|
21
25
|
function handleToggle() {
|
|
22
26
|
setEnabled(!enabled);
|
|
@@ -33,12 +37,12 @@ function InlineStringInputToggle({ initialValue, action, disabled, permission, u
|
|
|
33
37
|
disabled: isDisabled,
|
|
34
38
|
onChange: (e) => handleChange(e.target.value ? e.target.value : null),
|
|
35
39
|
onBlur: (e) => handleBlur(e.target.value ? e.target.value : null),
|
|
36
|
-
className: cn("border-border/70 hover:border-border
|
|
40
|
+
className: cn("w-full border-border/70 hover:border-border", className)
|
|
37
41
|
}), /* @__PURE__ */ jsx(Button, {
|
|
38
42
|
variant: "ghost",
|
|
39
43
|
onClick: handleToggle,
|
|
40
44
|
tabIndex: -1,
|
|
41
|
-
className: cn("absolute
|
|
45
|
+
className: cn("absolute top-0 right-0 bottom-0 opacity-50", !value && "text-muted-foreground"),
|
|
42
46
|
children: enabled ? /* @__PURE__ */ jsx(CheckIcon, {}) : /* @__PURE__ */ jsx(XIcon, {})
|
|
43
47
|
})]
|
|
44
48
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-toggle.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/input-toggle.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { CheckIcon, XIcon } from \"lucide-react\";\nimport { type ComponentProps, useState } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Input } from \"@/components/ui/input\";\nimport { cn } from \"@/lib/entry\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\n\ntype InlineStringInputToggleProps<Required extends boolean = false> = Omit<\n ComponentProps<typeof Input>,\n \"type\"\n> &\n useInlineEditOptions<string, Required>;\n\nexport function InlineStringInputToggle<Required extends boolean>({\n initialValue,\n action,\n disabled,\n permission,\n updateStrategy,\n isRequired,\n className,\n ...props\n}: InlineStringInputToggleProps<Required>) {\n const [enabled, setEnabled] = useState(!!initialValue);\n\n const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n });\n\n function handleToggle() {\n setEnabled(!enabled);\n if (!enabled) return;\n\n handleBlur(null);\n }\n\n const isDisabled = !enabled || disabled || !isAllowed;\n\n return (\n <div className=\"relative\">\n <Input\n {...props}\n type=\"text\"\n value={value ?? undefined}\n disabled={isDisabled}\n onChange={(e) => handleChange(e.target.value ? e.target.value : null)}\n onBlur={(e) => handleBlur(e.target.value ? e.target.value : null)}\n className={cn(\"border-border/70 hover:border-border
|
|
1
|
+
{"version":3,"file":"input-toggle.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/input-toggle.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { CheckIcon, XIcon } from \"lucide-react\";\nimport { type ComponentProps, useState } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Input } from \"@/components/ui/input\";\nimport { cn } from \"@/lib/entry\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\n\ntype InlineStringInputToggleProps<Required extends boolean = false> = Omit<\n ComponentProps<typeof Input>,\n \"type\"\n> &\n useInlineEditOptions<string, Required>;\n\nexport function InlineStringInputToggle<Required extends boolean>({\n initialValue,\n action,\n disabled,\n permission,\n updateStrategy,\n isRequired,\n className,\n ...props\n}: InlineStringInputToggleProps<Required>) {\n const [enabled, setEnabled] = useState(!!initialValue);\n\n const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n function handleToggle() {\n setEnabled(!enabled);\n if (!enabled) return;\n\n handleBlur(null);\n }\n\n const isDisabled = !enabled || disabled || !isAllowed;\n\n return (\n <div className=\"relative\">\n <Input\n {...props}\n type=\"text\"\n value={value ?? undefined}\n disabled={isDisabled}\n onChange={(e) => handleChange(e.target.value ? e.target.value : null)}\n onBlur={(e) => handleBlur(e.target.value ? e.target.value : null)}\n className={cn(\"w-full border-border/70 hover:border-border\", className)}\n />\n\n <Button\n variant=\"ghost\"\n onClick={handleToggle}\n tabIndex={-1}\n className={cn(\n \"absolute top-0 right-0 bottom-0 opacity-50\",\n !value && \"text-muted-foreground\",\n )}\n >\n {enabled ? <CheckIcon /> : <XIcon />}\n </Button>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAeA,SAAgB,wBAAkD,EAChE,cACA,QACA,UACA,YACA,gBACA,YACA,WACA,GAAG,SACsC;CACzC,MAAM,CAAC,SAAS,cAAc,SAAS,CAAC,CAAC,aAAa;CAEtD,MAAM,EAAE,OAAO,cAAc,YAAY,cAAc,cAAc;EACnE;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;CAEF,SAAS,eAAe;AACtB,aAAW,CAAC,QAAQ;AACpB,MAAI,CAAC,QAAS;AAEd,aAAW,KAAK;;CAGlB,MAAM,aAAa,CAAC,WAAW,YAAY,CAAC;AAE5C,QACE,qBAAC;EAAI,WAAU;aACb,oBAAC;GACC,GAAI;GACJ,MAAK;GACL,OAAO,SAAS;GAChB,UAAU;GACV,WAAW,MAAM,aAAa,EAAE,OAAO,QAAQ,EAAE,OAAO,QAAQ,KAAK;GACrE,SAAS,MAAM,WAAW,EAAE,OAAO,QAAQ,EAAE,OAAO,QAAQ,KAAK;GACjE,WAAW,GAAG,+CAA+C,UAAU;IACvE,EAEF,oBAAC;GACC,SAAQ;GACR,SAAS;GACT,UAAU;GACV,WAAW,GACT,8CACA,CAAC,SAAS,wBACX;aAEA,UAAU,oBAAC,cAAY,GAAG,oBAAC,UAAQ;IAC7B;GACL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/input.client.tsx"],"mappings":";;;;;;;KAQK,oBAAA,6CAAiE,IAAA,CACpE,cAAA,QAAsB,KAAA,aAGtB,oBAAA,CAAqB,MAAA,EAAQ,QAAA,IAC7B,uBAAA;;;AAPiF;iBAYnE,iBAAA,kCAAA,CAAA;EACd,YAAA;EACA,MAAA;EACA,OAAA;EACA,SAAA;EACA,UAAA;EACA,cAAA;EACA,UAAA;EACA,QAAA;EAAA,GACG;AAAA,GACF,oBAAA,SAA6B,QAAA,IAAS,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"input.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/input.client.tsx"],"mappings":";;;;;;;KAQK,oBAAA,6CAAiE,IAAA,CACpE,cAAA,QAAsB,KAAA,aAGtB,oBAAA,CAAqB,MAAA,EAAQ,QAAA,IAC7B,uBAAA;;;AAPiF;iBAYnE,iBAAA,kCAAA,CAAA;EACd,YAAA;EACA,MAAA;EACA,OAAA;EACA,SAAA;EACA,UAAA;EACA,cAAA;EACA,UAAA;EACA,QAAA;EAAA,GACG;AAAA,GACF,oBAAA,SAA6B,QAAA,IAAS,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAoCzB,iBAAA,kCAAA,CAAA;EACd,YAAA;EACA,MAAA;EACA,OAAA;EACA,SAAA;EACA,UAAA;EACA,cAAA;EACA,UAAA;EACA,QAAA;EAAA,GACG;AAAA,GACF,oBAAA,SAA6B,QAAA,IAAS,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;iBAiCzB,kBAAA,CAAA;EACd,YAAA;EACA,MAAA;EACA,OAAA;EACA,SAAA;EACA,UAAA;EACA,cAAA;EACA,UAAA;EACA,QAAA;EAAA,GACG;AAAA,GACF,oBAAA,WAA4B,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -16,7 +16,11 @@ function InlineStringInput({ initialValue, action, variant, className, permissio
|
|
|
16
16
|
action,
|
|
17
17
|
permission,
|
|
18
18
|
updateStrategy,
|
|
19
|
-
isRequired
|
|
19
|
+
isRequired,
|
|
20
|
+
parser: {
|
|
21
|
+
decode: (value) => value,
|
|
22
|
+
encode: (value) => value
|
|
23
|
+
}
|
|
20
24
|
});
|
|
21
25
|
return /* @__PURE__ */ jsx(Input, {
|
|
22
26
|
...props,
|
|
@@ -25,7 +29,7 @@ function InlineStringInput({ initialValue, action, variant, className, permissio
|
|
|
25
29
|
disabled: disabled || !isAllowed,
|
|
26
30
|
onChange: (e) => handleChange(e.target.value ? e.target.value : null),
|
|
27
31
|
onBlur: (e) => handleBlur(e.target.value ? e.target.value : null),
|
|
28
|
-
className: cn("border-border/70 hover:border-border
|
|
32
|
+
className: cn("w-full border-border/70 hover:border-border", inlineEditVariants({
|
|
29
33
|
variant,
|
|
30
34
|
status
|
|
31
35
|
}), className)
|
|
@@ -41,7 +45,11 @@ function InlineNumberInput({ initialValue, action, variant, className, permissio
|
|
|
41
45
|
action,
|
|
42
46
|
permission,
|
|
43
47
|
updateStrategy,
|
|
44
|
-
isRequired
|
|
48
|
+
isRequired,
|
|
49
|
+
parser: {
|
|
50
|
+
decode: (value) => value,
|
|
51
|
+
encode: (value) => value
|
|
52
|
+
}
|
|
45
53
|
});
|
|
46
54
|
return /* @__PURE__ */ jsx(Input, {
|
|
47
55
|
...props,
|
|
@@ -50,7 +58,7 @@ function InlineNumberInput({ initialValue, action, variant, className, permissio
|
|
|
50
58
|
disabled: disabled || !isAllowed,
|
|
51
59
|
onChange: (e) => handleChange(parseValueAsNumber(e.target.valueAsNumber)),
|
|
52
60
|
onBlur: (e) => handleBlur(parseValueAsNumber(e.target.valueAsNumber)),
|
|
53
|
-
className: cn("border-border/70 hover:border-border
|
|
61
|
+
className: cn("w-full border-border/70 hover:border-border", inlineEditVariants({
|
|
54
62
|
variant,
|
|
55
63
|
status
|
|
56
64
|
}), className)
|
|
@@ -65,7 +73,11 @@ function InlineDecimalInput({ initialValue, action, variant, className, permissi
|
|
|
65
73
|
action,
|
|
66
74
|
permission,
|
|
67
75
|
updateStrategy,
|
|
68
|
-
isRequired
|
|
76
|
+
isRequired,
|
|
77
|
+
parser: {
|
|
78
|
+
decode: (value) => value,
|
|
79
|
+
encode: (value) => value
|
|
80
|
+
}
|
|
69
81
|
});
|
|
70
82
|
return /* @__PURE__ */ jsx(Input, {
|
|
71
83
|
...props,
|
|
@@ -74,7 +86,7 @@ function InlineDecimalInput({ initialValue, action, variant, className, permissi
|
|
|
74
86
|
disabled: disabled || !isAllowed,
|
|
75
87
|
onChange: (e) => handleChange(e.target.value ? e.target.value : null),
|
|
76
88
|
onBlur: (e) => handleBlur(e.target.value ? e.target.value : null),
|
|
77
|
-
className: cn("border-border/70 hover:border-border
|
|
89
|
+
className: cn("w-full border-border/70 hover:border-border", inlineEditVariants({
|
|
78
90
|
variant,
|
|
79
91
|
status
|
|
80
92
|
}), className)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/input.client.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport { Input } from \"@/components/ui/input\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\ntype InlineEditInputProps<TValue, Required extends boolean = false> = Omit<\n ComponentProps<typeof Input>,\n \"type\"\n> &\n useInlineEditOptions<TValue, Required> &\n InlineEditVariantsProps;\n\n/**\n * The inline edit string input component.\n */\nexport function InlineStringInput<Required extends boolean = false>({\n initialValue,\n action,\n variant,\n className,\n permission,\n updateStrategy,\n isRequired,\n disabled,\n ...props\n}: InlineEditInputProps<string, Required>) {\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n });\n\n return (\n <Input\n {...props}\n type=\"text\"\n value={value ?? undefined}\n disabled={disabled || !isAllowed}\n onChange={(e) => handleChange(e.target.value ? e.target.value : null)}\n onBlur={(e) => handleBlur(e.target.value ? e.target.value : null)}\n className={cn(\n \"border-border/70 hover:border-border
|
|
1
|
+
{"version":3,"file":"input.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/input.client.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport { Input } from \"@/components/ui/input\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\ntype InlineEditInputProps<TValue, Required extends boolean = false> = Omit<\n ComponentProps<typeof Input>,\n \"type\"\n> &\n useInlineEditOptions<TValue, Required> &\n InlineEditVariantsProps;\n\n/**\n * The inline edit string input component.\n */\nexport function InlineStringInput<Required extends boolean = false>({\n initialValue,\n action,\n variant,\n className,\n permission,\n updateStrategy,\n isRequired,\n disabled,\n ...props\n}: InlineEditInputProps<string, Required>) {\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <Input\n {...props}\n type=\"text\"\n value={value ?? undefined}\n disabled={disabled || !isAllowed}\n onChange={(e) => handleChange(e.target.value ? e.target.value : null)}\n onBlur={(e) => handleBlur(e.target.value ? e.target.value : null)}\n className={cn(\n \"w-full border-border/70 hover:border-border\",\n inlineEditVariants({ variant, status }),\n className,\n )}\n />\n );\n}\n\n/**\n * The inline edit number input component.\n */\nconst parseValueAsNumber = (valueAsNumber: number): number | null =>\n !Number.isNaN(Number(valueAsNumber)) ? valueAsNumber : null;\n\nexport function InlineNumberInput<Required extends boolean = false>({\n initialValue,\n action,\n variant,\n className,\n permission,\n updateStrategy,\n isRequired,\n disabled,\n ...props\n}: InlineEditInputProps<number, Required>) {\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <Input\n {...props}\n type=\"number\"\n value={value ?? undefined}\n disabled={disabled || !isAllowed}\n onChange={(e) => handleChange(parseValueAsNumber(e.target.valueAsNumber))}\n onBlur={(e) => handleBlur(parseValueAsNumber(e.target.valueAsNumber))}\n className={cn(\n \"w-full border-border/70 hover:border-border\",\n inlineEditVariants({ variant, status }),\n className,\n )}\n />\n );\n}\n\n/**\n * The inline edit decimal input component.\n */\nexport function InlineDecimalInput({\n initialValue,\n action,\n variant,\n className,\n permission,\n updateStrategy,\n isRequired,\n disabled,\n ...props\n}: InlineEditInputProps<string>) {\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <Input\n {...props}\n type=\"number\"\n value={value ?? undefined}\n disabled={disabled || !isAllowed}\n onChange={(e) => handleChange(e.target.value ? e.target.value : null)}\n onBlur={(e) => handleBlur(e.target.value ? e.target.value : null)}\n className={cn(\n \"w-full border-border/70 hover:border-border\",\n inlineEditVariants({ variant, status }),\n className,\n )}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;AAkBA,SAAgB,kBAAoD,EAClE,cACA,QACA,SACA,WACA,YACA,gBACA,YACA,UACA,GAAG,SACsC;CACzC,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,oBAAC;EACC,GAAI;EACJ,MAAK;EACL,OAAO,SAAS;EAChB,UAAU,YAAY,CAAC;EACvB,WAAW,MAAM,aAAa,EAAE,OAAO,QAAQ,EAAE,OAAO,QAAQ,KAAK;EACrE,SAAS,MAAM,WAAW,EAAE,OAAO,QAAQ,EAAE,OAAO,QAAQ,KAAK;EACjE,WAAW,GACT,+CACA,mBAAmB;GAAE;GAAS;GAAQ,CAAC,EACvC,UACD;GACD;;;;;AAON,MAAM,sBAAsB,kBAC1B,CAAC,OAAO,MAAM,OAAO,cAAc,CAAC,GAAG,gBAAgB;AAEzD,SAAgB,kBAAoD,EAClE,cACA,QACA,SACA,WACA,YACA,gBACA,YACA,UACA,GAAG,SACsC;CACzC,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,oBAAC;EACC,GAAI;EACJ,MAAK;EACL,OAAO,SAAS;EAChB,UAAU,YAAY,CAAC;EACvB,WAAW,MAAM,aAAa,mBAAmB,EAAE,OAAO,cAAc,CAAC;EACzE,SAAS,MAAM,WAAW,mBAAmB,EAAE,OAAO,cAAc,CAAC;EACrE,WAAW,GACT,+CACA,mBAAmB;GAAE;GAAS;GAAQ,CAAC,EACvC,UACD;GACD;;;;;AAON,SAAgB,mBAAmB,EACjC,cACA,QACA,SACA,WACA,YACA,gBACA,YACA,UACA,GAAG,SAC4B;CAC/B,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,oBAAC;EACC,GAAI;EACJ,MAAK;EACL,OAAO,SAAS;EAChB,UAAU,YAAY,CAAC;EACvB,WAAW,MAAM,aAAa,EAAE,OAAO,QAAQ,EAAE,OAAO,QAAQ,KAAK;EACrE,SAAS,MAAM,WAAW,EAAE,OAAO,QAAQ,EAAE,OAAO,QAAQ,KAAK;EACjE,WAAW,GACT,+CACA,mBAAmB;GAAE;GAAS;GAAQ,CAAC,EACvC,UACD;GACD"}
|