@veltra/desktop 1.2.6 → 1.2.7

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.
@@ -6,9 +6,9 @@ type __VLS_Slots = {
6
6
  default?: () => VNode[];
7
7
  };
8
8
  declare const __VLS_base: import("vue").DefineComponent<ActionGroupProps, _ActionGroupExposed, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ActionGroupProps> & Readonly<{}>, {
9
+ type: import("@veltra/utils").ColorType;
9
10
  text: boolean;
10
11
  size: "small" | "default" | "large";
11
- type: import("@veltra/utils").ColorType;
12
12
  circle: boolean;
13
13
  max: number;
14
14
  loading: boolean;
@@ -12,9 +12,9 @@ declare const __VLS_base: import("vue").DefineComponent<ActionProps, {}, {}, {},
12
12
  }, string, import("vue").PublicProps, Readonly<ActionProps> & Readonly<{
13
13
  onRun?: (() => any) | undefined;
14
14
  }>, {
15
+ type: ButtonType;
15
16
  text: boolean;
16
17
  size: import("@veltra/utils").ComponentSize;
17
- type: ButtonType;
18
18
  circle: boolean;
19
19
  loading: boolean;
20
20
  inDropdown: boolean;
@@ -17,9 +17,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
17
17
  "onUpdate:modelValue"?: ((checked: boolean) => any) | undefined;
18
18
  onChange?: ((checked: boolean) => any) | undefined;
19
19
  }>, {
20
+ type: import("@veltra/utils").ColorType;
20
21
  disabled: boolean;
21
22
  readonly: boolean;
22
- type: import("@veltra/utils").ColorType;
23
23
  round: boolean;
24
24
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
25
25
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -7,8 +7,8 @@ declare const __VLS_export: import("vue").DefineComponent<DatePanelProps, {}, {}
7
7
  "onSelect:range-date"?: ((rangeDate?: [import("@cat-kit/core").Dater, import("@cat-kit/core").Dater] | undefined) => any) | undefined;
8
8
  "onSelect:date"?: ((date: import("@cat-kit/core").Dater) => any) | undefined;
9
9
  }>, {
10
- size: import("@veltra/utils").ComponentSize;
11
10
  type: "date" | "month" | "year";
11
+ size: import("@veltra/utils").ComponentSize;
12
12
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
13
  declare const _default: typeof __VLS_export;
14
14
  //#endregion
@@ -5,11 +5,11 @@ declare const __VLS_export: import("vue").DefineComponent<DatePickerProps, {}, {
5
5
  }, string, import("vue").PublicProps, Readonly<DatePickerProps> & Readonly<{
6
6
  "onUpdate:modelValue"?: ((value?: string | number | Date | undefined) => any) | undefined;
7
7
  }>, {
8
+ type: "date" | "month" | "year";
8
9
  placeholder: string;
9
10
  clearable: boolean;
10
11
  disabled: boolean;
11
12
  readonly: boolean;
12
- type: "date" | "month" | "year";
13
13
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
14
  declare const _default: typeof __VLS_export;
15
15
  //#endregion
@@ -5,11 +5,11 @@ declare const __VLS_export: import("vue").DefineComponent<DateRangePickerProps,
5
5
  }, string, import("vue").PublicProps, Readonly<DateRangePickerProps> & Readonly<{
6
6
  "onUpdate:modelValue"?: ((value?: [string, string] | undefined) => any) | undefined;
7
7
  }>, {
8
+ type: "date" | "month" | "year";
8
9
  placeholder: [string, string];
9
10
  clearable: boolean;
10
11
  disabled: boolean;
11
12
  readonly: boolean;
12
- type: "date" | "month" | "year";
13
13
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
14
  declare const _default: typeof __VLS_export;
15
15
  //#endregion
@@ -3,7 +3,7 @@ import _sfc_main$2 from "../tip/tip.js";
3
3
  import { collectNavBranchPaths } from "../nav/helper.js";
4
4
  import _sfc_main$3 from "../nav/nav.js";
5
5
  import _sfc_main$4 from "./dual-nav-app.js";
6
- import { findRootApp } from "./helper.js";
6
+ import { findFirstLeaf, findRootApp } from "./helper.js";
7
7
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, ref, renderList, toDisplayString, unref, useTemplateRef, watch, withCtx } from "vue";
8
8
  import { bem } from "@veltra/utils";
9
9
  import { Folder, FolderOpened } from "@veltra/icons/normal";
@@ -64,7 +64,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
64
64
  function handleAppClick(app) {
65
65
  if (app.disabled) return;
66
66
  panelAppPath.value = app.path;
67
- if (!app.children?.length) emit("item-click", app);
67
+ emit("item-click", findFirstLeaf(app));
68
68
  }
69
69
  function handleToggleExpandAll() {
70
70
  if (allExpanded.value) {
@@ -1 +1 @@
1
- {"version":3,"file":"dual-nav.js","names":[],"sources":["../../../src/components/dual-nav/dual-nav.vue"],"sourcesContent":["<template>\n <div :class=\"cls.b\">\n <div :class=\"cls.e('rail')\">\n <DualNavApp\n v-for=\"app in menus\"\n :key=\"app.path\"\n :app=\"app\"\n :active=\"isAppActive(app)\"\n :selected=\"isAppSelected(app)\"\n @click=\"handleAppClick(app)\"\n />\n </div>\n\n <!-- <div :class=\"cls.e('divider')\" aria-hidden=\"true\" /> -->\n\n <div :class=\"cls.e('panel')\">\n <template v-if=\"panelApp\">\n <div :class=\"cls.e('panel-header')\">\n <div :class=\"cls.e('panel-header-main')\">\n <h3 :class=\"cls.e('panel-title')\">{{ panelApp.title }}</h3>\n <p v-if=\"panelApp.description\" :class=\"cls.e('description')\">\n {{ panelApp.description }}\n </p>\n </div>\n\n <u-tip\n v-if=\"hasExpandableMenus\"\n :content=\"allExpanded ? '折叠全部' : '展开全部'\"\n hide-arrow\n >\n <button\n type=\"button\"\n :class=\"cls.e('toggle-expand')\"\n :aria-label=\"allExpanded ? '折叠全部' : '展开全部'\"\n @click=\"handleToggleExpandAll\"\n >\n <u-icon>\n <FolderOpened v-if=\"!allExpanded\" />\n <Folder v-else />\n </u-icon>\n </button>\n </u-tip>\n </div>\n\n <div :class=\"cls.e('panel-body')\">\n <UNav\n ref=\"navRef\"\n :menus=\"panelMenus\"\n :current-path=\"currentPath\"\n :collapsed=\"false\"\n @item-click=\"emit('item-click', $event)\"\n />\n </div>\n </template>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { Folder, FolderOpened } from '@veltra/icons/normal'\nimport { bem } from '@veltra/utils'\nimport { computed, ref, useTemplateRef, watch } from 'vue'\n\nimport type { DualNavEmits, DualNavProps, DualNavRootItem } from '../../types/dual-nav'\nimport type { NavExposed, NavItem } from '../../types/nav'\nimport { UIcon } from '../icon'\nimport { UNav } from '../nav'\nimport { collectNavBranchPaths } from '../nav/helper'\nimport { UTip } from '../tip'\nimport DualNavApp from './dual-nav-app.vue'\nimport { findRootApp } from './helper'\n\ndefineOptions({ name: 'DualNav' })\n\nconst props = defineProps<DualNavProps>()\nconst emit = defineEmits<DualNavEmits>()\n\nconst cls = bem('dual-nav')\nconst navRef = useTemplateRef<NavExposed>('navRef')\n\n/** 右栏当前展示的应用(点击左轨或 currentPath 同步) */\nconst panelAppPath = ref<string>()\nconst allExpanded = ref(false)\n\nfunction syncPanelAppFromCurrentPath(currentPath?: string) {\n const rootApp = findRootApp(props.menus, currentPath)\n if (rootApp) {\n panelAppPath.value = rootApp.path\n return\n }\n\n if (!panelAppPath.value && props.menus?.length) {\n panelAppPath.value = props.menus[0]!.path\n }\n}\n\nwatch(\n () => [props.currentPath, props.menus] as const,\n ([currentPath]) => {\n syncPanelAppFromCurrentPath(currentPath)\n },\n { immediate: true }\n)\n\nconst panelApp = computed<DualNavRootItem | undefined>(() => {\n if (!panelAppPath.value || !props.menus?.length) return undefined\n return props.menus.find((app) => app.path === panelAppPath.value)\n})\n\n/** 右栏菜单:有子级时展示子级,单层时展示根项自身 */\nconst panelMenus = computed<NavItem[] | undefined>(() => {\n const app = panelApp.value\n if (!app) return undefined\n if (app.children?.length) return app.children\n return [app]\n})\n\nconst hasExpandableMenus = computed(() => {\n return collectNavBranchPaths(panelMenus.value).length > 0\n})\n\nwatch(panelAppPath, () => {\n allExpanded.value = false\n})\n\n/** 左轨高亮:currentPath 落在该应用下时为激活态 */\nfunction isAppActive(app: NavItem): boolean {\n return findRootApp(props.menus, props.currentPath)?.path === app.path\n}\n\n/** 左轨选中:已切换右栏但尚未导航到该应用下任一菜单时,使用 hover 风格 */\nfunction isAppSelected(app: NavItem): boolean {\n return panelAppPath.value === app.path && !isAppActive(app)\n}\n\nfunction handleAppClick(app: NavItem) {\n if (app.disabled) return\n\n panelAppPath.value = app.path\n\n if (!app.children?.length) {\n emit('item-click', app)\n }\n}\n\nfunction handleToggleExpandAll() {\n if (allExpanded.value) {\n navRef.value?.collapseAll()\n allExpanded.value = false\n return\n }\n\n navRef.value?.expandAll()\n allExpanded.value = true\n}\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EA0EA,MAAM,QAAQ;EACd,MAAM,OAAO;EAEb,MAAM,MAAM,IAAI,UAAU;EAC1B,MAAM,SAAS,eAA2B,QAAQ;;EAGlD,MAAM,eAAe,IAAY;EACjC,MAAM,cAAc,IAAI,KAAK;EAE7B,SAAS,4BAA4B,aAAsB;GACzD,MAAM,UAAU,YAAY,MAAM,OAAO,WAAW;GACpD,IAAI,SAAS;IACX,aAAa,QAAQ,QAAQ;IAC7B;GACF;GAEA,IAAI,CAAC,aAAa,SAAS,MAAM,OAAO,QACtC,aAAa,QAAQ,MAAM,MAAM,GAAI;EAEzC;EAEA,YACQ,CAAC,MAAM,aAAa,MAAM,KAAK,IACpC,CAAC,iBAAiB;GACjB,4BAA4B,WAAW;EACzC,GACA,EAAE,WAAW,KAAK,CACpB;EAEA,MAAM,WAAW,eAA4C;GAC3D,IAAI,CAAC,aAAa,SAAS,CAAC,MAAM,OAAO,QAAQ,OAAO,KAAA;GACxD,OAAO,MAAM,MAAM,MAAM,QAAQ,IAAI,SAAS,aAAa,KAAK;EAClE,CAAC;;EAGD,MAAM,aAAa,eAAsC;GACvD,MAAM,MAAM,SAAS;GACrB,IAAI,CAAC,KAAK,OAAO,KAAA;G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esContent":["<template>\n <div :class=\"cls.b\">\n <div :class=\"cls.e('rail')\">\n <DualNavApp\n v-for=\"app in menus\"\n :key=\"app.path\"\n :app=\"app\"\n :active=\"isAppActive(app)\"\n :selected=\"isAppSelected(app)\"\n @click=\"handleAppClick(app)\"\n />\n </div>\n\n <!-- <div :class=\"cls.e('divider')\" aria-hidden=\"true\" /> -->\n\n <div :class=\"cls.e('panel')\">\n <template v-if=\"panelApp\">\n <div :class=\"cls.e('panel-header')\">\n <div :class=\"cls.e('panel-header-main')\">\n <h3 :class=\"cls.e('panel-title')\">{{ panelApp.title }}</h3>\n <p v-if=\"panelApp.description\" :class=\"cls.e('description')\">\n {{ panelApp.description }}\n </p>\n </div>\n\n <u-tip\n v-if=\"hasExpandableMenus\"\n :content=\"allExpanded ? '折叠全部' : '展开全部'\"\n hide-arrow\n >\n <button\n type=\"button\"\n :class=\"cls.e('toggle-expand')\"\n :aria-label=\"allExpanded ? '折叠全部' : '展开全部'\"\n @click=\"handleToggleExpandAll\"\n >\n <u-icon>\n <FolderOpened v-if=\"!allExpanded\" />\n <Folder v-else />\n </u-icon>\n </button>\n </u-tip>\n </div>\n\n <div :class=\"cls.e('panel-body')\">\n <UNav\n ref=\"navRef\"\n :menus=\"panelMenus\"\n :current-path=\"currentPath\"\n :collapsed=\"false\"\n @item-click=\"emit('item-click', $event)\"\n />\n </div>\n </template>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { Folder, FolderOpened } from '@veltra/icons/normal'\nimport { bem } from '@veltra/utils'\nimport { computed, ref, useTemplateRef, watch } from 'vue'\n\nimport type { DualNavEmits, DualNavProps, DualNavRootItem } from '../../types/dual-nav'\nimport type { NavExposed, NavItem } from '../../types/nav'\nimport { UIcon } from '../icon'\nimport { UNav } from '../nav'\nimport { collectNavBranchPaths } from '../nav/helper'\nimport { UTip } from '../tip'\nimport DualNavApp from './dual-nav-app.vue'\nimport { findFirstLeaf, findRootApp } from './helper'\n\ndefineOptions({ name: 'DualNav' })\n\nconst props = defineProps<DualNavProps>()\nconst emit = defineEmits<DualNavEmits>()\n\nconst cls = bem('dual-nav')\nconst navRef = useTemplateRef<NavExposed>('navRef')\n\n/** 右栏当前展示的应用(点击左轨或 currentPath 同步) */\nconst panelAppPath = ref<string>()\nconst allExpanded = ref(false)\n\nfunction syncPanelAppFromCurrentPath(currentPath?: string) {\n const rootApp = findRootApp(props.menus, currentPath)\n if (rootApp) {\n panelAppPath.value = rootApp.path\n return\n }\n\n if (!panelAppPath.value && props.menus?.length) {\n panelAppPath.value = props.menus[0]!.path\n }\n}\n\nwatch(\n () => [props.currentPath, props.menus] as const,\n ([currentPath]) => {\n syncPanelAppFromCurrentPath(currentPath)\n },\n { immediate: true }\n)\n\nconst panelApp = computed<DualNavRootItem | undefined>(() => {\n if (!panelAppPath.value || !props.menus?.length) return undefined\n return props.menus.find((app) => app.path === panelAppPath.value)\n})\n\n/** 右栏菜单:有子级时展示子级,单层时展示根项自身 */\nconst panelMenus = computed<NavItem[] | undefined>(() => {\n const app = panelApp.value\n if (!app) return undefined\n if (app.children?.length) return app.children\n return [app]\n})\n\nconst hasExpandableMenus = computed(() => {\n return collectNavBranchPaths(panelMenus.value).length > 0\n})\n\nwatch(panelAppPath, () => {\n allExpanded.value = false\n})\n\n/** 左轨高亮:currentPath 落在该应用下时为激活态 */\nfunction isAppActive(app: NavItem): boolean {\n return findRootApp(props.menus, props.currentPath)?.path === app.path\n}\n\n/** 左轨选中:已切换右栏但尚未导航到该应用下任一菜单时,使用 hover 风格 */\nfunction isAppSelected(app: NavItem): boolean {\n return panelAppPath.value === app.path && !isAppActive(app)\n}\n\nfunction handleAppClick(app: NavItem) {\n if (app.disabled) return\n\n panelAppPath.value = app.path\n\n emit('item-click', findFirstLeaf(app))\n}\n\nfunction handleToggleExpandAll() {\n if (allExpanded.value) {\n navRef.value?.collapseAll()\n allExpanded.value = false\n return\n }\n\n navRef.value?.expandAll()\n allExpanded.value = true\n}\n</script>\n"],"mappings":";;;;;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AAA,UAAA,GADR,YAgBQ,MAAA,WAAA,GAAA;;KAdL,SAAS,YAAA,QAAW,SAAA;KACrB,cAAA;;4BAYS,CAVT,mBAUS,UAAA;MATP,MAAK;MACJ,OAAK,eAAE,MAAA,GAAA,EAAI,EAAC,eAAA,CAAA;MACZ,cAAY,YAAA,QAAW,SAAA;MACvB,SAAO;SAER,YAGS,MAAA,WAAA,GAAA,MAAA;6BAF6B,CAAA,CAAf,YAAA,SAAA,UAAA,GAArB,YAAoC,MAAA,YAAA,GAAA,EAAA,KAAA,EAAA,CAAA,MAAA,UAAA,GACpC,YAAiB,MAAA,MAAA,GAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA;;;;iEAMzB,mBAQM,OAAA,EARA,OAAK,eAAE,MAAA,GAAA,EAAI,EAAC,YAAA,CAAA,EAAA,GAAA,CAChB,YAME,MAAA,WAAA,GAAA;cALI;KAAJ,KAAI;KACH,OAAO,WAAA;KACP,gBAAc,QAAA;KACd,WAAW;KACX,aAAU,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,cAAe,MAAM"}
@@ -15,7 +15,12 @@ function findRootApp(menus, currentPath) {
15
15
  if (matched) return app;
16
16
  }
17
17
  }
18
+ /** 深度优先查找首个叶子节点(无子级或子级为空) */
19
+ function findFirstLeaf(node) {
20
+ if (!node.children?.length) return node;
21
+ return findFirstLeaf(node.children[0]);
22
+ }
18
23
  //#endregion
19
- export { findRootApp };
24
+ export { findFirstLeaf, findRootApp };
20
25
 
21
26
  //# sourceMappingURL=helper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helper.js","names":[],"sources":["../../../src/components/dual-nav/helper.ts"],"sourcesContent":["import type { DualNavRootItem } from '../../types'\nimport { walkNavWithPath } from '../nav/walk-nav-path'\n\n/** 根据当前路径反查所属顶层应用 */\nexport function findRootApp(\n menus: DualNavRootItem[] | undefined,\n currentPath?: string\n): DualNavRootItem | undefined {\n if (!currentPath || !menus?.length) return undefined\n\n for (const app of menus) {\n if (app.path === currentPath) return app\n\n let matched = false\n walkNavWithPath(app, (node) => {\n if (node.path === currentPath) {\n matched = true\n return false\n }\n })\n if (matched) return app\n }\n\n return undefined\n}\n"],"mappings":";;;AAIA,SAAgB,YACd,OACA,aAC6B;CAC7B,IAAI,CAAC,eAAe,CAAC,OAAO,QAAQ,OAAO,KAAA;CAE3C,KAAK,MAAM,OAAO,OAAO;EACvB,IAAI,IAAI,SAAS,aAAa,OAAO;EAErC,IAAI,UAAU;EACd,gBAAgB,MAAM,SAAS;GAC7B,IAAI,KAAK,SAAS,aAAa;IAC7B,UAAU;IACV,OAAO;GACT;EACF,CAAC;EACD,IAAI,SAAS,OAAO;CACtB;AAGF"}
1
+ {"version":3,"file":"helper.js","names":[],"sources":["../../../src/components/dual-nav/helper.ts"],"sourcesContent":["import type { DualNavRootItem, NavItem } from '../../types'\nimport { walkNavWithPath } from '../nav/walk-nav-path'\n\n/** 根据当前路径反查所属顶层应用 */\nexport function findRootApp(\n menus: DualNavRootItem[] | undefined,\n currentPath?: string\n): DualNavRootItem | undefined {\n if (!currentPath || !menus?.length) return undefined\n\n for (const app of menus) {\n if (app.path === currentPath) return app\n\n let matched = false\n walkNavWithPath(app, (node) => {\n if (node.path === currentPath) {\n matched = true\n return false\n }\n })\n if (matched) return app\n }\n\n return undefined\n}\n\n/** 深度优先查找首个叶子节点(无子级或子级为空) */\nexport function findFirstLeaf(node: NavItem): NavItem {\n if (!node.children?.length) return node\n return findFirstLeaf(node.children[0]!)\n}\n"],"mappings":";;;AAIA,SAAgB,YACd,OACA,aAC6B;CAC7B,IAAI,CAAC,eAAe,CAAC,OAAO,QAAQ,OAAO,KAAA;CAE3C,KAAK,MAAM,OAAO,OAAO;EACvB,IAAI,IAAI,SAAS,aAAa,OAAO;EAErC,IAAI,UAAU;EACd,gBAAgB,MAAM,SAAS;GAC7B,IAAI,KAAK,SAAS,aAAa;IAC7B,UAAU;IACV,OAAO;GACT;EACF,CAAC;EACD,IAAI,SAAS,OAAO;CACtB;AAGF;;AAGA,SAAgB,cAAc,MAAwB;CACpD,IAAI,CAAC,KAAK,UAAU,QAAQ,OAAO;CACnC,OAAO,cAAc,KAAK,SAAS,EAAG;AACxC"}
@@ -20,7 +20,6 @@
20
20
  height: 100%;
21
21
  min-height: 0;
22
22
  background-color: var(--u-nav-bg-color);
23
- border: 1px solid var(--u-border-color);
24
23
  border-radius: calc(var(--u-radius-large) + 6px);
25
24
  overflow: hidden;
26
25
  }
@@ -53,7 +52,6 @@
53
52
  justify-content: space-between;
54
53
  gap: 8px;
55
54
  padding: 12px 12px 10px;
56
- border-bottom: 1px solid var(--u-border-color);
57
55
  }
58
56
  .u-dual-nav__panel-header-main {
59
57
  flex: 1;
@@ -17,19 +17,19 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, _Inpu
17
17
  "update:modelValue": (value: string) => any;
18
18
  clear: () => any;
19
19
  change: (value: string) => any;
20
- "suffix:click": (value?: string | undefined) => any;
21
- "prefix:click": (value?: string | undefined) => any;
22
20
  focus: (value?: string | undefined) => any;
23
21
  blur: (value?: string | undefined) => any;
22
+ "suffix:click": (value?: string | undefined) => any;
23
+ "prefix:click": (value?: string | undefined) => any;
24
24
  "native:input": (ev: Event) => any;
25
25
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
26
26
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
27
27
  onClear?: (() => any) | undefined;
28
28
  onChange?: ((value: string) => any) | undefined;
29
- "onSuffix:click"?: ((value?: string | undefined) => any) | undefined;
30
- "onPrefix:click"?: ((value?: string | undefined) => any) | undefined;
31
29
  onFocus?: ((value?: string | undefined) => any) | undefined;
32
30
  onBlur?: ((value?: string | undefined) => any) | undefined;
31
+ "onSuffix:click"?: ((value?: string | undefined) => any) | undefined;
32
+ "onPrefix:click"?: ((value?: string | undefined) => any) | undefined;
33
33
  "onNative:input"?: ((ev: Event) => any) | undefined;
34
34
  }>, {
35
35
  placeholder: string;
@@ -21,9 +21,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
21
21
  onClear?: (() => any) | undefined;
22
22
  onChange?: ((checked: Record<string, any>[]) => any) | undefined;
23
23
  }>, {
24
- expandAll: boolean;
25
24
  labelKey: string;
26
25
  valueKey: string;
26
+ expandAll: boolean;
27
27
  placeholder: string;
28
28
  clearable: boolean;
29
29
  filterable: boolean;
@@ -1,8 +1,8 @@
1
1
  import { NumberProps } from "../../types/number.js";
2
2
  //#region src/components/number/number.vue.d.ts
3
3
  declare const __VLS_export: import("vue").DefineComponent<NumberProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NumberProps> & Readonly<{}>, {
4
- duration: number;
5
4
  format: "currency" | "percent" | "decimal";
5
+ duration: number;
6
6
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  declare const _default: typeof __VLS_export;
8
8
  //#endregion
@@ -19,9 +19,9 @@ declare const __VLS_base: import("vue").DefineComponent<ProgressNodesProps, {},
19
19
  "onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
20
20
  onClick?: ((node: Record<string, any>, index: number) => any) | undefined;
21
21
  }>, {
22
+ colorType: import("@veltra/utils").ColorType;
22
23
  labelKey: string;
23
24
  valueKey: string;
24
- colorType: import("@veltra/utils").ColorType;
25
25
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
26
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
27
27
  declare const _default: typeof __VLS_export;
@@ -5,11 +5,11 @@ type __VLS_Slots = {
5
5
  content(): any;
6
6
  };
7
7
  declare const __VLS_base: import("vue").DefineComponent<ScrollProps, _ScrollExposed, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
8
- scroll: (position: Required<ScrollPosition>) => any;
9
8
  resize: (targets: HTMLElement[]) => any;
9
+ scroll: (position: Required<ScrollPosition>) => any;
10
10
  }, string, import("vue").PublicProps, Readonly<ScrollProps> & Readonly<{
11
- onScroll?: ((position: Required<ScrollPosition>) => any) | undefined;
12
11
  onResize?: ((targets: HTMLElement[]) => any) | undefined;
12
+ onScroll?: ((position: Required<ScrollPosition>) => any) | undefined;
13
13
  }>, {
14
14
  tag: string;
15
15
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -6,11 +6,11 @@ type __VLS_Slots = {
6
6
  tip?: (scope: StepsSlotScope) => any;
7
7
  };
8
8
  declare const __VLS_base: import("vue").DefineComponent<StepsProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
9
- "item-click": (item: Record<string, any>, index: number) => any;
10
9
  "update:current": (value?: string | number | undefined) => any;
10
+ "item-click": (item: Record<string, any>, index: number) => any;
11
11
  }, string, import("vue").PublicProps, Readonly<StepsProps> & Readonly<{
12
- "onItem-click"?: ((item: Record<string, any>, index: number) => any) | undefined;
13
12
  "onUpdate:current"?: ((value?: string | number | undefined) => any) | undefined;
13
+ "onItem-click"?: ((item: Record<string, any>, index: number) => any) | undefined;
14
14
  }>, {
15
15
  labelKey: string;
16
16
  direction: "horizontal" | "vertical";
@@ -19,9 +19,9 @@ declare const __VLS_base: import("vue").DefineComponent<TreeProps, _TreeExposed,
19
19
  "onNode-contextmenu"?: ((event: MouseEvent, node: TreeNode<Record<string, any>>) => any) | undefined;
20
20
  "onSelected-synced"?: ((selected?: Record<string, any> | undefined) => any) | undefined;
21
21
  }>, {
22
- expandOnClickNode: boolean;
23
22
  labelKey: string;
24
23
  valueKey: string;
24
+ expandOnClickNode: boolean;
25
25
  childrenKey: string;
26
26
  data: Record<string, any>[];
27
27
  checkStrictly: boolean;
@@ -23,9 +23,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
23
23
  onChange?: ((value?: string | number | undefined, selectedData?: Record<string, any> | undefined) => any) | undefined;
24
24
  "onUpdate:text"?: ((text?: string | undefined) => any) | undefined;
25
25
  }>, {
26
- expandAll: boolean;
27
26
  labelKey: string;
28
27
  valueKey: string;
28
+ expandAll: boolean;
29
29
  placeholder: string;
30
30
  clearable: boolean;
31
31
  filterable: boolean;
@@ -5,8 +5,8 @@ type __VLS_Slots = {} & {
5
5
  default?: (props: typeof __VLS_7) => any;
6
6
  };
7
7
  declare const __VLS_base: import("vue").DefineComponent<WatermarkProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<WatermarkProps> & Readonly<{}>, {
8
- fontSize: number;
9
8
  route: number;
9
+ fontSize: number;
10
10
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
11
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
12
  declare const _default: typeof __VLS_export;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veltra/desktop",
3
- "version": "1.2.6",
3
+ "version": "1.2.7",
4
4
  "files": [
5
5
  "dist",
6
6
  "src"
@@ -68,11 +68,11 @@
68
68
  "@cat-kit/core": ">=1.1.6",
69
69
  "@cat-kit/excel": ">=1.0.0",
70
70
  "@cat-kit/fe": "^1.1.6",
71
- "@veltra/compositions": "1.2.6",
72
- "@veltra/directives": "1.2.6",
73
- "@veltra/icons": "1.2.6",
74
- "@veltra/styles": "1.2.6",
75
- "@veltra/utils": "1.2.6",
71
+ "@veltra/compositions": "1.2.7",
72
+ "@veltra/directives": "1.2.7",
73
+ "@veltra/icons": "1.2.7",
74
+ "@veltra/styles": "1.2.7",
75
+ "@veltra/utils": "1.2.7",
76
76
  "vue": ">=3.5.0"
77
77
  }
78
78
  }
@@ -68,7 +68,7 @@ import { UNav } from '../nav'
68
68
  import { collectNavBranchPaths } from '../nav/helper'
69
69
  import { UTip } from '../tip'
70
70
  import DualNavApp from './dual-nav-app.vue'
71
- import { findRootApp } from './helper'
71
+ import { findFirstLeaf, findRootApp } from './helper'
72
72
 
73
73
  defineOptions({ name: 'DualNav' })
74
74
 
@@ -138,9 +138,7 @@ function handleAppClick(app: NavItem) {
138
138
 
139
139
  panelAppPath.value = app.path
140
140
 
141
- if (!app.children?.length) {
142
- emit('item-click', app)
143
- }
141
+ emit('item-click', findFirstLeaf(app))
144
142
  }
145
143
 
146
144
  function handleToggleExpandAll() {
@@ -1,4 +1,4 @@
1
- import type { DualNavRootItem } from '../../types'
1
+ import type { DualNavRootItem, NavItem } from '../../types'
2
2
  import { walkNavWithPath } from '../nav/walk-nav-path'
3
3
 
4
4
  /** 根据当前路径反查所属顶层应用 */
@@ -23,3 +23,9 @@ export function findRootApp(
23
23
 
24
24
  return undefined
25
25
  }
26
+
27
+ /** 深度优先查找首个叶子节点(无子级或子级为空) */
28
+ export function findFirstLeaf(node: NavItem): NavItem {
29
+ if (!node.children?.length) return node
30
+ return findFirstLeaf(node.children[0]!)
31
+ }
@@ -7,7 +7,6 @@
7
7
  height: 100%;
8
8
  min-height: 0;
9
9
  background-color: var(--u-nav-bg-color);
10
- border: 1px solid fn.use-var(border, color);
11
10
  border-radius: calc(fn.use-var(radius, large) + 6px);
12
11
  overflow: hidden;
13
12
 
@@ -43,7 +42,6 @@
43
42
  justify-content: space-between;
44
43
  gap: 8px;
45
44
  padding: 12px 12px 10px;
46
- border-bottom: 1px solid fn.use-var(border, color);
47
45
  }
48
46
 
49
47
  @include m.e(panel-header-main) {