v-nuxt-ui 0.1.34 → 0.1.36

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 (50) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/EChart.client.vue +13 -6
  3. package/dist/runtime/components/SqlEditor.d.vue.ts +1 -1
  4. package/dist/runtime/components/SqlEditor.vue.d.ts +1 -1
  5. package/dist/runtime/components/button/Dropdown.vue +5 -1
  6. package/dist/runtime/components/date-picker/Input.d.vue.ts +9 -1
  7. package/dist/runtime/components/date-picker/Input.vue +55 -11
  8. package/dist/runtime/components/date-picker/Input.vue.d.ts +9 -1
  9. package/dist/runtime/components/date-picker/index.vue +3 -3
  10. package/dist/runtime/components/form/field/DatePicker.vue +1 -1
  11. package/dist/runtime/components/sys/table/CreateModal.vue +31 -33
  12. package/dist/runtime/components/sys/table/Table.vue +6 -4
  13. package/dist/runtime/components/sys/user/Table.vue +44 -27
  14. package/dist/runtime/components/table/permission/TablePermissionConfig.d.vue.ts +2 -2
  15. package/dist/runtime/components/table/permission/TablePermissionConfig.vue +3 -3
  16. package/dist/runtime/components/table/permission/TablePermissionConfig.vue.d.ts +2 -2
  17. package/dist/runtime/components/table/permission/TablePermissionTab.vue +7 -4
  18. package/dist/runtime/components/table/query/order/Item.d.vue.ts +2 -2
  19. package/dist/runtime/components/table/query/order/Item.vue.d.ts +2 -2
  20. package/dist/runtime/components/table/query/where/Newer.vue +2 -0
  21. package/dist/runtime/components/table/query/where/index.vue +46 -15
  22. package/dist/runtime/components/table/query/where/simple/item/ColumnPicker.vue +9 -4
  23. package/dist/runtime/components/table/query/where/simple/item/OprPicker.vue +3 -3
  24. package/dist/runtime/components/table/query/where/simple/item/opr/AsyncSelect.vue +45 -48
  25. package/dist/runtime/components/table/query/where/simple/item/opr/DatePicker.vue +137 -131
  26. package/dist/runtime/components/table/query/where/simple/item/opr/Select.d.vue.ts +4 -2
  27. package/dist/runtime/components/table/query/where/simple/item/opr/Select.vue +40 -40
  28. package/dist/runtime/components/table/query/where/simple/item/opr/Select.vue.d.ts +4 -2
  29. package/dist/runtime/components/table/query/where/simple/item/opr/index.vue +2 -0
  30. package/dist/runtime/components/table/settings/TableSettings.d.vue.ts +1 -1
  31. package/dist/runtime/components/table/settings/TableSettings.vue +0 -3
  32. package/dist/runtime/components/table/settings/TableSettings.vue.d.ts +1 -1
  33. package/dist/runtime/composables/api/sys/useRoleApi.js +3 -1
  34. package/dist/runtime/composables/api/sys/useUserApi.js +3 -1
  35. package/dist/runtime/composables/useDate.js +8 -8
  36. package/dist/runtime/composables/useEChart.d.ts +1 -3
  37. package/dist/runtime/composables/useEChart.js +155 -33
  38. package/dist/runtime/constants/index.d.ts +1 -0
  39. package/dist/runtime/constants/index.js +1 -0
  40. package/dist/runtime/constants/options.js +2 -3
  41. package/dist/runtime/constants/table.d.ts +2 -0
  42. package/dist/runtime/constants/table.js +8 -0
  43. package/dist/runtime/types/components/table/column.d.ts +4 -3
  44. package/dist/runtime/types/components/table/query/where.d.ts +1 -5
  45. package/dist/runtime/types/storage.d.ts +2 -1
  46. package/dist/runtime/types/storage.js +1 -0
  47. package/package.json +1 -1
  48. package/dist/runtime/components/table/query/where/simple/index.d.vue.ts +0 -21
  49. package/dist/runtime/components/table/query/where/simple/index.vue +0 -52
  50. package/dist/runtime/components/table/query/where/simple/index.vue.d.ts +0 -21
@@ -1,12 +1,12 @@
1
1
  <script setup>
2
- import { computed, useTemplateRef } from "vue";
3
- import ButtonDropdown from "#v/components/button/Dropdown.vue";
2
+ import { computed, ref, useTemplateRef } from "vue";
4
3
  const props = defineProps({
5
4
  disabled: { type: Boolean, required: false },
6
- items: { type: Array, required: true }
5
+ items: { type: Array, required: true },
6
+ placeholder: { type: String, required: false }
7
7
  });
8
8
  const whereQueryItem = defineModel("whereQueryItem", { type: Object, ...{ required: true } });
9
- const queryValue = computed({
9
+ const inputMenuValue = computed({
10
10
  get() {
11
11
  return whereQueryItem.value.value;
12
12
  },
@@ -14,49 +14,49 @@ const queryValue = computed({
14
14
  whereQueryItem.value = { ...whereQueryItem.value, value: newValue };
15
15
  }
16
16
  });
17
- const groups = computed(() => [
18
- {
19
- id: "fields",
20
- items: props.items,
21
- ignoreFilter: true
17
+ const searchTerm = ref("");
18
+ const filteredItems = computed(() => {
19
+ if (!searchTerm.value) {
20
+ return props.items;
22
21
  }
23
- ]);
24
- const ref = useTemplateRef("dropdownBtn");
22
+ return props.items.filter((item) => item?.label.toLowerCase().includes(searchTerm.value.toLowerCase()));
23
+ });
24
+ const inputMenuRef = useTemplateRef("inputMenu");
25
25
  defineExpose({
26
26
  focus: () => {
27
- ref.value?.focus();
27
+ inputMenuRef.value?.inputRef.focus();
28
28
  }
29
29
  });
30
30
  </script>
31
31
 
32
32
  <template>
33
- <ButtonDropdown
34
- ref="dropdownBtn"
35
- v-model="queryValue"
36
- :groups="groups"
33
+ <UInputMenu
34
+ ref="inputMenu"
35
+ v-model:search-term="searchTerm"
36
+ v-model="inputMenuValue"
37
+ :items="filteredItems"
38
+ :placeholder="placeholder"
37
39
  multiple
38
- enable-footer-toolbar
39
- >
40
- <UButton
41
- size="sm"
42
- color="neutral"
43
- variant="outline"
44
- >
45
- <div v-if="!queryValue || queryValue.length === 0">
46
- --
47
- </div>
48
- <div v-else-if="queryValue.length <= 2" class="flex items-center gap-1">
49
- {{ queryValue.map((value2) => items.find((item) => item.value === value2)?.label || value2).join(", ") }}
50
- </div>
51
- <div v-else>
52
- <!-- 打印前两项,后面+1代替 -->
53
- <div class="flex items-center gap-1">
54
- <div v-for="value in queryValue.slice(0, 2)" :key="value">
55
- {{ items.find((item) => item.value === value)?.label || value }}
56
- </div>
57
- <span>+{{ queryValue.length - 2 }}</span>
58
- </div>
59
- </div>
60
- </UButton>
61
- </ButtonDropdown>
40
+ color="neutral"
41
+ delete-icon="i-lucide-trash"
42
+ value-key="value"
43
+ clear
44
+ clear-icon="i-lucide-circle-x"
45
+ icon=""
46
+ :disabled="disabled"
47
+ open-on-focus
48
+ trailing
49
+ :ui="{
50
+ root: 'rounded-none min-w-32',
51
+ // TODO: 不然有rounded,这个应该是个bug
52
+ content: 'min-w-fit',
53
+ tagsInput: 'min-w-4 w-0'
54
+ }"
55
+ :content="{
56
+ align: 'start'
57
+ }"
58
+ @update:model-value="() => {
59
+ inputMenuRef?.inputRef.focus();
60
+ }"
61
+ />
62
62
  </template>
@@ -1,8 +1,10 @@
1
- import type { SelectOption, WhereQueryItem } from '#v/types';
1
+ import type { WhereQueryItem } from '#v/types';
2
+ import type { InputMenuItem, InputMenuProps } from '@nuxt/ui';
2
3
  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
4
  props: import("vue").PublicProps & __VLS_PrettifyLocal<({
4
5
  disabled?: boolean;
5
- items: SelectOption[];
6
+ items: InputMenuItem[];
7
+ placeholder?: InputMenuProps["placeholder"];
6
8
  } & {
7
9
  whereQueryItem: WhereQueryItem<T>;
8
10
  }) & {
@@ -48,6 +48,7 @@ defineExpose({
48
48
  v-model:where-query-item="whereQueryItem"
49
49
  :disabled="fetching"
50
50
  :items="option.items || []"
51
+ :placeholder="option.placeholder"
51
52
  />
52
53
  <TableQueryWhereSimpleItemOprDatePicker
53
54
  v-else-if="option.type === 'date-picker'"
@@ -68,5 +69,6 @@ defineExpose({
68
69
  :label-field="option.labelField"
69
70
  :value-field="option.valueField"
70
71
  :multiple="option.multiple"
72
+ :placeholder="option.placeholder"
71
73
  />
72
74
  </template>
@@ -1,3 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
2
  declare const _default: typeof __VLS_export;
2
3
  export default _default;
3
- declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -2,9 +2,6 @@
2
2
  import { useTableColumnPermission } from "#v/composables/table/useTableColumnPermission";
3
3
  import UserTableColumnModal from "./UserTableColumnModal.vue";
4
4
  import { ref, h, onMounted } from "vue";
5
- </script>
6
-
7
- <script>
8
5
  const { tables, fetchTables, fetchMergedColumns, saveUserColumns } = useTableColumnPermission();
9
6
  const selectedTable = ref(null);
10
7
  const mergedColumns = ref([]);
@@ -1,3 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
2
  declare const _default: typeof __VLS_export;
2
3
  export default _default;
3
- declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -7,6 +7,7 @@ export const useRoleApi = createSharedComposable(() => ({
7
7
  prune: (model) => {
8
8
  const cloned = cloneJson(model);
9
9
  cloned.menus = useBizModel().extractIds(cloned.menus);
10
+ cloned.tablePermissions = useBizModel().extractIds(cloned.tablePermissions);
10
11
  return cloned;
11
12
  },
12
13
  copy: (model) => ({
@@ -15,6 +16,7 @@ export const useRoleApi = createSharedComposable(() => ({
15
16
  permission: model.permission,
16
17
  disabled: model.disabled,
17
18
  remark: model.remark,
18
- menus: model.menus
19
+ menus: model.menus,
20
+ tablePermissions: model.tablePermissions
19
21
  })
20
22
  }));
@@ -13,6 +13,7 @@ export const useUserApi = createSharedComposable(() => ({
13
13
  const bizModel = useBizModel();
14
14
  cloned.roles = bizModel.extractIds(cloned.roles);
15
15
  cloned.menus = bizModel.extractIds(cloned.menus);
16
+ cloned.tablePermissions = bizModel.extractIds(cloned.tablePermissions);
16
17
  return cloned;
17
18
  },
18
19
  copy: (model) => ({
@@ -28,7 +29,8 @@ export const useUserApi = createSharedComposable(() => ({
28
29
  entryDate: model.entryDate,
29
30
  resignDate: model.resignDate,
30
31
  gender: model.gender,
31
- loginType: model.loginType
32
+ loginType: model.loginType,
33
+ tablePermissions: model.tablePermissions
32
34
  }),
33
35
  changePwd: (payload, customOptions = {}) => {
34
36
  return usePutFetch(`/users/pwd/change`, payload, customOptions);
@@ -39,7 +39,7 @@ const _useDate = () => {
39
39
  return `${date.year()}-W${weekNumber}`;
40
40
  }
41
41
  case "day":
42
- return date.format("YYYY/MM/DD");
42
+ return date.format("YYYY-MM-DD");
43
43
  default:
44
44
  throw new Error(`Unsupported time unit: ${unit}`);
45
45
  }
@@ -53,8 +53,8 @@ const _useDate = () => {
53
53
  };
54
54
  };
55
55
  const getlastWeekDateRange = () => {
56
- const end = dayjs().subtract(1, "week").endOf("week");
57
- const start = end.subtract(6, "day").startOf("day");
56
+ const end = dayjs().endOf("week").subtract(1, "week");
57
+ const start = end.startOf("week");
58
58
  return {
59
59
  start: dayjsToDateValue(start),
60
60
  end: dayjsToDateValue(end)
@@ -66,7 +66,7 @@ const _useDate = () => {
66
66
  };
67
67
  const getCurrentWeekDateRange = () => {
68
68
  const end = dayjs().endOf("week");
69
- const start = end.subtract(6, "day").startOf("day");
69
+ const start = end.startOf("week");
70
70
  return {
71
71
  start: dayjsToDateValue(start),
72
72
  end: dayjsToDateValue(end)
@@ -78,7 +78,7 @@ const _useDate = () => {
78
78
  };
79
79
  const getLastMonthDateRange = () => {
80
80
  const end = dayjs().subtract(1, "month").endOf("month");
81
- const start = end.subtract(1, "month").startOf("month");
81
+ const start = end.startOf("month");
82
82
  return {
83
83
  start: dayjsToDateValue(start),
84
84
  end: dayjsToDateValue(end)
@@ -90,7 +90,7 @@ const _useDate = () => {
90
90
  };
91
91
  const getCurrentMonthDateRange = () => {
92
92
  const end = dayjs().endOf("month");
93
- const start = end.subtract(1, "month").startOf("month");
93
+ const start = end.startOf("month");
94
94
  return {
95
95
  start: dayjsToDateValue(start),
96
96
  end: dayjsToDateValue(end)
@@ -102,7 +102,7 @@ const _useDate = () => {
102
102
  };
103
103
  const getlastYearDateRange = () => {
104
104
  const end = dayjs().subtract(1, "year").endOf("year");
105
- const start = end.subtract(1, "year").startOf("year");
105
+ const start = end.startOf("year");
106
106
  return {
107
107
  start: dayjsToDateValue(start),
108
108
  end: dayjsToDateValue(end)
@@ -114,7 +114,7 @@ const _useDate = () => {
114
114
  };
115
115
  const getCurrentYearDateRange = () => {
116
116
  const end = dayjs().endOf("year");
117
- const start = end.subtract(1, "year").startOf("year");
117
+ const start = end.startOf("year");
118
118
  return {
119
119
  start: dayjsToDateValue(start),
120
120
  end: dayjsToDateValue(end)
@@ -22,7 +22,6 @@ export declare const useEChart: () => {
22
22
  };
23
23
  };
24
24
  getCommonXAxisOption: () => {
25
- color: string[];
26
25
  xAxis: {
27
26
  nameTextStyle: {
28
27
  color: string;
@@ -37,6 +36,7 @@ export declare const useEChart: () => {
37
36
  color: string;
38
37
  interval: () => boolean;
39
38
  hideOverlap: boolean;
39
+ rotate: number;
40
40
  };
41
41
  axisTick: {
42
42
  show: boolean;
@@ -78,7 +78,6 @@ export declare const useEChart: () => {
78
78
  focus: string;
79
79
  };
80
80
  label: {
81
- color: string;
82
81
  distance: number;
83
82
  };
84
83
  };
@@ -87,7 +86,6 @@ export declare const useEChart: () => {
87
86
  focus: string;
88
87
  };
89
88
  label: {
90
- color: string;
91
89
  distance: number;
92
90
  };
93
91
  };
@@ -1,13 +1,15 @@
1
- import { createSharedComposable } from "@vueuse/core";
1
+ import { useLocalStorage, createSharedComposable } from "@vueuse/core";
2
2
  import { defu } from "defu";
3
3
  import { useApp } from "./useApp.js";
4
- import { useTheme } from "./useTheme.js";
4
+ import { StorageKey } from "#v/types";
5
5
  import { triggerFileDownloadFromUrl } from "#v/utils";
6
6
  const _useEChart = () => {
7
7
  const app = useApp();
8
- const theme = useTheme();
8
+ const rotateXAxisLabel = useLocalStorage(StorageKey.ECHART_ROTATE_X_AXIS_LABEL, false);
9
9
  const parseCSSVariableColor = (colorStr) => {
10
- if (!colorStr?.startsWith("var(")) return colorStr;
10
+ if (!colorStr?.startsWith("var(")) {
11
+ return colorStr;
12
+ }
11
13
  const varName = colorStr.match(/var\((--[^,)]+)/)?.[1];
12
14
  if (!varName) return colorStr;
13
15
  const value = getComputedStyle(document.documentElement).getPropertyValue(varName).trim();
@@ -16,9 +18,14 @@ const _useEChart = () => {
16
18
  const getNormedUiTextColor = () => parseCSSVariableColor("var(--ui-text-muted)");
17
19
  const getNormedUiBorderColor = () => parseCSSVariableColor("var(--ui-border)");
18
20
  const getNormedRadius = () => Math.round((app.appConfig.value.radius ?? 0.25) * 16);
19
- const getNormedChartColors = () => theme.chartColorVars.value.map((colorVar) => parseCSSVariableColor(colorVar));
20
21
  const getCommonGridOption = () => ({
21
- grid: { left: "0", right: "0", bottom: "32", top: "20", containLabel: true }
22
+ grid: {
23
+ left: "0",
24
+ right: "0",
25
+ bottom: "32",
26
+ top: "20",
27
+ containLabel: true
28
+ }
22
29
  });
23
30
  const getCommonLegendOption = () => ({
24
31
  legend: {
@@ -27,45 +34,95 @@ const _useEChart = () => {
27
34
  itemGap: 12,
28
35
  itemWidth: 12,
29
36
  itemHeight: 12,
30
- textStyle: { color: getNormedUiTextColor() },
37
+ textStyle: {
38
+ color: getNormedUiTextColor()
39
+ },
31
40
  icon: "circle"
32
41
  }
33
42
  });
34
43
  const getCommonXAxisOption = () => ({
35
- color: getNormedChartColors(),
36
44
  xAxis: {
37
- nameTextStyle: { color: getNormedUiTextColor() },
38
- axisLine: { show: true, lineStyle: { color: getNormedUiBorderColor() } },
39
- axisLabel: { color: getNormedUiTextColor(), interval: () => true, hideOverlap: true },
40
- axisTick: { show: true, interval: () => true, lineStyle: { color: getNormedUiBorderColor() } }
45
+ nameTextStyle: {
46
+ color: getNormedUiTextColor()
47
+ },
48
+ axisLine: {
49
+ show: true,
50
+ lineStyle: {
51
+ color: getNormedUiBorderColor()
52
+ }
53
+ },
54
+ axisLabel: {
55
+ color: getNormedUiTextColor(),
56
+ interval: () => true,
57
+ // 始终显示所有标签,
58
+ hideOverlap: true,
59
+ rotate: rotateXAxisLabel.value ? 90 : 0
60
+ },
61
+ axisTick: {
62
+ show: true,
63
+ interval: () => true,
64
+ // 始终显示所有刻度线
65
+ lineStyle: {
66
+ color: getNormedUiBorderColor()
67
+ }
68
+ }
41
69
  }
42
70
  });
43
71
  const getCommonYAxisOption = () => ({
44
72
  yAxis: {
45
- nameTextStyle: { color: getNormedUiTextColor() },
46
- axisLine: { show: true, lineStyle: { color: getNormedUiBorderColor() } },
47
- axisLabel: { color: getNormedUiTextColor() },
48
- splitLine: { show: false, lineStyle: { color: getNormedUiBorderColor(), type: "dashed" } }
73
+ nameTextStyle: {
74
+ color: getNormedUiTextColor()
75
+ },
76
+ axisLine: {
77
+ show: true,
78
+ lineStyle: {
79
+ color: getNormedUiBorderColor()
80
+ }
81
+ },
82
+ axisLabel: {
83
+ color: getNormedUiTextColor()
84
+ },
85
+ splitLine: {
86
+ show: false,
87
+ lineStyle: {
88
+ color: getNormedUiBorderColor(),
89
+ type: "dashed"
90
+ }
91
+ }
49
92
  }
50
93
  });
51
94
  const getCommonBarOption = () => ({
52
- itemStyle: { borderRadius: [getNormedRadius(), getNormedRadius(), 0, 0] },
53
- emphasis: { focus: "series" },
54
- label: { color: getNormedUiTextColor(), distance: 2 }
95
+ itemStyle: {
96
+ borderRadius: [getNormedRadius(), getNormedRadius(), 0, 0]
97
+ },
98
+ emphasis: {
99
+ focus: "series"
100
+ },
101
+ label: {
102
+ distance: 2
103
+ }
55
104
  });
56
- const getCommonBarOptionWithColor = (idx) => {
57
- const colors = getNormedChartColors();
58
- return defu(getCommonBarOption(), { emphasis: { itemStyle: { color: colors[idx] } } });
105
+ const getCommonBarOptionWithColor = (_idx) => {
106
+ return defu(getCommonBarOption(), {
107
+ emphasis: {
108
+ itemStyle: {}
109
+ }
110
+ });
59
111
  };
60
112
  const getCommonLineOption = () => ({
61
- emphasis: { focus: "series" },
62
- label: { color: getNormedUiTextColor(), distance: 2 }
113
+ emphasis: {
114
+ focus: "series"
115
+ },
116
+ label: {
117
+ distance: 2
118
+ }
63
119
  });
64
- const getCommonLineOptionWithColor = (idx) => {
65
- const colors = getNormedChartColors();
120
+ const getCommonLineOptionWithColor = (_idx) => {
66
121
  return defu(getCommonLineOption(), {
67
- emphasis: { lineStyle: { color: colors[idx] } },
68
- lineStyle: { color: colors[idx] }
122
+ emphasis: {
123
+ lineStyle: {}
124
+ },
125
+ lineStyle: {}
69
126
  });
70
127
  };
71
128
  const getChartDataURL = (chart, options = {}) => {
@@ -75,7 +132,7 @@ const _useEChart = () => {
75
132
  try {
76
133
  return chart.getDataURL({ type: echartsType, backgroundColor, pixelRatio });
77
134
  } catch (e) {
78
- console.error("Failed to get EChart dataURL:", e);
135
+ console.error("\u83B7\u53D6 EChart \u56FE\u8868 dataURL \u5931\u8D25\uFF1A", e);
79
136
  return null;
80
137
  }
81
138
  };
@@ -86,10 +143,75 @@ const _useEChart = () => {
86
143
  triggerFileDownloadFromUrl(dataURL, `${filename}.${type}`);
87
144
  };
88
145
  const mergeSeries = (series) => {
89
- return series.map((s, seriesIndex) => {
90
- if (s?.type === "bar") return defu(s, getCommonBarOptionWithColor(seriesIndex));
91
- if (s?.type === "line") return defu(s, getCommonLineOptionWithColor(seriesIndex));
92
- return s;
146
+ if (!series?.length) return [];
147
+ const getDataValue = (item) => {
148
+ if (item == null) return 0;
149
+ if (typeof item === "number") return item;
150
+ if (Array.isArray(item)) return Number(item[item.length - 1]) || 0;
151
+ if (typeof item === "object") {
152
+ const v = item.value;
153
+ return (Array.isArray(v) ? Number(v[v.length - 1]) : Number(v)) || 0;
154
+ }
155
+ return Number(item) || 0;
156
+ };
157
+ const stackDetails = /* @__PURE__ */ new Map();
158
+ series.forEach((s, idx) => {
159
+ if (s?.type === "bar" && s?.stack) {
160
+ if (!stackDetails.has(s.stack)) {
161
+ stackDetails.set(s.stack, { indices: [], maxLen: 0 });
162
+ }
163
+ const group = stackDetails.get(s.stack);
164
+ group.indices.push(idx);
165
+ const len = Array.isArray(s.data) ? s.data.length : 0;
166
+ if (len > group.maxLen) group.maxLen = len;
167
+ }
168
+ });
169
+ const stackRadiusOwners = /* @__PURE__ */ new Map();
170
+ for (const [stack, { indices, maxLen }] of stackDetails) {
171
+ const owners = new Array(maxLen).fill(-1);
172
+ for (let i = 0; i < maxLen; i++) {
173
+ for (let j = indices.length - 1; j >= 0; j--) {
174
+ const sIdx = indices[j];
175
+ const val = getDataValue(series[sIdx]?.data?.[i]);
176
+ if (val !== 0) {
177
+ owners[i] = sIdx;
178
+ break;
179
+ }
180
+ }
181
+ }
182
+ stackRadiusOwners.set(stack, owners);
183
+ }
184
+ const radius = getNormedRadius();
185
+ const radiusStyle = { borderRadius: [radius, radius, 0, 0] };
186
+ const noRadiusStyle = { borderRadius: 0 };
187
+ return series.map((s, idx) => {
188
+ if (!s) return s;
189
+ if (s.type === "line") {
190
+ return defu(s, getCommonLineOptionWithColor(idx));
191
+ }
192
+ if (s.type !== "bar") return s;
193
+ const isStack = !!s.stack;
194
+ const baseOption = getCommonBarOptionWithColor(idx);
195
+ if (isStack) {
196
+ baseOption.itemStyle = { ...baseOption.itemStyle, ...noRadiusStyle };
197
+ }
198
+ const merged = defu(s, baseOption);
199
+ if (isStack && Array.isArray(merged.data)) {
200
+ const owners = stackRadiusOwners.get(s.stack);
201
+ if (owners) {
202
+ merged.data = merged.data.map((item, i) => {
203
+ if (i < owners.length && owners[i] === idx) {
204
+ const itemObj = item !== null && typeof item === "object" && !Array.isArray(item) ? item : { value: item };
205
+ return {
206
+ ...itemObj,
207
+ itemStyle: { ...itemObj.itemStyle, ...radiusStyle }
208
+ };
209
+ }
210
+ return item;
211
+ });
212
+ }
213
+ }
214
+ return merged;
93
215
  });
94
216
  };
95
217
  const mergeOption = (option) => {
@@ -5,3 +5,4 @@ export * from './time.js';
5
5
  export * from './menu.js';
6
6
  export * from './user.js';
7
7
  export * from './calendar.js';
8
+ export * from './table.js';
@@ -5,3 +5,4 @@ export * from "./time.js";
5
5
  export * from "./menu.js";
6
6
  export * from "./user.js";
7
7
  export * from "./calendar.js";
8
+ export * from "./table.js";
@@ -9,7 +9,6 @@ export var Gender = /* @__PURE__ */ ((Gender2) => {
9
9
  return Gender2;
10
10
  })(Gender || {});
11
11
  export const genderOptions = [
12
- { label: "Male", value: 1 /* MALE */ },
13
- { label: "Female", value: 2 /* FEMALE */ },
14
- { label: "Unknown", value: 0 /* UNKNOWN */ }
12
+ { label: "\u7537", value: 1 /* MALE */ },
13
+ { label: "\u5973", value: 2 /* FEMALE */ }
15
14
  ];
@@ -0,0 +1,2 @@
1
+ import type { WhereQueryColumnOption } from '#v/types';
2
+ export declare const tableWhereQueryItemIconMap: Map<WhereQueryColumnOption<any>['type'], string>;
@@ -0,0 +1,8 @@
1
+ export const tableWhereQueryItemIconMap = /* @__PURE__ */ new Map([
2
+ ["async-select", "i-lucide-list-check"],
3
+ ["date-picker", "i-lucide-calendar-cog"],
4
+ ["input", "i-lucide-text-cursor-input"],
5
+ ["input-number", "i-lucide-text-cursor-input"],
6
+ ["select", "i-lucide-list-check"],
7
+ ["unknown", "i-lucide-circle-question-mark"]
8
+ ]);
@@ -1,6 +1,6 @@
1
1
  import type { OrderQueryOpr, WhereQueryOpr, QueryTemplate, WhereQueryItem } from '../../query.js';
2
2
  import type { PageResult, RequestResult } from '../../request.js';
3
- import type { TableColumn, BadgeProps, SelectProps } from '@nuxt/ui';
3
+ import type { TableColumn, BadgeProps, InputMenuProps } from '@nuxt/ui';
4
4
  import type { SelectOption } from '../../index.js';
5
5
  import type { Ref } from 'vue';
6
6
  export type WhereQueryType = 'input' | 'input-number' | 'date-picker' | 'select' | 'async-select' | 'unknown';
@@ -23,8 +23,8 @@ export type WhereQueryColumnAsyncSelectProps<T> = {
23
23
  enableEmptyOption?: boolean;
24
24
  disableOprSelector?: boolean;
25
25
  multiple?: boolean;
26
- placeholder?: string;
27
- size?: SelectProps['size'];
26
+ placeholder?: InputMenuProps['placeholder'];
27
+ size?: InputMenuProps['size'];
28
28
  };
29
29
  export type WhereQueryColumnOption<T> = {
30
30
  defaultOpr?: WhereQueryOpr;
@@ -43,6 +43,7 @@ export type WhereQueryColumnOption<T> = {
43
43
  variant?: BadgeProps['variant'];
44
44
  items: SelectOption[];
45
45
  empty?: BadgeProps;
46
+ placeholder?: InputMenuProps['placeholder'];
46
47
  } | {
47
48
  type: 'async-select';
48
49
  } & WhereQueryColumnAsyncSelectProps<T> | {
@@ -1,4 +1,4 @@
1
- import type { VColumn, WhereQuery, WhereQueryColumnOption, WhereQueryItem, WhereQueryItemGroup } from '../../../index.js';
1
+ import type { VColumn, WhereQuery, WhereQueryColumnOption, WhereQueryItemGroup } from '../../../index.js';
2
2
  export type WhereQueryOption<T> = {
3
3
  field: string & keyof T | string;
4
4
  label: string;
@@ -16,10 +16,6 @@ export type WhereQueryProps<T> = {
16
16
  bizColumns?: VColumn<T>[];
17
17
  hideQueryButton?: boolean;
18
18
  };
19
- export type WhereSimpleQueryProps<T> = {
20
- items?: WhereQueryItem<T>[];
21
- onUpdateItems: (items: WhereQueryItem<T>[] | undefined) => void;
22
- } & Pick<WhereQueryProps<T>, 'whereOptions' | 'fetching' | 'triggerFetching' | 'bizColumns'>;
23
19
  export type WhereAdvancedQueryProps<T> = {
24
20
  group?: WhereQueryItemGroup<T>;
25
21
  onUpdateGroup?: (items: WhereQueryItemGroup<T>) => void;
@@ -6,7 +6,8 @@ export declare enum StorageKey {
6
6
  FLOW_EDGE_STROKE_WIDTH = "flow_edge_stroke_width",
7
7
  FLOW_EDGE_MARKER_START = "flow_edge_marker_start",
8
8
  FLOW_EDGE_MARKER_END = "flow_edge_marker_end",
9
- FLOW_NODE_BORDER_WIDTH = "flow_node_border_width"
9
+ FLOW_NODE_BORDER_WIDTH = "flow_node_border_width",
10
+ ECHART_ROTATE_X_AXIS_LABEL = "echart_rotate_x_axis_label"
10
11
  }
11
12
  export type Column = {
12
13
  accessorKey: string;
@@ -7,5 +7,6 @@ export var StorageKey = /* @__PURE__ */ ((StorageKey2) => {
7
7
  StorageKey2["FLOW_EDGE_MARKER_START"] = "flow_edge_marker_start";
8
8
  StorageKey2["FLOW_EDGE_MARKER_END"] = "flow_edge_marker_end";
9
9
  StorageKey2["FLOW_NODE_BORDER_WIDTH"] = "flow_node_border_width";
10
+ StorageKey2["ECHART_ROTATE_X_AXIS_LABEL"] = "echart_rotate_x_axis_label";
10
11
  return StorageKey2;
11
12
  })(StorageKey || {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "v-nuxt-ui",
3
- "version": "0.1.34",
3
+ "version": "0.1.36",
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",