@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,9 +1,9 @@
|
|
|
1
1
|
import { cn as e } from "../../lib/utils.js";
|
|
2
2
|
import { createBlock as t, createVNode as n, defineComponent as r, mergeProps as i, openBlock as a, renderSlot as o, unref as s, withCtx as c } from "vue";
|
|
3
|
-
import { PopoverContent as l, PopoverPortal as u,
|
|
4
|
-
import { reactiveOmit as
|
|
3
|
+
import { PopoverContent as l, PopoverPortal as u, useDirection as d, useForwardPropsEmits as f } from "reka-ui";
|
|
4
|
+
import { reactiveOmit as p } from "@vueuse/core";
|
|
5
5
|
//#region src/components/ui/PopoverContent.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
6
|
+
var m = /*@__PURE__*/ r({
|
|
7
7
|
inheritAttrs: !1,
|
|
8
8
|
__name: "PopoverContent",
|
|
9
9
|
props: {
|
|
@@ -47,13 +47,14 @@ var p = /*@__PURE__*/ r({
|
|
|
47
47
|
"openAutoFocus",
|
|
48
48
|
"closeAutoFocus"
|
|
49
49
|
],
|
|
50
|
-
setup(r, { emit:
|
|
51
|
-
let
|
|
50
|
+
setup(r, { emit: m }) {
|
|
51
|
+
let h = r, g = m, _ = f(p(h, "class"), g), v = d();
|
|
52
52
|
return (r, d) => (a(), t(s(u), null, {
|
|
53
53
|
default: c(() => [n(s(l), i({ "data-slot": "popover-content" }, {
|
|
54
|
-
...s(
|
|
54
|
+
...s(_),
|
|
55
|
+
dir: s(_).dir ?? s(v),
|
|
55
56
|
...r.$attrs
|
|
56
|
-
}, { class: s(e)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--reka-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
|
|
57
|
+
}, { class: s(e)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--reka-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden", h.class) }), {
|
|
57
58
|
default: c(() => [o(r.$slots, "default")]),
|
|
58
59
|
_: 3
|
|
59
60
|
}, 16, ["class"])]),
|
|
@@ -62,6 +63,6 @@ var p = /*@__PURE__*/ r({
|
|
|
62
63
|
}
|
|
63
64
|
});
|
|
64
65
|
//#endregion
|
|
65
|
-
export {
|
|
66
|
+
export { m as default };
|
|
66
67
|
|
|
67
68
|
//# sourceMappingURL=PopoverContent.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopoverContent.vue_vue_type_script_setup_true_lang.js","names":["$attrs","_openBlock","_createBlock","_unref","_withCtx","_createVNode","_mergeProps","_renderSlot","PopoverContent_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emits","forwarded","useForwardPropsEmits","reactiveOmit","openBlock","createBlock","unref","PopoverPortal","withCtx","createVNode","PopoverContent","mergeProps","_ctx","cn","renderSlot"],"sources":["../../../src/components/ui/PopoverContent.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { reactiveOmit } from '@vueuse/core'\nimport {\n PopoverContent,\n PopoverPortal,\n useForwardPropsEmits,\n type PopoverContentEmits,\n type PopoverContentProps,\n} from 'reka-ui'\nimport type { HTMLAttributes } from 'vue'\nimport { cn } from '../../lib/utils'\n\nconst props = withDefaults(\n defineProps<PopoverContentProps & { class?: HTMLAttributes['class'] }>(),\n { align: 'center', sideOffset: 4 },\n)\n// The root is the portal, so extra attributes (data-slot, role, data-*) would be lost:\n// forward them to the content element. `class` is a prop and is merged, never replaced.\ndefineOptions({ inheritAttrs: false })\n\nconst emits = defineEmits<PopoverContentEmits>()\nconst forwarded = useForwardPropsEmits(reactiveOmit(props, 'class'), emits)\n</script>\n\n<template>\n <PopoverPortal>\n <PopoverContent\n data-slot=\"popover-content\"\n v-bind=\"{ ...forwarded, ...$attrs }\"\n :class=\"\n cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--reka-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden',\n props.class,\n )\n \"\n >\n <slot />\n </PopoverContent>\n </PopoverPortal>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"PopoverContent.vue_vue_type_script_setup_true_lang.js","names":["$attrs","_openBlock","_createBlock","_unref","_withCtx","_createVNode","_mergeProps","_renderSlot","PopoverContent_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emits","forwarded","useForwardPropsEmits","reactiveOmit","dir","useDirection","openBlock","createBlock","unref","PopoverPortal","withCtx","createVNode","PopoverContent","mergeProps","_ctx","cn","renderSlot"],"sources":["../../../src/components/ui/PopoverContent.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { reactiveOmit } from '@vueuse/core'\nimport {\n PopoverContent,\n PopoverPortal,\n useDirection,\n useForwardPropsEmits,\n type PopoverContentEmits,\n type PopoverContentProps,\n} from 'reka-ui'\nimport type { HTMLAttributes } from 'vue'\nimport { cn } from '../../lib/utils'\n\nconst props = withDefaults(\n defineProps<PopoverContentProps & { class?: HTMLAttributes['class'] }>(),\n { align: 'center', sideOffset: 4 },\n)\n// The root is the portal, so extra attributes (data-slot, role, data-*) would be lost:\n// forward them to the content element. `class` is a prop and is merged, never replaced.\ndefineOptions({ inheritAttrs: false })\n\nconst emits = defineEmits<PopoverContentEmits>()\nconst forwarded = useForwardPropsEmits(reactiveOmit(props, 'class'), emits)\n// Portaled outside Alfakit's root: carry the reading direction (starter kit pages and\n// standalone components leave <html dir> to the host).\nconst dir = useDirection()\n</script>\n\n<template>\n <PopoverPortal>\n <PopoverContent\n data-slot=\"popover-content\"\n v-bind=\"{ ...forwarded, dir: forwarded.dir ?? dir, ...$attrs }\"\n :class=\"\n cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--reka-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden',\n props.class,\n )\n \"\n >\n <slot />\n </PopoverContent>\n </PopoverPortal>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAaA,IAAMU,IAAQC,GAQRC,IAAQH,GACRI,IAAYC,EAAqBC,EAAaL,GAAO,OAAO,GAAGE,CAAK,GAGpEI,IAAMC,EAAa;oBAIvBhB,EAAA,GAAAC,EAagBC,EAAAkB,CAAA,GAAA,MAAA;GAZd,SAAAjB,QAWiB,CAXjBC,EAWiBF,EAAAqB,CAAA,GAXjBlB,EAWiB,EAVf,aAAU,kBAAiB,GAAA;IAAA,GACdH,EAAAU,CAAA;IAAS,KAAOV,EAAAU,CAAA,CAAS,CAAC,OAAOV,EAAAa,CAAA;IAAG,GAAKhB,EAAAA;GAAM,GAAA,EAC3D,OAAgBG,EAAAwB,CAAA,CAAE,CAAA,ieAAufjB,EAAM,KAAA,EAAA,CAAA,GAAA;IAOhhB,SAAAN,QAAQ,CAARG,EAAQmB,EAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetContent.js","names":["_sfc_main","SheetContent_vue_vue_type_script_setup_true_lang_default","SheetContent_default"],"sources":["../../../src/components/ui/SheetContent.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { XIcon } from '@lucide/vue'\nimport { reactiveOmit } from '@vueuse/core'\nimport {\n DialogClose,\n DialogContent,\n DialogOverlay,\n DialogPortal,\n useForwardPropsEmits,\n type DialogContentEmits,\n type DialogContentProps,\n} from 'reka-ui'\nimport type { HTMLAttributes } from 'vue'\nimport { Icon } from '../../lib/icons'\nimport { cn } from '../../lib/utils'\nimport { useT } from '../../context'\n\nconst props = withDefaults(\n defineProps<\n DialogContentProps & {\n class?: HTMLAttributes['class']\n side?: 'top' | 'right' | 'bottom' | 'left'\n showCloseButton?: boolean\n }\n >(),\n { side: 'right', showCloseButton: true },\n)\n// The root is the portal, so extra attributes (data-slot, role, data-*) would be lost:\n// forward them to the content element like the React and Svelte wrappers. `class` is a prop\n// and is merged below, never replaced.\ndefineOptions({ inheritAttrs: false })\n\nconst emits = defineEmits<DialogContentEmits>()\nconst forwarded = useForwardPropsEmits(\n reactiveOmit(props, 'class', 'side', 'showCloseButton'),\n emits,\n)\nconst t = useT()\n</script>\n\n<template>\n <DialogPortal>\n <DialogOverlay\n data-slot=\"sheet-overlay\"\n class=\"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\"\n />\n <DialogContent\n data-slot=\"sheet-content\"\n v-bind=\"{ ...forwarded, ...$attrs }\"\n :class=\"\n cn(\n 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500',\n props.side === 'right' &&\n 'data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm',\n props.side === 'left' &&\n 'data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm',\n props.side === 'top' &&\n 'data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b',\n props.side === 'bottom' &&\n 'data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t',\n props.class,\n )\n \"\n >\n <slot />\n <DialogClose\n v-if=\"props.showCloseButton\"\n class=\"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute end-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none\"\n >\n <Icon name=\"alfakit::support.modal.close-button\" :fallback=\"XIcon\" class=\"size-4\" />\n <span class=\"sr-only\">{{ t('close', {}, 'Close') }}</span>\n </DialogClose>\n </DialogContent>\n </DialogPortal>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"SheetContent.js","names":["_sfc_main","SheetContent_vue_vue_type_script_setup_true_lang_default","SheetContent_default"],"sources":["../../../src/components/ui/SheetContent.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { XIcon } from '@lucide/vue'\nimport { reactiveOmit } from '@vueuse/core'\nimport {\n DialogClose,\n DialogContent,\n DialogOverlay,\n DialogPortal,\n useDirection,\n useForwardPropsEmits,\n type DialogContentEmits,\n type DialogContentProps,\n} from 'reka-ui'\nimport type { HTMLAttributes } from 'vue'\nimport { Icon } from '../../lib/icons'\nimport { cn } from '../../lib/utils'\nimport { useT } from '../../context'\n\nconst props = withDefaults(\n defineProps<\n DialogContentProps & {\n class?: HTMLAttributes['class']\n side?: 'top' | 'right' | 'bottom' | 'left'\n showCloseButton?: boolean\n }\n >(),\n { side: 'right', showCloseButton: true },\n)\n// The root is the portal, so extra attributes (data-slot, role, data-*) would be lost:\n// forward them to the content element like the React and Svelte wrappers. `class` is a prop\n// and is merged below, never replaced.\ndefineOptions({ inheritAttrs: false })\n\nconst emits = defineEmits<DialogContentEmits>()\nconst forwarded = useForwardPropsEmits(\n reactiveOmit(props, 'class', 'side', 'showCloseButton'),\n emits,\n)\n// Portaled outside Alfakit's root: carry the reading direction (starter kit pages and\n// standalone components leave <html dir> to the host).\nconst dir = useDirection()\nconst t = useT()\n</script>\n\n<template>\n <DialogPortal>\n <DialogOverlay\n data-slot=\"sheet-overlay\"\n class=\"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\"\n />\n <DialogContent\n data-slot=\"sheet-content\"\n v-bind=\"{ dir, ...forwarded, ...$attrs }\"\n :class=\"\n cn(\n 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500',\n props.side === 'right' &&\n 'data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm',\n props.side === 'left' &&\n 'data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm',\n props.side === 'top' &&\n 'data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b',\n props.side === 'bottom' &&\n 'data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t',\n props.class,\n )\n \"\n >\n <slot />\n <DialogClose\n v-if=\"props.showCloseButton\"\n class=\"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute end-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none\"\n >\n <Icon name=\"alfakit::support.modal.close-button\" :fallback=\"XIcon\" class=\"size-4\" />\n <span class=\"sr-only\">{{ t('close', {}, 'Close') }}</span>\n </DialogClose>\n </DialogContent>\n </DialogPortal>\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetContent.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ui/SheetContent.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SheetContent.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ui/SheetContent.vue"],"names":[],"mappings":"AAmFA,OAAO,EAQL,KAAK,kBAAkB,EACxB,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AAKzC,KAAK,WAAW,GAAG,kBAAkB,GAAG;IAClC,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAA;IAC/B,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;IAC1C,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAC;AAuJN,QAAA,IAAI,QAAQ,IAAY,CAAE;AAC1B,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AA+BhD,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;qBAzLG,OAAO;UADlB,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM;6EAkM9C,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -2,11 +2,11 @@ import { useT as e } from "../../context.js";
|
|
|
2
2
|
import { cn as t } from "../../lib/utils.js";
|
|
3
3
|
import n from "../../lib/Icon.js";
|
|
4
4
|
import { createBlock as r, createCommentVNode as i, createElementVNode as a, createVNode as o, defineComponent as s, mergeProps as c, openBlock as l, renderSlot as u, toDisplayString as d, unref as f, withCtx as p } from "vue";
|
|
5
|
-
import { DialogClose as m, DialogContent as h, DialogOverlay as g, DialogPortal as _,
|
|
6
|
-
import { XIcon as
|
|
7
|
-
import { reactiveOmit as
|
|
5
|
+
import { DialogClose as m, DialogContent as h, DialogOverlay as g, DialogPortal as _, useDirection as v, useForwardPropsEmits as y } from "reka-ui";
|
|
6
|
+
import { XIcon as b } from "@lucide/vue";
|
|
7
|
+
import { reactiveOmit as x } from "@vueuse/core";
|
|
8
8
|
//#region src/components/ui/SheetContent.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
-
var
|
|
9
|
+
var S = { class: "sr-only" }, C = /*@__PURE__*/ s({
|
|
10
10
|
inheritAttrs: !1,
|
|
11
11
|
__name: "SheetContent",
|
|
12
12
|
props: {
|
|
@@ -35,25 +35,26 @@ var x = { class: "sr-only" }, S = /*@__PURE__*/ s({
|
|
|
35
35
|
"openAutoFocus",
|
|
36
36
|
"closeAutoFocus"
|
|
37
37
|
],
|
|
38
|
-
setup(s, { emit:
|
|
39
|
-
let
|
|
38
|
+
setup(s, { emit: C }) {
|
|
39
|
+
let w = s, T = C, E = y(x(w, "class", "side", "showCloseButton"), T), D = v(), O = e();
|
|
40
40
|
return (e, s) => (l(), r(f(_), null, {
|
|
41
41
|
default: p(() => [o(f(g), {
|
|
42
42
|
"data-slot": "sheet-overlay",
|
|
43
43
|
class: "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50"
|
|
44
44
|
}), o(f(h), c({ "data-slot": "sheet-content" }, {
|
|
45
|
-
|
|
45
|
+
dir: f(D),
|
|
46
|
+
...f(E),
|
|
46
47
|
...e.$attrs
|
|
47
|
-
}, { class: f(t)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
48
|
-
default: p(() => [u(e.$slots, "default"),
|
|
48
|
+
}, { class: f(t)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500", w.side === "right" && "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm", w.side === "left" && "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm", w.side === "top" && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b", w.side === "bottom" && "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t", w.class) }), {
|
|
49
|
+
default: p(() => [u(e.$slots, "default"), w.showCloseButton ? (l(), r(f(m), {
|
|
49
50
|
key: 0,
|
|
50
51
|
class: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute end-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none"
|
|
51
52
|
}, {
|
|
52
53
|
default: p(() => [o(f(n), {
|
|
53
54
|
name: "alfakit::support.modal.close-button",
|
|
54
|
-
fallback: f(
|
|
55
|
+
fallback: f(b),
|
|
55
56
|
class: "size-4"
|
|
56
|
-
}, null, 8, ["fallback"]), a("span",
|
|
57
|
+
}, null, 8, ["fallback"]), a("span", S, d(f(O)("close", {}, "Close")), 1)]),
|
|
57
58
|
_: 1
|
|
58
59
|
})) : i("", !0)]),
|
|
59
60
|
_: 3
|
|
@@ -63,6 +64,6 @@ var x = { class: "sr-only" }, S = /*@__PURE__*/ s({
|
|
|
63
64
|
}
|
|
64
65
|
});
|
|
65
66
|
//#endregion
|
|
66
|
-
export {
|
|
67
|
+
export { C as default };
|
|
67
68
|
|
|
68
69
|
//# sourceMappingURL=SheetContent.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetContent.vue_vue_type_script_setup_true_lang.js","names":["$attrs","_openBlock","_createBlock","_unref","_withCtx","_createVNode","_mergeProps","_renderSlot","Icon","_createElementVNode","_toDisplayString","_createCommentVNode","Icon_default","_hoisted_1","SheetContent_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emits","forwarded","useForwardPropsEmits","reactiveOmit","t","useT","openBlock","createBlock","unref","DialogPortal","withCtx","createVNode","DialogOverlay","DialogContent","mergeProps","_ctx","cn","renderSlot","DialogClose","XIcon","createElementVNode","toDisplayString","createCommentVNode"],"sources":["../../../src/components/ui/SheetContent.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { XIcon } from '@lucide/vue'\nimport { reactiveOmit } from '@vueuse/core'\nimport {\n DialogClose,\n DialogContent,\n DialogOverlay,\n DialogPortal,\n useForwardPropsEmits,\n type DialogContentEmits,\n type DialogContentProps,\n} from 'reka-ui'\nimport type { HTMLAttributes } from 'vue'\nimport { Icon } from '../../lib/icons'\nimport { cn } from '../../lib/utils'\nimport { useT } from '../../context'\n\nconst props = withDefaults(\n defineProps<\n DialogContentProps & {\n class?: HTMLAttributes['class']\n side?: 'top' | 'right' | 'bottom' | 'left'\n showCloseButton?: boolean\n }\n >(),\n { side: 'right', showCloseButton: true },\n)\n// The root is the portal, so extra attributes (data-slot, role, data-*) would be lost:\n// forward them to the content element like the React and Svelte wrappers. `class` is a prop\n// and is merged below, never replaced.\ndefineOptions({ inheritAttrs: false })\n\nconst emits = defineEmits<DialogContentEmits>()\nconst forwarded = useForwardPropsEmits(\n reactiveOmit(props, 'class', 'side', 'showCloseButton'),\n emits,\n)\nconst t = useT()\n</script>\n\n<template>\n <DialogPortal>\n <DialogOverlay\n data-slot=\"sheet-overlay\"\n class=\"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\"\n />\n <DialogContent\n data-slot=\"sheet-content\"\n v-bind=\"{ ...forwarded, ...$attrs }\"\n :class=\"\n cn(\n 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500',\n props.side === 'right' &&\n 'data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm',\n props.side === 'left' &&\n 'data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm',\n props.side === 'top' &&\n 'data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b',\n props.side === 'bottom' &&\n 'data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t',\n props.class,\n )\n \"\n >\n <slot />\n <DialogClose\n v-if=\"props.showCloseButton\"\n class=\"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute end-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none\"\n >\n <Icon name=\"alfakit::support.modal.close-button\" :fallback=\"XIcon\" class=\"size-4\" />\n <span class=\"sr-only\">{{ t('close', {}, 'Close') }}</span>\n </DialogClose>\n </DialogContent>\n </DialogPortal>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"SheetContent.vue_vue_type_script_setup_true_lang.js","names":["$attrs","_openBlock","_createBlock","_unref","_withCtx","_createVNode","_mergeProps","_renderSlot","Icon","_createElementVNode","_toDisplayString","_createCommentVNode","Icon_default","_hoisted_1","SheetContent_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emits","forwarded","useForwardPropsEmits","reactiveOmit","dir","useDirection","t","useT","openBlock","createBlock","unref","DialogPortal","withCtx","createVNode","DialogOverlay","DialogContent","mergeProps","_ctx","cn","renderSlot","DialogClose","XIcon","createElementVNode","toDisplayString","createCommentVNode"],"sources":["../../../src/components/ui/SheetContent.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { XIcon } from '@lucide/vue'\nimport { reactiveOmit } from '@vueuse/core'\nimport {\n DialogClose,\n DialogContent,\n DialogOverlay,\n DialogPortal,\n useDirection,\n useForwardPropsEmits,\n type DialogContentEmits,\n type DialogContentProps,\n} from 'reka-ui'\nimport type { HTMLAttributes } from 'vue'\nimport { Icon } from '../../lib/icons'\nimport { cn } from '../../lib/utils'\nimport { useT } from '../../context'\n\nconst props = withDefaults(\n defineProps<\n DialogContentProps & {\n class?: HTMLAttributes['class']\n side?: 'top' | 'right' | 'bottom' | 'left'\n showCloseButton?: boolean\n }\n >(),\n { side: 'right', showCloseButton: true },\n)\n// The root is the portal, so extra attributes (data-slot, role, data-*) would be lost:\n// forward them to the content element like the React and Svelte wrappers. `class` is a prop\n// and is merged below, never replaced.\ndefineOptions({ inheritAttrs: false })\n\nconst emits = defineEmits<DialogContentEmits>()\nconst forwarded = useForwardPropsEmits(\n reactiveOmit(props, 'class', 'side', 'showCloseButton'),\n emits,\n)\n// Portaled outside Alfakit's root: carry the reading direction (starter kit pages and\n// standalone components leave <html dir> to the host).\nconst dir = useDirection()\nconst t = useT()\n</script>\n\n<template>\n <DialogPortal>\n <DialogOverlay\n data-slot=\"sheet-overlay\"\n class=\"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\"\n />\n <DialogContent\n data-slot=\"sheet-content\"\n v-bind=\"{ dir, ...forwarded, ...$attrs }\"\n :class=\"\n cn(\n 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500',\n props.side === 'right' &&\n 'data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm',\n props.side === 'left' &&\n 'data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm',\n props.side === 'top' &&\n 'data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b',\n props.side === 'bottom' &&\n 'data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t',\n props.class,\n )\n \"\n >\n <slot />\n <DialogClose\n v-if=\"props.showCloseButton\"\n class=\"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute end-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none\"\n >\n <Icon name=\"alfakit::support.modal.close-button\" :fallback=\"XIcon\" class=\"size-4\" />\n <span class=\"sr-only\">{{ t('close', {}, 'Close') }}</span>\n </DialogClose>\n </DialogContent>\n </DialogPortal>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBA,IAAMgB,IAAQC,GAeRC,IAAQH,GACRI,IAAYC,EAChBC,EAAaL,GAAO,SAAS,QAAQ,iBAAiB,GACtDE,CACF,GAGMI,IAAMC,EAAa,GACnBC,IAAIC,EAAK;oBAIbxB,EAAA,GAAAC,EAgCeC,EAAA0B,CAAA,GAAA,MAAA;GA/Bb,SAAAzB,QAGE,CAHFC,EAGEF,EAAA6B,CAAA,GAAA;IAFA,aAAU;IACV,OAAM;GAER3B,CAAAA,GAAAA,EA0BgBF,EAAA8B,CAAA,GA1BhB3B,EA0BgB,EAzBd,aAAU,gBAAe,GAAA;IAAA,KACfH,EAAAmB,CAAA;IAAG,GAAKnB,EAAAgB,CAAA;IAAS,GAAKnB,EAAAA;GAAM,GAAA,EACrC,OAAgBG,EAAAiC,CAAA,CAAE,CAAA,8MAAoOpB,EAAM,SAAI,WAAA,oIAA0KA,EAAM,SAAI,UAAA,iIAAsKA,EAAM,SAAI,SAAA,4GAAgJA,EAAM,SAAI,YAAA,qHAA4JA,EAAM,KAAA,EAAA,CAAA,GAAA;IAej6B,SAAAZ,QAAQ,CAARG,EAAQ4B,EAAA,QAAA,SAAA,GAEAnB,EAAM,mBADdf,EAAA,GAAAC,EAMcC,EAAAmC,CAAA,GAAA;;KAJZ,OAAM;;KAEN,SAAAlC,QAAoF,CAApFC,EAAoFF,EAAAK,CAAA,GAAA;MAA9E,MAAK;MAAuC,UAAUL,EAAAoC,CAAA;MAAO,OAAM;KACzE9B,GAAAA,MAAAA,GAAAA,CAAAA,UAAAA,CAAAA,GAAAA,EAA0D,QAA1DI,GAA0DH,EAAjCP,EAAAqB,CAAA,CAAC,CAAA,SAAA,CAAA,GAAA,OAAA,CAAA,GAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TooltipContent.js","names":["_sfc_main","TooltipContent_vue_vue_type_script_setup_true_lang_default","TooltipContent_default"],"sources":["../../../src/components/ui/TooltipContent.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { reactiveOmit } from '@vueuse/core'\nimport {\n TooltipArrow,\n TooltipContent,\n TooltipPortal,\n useForwardPropsEmits,\n type TooltipContentEmits,\n type TooltipContentProps,\n} from 'reka-ui'\nimport type { HTMLAttributes } from 'vue'\nimport { cn } from '../../lib/utils'\n\nconst props = withDefaults(\n defineProps<TooltipContentProps & { class?: HTMLAttributes['class'] }>(),\n { sideOffset: 4 },\n)\n// The root is the portal, so extra attributes (data-slot, role, data-*) would be lost:\n// forward them to the content element. `class` is a prop and is merged, never replaced.\ndefineOptions({ inheritAttrs: false })\n\nconst emits = defineEmits<TooltipContentEmits>()\nconst forwarded = useForwardPropsEmits(reactiveOmit(props, 'class'), emits)\n</script>\n\n<template>\n <TooltipPortal>\n <TooltipContent\n data-slot=\"tooltip-content\"\n v-bind=\"{ ...forwarded, ...$attrs }\"\n :class=\"\n cn(\n 'bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--reka-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance',\n props.class,\n )\n \"\n >\n <slot />\n <TooltipArrow\n class=\"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]\"\n />\n </TooltipContent>\n </TooltipPortal>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"TooltipContent.js","names":["_sfc_main","TooltipContent_vue_vue_type_script_setup_true_lang_default","TooltipContent_default"],"sources":["../../../src/components/ui/TooltipContent.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { reactiveOmit } from '@vueuse/core'\nimport {\n TooltipArrow,\n TooltipContent,\n TooltipPortal,\n useDirection,\n useForwardPropsEmits,\n type TooltipContentEmits,\n type TooltipContentProps,\n} from 'reka-ui'\nimport type { HTMLAttributes } from 'vue'\nimport { cn } from '../../lib/utils'\n\nconst props = withDefaults(\n defineProps<TooltipContentProps & { class?: HTMLAttributes['class'] }>(),\n { sideOffset: 4 },\n)\n// The root is the portal, so extra attributes (data-slot, role, data-*) would be lost:\n// forward them to the content element. `class` is a prop and is merged, never replaced.\ndefineOptions({ inheritAttrs: false })\n\nconst emits = defineEmits<TooltipContentEmits>()\nconst forwarded = useForwardPropsEmits(reactiveOmit(props, 'class'), emits)\n// Portaled outside Alfakit's root: carry the reading direction (starter kit pages and\n// standalone components leave <html dir> to the host).\nconst dir = useDirection()\n</script>\n\n<template>\n <TooltipPortal>\n <TooltipContent\n data-slot=\"tooltip-content\"\n v-bind=\"{ dir, ...forwarded, ...$attrs }\"\n :class=\"\n cn(\n 'bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--reka-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance',\n props.class,\n )\n \"\n >\n <slot />\n <TooltipArrow\n class=\"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]\"\n />\n </TooltipContent>\n </TooltipPortal>\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TooltipContent.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ui/TooltipContent.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TooltipContent.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ui/TooltipContent.vue"],"names":[],"mappings":"AAmDA,OAAO,EAOL,KAAK,mBAAmB,EACzB,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AAGzC,KAAK,WAAW,GAAG,mBAAmB,GAAG;IAAE,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAA;CAAE,CAAC;AA+E7E,QAAA,IAAI,QAAQ,IAAW,CAAE;AACzB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AA2BhD,QAAA,MAAM,eAAe;;;;;;;;6EAQnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { cn as e } from "../../lib/utils.js";
|
|
2
2
|
import { createBlock as t, createVNode as n, defineComponent as r, mergeProps as i, openBlock as a, renderSlot as o, unref as s, withCtx as c } from "vue";
|
|
3
|
-
import { TooltipArrow as l, TooltipContent as u, TooltipPortal as d,
|
|
4
|
-
import { reactiveOmit as
|
|
3
|
+
import { TooltipArrow as l, TooltipContent as u, TooltipPortal as d, useDirection as f, useForwardPropsEmits as p } from "reka-ui";
|
|
4
|
+
import { reactiveOmit as m } from "@vueuse/core";
|
|
5
5
|
//#region src/components/ui/TooltipContent.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
6
|
+
var h = /*@__PURE__*/ r({
|
|
7
7
|
inheritAttrs: !1,
|
|
8
8
|
__name: "TooltipContent",
|
|
9
9
|
props: {
|
|
@@ -32,13 +32,14 @@ var m = /*@__PURE__*/ r({
|
|
|
32
32
|
] }
|
|
33
33
|
},
|
|
34
34
|
emits: ["escapeKeyDown", "pointerDownOutside"],
|
|
35
|
-
setup(r, { emit:
|
|
36
|
-
let
|
|
35
|
+
setup(r, { emit: h }) {
|
|
36
|
+
let g = r, _ = h, v = p(m(g, "class"), _), y = f();
|
|
37
37
|
return (r, f) => (a(), t(s(d), null, {
|
|
38
38
|
default: c(() => [n(s(u), i({ "data-slot": "tooltip-content" }, {
|
|
39
|
-
|
|
39
|
+
dir: s(y),
|
|
40
|
+
...s(v),
|
|
40
41
|
...r.$attrs
|
|
41
|
-
}, { class: s(e)("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--reka-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
|
|
42
|
+
}, { class: s(e)("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--reka-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance", g.class) }), {
|
|
42
43
|
default: c(() => [o(r.$slots, "default"), n(s(l), { class: "bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })]),
|
|
43
44
|
_: 3
|
|
44
45
|
}, 16, ["class"])]),
|
|
@@ -47,6 +48,6 @@ var m = /*@__PURE__*/ r({
|
|
|
47
48
|
}
|
|
48
49
|
});
|
|
49
50
|
//#endregion
|
|
50
|
-
export {
|
|
51
|
+
export { h as default };
|
|
51
52
|
|
|
52
53
|
//# sourceMappingURL=TooltipContent.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TooltipContent.vue_vue_type_script_setup_true_lang.js","names":["$attrs","_openBlock","_createBlock","_unref","_withCtx","_createVNode","_mergeProps","_renderSlot","TooltipContent_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emits","forwarded","useForwardPropsEmits","reactiveOmit","openBlock","createBlock","unref","TooltipPortal","withCtx","createVNode","TooltipContent","mergeProps","_ctx","cn","renderSlot","TooltipArrow"],"sources":["../../../src/components/ui/TooltipContent.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { reactiveOmit } from '@vueuse/core'\nimport {\n TooltipArrow,\n TooltipContent,\n TooltipPortal,\n useForwardPropsEmits,\n type TooltipContentEmits,\n type TooltipContentProps,\n} from 'reka-ui'\nimport type { HTMLAttributes } from 'vue'\nimport { cn } from '../../lib/utils'\n\nconst props = withDefaults(\n defineProps<TooltipContentProps & { class?: HTMLAttributes['class'] }>(),\n { sideOffset: 4 },\n)\n// The root is the portal, so extra attributes (data-slot, role, data-*) would be lost:\n// forward them to the content element. `class` is a prop and is merged, never replaced.\ndefineOptions({ inheritAttrs: false })\n\nconst emits = defineEmits<TooltipContentEmits>()\nconst forwarded = useForwardPropsEmits(reactiveOmit(props, 'class'), emits)\n</script>\n\n<template>\n <TooltipPortal>\n <TooltipContent\n data-slot=\"tooltip-content\"\n v-bind=\"{ ...forwarded, ...$attrs }\"\n :class=\"\n cn(\n 'bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--reka-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance',\n props.class,\n )\n \"\n >\n <slot />\n <TooltipArrow\n class=\"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]\"\n />\n </TooltipContent>\n </TooltipPortal>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"TooltipContent.vue_vue_type_script_setup_true_lang.js","names":["$attrs","_openBlock","_createBlock","_unref","_withCtx","_createVNode","_mergeProps","_renderSlot","TooltipContent_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emits","forwarded","useForwardPropsEmits","reactiveOmit","dir","useDirection","openBlock","createBlock","unref","TooltipPortal","withCtx","createVNode","TooltipContent","mergeProps","_ctx","cn","renderSlot","TooltipArrow"],"sources":["../../../src/components/ui/TooltipContent.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { reactiveOmit } from '@vueuse/core'\nimport {\n TooltipArrow,\n TooltipContent,\n TooltipPortal,\n useDirection,\n useForwardPropsEmits,\n type TooltipContentEmits,\n type TooltipContentProps,\n} from 'reka-ui'\nimport type { HTMLAttributes } from 'vue'\nimport { cn } from '../../lib/utils'\n\nconst props = withDefaults(\n defineProps<TooltipContentProps & { class?: HTMLAttributes['class'] }>(),\n { sideOffset: 4 },\n)\n// The root is the portal, so extra attributes (data-slot, role, data-*) would be lost:\n// forward them to the content element. `class` is a prop and is merged, never replaced.\ndefineOptions({ inheritAttrs: false })\n\nconst emits = defineEmits<TooltipContentEmits>()\nconst forwarded = useForwardPropsEmits(reactiveOmit(props, 'class'), emits)\n// Portaled outside Alfakit's root: carry the reading direction (starter kit pages and\n// standalone components leave <html dir> to the host).\nconst dir = useDirection()\n</script>\n\n<template>\n <TooltipPortal>\n <TooltipContent\n data-slot=\"tooltip-content\"\n v-bind=\"{ dir, ...forwarded, ...$attrs }\"\n :class=\"\n cn(\n 'bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--reka-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance',\n props.class,\n )\n \"\n >\n <slot />\n <TooltipArrow\n class=\"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]\"\n />\n </TooltipContent>\n </TooltipPortal>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcA,IAAMU,IAAQC,GAQRC,IAAQH,GACRI,IAAYC,EAAqBC,EAAaL,GAAO,OAAO,GAAGE,CAAK,GAGpEI,IAAMC,EAAa;oBAIvBhB,EAAA,GAAAC,EAgBgBC,EAAAkB,CAAA,GAAA,MAAA;GAfd,SAAAjB,QAciB,CAdjBC,EAciBF,EAAAqB,CAAA,GAdjBlB,EAciB,EAbf,aAAU,kBAAiB,GAAA;IAAA,KACjBH,EAAAa,CAAA;IAAG,GAAKb,EAAAU,CAAA;IAAS,GAAKb,EAAAA;GAAM,GAAA,EACrC,OAAgBG,EAAAwB,CAAA,CAAE,CAAA,oaAA0bjB,EAAM,KAAA,EAAA,CAAA,GAAA;IAOnd,SAAAN,QAAQ,CAARG,EAAQmB,EAAA,QAAA,SAAA,GACRrB,EAEEF,EAAA0B,CAAA,GAAA,EADA,OAAM,qGAAoG,CAAA,CAAA,CAAA"}
|
package/dist/context.d.ts
CHANGED
|
@@ -12,6 +12,11 @@ export interface AlfakitContextValue {
|
|
|
12
12
|
* their own schemas by token.
|
|
13
13
|
*/
|
|
14
14
|
poll?: (target: string, interval: string | number | null | undefined) => () => void;
|
|
15
|
+
/**
|
|
16
|
+
* Fetches fresh schemas of components now (`live()` tables and widgets after a record
|
|
17
|
+
* change). Panels leave it out (a partial reload); components outside panels fetch theirs.
|
|
18
|
+
*/
|
|
19
|
+
refresh?: (targets: string[]) => Promise<void>;
|
|
15
20
|
}
|
|
16
21
|
export declare const ALFAKIT_KEY: InjectionKey<AlfakitContextValue>;
|
|
17
22
|
/**
|
|
@@ -29,6 +34,8 @@ export declare function useStandalone(): StandaloneContextValue | null;
|
|
|
29
34
|
export declare function useOptionalAlfakit(): AlfakitContextValue | null;
|
|
30
35
|
/** Poll a component (`table`, `widget:<id>`); the returned function stops it. */
|
|
31
36
|
export declare function usePollComponent(): NonNullable<AlfakitContextValue['poll']>;
|
|
37
|
+
/** How `live()` components refresh: their own fetch outside panels, else a partial reload. */
|
|
38
|
+
export declare function useRefreshComponents(): AlfakitContextValue['refresh'];
|
|
32
39
|
export declare function provideAlfakit(value: AlfakitContextValue): void;
|
|
33
40
|
export declare function useAlfakit(): AlfakitContextValue;
|
|
34
41
|
/** The shared `alfakit` prop (panel, navigation, user, endpoints…). */
|
package/dist/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAGf,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,UAAU,EAChB,MAAM,eAAe,CAAA;AAEtB,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,GAAG,EACT,MAAM,KAAK,CAAA;AAGZ,MAAM,MAAM,YAAY,GAAG,SAAS,CAAC,GAAG,CAAC,CAAA;AAEzC,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAA;IACzC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IACnC,OAAO,EAAE,YAAY,CAAA;IACrB,UAAU,EAAE,UAAU,CAAA;IACtB;;;;OAIG;IACH,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,KAAK,MAAM,IAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAGf,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,UAAU,EAChB,MAAM,eAAe,CAAA;AAEtB,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,GAAG,EACT,MAAM,KAAK,CAAA;AAGZ,MAAM,MAAM,YAAY,GAAG,SAAS,CAAC,GAAG,CAAC,CAAA;AAEzC,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAA;IACzC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IACnC,OAAO,EAAE,YAAY,CAAA;IACrB,UAAU,EAAE,UAAU,CAAA;IACtB;;;;OAIG;IACH,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,KAAK,MAAM,IAAI,CAAA;IACnF;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAC/C;AAED,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC,mBAAmB,CAAqB,CAAA;AAE/E;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,GAAG,CAAC,WAAW,CAAC,CAAA;IACvB,IAAI,EAAE,GAAG,CAAC,UAAU,CAAC,CAAA;CACtB;AAED,eAAO,MAAM,cAAc,EAAE,YAAY,CAAC,sBAAsB,CAAgC,CAAA;AAEhG,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,IAAI,CAErE;AAED,wBAAgB,aAAa,IAAI,sBAAsB,GAAG,IAAI,CAE7D;AAED,wGAAwG;AACxG,wBAAgB,kBAAkB,IAAI,mBAAmB,GAAG,IAAI,CAE/D;AAED,iFAAiF;AACjF,wBAAgB,gBAAgB,IAAI,WAAW,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAE3E;AAED,8FAA8F;AAC9F,wBAAgB,oBAAoB,IAAI,mBAAmB,CAAC,SAAS,CAAC,CAErE;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI,CAE/D;AAED,wBAAgB,UAAU,IAAI,mBAAmB,CAQhD;AAQD,uEAAuE;AACvE,wBAAgB,QAAQ,IAAI,WAAW,CAAC,WAAW,CAAC,CAWnD;AAED,wBAAgB,aAAa,IAAI,WAAW,CAAC,UAAU,GAAG,SAAS,CAAC,CAKnE;AAED,wBAAgB,eAAe,IAAI,WAAW,CAAC,gBAAgB,CAAC,CAE/D;AAQD,0EAA0E;AAC1E,wBAAgB,IAAI,IAAI,UAAU,CAAC,GAAG,CAAC,CAItC;AAED,yFAAyF;AACzF,wBAAgB,SAAS,IAAI,UAAU,CAAC,QAAQ,CAAC,CAIhD;AASD,6EAA6E;AAC7E,wBAAgB,eAAe,IAAI,WAAW,CAAC,kBAAkB,CAAC,CAOjE;AAED,wBAAgB,YAAY,IAAI,WAAW,CAAC,KAAK,GAAG,KAAK,CAAC,CAOzD;AAED,yGAAyG;AACzG,wBAAgB,YAAY,IAAI,WAAW,CAAC,eAAe,CAAC,CAoB3D;AAED,wBAAgB,eAAe,IAAI,YAAY,CAE9C;AAED,wBAAgB,WAAW,IAAI,iBAAiB,CAAC,YAAY,CAAC,CAE7D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,iBAAiB,CAAC,YAAY,CAAC,GAAG,IAAI,CAE5E"}
|
package/dist/context.js
CHANGED
|
@@ -15,54 +15,57 @@ function f() {
|
|
|
15
15
|
function p() {
|
|
16
16
|
return o(c, null)?.poll ?? t;
|
|
17
17
|
}
|
|
18
|
-
function m(
|
|
18
|
+
function m() {
|
|
19
|
+
return o(c, null)?.refresh;
|
|
20
|
+
}
|
|
21
|
+
function h(e) {
|
|
19
22
|
s(c, e);
|
|
20
23
|
}
|
|
21
|
-
function
|
|
24
|
+
function g() {
|
|
22
25
|
let e = o(c, null);
|
|
23
26
|
if (!e) throw Error("Alfakit components must be rendered inside createAlfakit().");
|
|
24
27
|
return e;
|
|
25
28
|
}
|
|
26
|
-
function
|
|
29
|
+
function _() {
|
|
27
30
|
let e = i();
|
|
28
31
|
return a(() => e.props);
|
|
29
32
|
}
|
|
30
|
-
function _() {
|
|
31
|
-
let e = o(l, null), t = g();
|
|
32
|
-
return a(() => n(e?.panel.value ?? t.value.alfakit, t.value.alfakitNavigationBadges));
|
|
33
|
-
}
|
|
34
33
|
function v() {
|
|
35
|
-
let e = o(l, null), t =
|
|
36
|
-
return a(() => e?.
|
|
34
|
+
let e = o(l, null), t = _();
|
|
35
|
+
return a(() => n(e?.panel.value ?? t.value.alfakit, t.value.alfakitNavigationBadges));
|
|
37
36
|
}
|
|
38
37
|
function y() {
|
|
39
|
-
|
|
38
|
+
let e = o(l, null), t = _();
|
|
39
|
+
return a(() => e?.page.value ?? t.value.page);
|
|
40
40
|
}
|
|
41
41
|
function b() {
|
|
42
|
-
return
|
|
42
|
+
return _();
|
|
43
43
|
}
|
|
44
44
|
function x() {
|
|
45
|
-
|
|
46
|
-
return e.t.bind(e);
|
|
45
|
+
return o(c, null)?.translator ?? r;
|
|
47
46
|
}
|
|
48
47
|
function S() {
|
|
49
|
-
let e =
|
|
50
|
-
return e.
|
|
48
|
+
let e = x();
|
|
49
|
+
return e.t.bind(e);
|
|
51
50
|
}
|
|
52
51
|
function C() {
|
|
52
|
+
let e = x();
|
|
53
|
+
return e.choice.bind(e);
|
|
54
|
+
}
|
|
55
|
+
function w() {
|
|
53
56
|
let e = i();
|
|
54
57
|
return a(() => e.props);
|
|
55
58
|
}
|
|
56
|
-
function
|
|
57
|
-
let e = o(l, null), t =
|
|
59
|
+
function T() {
|
|
60
|
+
let e = o(l, null), t = w();
|
|
58
61
|
return a(() => (e?.panel.value ?? t.value?.alfakit)?.localization);
|
|
59
62
|
}
|
|
60
|
-
function
|
|
61
|
-
let e = o(l, null), t =
|
|
63
|
+
function E() {
|
|
64
|
+
let e = o(l, null), t = w();
|
|
62
65
|
return a(() => (e?.panel.value ?? t.value?.alfakit)?.localization?.direction ?? "ltr");
|
|
63
66
|
}
|
|
64
|
-
function
|
|
65
|
-
let t = o(l, null), n =
|
|
67
|
+
function D() {
|
|
68
|
+
let t = o(l, null), n = w(), r = a(() => {
|
|
66
69
|
let e = (t?.panel.value ?? n.value?.alfakit)?.localization;
|
|
67
70
|
return [
|
|
68
71
|
e?.tag ?? "en",
|
|
@@ -78,16 +81,16 @@ function E() {
|
|
|
78
81
|
}), i.formatter;
|
|
79
82
|
});
|
|
80
83
|
}
|
|
81
|
-
function D() {
|
|
82
|
-
return h().actions;
|
|
83
|
-
}
|
|
84
84
|
function O() {
|
|
85
|
-
return
|
|
85
|
+
return g().actions;
|
|
86
86
|
}
|
|
87
87
|
function k() {
|
|
88
|
+
return g().registry;
|
|
89
|
+
}
|
|
90
|
+
function A() {
|
|
88
91
|
return o(c, null)?.registry ?? null;
|
|
89
92
|
}
|
|
90
93
|
//#endregion
|
|
91
|
-
export { c as ALFAKIT_KEY, l as STANDALONE_KEY,
|
|
94
|
+
export { c as ALFAKIT_KEY, l as STANDALONE_KEY, h as provideAlfakit, u as provideStandalone, O as useActionRunner, g as useAlfakit, b as useAlfakitProps, C as useChoice, E as useDirection, D as useFormatter, T as useLocalization, f as useOptionalAlfakit, A as useOptionalRegistry, y as usePageSchema, v as usePanel, p as usePollComponent, m as useRefreshComponents, k as useRegistry, d as useStandalone, S as useT };
|
|
92
95
|
|
|
93
96
|
//# sourceMappingURL=context.js.map
|
package/dist/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","names":["globalTranslator","ALFAKIT_KEY","STANDALONE_KEY","provideStandalone","value","useStandalone","inject","useOptionalAlfakit","usePollComponent","pollComponent","provideAlfakit","useAlfakit","context","pageProps","page","usePage","computed","usePanel","standalone","props","resolvePanelNavigation","usePageSchema","useAlfakitProps","useTranslator","translator","useT","useChoice","optionalPageProps","useLocalization","useDirection","useFormatter","key","localization","cached","tag","currency","timezone","id","LocaleFormatter","useActionRunner","useRegistry","useOptionalRegistry"],"sources":["../src/context.ts"],"sourcesContent":["import {\n translator as globalTranslator,\n LocaleFormatter,\n pollComponent,\n resolvePanelNavigation,\n type ActionRunner,\n type AlfakitPageProps,\n type ComponentRegistry,\n type LocalizationSchema,\n type PageSchema,\n type PanelSchema,\n type Translator,\n} from '@alfakit/core'\nimport { usePage } from '@inertiajs/vue3'\nimport {\n computed,\n inject,\n provide,\n type Component,\n type ComputedRef,\n type InjectionKey,\n type Ref,\n} from 'vue'\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AnyComponent = Component<any>\n\nexport interface AlfakitContextValue {\n registry: ComponentRegistry<AnyComponent>\n pages: Record<string, AnyComponent>\n actions: ActionRunner\n translator: Translator\n /**\n * Polls a component (`table`, `widget:<id>`) and returns an unsubscribe. Panels use the\n * shared `pollComponent()` (an Inertia partial reload); components outside panels fetch\n * their own schemas by token.\n */\n poll?: (target: string, interval: string | number | null | undefined) => () => void\n}\n\nexport const ALFAKIT_KEY: InjectionKey<AlfakitContextValue> = Symbol('alfakit')\n\n/**\n * Outside panels there is no shared `alfakit` prop and no `page` prop: `<AlfakitComponent>`\n * provides both from its payload, and the composables below read them first.\n */\nexport interface StandaloneContextValue {\n panel: Ref<PanelSchema>\n page: Ref<PageSchema>\n}\n\nexport const STANDALONE_KEY: InjectionKey<StandaloneContextValue> = Symbol('alfakit.standalone')\n\nexport function provideStandalone(value: StandaloneContextValue): void {\n provide(STANDALONE_KEY, value)\n}\n\nexport function useStandalone(): StandaloneContextValue | null {\n return inject(STANDALONE_KEY, null)\n}\n\n/** The context the component renders in, or null outside `createAlfakit()` and `<AlfakitComponent>`. */\nexport function useOptionalAlfakit(): AlfakitContextValue | null {\n return inject(ALFAKIT_KEY, null)\n}\n\n/** Poll a component (`table`, `widget:<id>`); the returned function stops it. */\nexport function usePollComponent(): NonNullable<AlfakitContextValue['poll']> {\n return inject(ALFAKIT_KEY, null)?.poll ?? pollComponent\n}\n\nexport function provideAlfakit(value: AlfakitContextValue): void {\n provide(ALFAKIT_KEY, value)\n}\n\nexport function useAlfakit(): AlfakitContextValue {\n const context = inject(ALFAKIT_KEY, null)\n\n if (!context) {\n throw new Error('Alfakit components must be rendered inside createAlfakit().')\n }\n\n return context\n}\n\nfunction pageProps(): ComputedRef<AlfakitPageProps> {\n const page = usePage<AlfakitPageProps>()\n\n return computed(() => page.props)\n}\n\n/** The shared `alfakit` prop (panel, navigation, user, endpoints…). */\nexport function usePanel(): ComputedRef<PanelSchema> {\n const standalone = inject(STANDALONE_KEY, null)\n const props = pageProps()\n\n // The navigation structure is a once prop; its active items and badges are merged in here.\n return computed(() =>\n resolvePanelNavigation(\n standalone?.panel.value ?? props.value.alfakit,\n props.value.alfakitNavigationBadges,\n ),\n )\n}\n\nexport function usePageSchema(): ComputedRef<PageSchema | undefined> {\n const standalone = inject(STANDALONE_KEY, null)\n const props = pageProps()\n\n return computed(() => standalone?.page.value ?? props.value.page)\n}\n\nexport function useAlfakitProps(): ComputedRef<AlfakitPageProps> {\n return pageProps()\n}\n\nfunction useTranslator(): Translator {\n // Primitives may render outside createAlfakit() (tests, Storybook); fall back to the\n // shared translator so they still show their English defaults.\n return inject(ALFAKIT_KEY, null)?.translator ?? globalTranslator\n}\n\n/** `t('table.showing', { first: 1, last: 10, total: 42 }, 'Fallback')` */\nexport function useT(): Translator['t'] {\n const translator = useTranslator()\n\n return translator.t.bind(translator)\n}\n\n/** Plural-aware lines: `choice('table.selected', 3)` (Laravel `trans_choice` syntax). */\nexport function useChoice(): Translator['choice'] {\n const translator = useTranslator()\n\n return translator.choice.bind(translator)\n}\n\n/** The page's Inertia props; undefined when rendered outside an Inertia app (tests). */\nfunction optionalPageProps(): ComputedRef<AlfakitPageProps | undefined> {\n const page = usePage<AlfakitPageProps>()\n\n return computed(() => page.props as AlfakitPageProps | undefined)\n}\n\n/** The current language, direction, currency, timezone and language list. */\nexport function useLocalization(): ComputedRef<LocalizationSchema> {\n const standalone = inject(STANDALONE_KEY, null)\n const props = optionalPageProps()\n\n return computed(\n () => (standalone?.panel.value ?? props.value?.alfakit)?.localization as LocalizationSchema,\n )\n}\n\nexport function useDirection(): ComputedRef<'ltr' | 'rtl'> {\n const standalone = inject(STANDALONE_KEY, null)\n const props = optionalPageProps()\n\n return computed(\n () => (standalone?.panel.value ?? props.value?.alfakit)?.localization?.direction ?? 'ltr',\n )\n}\n\n/** `Intl` formatting in the user's locale: `format.value.money(12.5)`, `format.value.relative(date)`. */\nexport function useFormatter(): ComputedRef<LocaleFormatter> {\n const standalone = inject(STANDALONE_KEY, null)\n const props = optionalPageProps()\n const key = computed(() => {\n const localization = (standalone?.panel.value ?? props.value?.alfakit)?.localization\n\n return [localization?.tag ?? 'en', localization?.currency ?? 'USD', localization?.timezone]\n })\n let cached: { key: string; formatter: LocaleFormatter } | null = null\n\n return computed(() => {\n const [tag, currency, timezone] = key.value\n const id = `${tag}|${currency}|${timezone ?? ''}`\n\n if (cached?.key !== id) {\n cached = { key: id, formatter: new LocaleFormatter(tag, currency, timezone) }\n }\n\n return cached.formatter\n })\n}\n\nexport function useActionRunner(): ActionRunner {\n return useAlfakit().actions\n}\n\nexport function useRegistry(): ComponentRegistry<AnyComponent> {\n return useAlfakit().registry\n}\n\n/**\n * The component registry when rendered inside `createAlfakit()`, otherwise null (primitives\n * rendered on their own in tests or Storybook).\n */\nexport function useOptionalRegistry(): ComponentRegistry<AnyComponent> | null {\n return inject(ALFAKIT_KEY, null)?.registry ?? null\n}\n"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"context.js","names":["globalTranslator","ALFAKIT_KEY","STANDALONE_KEY","provideStandalone","value","useStandalone","inject","useOptionalAlfakit","usePollComponent","pollComponent","useRefreshComponents","provideAlfakit","useAlfakit","context","pageProps","page","usePage","computed","usePanel","standalone","props","resolvePanelNavigation","usePageSchema","useAlfakitProps","useTranslator","translator","useT","useChoice","optionalPageProps","useLocalization","useDirection","useFormatter","key","localization","cached","tag","currency","timezone","id","LocaleFormatter","useActionRunner","useRegistry","useOptionalRegistry"],"sources":["../src/context.ts"],"sourcesContent":["import {\n translator as globalTranslator,\n LocaleFormatter,\n pollComponent,\n resolvePanelNavigation,\n type ActionRunner,\n type AlfakitPageProps,\n type ComponentRegistry,\n type LocalizationSchema,\n type PageSchema,\n type PanelSchema,\n type Translator,\n} from '@alfakit/core'\nimport { usePage } from '@inertiajs/vue3'\nimport {\n computed,\n inject,\n provide,\n type Component,\n type ComputedRef,\n type InjectionKey,\n type Ref,\n} from 'vue'\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AnyComponent = Component<any>\n\nexport interface AlfakitContextValue {\n registry: ComponentRegistry<AnyComponent>\n pages: Record<string, AnyComponent>\n actions: ActionRunner\n translator: Translator\n /**\n * Polls a component (`table`, `widget:<id>`) and returns an unsubscribe. Panels use the\n * shared `pollComponent()` (an Inertia partial reload); components outside panels fetch\n * their own schemas by token.\n */\n poll?: (target: string, interval: string | number | null | undefined) => () => void\n /**\n * Fetches fresh schemas of components now (`live()` tables and widgets after a record\n * change). Panels leave it out (a partial reload); components outside panels fetch theirs.\n */\n refresh?: (targets: string[]) => Promise<void>\n}\n\nexport const ALFAKIT_KEY: InjectionKey<AlfakitContextValue> = Symbol('alfakit')\n\n/**\n * Outside panels there is no shared `alfakit` prop and no `page` prop: `<AlfakitComponent>`\n * provides both from its payload, and the composables below read them first.\n */\nexport interface StandaloneContextValue {\n panel: Ref<PanelSchema>\n page: Ref<PageSchema>\n}\n\nexport const STANDALONE_KEY: InjectionKey<StandaloneContextValue> = Symbol('alfakit.standalone')\n\nexport function provideStandalone(value: StandaloneContextValue): void {\n provide(STANDALONE_KEY, value)\n}\n\nexport function useStandalone(): StandaloneContextValue | null {\n return inject(STANDALONE_KEY, null)\n}\n\n/** The context the component renders in, or null outside `createAlfakit()` and `<AlfakitComponent>`. */\nexport function useOptionalAlfakit(): AlfakitContextValue | null {\n return inject(ALFAKIT_KEY, null)\n}\n\n/** Poll a component (`table`, `widget:<id>`); the returned function stops it. */\nexport function usePollComponent(): NonNullable<AlfakitContextValue['poll']> {\n return inject(ALFAKIT_KEY, null)?.poll ?? pollComponent\n}\n\n/** How `live()` components refresh: their own fetch outside panels, else a partial reload. */\nexport function useRefreshComponents(): AlfakitContextValue['refresh'] {\n return inject(ALFAKIT_KEY, null)?.refresh\n}\n\nexport function provideAlfakit(value: AlfakitContextValue): void {\n provide(ALFAKIT_KEY, value)\n}\n\nexport function useAlfakit(): AlfakitContextValue {\n const context = inject(ALFAKIT_KEY, null)\n\n if (!context) {\n throw new Error('Alfakit components must be rendered inside createAlfakit().')\n }\n\n return context\n}\n\nfunction pageProps(): ComputedRef<AlfakitPageProps> {\n const page = usePage<AlfakitPageProps>()\n\n return computed(() => page.props)\n}\n\n/** The shared `alfakit` prop (panel, navigation, user, endpoints…). */\nexport function usePanel(): ComputedRef<PanelSchema> {\n const standalone = inject(STANDALONE_KEY, null)\n const props = pageProps()\n\n // The navigation structure is a once prop; its active items and badges are merged in here.\n return computed(() =>\n resolvePanelNavigation(\n standalone?.panel.value ?? props.value.alfakit,\n props.value.alfakitNavigationBadges,\n ),\n )\n}\n\nexport function usePageSchema(): ComputedRef<PageSchema | undefined> {\n const standalone = inject(STANDALONE_KEY, null)\n const props = pageProps()\n\n return computed(() => standalone?.page.value ?? props.value.page)\n}\n\nexport function useAlfakitProps(): ComputedRef<AlfakitPageProps> {\n return pageProps()\n}\n\nfunction useTranslator(): Translator {\n // Primitives may render outside createAlfakit() (tests, Storybook); fall back to the\n // shared translator so they still show their English defaults.\n return inject(ALFAKIT_KEY, null)?.translator ?? globalTranslator\n}\n\n/** `t('table.showing', { first: 1, last: 10, total: 42 }, 'Fallback')` */\nexport function useT(): Translator['t'] {\n const translator = useTranslator()\n\n return translator.t.bind(translator)\n}\n\n/** Plural-aware lines: `choice('table.selected', 3)` (Laravel `trans_choice` syntax). */\nexport function useChoice(): Translator['choice'] {\n const translator = useTranslator()\n\n return translator.choice.bind(translator)\n}\n\n/** The page's Inertia props; undefined when rendered outside an Inertia app (tests). */\nfunction optionalPageProps(): ComputedRef<AlfakitPageProps | undefined> {\n const page = usePage<AlfakitPageProps>()\n\n return computed(() => page.props as AlfakitPageProps | undefined)\n}\n\n/** The current language, direction, currency, timezone and language list. */\nexport function useLocalization(): ComputedRef<LocalizationSchema> {\n const standalone = inject(STANDALONE_KEY, null)\n const props = optionalPageProps()\n\n return computed(\n () => (standalone?.panel.value ?? props.value?.alfakit)?.localization as LocalizationSchema,\n )\n}\n\nexport function useDirection(): ComputedRef<'ltr' | 'rtl'> {\n const standalone = inject(STANDALONE_KEY, null)\n const props = optionalPageProps()\n\n return computed(\n () => (standalone?.panel.value ?? props.value?.alfakit)?.localization?.direction ?? 'ltr',\n )\n}\n\n/** `Intl` formatting in the user's locale: `format.value.money(12.5)`, `format.value.relative(date)`. */\nexport function useFormatter(): ComputedRef<LocaleFormatter> {\n const standalone = inject(STANDALONE_KEY, null)\n const props = optionalPageProps()\n const key = computed(() => {\n const localization = (standalone?.panel.value ?? props.value?.alfakit)?.localization\n\n return [localization?.tag ?? 'en', localization?.currency ?? 'USD', localization?.timezone]\n })\n let cached: { key: string; formatter: LocaleFormatter } | null = null\n\n return computed(() => {\n const [tag, currency, timezone] = key.value\n const id = `${tag}|${currency}|${timezone ?? ''}`\n\n if (cached?.key !== id) {\n cached = { key: id, formatter: new LocaleFormatter(tag, currency, timezone) }\n }\n\n return cached.formatter\n })\n}\n\nexport function useActionRunner(): ActionRunner {\n return useAlfakit().actions\n}\n\nexport function useRegistry(): ComponentRegistry<AnyComponent> {\n return useAlfakit().registry\n}\n\n/**\n * The component registry when rendered inside `createAlfakit()`, otherwise null (primitives\n * rendered on their own in tests or Storybook).\n */\nexport function useOptionalRegistry(): ComponentRegistry<AnyComponent> | null {\n return inject(ALFAKIT_KEY, null)?.registry ?? null\n}\n"],"mappings":";;;;AA6CA,IAAaC,IAAiD,OAAO,SAAS,GAWjEC,IAAuD,OAAO,oBAAoB;AAE/F,SAAgBC,EAAkB,GAAqC;CACrE,EAAQD,GAAgBE,CAAK;AAC/B;AAEA,SAAgBC,IAA+C;CAC7D,OAAOC,EAAOJ,GAAgB,IAAI;AACpC;AAGA,SAAgBK,IAAiD;CAC/D,OAAOD,EAAOL,GAAa,IAAI;AACjC;AAGA,SAAgBO,IAA6D;CAC3E,OAAOF,EAAOL,GAAa,IAAI,CAAC,EAAE,QAAQQ;AAC5C;AAGA,SAAgBC,IAAuD;CACrE,OAAOJ,EAAOL,GAAa,IAAI,CAAC,EAAE;AACpC;AAEA,SAAgBU,EAAe,GAAkC;CAC/D,EAAQV,GAAaG,CAAK;AAC5B;AAEA,SAAgBQ,IAAkC;CAChD,IAAMC,IAAUP,EAAOL,GAAa,IAAI;CAExC,IAAI,CAACY,GACH,MAAU,MAAM,6DAA6D;CAG/E,OAAOA;AACT;AAEA,SAASC,IAA2C;CAClD,IAAMC,IAAOC,EAA0B;CAEvC,OAAOC,QAAeF,EAAK,KAAK;AAClC;AAGA,SAAgBG,IAAqC;CACnD,IAAMC,IAAab,EAAOJ,GAAgB,IAAI,GACxCkB,IAAQN,EAAU;CAGxB,OAAOG,QACLI,EACEF,GAAY,MAAM,SAASC,EAAM,MAAM,SACvCA,EAAM,MAAM,uBACd,CACF;AACF;AAEA,SAAgBE,IAAqD;CACnE,IAAMH,IAAab,EAAOJ,GAAgB,IAAI,GACxCkB,IAAQN,EAAU;CAExB,OAAOG,QAAeE,GAAY,KAAK,SAASC,EAAM,MAAM,IAAI;AAClE;AAEA,SAAgBG,IAAiD;CAC/D,OAAOT,EAAU;AACnB;AAEA,SAASU,IAA4B;CAGnC,OAAOlB,EAAOL,GAAa,IAAI,CAAC,EAAE,cAAcD;AAClD;AAGA,SAAgB0B,IAAwB;CACtC,IAAMD,IAAaD,EAAc;CAEjC,OAAOC,EAAW,EAAE,KAAKA,CAAU;AACrC;AAGA,SAAgBE,IAAkC;CAChD,IAAMF,IAAaD,EAAc;CAEjC,OAAOC,EAAW,OAAO,KAAKA,CAAU;AAC1C;AAGA,SAASG,IAA+D;CACtE,IAAMb,IAAOC,EAA0B;CAEvC,OAAOC,QAAeF,EAAK,KAAqC;AAClE;AAGA,SAAgBc,IAAmD;CACjE,IAAMV,IAAab,EAAOJ,GAAgB,IAAI,GACxCkB,IAAQQ,EAAkB;CAEhC,OAAOX,SACEE,GAAY,MAAM,SAASC,EAAM,OAAO,QAAA,EAAU,YAC3D;AACF;AAEA,SAAgBU,IAA2C;CACzD,IAAMX,IAAab,EAAOJ,GAAgB,IAAI,GACxCkB,IAAQQ,EAAkB;CAEhC,OAAOX,SACEE,GAAY,MAAM,SAASC,EAAM,OAAO,QAAA,EAAU,cAAc,aAAa,KACtF;AACF;AAGA,SAAgBW,IAA6C;CAC3D,IAAMZ,IAAab,EAAOJ,GAAgB,IAAI,GACxCkB,IAAQQ,EAAkB,GAC1BI,IAAMf,QAAe;EACzB,IAAMgB,KAAgBd,GAAY,MAAM,SAASC,EAAM,OAAO,QAAA,EAAU;EAExE,OAAO;GAACa,GAAc,OAAO;GAAMA,GAAc,YAAY;GAAOA,GAAc;EAAQ;CAC5F,CAAC,GACGC,IAA6D;CAEjE,OAAOjB,QAAe;EACpB,IAAM,CAACkB,GAAKC,GAAUC,KAAYL,EAAI,OAChCM,IAAK,GAAGH,EAAI,GAAGC,EAAS,GAAGC,KAAY;EAM7C,OAJIH,GAAQ,QAAQI,MAClB,IAAS;GAAE,KAAKA;GAAI,WAAW,IAAIC,EAAgBJ,GAAKC,GAAUC,CAAQ;EAAE,IAGvEH,EAAO;CAChB,CAAC;AACH;AAEA,SAAgBM,IAAgC;CAC9C,OAAO5B,EAAW,CAAC,CAAC;AACtB;AAEA,SAAgB6B,IAA+C;CAC7D,OAAO7B,EAAW,CAAC,CAAC;AACtB;AAMA,SAAgB8B,IAA8D;CAC5E,OAAOpC,EAAOL,GAAa,IAAI,CAAC,EAAE,YAAY;AAChD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-alfakit.d.ts","sourceRoot":"","sources":["../src/create-alfakit.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"create-alfakit.d.ts","sourceRoot":"","sources":["../src/create-alfakit.ts"],"names":[],"mappings":"AAAA,OAAO,EAmBL,KAAK,cAAc,EAIpB,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAE,qBAAqB,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAElE,OAAO,KAAK,EAAE,GAAG,EAAmB,MAAM,KAAK,CAAA;AAG/C,OAAO,EAAyC,KAAK,YAAY,EAAE,MAAM,WAAW,CAAA;AAOpF,MAAM,WAAW,oBAAqB,SAAQ,cAAc,CAAC,YAAY,CAAC;IACxE,2FAA2F;IAC3F,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAA;CAC7B;AAED,uFAAuF;AACvF,MAAM,MAAM,qBAAqB,GAAG,CAClC,IAAI,EAAE,IAAI,EACV,cAAc,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC,MAAM,CAAC,KAC1C,OAAO,CAAC,qBAAqB,CAAC,CAAA;AAEnC;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,IAAI,GAAG,qBAAqB,CAAC,CAuJvC;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,OAAO,GAAE,oBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAKrF"}
|
package/dist/create-alfakit.js
CHANGED
|
@@ -4,66 +4,68 @@ import { showToast as n } from "./components/notifications/flash-toasts.js";
|
|
|
4
4
|
import { discoverComponents as r } from "./lib/discovery.js";
|
|
5
5
|
import { builtInComponents as i, createDefaultRegistry as a } from "./registry.js";
|
|
6
6
|
import o from "./AlfakitRoot.js";
|
|
7
|
-
import s from "./
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
7
|
+
import { panelLayouts as s } from "./layouts/panel-layouts.js";
|
|
8
|
+
import c from "./pages/AlfakitPage.js";
|
|
9
|
+
import { ActionRunner as l, Translator as u, applyDocumentLocale as d, applyPanelTheme as f, configureCharts as p, configureRealtime as m, debugRecorder as h, documentNonce as g, effectiveErrorNotifications as _, initializeAppearance as v, installErrorNotifications as y, installPrefetchInvalidation as b, installSpaUrlExceptions as x, registerRichEditorExtensions as S, reloadOnExpiredPage as C, resolveRequestErrorNotification as w, setRequestErrorReporter as T, whenIdle as E } from "@alfakit/core";
|
|
10
|
+
import { createInertiaApp as D, router as O } from "@inertiajs/vue3";
|
|
10
11
|
//#region src/create-alfakit.ts
|
|
11
|
-
function
|
|
12
|
-
let
|
|
13
|
-
"Alfakit/Page":
|
|
14
|
-
...
|
|
15
|
-
...
|
|
16
|
-
},
|
|
17
|
-
t(),
|
|
18
|
-
let
|
|
19
|
-
let e = new
|
|
12
|
+
function k(E = {}) {
|
|
13
|
+
let k = r(E.discover), A = a().registerMany(s).registerMany(k.components).registerMany(E.components ?? {}), j = {
|
|
14
|
+
"Alfakit/Page": c,
|
|
15
|
+
...k.pages,
|
|
16
|
+
...E.pages
|
|
17
|
+
}, M = typeof window > "u";
|
|
18
|
+
t(), p(E), E.echo !== void 0 && !M && m(null, { echo: E.echo }), S(E.richEditorExtensions ?? {});
|
|
19
|
+
let N = null, P, F = () => {
|
|
20
|
+
let e = new u();
|
|
20
21
|
return {
|
|
21
|
-
registry:
|
|
22
|
-
pages:
|
|
22
|
+
registry: A,
|
|
23
|
+
pages: j,
|
|
23
24
|
translator: e,
|
|
24
|
-
actions: new
|
|
25
|
+
actions: new l({
|
|
25
26
|
endpoints: {
|
|
26
27
|
action: "",
|
|
27
28
|
modal: ""
|
|
28
29
|
},
|
|
29
30
|
onError: (t) => {
|
|
30
|
-
let r =
|
|
31
|
+
let r = w(t, P, (t, n, r) => e.t(t, n, r));
|
|
31
32
|
r && n(r);
|
|
32
33
|
}
|
|
33
34
|
})
|
|
34
35
|
};
|
|
35
|
-
},
|
|
36
|
+
}, I = M ? null : F(), L = (e, t, n) => {
|
|
36
37
|
let r = t.props, i = r.alfakit;
|
|
37
|
-
i && (e ===
|
|
38
|
+
i && (e === I && (N = i, P = _(i, r.page)), e.translator.setTranslations(i.translations ?? {}), e.translator.setLocale(i.localization?.tag ?? "en"), e.actions.setEndpoints({
|
|
38
39
|
action: i.endpoints.action ?? "",
|
|
39
40
|
modal: i.endpoints.modal ?? ""
|
|
40
|
-
}), n && (
|
|
41
|
+
}), n && (d(i.localization), f(i), h.setEnabled(r.alfakitDebug !== void 0)));
|
|
41
42
|
};
|
|
42
|
-
return
|
|
43
|
-
let t =
|
|
43
|
+
return I && (O.on("navigate", (e) => L(I, e.detail.page, !0)), C(), b(), x(() => N), y(() => ({ errorNotifications: P }), (e) => n(e)), T((e) => {
|
|
44
|
+
let t = w(e, P, (e, t, n) => I.translator.t(e, t, n));
|
|
44
45
|
t && n(t);
|
|
45
|
-
})),
|
|
46
|
+
})), D({
|
|
46
47
|
title: (e) => e,
|
|
47
|
-
progress:
|
|
48
|
+
progress: E.progress === void 0 ? { color: "var(--primary)" } : E.progress,
|
|
49
|
+
nonce: g(),
|
|
48
50
|
resolve: (e, t) => {
|
|
49
|
-
let n =
|
|
51
|
+
let n = j[e];
|
|
50
52
|
if (!n) throw Error(`Alfakit: page component "${e}" is not registered. Pass it to createAlfakit({ pages }).`);
|
|
51
|
-
let r = [i.preloadFor(t),
|
|
53
|
+
let r = [i.preloadFor(t), k.discovery.preloadFor(t)].filter((e) => e !== void 0), a = r.length > 0 ? Promise.all(r) : void 0;
|
|
52
54
|
return a ? a.then(() => n) : n;
|
|
53
55
|
},
|
|
54
56
|
layout: () => o,
|
|
55
57
|
withApp: (t, { page: n, ssr: r }) => {
|
|
56
|
-
let i =
|
|
57
|
-
|
|
58
|
+
let i = I ?? F();
|
|
59
|
+
L(i, n, !r);
|
|
58
60
|
let a = n.props.alfakit;
|
|
59
|
-
!r && a &&
|
|
61
|
+
!r && a && v(a), t.provide(e, i), E.withApp?.(t);
|
|
60
62
|
}
|
|
61
63
|
});
|
|
62
64
|
}
|
|
63
|
-
async function
|
|
64
|
-
await
|
|
65
|
+
async function A(e = {}) {
|
|
66
|
+
await k(e), E(() => void i.preloadAll());
|
|
65
67
|
}
|
|
66
68
|
//#endregion
|
|
67
|
-
export {
|
|
69
|
+
export { k as bootAlfakit, A as createAlfakit };
|
|
68
70
|
|
|
69
71
|
//# sourceMappingURL=create-alfakit.js.map
|