@alfakit/vue 0.1.2 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/AlfakitRoot.js.map +1 -1
- package/dist/AlfakitRoot.vue.d.ts.map +1 -1
- package/dist/AlfakitRoot.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/AlfakitRoot.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/actions/ActionGroupMenu.js.map +1 -1
- package/dist/components/actions/ActionGroupMenu.vue.d.ts.map +1 -1
- package/dist/components/actions/ActionGroupMenu.vue_vue_type_script_setup_true_lang.js +69 -65
- package/dist/components/actions/ActionGroupMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/actions/ActionModal.js.map +1 -1
- package/dist/components/actions/ActionModal.vue.d.ts.map +1 -1
- package/dist/components/actions/ActionModal.vue_vue_type_script_setup_true_lang.js +17 -15
- package/dist/components/actions/ActionModal.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ai/AiCopilot.js.map +1 -1
- package/dist/components/ai/AiCopilot.vue.d.ts +2 -0
- package/dist/components/ai/AiCopilot.vue.d.ts.map +1 -1
- package/dist/components/ai/AiCopilot.vue_vue_type_script_setup_true_lang.js +7 -2
- package/dist/components/ai/AiCopilot.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/cms/CmsPage.vue_vue_type_script_setup_true_lang.js +19 -19
- package/dist/components/cms/CmsPage.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/cms/LivePreview.js.map +1 -1
- package/dist/components/cms/LivePreview.vue.d.ts.map +1 -1
- package/dist/components/cms/LivePreview.vue_vue_type_script_setup_true_lang.js +83 -83
- package/dist/components/cms/LivePreview.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/fields/BuilderField.js.map +1 -1
- package/dist/components/fields/BuilderField.vue.d.ts.map +1 -1
- package/dist/components/fields/BuilderField.vue_vue_type_script_setup_true_lang.js +162 -157
- package/dist/components/fields/BuilderField.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/fields/ImageEditorDialog.js.map +1 -1
- package/dist/components/fields/ImageEditorDialog.vue.d.ts.map +1 -1
- package/dist/components/fields/ImageEditorDialog.vue_vue_type_script_setup_true_lang.js +46 -46
- package/dist/components/fields/ImageEditorDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/fields/KeyValueField.js.map +1 -1
- package/dist/components/fields/KeyValueField.vue.d.ts.map +1 -1
- package/dist/components/fields/KeyValueField.vue_vue_type_script_setup_true_lang.js +66 -66
- package/dist/components/fields/KeyValueField.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/fields/ModalTablePicker.js.map +1 -1
- package/dist/components/fields/ModalTablePicker.vue.d.ts.map +1 -1
- package/dist/components/fields/ModalTablePicker.vue_vue_type_script_setup_true_lang.js +113 -113
- package/dist/components/fields/ModalTablePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/fields/RepeaterField.js.map +1 -1
- package/dist/components/fields/RepeaterField.vue.d.ts.map +1 -1
- package/dist/components/fields/RepeaterField.vue_vue_type_script_setup_true_lang.js +12 -12
- package/dist/components/fields/RepeaterField.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/fields/RichEditorInput.js.map +1 -1
- package/dist/components/fields/RichEditorInput.vue.d.ts.map +1 -1
- package/dist/components/fields/RichEditorInput.vue_vue_type_script_setup_true_lang.js +166 -165
- package/dist/components/fields/RichEditorInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/fields/SliderField.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/fields/item-actions.d.ts +2 -2
- package/dist/components/fields/item-actions.d.ts.map +1 -1
- package/dist/components/fields/item-actions.js +31 -31
- package/dist/components/fields/item-actions.js.map +1 -1
- package/dist/components/form/FormBlock.js.map +1 -1
- package/dist/components/form/FormBlock.vue.d.ts.map +1 -1
- package/dist/components/form/FormBlock.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/form/FormBlock.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/form/form-context.js +25 -25
- package/dist/components/form/form-context.js.map +1 -1
- package/dist/components/kanban/KanbanBoard.js.map +1 -1
- package/dist/components/kanban/KanbanBoard.vue.d.ts.map +1 -1
- package/dist/components/kanban/KanbanBoard.vue_vue_type_script_setup_true_lang.js +5 -2
- package/dist/components/kanban/KanbanBoard.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/kanban/KanbanColumnHeader.js.map +1 -1
- package/dist/components/kanban/KanbanColumnHeader.vue.d.ts.map +1 -1
- package/dist/components/kanban/KanbanColumnHeader.vue_vue_type_script_setup_true_lang.js +64 -64
- package/dist/components/kanban/KanbanColumnHeader.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/layout/SectionComponent.js.map +1 -1
- package/dist/components/layout/SectionComponent.vue.d.ts.map +1 -1
- package/dist/components/layout/SectionComponent.vue_vue_type_script_setup_true_lang.js +23 -23
- package/dist/components/layout/SectionComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/panel/DebugPanel.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/components/panel/DebugPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/panel/GlobalSearchPalette.js.map +1 -1
- package/dist/components/panel/GlobalSearchPalette.vue.d.ts.map +1 -1
- package/dist/components/panel/GlobalSearchPalette.vue_vue_type_script_setup_true_lang.js +102 -96
- package/dist/components/panel/GlobalSearchPalette.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/panel/NavGroup.vue_vue_type_script_setup_true_lang.js +10 -10
- package/dist/components/panel/NavGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/panel/NavGroupFlyout.vue_vue_type_script_setup_true_lang.js +9 -9
- package/dist/components/panel/NavGroupFlyout.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/panel/NavItem.vue_vue_type_script_setup_true_lang.js +16 -16
- package/dist/components/panel/NavItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/panel/NavSubItem.vue_vue_type_script_setup_true_lang.js +10 -10
- package/dist/components/panel/NavSubItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/panel/TenantMenu.vue_vue_type_script_setup_true_lang.js +35 -35
- package/dist/components/panel/TenantMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/panel/Topbar.vue_vue_type_script_setup_true_lang.js +11 -11
- package/dist/components/panel/Topbar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/realtime/use-live-updates.d.ts.map +1 -1
- package/dist/components/realtime/use-live-updates.js +24 -23
- package/dist/components/realtime/use-live-updates.js.map +1 -1
- package/dist/components/table/BooleanCell.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/table/BooleanCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/table/ColumnHeader.js.map +1 -1
- package/dist/components/table/ColumnHeader.vue.d.ts.map +1 -1
- package/dist/components/table/ColumnHeader.vue_vue_type_script_setup_true_lang.js +55 -49
- package/dist/components/table/ColumnHeader.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/table/ColumnManager.js.map +1 -1
- package/dist/components/table/ColumnManager.vue.d.ts.map +1 -1
- package/dist/components/table/ColumnManager.vue_vue_type_script_setup_true_lang.js +5 -4
- package/dist/components/table/ColumnManager.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/table/ContentLayoutSort.js.map +1 -1
- package/dist/components/table/ContentLayoutSort.vue.d.ts.map +1 -1
- package/dist/components/table/ContentLayoutSort.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/components/table/ContentLayoutSort.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/table/SelectCell.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/table/SelectCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/table/SelectComboboxCell.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/table/SelectComboboxCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/table/TableCellContent.js.map +1 -1
- package/dist/components/table/TableCellContent.vue.d.ts.map +1 -1
- package/dist/components/table/TableCellContent.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/components/table/TableCellContent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/table/TablePagination.js.map +1 -1
- package/dist/components/table/TablePagination.vue.d.ts.map +1 -1
- package/dist/components/table/TablePagination.vue_vue_type_script_setup_true_lang.js +87 -87
- package/dist/components/table/TablePagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/table/TextInputCell.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/table/TextInputCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/table/cell-update.d.ts +6 -0
- package/dist/components/table/cell-update.d.ts.map +1 -1
- package/dist/components/table/cell-update.js.map +1 -1
- package/dist/components/translation-manager/TranslationManagerView.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/translation-manager/TranslationManagerView.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ui/CommandAutoHighlight.js +7 -0
- package/dist/components/ui/CommandAutoHighlight.js.map +1 -0
- package/dist/components/ui/CommandAutoHighlight.vue.d.ts +21 -0
- package/dist/components/ui/CommandAutoHighlight.vue.d.ts.map +1 -0
- package/dist/components/ui/CommandAutoHighlight.vue_vue_type_script_setup_true_lang.js +18 -0
- package/dist/components/ui/CommandAutoHighlight.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/ui/DialogContent.js.map +1 -1
- package/dist/components/ui/DialogContent.vue.d.ts.map +1 -1
- package/dist/components/ui/DialogContent.vue_vue_type_script_setup_true_lang.js +13 -12
- package/dist/components/ui/DialogContent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ui/PopoverContent.js.map +1 -1
- package/dist/components/ui/PopoverContent.vue.d.ts.map +1 -1
- package/dist/components/ui/PopoverContent.vue_vue_type_script_setup_true_lang.js +9 -8
- package/dist/components/ui/PopoverContent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ui/SheetContent.js.map +1 -1
- package/dist/components/ui/SheetContent.vue.d.ts.map +1 -1
- package/dist/components/ui/SheetContent.vue_vue_type_script_setup_true_lang.js +13 -12
- package/dist/components/ui/SheetContent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ui/TooltipContent.js.map +1 -1
- package/dist/components/ui/TooltipContent.vue.d.ts.map +1 -1
- package/dist/components/ui/TooltipContent.vue_vue_type_script_setup_true_lang.js +9 -8
- package/dist/components/ui/TooltipContent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/context.d.ts +7 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +29 -26
- package/dist/context.js.map +1 -1
- package/dist/create-alfakit.d.ts.map +1 -1
- package/dist/create-alfakit.js +33 -31
- package/dist/create-alfakit.js.map +1 -1
- package/dist/eject-manifest.json +11 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +219 -217
- package/dist/layouts/AppLayout.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/layouts/AppLayout.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/layouts/AuthLayout.vue_vue_type_script_setup_true_lang.js +9 -9
- package/dist/layouts/FullscreenLayout.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/layouts/FullscreenLayout.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/layouts/TopNavLayout.vue_vue_type_script_setup_true_lang.js +15 -15
- package/dist/layouts/TopNavLayout.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/layouts/lazy-layouts.d.ts +10 -0
- package/dist/layouts/lazy-layouts.d.ts.map +1 -0
- package/dist/layouts/lazy-layouts.js +8 -0
- package/dist/layouts/lazy-layouts.js.map +1 -0
- package/dist/layouts/panel-layouts.d.ts +8 -0
- package/dist/layouts/panel-layouts.d.ts.map +1 -0
- package/dist/layouts/panel-layouts.js +15 -0
- package/dist/layouts/panel-layouts.js.map +1 -0
- package/dist/lib/lazy.d.ts.map +1 -1
- package/dist/lib/lazy.js +2 -2
- package/dist/lib/lazy.js.map +1 -1
- package/dist/pages/PageShell.js.map +1 -1
- package/dist/pages/PageShell.vue.d.ts.map +1 -1
- package/dist/pages/PageShell.vue_vue_type_script_setup_true_lang.js +39 -42
- package/dist/pages/PageShell.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/standalone/AlfakitComponent.js.map +1 -1
- package/dist/standalone/AlfakitComponent.vue.d.ts.map +1 -1
- package/dist/standalone/AlfakitComponent.vue_vue_type_script_setup_true_lang.js +56 -52
- package/dist/standalone/AlfakitComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/standalone.css +7 -0
- package/dist/starter-kit/AlfakitStarterKitRoot.js.map +1 -1
- package/dist/starter-kit/AlfakitStarterKitRoot.vue.d.ts +2 -2
- package/dist/starter-kit/AlfakitStarterKitRoot.vue.d.ts.map +1 -1
- package/dist/starter-kit/AlfakitStarterKitRoot.vue_vue_type_script_setup_true_lang.js +17 -12
- package/dist/starter-kit/AlfakitStarterKitRoot.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/starter-kit/dashboard-widgets.d.ts +54 -0
- package/dist/starter-kit/dashboard-widgets.d.ts.map +1 -0
- package/dist/starter-kit/dashboard-widgets.js +54 -0
- package/dist/starter-kit/dashboard-widgets.js.map +1 -0
- package/dist/starter-kit/index.d.ts +2 -1
- package/dist/starter-kit/index.d.ts.map +1 -1
- package/dist/starter-kit/index.js +5 -4
- package/dist/starter-kit/runtime.d.ts +6 -0
- package/dist/starter-kit/runtime.d.ts.map +1 -1
- package/dist/starter-kit/runtime.js +19 -15
- package/dist/starter-kit/runtime.js.map +1 -1
- package/dist/starter-kit/starter-kit.d.ts.map +1 -1
- package/dist/starter-kit/starter-kit.js +8 -8
- package/dist/starter-kit/starter-kit.js.map +1 -1
- package/dist/starter-kit/widgets/CopilotTrigger.js +7 -0
- package/dist/starter-kit/widgets/CopilotTrigger.js.map +1 -0
- package/dist/starter-kit/widgets/CopilotTrigger.vue.d.ts +12 -0
- package/dist/starter-kit/widgets/CopilotTrigger.vue.d.ts.map +1 -0
- package/dist/starter-kit/widgets/CopilotTrigger.vue_vue_type_script_setup_true_lang.js +23 -0
- package/dist/starter-kit/widgets/CopilotTrigger.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/starter-kit/widgets/LoadedCopilot.js +7 -0
- package/dist/starter-kit/widgets/LoadedCopilot.js.map +1 -0
- package/dist/starter-kit/widgets/LoadedCopilot.vue.d.ts +8 -0
- package/dist/starter-kit/widgets/LoadedCopilot.vue.d.ts.map +1 -0
- package/dist/starter-kit/widgets/LoadedCopilot.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/starter-kit/widgets/LoadedCopilot.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/starter-kit/widgets/StarterKitImpersonationBanner.js +7 -0
- package/dist/starter-kit/widgets/StarterKitImpersonationBanner.js.map +1 -0
- package/dist/starter-kit/widgets/StarterKitImpersonationBanner.vue.d.ts +8 -0
- package/dist/starter-kit/widgets/StarterKitImpersonationBanner.vue.d.ts.map +1 -0
- package/dist/starter-kit/widgets/StarterKitImpersonationBanner.vue_vue_type_script_setup_true_lang.js +34 -0
- package/dist/starter-kit/widgets/StarterKitImpersonationBanner.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/starter-kit/widgets/index.d.ts +40 -9
- package/dist/starter-kit/widgets/index.d.ts.map +1 -1
- package/dist/starter-kit/widgets/index.js +21 -18
- package/dist/starter-kit/widgets/index.js.map +1 -1
- package/dist/starter-kit/widgets/loaded.d.ts +10 -0
- package/dist/starter-kit/widgets/loaded.d.ts.map +1 -0
- package/dist/starter-kit/widgets/loaded.js +5 -0
- package/dist/styles.css +9 -2
- package/dist/themes.css +6 -1
- package/package.json +2 -2
- package/src/AlfakitRoot.vue +9 -1
- package/src/components/actions/ActionGroupMenu.vue +13 -1
- package/src/components/actions/ActionModal.vue +9 -0
- package/src/components/ai/AiCopilot.vue +7 -1
- package/src/components/cms/LivePreview.vue +8 -2
- package/src/components/fields/BuilderField.vue +15 -2
- package/src/components/fields/ImageEditorDialog.vue +7 -3
- package/src/components/fields/KeyValueField.vue +3 -2
- package/src/components/fields/ModalTablePicker.vue +7 -2
- package/src/components/fields/RepeaterField.vue +2 -3
- package/src/components/fields/RichEditorInput.vue +3 -0
- package/src/components/fields/item-actions.ts +31 -10
- package/src/components/form/FormBlock.vue +2 -1
- package/src/components/form/form-context.ts +2 -2
- package/src/components/kanban/KanbanBoard.vue +15 -3
- package/src/components/kanban/KanbanColumnHeader.vue +6 -4
- package/src/components/layout/SectionComponent.vue +10 -4
- package/src/components/panel/GlobalSearchPalette.vue +2 -0
- package/src/components/realtime/use-live-updates.ts +3 -1
- package/src/components/table/ColumnHeader.vue +23 -12
- package/src/components/table/ColumnManager.vue +12 -8
- package/src/components/table/ContentLayoutSort.vue +7 -1
- package/src/components/table/TableCellContent.vue +4 -2
- package/src/components/table/TablePagination.vue +12 -7
- package/src/components/table/cell-update.ts +6 -0
- package/src/components/ui/CommandAutoHighlight.vue +27 -0
- package/src/components/ui/DialogContent.vue +5 -1
- package/src/components/ui/PopoverContent.vue +5 -1
- package/src/components/ui/SheetContent.vue +5 -1
- package/src/components/ui/TooltipContent.vue +5 -1
- package/src/context.ts +10 -0
- package/src/create-alfakit.ts +5 -0
- package/src/index.ts +2 -0
- package/src/layouts/lazy-layouts.ts +14 -0
- package/src/layouts/panel-layouts.ts +17 -0
- package/src/lib/lazy.ts +11 -1
- package/src/pages/PageShell.vue +5 -6
- package/src/standalone/AlfakitComponent.vue +17 -6
- package/src/starter-kit/AlfakitStarterKitRoot.vue +12 -3
- package/src/starter-kit/dashboard-widgets.ts +93 -0
- package/src/starter-kit/index.ts +7 -1
- package/src/starter-kit/runtime.ts +17 -1
- package/src/starter-kit/starter-kit.ts +2 -1
- package/src/starter-kit/widgets/CopilotTrigger.vue +58 -0
- package/src/starter-kit/widgets/LoadedCopilot.vue +29 -0
- package/src/starter-kit/widgets/StarterKitImpersonationBanner.vue +57 -0
- package/src/starter-kit/widgets/index.ts +56 -11
- package/src/starter-kit/widgets/loaded.ts +9 -0
- package/src/styles.css +9 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageShell.vue_vue_type_script_setup_true_lang.js","names":["
|
|
1
|
+
{"version":3,"file":"PageShell.vue_vue_type_script_setup_true_lang.js","names":["BlankLayout","ConflictBanner","_openBlock","_createBlock","_resolveDynamicComponent","_withCtx","_renderSlot","_createVNode","KeyboardShortcuts","Slot","PageHeader","_createCommentVNode","SubNavigationLayout","Slot_default","KeyboardShortcuts_default","BlankLayout_default","SubNavigationLayout_default","ConflictBanner_default","PageHeader_default","PageShell_vue_vue_type_script_setup_true_lang_default","props","__props","registry","useRegistry","Auth","computed","Blank","Fullscreen","App","Conflicts","undoBodyAttributes","watch","applyBodyAttributes","onBeforeUnmount","openBlock","createBlock","resolveDynamicComponent","withCtx","renderSlot","_ctx","createVNode","createCommentVNode"],"sources":["../../src/pages/PageShell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { PageSchema } from '@alfakit/core'\nimport { applyBodyAttributes } from '@alfakit/core'\nimport { computed, onBeforeUnmount, watch } from 'vue'\nimport KeyboardShortcuts from '../components/panel/KeyboardShortcuts.vue'\nimport Slot from '../components/panel/Slot.vue'\nimport { useRegistry } from '../context'\nimport BlankLayout from '../layouts/BlankLayout.vue'\nimport SubNavigationLayout from '../components/panel/SubNavigationLayout.vue'\nimport ConflictBanner from '../components/realtime/ConflictBanner.vue'\nimport PageHeader from './PageHeader.vue'\n\nconst props = defineProps<{ page: PageSchema }>()\nconst registry = useRegistry()\n\n// Each layout can be replaced: createAlfakit({ components: { 'layout:app': MyLayout } }).\n// `createAlfakit()` registers the panel's layouts (`panelLayouts`), the starter kit its content\n// layout; importing the panel layouts here would put the sidebar in every starter kit page.\nconst Auth = computed(() => registry.resolve('layout:auth') ?? BlankLayout)\nconst Blank = computed(() => registry.resolve('layout:blank') ?? BlankLayout)\nconst Fullscreen = computed(() => registry.resolve('layout:fullscreen') ?? BlankLayout)\nconst App = computed(() => registry.resolve('layout:app') ?? BlankLayout)\n// Edit pages: somebody else saved the record (`detectConflicts()`, `Panel::realtime()`).\nconst Conflicts = computed(() => registry.resolve('page:conflict-banner') ?? ConflictBanner)\n\n// The page's `$extraBodyAttributes` on `<body>` while it is open.\nlet undoBodyAttributes = () => {}\nwatch(\n () => JSON.stringify(props.page.extraBodyAttributes ?? null),\n () => {\n undoBodyAttributes()\n undoBodyAttributes = applyBodyAttributes(props.page.extraBodyAttributes)\n },\n { immediate: true },\n)\nonBeforeUnmount(() => undoBodyAttributes())\n</script>\n\n<template>\n <component\n :is=\"Auth\"\n v-if=\"props.page.layout === 'auth'\"\n :heading=\"props.page.heading ?? props.page.title\"\n :subheading=\"props.page.subheading\"\n :page=\"props.page\"\n >\n <slot />\n </component>\n <component :is=\"Blank\" v-else-if=\"props.page.layout === 'blank'\" :page=\"props.page\">\n <slot />\n </component>\n <component :is=\"Fullscreen\" v-else-if=\"props.page.layout === 'fullscreen'\" :page=\"props.page\">\n <slot />\n </component>\n <component\n :is=\"App\"\n v-else\n :breadcrumbs=\"props.page.breadcrumbs\"\n :max-content-width=\"props.page.maxContentWidth\"\n :page=\"props.page\"\n >\n <!-- `?` overlay, `/`, `g d` and panel command shortcuts (`keyboardShortcuts()`). -->\n <KeyboardShortcuts />\n <Slot name=\"page.start\" />\n <PageHeader :page=\"props.page\" />\n <component :is=\"Conflicts\" v-if=\"props.page.conflicts\" :page=\"props.page\" />\n <SubNavigationLayout v-if=\"props.page.subNavigation\" :navigation=\"props.page.subNavigation\">\n <slot />\n </SubNavigationLayout>\n <slot v-else />\n <Slot name=\"page.end\" />\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;EAYA,IAAMoB,IAAQC,GACRC,IAAWC,EAAY,GAKvBC,IAAOC,QAAeH,EAAS,QAAQ,aAAa,KAAKtB,CAAW,GACpE0B,IAAQD,QAAeH,EAAS,QAAQ,cAAc,KAAKtB,CAAW,GACtE2B,IAAaF,QAAeH,EAAS,QAAQ,mBAAmB,KAAKtB,CAAW,GAChF4B,IAAMH,QAAeH,EAAS,QAAQ,YAAY,KAAKtB,CAAW,GAElE6B,IAAYJ,QAAeH,EAAS,QAAQ,sBAAsB,KAAKrB,CAAc,GAGvF6B,UAA2B,CAAC;SAChCC,QACQ,KAAK,UAAUX,EAAM,KAAK,uBAAuB,IAAI,SACrD;GAEJ,AADAU,EAAmB,GACnB,IAAqBE,EAAoBZ,EAAM,KAAK,mBAAmB;EACzE,GACA,EAAE,WAAW,GAAK,CACpB,GACAa,QAAsBH,EAAmB,CAAC,aAMhCV,EAAM,KAAK,WAAM,UAFzBlB,EAAA,GAAAC,EAQYC,EAPLoB,EAAA,KAAI,GAAA;;GAER,SAASJ,EAAM,KAAK,WAAWA,EAAM,KAAK;GAC1C,YAAYA,EAAM,KAAK;GACvB,MAAMA,EAAM;;GAEb,SAAAf,QAAQ,CAARC,EAAQiC,EAAA,QAAA,SAAA,CAAA,CAAA;;;;;;EAEwB,CAAA,KAAAnB,EAAM,KAAK,WAAM,WAAnDlB,EAAA,GAAAC,EAEYC,EAFIsB,EAAA,KAAK,GAAA;;GAA6C,MAAMN,EAAM;;GAC5E,SAAAf,QAAQ,CAARC,EAAQiC,EAAA,QAAA,SAAA,CAAA,CAAA;;EAE6B,GAAA,GAAA,CAAA,MAAA,CAAA,KAAAnB,EAAM,KAAK,WAAM,gBAAxDlB,EAAA,GAAAC,EAEYC,EAFIuB,EAAA,KAAU,GAAA;;GAAkD,MAAMP,EAAM;;GACtF,SAAAf,QAAQ,CAARC,EAAQiC,EAAA,QAAA,SAAA,CAAA,CAAA;;EAEVrC,GAAAA,GAAAA,CAAAA,MAAAA,CAAAA,MAAAA,EAAA,GAAAC,EAiBYC,EAhBLwB,EAAA,KAAG,GAAA;;GAEP,aAAaR,EAAM,KAAK;GACxB,qBAAmBA,EAAM,KAAK;GAC9B,MAAMA,EAAM;;GAGb,SAAAf,QAAqB;IAArBE,EAAqBC,CAAA;IACrBD,EAA0BE,GAAA,EAApB,MAAK,aAAY,CAAA;IACvBF,EAAiCG,GAAA,EAApB,MAAMU,EAAM,KAAA,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA;IACQA,EAAM,KAAK,aAA5ClB,EAAA,GAAAC,EAA4EC,EAA5DyB,EAAA,KAAS,GAAA;;KAA+B,MAAMT,EAAM;;IACzCA,EAAM,KAAK,iBAAtClB,EAAA,GAAAC,EAEsBS,GAAA;;KAFgC,YAAYQ,EAAM,KAAK;;KAC3E,SAAAf,QAAQ,CAARC,EAAQiC,EAAA,QAAA,SAAA,CAAA,CAAA;;IAEVjC,GAAAA,GAAAA,CAAAA,YAAAA,CAAAA,KAAAA,EAAeiC,EAAA,QAAA,WAAA,CAAA,GAAA,KAAA,GAAA,KAAA,GAAA,CAAA;IACfhC,EAAwBE,GAAA,EAAlB,MAAK,WAAU,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlfakitComponent.js","names":["_sfc_main","AlfakitComponent_vue_vue_type_script_setup_true_lang_default","AlfakitComponent_default"],"sources":["../../src/standalone/AlfakitComponent.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n StandaloneComponentState,\n findStandalonePropName,\n registerStandaloneProp,\n standalonePanelSchema,\n type ContentBlock,\n type StandaloneComponentSchema,\n} from '@alfakit/core'\nimport { usePage } from '@inertiajs/vue3'\nimport { ConfigProvider } from 'reka-ui'\nimport { computed, onMounted, onScopeDispose, provide, ref, watch, type HTMLAttributes } from 'vue'\nimport { providePageActionContext } from '../components/actions/action-context'\nimport ActionList from '../components/actions/ActionList.vue'\nimport ActionModals from '../components/actions/ActionModals.vue'\nimport TooltipProvider from '../components/ui/TooltipProvider.vue'\nimport {\n ALFAKIT_KEY,\n provideStandalone,\n useOptionalAlfakit,\n type AlfakitContextValue,\n type AnyComponent,\n} from '../context'\nimport { cn } from '../lib/utils'\nimport ContentBlockRenderer from '../pages/ContentBlockRenderer.vue'\nimport AlfakitToaster from './AlfakitToaster.vue'\nimport {\n claimToaster,\n createStandaloneContext,\n createStandaloneRegistry,\n ensureStandaloneRuntime,\n hasToaster,\n} from './runtime'\n\n/**\n * Renders an Alfakit component outside a panel: a form, table, infolist, widgets or any mix\n * (`AlfaSix\\Alfakit\\Standalone\\*`) in any Inertia page of the application. Needs no\n * `createAlfakit()` and no panel layout: it provides its own translator, registry, action\n * runner and modals, and inherits the application's shadcn tokens.\n *\n * ```vue\n * <AlfakitComponent :component=\"orders\" class=\"max-w-4xl\" />\n * ```\n *\n * Slots: `header` (above the content blocks), `footer` (below), and the default slot to\n * render the blocks yourself: `<template #default=\"{ blocks }\">…<ContentBlockRenderer :block=\"…\" />`.\n */\nconst props = defineProps<{\n /** The payload: `ContactForm::make()` passed as an Inertia prop. */\n component: StandaloneComponentSchema\n /** Renderer overrides for this instance (`{ TextInput: MyInput }`), on top of `configureAlfakit()`. */\n components?: Record<string, AnyComponent>\n class?: HTMLAttributes['class']\n}>()\n\ndefineSlots<{\n header?: () => unknown\n footer?: () => unknown\n default?: (props: { blocks: ContentBlock[]; page: StandaloneComponentSchema }) => unknown\n}>()\n\nconst parent = useOptionalAlfakit()\nconst inertiaPage = usePage()\n\n// Lazy and polled schemas of this component, merged into the page it renders.\nconst version = ref(0)\nconst state = new StandaloneComponentState(props.component, () => version.value++)\nconst poll = (target: string, interval: string | number | null | undefined) =>\n state.poll(target, interval)\n\nconst context: AlfakitContextValue = parent\n ? {
|
|
1
|
+
{"version":3,"file":"AlfakitComponent.js","names":["_sfc_main","AlfakitComponent_vue_vue_type_script_setup_true_lang_default","AlfakitComponent_default"],"sources":["../../src/standalone/AlfakitComponent.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n StandaloneComponentState,\n findStandalonePropName,\n registerStandaloneProp,\n standalonePanelSchema,\n type ContentBlock,\n type StandaloneComponentSchema,\n} from '@alfakit/core'\nimport { usePage } from '@inertiajs/vue3'\nimport { ConfigProvider } from 'reka-ui'\nimport { computed, onMounted, onScopeDispose, provide, ref, watch, type HTMLAttributes } from 'vue'\nimport { providePageActionContext } from '../components/actions/action-context'\nimport ActionList from '../components/actions/ActionList.vue'\nimport ActionModals from '../components/actions/ActionModals.vue'\nimport TooltipProvider from '../components/ui/TooltipProvider.vue'\nimport {\n ALFAKIT_KEY,\n provideStandalone,\n useOptionalAlfakit,\n type AlfakitContextValue,\n type AnyComponent,\n} from '../context'\nimport { cn } from '../lib/utils'\nimport ContentBlockRenderer from '../pages/ContentBlockRenderer.vue'\nimport AlfakitToaster from './AlfakitToaster.vue'\nimport {\n claimToaster,\n createStandaloneContext,\n createStandaloneRegistry,\n ensureStandaloneRuntime,\n hasToaster,\n} from './runtime'\n\n/**\n * Renders an Alfakit component outside a panel: a form, table, infolist, widgets or any mix\n * (`AlfaSix\\Alfakit\\Standalone\\*`) in any Inertia page of the application. Needs no\n * `createAlfakit()` and no panel layout: it provides its own translator, registry, action\n * runner and modals, and inherits the application's shadcn tokens.\n *\n * ```vue\n * <AlfakitComponent :component=\"orders\" class=\"max-w-4xl\" />\n * ```\n *\n * Slots: `header` (above the content blocks), `footer` (below), and the default slot to\n * render the blocks yourself: `<template #default=\"{ blocks }\">…<ContentBlockRenderer :block=\"…\" />`.\n */\nconst props = defineProps<{\n /** The payload: `ContactForm::make()` passed as an Inertia prop. */\n component: StandaloneComponentSchema\n /** Renderer overrides for this instance (`{ TextInput: MyInput }`), on top of `configureAlfakit()`. */\n components?: Record<string, AnyComponent>\n class?: HTMLAttributes['class']\n}>()\n\ndefineSlots<{\n header?: () => unknown\n footer?: () => unknown\n default?: (props: { blocks: ContentBlock[]; page: StandaloneComponentSchema }) => unknown\n}>()\n\nconst parent = useOptionalAlfakit()\nconst inertiaPage = usePage()\n\n// Lazy and polled schemas of this component, merged into the page it renders.\nconst version = ref(0)\nconst state = new StandaloneComponentState(props.component, () => version.value++)\nconst poll = (target: string, interval: string | number | null | undefined) =>\n state.poll(target, interval)\nconst refresh = (targets: string[]) => state.refresh(targets)\n\nconst context: AlfakitContextValue = parent\n ? {\n ...parent,\n registry: createStandaloneRegistry(props.components, parent.registry),\n poll,\n refresh,\n }\n : {\n ...createStandaloneContext(\n { action: props.component.endpoints.action, modal: props.component.endpoints.modal },\n props.components,\n poll,\n ),\n refresh,\n }\n\nprovide(ALFAKIT_KEY, context)\n\nconst panel = computed(() => standalonePanelSchema(props.component))\nconst page = computed(() => {\n void version.value\n state.setComponent(props.component)\n\n return state.page\n})\nconst direction = computed(() => props.component.localization?.direction ?? 'ltr')\nconst actionContext = computed(() => ({ token: props.component.token, component: 'page' }))\n\nprovideStandalone({ panel, page })\nprovidePageActionContext(actionContext.value)\n\n// Endpoints and strings follow the latest payload (they change per locale or path).\nwatch(\n () => props.component,\n (component) => {\n context.actions.setEndpoints({\n action: component.endpoints.action,\n modal: component.endpoints.modal,\n })\n\n // Inside `createAlfakit()` the panel feeds the shared translator; on a page without the\n // `alfakit` prop (the rest of the app) the component's own translations apply.\n if (!parent || !(inertiaPage.props as Record<string, unknown>).alfakit) {\n context.translator.setTranslations(component.translations ?? {})\n context.translator.setLocale(component.localization?.tag ?? 'en')\n }\n },\n { immediate: true, flush: 'sync' },\n)\n\n// Toasts: use the layout's <AlfakitToaster /> when there is one, else the first component\n// on the page renders one (checked after every component mounted).\nconst ownsToaster = ref(false)\n\nonMounted(() => {\n ensureStandaloneRuntime()\n\n // Partial reloads (sorting, paging, inline edits) request this component's own prop.\n watch(\n () => findStandalonePropName(inertiaPage.props as Record<string, unknown>, props.component),\n (name, _old, onCleanup) => onCleanup(registerStandaloneProp(name ?? null)),\n { immediate: true },\n )\n\n // The watcher runs before the new payload renders: hand it over, or the response would\n // count as stale and lazy widgets (a calendar after its action) keep their old schema.\n watch(\n () => props.component.token,\n () => void state.loadLazy(props.component),\n { immediate: true },\n )\n\n if (parent) return\n\n let release: (() => void) | null = null\n let cancelled = false\n\n queueMicrotask(() => {\n if (cancelled || hasToaster()) return\n\n release = claimToaster()\n ownsToaster.value = true\n })\n\n onScopeDispose(() => {\n cancelled = true\n release?.()\n })\n})\n</script>\n\n<template>\n <component\n :is=\"parent ? 'div' : ConfigProvider\"\n :dir=\"parent ? undefined : direction\"\n :class=\"parent ? 'contents' : undefined\"\n >\n <TooltipProvider :delay-duration=\"0\">\n <div\n data-slot=\"standalone\"\n :data-alfakit-component=\"props.component.class\"\n :dir=\"direction\"\n :class=\"cn('flex flex-col gap-6', props.class)\"\n >\n <header\n v-if=\"page.heading || page.headerActions?.length\"\n data-slot=\"page-header\"\n class=\"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between\"\n >\n <div class=\"min-w-0\">\n <h2 v-if=\"page.heading\" class=\"text-xl font-semibold tracking-tight\">\n {{ page.heading }}\n </h2>\n <p v-if=\"page.subheading\" class=\"text-muted-foreground mt-1 text-sm\">\n {{ page.subheading }}\n </p>\n </div>\n <ActionList\n v-if=\"page.headerActions && page.headerActions.length > 0\"\n :actions=\"page.headerActions\"\n :context=\"actionContext\"\n align=\"end\"\n class=\"max-w-full shrink-0\"\n />\n </header>\n <slot name=\"header\" />\n <slot :blocks=\"page.content\" :page=\"props.component\">\n <ContentBlockRenderer v-for=\"block in page.content\" :key=\"block.key\" :block=\"block\" />\n </slot>\n <slot name=\"footer\" />\n </div>\n <ActionModals />\n <AlfakitToaster v-if=\"ownsToaster\" claimed />\n </TooltipProvider>\n </component>\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlfakitComponent.vue.d.ts","sourceRoot":"","sources":["../../src/standalone/AlfakitComponent.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AlfakitComponent.vue.d.ts","sourceRoot":"","sources":["../../src/standalone/AlfakitComponent.vue"],"names":[],"mappings":"AAiNA,OAAO,EAKL,KAAK,YAAY,EACjB,KAAK,yBAAyB,EAC/B,MAAM,eAAe,CAAA;AAGtB,OAAO,EAA4D,KAAK,cAAc,EAAE,MAAM,KAAK,CAAA;AAKnG,OAAO,EAKL,KAAK,YAAY,EAClB,MAAM,YAAY,CAAA;AAYnB;;;;;;;;;;;;GAYG;AACH,KAAK,WAAW,GAAG;IACjB,oEAAoE;IACpE,SAAS,EAAE,yBAAyB,CAAA;IACpC,uGAAuG;IACvG,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IACzC,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAA;CAChC,CAAC;AAGF,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,MAAM,OAAO,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,OAAO,CAAA;IACtB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE,YAAY,EAAE,CAAC;QAAC,IAAI,EAAE,yBAAyB,CAAA;KAAE,KAAK,OAAO,CAAA;CAC1F,CAAC;AAkQF,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { ALFAKIT_KEY as e, provideStandalone as t, useOptionalAlfakit as n } from "../context.js";
|
|
2
|
-
import { providePageActionContext as
|
|
3
|
-
import { cn as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
2
|
+
import { providePageActionContext as r } from "../components/actions/action-context.js";
|
|
3
|
+
import { cn as i } from "../lib/utils.js";
|
|
4
|
+
import a from "../components/actions/ActionList.js";
|
|
5
|
+
import ee from "../pages/ContentBlockRenderer.js";
|
|
6
6
|
import o from "../components/actions/ActionModals.js";
|
|
7
7
|
import s from "../components/ui/TooltipProvider.js";
|
|
8
8
|
import { claimToaster as c, createStandaloneContext as l, createStandaloneRegistry as u, ensureStandaloneRuntime as d, hasToaster as f } from "./runtime.js";
|
|
9
|
-
import
|
|
10
|
-
import { StandaloneComponentState as
|
|
11
|
-
import { usePage as
|
|
12
|
-
import { Fragment as
|
|
13
|
-
import { ConfigProvider as
|
|
9
|
+
import te from "./AlfakitToaster.js";
|
|
10
|
+
import { StandaloneComponentState as ne, findStandalonePropName as p, registerStandaloneProp as m, standalonePanelSchema as h } from "@alfakit/core";
|
|
11
|
+
import { usePage as g } from "@inertiajs/vue3";
|
|
12
|
+
import { Fragment as _, computed as v, createBlock as y, createCommentVNode as b, createElementBlock as x, createElementVNode as S, createVNode as C, defineComponent as w, normalizeClass as T, onMounted as re, onScopeDispose as ie, openBlock as E, provide as D, ref as O, renderList as k, renderSlot as A, resolveDynamicComponent as j, toDisplayString as M, unref as N, watch as P, withCtx as F } from "vue";
|
|
13
|
+
import { ConfigProvider as I } from "reka-ui";
|
|
14
14
|
//#region src/standalone/AlfakitComponent.vue?vue&type=script&setup=true&lang.ts
|
|
15
|
-
var
|
|
15
|
+
var L = ["data-alfakit-component", "dir"], R = {
|
|
16
16
|
key: 0,
|
|
17
17
|
"data-slot": "page-header",
|
|
18
18
|
class: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between"
|
|
19
|
-
},
|
|
19
|
+
}, z = { class: "min-w-0" }, B = {
|
|
20
20
|
key: 0,
|
|
21
21
|
class: "text-xl font-semibold tracking-tight"
|
|
22
|
-
},
|
|
22
|
+
}, V = {
|
|
23
23
|
key: 1,
|
|
24
24
|
class: "text-muted-foreground mt-1 text-sm"
|
|
25
|
-
},
|
|
25
|
+
}, H = /*@__PURE__*/ w({
|
|
26
26
|
__name: "AlfakitComponent",
|
|
27
27
|
props: {
|
|
28
28
|
component: {},
|
|
@@ -35,75 +35,79 @@ var R = ["data-alfakit-component", "dir"], z = {
|
|
|
35
35
|
Array
|
|
36
36
|
] }
|
|
37
37
|
},
|
|
38
|
-
setup(
|
|
39
|
-
let
|
|
40
|
-
...
|
|
41
|
-
registry: u(
|
|
42
|
-
poll:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
38
|
+
setup(w) {
|
|
39
|
+
let H = w, U = n(), W = g(), G = O(0), K = new ne(H.component, () => G.value++), q = (e, t) => K.poll(e, t), J = (e) => K.refresh(e), Y = U ? {
|
|
40
|
+
...U,
|
|
41
|
+
registry: u(H.components, U.registry),
|
|
42
|
+
poll: q,
|
|
43
|
+
refresh: J
|
|
44
|
+
} : {
|
|
45
|
+
...l({
|
|
46
|
+
action: H.component.endpoints.action,
|
|
47
|
+
modal: H.component.endpoints.modal
|
|
48
|
+
}, H.components, q),
|
|
49
|
+
refresh: J
|
|
50
|
+
};
|
|
51
|
+
D(e, Y);
|
|
52
|
+
let ae = v(() => h(H.component)), X = v(() => (G.value, K.setComponent(H.component), K.page)), Z = v(() => H.component.localization?.direction ?? "ltr"), Q = v(() => ({
|
|
53
|
+
token: H.component.token,
|
|
50
54
|
component: "page"
|
|
51
55
|
}));
|
|
52
56
|
t({
|
|
53
|
-
panel:
|
|
57
|
+
panel: ae,
|
|
54
58
|
page: X
|
|
55
|
-
}),
|
|
59
|
+
}), r(Q.value), P(() => H.component, (e) => {
|
|
56
60
|
Y.actions.setEndpoints({
|
|
57
61
|
action: e.endpoints.action,
|
|
58
62
|
modal: e.endpoints.modal
|
|
59
|
-
}), (!
|
|
63
|
+
}), (!U || !W.props.alfakit) && (Y.translator.setTranslations(e.translations ?? {}), Y.translator.setLocale(e.localization?.tag ?? "en"));
|
|
60
64
|
}, {
|
|
61
65
|
immediate: !0,
|
|
62
66
|
flush: "sync"
|
|
63
67
|
});
|
|
64
|
-
let $ =
|
|
65
|
-
return
|
|
66
|
-
if (d(),
|
|
68
|
+
let $ = O(!1);
|
|
69
|
+
return re(() => {
|
|
70
|
+
if (d(), P(() => p(W.props, H.component), (e, t, n) => n(m(e ?? null)), { immediate: !0 }), P(() => H.component.token, () => void K.loadLazy(H.component), { immediate: !0 }), U) return;
|
|
67
71
|
let e = null, t = !1;
|
|
68
72
|
queueMicrotask(() => {
|
|
69
73
|
t || f() || (e = c(), $.value = !0);
|
|
70
|
-
}),
|
|
74
|
+
}), ie(() => {
|
|
71
75
|
t = !0, e?.();
|
|
72
76
|
});
|
|
73
|
-
}), (e, t) => (
|
|
74
|
-
dir:
|
|
75
|
-
class:
|
|
77
|
+
}), (e, t) => (E(), y(j(N(U) ? "div" : N(I)), {
|
|
78
|
+
dir: N(U) ? void 0 : Z.value,
|
|
79
|
+
class: T(N(U) ? "contents" : void 0)
|
|
76
80
|
}, {
|
|
77
|
-
default:
|
|
78
|
-
default:
|
|
79
|
-
|
|
81
|
+
default: F(() => [C(s, { "delay-duration": 0 }, {
|
|
82
|
+
default: F(() => [
|
|
83
|
+
S("div", {
|
|
80
84
|
"data-slot": "standalone",
|
|
81
|
-
"data-alfakit-component":
|
|
85
|
+
"data-alfakit-component": H.component.class,
|
|
82
86
|
dir: Z.value,
|
|
83
|
-
class:
|
|
87
|
+
class: T(N(i)("flex flex-col gap-6", H.class))
|
|
84
88
|
}, [
|
|
85
|
-
X.value.heading || X.value.headerActions?.length ? (
|
|
89
|
+
X.value.heading || X.value.headerActions?.length ? (E(), x("header", R, [S("div", z, [X.value.heading ? (E(), x("h2", B, M(X.value.heading), 1)) : b("", !0), X.value.subheading ? (E(), x("p", V, M(X.value.subheading), 1)) : b("", !0)]), X.value.headerActions && X.value.headerActions.length > 0 ? (E(), y(a, {
|
|
86
90
|
key: 0,
|
|
87
91
|
actions: X.value.headerActions,
|
|
88
92
|
context: Q.value,
|
|
89
93
|
align: "end",
|
|
90
94
|
class: "max-w-full shrink-0"
|
|
91
|
-
}, null, 8, ["actions", "context"])) :
|
|
92
|
-
|
|
93
|
-
|
|
95
|
+
}, null, 8, ["actions", "context"])) : b("", !0)])) : b("", !0),
|
|
96
|
+
A(e.$slots, "header"),
|
|
97
|
+
A(e.$slots, "default", {
|
|
94
98
|
blocks: X.value.content,
|
|
95
|
-
page:
|
|
96
|
-
}, () => [(
|
|
99
|
+
page: H.component
|
|
100
|
+
}, () => [(E(!0), x(_, null, k(X.value.content, (e) => (E(), y(ee, {
|
|
97
101
|
key: e.key,
|
|
98
102
|
block: e
|
|
99
103
|
}, null, 8, ["block"]))), 128))]),
|
|
100
|
-
|
|
101
|
-
], 10,
|
|
102
|
-
|
|
103
|
-
$.value ? (
|
|
104
|
+
A(e.$slots, "footer")
|
|
105
|
+
], 10, L),
|
|
106
|
+
C(o),
|
|
107
|
+
$.value ? (E(), y(te, {
|
|
104
108
|
key: 0,
|
|
105
109
|
claimed: ""
|
|
106
|
-
})) :
|
|
110
|
+
})) : b("", !0)
|
|
107
111
|
]),
|
|
108
112
|
_: 3
|
|
109
113
|
})]),
|
|
@@ -112,6 +116,6 @@ var R = ["data-alfakit-component", "dir"], z = {
|
|
|
112
116
|
}
|
|
113
117
|
});
|
|
114
118
|
//#endregion
|
|
115
|
-
export {
|
|
119
|
+
export { H as default };
|
|
116
120
|
|
|
117
121
|
//# sourceMappingURL=AlfakitComponent.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlfakitComponent.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_unref","_normalizeClass","_withCtx","_createVNode","TooltipProvider","_createElementVNode","_createElementBlock","_toDisplayString","_createCommentVNode","ActionList","_renderSlot","_Fragment","_renderList","ContentBlockRenderer","ActionModals","AlfakitToaster","ActionList_default","ContentBlockRenderer_default","ActionModals_default","TooltipProvider_default","AlfakitToaster_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","AlfakitComponent_vue_vue_type_script_setup_true_lang_default","props","__props","parent","useOptionalAlfakit","inertiaPage","usePage","version","ref","state","StandaloneComponentState","poll","target","interval","context","createStandaloneRegistry","createStandaloneContext","ALFAKIT_KEY","panel","computed","standalonePanelSchema","page","direction","actionContext","provideStandalone","providePageActionContext","watch","component","ownsToaster","onMounted","ensureStandaloneRuntime","findStandalonePropName","onCleanup","registerStandaloneProp","name","release","cancelled","hasToaster","claimToaster","onScopeDispose","openBlock","createBlock","resolveDynamicComponent","unref","ConfigProvider","normalizeClass","withCtx","createVNode","createElementVNode","cn","createElementBlock","toDisplayString","createCommentVNode","renderSlot","_ctx","Fragment","renderList","block"],"sources":["../../src/standalone/AlfakitComponent.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n StandaloneComponentState,\n findStandalonePropName,\n registerStandaloneProp,\n standalonePanelSchema,\n type ContentBlock,\n type StandaloneComponentSchema,\n} from '@alfakit/core'\nimport { usePage } from '@inertiajs/vue3'\nimport { ConfigProvider } from 'reka-ui'\nimport { computed, onMounted, onScopeDispose, provide, ref, watch, type HTMLAttributes } from 'vue'\nimport { providePageActionContext } from '../components/actions/action-context'\nimport ActionList from '../components/actions/ActionList.vue'\nimport ActionModals from '../components/actions/ActionModals.vue'\nimport TooltipProvider from '../components/ui/TooltipProvider.vue'\nimport {\n ALFAKIT_KEY,\n provideStandalone,\n useOptionalAlfakit,\n type AlfakitContextValue,\n type AnyComponent,\n} from '../context'\nimport { cn } from '../lib/utils'\nimport ContentBlockRenderer from '../pages/ContentBlockRenderer.vue'\nimport AlfakitToaster from './AlfakitToaster.vue'\nimport {\n claimToaster,\n createStandaloneContext,\n createStandaloneRegistry,\n ensureStandaloneRuntime,\n hasToaster,\n} from './runtime'\n\n/**\n * Renders an Alfakit component outside a panel: a form, table, infolist, widgets or any mix\n * (`AlfaSix\\Alfakit\\Standalone\\*`) in any Inertia page of the application. Needs no\n * `createAlfakit()` and no panel layout: it provides its own translator, registry, action\n * runner and modals, and inherits the application's shadcn tokens.\n *\n * ```vue\n * <AlfakitComponent :component=\"orders\" class=\"max-w-4xl\" />\n * ```\n *\n * Slots: `header` (above the content blocks), `footer` (below), and the default slot to\n * render the blocks yourself: `<template #default=\"{ blocks }\">…<ContentBlockRenderer :block=\"…\" />`.\n */\nconst props = defineProps<{\n /** The payload: `ContactForm::make()` passed as an Inertia prop. */\n component: StandaloneComponentSchema\n /** Renderer overrides for this instance (`{ TextInput: MyInput }`), on top of `configureAlfakit()`. */\n components?: Record<string, AnyComponent>\n class?: HTMLAttributes['class']\n}>()\n\ndefineSlots<{\n header?: () => unknown\n footer?: () => unknown\n default?: (props: { blocks: ContentBlock[]; page: StandaloneComponentSchema }) => unknown\n}>()\n\nconst parent = useOptionalAlfakit()\nconst inertiaPage = usePage()\n\n// Lazy and polled schemas of this component, merged into the page it renders.\nconst version = ref(0)\nconst state = new StandaloneComponentState(props.component, () => version.value++)\nconst poll = (target: string, interval: string | number | null | undefined) =>\n state.poll(target, interval)\n\nconst context: AlfakitContextValue = parent\n ? { ...parent, registry: createStandaloneRegistry(props.components, parent.registry), poll }\n : createStandaloneContext(\n { action: props.component.endpoints.action, modal: props.component.endpoints.modal },\n props.components,\n poll,\n )\n\nprovide(ALFAKIT_KEY, context)\n\nconst panel = computed(() => standalonePanelSchema(props.component))\nconst page = computed(() => {\n void version.value\n state.setComponent(props.component)\n\n return state.page\n})\nconst direction = computed(() => props.component.localization?.direction ?? 'ltr')\nconst actionContext = computed(() => ({ token: props.component.token, component: 'page' }))\n\nprovideStandalone({ panel, page })\nprovidePageActionContext(actionContext.value)\n\n// Endpoints and strings follow the latest payload (they change per locale or path).\nwatch(\n () => props.component,\n (component) => {\n context.actions.setEndpoints({\n action: component.endpoints.action,\n modal: component.endpoints.modal,\n })\n\n // Inside `createAlfakit()` the panel feeds the shared translator; on a page without the\n // `alfakit` prop (the rest of the app) the component's own translations apply.\n if (!parent || !(inertiaPage.props as Record<string, unknown>).alfakit) {\n context.translator.setTranslations(component.translations ?? {})\n context.translator.setLocale(component.localization?.tag ?? 'en')\n }\n },\n { immediate: true, flush: 'sync' },\n)\n\n// Toasts: use the layout's <AlfakitToaster /> when there is one, else the first component\n// on the page renders one (checked after every component mounted).\nconst ownsToaster = ref(false)\n\nonMounted(() => {\n ensureStandaloneRuntime()\n\n // Partial reloads (sorting, paging, inline edits) request this component's own prop.\n watch(\n () => findStandalonePropName(inertiaPage.props as Record<string, unknown>, props.component),\n (name, _old, onCleanup) => onCleanup(registerStandaloneProp(name ?? null)),\n { immediate: true },\n )\n\n watch(\n () => props.component.token,\n () => void state.loadLazy(),\n { immediate: true },\n )\n\n if (parent) return\n\n let release: (() => void) | null = null\n let cancelled = false\n\n queueMicrotask(() => {\n if (cancelled || hasToaster()) return\n\n release = claimToaster()\n ownsToaster.value = true\n })\n\n onScopeDispose(() => {\n cancelled = true\n release?.()\n })\n})\n</script>\n\n<template>\n <component\n :is=\"parent ? 'div' : ConfigProvider\"\n :dir=\"parent ? undefined : direction\"\n :class=\"parent ? 'contents' : undefined\"\n >\n <TooltipProvider :delay-duration=\"0\">\n <div\n data-slot=\"standalone\"\n :data-alfakit-component=\"props.component.class\"\n :dir=\"direction\"\n :class=\"cn('flex flex-col gap-6', props.class)\"\n >\n <header\n v-if=\"page.heading || page.headerActions?.length\"\n data-slot=\"page-header\"\n class=\"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between\"\n >\n <div class=\"min-w-0\">\n <h2 v-if=\"page.heading\" class=\"text-xl font-semibold tracking-tight\">\n {{ page.heading }}\n </h2>\n <p v-if=\"page.subheading\" class=\"text-muted-foreground mt-1 text-sm\">\n {{ page.subheading }}\n </p>\n </div>\n <ActionList\n v-if=\"page.headerActions && page.headerActions.length > 0\"\n :actions=\"page.headerActions\"\n :context=\"actionContext\"\n align=\"end\"\n class=\"max-w-full shrink-0\"\n />\n </header>\n <slot name=\"header\" />\n <slot :blocks=\"page.content\" :page=\"props.component\">\n <ContentBlockRenderer v-for=\"block in page.content\" :key=\"block.key\" :block=\"block\" />\n </slot>\n <slot name=\"footer\" />\n </div>\n <ActionModals />\n <AlfakitToaster v-if=\"ownsToaster\" claimed />\n </TooltipProvider>\n </component>\n</template>\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"AlfakitComponent.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_unref","_normalizeClass","_withCtx","_createVNode","TooltipProvider","_createElementVNode","_createElementBlock","_toDisplayString","_createCommentVNode","ActionList","_renderSlot","_Fragment","_renderList","ContentBlockRenderer","ActionModals","AlfakitToaster","ActionList_default","ContentBlockRenderer_default","ActionModals_default","TooltipProvider_default","AlfakitToaster_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","AlfakitComponent_vue_vue_type_script_setup_true_lang_default","props","__props","parent","useOptionalAlfakit","inertiaPage","usePage","version","ref","state","StandaloneComponentState","poll","target","interval","refresh","targets","context","createStandaloneRegistry","createStandaloneContext","ALFAKIT_KEY","panel","computed","standalonePanelSchema","page","direction","actionContext","provideStandalone","providePageActionContext","watch","component","ownsToaster","onMounted","ensureStandaloneRuntime","findStandalonePropName","onCleanup","registerStandaloneProp","name","release","cancelled","hasToaster","claimToaster","onScopeDispose","openBlock","createBlock","resolveDynamicComponent","unref","ConfigProvider","normalizeClass","withCtx","createVNode","createElementVNode","cn","createElementBlock","toDisplayString","createCommentVNode","renderSlot","_ctx","Fragment","renderList","block"],"sources":["../../src/standalone/AlfakitComponent.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n StandaloneComponentState,\n findStandalonePropName,\n registerStandaloneProp,\n standalonePanelSchema,\n type ContentBlock,\n type StandaloneComponentSchema,\n} from '@alfakit/core'\nimport { usePage } from '@inertiajs/vue3'\nimport { ConfigProvider } from 'reka-ui'\nimport { computed, onMounted, onScopeDispose, provide, ref, watch, type HTMLAttributes } from 'vue'\nimport { providePageActionContext } from '../components/actions/action-context'\nimport ActionList from '../components/actions/ActionList.vue'\nimport ActionModals from '../components/actions/ActionModals.vue'\nimport TooltipProvider from '../components/ui/TooltipProvider.vue'\nimport {\n ALFAKIT_KEY,\n provideStandalone,\n useOptionalAlfakit,\n type AlfakitContextValue,\n type AnyComponent,\n} from '../context'\nimport { cn } from '../lib/utils'\nimport ContentBlockRenderer from '../pages/ContentBlockRenderer.vue'\nimport AlfakitToaster from './AlfakitToaster.vue'\nimport {\n claimToaster,\n createStandaloneContext,\n createStandaloneRegistry,\n ensureStandaloneRuntime,\n hasToaster,\n} from './runtime'\n\n/**\n * Renders an Alfakit component outside a panel: a form, table, infolist, widgets or any mix\n * (`AlfaSix\\Alfakit\\Standalone\\*`) in any Inertia page of the application. Needs no\n * `createAlfakit()` and no panel layout: it provides its own translator, registry, action\n * runner and modals, and inherits the application's shadcn tokens.\n *\n * ```vue\n * <AlfakitComponent :component=\"orders\" class=\"max-w-4xl\" />\n * ```\n *\n * Slots: `header` (above the content blocks), `footer` (below), and the default slot to\n * render the blocks yourself: `<template #default=\"{ blocks }\">…<ContentBlockRenderer :block=\"…\" />`.\n */\nconst props = defineProps<{\n /** The payload: `ContactForm::make()` passed as an Inertia prop. */\n component: StandaloneComponentSchema\n /** Renderer overrides for this instance (`{ TextInput: MyInput }`), on top of `configureAlfakit()`. */\n components?: Record<string, AnyComponent>\n class?: HTMLAttributes['class']\n}>()\n\ndefineSlots<{\n header?: () => unknown\n footer?: () => unknown\n default?: (props: { blocks: ContentBlock[]; page: StandaloneComponentSchema }) => unknown\n}>()\n\nconst parent = useOptionalAlfakit()\nconst inertiaPage = usePage()\n\n// Lazy and polled schemas of this component, merged into the page it renders.\nconst version = ref(0)\nconst state = new StandaloneComponentState(props.component, () => version.value++)\nconst poll = (target: string, interval: string | number | null | undefined) =>\n state.poll(target, interval)\nconst refresh = (targets: string[]) => state.refresh(targets)\n\nconst context: AlfakitContextValue = parent\n ? {\n ...parent,\n registry: createStandaloneRegistry(props.components, parent.registry),\n poll,\n refresh,\n }\n : {\n ...createStandaloneContext(\n { action: props.component.endpoints.action, modal: props.component.endpoints.modal },\n props.components,\n poll,\n ),\n refresh,\n }\n\nprovide(ALFAKIT_KEY, context)\n\nconst panel = computed(() => standalonePanelSchema(props.component))\nconst page = computed(() => {\n void version.value\n state.setComponent(props.component)\n\n return state.page\n})\nconst direction = computed(() => props.component.localization?.direction ?? 'ltr')\nconst actionContext = computed(() => ({ token: props.component.token, component: 'page' }))\n\nprovideStandalone({ panel, page })\nprovidePageActionContext(actionContext.value)\n\n// Endpoints and strings follow the latest payload (they change per locale or path).\nwatch(\n () => props.component,\n (component) => {\n context.actions.setEndpoints({\n action: component.endpoints.action,\n modal: component.endpoints.modal,\n })\n\n // Inside `createAlfakit()` the panel feeds the shared translator; on a page without the\n // `alfakit` prop (the rest of the app) the component's own translations apply.\n if (!parent || !(inertiaPage.props as Record<string, unknown>).alfakit) {\n context.translator.setTranslations(component.translations ?? {})\n context.translator.setLocale(component.localization?.tag ?? 'en')\n }\n },\n { immediate: true, flush: 'sync' },\n)\n\n// Toasts: use the layout's <AlfakitToaster /> when there is one, else the first component\n// on the page renders one (checked after every component mounted).\nconst ownsToaster = ref(false)\n\nonMounted(() => {\n ensureStandaloneRuntime()\n\n // Partial reloads (sorting, paging, inline edits) request this component's own prop.\n watch(\n () => findStandalonePropName(inertiaPage.props as Record<string, unknown>, props.component),\n (name, _old, onCleanup) => onCleanup(registerStandaloneProp(name ?? null)),\n { immediate: true },\n )\n\n // The watcher runs before the new payload renders: hand it over, or the response would\n // count as stale and lazy widgets (a calendar after its action) keep their old schema.\n watch(\n () => props.component.token,\n () => void state.loadLazy(props.component),\n { immediate: true },\n )\n\n if (parent) return\n\n let release: (() => void) | null = null\n let cancelled = false\n\n queueMicrotask(() => {\n if (cancelled || hasToaster()) return\n\n release = claimToaster()\n ownsToaster.value = true\n })\n\n onScopeDispose(() => {\n cancelled = true\n release?.()\n })\n})\n</script>\n\n<template>\n <component\n :is=\"parent ? 'div' : ConfigProvider\"\n :dir=\"parent ? undefined : direction\"\n :class=\"parent ? 'contents' : undefined\"\n >\n <TooltipProvider :delay-duration=\"0\">\n <div\n data-slot=\"standalone\"\n :data-alfakit-component=\"props.component.class\"\n :dir=\"direction\"\n :class=\"cn('flex flex-col gap-6', props.class)\"\n >\n <header\n v-if=\"page.heading || page.headerActions?.length\"\n data-slot=\"page-header\"\n class=\"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between\"\n >\n <div class=\"min-w-0\">\n <h2 v-if=\"page.heading\" class=\"text-xl font-semibold tracking-tight\">\n {{ page.heading }}\n </h2>\n <p v-if=\"page.subheading\" class=\"text-muted-foreground mt-1 text-sm\">\n {{ page.subheading }}\n </p>\n </div>\n <ActionList\n v-if=\"page.headerActions && page.headerActions.length > 0\"\n :actions=\"page.headerActions\"\n :context=\"actionContext\"\n align=\"end\"\n class=\"max-w-full shrink-0\"\n />\n </header>\n <slot name=\"header\" />\n <slot :blocks=\"page.content\" :page=\"props.component\">\n <ContentBlockRenderer v-for=\"block in page.content\" :key=\"block.key\" :block=\"block\" />\n </slot>\n <slot name=\"footer\" />\n </div>\n <ActionModals />\n <AlfakitToaster v-if=\"ownsToaster\" claimed />\n </TooltipProvider>\n </component>\n</template>\n"],"mappings":"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"}
|
package/dist/standalone.css
CHANGED
|
@@ -17,6 +17,13 @@
|
|
|
17
17
|
|
|
18
18
|
@custom-variant dark (&:is(.dark *));
|
|
19
19
|
|
|
20
|
+
/*
|
|
21
|
+
* Class lists that live in @alfakit/core (stacked-on-mobile tables, filter and column manager
|
|
22
|
+
* widths in `table.ts`, …): scan core's build too. Relative to this file in
|
|
23
|
+
* node_modules/@alfakit/<renderer>/dist, next to node_modules/@alfakit/core.
|
|
24
|
+
*/
|
|
25
|
+
@source '../../core/dist';
|
|
26
|
+
|
|
20
27
|
/*
|
|
21
28
|
* Grid classes are composed at runtime from schema breakpoints (`columns`, `columnSpan`),
|
|
22
29
|
* so force Tailwind to generate every variant the renderers can produce.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlfakitStarterKitRoot.js","names":["_sfc_main","AlfakitStarterKitRoot_vue_vue_type_script_setup_true_lang_default","AlfakitStarterKitRoot_default"],"sources":["../../src/starter-kit/AlfakitStarterKitRoot.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n STARTER_KIT_TOASTER_ID,\n installStarterKitRuntime,\n syncStarterKitPage,\n type AlfakitPageProps,\n} from '@alfakit/core'\nimport { usePage } from '@inertiajs/vue3'\nimport { onMounted, onUnmounted, watch } from 'vue'\nimport AlfakitRoot from '../AlfakitRoot.vue'\nimport { setToasterId, showToast } from '../components/notifications/flash-toasts'\nimport { provideAlfakit } from '../context'\nimport { starterKitContext, type StarterKitPageOptions } from './runtime'\n\n/**\n * The Inertia layout around every Alfakit page in starter kit mode, inside the host layout:\n * Alfakit's context, modals, toasts and the reading direction. It stays mounted while the\n * user moves between Alfakit pages.\n */\nconst props = defineProps<{ options?: StarterKitPageOptions }>()\nconst context = starterKitContext(props.options ?? {})\nconst page = usePage<AlfakitPageProps>()\n\nprovideAlfakit(context)\n\n// Endpoints follow the open page (synchronously, before children run actions).\nwatch(\n () => page.props.alfakit?.endpoints,\n (endpoints) => {\n if (endpoints) {\n context.actions.setEndpoints({ action: endpoints.action ?? '', modal: endpoints.modal ?? '' })\n }\n },\n { immediate: true, flush: 'sync' },\n)\n\nonMounted(() => {\n installStarterKitRuntime(\n (notification) => showToast(notification),\n (key, replacements, fallback) => context.translator.t(key, replacements, fallback),\n )\n setToasterId(STARTER_KIT_TOASTER_ID)\n\n watch(\n () => page.props,\n (value) => syncStarterKitPage(value as AlfakitPageProps),\n { immediate: true },\n )\n})\n\nonUnmounted(() => {\n // A host page is open: its errors and toasts are the host's again.\n syncStarterKitPage(null)\n setToasterId(undefined)\n})\n</script>\n\n<template>\n <AlfakitRoot :toaster-id=\"STARTER_KIT_TOASTER_ID\">\n
|
|
1
|
+
{"version":3,"file":"AlfakitStarterKitRoot.js","names":["_sfc_main","AlfakitStarterKitRoot_vue_vue_type_script_setup_true_lang_default","AlfakitStarterKitRoot_default"],"sources":["../../src/starter-kit/AlfakitStarterKitRoot.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n STARTER_KIT_TOASTER_ID,\n installStarterKitRuntime,\n syncStarterKitPage,\n type AlfakitPageProps,\n} from '@alfakit/core'\nimport { usePage } from '@inertiajs/vue3'\nimport { onMounted, onUnmounted, watch } from 'vue'\nimport AlfakitRoot from '../AlfakitRoot.vue'\nimport { setToasterId, showToast } from '../components/notifications/flash-toasts'\nimport { provideAlfakit } from '../context'\nimport { starterKitContext, type StarterKitPageOptions } from './runtime'\n\n/**\n * The Inertia layout around every Alfakit page in starter kit mode, inside the host layout:\n * Alfakit's context, modals, toasts and the reading direction. It stays mounted while the\n * user moves between Alfakit pages.\n */\nconst props = defineProps<{ options?: StarterKitPageOptions }>()\nconst context = starterKitContext(props.options ?? {})\nconst page = usePage<AlfakitPageProps>()\n\nprovideAlfakit(context)\n\n// Endpoints follow the open page (synchronously, before children run actions).\nwatch(\n () => page.props.alfakit?.endpoints,\n (endpoints) => {\n if (endpoints) {\n context.actions.setEndpoints({ action: endpoints.action ?? '', modal: endpoints.modal ?? '' })\n }\n },\n { immediate: true, flush: 'sync' },\n)\n\nonMounted(() => {\n installStarterKitRuntime(\n (notification) => showToast(notification),\n (key, replacements, fallback) => context.translator.t(key, replacements, fallback),\n )\n setToasterId(STARTER_KIT_TOASTER_ID)\n\n watch(\n () => page.props,\n (value) => syncStarterKitPage(value as AlfakitPageProps),\n { immediate: true },\n )\n})\n\nonUnmounted(() => {\n // A host page is open: its errors and toasts are the host's again.\n syncStarterKitPage(null)\n setToasterId(undefined)\n})\n</script>\n\n<template>\n <!-- The reading direction and language of Alfakit's content only: the host layout around it\n (sidebar, header) and the app's own pages keep the document's. -->\n <div\n data-slot=\"starter-kit-root\"\n :dir=\"page.props.alfakit?.localization?.direction ?? 'ltr'\"\n :lang=\"page.props.alfakit?.localization?.tag\"\n class=\"contents\"\n >\n <AlfakitRoot :toaster-id=\"STARTER_KIT_TOASTER_ID\">\n <slot />\n </AlfakitRoot>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -7,9 +7,9 @@ import { type StarterKitPageOptions } from './runtime';
|
|
|
7
7
|
type __VLS_Props = {
|
|
8
8
|
options?: StarterKitPageOptions;
|
|
9
9
|
};
|
|
10
|
-
declare var
|
|
10
|
+
declare var __VLS_4: {};
|
|
11
11
|
type __VLS_Slots = {} & {
|
|
12
|
-
default?: (props: typeof
|
|
12
|
+
default?: (props: typeof __VLS_4) => any;
|
|
13
13
|
};
|
|
14
14
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
15
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlfakitStarterKitRoot.vue.d.ts","sourceRoot":"","sources":["../../src/starter-kit/AlfakitStarterKitRoot.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AlfakitStarterKitRoot.vue.d.ts","sourceRoot":"","sources":["../../src/starter-kit/AlfakitStarterKitRoot.vue"],"names":[],"mappings":"AAoFA,OAAO,EAAqB,KAAK,qBAAqB,EAAE,MAAM,WAAW,CAAA;AAEzE;;;;GAIG;AACH,KAAK,WAAW,GAAG;IAAE,OAAO,CAAC,EAAE,qBAAqB,CAAA;CAAE,CAAC;AAkEvD,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAqB/C,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -4,32 +4,37 @@ import r from "../AlfakitRoot.js";
|
|
|
4
4
|
import { starterKitContext as i } from "./runtime.js";
|
|
5
5
|
import { STARTER_KIT_TOASTER_ID as a, installStarterKitRuntime as o, syncStarterKitPage as s } from "@alfakit/core";
|
|
6
6
|
import { usePage as c } from "@inertiajs/vue3";
|
|
7
|
-
import {
|
|
7
|
+
import { createElementBlock as l, createVNode as u, defineComponent as d, onMounted as f, onUnmounted as p, openBlock as m, renderSlot as h, unref as g, watch as _, withCtx as v } from "vue";
|
|
8
8
|
//#region src/starter-kit/AlfakitStarterKitRoot.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
-
var
|
|
9
|
+
var y = ["dir", "lang"], b = /*@__PURE__*/ d({
|
|
10
10
|
__name: "AlfakitStarterKitRoot",
|
|
11
11
|
props: { options: {} },
|
|
12
|
-
setup(
|
|
13
|
-
let
|
|
14
|
-
return e(
|
|
15
|
-
e &&
|
|
12
|
+
setup(d) {
|
|
13
|
+
let b = i(d.options ?? {}), x = c();
|
|
14
|
+
return e(b), _(() => x.props.alfakit?.endpoints, (e) => {
|
|
15
|
+
e && b.actions.setEndpoints({
|
|
16
16
|
action: e.action ?? "",
|
|
17
17
|
modal: e.modal ?? ""
|
|
18
18
|
});
|
|
19
19
|
}, {
|
|
20
20
|
immediate: !0,
|
|
21
21
|
flush: "sync"
|
|
22
|
-
}), d(() => {
|
|
23
|
-
o((e) => n(e), (e, t, n) => v.translator.t(e, t, n)), t(a), g(() => y.props, (e) => s(e), { immediate: !0 });
|
|
24
22
|
}), f(() => {
|
|
23
|
+
o((e) => n(e), (e, t, n) => b.translator.t(e, t, n)), t(a), _(() => x.props, (e) => s(e), { immediate: !0 });
|
|
24
|
+
}), p(() => {
|
|
25
25
|
s(null), t(void 0);
|
|
26
|
-
}), (e, t) => (
|
|
27
|
-
|
|
26
|
+
}), (e, t) => (m(), l("div", {
|
|
27
|
+
"data-slot": "starter-kit-root",
|
|
28
|
+
dir: g(x).props.alfakit?.localization?.direction ?? "ltr",
|
|
29
|
+
lang: g(x).props.alfakit?.localization?.tag,
|
|
30
|
+
class: "contents"
|
|
31
|
+
}, [u(r, { "toaster-id": g(a) }, {
|
|
32
|
+
default: v(() => [h(e.$slots, "default")]),
|
|
28
33
|
_: 3
|
|
29
|
-
}, 8, ["toaster-id"]));
|
|
34
|
+
}, 8, ["toaster-id"])], 8, y));
|
|
30
35
|
}
|
|
31
36
|
});
|
|
32
37
|
//#endregion
|
|
33
|
-
export {
|
|
38
|
+
export { b as default };
|
|
34
39
|
|
|
35
40
|
//# sourceMappingURL=AlfakitStarterKitRoot.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlfakitStarterKitRoot.vue_vue_type_script_setup_true_lang.js","names":["props","_openBlock","
|
|
1
|
+
{"version":3,"file":"AlfakitStarterKitRoot.vue_vue_type_script_setup_true_lang.js","names":["props","_openBlock","_createElementBlock","_unref","_createVNode","AlfakitRoot","_withCtx","_renderSlot","AlfakitRoot_default","_hoisted_1","AlfakitStarterKitRoot_vue_vue_type_script_setup_true_lang_default","context","starterKitContext","__props","page","usePage","provideAlfakit","watch","endpoints","onMounted","installStarterKitRuntime","showToast","notification","key","replacements","fallback","setToasterId","STARTER_KIT_TOASTER_ID","syncStarterKitPage","value","onUnmounted","openBlock","createElementBlock","unref","createVNode","withCtx","renderSlot","_ctx"],"sources":["../../src/starter-kit/AlfakitStarterKitRoot.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n STARTER_KIT_TOASTER_ID,\n installStarterKitRuntime,\n syncStarterKitPage,\n type AlfakitPageProps,\n} from '@alfakit/core'\nimport { usePage } from '@inertiajs/vue3'\nimport { onMounted, onUnmounted, watch } from 'vue'\nimport AlfakitRoot from '../AlfakitRoot.vue'\nimport { setToasterId, showToast } from '../components/notifications/flash-toasts'\nimport { provideAlfakit } from '../context'\nimport { starterKitContext, type StarterKitPageOptions } from './runtime'\n\n/**\n * The Inertia layout around every Alfakit page in starter kit mode, inside the host layout:\n * Alfakit's context, modals, toasts and the reading direction. It stays mounted while the\n * user moves between Alfakit pages.\n */\nconst props = defineProps<{ options?: StarterKitPageOptions }>()\nconst context = starterKitContext(props.options ?? {})\nconst page = usePage<AlfakitPageProps>()\n\nprovideAlfakit(context)\n\n// Endpoints follow the open page (synchronously, before children run actions).\nwatch(\n () => page.props.alfakit?.endpoints,\n (endpoints) => {\n if (endpoints) {\n context.actions.setEndpoints({ action: endpoints.action ?? '', modal: endpoints.modal ?? '' })\n }\n },\n { immediate: true, flush: 'sync' },\n)\n\nonMounted(() => {\n installStarterKitRuntime(\n (notification) => showToast(notification),\n (key, replacements, fallback) => context.translator.t(key, replacements, fallback),\n )\n setToasterId(STARTER_KIT_TOASTER_ID)\n\n watch(\n () => page.props,\n (value) => syncStarterKitPage(value as AlfakitPageProps),\n { immediate: true },\n )\n})\n\nonUnmounted(() => {\n // A host page is open: its errors and toasts are the host's again.\n syncStarterKitPage(null)\n setToasterId(undefined)\n})\n</script>\n\n<template>\n <!-- The reading direction and language of Alfakit's content only: the host layout around it\n (sidebar, header) and the app's own pages keep the document's. -->\n <div\n data-slot=\"starter-kit-root\"\n :dir=\"page.props.alfakit?.localization?.direction ?? 'ltr'\"\n :lang=\"page.props.alfakit?.localization?.tag\"\n class=\"contents\"\n >\n <AlfakitRoot :toaster-id=\"STARTER_KIT_TOASTER_ID\">\n <slot />\n </AlfakitRoot>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;EAoBA,IAAMW,IAAUC,EAAkBZ,EAAM,WAAW,CAAC,CAAC,GAC/Cc,IAAOC,EAA0B;SAEvCC,EAAeL,CAAO,GAGtBM,QACQH,EAAK,MAAM,SAAS,YACzB,MAAc;GACb,AAAII,KACFP,EAAQ,QAAQ,aAAa;IAAE,QAAQO,EAAU,UAAU;IAAI,OAAOA,EAAU,SAAS;GAAG,CAAC;EAEjG,GACA;GAAE,WAAW;GAAM,OAAO;EAAO,CACnC,GAEAC,QAAgB;GAOd,AANAC,GACG,MAAiBC,EAAUC,CAAY,IACvC,GAAK,GAAc,MAAaX,EAAQ,WAAW,EAAEY,GAAKC,GAAcC,CAAQ,CACnF,GACAC,EAAaC,CAAsB,GAEnCV,QACQH,EAAK,QACV,MAAUc,EAAmBC,CAAyB,GACvD,EAAE,WAAW,GAAK,CACpB;EACF,CAAC,GAEDC,QAAkB;GAGhB,AADAF,EAAmB,IAAI,GACvBF,EAAa,KAAA,CAAS;EACxB,CAAC,cAMCzB,EAAA,GAAAC,EASM,OAAA;GARJ,aAAU;GACT,KAAKC,EAAAW,CAAA,CAAI,CAAC,MAAM,SAAS,cAAc,aAAS;GAChD,MAAMX,EAAAW,CAAA,CAAI,CAAC,MAAM,SAAS,cAAc;GACzC,OAAM;EAENV,GAAAA,CAAAA,EAEcC,GAAA,EAFA,cAAYF,EAAAwB,CAAA,EAAsB,GAAA;GAC9C,SAAArB,QAAQ,CAARC,EAAQ8B,EAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import type { AnyComponent } from '../context';
|
|
3
|
+
/**
|
|
4
|
+
* The dashboard widgets of a `starterKit()` panel on the host's own dashboard. Reads the
|
|
5
|
+
* `alfakitWidgets` prop (shared on the panel's `starterKitDashboard()` pages only, the
|
|
6
|
+
* starter kit's `/dashboard` by default) and renders the widgets with the host's theme, as
|
|
7
|
+
* `<AlfakitComponent>` renders standalone widgets: lazy widgets, polling and table widget
|
|
8
|
+
* actions go through the panel's endpoints. Its code loads once mounted; the server render
|
|
9
|
+
* and hydration show placeholders. Renders its default slot (the kit's placeholder boxes)
|
|
10
|
+
* when there are no widgets to show: other pages, guests, users who may not open the panel.
|
|
11
|
+
*
|
|
12
|
+
* ```vue
|
|
13
|
+
* <script setup lang="ts">
|
|
14
|
+
* import { AlfakitWidgets } from '@alfakit/vue'
|
|
15
|
+
* </script>
|
|
16
|
+
*
|
|
17
|
+
* <template>
|
|
18
|
+
* <AlfakitWidgets>
|
|
19
|
+
* <MyEmptyState />
|
|
20
|
+
* </AlfakitWidgets>
|
|
21
|
+
* </template>
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare const AlfakitWidgets: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
25
|
+
/** The `starterKit()` panel whose widgets to show (the first one by default). */
|
|
26
|
+
panel: {
|
|
27
|
+
type: PropType<string | undefined>;
|
|
28
|
+
default: undefined;
|
|
29
|
+
};
|
|
30
|
+
/** Frontend components of custom widgets (`{ RevenueWidget }`), as for `<AlfakitComponent>`. */
|
|
31
|
+
components: {
|
|
32
|
+
type: PropType<Record<string, AnyComponent> | undefined>;
|
|
33
|
+
default: undefined;
|
|
34
|
+
};
|
|
35
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
}> | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
38
|
+
[key: string]: any;
|
|
39
|
+
}>[] | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
40
|
+
/** The `starterKit()` panel whose widgets to show (the first one by default). */
|
|
41
|
+
panel: {
|
|
42
|
+
type: PropType<string | undefined>;
|
|
43
|
+
default: undefined;
|
|
44
|
+
};
|
|
45
|
+
/** Frontend components of custom widgets (`{ RevenueWidget }`), as for `<AlfakitComponent>`. */
|
|
46
|
+
components: {
|
|
47
|
+
type: PropType<Record<string, AnyComponent> | undefined>;
|
|
48
|
+
default: undefined;
|
|
49
|
+
};
|
|
50
|
+
}>> & Readonly<{}>, {
|
|
51
|
+
components: Record<string, AnyComponent> | undefined;
|
|
52
|
+
panel: string | undefined;
|
|
53
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
54
|
+
//# sourceMappingURL=dashboard-widgets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard-widgets.d.ts","sourceRoot":"","sources":["../../src/starter-kit/dashboard-widgets.ts"],"names":[],"mappings":"AAMA,OAAO,EAAgC,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAA;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAqC9C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,cAAc;IAIvB,iFAAiF;;cACxD,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC;;;IACrD,gGAAgG;;cAE9E,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,SAAS,CAAC;;;;;;;;IAJpE,iFAAiF;;cACxD,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC;;;IACrD,gGAAgG;;cAE9E,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,SAAS,CAAC;;;;;;4EAmBtE,CAAA"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { lazyComponent as e } from "../lib/lazy.js";
|
|
2
|
+
import { standaloneWidgetCount as t, starterKitDashboardWidgets as n } from "@alfakit/core";
|
|
3
|
+
import { usePage as r } from "@inertiajs/vue3";
|
|
4
|
+
import { computed as i, defineComponent as a, h as o } from "vue";
|
|
5
|
+
//#region src/starter-kit/dashboard-widgets.ts
|
|
6
|
+
var s = a({
|
|
7
|
+
name: "AlfakitWidgetsPlaceholder",
|
|
8
|
+
props: {
|
|
9
|
+
component: {
|
|
10
|
+
type: Object,
|
|
11
|
+
required: !0
|
|
12
|
+
},
|
|
13
|
+
components: {
|
|
14
|
+
type: Object,
|
|
15
|
+
default: void 0
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
setup(e) {
|
|
19
|
+
return () => o("div", {
|
|
20
|
+
"data-slot": "starter-kit-widgets-placeholder",
|
|
21
|
+
"aria-busy": "true",
|
|
22
|
+
class: "grid auto-rows-min gap-4 md:grid-cols-2"
|
|
23
|
+
}, Array.from({ length: Math.max(t(e.component), 1) }, (e, t) => o("div", {
|
|
24
|
+
key: t,
|
|
25
|
+
"aria-hidden": "true",
|
|
26
|
+
class: "bg-muted h-28 animate-pulse rounded-xl"
|
|
27
|
+
})));
|
|
28
|
+
}
|
|
29
|
+
}), c = e("AlfakitLoadedWidgets", () => import("../standalone/AlfakitComponent.js").then((e) => e.default), s), l = a({
|
|
30
|
+
name: "AlfakitWidgets",
|
|
31
|
+
inheritAttrs: !1,
|
|
32
|
+
props: {
|
|
33
|
+
panel: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: void 0
|
|
36
|
+
},
|
|
37
|
+
components: {
|
|
38
|
+
type: Object,
|
|
39
|
+
default: void 0
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
setup(e, { attrs: t, slots: a }) {
|
|
43
|
+
let s = r(), l = i(() => n(s.props, e.panel));
|
|
44
|
+
return () => l.value ? o("div", { "data-slot": "starter-kit-widgets" }, [o(c, {
|
|
45
|
+
component: l.value,
|
|
46
|
+
components: e.components,
|
|
47
|
+
class: t.class
|
|
48
|
+
})]) : a.default?.();
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
//#endregion
|
|
52
|
+
export { l as AlfakitWidgets };
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=dashboard-widgets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard-widgets.js","names":["WidgetsPlaceholder","defineComponent","h","standaloneWidgetCount","props","index","LoadedWidgets","lazyComponent","module","AlfakitWidgets","page","usePage","component","computed","starterKitDashboardWidgets","attrs","slots"],"sources":["../../src/starter-kit/dashboard-widgets.ts"],"sourcesContent":["import {\n standaloneWidgetCount,\n starterKitDashboardWidgets,\n type StandaloneComponentSchema,\n} from '@alfakit/core'\nimport { usePage } from '@inertiajs/vue3'\nimport { computed, defineComponent, h, type PropType } from 'vue'\nimport type { AnyComponent } from '../context'\nimport { lazyComponent } from '../lib/lazy'\n\n/** Widget-sized boxes until the widgets' code has loaded (also during SSR). */\nconst WidgetsPlaceholder = defineComponent({\n name: 'AlfakitWidgetsPlaceholder',\n props: {\n component: { type: Object as PropType<StandaloneComponentSchema>, required: true },\n // Declared so it does not fall through as an attribute.\n components: { type: Object as PropType<Record<string, AnyComponent>>, default: undefined },\n },\n setup(props) {\n return () =>\n h(\n 'div',\n {\n 'data-slot': 'starter-kit-widgets-placeholder',\n 'aria-busy': 'true',\n class: 'grid auto-rows-min gap-4 md:grid-cols-2',\n },\n Array.from({ length: Math.max(standaloneWidgetCount(props.component), 1) }, (_, index) =>\n h('div', {\n key: index,\n 'aria-hidden': 'true',\n class: 'bg-muted h-28 animate-pulse rounded-xl',\n }),\n ),\n )\n },\n})\n\nconst LoadedWidgets = lazyComponent(\n 'AlfakitLoadedWidgets',\n () => import('../standalone/AlfakitComponent.vue').then((module) => module.default),\n WidgetsPlaceholder,\n)\n\n/**\n * The dashboard widgets of a `starterKit()` panel on the host's own dashboard. Reads the\n * `alfakitWidgets` prop (shared on the panel's `starterKitDashboard()` pages only, the\n * starter kit's `/dashboard` by default) and renders the widgets with the host's theme, as\n * `<AlfakitComponent>` renders standalone widgets: lazy widgets, polling and table widget\n * actions go through the panel's endpoints. Its code loads once mounted; the server render\n * and hydration show placeholders. Renders its default slot (the kit's placeholder boxes)\n * when there are no widgets to show: other pages, guests, users who may not open the panel.\n *\n * ```vue\n * <script setup lang=\"ts\">\n * import { AlfakitWidgets } from '@alfakit/vue'\n * </script>\n *\n * <template>\n * <AlfakitWidgets>\n * <MyEmptyState />\n * </AlfakitWidgets>\n * </template>\n * ```\n */\nexport const AlfakitWidgets = defineComponent({\n name: 'AlfakitWidgets',\n inheritAttrs: false,\n props: {\n /** The `starterKit()` panel whose widgets to show (the first one by default). */\n panel: { type: String as PropType<string | undefined>, default: undefined },\n /** Frontend components of custom widgets (`{ RevenueWidget }`), as for `<AlfakitComponent>`. */\n components: {\n type: Object as PropType<Record<string, AnyComponent> | undefined>,\n default: undefined,\n },\n },\n setup(props, { attrs, slots }) {\n const page = usePage()\n const component = computed(() => starterKitDashboardWidgets(page.props, props.panel))\n\n return () =>\n component.value\n ? h('div', { 'data-slot': 'starter-kit-widgets' }, [\n h(LoadedWidgets, {\n component: component.value,\n components: props.components,\n class: attrs.class,\n }),\n ])\n : slots.default?.()\n },\n})\n"],"mappings":";;;;;AAWA,IAAMA,IAAqBC,EAAgB;CACzC,MAAM;CACN,OAAO;EACL,WAAW;GAAE,MAAM;GAA+C,UAAU;EAAK;EAEjF,YAAY;GAAE,MAAM;GAAkD,SAAS,KAAA;EAAU;CAC3F;CACA,MAAM,GAAO;EACX,aACEC,EACE,OACA;GACE,aAAa;GACb,aAAa;GACb,OAAO;EACT,GACA,MAAM,KAAK,EAAE,QAAQ,KAAK,IAAIC,EAAsBC,EAAM,SAAS,GAAG,CAAC,EAAE,IAAI,GAAG,MAC9EF,EAAE,OAAO;GACP,KAAKG;GACL,eAAe;GACf,OAAO;EACT,CAAC,CACH,CACF;CACJ;AACF,CAAC,GAEKC,IAAgBC,EACpB,8BACM,OAAO,oCAAqC,CAAC,MAAM,MAAWC,EAAO,OAAO,GAClFR,CACF,GAuBaS,IAAiBR,EAAgB;CAC5C,MAAM;CACN,cAAc;CACd,OAAO;EAEL,OAAO;GAAE,MAAM;GAAwC,SAAS,KAAA;EAAU;EAE1E,YAAY;GACV,MAAM;GACN,SAAS,KAAA;EACX;CACF;CACA,MAAM,GAAO,EAAE,UAAO,YAAS;EAC7B,IAAMS,IAAOC,EAAQ,GACfC,IAAYC,QAAeC,EAA2BJ,EAAK,OAAON,EAAM,KAAK,CAAC;EAEpF,aACEQ,EAAU,QACNV,EAAE,OAAO,EAAE,aAAa,sBAAsB,GAAG,CAC/CA,EAAEI,GAAe;GACf,WAAWM,EAAU;GACrB,YAAYR,EAAM;GAClB,OAAOW,EAAM;EACf,CAAC,CACH,CAAC,IACDC,EAAM,UAAU;CACxB;AACF,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { default as AlfakitStarterKitRoot } from './AlfakitStarterKitRoot.vue';
|
|
2
|
+
export { AlfakitWidgets } from './dashboard-widgets';
|
|
2
3
|
export { useAlfakitNavigation, type AlfakitNavigation } from './navigation';
|
|
3
4
|
export { createStarterKitPage, type StarterKitPageOptions } from './starter-kit';
|
|
4
5
|
export { default as StarterKitContentLayout } from './StarterKitContentLayout.vue';
|
|
5
|
-
export { AlfakitNotifications, AlfakitSearch, AlfakitTenantSwitcher } from './widgets';
|
|
6
|
+
export { AlfakitCopilot, AlfakitNotifications, AlfakitSearch, AlfakitTenantSwitcher, } from './widgets';
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/starter-kit/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AAC9E,OAAO,EAAE,oBAAoB,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAC3E,OAAO,EAAE,oBAAoB,EAAE,KAAK,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAChF,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;AAClF,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/starter-kit/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,oBAAoB,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAC3E,OAAO,EAAE,oBAAoB,EAAE,KAAK,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAChF,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;AAClF,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,qBAAqB,GACtB,MAAM,WAAW,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import e from "./StarterKitContentLayout.js";
|
|
2
2
|
import t from "./AlfakitStarterKitRoot.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
3
|
+
import { AlfakitWidgets as n } from "./dashboard-widgets.js";
|
|
4
|
+
import { useAlfakitNavigation as r } from "./navigation.js";
|
|
5
|
+
import { createStarterKitPage as i } from "./starter-kit.js";
|
|
6
|
+
import { AlfakitCopilot as a, AlfakitNotifications as o, AlfakitSearch as s, AlfakitTenantSwitcher as c } from "./widgets/index.js";
|
|
7
|
+
export { a as AlfakitCopilot, o as AlfakitNotifications, s as AlfakitSearch, t as AlfakitStarterKitRoot, c as AlfakitTenantSwitcher, n as AlfakitWidgets, e as StarterKitContentLayout, i as createStarterKitPage, r as useAlfakitNavigation };
|