v-nuxt-ui 0.2.4 → 0.2.5

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 (51) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/AsyncSelect.d.vue.ts +25 -0
  3. package/dist/runtime/components/AsyncSelect.vue +178 -0
  4. package/dist/runtime/components/AsyncSelect.vue.d.ts +25 -0
  5. package/dist/runtime/components/AsyncTreeSelect.d.vue.ts +23 -0
  6. package/dist/runtime/components/AsyncTreeSelect.vue +151 -0
  7. package/dist/runtime/components/AsyncTreeSelect.vue.d.ts +23 -0
  8. package/dist/runtime/components/Empty.d.vue.ts +1 -1
  9. package/dist/runtime/components/Empty.vue.d.ts +1 -1
  10. package/dist/runtime/components/date-picker/Input.d.vue.ts +2 -2
  11. package/dist/runtime/components/date-picker/Input.vue.d.ts +2 -2
  12. package/dist/runtime/components/flow/FlowEdge.client.vue +6 -4
  13. package/dist/runtime/components/flow/FlowEditor.client.d.vue.ts +14 -0
  14. package/dist/runtime/components/flow/FlowEditor.client.vue +43 -7
  15. package/dist/runtime/components/flow/FlowEditor.client.vue.d.ts +14 -0
  16. package/dist/runtime/components/flow/FlowNode.client.vue +32 -25
  17. package/dist/runtime/components/flow/FlowToolbar.d.vue.ts +3 -0
  18. package/dist/runtime/components/flow/FlowToolbar.vue +16 -1
  19. package/dist/runtime/components/flow/FlowToolbar.vue.d.ts +3 -0
  20. package/dist/runtime/components/form/field/AsyncObjectSelect.d.vue.ts +4 -2
  21. package/dist/runtime/components/form/field/AsyncObjectSelect.vue +16 -13
  22. package/dist/runtime/components/form/field/AsyncObjectSelect.vue.d.ts +4 -2
  23. package/dist/runtime/components/form/field/AsyncSelect.d.vue.ts +8 -12
  24. package/dist/runtime/components/form/field/AsyncSelect.vue +31 -146
  25. package/dist/runtime/components/form/field/AsyncSelect.vue.d.ts +8 -12
  26. package/dist/runtime/components/form/field/AsyncTreeSelect.d.vue.ts +3 -5
  27. package/dist/runtime/components/form/field/AsyncTreeSelect.vue +31 -112
  28. package/dist/runtime/components/form/field/AsyncTreeSelect.vue.d.ts +3 -5
  29. package/dist/runtime/components/form/field/index.vue +3 -41
  30. package/dist/runtime/components/sys/department/CreateModal.vue +9 -9
  31. package/dist/runtime/components/sys/menu/CreateModal.vue +3 -3
  32. package/dist/runtime/components/sys/user/CreateModal.vue +9 -7
  33. package/dist/runtime/components/sys/user/Table.vue +3 -3
  34. package/dist/runtime/components/table/query/where/simple/item/opr/AsyncSelect.d.vue.ts +2 -6
  35. package/dist/runtime/components/table/query/where/simple/item/opr/AsyncSelect.vue +28 -122
  36. package/dist/runtime/components/table/query/where/simple/item/opr/AsyncSelect.vue.d.ts +2 -6
  37. package/dist/runtime/components/table/query/where/simple/item/opr/index.vue +2 -2
  38. package/dist/runtime/components/table/settings/UserTableColumnModal.d.vue.ts +2 -2
  39. package/dist/runtime/components/table/settings/UserTableColumnModal.vue.d.ts +2 -2
  40. package/dist/runtime/composables/flow/useFlowStyles.d.ts +2 -0
  41. package/dist/runtime/composables/flow/useFlowStyles.js +3 -0
  42. package/dist/runtime/constants/columns.js +2 -2
  43. package/dist/runtime/constants/flow.d.ts +4 -0
  44. package/dist/runtime/constants/flow.js +1 -0
  45. package/dist/runtime/types/components/async-select.d.ts +30 -0
  46. package/dist/runtime/types/components/async-select.js +0 -0
  47. package/dist/runtime/types/components/form/field.d.ts +8 -25
  48. package/dist/runtime/types/components/index.d.ts +1 -0
  49. package/dist/runtime/types/components/index.js +1 -0
  50. package/dist/runtime/types/components/table/column.d.ts +3 -27
  51. package/package.json +18 -18
@@ -1,151 +1,57 @@
1
1
  <script setup>
2
- import { ref, computed, useTemplateRef, watch } from "vue";
3
- import { useDebounceFn } from "@vueuse/core";
4
- import { defu } from "defu";
5
- import { useFetching } from "#v/composables/useBoolean";
6
- import { isEmptyString } from "#v/utils";
2
+ import { computed, useTemplateRef } from "vue";
3
+ import VAsyncSelect from "#v/components/AsyncSelect.vue";
7
4
  const props = defineProps({
8
- label: { type: String, required: true },
5
+ label: { type: String, required: false },
6
+ floatingPlaceholder: { type: Boolean, required: false },
9
7
  disabled: { type: Boolean, required: false },
10
- triggerFetching: { type: Function, required: false },
8
+ placeholder: { type: String, required: false },
9
+ size: { type: null, required: false, default: "sm" },
10
+ icon: { type: null, required: false },
11
11
  listApi: { type: Function, required: true },
12
+ searchFields: { type: Function, required: false },
13
+ likeSearchFields: { type: Array, required: false },
12
14
  extraQuery: { type: Object, required: false },
13
- initModelValues: { type: null, required: false },
14
- onUpdateInitModelValues: { type: Function, required: false },
15
- searchFields: { type: Array, required: true },
16
- extraSearchFieldFn: { type: Function, required: false },
17
- labelField: { type: null, required: false, default: "name" },
18
- valueField: { type: null, required: true, default: "id" },
15
+ fetchAll: { type: Boolean, required: false },
16
+ labelField: { type: null, required: true },
17
+ valueField: { type: null, required: true },
19
18
  labelRenderFn: { type: Function, required: false },
20
19
  enableEmptyOption: { type: Boolean, required: false },
21
- disableOprSelector: { type: Boolean, required: false },
22
20
  multiple: { type: Boolean, required: false },
23
- placeholder: { type: String, required: false },
24
- size: { type: null, required: false, default: "sm" },
21
+ afterSelect: { type: Function, required: false },
25
22
  canCreate: { type: Boolean, required: false },
26
23
  createModalComponent: { type: null, required: false },
27
24
  createModalOpenProps: { type: Object, required: false }
28
25
  });
29
26
  const whereQueryItem = defineModel("whereQueryItem", { type: Object, ...{ required: true } });
30
- const { fetching, startFetching, endFetching } = useFetching();
31
- const searchedData = ref([]);
32
- const currentSelectedData = computed(() => [...whereQueryItem.value.extraData ?? []].flat());
33
- const allData = computed(() => {
34
- const newSearchedData = [];
35
- if (props.enableEmptyOption) {
36
- newSearchedData.push({
37
- [props.valueField]: 0,
38
- [props.labelField]: "\u65E0"
39
- });
40
- }
41
- newSearchedData.push(...currentSelectedData.value);
42
- searchedData.value.forEach((searchedItem) => {
43
- const idx = newSearchedData.findIndex((item) => item[props.valueField] === searchedItem[props.valueField]);
44
- if (idx === -1) {
45
- newSearchedData.push(searchedItem);
46
- }
47
- });
48
- return newSearchedData;
49
- });
50
- const items = computed(() => {
51
- return fetching.value ? currentSelectedData.value.map((p) => ({
52
- label: String(props.labelRenderFn ? props.labelRenderFn(p) : p[props.labelField] ?? ""),
53
- value: p[props.valueField]
54
- })).filter((p) => p.label && !isEmptyString(String(p.value))) : allData.value.map((p) => ({
55
- label: String(props.labelRenderFn ? props.labelRenderFn(p) : p[props.labelField] ?? ""),
56
- value: p[props.valueField]
57
- })).filter((p) => p.label && !isEmptyString(String(p.value)));
58
- });
59
- const inputMenuValue = computed({
27
+ const modelValue = computed({
60
28
  get() {
61
- return whereQueryItem.value.value;
29
+ return {
30
+ values: whereQueryItem.value.value,
31
+ extraModels: whereQueryItem.value.extraData
32
+ };
62
33
  },
63
- set(newValues) {
64
- if (!newValues || newValues.length === 0) {
65
- whereQueryItem.value = { ...whereQueryItem.value, value: null };
66
- return;
67
- }
68
- const newExtraData = [];
69
- newValues.forEach((val) => {
70
- const foundItem = allData.value.find((p) => p[props.valueField] === val);
71
- if (foundItem) {
72
- newExtraData.push(foundItem);
73
- }
74
- });
34
+ set(newValue) {
75
35
  whereQueryItem.value = {
76
36
  ...whereQueryItem.value,
77
- value: newValues,
78
- extraData: newExtraData
37
+ value: newValue.values,
38
+ extraData: newValue.extraModels
79
39
  };
80
40
  }
81
41
  });
82
- const onFetchItems = async (searchTerm2) => {
83
- try {
84
- startFetching();
85
- const query = {
86
- pagination: { pageNum: 1, pageSize: 10 },
87
- whereQuery: { items: [] }
88
- };
89
- if (!isEmptyString(searchTerm2)) {
90
- props.searchFields.forEach((field) => {
91
- query.whereQuery?.items?.push({ field, opr: "like", value: searchTerm2, andOr: "or" });
92
- });
93
- }
94
- const result = await props.listApi(defu(query, props.extraQuery));
95
- if (result.data) {
96
- searchedData.value = result.data.value.data?.list ?? [];
97
- }
98
- } finally {
99
- endFetching();
100
- }
101
- };
102
- const searchTerm = ref("");
103
- const onDebounceFetchItems = useDebounceFn(onFetchItems, 512);
104
- watch(searchTerm, (newVal) => {
105
- onDebounceFetchItems(newVal);
106
- }, { immediate: false });
107
- const inputMenuRef = useTemplateRef("inputMenu");
42
+ const asyncSelectRef = useTemplateRef("asyncSelect");
108
43
  defineExpose({
109
44
  focus: () => {
110
- inputMenuRef.value?.inputRef.focus();
45
+ asyncSelectRef.value?.focus();
111
46
  }
112
47
  });
113
48
  </script>
114
49
 
115
50
  <template>
116
- <UInputMenu
117
- ref="inputMenu"
118
- v-model:search-term="searchTerm"
119
- v-model="inputMenuValue"
120
- :items="items"
121
- :placeholder="placeholder"
122
- multiple
123
- color="neutral"
124
- delete-icon="i-lucide-trash"
125
- value-key="value"
126
- clear
127
- clear-icon="i-lucide-circle-x"
128
- icon=""
129
- :loading="fetching"
130
- :disabled="disabled"
131
- open-on-focus
132
- trailing
133
- :ui="{
134
- root: 'rounded-none min-w-32',
135
- // TODO: 不然有rounded,这个应该是个bug
136
- content: 'min-w-fit',
137
- tagsInput: 'min-w-4 w-0'
138
- }"
139
- :content="{
140
- align: 'start'
141
- }"
142
- @update:open="(opened) => {
143
- if (opened) {
144
- onFetchItems(searchTerm);
145
- }
146
- }"
147
- @update:model-value="() => {
148
- inputMenuRef?.inputRef.focus();
149
- }"
51
+ <VAsyncSelect
52
+ ref="asyncSelect"
53
+ v-bind="props"
54
+ v-model="modelValue"
55
+ :placeholder="`\u8BF7\u9009\u62E9${label ?? ''}`"
150
56
  />
151
57
  </template>
@@ -1,10 +1,6 @@
1
- import type { VFormFieldAsyncSelectProps, WhereQueryItem } from '#v/types';
1
+ import type { WhereQueryItem, VAsyncSelectProps } from '#v/types';
2
2
  declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
- props: import("vue").PublicProps & __VLS_PrettifyLocal<({
4
- label: string;
5
- disabled?: boolean;
6
- triggerFetching?: () => Promise<void>;
7
- } & VFormFieldAsyncSelectProps<T> & {
3
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<(VAsyncSelectProps<T> & {
8
4
  whereQueryItem: WhereQueryItem<T>;
9
5
  }) & {
10
6
  "onUpdate:whereQueryItem"?: ((value: WhereQueryItem<T>) => any) | undefined;
@@ -35,7 +35,7 @@ defineExpose({
35
35
  :trigger-fetching="triggerFetching"
36
36
  />
37
37
  <TableQueryWhereSimpleItemOprInputNumber
38
- v-if="option.type === 'input-number'"
38
+ v-else-if="option.type === 'input-number'"
39
39
  ref="item"
40
40
  v-model:where-query-item="whereQueryItem"
41
41
  :label="option.label || whereQueryItem.field"
@@ -64,7 +64,7 @@ defineExpose({
64
64
  :trigger-fetching="triggerFetching"
65
65
  :label="option.label"
66
66
  :list-api="option.listApi"
67
- :search-fields="option.searchFields ?? []"
67
+ :search-fields="option.searchFields"
68
68
  :label-render-fn="option.labelRenderFn"
69
69
  :label-field="option.labelField"
70
70
  :value-field="option.valueField"
@@ -5,12 +5,12 @@ type __VLS_Props = {
5
5
  loading?: boolean;
6
6
  };
7
7
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
- close: () => any;
9
8
  "update:open": (args_0: boolean) => any;
9
+ close: () => any;
10
10
  save: (args_0: UserTableColumn) => any;
11
11
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
12
- onClose?: (() => any) | undefined;
13
12
  "onUpdate:open"?: ((args_0: boolean) => any) | undefined;
13
+ onClose?: (() => any) | undefined;
14
14
  onSave?: ((args_0: UserTableColumn) => any) | undefined;
15
15
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
16
  declare const _default: typeof __VLS_export;
@@ -5,12 +5,12 @@ type __VLS_Props = {
5
5
  loading?: boolean;
6
6
  };
7
7
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
- close: () => any;
9
8
  "update:open": (args_0: boolean) => any;
9
+ close: () => any;
10
10
  save: (args_0: UserTableColumn) => any;
11
11
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
12
- onClose?: (() => any) | undefined;
13
12
  "onUpdate:open"?: ((args_0: boolean) => any) | undefined;
13
+ onClose?: (() => any) | undefined;
14
14
  onSave?: ((args_0: UserTableColumn) => any) | undefined;
15
15
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
16
  declare const _default: typeof __VLS_export;
@@ -13,6 +13,7 @@ export interface FlowEdgeStylesState {
13
13
  }
14
14
  /** 节点样式存储结构 */
15
15
  export interface FlowNodeStylesState {
16
+ showBorder: boolean;
16
17
  borderWidth: number;
17
18
  borderRadius: number;
18
19
  borderColor: string;
@@ -49,6 +50,7 @@ export declare function useFlowStyles(): {
49
50
  edgePathType: WritableComputedRef<FlowEdgePathType, FlowEdgePathType>;
50
51
  edgeColor: WritableComputedRef<string, string>;
51
52
  edgeLabelColor: WritableComputedRef<string, string>;
53
+ nodeShowBorder: WritableComputedRef<boolean, boolean>;
52
54
  nodeBorderWidth: WritableComputedRef<number, number>;
53
55
  nodeBorderRadius: WritableComputedRef<number, number>;
54
56
  nodeBorderColor: WritableComputedRef<string, string>;
@@ -13,6 +13,7 @@ const EDGE_DEFAULTS = {
13
13
  labelColor: ""
14
14
  };
15
15
  const NODE_DEFAULTS = {
16
+ showBorder: true,
16
17
  borderWidth: 2,
17
18
  borderRadius: 6,
18
19
  borderColor: "",
@@ -74,6 +75,7 @@ export function useFlowStyles() {
74
75
  const edgePathType = useField(edgeStore, "pathType");
75
76
  const edgeColor = useField(edgeStore, "color");
76
77
  const edgeLabelColor = useField(edgeStore, "labelColor");
78
+ const nodeShowBorder = useField(nodeStore, "showBorder");
77
79
  const nodeBorderWidth = useField(nodeStore, "borderWidth");
78
80
  const nodeBorderRadius = useField(nodeStore, "borderRadius");
79
81
  const nodeBorderColor = useField(nodeStore, "borderColor");
@@ -117,6 +119,7 @@ export function useFlowStyles() {
117
119
  edgeColor,
118
120
  edgeLabelColor,
119
121
  // 节点(原始自定义值,用于 UI 绑定)
122
+ nodeShowBorder,
120
123
  nodeBorderWidth,
121
124
  nodeBorderRadius,
122
125
  nodeBorderColor,
@@ -20,7 +20,7 @@ export const getOprColumns = (createdAtSortOpr = "desc") => [
20
20
  filterOption: {
21
21
  type: "async-select",
22
22
  listApi: useUserApi().list,
23
- searchFields: ["nickname"],
23
+ likeSearchFields: ["nickname"],
24
24
  labelField: "nickname",
25
25
  valueField: "id",
26
26
  multiple: true,
@@ -35,7 +35,7 @@ export const getOprColumns = (createdAtSortOpr = "desc") => [
35
35
  filterOption: {
36
36
  type: "async-select",
37
37
  listApi: useUserApi().list,
38
- searchFields: ["nickname"],
38
+ likeSearchFields: ["nickname"],
39
39
  labelField: "nickname",
40
40
  valueField: "id",
41
41
  multiple: true,
@@ -20,6 +20,10 @@ export interface FlowHandle {
20
20
  * 鼠标位置注入 Key
21
21
  */
22
22
  export declare const FLOW_MOUSE_POSITION_KEY: InjectionKey<Ref<FlowMousePosition>>;
23
+ /**
24
+ * 是否可编辑注入 Key
25
+ */
26
+ export declare const FLOW_EDITABLE_KEY: InjectionKey<Ref<boolean>>;
23
27
  export declare const FLOW_HANDLES: FlowHandle[];
24
28
  /**
25
29
  * Handle 层级阈值(可配置)
@@ -1,6 +1,7 @@
1
1
  import { Position } from "@vue-flow/core";
2
2
  export const GRID_SIZE = 20;
3
3
  export const FLOW_MOUSE_POSITION_KEY = Symbol("flow-mouse-position");
4
+ export const FLOW_EDITABLE_KEY = Symbol("flow-editable");
4
5
  export const FLOW_HANDLES = [
5
6
  // 4个角 - 可以双向调整
6
7
  { id: "tl", position: Position.Top, offsetPercent: { x: 0 } },
@@ -0,0 +1,30 @@
1
+ import type { ApiGroup, QueryTemplate, WhereQueryItem } from '#v/types';
2
+ import type { Component } from 'vue';
3
+ import type { InputMenuProps } from '@nuxt/ui';
4
+ export type VAsyncSelectProps<T> = {
5
+ label?: string;
6
+ floatingPlaceholder?: boolean;
7
+ disabled?: InputMenuProps['disabled'];
8
+ placeholder?: InputMenuProps['placeholder'];
9
+ size?: InputMenuProps['size'];
10
+ icon?: InputMenuProps['icon'];
11
+ listApi: ApiGroup<T>['list'];
12
+ searchFields?(keyword: string): WhereQueryItem<T>[];
13
+ likeSearchFields?: string[];
14
+ extraQuery?: QueryTemplate<T>;
15
+ fetchAll?: boolean;
16
+ labelField: keyof T;
17
+ valueField: keyof T;
18
+ labelRenderFn?(model: T): string | undefined;
19
+ enableEmptyOption?: boolean;
20
+ multiple?: boolean;
21
+ afterSelect?(selected: T | T[] | undefined): void;
22
+ canCreate?: boolean;
23
+ createModalComponent?: Component;
24
+ createModalOpenProps?: Record<string, any>;
25
+ };
26
+ export type AsyncSelectValue = string[] | number[] | string | number | undefined;
27
+ export type AsyncSelectCombinedValue = {
28
+ values: AsyncSelectValue;
29
+ extraModels?: any[];
30
+ };
File without changes
@@ -1,32 +1,15 @@
1
- import type { VNode, Ref, Component } from 'vue';
1
+ import type { VNode } from 'vue';
2
2
  import type { ButtonProps, FormFieldProps, InputProps, RadioGroupProps, SelectMenuItem, SelectProps, TreeItem } from '@nuxt/ui';
3
3
  import type { ZodType } from 'zod';
4
- import type { PageResult, RequestResult } from '../../request.js';
5
- import type { QueryTemplate, WhereQueryItem } from '../../query.js';
4
+ import type { VAsyncSelectProps } from '#v/types';
6
5
  export type VFormFieldAsyncSelectProps<T> = {
7
- listApi(payload: Omit<QueryTemplate<T>, 'selectQuery'>): Promise<{
8
- data: Ref<RequestResult<PageResult<T>>>;
9
- }>;
10
- extraQuery?: QueryTemplate<T>;
11
- initModelValues?: any | any[];
12
- onUpdateInitModelValues?: (newInitModels: any | any[]) => void;
13
- searchFields: (string)[];
14
- extraSearchFieldFn?(keyword: string): WhereQueryItem<T>;
15
- labelField?: keyof T;
16
- valueField: keyof T;
17
- labelRenderFn?(model: T): string | undefined;
18
- enableEmptyOption?: boolean;
19
- disableOprSelector?: boolean;
20
- multiple?: boolean;
21
- placeholder?: string;
22
- size?: SelectProps['size'];
23
- canCreate?: boolean;
24
- createModalComponent?: Component;
25
- createModalOpenProps?: Record<string, any>;
26
- };
6
+ initModel?: any | any[];
7
+ onUpdateInitModel?(model: any | any[] | undefined): void;
8
+ } & VAsyncSelectProps<T>;
27
9
  export type VFormFieldAsyncTreeSelectProps<T> = {
28
- fetchAll?: boolean;
29
- } & VFormFieldAsyncSelectProps<T>;
10
+ initModel?: any | any[];
11
+ onUpdateInitModel?(model: any | any[] | undefined): void;
12
+ } & VAsyncSelectProps<T>;
30
13
  export type VFormFieldTreeSelectTransferProps = {
31
14
  sourceTreeItems: TreeItem[];
32
15
  targetTreeItems: TreeItem[];
@@ -2,3 +2,4 @@ export * from './table/index.js';
2
2
  export * from './form/index.js';
3
3
  export * from './date.js';
4
4
  export * from './dnd.js';
5
+ export * from './async-select.js';
@@ -2,3 +2,4 @@ export * from "./table/index.js";
2
2
  export * from "./form/index.js";
3
3
  export * from "./date.js";
4
4
  export * from "./dnd.js";
5
+ export * from "./async-select.js";
@@ -1,31 +1,7 @@
1
- import type { OrderQueryOpr, WhereQueryOpr, QueryTemplate, WhereQueryItem } from '../../query.js';
2
- import type { PageResult, RequestResult } from '../../request.js';
1
+ import type { OrderQueryOpr, WhereQueryOpr } from '../../query.js';
3
2
  import type { TableColumn, BadgeProps, InputMenuProps } from '@nuxt/ui';
4
- import type { SelectOption } from '../../index.js';
5
- import type { Ref } from 'vue';
3
+ import type { SelectOption, VAsyncSelectProps } from '../../index.js';
6
4
  export type WhereQueryType = 'input' | 'input-number' | 'date-picker' | 'select' | 'async-select' | 'unknown';
7
- /**
8
- * 专用于 WhereQueryColumnOption async-select 分支的属性类型。
9
- * 与 VFormFieldAsyncSelectProps<T> 结构一致,但 listApi 使用方法签名。
10
- * 函数属性使用方法签名以保持 T 的双变性(bivariant),
11
- * 使 VColumn<SubType> 可以安全赋值给 VColumn<Record<string, any>>。
12
- */
13
- export type WhereQueryColumnAsyncSelectProps<T> = {
14
- listApi(payload: Omit<QueryTemplate<T>, 'selectQuery'>): Promise<{
15
- data: Ref<RequestResult<PageResult<T>>>;
16
- }>;
17
- extraQuery?: QueryTemplate<T>;
18
- searchFields: string[];
19
- extraSearchFieldFn?(keyword: string): WhereQueryItem<T>;
20
- labelField?: keyof T;
21
- valueField: keyof T;
22
- labelRenderFn?(model: T): string | undefined;
23
- enableEmptyOption?: boolean;
24
- disableOprSelector?: boolean;
25
- multiple?: boolean;
26
- placeholder?: InputMenuProps['placeholder'];
27
- size?: InputMenuProps['size'];
28
- };
29
5
  export type WhereQueryColumnOption<T> = {
30
6
  defaultOpr?: WhereQueryOpr;
31
7
  custom?: boolean;
@@ -46,7 +22,7 @@ export type WhereQueryColumnOption<T> = {
46
22
  placeholder?: InputMenuProps['placeholder'];
47
23
  } | {
48
24
  type: 'async-select';
49
- } & WhereQueryColumnAsyncSelectProps<T> | {
25
+ } & VAsyncSelectProps<T> | {
50
26
  type: 'unknown';
51
27
  });
52
28
  export type OrderQueryColumnOption = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "v-nuxt-ui",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Veken UI Component Library - Reusable Nuxt UI components, composables, and utilities for enterprise applications",
5
5
  "type": "module",
6
6
  "style": "./dist/runtime/index.css",
@@ -30,9 +30,9 @@
30
30
  "typecheck": "nuxi typecheck playground"
31
31
  },
32
32
  "dependencies": {
33
- "@nuxt/kit": "^4.3.1",
34
- "dayjs": "^1.11.19",
35
- "defu": "^6.1.4",
33
+ "@nuxt/kit": "^4.4.2",
34
+ "dayjs": "^1.11.20",
35
+ "defu": "^6.1.7",
36
36
  "maska": "^3.2.0",
37
37
  "uuid": "^13.0.0"
38
38
  },
@@ -54,45 +54,45 @@
54
54
  }
55
55
  },
56
56
  "optionalDependencies": {
57
- "cronstrue": "^3.12.0",
57
+ "cronstrue": "^3.14.0",
58
58
  "echarts": "^6.0.0",
59
59
  "exceljs": "^4.4.0",
60
60
  "monaco-editor": "^0.55.1",
61
61
  "shiki": "^3.23.0",
62
- "sql-formatter": "^15.7.2",
62
+ "sql-formatter": "^15.7.3",
63
63
  "vue-draggable-plus": "^0.6.1",
64
64
  "vue-echarts": "^8.0.1"
65
65
  },
66
66
  "devDependencies": {
67
- "@vue-flow/core": "^1.42.2",
68
- "@vue-flow/background": "^1.3.2",
69
- "@iconify-json/lucide": "^1.2.94",
70
- "@internationalized/date": "^3.12.0",
71
- "@nuxt/content": "^3.12.0",
67
+ "@iconify-json/lucide": "^1.2.102",
68
+ "@internationalized/date": "^3.12.1",
69
+ "@nuxt/content": "^3.13.0",
72
70
  "@nuxt/eslint": "^1.15.2",
73
71
  "@nuxt/eslint-config": "^1.15.2",
74
72
  "@nuxt/fonts": "^0.12.1",
75
73
  "@nuxt/module-builder": "^1.0.2",
76
- "@nuxt/ui": "^4.6.0",
74
+ "@nuxt/ui": "^4.6.1",
77
75
  "@nuxtjs/i18n": "^10.2.4",
78
76
  "@nuxtjs/mdc": "^0.20.2",
79
77
  "@tanstack/table-core": "^8.21.3",
80
78
  "@types/better-sqlite3": "^7.6.13",
81
79
  "@types/sortablejs": "^1.15.9",
82
80
  "@types/uuid": "^11.0.0",
81
+ "@vue-flow/background": "^1.3.2",
82
+ "@vue-flow/core": "^1.48.2",
83
83
  "@vueuse/core": "^14.2.1",
84
84
  "@vueuse/nuxt": "^14.2.1",
85
- "better-sqlite3": "^12.8.0",
85
+ "better-sqlite3": "^12.9.0",
86
86
  "cronstrue": "^3.12.0",
87
87
  "echarts": "^6.0.0",
88
- "eslint": "^9.39.3",
88
+ "eslint": "^9.39.4",
89
89
  "exceljs": "^4.4.0",
90
90
  "fflate": "^0.8.2",
91
91
  "json5": "^2.2.3",
92
92
  "monaco-editor": "^0.55.1",
93
- "nuxt": "^4.3.1",
93
+ "nuxt": "^4.4.2",
94
94
  "ohash": "^2.0.11",
95
- "reka-ui": "^2.9.2",
95
+ "reka-ui": "^2.9.6",
96
96
  "scule": "^1.3.0",
97
97
  "shiki": "^3.23.0",
98
98
  "sortablejs": "^1.15.7",
@@ -100,10 +100,10 @@
100
100
  "tailwindcss": "^4.2.2",
101
101
  "typescript": "^5.9.3",
102
102
  "unbuild": "^3.6.1",
103
- "vue": "^3.5.0",
103
+ "vue": "^3.5.32",
104
104
  "vue-draggable-plus": "^0.6.1",
105
105
  "vue-echarts": "^8.0.1",
106
- "vue-tsc": "^3.2.5",
106
+ "vue-tsc": "^3.2.6",
107
107
  "zod": "^4.3.6"
108
108
  },
109
109
  "packageManager": "pnpm@10.29.2",