@shwfed/nuxt 0.1.20 → 0.1.22

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.
Files changed (117) hide show
  1. package/dist/module.d.mts +1 -1
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +9 -2
  4. package/dist/runtime/components/app.d.vue.ts +2 -2
  5. package/dist/runtime/components/app.vue +58 -3
  6. package/dist/runtime/components/app.vue.d.ts +2 -2
  7. package/dist/runtime/components/table.d.vue.ts +12 -3
  8. package/dist/runtime/components/table.vue +44 -82
  9. package/dist/runtime/components/table.vue.d.ts +12 -3
  10. package/dist/runtime/components/ui/button/index.d.ts +1 -1
  11. package/dist/runtime/components/ui/button-group/ButtonGroup.d.vue.ts +19 -0
  12. package/dist/runtime/components/ui/button-group/ButtonGroup.vue +19 -0
  13. package/dist/runtime/components/ui/button-group/ButtonGroup.vue.d.ts +19 -0
  14. package/dist/runtime/components/ui/button-group/ButtonGroupSeparator.d.vue.ts +10 -0
  15. package/dist/runtime/components/ui/button-group/ButtonGroupSeparator.vue +25 -0
  16. package/dist/runtime/components/ui/button-group/ButtonGroupSeparator.vue.d.ts +10 -0
  17. package/dist/runtime/components/ui/button-group/ButtonGroupText.d.vue.ts +22 -0
  18. package/dist/runtime/components/ui/button-group/ButtonGroupText.vue +23 -0
  19. package/dist/runtime/components/ui/button-group/ButtonGroupText.vue.d.ts +22 -0
  20. package/dist/runtime/components/ui/button-group/index.d.ts +8 -0
  21. package/dist/runtime/components/ui/button-group/index.js +18 -0
  22. package/dist/runtime/components/ui/checkbox/Checkbox.d.vue.ts +25 -0
  23. package/dist/runtime/components/ui/checkbox/Checkbox.vue +47 -0
  24. package/dist/runtime/components/ui/checkbox/Checkbox.vue.d.ts +25 -0
  25. package/dist/runtime/components/ui/checkbox/index.d.ts +1 -0
  26. package/dist/runtime/components/ui/checkbox/index.js +1 -0
  27. package/dist/runtime/components/ui/command/Command.d.vue.ts +36 -0
  28. package/dist/runtime/components/ui/command/Command.vue +81 -0
  29. package/dist/runtime/components/ui/command/Command.vue.d.ts +36 -0
  30. package/dist/runtime/components/{tooltip.d.vue.ts → ui/command/CommandDialog.d.vue.ts} +13 -6
  31. package/dist/runtime/components/ui/command/CommandDialog.vue +34 -0
  32. package/dist/runtime/components/{tooltip.vue.d.ts → ui/command/CommandDialog.vue.d.ts} +13 -6
  33. package/dist/runtime/components/ui/command/CommandEmpty.d.vue.ts +18 -0
  34. package/dist/runtime/components/ui/command/CommandEmpty.vue +28 -0
  35. package/dist/runtime/components/ui/command/CommandEmpty.vue.d.ts +18 -0
  36. package/dist/runtime/components/ui/command/CommandGroup.d.vue.ts +19 -0
  37. package/dist/runtime/components/ui/command/CommandGroup.vue +44 -0
  38. package/dist/runtime/components/ui/command/CommandGroup.vue.d.ts +19 -0
  39. package/dist/runtime/components/ui/command/CommandInput.d.vue.ts +8 -0
  40. package/dist/runtime/components/ui/command/CommandInput.vue +40 -0
  41. package/dist/runtime/components/ui/command/CommandInput.vue.d.ts +8 -0
  42. package/dist/runtime/components/ui/command/CommandItem.d.vue.ts +22 -0
  43. package/dist/runtime/components/ui/command/CommandItem.vue +65 -0
  44. package/dist/runtime/components/ui/command/CommandItem.vue.d.ts +22 -0
  45. package/dist/runtime/components/ui/command/CommandList.d.vue.ts +18 -0
  46. package/dist/runtime/components/ui/command/CommandList.vue +24 -0
  47. package/dist/runtime/components/ui/command/CommandList.vue.d.ts +18 -0
  48. package/dist/runtime/components/ui/command/CommandSeparator.d.vue.ts +18 -0
  49. package/dist/runtime/components/ui/command/CommandSeparator.vue +23 -0
  50. package/dist/runtime/components/ui/command/CommandSeparator.vue.d.ts +18 -0
  51. package/dist/runtime/components/{dialog.d.vue.ts → ui/command/CommandShortcut.d.vue.ts} +5 -10
  52. package/dist/runtime/components/ui/command/CommandShortcut.vue +15 -0
  53. package/dist/runtime/components/{dialog.vue.d.ts → ui/command/CommandShortcut.vue.d.ts} +5 -10
  54. package/dist/runtime/components/ui/command/index.d.ts +90 -0
  55. package/dist/runtime/components/ui/command/index.js +12 -0
  56. package/dist/runtime/components/ui/dialog/Dialog.d.vue.ts +21 -0
  57. package/dist/runtime/components/ui/dialog/Dialog.vue +20 -0
  58. package/dist/runtime/components/ui/dialog/Dialog.vue.d.ts +21 -0
  59. package/dist/runtime/components/ui/dialog/DialogClose.d.vue.ts +14 -0
  60. package/dist/runtime/components/ui/dialog/DialogClose.vue +16 -0
  61. package/dist/runtime/components/ui/dialog/DialogClose.vue.d.ts +14 -0
  62. package/dist/runtime/components/ui/dialog/DialogContent.d.vue.ts +35 -0
  63. package/dist/runtime/components/ui/dialog/DialogContent.vue +53 -0
  64. package/dist/runtime/components/ui/dialog/DialogContent.vue.d.ts +35 -0
  65. package/dist/runtime/components/ui/dialog/DialogDescription.d.vue.ts +18 -0
  66. package/dist/runtime/components/ui/dialog/DialogDescription.vue +22 -0
  67. package/dist/runtime/components/ui/dialog/DialogDescription.vue.d.ts +18 -0
  68. package/dist/runtime/components/ui/dialog/DialogFooter.d.vue.ts +17 -0
  69. package/dist/runtime/components/ui/dialog/DialogFooter.vue +15 -0
  70. package/dist/runtime/components/ui/dialog/DialogFooter.vue.d.ts +17 -0
  71. package/dist/runtime/components/ui/dialog/DialogHeader.d.vue.ts +17 -0
  72. package/dist/runtime/components/ui/dialog/DialogHeader.vue +15 -0
  73. package/dist/runtime/components/ui/dialog/DialogHeader.vue.d.ts +17 -0
  74. package/dist/runtime/components/ui/dialog/DialogOverlay.d.vue.ts +18 -0
  75. package/dist/runtime/components/ui/dialog/DialogOverlay.vue +22 -0
  76. package/dist/runtime/components/ui/dialog/DialogOverlay.vue.d.ts +18 -0
  77. package/dist/runtime/components/ui/dialog/DialogScrollContent.d.vue.ts +32 -0
  78. package/dist/runtime/components/ui/dialog/DialogScrollContent.vue +58 -0
  79. package/dist/runtime/components/ui/dialog/DialogScrollContent.vue.d.ts +32 -0
  80. package/dist/runtime/components/ui/dialog/DialogTitle.d.vue.ts +18 -0
  81. package/dist/runtime/components/ui/dialog/DialogTitle.vue +22 -0
  82. package/dist/runtime/components/ui/dialog/DialogTitle.vue.d.ts +18 -0
  83. package/dist/runtime/components/ui/dialog/DialogTrigger.d.vue.ts +14 -0
  84. package/dist/runtime/components/ui/dialog/DialogTrigger.vue +16 -0
  85. package/dist/runtime/components/ui/dialog/DialogTrigger.vue.d.ts +14 -0
  86. package/dist/runtime/components/ui/dialog/index.d.ts +10 -0
  87. package/dist/runtime/components/ui/dialog/index.js +10 -0
  88. package/dist/runtime/components/ui/separator/Separator.d.vue.ts +1 -1
  89. package/dist/runtime/components/ui/separator/Separator.vue.d.ts +1 -1
  90. package/dist/runtime/components/ui/tooltip/Tooltip.d.vue.ts +20 -0
  91. package/dist/runtime/components/ui/tooltip/Tooltip.vue +24 -0
  92. package/dist/runtime/components/ui/tooltip/Tooltip.vue.d.ts +20 -0
  93. package/dist/runtime/components/ui/tooltip/TooltipContent.d.vue.ts +26 -0
  94. package/dist/runtime/components/ui/tooltip/TooltipContent.vue +58 -0
  95. package/dist/runtime/components/ui/tooltip/TooltipContent.vue.d.ts +26 -0
  96. package/dist/runtime/components/ui/tooltip/TooltipProvider.d.vue.ts +16 -0
  97. package/dist/runtime/components/ui/tooltip/TooltipProvider.vue +17 -0
  98. package/dist/runtime/components/ui/tooltip/TooltipProvider.vue.d.ts +16 -0
  99. package/dist/runtime/components/ui/tooltip/TooltipTrigger.d.vue.ts +14 -0
  100. package/dist/runtime/components/ui/tooltip/TooltipTrigger.vue +17 -0
  101. package/dist/runtime/components/ui/tooltip/TooltipTrigger.vue.d.ts +14 -0
  102. package/dist/runtime/components/ui/tooltip/index.d.ts +4 -0
  103. package/dist/runtime/components/ui/tooltip/index.js +4 -0
  104. package/dist/runtime/plugins/cel/env.d.ts +5 -1
  105. package/dist/runtime/plugins/cel/env.js +3 -1
  106. package/dist/runtime/plugins/cel/index.d.ts +12 -4
  107. package/dist/runtime/plugins/cel/index.js +8 -6
  108. package/dist/runtime/plugins/i18n/index.d.ts +2 -0
  109. package/dist/runtime/plugins/i18n/index.js +14 -0
  110. package/dist/runtime/plugins/markdown/index.js +1 -1
  111. package/dist/runtime/table-renderers/builtins.js +13 -30
  112. package/package.json +3 -1
  113. package/dist/runtime/components/dialog.vue +0 -64
  114. package/dist/runtime/components/markdown.d.vue.ts +0 -19
  115. package/dist/runtime/components/markdown.vue +0 -52
  116. package/dist/runtime/components/markdown.vue.d.ts +0 -19
  117. package/dist/runtime/components/tooltip.vue +0 -48
package/dist/module.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
2
 
3
3
  interface ModuleOptions {
4
- clientId: string;
4
+ features: ReadonlyArray<string>;
5
5
  }
6
6
  declare module 'nuxt/schema' {
7
7
  interface PublicRuntimeConfig {
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shwfed/nuxt",
3
3
  "configKey": "shwfed",
4
- "version": "0.1.20",
4
+ "version": "0.1.22",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
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 __VLS_19: {};
1
+ declare var __VLS_53: {};
2
2
  type __VLS_Slots = {} & {
3
- default?: (props: typeof __VLS_19) => any;
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 { Tooltip } from "reka-ui/namespaced";
3
+ import { ref } from "vue";
4
+ import { CommandDialog, CommandInput, CommandList, CommandGroup, CommandEmpty } from "./ui/command";
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,62 @@ 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
- <Tooltip.Provider>
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
- </Tooltip.Provider>
63
+ </TooltipProvider>
21
64
  </template>
65
+
66
+ <i18n lang="yaml">
67
+ zh:
68
+ command-palette:
69
+ empty: 无搜索结果
70
+ ja:
71
+ command-palette:
72
+ empty: 結果はありません
73
+ en:
74
+ command-palette:
75
+ empty: No results
76
+ </i18n>
@@ -1,6 +1,6 @@
1
- declare var __VLS_19: {};
1
+ declare var __VLS_53: {};
2
2
  type __VLS_Slots = {} & {
3
- default?: (props: typeof __VLS_19) => any;
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
+ };
@@ -7,10 +7,8 @@ import { Pagination } from "reka-ui/namespaced";
7
7
  import { computed, ref } from "vue";
8
8
  import { useNuxtApp } from "#app";
9
9
  import { Button } from "./ui/button";
10
+ import { Tooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip";
10
11
  import { useTableRenderers } from "../composables/useTableRenderers";
11
- import Tooltip from "./tooltip.vue";
12
- import Dialog from "./dialog.vue";
13
- import MarkdownEditor from "./markdown.vue";
14
12
  import { useCheating } from "#imports";
15
13
  </script>
16
14
 
@@ -28,6 +26,7 @@ const props = defineProps({
28
26
  paginationLeft: { type: String, required: false },
29
27
  paginationRight: { type: String, required: false }
30
28
  });
29
+ const slots = defineSlots();
31
30
  const { $dsl } = useNuxtApp();
32
31
  const isCheating = useCheating();
33
32
  const { resolveTableRenderer } = useTableRenderers();
@@ -62,6 +61,9 @@ function translate(column) {
62
61
  id: column.id ?? genColumnId(column),
63
62
  header: (ctx) => renderer.header?.({ ctx, options }) ?? column.title,
64
63
  cell: (ctx) => {
64
+ if (ctx.column.id in slots) {
65
+ return slots[ctx.column.id]?.({ cell: ctx });
66
+ }
65
67
  return renderer.cell({ ctx, options });
66
68
  },
67
69
  accessorFn: (row, index) => {
@@ -70,7 +72,7 @@ function translate(column) {
70
72
  return getProperty(row, key);
71
73
  } else if (key !== void 0) {
72
74
  try {
73
- return $dsl.evaluate(key.read, {
75
+ return $dsl.evaluate`${key.read}`({
74
76
  row,
75
77
  index: BigInt(index)
76
78
  });
@@ -108,8 +110,7 @@ const table = useVueTable({
108
110
  getPaginationRowModel: getPaginationRowModel(),
109
111
  getRowId: props.getRowId ? (originalRow, index, parent) => {
110
112
  try {
111
- const key = $dsl.evaluate(
112
- props.getRowId,
113
+ const key = $dsl.evaluate`${props.getRowId}`(
113
114
  {
114
115
  row: originalRow,
115
116
  index,
@@ -132,7 +133,7 @@ const table = useVueTable({
132
133
  if (!props.getSubRows)
133
134
  return void 0;
134
135
  try {
135
- const value = $dsl.evaluate(props.getSubRows, {
136
+ const value = $dsl.evaluate`${props.getSubRows}`({
136
137
  row,
137
138
  index
138
139
  });
@@ -146,7 +147,7 @@ const table = useVueTable({
146
147
  if (!props.enableRowSelection)
147
148
  return true;
148
149
  try {
149
- return Boolean($dsl.evaluate(props.enableRowSelection, {
150
+ return Boolean($dsl.evaluate`${props.enableRowSelection}`({
150
151
  row: row.original,
151
152
  index: BigInt(row.index),
152
153
  id: row.id
@@ -158,7 +159,7 @@ const table = useVueTable({
158
159
  },
159
160
  enableMultiRowSelection: props.enableMultiRowSelection ? (row) => {
160
161
  try {
161
- return Boolean($dsl.evaluate(props.enableMultiRowSelection, {
162
+ return Boolean($dsl.evaluate`${props.enableMultiRowSelection}`({
162
163
  row: row.original,
163
164
  index: BigInt(row.index),
164
165
  id: row.id
@@ -195,7 +196,7 @@ function getCellStyles(ctx) {
195
196
  if (!props.cellStyles)
196
197
  return {};
197
198
  try {
198
- const result = $dsl.evaluate(props.cellStyles, {
199
+ const result = $dsl.evaluate`${props.cellStyles}`({
199
200
  row: ctx.row.original,
200
201
  index: BigInt(ctx.row.index),
201
202
  id: ctx.column.id,
@@ -296,9 +297,16 @@ function getSortIcon(column) {
296
297
  <Tooltip
297
298
  v-if="!header.isPlaceholder && header.column.columnDef.meta?.tooltip"
298
299
  :delay-duration="180"
299
- :content="$md.inline`${header.column.columnDef.meta.tooltip}`()"
300
300
  >
301
- <Icon icon="fluent:info-20-regular" />
301
+ <TooltipTrigger as-child>
302
+ <Icon icon="fluent:info-20-regular" />
303
+ </TooltipTrigger>
304
+ <TooltipContent
305
+ align="center"
306
+ side="top"
307
+ >
308
+ <span v-html="$md.inline`${header.column.columnDef.meta.tooltip}`()" />
309
+ </TooltipContent>
302
310
  </Tooltip>
303
311
 
304
312
  <Button
@@ -410,47 +418,24 @@ function getSortIcon(column) {
410
418
  </div>
411
419
 
412
420
  <div class="flex items-center justify-between w-full py-2 gap-2 text-sm text-zinc-600">
413
- <Dialog
414
- title="编辑分页左侧文字"
415
- width="50%"
416
- :disabled="!isCheating"
417
- >
418
- <template #trigger>
419
- <div
420
- :class="[
421
+ <div
422
+ :class="[
421
423
  'relative p-1 flex-1 prose prose-zinc text-xs border border-dashed',
422
424
  isCheating ? 'border-(--primary)/20 rounded hover:border-(--primary)/40 transition-colors duration-150 group cursor-pointer' : 'border-transparent'
423
425
  ]"
424
- >
425
- <span
426
- v-html="$md.inline`${props.paginationLeft}`({
426
+ >
427
+ <span
428
+ v-html="$md.inline`${props.paginationLeft}`({
427
429
  selected: table.getSelectedRowModel().rows.map((row) => row.original)
428
430
  })"
429
- />
430
- <Icon
431
- v-if="isCheating"
432
- icon="fluent:edit-20-regular"
433
- class="w-4 h-4 text-(--primary) absolute right-1 top-1/2 -translate-y-1/2 transform-3d group-hover:opacity-100 opacity-50 transition-opacity duration-150"
434
- />
431
+ />
432
+ <Icon
433
+ v-if="isCheating"
434
+ icon="fluent:edit-20-regular"
435
+ class="w-4 h-4 text-(--primary) absolute right-1 top-1/2 -translate-y-1/2 transform-3d group-hover:opacity-100 opacity-50 transition-opacity duration-150"
436
+ />
435
437
  &nbsp;
436
- </div>
437
- </template>
438
- <template #default>
439
- <MarkdownEditor
440
- :model-value="props.paginationLeft ?? ''"
441
- class="w-full h-64"
442
- :variables="[
443
- {
444
- identity: 'selected',
445
- type: 'list<dyn>',
446
- description: $md.raw`
447
- 表格被选中的行:如果没有被选中的行,那么这个变量将始终为空列表。
448
- `
449
- }
450
- ]"
451
- />
452
- </template>
453
- </Dialog>
438
+ </div>
454
439
  <div class="flex items-center gap-4">
455
440
  <span class="text-xs">{{ `\u5171 ${props.data.length} \u6761` }}</span>
456
441
  <Pagination.Root
@@ -535,47 +520,24 @@ function getSortIcon(column) {
535
520
  </Pagination.Root>
536
521
  <span class="text-xs">前往</span>
537
522
  </div>
538
- <Dialog
539
- title="编辑分页右侧文字"
540
- width="50%"
541
- :disabled="!isCheating"
542
- >
543
- <template #trigger>
544
- <div
545
- :class="[
523
+ <div
524
+ :class="[
546
525
  'relative p-1 flex-1 prose prose-zinc text-xs border border-dashed',
547
526
  isCheating ? 'border-(--primary)/20 rounded hover:border-(--primary)/40 transition-colors duration-150 group cursor-pointer' : 'border-transparent'
548
527
  ]"
549
- >
550
- <span
551
- v-html="$md.inline`${props.paginationRight}`({
528
+ >
529
+ <span
530
+ v-html="$md.inline`${props.paginationRight}`({
552
531
  selected: table.getSelectedRowModel().rows.map((row) => row.original)
553
532
  })"
554
- />
555
- <Icon
556
- v-if="isCheating"
557
- icon="fluent:edit-20-regular"
558
- class="w-4 h-4 text-(--primary) absolute right-1 top-1/2 -translate-y-1/2 transform-3d group-hover:opacity-100 opacity-50 transition-opacity duration-150"
559
- />
533
+ />
534
+ <Icon
535
+ v-if="isCheating"
536
+ icon="fluent:edit-20-regular"
537
+ class="w-4 h-4 text-(--primary) absolute right-1 top-1/2 -translate-y-1/2 transform-3d group-hover:opacity-100 opacity-50 transition-opacity duration-150"
538
+ />
560
539
  &nbsp;
561
- </div>
562
- </template>
563
- <template #default>
564
- <MarkdownEditor
565
- :model-value="props.paginationRight ?? ''"
566
- class="w-full h-64"
567
- :variables="[
568
- {
569
- identity: 'selected',
570
- type: 'list<dyn>',
571
- description: $md.raw`
572
- 表格被选中的行:如果没有被选中的行,那么这个变量将始终为空列表。
573
- `
574
- }
575
- ]"
576
- />
577
- </template>
578
- </Dialog>
540
+ </div>
579
541
  </div>
580
542
  </div>
581
543
  </template>
@@ -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
+ };
@@ -1,7 +1,7 @@
1
1
  import type { VariantProps } from 'class-variance-authority';
2
2
  export { default as Button } from './Button.vue.js';
3
3
  export declare const buttonVariants: (props?: ({
4
- variant?: "primary" | "default" | "destructive" | "ghost" | null | undefined;
4
+ variant?: "default" | "primary" | "destructive" | "ghost" | null | undefined;
5
5
  size?: "default" | "sm" | "xs" | null | undefined;
6
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
7
  export type ButtonVariants = VariantProps<typeof buttonVariants>;
@@ -0,0 +1,19 @@
1
+ import type { HTMLAttributes } from 'vue';
2
+ import type { ButtonGroupVariants } from '.';
3
+ type __VLS_Props = {
4
+ class?: HTMLAttributes['class'];
5
+ orientation?: ButtonGroupVariants['orientation'];
6
+ };
7
+ declare var __VLS_1: {};
8
+ type __VLS_Slots = {} & {
9
+ default?: (props: typeof __VLS_1) => any;
10
+ };
11
+ 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>;
12
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
13
+ declare const _default: typeof __VLS_export;
14
+ export default _default;
15
+ type __VLS_WithSlots<T, S> = T & {
16
+ new (): {
17
+ $slots: S;
18
+ };
19
+ };
@@ -0,0 +1,19 @@
1
+ <script setup>
2
+ import { cn } from "../../../utils/cn";
3
+ import { buttonGroupVariants } from ".";
4
+ const props = defineProps({
5
+ class: { type: null, required: false },
6
+ orientation: { type: null, required: false }
7
+ });
8
+ </script>
9
+
10
+ <template>
11
+ <div
12
+ role="group"
13
+ data-slot="button-group"
14
+ :data-orientation="props.orientation"
15
+ :class="cn(buttonGroupVariants({ orientation: props.orientation }), props.class)"
16
+ >
17
+ <slot />
18
+ </div>
19
+ </template>
@@ -0,0 +1,19 @@
1
+ import type { HTMLAttributes } from 'vue';
2
+ import type { ButtonGroupVariants } from '.';
3
+ type __VLS_Props = {
4
+ class?: HTMLAttributes['class'];
5
+ orientation?: ButtonGroupVariants['orientation'];
6
+ };
7
+ declare var __VLS_1: {};
8
+ type __VLS_Slots = {} & {
9
+ default?: (props: typeof __VLS_1) => any;
10
+ };
11
+ 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>;
12
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
13
+ declare const _default: typeof __VLS_export;
14
+ export default _default;
15
+ type __VLS_WithSlots<T, S> = T & {
16
+ new (): {
17
+ $slots: S;
18
+ };
19
+ };
@@ -0,0 +1,10 @@
1
+ import type { SeparatorProps } from 'reka-ui';
2
+ import type { HTMLAttributes } from 'vue';
3
+ type __VLS_Props = SeparatorProps & {
4
+ class?: HTMLAttributes['class'];
5
+ };
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: "vertical" | "horizontal";
8
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ declare const _default: typeof __VLS_export;
10
+ export default _default;
@@ -0,0 +1,25 @@
1
+ <script setup>
2
+ import { reactiveOmit } from "@vueuse/core";
3
+ import { cn } from "../../../utils/cn";
4
+ import { Separator } from "../separator";
5
+ const props = defineProps({
6
+ orientation: { type: String, required: false, default: "vertical" },
7
+ decorative: { type: Boolean, required: false },
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
+ </script>
14
+
15
+ <template>
16
+ <Separator
17
+ data-slot="button-group-separator"
18
+ v-bind="delegatedProps"
19
+ :orientation="props.orientation"
20
+ :class="cn(
21
+ 'bg-input relative m-0! self-stretch data-[orientation=vertical]:h-auto',
22
+ props.class
23
+ )"
24
+ />
25
+ </template>
@@ -0,0 +1,10 @@
1
+ import type { SeparatorProps } from 'reka-ui';
2
+ import type { HTMLAttributes } from 'vue';
3
+ type __VLS_Props = SeparatorProps & {
4
+ class?: HTMLAttributes['class'];
5
+ };
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: "vertical" | "horizontal";
8
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ declare const _default: typeof __VLS_export;
10
+ export default _default;
@@ -0,0 +1,22 @@
1
+ import type { PrimitiveProps } from 'reka-ui';
2
+ import type { HTMLAttributes } from 'vue';
3
+ import type { ButtonGroupVariants } from '.';
4
+ interface Props extends PrimitiveProps {
5
+ class?: HTMLAttributes['class'];
6
+ orientation?: ButtonGroupVariants['orientation'];
7
+ }
8
+ declare var __VLS_8: {};
9
+ type __VLS_Slots = {} & {
10
+ default?: (props: typeof __VLS_8) => any;
11
+ };
12
+ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
13
+ as: import("reka-ui").AsTag | import("vue").Component;
14
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
18
+ type __VLS_WithSlots<T, S> = T & {
19
+ new (): {
20
+ $slots: S;
21
+ };
22
+ };
@@ -0,0 +1,23 @@
1
+ <script setup>
2
+ import { Primitive } from "reka-ui";
3
+ import { cn } from "../../../utils/cn";
4
+ const props = defineProps({
5
+ class: { type: null, required: false },
6
+ orientation: { type: null, required: false },
7
+ asChild: { type: Boolean, required: false },
8
+ as: { type: null, required: false, default: "div" }
9
+ });
10
+ </script>
11
+
12
+ <template>
13
+ <Primitive
14
+ role="group"
15
+ data-slot="button-group"
16
+ :data-orientation="props.orientation"
17
+ :as="as"
18
+ :as-child="asChild"
19
+ :class="cn('bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*=\'size-\'])]:size-4', props.class)"
20
+ >
21
+ <slot />
22
+ </Primitive>
23
+ </template>
@@ -0,0 +1,22 @@
1
+ import type { PrimitiveProps } from 'reka-ui';
2
+ import type { HTMLAttributes } from 'vue';
3
+ import type { ButtonGroupVariants } from '.';
4
+ interface Props extends PrimitiveProps {
5
+ class?: HTMLAttributes['class'];
6
+ orientation?: ButtonGroupVariants['orientation'];
7
+ }
8
+ declare var __VLS_8: {};
9
+ type __VLS_Slots = {} & {
10
+ default?: (props: typeof __VLS_8) => any;
11
+ };
12
+ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
13
+ as: import("reka-ui").AsTag | import("vue").Component;
14
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
18
+ type __VLS_WithSlots<T, S> = T & {
19
+ new (): {
20
+ $slots: S;
21
+ };
22
+ };
@@ -0,0 +1,8 @@
1
+ import type { VariantProps } from 'class-variance-authority';
2
+ export { default as ButtonGroup } from './ButtonGroup.vue.js';
3
+ export { default as ButtonGroupSeparator } from './ButtonGroupSeparator.vue.js';
4
+ export { default as ButtonGroupText } from './ButtonGroupText.vue.js';
5
+ export declare const buttonGroupVariants: (props?: ({
6
+ orientation?: "vertical" | "horizontal" | null | undefined;
7
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
+ export type ButtonGroupVariants = VariantProps<typeof buttonGroupVariants>;
@@ -0,0 +1,18 @@
1
+ import { cva } from "class-variance-authority";
2
+ export { default as ButtonGroup } from "./ButtonGroup.vue";
3
+ export { default as ButtonGroupSeparator } from "./ButtonGroupSeparator.vue";
4
+ export { default as ButtonGroupText } from "./ButtonGroupText.vue";
5
+ export const buttonGroupVariants = cva(
6
+ "flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2",
7
+ {
8
+ variants: {
9
+ orientation: {
10
+ horizontal: "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
11
+ vertical: "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"
12
+ }
13
+ },
14
+ defaultVariants: {
15
+ orientation: "horizontal"
16
+ }
17
+ }
18
+ );