@shwfed/nuxt 0.1.21 → 0.1.23
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/dist/module.d.mts +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +9 -2
- package/dist/runtime/components/app.d.vue.ts +2 -2
- package/dist/runtime/components/app.vue +52 -0
- package/dist/runtime/components/app.vue.d.ts +2 -2
- package/dist/runtime/components/table.d.vue.ts +12 -3
- package/dist/runtime/components/table.vue +4 -0
- package/dist/runtime/components/table.vue.d.ts +12 -3
- package/dist/runtime/components/ui/button-group/ButtonGroupSeparator.d.vue.ts +1 -1
- package/dist/runtime/components/ui/button-group/ButtonGroupSeparator.vue.d.ts +1 -1
- package/dist/runtime/components/ui/button-group/index.d.ts +1 -1
- package/dist/runtime/components/ui/checkbox/Checkbox.d.vue.ts +25 -0
- package/dist/runtime/components/ui/checkbox/Checkbox.vue +47 -0
- package/dist/runtime/components/ui/checkbox/Checkbox.vue.d.ts +25 -0
- package/dist/runtime/components/ui/checkbox/index.d.ts +1 -0
- package/dist/runtime/components/ui/checkbox/index.js +1 -0
- package/dist/runtime/components/ui/command/Command.d.vue.ts +36 -0
- package/dist/runtime/components/ui/command/Command.vue +81 -0
- package/dist/runtime/components/ui/command/Command.vue.d.ts +36 -0
- package/dist/runtime/components/ui/command/CommandDialog.d.vue.ts +28 -0
- package/dist/runtime/components/ui/command/CommandDialog.vue +34 -0
- package/dist/runtime/components/ui/command/CommandDialog.vue.d.ts +28 -0
- package/dist/runtime/components/ui/command/CommandEmpty.d.vue.ts +18 -0
- package/dist/runtime/components/ui/command/CommandEmpty.vue +28 -0
- package/dist/runtime/components/ui/command/CommandEmpty.vue.d.ts +18 -0
- package/dist/runtime/components/ui/command/CommandGroup.d.vue.ts +19 -0
- package/dist/runtime/components/ui/command/CommandGroup.vue +44 -0
- package/dist/runtime/components/ui/command/CommandGroup.vue.d.ts +19 -0
- package/dist/runtime/components/ui/command/CommandInput.d.vue.ts +8 -0
- package/dist/runtime/components/ui/command/CommandInput.vue +40 -0
- package/dist/runtime/components/ui/command/CommandInput.vue.d.ts +8 -0
- package/dist/runtime/components/ui/command/CommandItem.d.vue.ts +22 -0
- package/dist/runtime/components/ui/command/CommandItem.vue +65 -0
- package/dist/runtime/components/ui/command/CommandItem.vue.d.ts +22 -0
- package/dist/runtime/components/ui/command/CommandList.d.vue.ts +18 -0
- package/dist/runtime/components/ui/command/CommandList.vue +24 -0
- package/dist/runtime/components/ui/command/CommandList.vue.d.ts +18 -0
- package/dist/runtime/components/ui/command/CommandSeparator.d.vue.ts +18 -0
- package/dist/runtime/components/ui/command/CommandSeparator.vue +23 -0
- package/dist/runtime/components/ui/command/CommandSeparator.vue.d.ts +18 -0
- package/dist/runtime/components/ui/command/CommandShortcut.d.vue.ts +17 -0
- package/dist/runtime/components/ui/command/CommandShortcut.vue +15 -0
- package/dist/runtime/components/ui/command/CommandShortcut.vue.d.ts +17 -0
- package/dist/runtime/components/ui/command/index.d.ts +90 -0
- package/dist/runtime/components/ui/command/index.js +12 -0
- package/dist/runtime/components/ui/dialog/Dialog.d.vue.ts +21 -0
- package/dist/runtime/components/ui/dialog/Dialog.vue +20 -0
- package/dist/runtime/components/ui/dialog/Dialog.vue.d.ts +21 -0
- package/dist/runtime/components/ui/dialog/DialogClose.d.vue.ts +14 -0
- package/dist/runtime/components/ui/dialog/DialogClose.vue +16 -0
- package/dist/runtime/components/ui/dialog/DialogClose.vue.d.ts +14 -0
- package/dist/runtime/components/ui/dialog/DialogContent.d.vue.ts +35 -0
- package/dist/runtime/components/ui/dialog/DialogContent.vue +53 -0
- package/dist/runtime/components/ui/dialog/DialogContent.vue.d.ts +35 -0
- package/dist/runtime/components/ui/dialog/DialogDescription.d.vue.ts +18 -0
- package/dist/runtime/components/ui/dialog/DialogDescription.vue +22 -0
- package/dist/runtime/components/ui/dialog/DialogDescription.vue.d.ts +18 -0
- package/dist/runtime/components/ui/dialog/DialogFooter.d.vue.ts +17 -0
- package/dist/runtime/components/ui/dialog/DialogFooter.vue +15 -0
- package/dist/runtime/components/ui/dialog/DialogFooter.vue.d.ts +17 -0
- package/dist/runtime/components/ui/dialog/DialogHeader.d.vue.ts +17 -0
- package/dist/runtime/components/ui/dialog/DialogHeader.vue +15 -0
- package/dist/runtime/components/ui/dialog/DialogHeader.vue.d.ts +17 -0
- package/dist/runtime/components/ui/dialog/DialogOverlay.d.vue.ts +18 -0
- package/dist/runtime/components/ui/dialog/DialogOverlay.vue +22 -0
- package/dist/runtime/components/ui/dialog/DialogOverlay.vue.d.ts +18 -0
- package/dist/runtime/components/ui/dialog/DialogScrollContent.d.vue.ts +32 -0
- package/dist/runtime/components/ui/dialog/DialogScrollContent.vue +58 -0
- package/dist/runtime/components/ui/dialog/DialogScrollContent.vue.d.ts +32 -0
- package/dist/runtime/components/ui/dialog/DialogTitle.d.vue.ts +18 -0
- package/dist/runtime/components/ui/dialog/DialogTitle.vue +22 -0
- package/dist/runtime/components/ui/dialog/DialogTitle.vue.d.ts +18 -0
- package/dist/runtime/components/ui/dialog/DialogTrigger.d.vue.ts +14 -0
- package/dist/runtime/components/ui/dialog/DialogTrigger.vue +16 -0
- package/dist/runtime/components/ui/dialog/DialogTrigger.vue.d.ts +14 -0
- package/dist/runtime/components/ui/dialog/index.d.ts +10 -0
- package/dist/runtime/components/ui/dialog/index.js +10 -0
- package/dist/runtime/components/ui/separator/Separator.d.vue.ts +1 -1
- package/dist/runtime/components/ui/separator/Separator.vue.d.ts +1 -1
- package/dist/runtime/plugins/cel/env.d.ts +5 -8
- package/dist/runtime/plugins/cel/env.js +3 -12
- package/dist/runtime/plugins/cel/index.js +4 -2
- package/dist/runtime/plugins/i18n/index.d.ts +2 -0
- package/dist/runtime/plugins/i18n/index.js +14 -0
- package/dist/runtime/table-renderers/builtins.js +12 -29
- package/package.json +3 -1
package/dist/module.d.mts
CHANGED
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,16 +1,23 @@
|
|
|
1
|
-
import { defineNuxtModule, createResolver, addPlugin, addImportsDir, addComponentsDir } from '@nuxt/kit';
|
|
1
|
+
import { defineNuxtModule, createResolver, addVitePlugin, addPlugin, addImportsDir, addComponentsDir } from '@nuxt/kit';
|
|
2
|
+
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
|
|
2
3
|
|
|
3
4
|
const module$1 = defineNuxtModule({
|
|
4
5
|
meta: {
|
|
5
6
|
name: "@shwfed/nuxt",
|
|
6
7
|
configKey: "shwfed"
|
|
7
8
|
},
|
|
8
|
-
defaults: {
|
|
9
|
+
defaults: {
|
|
10
|
+
features: []
|
|
11
|
+
},
|
|
9
12
|
setup(options, nuxt) {
|
|
10
13
|
const resolver = createResolver(import.meta.url);
|
|
11
14
|
nuxt.options.runtimeConfig.public.shwfed = options;
|
|
12
15
|
nuxt.options.css ||= [];
|
|
13
16
|
nuxt.options.css.push("vue-sonner/style.css");
|
|
17
|
+
addVitePlugin(VueI18nPlugin({
|
|
18
|
+
ssr: true
|
|
19
|
+
}));
|
|
20
|
+
addPlugin(resolver.resolve("runtime/plugins/i18n/index"));
|
|
14
21
|
addPlugin(resolver.resolve("runtime/plugins/cel/index"));
|
|
15
22
|
addPlugin(resolver.resolve("runtime/plugins/markdown/index"));
|
|
16
23
|
addPlugin({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
declare var
|
|
1
|
+
declare var __VLS_53: {};
|
|
2
2
|
type __VLS_Slots = {} & {
|
|
3
|
-
default?: (props: typeof
|
|
3
|
+
default?: (props: typeof __VLS_53) => any;
|
|
4
4
|
};
|
|
5
5
|
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
6
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useHead } from "#app";
|
|
3
|
+
import { ref } from "vue";
|
|
4
|
+
import { CommandDialog, CommandInput, CommandList, CommandGroup, CommandEmpty } from "./ui/command";
|
|
3
5
|
import { TooltipProvider } from "./ui/tooltip";
|
|
4
6
|
import { Toaster } from "vue-sonner";
|
|
7
|
+
import { useMagicKeys, whenever } from "@vueuse/core";
|
|
8
|
+
import { useI18n } from "vue-i18n";
|
|
9
|
+
import { Icon } from "@iconify/vue";
|
|
10
|
+
const { t } = useI18n();
|
|
5
11
|
useHead({
|
|
6
12
|
bodyAttrs: {
|
|
7
13
|
style: {
|
|
@@ -9,13 +15,59 @@ useHead({
|
|
|
9
15
|
}
|
|
10
16
|
}
|
|
11
17
|
});
|
|
18
|
+
const isCommandOpen = ref(false);
|
|
19
|
+
const { meta_k } = useMagicKeys();
|
|
20
|
+
whenever(() => meta_k?.value, () => {
|
|
21
|
+
isCommandOpen.value = !isCommandOpen.value;
|
|
22
|
+
});
|
|
12
23
|
</script>
|
|
13
24
|
|
|
14
25
|
<template>
|
|
15
26
|
<TooltipProvider>
|
|
16
27
|
<ClientOnly>
|
|
17
28
|
<Toaster />
|
|
29
|
+
<CommandDialog
|
|
30
|
+
v-if="$dsl.evaluate`feature('command-palette')`()"
|
|
31
|
+
v-model:open="isCommandOpen"
|
|
32
|
+
>
|
|
33
|
+
<CommandInput />
|
|
34
|
+
<CommandList>
|
|
35
|
+
<CommandEmpty as-child>
|
|
36
|
+
<section class="h-32 flex flex-col text-lg items-center justify-center gap-2 select-none">
|
|
37
|
+
<Icon
|
|
38
|
+
icon="fluent:app-recent-20-regular"
|
|
39
|
+
class="text-zinc-400 text-2xl!"
|
|
40
|
+
/>
|
|
41
|
+
<p class="text-zinc-500">
|
|
42
|
+
{{ t("command-palette-empty") }}
|
|
43
|
+
</p>
|
|
44
|
+
</section>
|
|
45
|
+
</CommandEmpty>
|
|
46
|
+
<CommandGroup>
|
|
47
|
+
<!-- <CommandItem
|
|
48
|
+
v-for="command in commands"
|
|
49
|
+
:key="command.title"
|
|
50
|
+
:value="command.title"
|
|
51
|
+
>
|
|
52
|
+
<Icon
|
|
53
|
+
v-if="command.icon"
|
|
54
|
+
:icon="command.icon"
|
|
55
|
+
/>
|
|
56
|
+
<span>{{ command.title }}</span>
|
|
57
|
+
</CommandItem> -->
|
|
58
|
+
</CommandGroup>
|
|
59
|
+
</CommandList>
|
|
60
|
+
</CommandDialog>
|
|
18
61
|
</ClientOnly>
|
|
19
62
|
<slot />
|
|
20
63
|
</TooltipProvider>
|
|
21
64
|
</template>
|
|
65
|
+
|
|
66
|
+
<i18n lang="yaml">
|
|
67
|
+
zh:
|
|
68
|
+
command-palette-empty: 无搜索结果
|
|
69
|
+
ja:
|
|
70
|
+
command-palette-empty: 結果はありません
|
|
71
|
+
en:
|
|
72
|
+
command-palette-empty: No results
|
|
73
|
+
</i18n>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
declare var
|
|
1
|
+
declare var __VLS_53: {};
|
|
2
2
|
type __VLS_Slots = {} & {
|
|
3
|
-
default?: (props: typeof
|
|
3
|
+
default?: (props: typeof __VLS_53) => any;
|
|
4
4
|
};
|
|
5
5
|
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
6
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RowData, TableOptions } from '@tanstack/vue-table';
|
|
1
|
+
import type { CellContext, RowData, TableOptions } from '@tanstack/vue-table';
|
|
2
2
|
export type Expression = string;
|
|
3
3
|
export type Markdown = string;
|
|
4
4
|
export type Render = string | Readonly<{
|
|
@@ -32,7 +32,7 @@ declare module '@tanstack/vue-table' {
|
|
|
32
32
|
}
|
|
33
33
|
declare const _default: typeof __VLS_export;
|
|
34
34
|
export default _default;
|
|
35
|
-
declare const __VLS_export: import("vue").DefineComponent<Readonly<{
|
|
35
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Readonly<{
|
|
36
36
|
id: string;
|
|
37
37
|
getRowId?: Expression;
|
|
38
38
|
getSubRows?: Expression;
|
|
@@ -63,4 +63,13 @@ declare const __VLS_export: import("vue").DefineComponent<Readonly<{
|
|
|
63
63
|
readonly enableMultiRowSelection: Expression;
|
|
64
64
|
readonly enableRowSelection: Expression;
|
|
65
65
|
readonly cellStyles: Expression;
|
|
66
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any
|
|
66
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
67
|
+
[key: string]: (props: Readonly<{
|
|
68
|
+
cell: CellContext<unknown, unknown>;
|
|
69
|
+
}>) => void;
|
|
70
|
+
}>;
|
|
71
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
72
|
+
new (): {
|
|
73
|
+
$slots: S;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
@@ -26,6 +26,7 @@ const props = defineProps({
|
|
|
26
26
|
paginationLeft: { type: String, required: false },
|
|
27
27
|
paginationRight: { type: String, required: false }
|
|
28
28
|
});
|
|
29
|
+
const slots = defineSlots();
|
|
29
30
|
const { $dsl } = useNuxtApp();
|
|
30
31
|
const isCheating = useCheating();
|
|
31
32
|
const { resolveTableRenderer } = useTableRenderers();
|
|
@@ -60,6 +61,9 @@ function translate(column) {
|
|
|
60
61
|
id: column.id ?? genColumnId(column),
|
|
61
62
|
header: (ctx) => renderer.header?.({ ctx, options }) ?? column.title,
|
|
62
63
|
cell: (ctx) => {
|
|
64
|
+
if (ctx.column.id in slots) {
|
|
65
|
+
return slots[ctx.column.id]?.({ cell: ctx });
|
|
66
|
+
}
|
|
63
67
|
return renderer.cell({ ctx, options });
|
|
64
68
|
},
|
|
65
69
|
accessorFn: (row, index) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RowData, TableOptions } from '@tanstack/vue-table';
|
|
1
|
+
import type { CellContext, RowData, TableOptions } from '@tanstack/vue-table';
|
|
2
2
|
export type Expression = string;
|
|
3
3
|
export type Markdown = string;
|
|
4
4
|
export type Render = string | Readonly<{
|
|
@@ -32,7 +32,7 @@ declare module '@tanstack/vue-table' {
|
|
|
32
32
|
}
|
|
33
33
|
declare const _default: typeof __VLS_export;
|
|
34
34
|
export default _default;
|
|
35
|
-
declare const __VLS_export: import("vue").DefineComponent<Readonly<{
|
|
35
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Readonly<{
|
|
36
36
|
id: string;
|
|
37
37
|
getRowId?: Expression;
|
|
38
38
|
getSubRows?: Expression;
|
|
@@ -63,4 +63,13 @@ declare const __VLS_export: import("vue").DefineComponent<Readonly<{
|
|
|
63
63
|
readonly enableMultiRowSelection: Expression;
|
|
64
64
|
readonly enableRowSelection: Expression;
|
|
65
65
|
readonly cellStyles: Expression;
|
|
66
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any
|
|
66
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
67
|
+
[key: string]: (props: Readonly<{
|
|
68
|
+
cell: CellContext<unknown, unknown>;
|
|
69
|
+
}>) => void;
|
|
70
|
+
}>;
|
|
71
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
72
|
+
new (): {
|
|
73
|
+
$slots: S;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
@@ -4,7 +4,7 @@ type __VLS_Props = SeparatorProps & {
|
|
|
4
4
|
class?: HTMLAttributes['class'];
|
|
5
5
|
};
|
|
6
6
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
7
|
-
orientation: "
|
|
7
|
+
orientation: "vertical" | "horizontal";
|
|
8
8
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
9
|
declare const _default: typeof __VLS_export;
|
|
10
10
|
export default _default;
|
|
@@ -4,7 +4,7 @@ type __VLS_Props = SeparatorProps & {
|
|
|
4
4
|
class?: HTMLAttributes['class'];
|
|
5
5
|
};
|
|
6
6
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
7
|
-
orientation: "
|
|
7
|
+
orientation: "vertical" | "horizontal";
|
|
8
8
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
9
|
declare const _default: typeof __VLS_export;
|
|
10
10
|
export default _default;
|
|
@@ -3,6 +3,6 @@ export { default as ButtonGroup } from './ButtonGroup.vue.js';
|
|
|
3
3
|
export { default as ButtonGroupSeparator } from './ButtonGroupSeparator.vue.js';
|
|
4
4
|
export { default as ButtonGroupText } from './ButtonGroupText.vue.js';
|
|
5
5
|
export declare const buttonGroupVariants: (props?: ({
|
|
6
|
-
orientation?: "
|
|
6
|
+
orientation?: "vertical" | "horizontal" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
export type ButtonGroupVariants = VariantProps<typeof buttonGroupVariants>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { CheckboxRootProps } from 'reka-ui';
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
type __VLS_Props = CheckboxRootProps & {
|
|
4
|
+
class?: HTMLAttributes['class'];
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_14: {
|
|
7
|
+
modelValue: import("reka-ui").CheckboxCheckedState;
|
|
8
|
+
state: import("reka-ui").CheckboxCheckedState;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_Slots = {} & {
|
|
11
|
+
default?: (props: typeof __VLS_14) => any;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
|
+
"update:modelValue": (value: boolean | "indeterminate") => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
"onUpdate:modelValue"?: ((value: boolean | "indeterminate") => any) | undefined;
|
|
17
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
3
|
+
import { Icon } from "@iconify/vue";
|
|
4
|
+
import { CheckboxIndicator, CheckboxRoot, useForwardPropsEmits } from "reka-ui";
|
|
5
|
+
import { cn } from "../../../utils/cn";
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
defaultValue: { type: [Boolean, String], required: false },
|
|
8
|
+
modelValue: { type: [Boolean, String, null], required: false },
|
|
9
|
+
disabled: { type: Boolean, required: false },
|
|
10
|
+
value: { type: null, required: false },
|
|
11
|
+
id: { type: String, required: false },
|
|
12
|
+
asChild: { type: Boolean, required: false },
|
|
13
|
+
as: { type: null, required: false },
|
|
14
|
+
name: { type: String, required: false },
|
|
15
|
+
required: { type: Boolean, required: false },
|
|
16
|
+
class: { type: null, required: false }
|
|
17
|
+
});
|
|
18
|
+
const emits = defineEmits(["update:modelValue"]);
|
|
19
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
20
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<CheckboxRoot
|
|
25
|
+
v-slot="slotProps"
|
|
26
|
+
data-slot="checkbox"
|
|
27
|
+
v-bind="forwarded"
|
|
28
|
+
:class="
|
|
29
|
+
cn(
|
|
30
|
+
'peer cursor-pointer flex items-center justify-center border-zinc-200 data-[state=checked]:bg-(--primary) data-[state=checked]:text-white data-[state=checked]:border-(--primary) aria-invalid:border-red-400 size-4 shrink-0 rounded border shadow-xs hover:shadow transition-shadow outline-none disabled:cursor-not-allowed disabled:opacity-50',
|
|
31
|
+
props.class
|
|
32
|
+
)
|
|
33
|
+
"
|
|
34
|
+
>
|
|
35
|
+
<CheckboxIndicator
|
|
36
|
+
data-slot="checkbox-indicator"
|
|
37
|
+
class="grid h-full w-full place-content-center transition-none text-xs"
|
|
38
|
+
>
|
|
39
|
+
<slot v-bind="slotProps">
|
|
40
|
+
<Icon
|
|
41
|
+
v-if="$props.modelValue === true"
|
|
42
|
+
icon="fluent:checkmark-20-filled"
|
|
43
|
+
/>
|
|
44
|
+
</slot>
|
|
45
|
+
</CheckboxIndicator>
|
|
46
|
+
</CheckboxRoot>
|
|
47
|
+
</template>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { CheckboxRootProps } from 'reka-ui';
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
type __VLS_Props = CheckboxRootProps & {
|
|
4
|
+
class?: HTMLAttributes['class'];
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_14: {
|
|
7
|
+
modelValue: import("reka-ui").CheckboxCheckedState;
|
|
8
|
+
state: import("reka-ui").CheckboxCheckedState;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_Slots = {} & {
|
|
11
|
+
default?: (props: typeof __VLS_14) => any;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
|
+
"update:modelValue": (value: boolean | "indeterminate") => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
"onUpdate:modelValue"?: ((value: boolean | "indeterminate") => any) | undefined;
|
|
17
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Checkbox } from './Checkbox.vue.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Checkbox } from "./Checkbox.vue";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ListboxRootProps } from 'reka-ui';
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
type __VLS_Props = ListboxRootProps & {
|
|
4
|
+
class?: HTMLAttributes['class'];
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_8: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
default?: (props: typeof __VLS_8) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
"update:modelValue": (value: import("reka-ui").AcceptableValue) => any;
|
|
12
|
+
highlight: (payload: {
|
|
13
|
+
ref: HTMLElement;
|
|
14
|
+
value: import("reka-ui").AcceptableValue;
|
|
15
|
+
} | undefined) => any;
|
|
16
|
+
entryFocus: (event: CustomEvent<any>) => any;
|
|
17
|
+
leave: (event: Event) => any;
|
|
18
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
19
|
+
"onUpdate:modelValue"?: ((value: import("reka-ui").AcceptableValue) => any) | undefined;
|
|
20
|
+
onHighlight?: ((payload: {
|
|
21
|
+
ref: HTMLElement;
|
|
22
|
+
value: import("reka-ui").AcceptableValue;
|
|
23
|
+
} | undefined) => any) | undefined;
|
|
24
|
+
onEntryFocus?: ((event: CustomEvent<any>) => any) | undefined;
|
|
25
|
+
onLeave?: ((event: Event) => any) | undefined;
|
|
26
|
+
}>, {
|
|
27
|
+
modelValue: import("reka-ui").AcceptableValue | import("reka-ui").AcceptableValue[];
|
|
28
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
29
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
30
|
+
declare const _default: typeof __VLS_export;
|
|
31
|
+
export default _default;
|
|
32
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
33
|
+
new (): {
|
|
34
|
+
$slots: S;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
3
|
+
import { ListboxRoot, useFilter, useForwardPropsEmits } from "reka-ui";
|
|
4
|
+
import { reactive, ref, watch } from "vue";
|
|
5
|
+
import { cn } from "../../../utils/cn";
|
|
6
|
+
import { provideCommandContext } from ".";
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
modelValue: { type: null, required: false, default: "" },
|
|
9
|
+
defaultValue: { type: null, required: false },
|
|
10
|
+
multiple: { type: Boolean, required: false },
|
|
11
|
+
orientation: { type: String, required: false },
|
|
12
|
+
dir: { type: String, required: false },
|
|
13
|
+
disabled: { type: Boolean, required: false },
|
|
14
|
+
selectionBehavior: { type: String, required: false },
|
|
15
|
+
highlightOnHover: { type: Boolean, required: false },
|
|
16
|
+
by: { type: [String, Function], required: false },
|
|
17
|
+
asChild: { type: Boolean, required: false },
|
|
18
|
+
as: { type: null, required: false },
|
|
19
|
+
name: { type: String, required: false },
|
|
20
|
+
required: { type: Boolean, required: false },
|
|
21
|
+
class: { type: null, required: false }
|
|
22
|
+
});
|
|
23
|
+
const emits = defineEmits(["update:modelValue", "highlight", "entryFocus", "leave"]);
|
|
24
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
25
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
26
|
+
const allItems = ref(/* @__PURE__ */ new Map());
|
|
27
|
+
const allGroups = ref(/* @__PURE__ */ new Map());
|
|
28
|
+
const { contains } = useFilter({ sensitivity: "base" });
|
|
29
|
+
const filterState = reactive({
|
|
30
|
+
search: "",
|
|
31
|
+
filtered: {
|
|
32
|
+
/** The count of all visible items. */
|
|
33
|
+
count: 0,
|
|
34
|
+
/** Map from visible item id to its search score. */
|
|
35
|
+
items: /* @__PURE__ */ new Map(),
|
|
36
|
+
/** Set of groups with at least one visible item. */
|
|
37
|
+
groups: /* @__PURE__ */ new Set()
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
function filterItems() {
|
|
41
|
+
if (!filterState.search) {
|
|
42
|
+
filterState.filtered.count = allItems.value.size;
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
filterState.filtered.groups = /* @__PURE__ */ new Set();
|
|
46
|
+
let itemCount = 0;
|
|
47
|
+
for (const [id, value] of allItems.value) {
|
|
48
|
+
const score = contains(value, filterState.search);
|
|
49
|
+
filterState.filtered.items.set(id, score ? 1 : 0);
|
|
50
|
+
if (score)
|
|
51
|
+
itemCount++;
|
|
52
|
+
}
|
|
53
|
+
for (const [groupId, group] of allGroups.value) {
|
|
54
|
+
for (const itemId of group) {
|
|
55
|
+
if (filterState.filtered.items.get(itemId) > 0) {
|
|
56
|
+
filterState.filtered.groups.add(groupId);
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
filterState.filtered.count = itemCount;
|
|
62
|
+
}
|
|
63
|
+
watch(() => filterState.search, () => {
|
|
64
|
+
filterItems();
|
|
65
|
+
});
|
|
66
|
+
provideCommandContext({
|
|
67
|
+
allItems,
|
|
68
|
+
allGroups,
|
|
69
|
+
filterState
|
|
70
|
+
});
|
|
71
|
+
</script>
|
|
72
|
+
|
|
73
|
+
<template>
|
|
74
|
+
<ListboxRoot
|
|
75
|
+
data-slot="command"
|
|
76
|
+
v-bind="forwarded"
|
|
77
|
+
:class="cn('bg-white text-zinc-700 flex h-full w-full flex-col overflow-hidden rounded-md', props.class)"
|
|
78
|
+
>
|
|
79
|
+
<slot />
|
|
80
|
+
</ListboxRoot>
|
|
81
|
+
</template>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ListboxRootProps } from 'reka-ui';
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
type __VLS_Props = ListboxRootProps & {
|
|
4
|
+
class?: HTMLAttributes['class'];
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_8: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
default?: (props: typeof __VLS_8) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
"update:modelValue": (value: import("reka-ui").AcceptableValue) => any;
|
|
12
|
+
highlight: (payload: {
|
|
13
|
+
ref: HTMLElement;
|
|
14
|
+
value: import("reka-ui").AcceptableValue;
|
|
15
|
+
} | undefined) => any;
|
|
16
|
+
entryFocus: (event: CustomEvent<any>) => any;
|
|
17
|
+
leave: (event: Event) => any;
|
|
18
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
19
|
+
"onUpdate:modelValue"?: ((value: import("reka-ui").AcceptableValue) => any) | undefined;
|
|
20
|
+
onHighlight?: ((payload: {
|
|
21
|
+
ref: HTMLElement;
|
|
22
|
+
value: import("reka-ui").AcceptableValue;
|
|
23
|
+
} | undefined) => any) | undefined;
|
|
24
|
+
onEntryFocus?: ((event: CustomEvent<any>) => any) | undefined;
|
|
25
|
+
onLeave?: ((event: Event) => any) | undefined;
|
|
26
|
+
}>, {
|
|
27
|
+
modelValue: import("reka-ui").AcceptableValue | import("reka-ui").AcceptableValue[];
|
|
28
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
29
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
30
|
+
declare const _default: typeof __VLS_export;
|
|
31
|
+
export default _default;
|
|
32
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
33
|
+
new (): {
|
|
34
|
+
$slots: S;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { DialogRootProps } from 'reka-ui';
|
|
2
|
+
type __VLS_Props = DialogRootProps & {
|
|
3
|
+
title?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_38: {
|
|
7
|
+
open: boolean;
|
|
8
|
+
close: () => void;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_Slots = {} & {
|
|
11
|
+
default?: (props: typeof __VLS_38) => any;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
|
+
"update:open": (value: boolean) => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
17
|
+
}>, {
|
|
18
|
+
title: string;
|
|
19
|
+
description: string;
|
|
20
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
22
|
+
declare const _default: typeof __VLS_export;
|
|
23
|
+
export default _default;
|
|
24
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
25
|
+
new (): {
|
|
26
|
+
$slots: S;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useForwardPropsEmits } from "reka-ui";
|
|
3
|
+
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "../dialog";
|
|
4
|
+
import Command from "./Command.vue";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
open: { type: Boolean, required: false },
|
|
7
|
+
defaultOpen: { type: Boolean, required: false },
|
|
8
|
+
modal: { type: Boolean, required: false },
|
|
9
|
+
title: { type: String, required: false, default: "Command Palette" },
|
|
10
|
+
description: { type: String, required: false, default: "Search for a command to run..." }
|
|
11
|
+
});
|
|
12
|
+
const emits = defineEmits(["update:open"]);
|
|
13
|
+
const forwarded = useForwardPropsEmits(props, emits);
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<Dialog
|
|
18
|
+
v-slot="slotProps"
|
|
19
|
+
v-bind="forwarded"
|
|
20
|
+
>
|
|
21
|
+
<DialogContent
|
|
22
|
+
:show-close-button="false"
|
|
23
|
+
class="overflow-hidden p-0"
|
|
24
|
+
>
|
|
25
|
+
<DialogHeader class="sr-only">
|
|
26
|
+
<DialogTitle>{{ title }}</DialogTitle>
|
|
27
|
+
<DialogDescription>{{ description }}</DialogDescription>
|
|
28
|
+
</DialogHeader>
|
|
29
|
+
<Command>
|
|
30
|
+
<slot v-bind="slotProps" />
|
|
31
|
+
</Command>
|
|
32
|
+
</DialogContent>
|
|
33
|
+
</Dialog>
|
|
34
|
+
</template>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { DialogRootProps } from 'reka-ui';
|
|
2
|
+
type __VLS_Props = DialogRootProps & {
|
|
3
|
+
title?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_38: {
|
|
7
|
+
open: boolean;
|
|
8
|
+
close: () => void;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_Slots = {} & {
|
|
11
|
+
default?: (props: typeof __VLS_38) => any;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
|
+
"update:open": (value: boolean) => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
17
|
+
}>, {
|
|
18
|
+
title: string;
|
|
19
|
+
description: string;
|
|
20
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
22
|
+
declare const _default: typeof __VLS_export;
|
|
23
|
+
export default _default;
|
|
24
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
25
|
+
new (): {
|
|
26
|
+
$slots: S;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PrimitiveProps } from 'reka-ui';
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
type __VLS_Props = PrimitiveProps & {
|
|
4
|
+
class?: HTMLAttributes['class'];
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_8: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
default?: (props: typeof __VLS_8) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_base: 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>;
|
|
11
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
3
|
+
import { Primitive } from "reka-ui";
|
|
4
|
+
import { computed } from "vue";
|
|
5
|
+
import { cn } from "../../../utils/cn";
|
|
6
|
+
import { useCommand } from ".";
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
asChild: { type: Boolean, required: false },
|
|
9
|
+
as: { type: null, required: false },
|
|
10
|
+
class: { type: null, required: false }
|
|
11
|
+
});
|
|
12
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
13
|
+
const { filterState } = useCommand();
|
|
14
|
+
const isRender = computed(
|
|
15
|
+
() => !!filterState.search && filterState.filtered.count === 0
|
|
16
|
+
);
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<Primitive
|
|
21
|
+
v-if="isRender"
|
|
22
|
+
data-slot="command-empty"
|
|
23
|
+
v-bind="delegatedProps"
|
|
24
|
+
:class="cn('py-6 text-center text-sm', props.class)"
|
|
25
|
+
>
|
|
26
|
+
<slot />
|
|
27
|
+
</Primitive>
|
|
28
|
+
</template>
|