@veltra/desktop 1.2.3 → 1.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.
- package/dist/components/action/action-group.vue.d.ts +3 -3
- package/dist/components/action/action.vue.d.ts +2 -2
- package/dist/components/auto-complete/auto-complete.js +25 -13
- package/dist/components/auto-complete/auto-complete.js.map +1 -1
- package/dist/components/auto-complete/auto-complete.vue.d.ts +3 -2
- package/dist/components/batch-edit/batch-edit-form.js +33 -26
- package/dist/components/batch-edit/batch-edit-form.js.map +1 -1
- package/dist/components/batch-edit/batch-edit-list.js +4 -1
- package/dist/components/batch-edit/batch-edit-list.js.map +1 -1
- package/dist/components/batch-edit/batch-edit.js +29 -50
- package/dist/components/batch-edit/batch-edit.js.map +1 -1
- package/dist/components/batch-edit/batch-edit.vue.d.ts +3 -3
- package/dist/components/batch-edit/di.js.map +1 -1
- package/dist/components/batch-edit/style2.css +3 -0
- package/dist/components/batch-edit/use-edit.js +39 -71
- package/dist/components/batch-edit/use-edit.js.map +1 -1
- package/dist/components/batch-edit/use-features.js +38 -0
- package/dist/components/batch-edit/use-features.js.map +1 -0
- package/dist/components/checkbox/checkbox-button.vue.d.ts +1 -1
- package/dist/components/contextmenu/style2.css +7 -7
- package/dist/components/date-panel/date-panel.vue.d.ts +1 -1
- package/dist/components/date-picker/date-picker.vue.d.ts +1 -1
- package/dist/components/date-range-picker/date-range-picker.vue.d.ts +1 -1
- package/dist/components/dual-nav/dual-nav-app.js +49 -0
- package/dist/components/dual-nav/dual-nav-app.js.map +1 -0
- package/dist/components/dual-nav/dual-nav.js +125 -0
- package/dist/components/dual-nav/dual-nav.js.map +1 -0
- package/dist/components/dual-nav/dual-nav.vue.d.ts +13 -0
- package/dist/components/dual-nav/helper.js +21 -0
- package/dist/components/dual-nav/helper.js.map +1 -0
- package/dist/components/dual-nav/index.d.ts +1 -0
- package/dist/components/dual-nav/style.js +4 -0
- package/dist/components/dual-nav/style2.css +145 -0
- package/dist/components/empty/empty.vue.d.ts +1 -1
- package/dist/components/index.d.ts +23 -22
- package/dist/components/index.js +28 -26
- package/dist/components/index.js.map +1 -1
- package/dist/components/nav/di.js +7 -0
- package/dist/components/nav/di.js.map +1 -0
- package/dist/components/nav/helper.js +18 -0
- package/dist/components/nav/helper.js.map +1 -0
- package/dist/components/nav/index.d.ts +3 -0
- package/dist/components/{menu/menu-icon.js → nav/nav-icon.js} +4 -4
- package/dist/components/nav/nav-icon.js.map +1 -0
- package/dist/components/{menu/menu-item-collapsed.js → nav/nav-item-collapsed.js} +23 -23
- package/dist/components/nav/nav-item-collapsed.js.map +1 -0
- package/dist/components/{menu/menu-item.js → nav/nav-item.js} +13 -13
- package/dist/components/nav/nav-item.js.map +1 -0
- package/dist/components/{menu/menu-item.vue.d.ts → nav/nav-item.vue.d.ts} +4 -4
- package/dist/components/{menu/menu-sub-collapsed.js → nav/nav-sub-collapsed.js} +19 -19
- package/dist/components/nav/nav-sub-collapsed.js.map +1 -0
- package/dist/components/{menu/menu-sub.js → nav/nav-sub.js} +24 -24
- package/dist/components/nav/nav-sub.js.map +1 -0
- package/dist/components/{menu/menu-sub.vue.d.ts → nav/nav-sub.vue.d.ts} +4 -4
- package/dist/components/{menu/menu.js → nav/nav.js} +45 -36
- package/dist/components/nav/nav.js.map +1 -0
- package/dist/components/nav/nav.vue.d.ts +18 -0
- package/dist/components/nav/style.d.ts +1 -0
- package/dist/components/{menu → nav}/style2.css +105 -105
- package/dist/components/{menu/use-menu-item.js → nav/use-nav-item.js} +11 -11
- package/dist/components/nav/use-nav-item.js.map +1 -0
- package/dist/components/{menu/walk-menu-path.js → nav/walk-nav-path.js} +5 -5
- package/dist/components/nav/walk-nav-path.js.map +1 -0
- package/dist/components/number/number.vue.d.ts +1 -1
- package/dist/components/pop-confirm/pop-confirm.vue.d.ts +1 -1
- package/dist/components/select/style2.css +4 -4
- package/dist/components/table/use-columns.js +14 -12
- package/dist/components/table/use-columns.js.map +1 -1
- package/dist/components/tip/tip.vue.d.ts +1 -1
- package/dist/components/watermark/watermark.vue.d.ts +1 -1
- package/dist/index.d.ts +63 -61
- package/dist/index.js +56 -55
- package/dist/style.js +2 -1
- package/dist/types/auto-complete.d.ts +6 -1
- package/dist/types/batch-edit.d.ts +15 -2
- package/dist/types/dual-nav.d.ts +27 -0
- package/dist/types/index.d.ts +4 -3
- package/dist/types/nav.d.ts +48 -0
- package/package.json +6 -6
- package/src/components/auto-complete/auto-complete.vue +24 -13
- package/src/components/batch-edit/batch-edit-form.vue +29 -18
- package/src/components/batch-edit/batch-edit-list.vue +6 -1
- package/src/components/batch-edit/batch-edit.vue +36 -73
- package/src/components/batch-edit/di.ts +3 -1
- package/src/components/batch-edit/style.scss +5 -0
- package/src/components/batch-edit/use-edit.ts +63 -116
- package/src/components/batch-edit/use-features.ts +58 -0
- package/src/components/contextmenu/style.scss +5 -5
- package/src/components/dual-nav/dual-nav-app.vue +33 -0
- package/src/components/dual-nav/dual-nav.vue +150 -0
- package/src/components/dual-nav/helper.ts +25 -0
- package/src/components/dual-nav/index.ts +1 -0
- package/src/components/dual-nav/style.scss +153 -0
- package/src/components/dual-nav/style.ts +4 -0
- package/src/components/index.ts +3 -1
- package/src/components/nav/di.ts +17 -0
- package/src/components/nav/helper.ts +22 -0
- package/src/components/nav/index.ts +3 -0
- package/src/components/{menu/menu-icon.vue → nav/nav-icon.vue} +1 -1
- package/src/components/nav/nav-item-collapsed.vue +66 -0
- package/src/components/nav/nav-item.vue +36 -0
- package/src/components/{menu/menu-sub-collapsed.vue → nav/nav-sub-collapsed.vue} +15 -15
- package/src/components/{menu/menu-sub.vue → nav/nav-sub.vue} +19 -19
- package/src/components/{menu/menu.vue → nav/nav.vue} +42 -42
- package/src/components/{menu → nav}/style.scss +16 -14
- package/src/components/{menu/use-menu-item.ts → nav/use-nav-item.ts} +14 -14
- package/src/components/{menu/walk-menu-path.ts → nav/walk-nav-path.ts} +2 -2
- package/src/components/select/style.scss +4 -4
- package/src/components/table/use-columns.ts +23 -20
- package/src/style.ts +2 -1
- package/src/types/auto-complete.ts +6 -1
- package/src/types/batch-edit.ts +18 -1
- package/src/types/dual-nav.ts +28 -0
- package/src/types/index.ts +2 -1
- package/src/types/nav.ts +49 -0
- package/dist/components/menu/di.js +0 -7
- package/dist/components/menu/di.js.map +0 -1
- package/dist/components/menu/helper.js +0 -8
- package/dist/components/menu/helper.js.map +0 -1
- package/dist/components/menu/index.d.ts +0 -3
- package/dist/components/menu/menu-icon.js.map +0 -1
- package/dist/components/menu/menu-item-collapsed.js.map +0 -1
- package/dist/components/menu/menu-item.js.map +0 -1
- package/dist/components/menu/menu-sub-collapsed.js.map +0 -1
- package/dist/components/menu/menu-sub.js.map +0 -1
- package/dist/components/menu/menu.js.map +0 -1
- package/dist/components/menu/menu.vue.d.ts +0 -14
- package/dist/components/menu/use-menu-item.js.map +0 -1
- package/dist/components/menu/walk-menu-path.js.map +0 -1
- package/dist/types/menu.d.ts +0 -40
- package/src/components/menu/di.ts +0 -17
- package/src/components/menu/helper.ts +0 -3
- package/src/components/menu/index.ts +0 -3
- package/src/components/menu/menu-item-collapsed.vue +0 -66
- package/src/components/menu/menu-item.vue +0 -36
- package/src/components/menu/menu-node.ts +0 -6
- package/src/types/menu.ts +0 -41
- /package/dist/components/{menu → dual-nav}/style.d.ts +0 -0
- /package/dist/components/{menu → nav}/style.js +0 -0
- /package/src/components/{menu → nav}/style.ts +0 -0
package/dist/types/index.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ import { DatePanelEmits, DatePanelProps, PanelType } from "./date-panel.js";
|
|
|
24
24
|
import { DialogEmits, DialogExposed, DialogProps, DialogTransition, _DialogExposed } from "./dialog.js";
|
|
25
25
|
import { ActionEmits, ActionExposed, ActionGroupExposed, ActionGroupProps, ActionProps, _ActionExposed, _ActionGroupExposed } from "./action.js";
|
|
26
26
|
import { TableColumn, TableColumnAlign, TableColumnNode, TableColumnRenderContext, TableColumnSlotsScope, TableEmits, TableExposed, TableProps, TableRow, TableRowSlotsScope, TableSummaryContext, _TableExposed } from "./table.js";
|
|
27
|
-
import { BatchEditColumn, BatchEditEmits, BatchEditExposed, BatchEditFeature, BatchEditProps, _BatchEditExposed } from "./batch-edit.js";
|
|
27
|
+
import { BatchEditColumn, BatchEditEmits, BatchEditExposed, BatchEditFeature, BatchEditMode, BatchEditProps, _BatchEditExposed } from "./batch-edit.js";
|
|
28
28
|
import { BreadcrumbEmits, BreadcrumbExposed, BreadcrumbItem, BreadcrumbProps, BreadcrumbSlotScope, _BreadcrumbExposed } from "./breadcrumb.js";
|
|
29
29
|
import { ListEmits, ListExposed, ListProps, _ListExposed } from "./list.js";
|
|
30
30
|
import { EmptyEmits, EmptyExposed, EmptyProps, _EmptyExposed } from "./empty.js";
|
|
@@ -46,7 +46,8 @@ import { CodeEditorEmits, CodeEditorExposed, CodeEditorLang, CodeEditorProps, _C
|
|
|
46
46
|
import { TextEmits, TextExposed, TextProps, _TextExposed } from "./text.js";
|
|
47
47
|
import { CheckboxGroupEmits, CheckboxGroupExposed, CheckboxGroupProps } from "./checkbox-group.js";
|
|
48
48
|
import { TableEditorEmits, TableEditorExposed, TableEditorProps, _TableEditorExposed } from "./table-editor.js";
|
|
49
|
-
import {
|
|
49
|
+
import { NavEmits, NavExposed, NavItem, NavProps, _NavExposed } from "./nav.js";
|
|
50
|
+
import { DualNavEmits, DualNavExposed, DualNavProps, DualNavRootItem, _DualNavExposed } from "./dual-nav.js";
|
|
50
51
|
import { PasswordInputEmits, PasswordInputExposed, PasswordInputProps, _PasswordInputExposed } from "./password-input.js";
|
|
51
52
|
import { DatePickerEmits, DatePickerExposed, DatePickerProps, _DatePickerExposed } from "./date-picker.js";
|
|
52
53
|
import { DropdownEmits, DropdownExposed, DropdownProps, _DropdownExposed } from "./dropdown.js";
|
|
@@ -81,7 +82,7 @@ export type * from "@veltra/utils";
|
|
|
81
82
|
|
|
82
83
|
//#region src/types/index.d.ts
|
|
83
84
|
declare namespace index_d_exports {
|
|
84
|
-
export { ActionEmits, ActionExposed, ActionGroupExposed, ActionGroupProps, ActionProps, AnimationEmits, AnimationExposed, AnimationProps, AutoCompleteEmits, AutoCompleteExposed, AutoCompleteProps, BadgeEmits, BadgeExposed, BadgeProps, BarType, BatchEditColumn, BatchEditEmits, BatchEditExposed, BatchEditFeature, BatchEditProps, BreadcrumbEmits, BreadcrumbExposed, BreadcrumbItem, BreadcrumbProps, BreadcrumbSlotScope, BreakCols, Breakpoint, ButtonEmits, ButtonExposed, ButtonProps, ButtonType, CalendarDay, CalendarEmits, CalendarExposed, CalendarMonth, CalendarProps, CalendarYear, CardActionProps, CardContentProps, CardCoverProps, CardEmits, CardExposed, CardProps, CascadeEmits, CascadeExposed, CascadeNode, CascadeProps, CheckTagEmits, CheckTagExposed, CheckTagProps, CheckboxButtonEmits, CheckboxButtonProps, CheckboxEmits, CheckboxExposed, CheckboxGroupEmits, CheckboxGroupExposed, CheckboxGroupProps, CheckboxProps, CodeEditorEmits, CodeEditorExposed, CodeEditorLang, CodeEditorProps, CollapseEmits, CollapseItemProps, CollapseModelValue, CollapseProps, CollapseValue, ConditionConnector, ConditionEditorEmits, ConditionEditorExposed, ConditionEditorProps, ConditionExpression, ConditionField, ConditionGroup, ConditionLeaf, ConditionNode, ConditionValue, ContextmenuEmits, ContextmenuExposed, ContextmenuItem, ContextmenuProps, CssTransitionEmits, CssTransitionExposed, CssTransitionProps, DatePanelEmits, DatePanelProps, DatePickerEmits, DatePickerExposed, DatePickerProps, DateRangePickerEmits, DateRangePickerExposed, DateRangePickerProps, DialogEmits, DialogExposed, DialogProps, DialogTransition, DrawerDirection, DrawerEmits, DrawerExposed, DrawerMode, DrawerProps, DropdownEmits, DropdownExposed, DropdownProps, EmptyEmits, EmptyExposed, EmptyProps, ExpressionEditorEmits, ExpressionEditorExposed, ExpressionEditorProps, ExpressionSelectableLevels, FileViewerEmits, FileViewerExposed, FileViewerItem, FileViewerKind, FileViewerProps, FloatButtonEmits, FloatButtonExposed, FloatButtonItem, FloatButtonProps, FormExposed, FormItemEmits, FormItemExposed, FormItemProps, FormProps, GanttChartEmits, GanttChartExposed, GanttChartProps, GridEmits, GridExposed, GridInputEmits, GridInputExposed, GridInputProps, GridItemProps, GridProps, GroupInputEmits, GroupInputExposed, GroupInputProps, IconEmits, IconExposed, IconProps, InputEmits, InputExposed, InputProps, LayoutEmits, LayoutExposed, LayoutProps, ListEmits, ListExposed, ListProps, LoadingEmits, LoadingExposed, LoadingProps, LoadingType,
|
|
85
|
+
export { ActionEmits, ActionExposed, ActionGroupExposed, ActionGroupProps, ActionProps, AnimationEmits, AnimationExposed, AnimationProps, AutoCompleteEmits, AutoCompleteExposed, AutoCompleteProps, BadgeEmits, BadgeExposed, BadgeProps, BarType, BatchEditColumn, BatchEditEmits, BatchEditExposed, BatchEditFeature, BatchEditMode, BatchEditProps, BreadcrumbEmits, BreadcrumbExposed, BreadcrumbItem, BreadcrumbProps, BreadcrumbSlotScope, BreakCols, Breakpoint, ButtonEmits, ButtonExposed, ButtonProps, ButtonType, CalendarDay, CalendarEmits, CalendarExposed, CalendarMonth, CalendarProps, CalendarYear, CardActionProps, CardContentProps, CardCoverProps, CardEmits, CardExposed, CardProps, CascadeEmits, CascadeExposed, CascadeNode, CascadeProps, CheckTagEmits, CheckTagExposed, CheckTagProps, CheckboxButtonEmits, CheckboxButtonProps, CheckboxEmits, CheckboxExposed, CheckboxGroupEmits, CheckboxGroupExposed, CheckboxGroupProps, CheckboxProps, CodeEditorEmits, CodeEditorExposed, CodeEditorLang, CodeEditorProps, CollapseEmits, CollapseItemProps, CollapseModelValue, CollapseProps, CollapseValue, ConditionConnector, ConditionEditorEmits, ConditionEditorExposed, ConditionEditorProps, ConditionExpression, ConditionField, ConditionGroup, ConditionLeaf, ConditionNode, ConditionValue, ContextmenuEmits, ContextmenuExposed, ContextmenuItem, ContextmenuProps, CssTransitionEmits, CssTransitionExposed, CssTransitionProps, DatePanelEmits, DatePanelProps, DatePickerEmits, DatePickerExposed, DatePickerProps, DateRangePickerEmits, DateRangePickerExposed, DateRangePickerProps, DialogEmits, DialogExposed, DialogProps, DialogTransition, DrawerDirection, DrawerEmits, DrawerExposed, DrawerMode, DrawerProps, DropdownEmits, DropdownExposed, DropdownProps, DualNavEmits, DualNavExposed, DualNavProps, DualNavRootItem, EmptyEmits, EmptyExposed, EmptyProps, ExpressionEditorEmits, ExpressionEditorExposed, ExpressionEditorProps, ExpressionSelectableLevels, FileViewerEmits, FileViewerExposed, FileViewerItem, FileViewerKind, FileViewerProps, FloatButtonEmits, FloatButtonExposed, FloatButtonItem, FloatButtonProps, FormExposed, FormItemEmits, FormItemExposed, FormItemProps, FormProps, GanttChartEmits, GanttChartExposed, GanttChartProps, GridEmits, GridExposed, GridInputEmits, GridInputExposed, GridInputProps, GridItemProps, GridProps, GroupInputEmits, GroupInputExposed, GroupInputProps, IconEmits, IconExposed, IconProps, InputEmits, InputExposed, InputProps, LayoutEmits, LayoutExposed, LayoutProps, ListEmits, ListExposed, ListProps, LoadingEmits, LoadingExposed, LoadingProps, LoadingType, Message, MessageConfirmEmits, MessageConfirmExposed, MessageConfirmProps, MessageEmits, MessageExposed, MessageInstance, MessageOptions, MessageProps, MessageType, MultiAutoCompleteEmits, MultiAutoCompleteExposed, MultiAutoCompleteProps, MultiSelectEmits, MultiSelectExposed, MultiSelectProps, MultiTreeSelectEmits, MultiTreeSelectExposed, MultiTreeSelectProps, NavEmits, NavExposed, NavItem, NavProps, NodeRenderExposed, NodeRenderProps, NotificationEmits, NotificationExposed, NotificationProps, NumberEmits, NumberExposed, NumberInputEmits, NumberInputExposed, NumberInputProps, NumberProps, NumberRangeInputEmits, NumberRangeInputExposed, NumberRangeInputProps, NumberRangeTuple, PaginatorEmits, PaginatorExposed, PaginatorProps, PaletteColorType, PaletteEmits, PaletteExposed, PaletteHSV, PaletteProps, PaletteRGB, PanelItem, PanelType, PasswordInputEmits, PasswordInputExposed, PasswordInputProps, PopConfirmEmits, PopConfirmExposed, PopConfirmProps, PopEmits, PopExposed, PopProps, ProgressEmits, ProgressExposed, ProgressNodesEmits, ProgressNodesExposed, ProgressNodesProps, ProgressProps, QuickBatchEditEmits, QuickBatchEditExposed, QuickBatchEditProps, RadioEmits, RadioExposed, RadioGroupEmits, RadioGroupExposed, RadioGroupProps, RadioProps, RichTextEditorEmits, RichTextEditorExposed, RichTextEditorProps, RichTextFormat, ScrollEmits, ScrollExposed, ScrollPosition, ScrollProps, SelectEmits, SelectExposed, SelectProps, SliderEmits, SliderExposed, SliderProps, StepsEmits, StepsExposed, StepsProps, StepsSlotScope, SwitchEmits, SwitchExposed, SwitchProps, TabItem, TableColumn, TableColumnAlign, TableColumnNode, TableColumnRenderContext, TableColumnSlotsScope, TableEditorEmits, TableEditorExposed, TableEditorProps, TableEmits, TableExposed, TableProps, TableRow, TableRowSlotsScope, TableSummaryContext, TabsEmits, TabsExposed, TabsHorizontalEmits, TabsHorizontalExposed, TabsHorizontalProps, TabsProps, TabsVerticalEmits, TabsVerticalExposed, TabsVerticalProps, TagEmits, TagExposed, TagProps, TextEditorEmits, TextEditorExposed, TextEditorProps, TextEmits, TextExposed, TextProps, TextareaEmits, TextareaExposed, TextareaProps, ThemeExposed, ThemeProps, TipAlign, TipDirection, TipEmits, TipExposed, TipProps, ToolbarItem, TreeEmit, TreeExposed, TreeNode, TreeNodeProps, TreeProps, TreeSelectEmits, TreeSelectExposed, TreeSelectProps, UploaderEmits, UploaderExposed, UploaderProps, VariableItem, WatermarkEmits, WatermarkExposed, WatermarkProps, _ActionExposed, _ActionGroupExposed, _AnimationExposed, _AutoCompleteExposed, _BadgeExposed, _BatchEditExposed, _BreadcrumbExposed, _ButtonExposed, _CalendarExposed, _CardExposed, _CascadeExposed, _CheckTagExposed, _CodeEditorExposed, _ConditionEditorExposed, _ContextmenuExposed, _CssTransitionExposed, _DatePickerExposed, _DateRangePickerExposed, _DialogExposed, _DrawerExposed, _DropdownExposed, _DualNavExposed, _EmptyExposed, _ExpressionEditorExposed, _FileViewerExposed, _FloatButtonExposed, _FormExposed, _GanttChartExposed, _GridExposed, _GridInputExposed, _GroupInputExposed, _InputExposed, _LayoutExposed, _ListExposed, _LoadingExposed, _MessageConfirmExposed, _MessageExposed, _MultiAutoCompleteExposed, _MultiSelectExposed, _MultiTreeSelectExposed, _NavExposed, _NotificationExposed, _PaginatorExposed, _PaletteExposed, _PasswordInputExposed, _PopConfirmExposed, _PopExposed, _ProgressExposed, _ProgressNodesExposed, _QuickBatchEditExposed, _RadioExposed, _RadioGroupExposed, _RichTextEditorExposed, _ScrollExposed, _SelectExposed, _SliderExposed, _StepsExposed, _SwitchExposed, _TableEditorExposed, _TableExposed, _TabsExposed, _TabsHorizontalExposed, _TabsVerticalExposed, _TextEditorExposed, _TextExposed, _TextareaExposed, _ThemeExposed, _TipExposed, _TreeExposed, _TreeSelectExposed, _UploaderExposed, _WatermarkExposed };
|
|
85
86
|
}
|
|
86
87
|
import * as import__veltra_utils from "@veltra/utils";
|
|
87
88
|
//#endregion
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { DefineComponent } from "vue";
|
|
2
|
+
import { DeconstructValue } from "@veltra/utils";
|
|
3
|
+
|
|
4
|
+
//#region src/types/nav.d.ts
|
|
5
|
+
/** 导航项 */
|
|
6
|
+
interface NavItem {
|
|
7
|
+
/** 图标 */
|
|
8
|
+
icon?: string | DefineComponent;
|
|
9
|
+
/** 导航标题 */
|
|
10
|
+
title: string;
|
|
11
|
+
/** 导航路径 */
|
|
12
|
+
path: string;
|
|
13
|
+
/**
|
|
14
|
+
* 应用描述;仅根级导航项有效,且仅 UDualNav 右栏顶部展示
|
|
15
|
+
* @see DualNavRootItem
|
|
16
|
+
*/
|
|
17
|
+
description?: string;
|
|
18
|
+
/** 是否禁用 */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** 子导航 */
|
|
21
|
+
children?: NavItem[];
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
}
|
|
24
|
+
/** 导航组件属性 */
|
|
25
|
+
interface NavProps {
|
|
26
|
+
/** 当前路径 */
|
|
27
|
+
currentPath?: string;
|
|
28
|
+
/** 是否折叠 */
|
|
29
|
+
collapsed?: boolean;
|
|
30
|
+
/** 导航列表 */
|
|
31
|
+
menus?: NavItem[];
|
|
32
|
+
}
|
|
33
|
+
/** 导航组件定义的事件 */
|
|
34
|
+
interface NavEmits {
|
|
35
|
+
(e: 'item-click', item: NavItem): void;
|
|
36
|
+
}
|
|
37
|
+
/** 导航组件暴露的属性和方法(组件内部使用) */
|
|
38
|
+
interface _NavExposed {
|
|
39
|
+
/** 展开所有含子级的导航项 */
|
|
40
|
+
expandAll: () => void;
|
|
41
|
+
/** 折叠所有导航项 */
|
|
42
|
+
collapseAll: () => void;
|
|
43
|
+
}
|
|
44
|
+
/** 导航组件暴露的属性和方法(组件外部使用, 引用的值会被自动解构) */
|
|
45
|
+
type NavExposed = DeconstructValue<_NavExposed>;
|
|
46
|
+
//#endregion
|
|
47
|
+
export { NavEmits, NavExposed, NavItem, NavProps, _NavExposed };
|
|
48
|
+
//# sourceMappingURL=nav.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veltra/desktop",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
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.
|
|
72
|
-
"@veltra/directives": "1.2.
|
|
73
|
-
"@veltra/icons": "1.2.
|
|
74
|
-
"@veltra/styles": "1.2.
|
|
75
|
-
"@veltra/utils": "1.2.
|
|
71
|
+
"@veltra/compositions": "1.2.5",
|
|
72
|
+
"@veltra/directives": "1.2.5",
|
|
73
|
+
"@veltra/icons": "1.2.5",
|
|
74
|
+
"@veltra/styles": "1.2.5",
|
|
75
|
+
"@veltra/utils": "1.2.5",
|
|
76
76
|
"vue": ">=3.5.0"
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
<template #content>
|
|
34
34
|
<u-scroll tag="ul" :class="cls.e('options')" ref="scrollRef">
|
|
35
35
|
<li
|
|
36
|
-
v-if="
|
|
36
|
+
v-if="displayCachedSuggestion"
|
|
37
37
|
:class="[optionClass, bem.is('active', isCachedActive)]"
|
|
38
|
-
@click="handleSelectCachedOption(
|
|
38
|
+
@click="handleSelectCachedOption(displayCachedSuggestion)"
|
|
39
39
|
v-ripple="cls.e('ripple')"
|
|
40
|
-
:data-key="
|
|
41
|
-
:key="
|
|
40
|
+
:data-key="displayCachedSuggestion"
|
|
41
|
+
:key="displayCachedSuggestion"
|
|
42
42
|
>
|
|
43
|
-
<slot v-bind="{ option:
|
|
44
|
-
{{
|
|
43
|
+
<slot v-bind="{ option: displayCachedSuggestion, index: -1 }">
|
|
44
|
+
{{ displayCachedSuggestion }}
|
|
45
45
|
</slot>
|
|
46
46
|
</li>
|
|
47
47
|
|
|
@@ -90,6 +90,7 @@ defineOptions({ name: 'AutoComplete', inheritAttrs: false })
|
|
|
90
90
|
const props = withDefaults(defineProps<AutoCompleteProps>(), {
|
|
91
91
|
placeholder: '请输入',
|
|
92
92
|
clearable: true,
|
|
93
|
+
allowCustom: true,
|
|
93
94
|
disabled: undefined,
|
|
94
95
|
readonly: undefined
|
|
95
96
|
})
|
|
@@ -129,10 +130,15 @@ watch(scrollRef, (scroll) => {
|
|
|
129
130
|
|
|
130
131
|
const { suggestions, appendedSuggestions, cachedSuggestion } = useSuggestions({ props, model })
|
|
131
132
|
|
|
133
|
+
const displayCachedSuggestion = computed(() => {
|
|
134
|
+
if (!props.allowCustom) return undefined
|
|
135
|
+
return cachedSuggestion.value
|
|
136
|
+
})
|
|
137
|
+
|
|
132
138
|
const keyboardOptions = computed(() => {
|
|
133
139
|
const currentSuggestions = suggestions.value
|
|
134
|
-
return
|
|
135
|
-
? [
|
|
140
|
+
return displayCachedSuggestion.value
|
|
141
|
+
? [displayCachedSuggestion.value, ...currentSuggestions]
|
|
136
142
|
: currentSuggestions
|
|
137
143
|
})
|
|
138
144
|
|
|
@@ -148,7 +154,7 @@ const { point, handleKeydown } = useKeyboard({
|
|
|
148
154
|
return 0
|
|
149
155
|
},
|
|
150
156
|
onSelect: (option, index) => {
|
|
151
|
-
if (
|
|
157
|
+
if (displayCachedSuggestion.value && index === 0) {
|
|
152
158
|
handleSelectCachedOption(option)
|
|
153
159
|
return
|
|
154
160
|
}
|
|
@@ -156,18 +162,18 @@ const { point, handleKeydown } = useKeyboard({
|
|
|
156
162
|
}
|
|
157
163
|
})
|
|
158
164
|
|
|
159
|
-
const isCachedActive = computed(() => !!
|
|
165
|
+
const isCachedActive = computed(() => !!displayCachedSuggestion.value && point.value === 0)
|
|
160
166
|
|
|
161
167
|
const isActiveOption = (index: number) => {
|
|
162
|
-
const offset =
|
|
168
|
+
const offset = displayCachedSuggestion.value ? 1 : 0
|
|
163
169
|
return point.value === index + offset
|
|
164
170
|
}
|
|
165
171
|
|
|
166
172
|
const handleInputKeydown = (event: KeyboardEvent) => {
|
|
167
|
-
if (!dropdownVisible.value && event.key === 'Enter' &&
|
|
173
|
+
if (!dropdownVisible.value && event.key === 'Enter' && displayCachedSuggestion.value) {
|
|
168
174
|
event.preventDefault()
|
|
169
175
|
event.stopPropagation()
|
|
170
|
-
handleSelectCachedOption(
|
|
176
|
+
handleSelectCachedOption(displayCachedSuggestion.value)
|
|
171
177
|
return
|
|
172
178
|
}
|
|
173
179
|
handleKeydown(event)
|
|
@@ -202,4 +208,9 @@ const handleSelectCachedOption = (cachedOption: string) => {
|
|
|
202
208
|
appendedSuggestions.value = [...appendedSuggestions.value, cachedOption]
|
|
203
209
|
dropdownRef.value?.close()
|
|
204
210
|
}
|
|
211
|
+
|
|
212
|
+
defineExpose<_AutoCompleteExposed>({
|
|
213
|
+
open: () => dropdownRef.value?.open(),
|
|
214
|
+
close: () => dropdownRef.value?.close()
|
|
215
|
+
})
|
|
205
216
|
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<aside :class="cls.e('form')" v-if="state.visible &&
|
|
2
|
+
<aside :class="cls.e('form')" v-if="state.visible && formModel">
|
|
3
3
|
<header :class="cls.e('form-header')">
|
|
4
4
|
<span :class="[cls.e('form-icon'), bem.is(headerInfo.tone)]">
|
|
5
5
|
<u-icon>
|
|
@@ -27,9 +27,8 @@
|
|
|
27
27
|
<transition name="fade" appear mode="out-in">
|
|
28
28
|
<u-form
|
|
29
29
|
ref="formComponentRef"
|
|
30
|
-
:model="
|
|
30
|
+
:model="formModel"
|
|
31
31
|
:readonly="props.readonly"
|
|
32
|
-
@keydown="handleFormKeydown"
|
|
33
32
|
:label-width="props.labelWidth"
|
|
34
33
|
>
|
|
35
34
|
<slot
|
|
@@ -45,21 +44,25 @@
|
|
|
45
44
|
</u-scroll>
|
|
46
45
|
|
|
47
46
|
<footer :class="cls.e('form-footer')">
|
|
48
|
-
<span :class="cls.e('form-hint')" v-if="
|
|
49
|
-
|
|
47
|
+
<span :class="cls.e('form-hint')" v-if="props.readonly">只读模式</span>
|
|
48
|
+
<span :class="cls.e('form-hint')" v-else-if="isQuickUpdate">
|
|
49
|
+
实时编辑
|
|
50
|
+
<span :class="{ [bem.is('concealed')]: !focused }"> · <u-kbd>Esc</u-kbd> 关闭</span>
|
|
50
51
|
</span>
|
|
51
|
-
<span :class="cls.e('form-hint')" v-else
|
|
52
|
-
<
|
|
52
|
+
<span :class="cls.e('form-hint')" v-else>
|
|
53
|
+
<span :class="{ [bem.is('concealed')]: !focused }">
|
|
54
|
+
<u-kbd>Ctrl + S</u-kbd> 保存 · <u-kbd>Esc</u-kbd> 关闭
|
|
55
|
+
</span>
|
|
53
56
|
</span>
|
|
54
|
-
<span :class="cls.e('form-hint')" v-else>只读模式</span>
|
|
55
57
|
|
|
56
58
|
<div :class="cls.e('form-actions')">
|
|
57
59
|
<u-button text :loading="state.loading" @click="handleClose"> 取消 </u-button>
|
|
58
60
|
<u-button
|
|
59
|
-
v-if="
|
|
61
|
+
v-if="
|
|
62
|
+
!props.readonly && ((isNormal && (creatable || updatable)) || (isQuick && creatable))
|
|
63
|
+
"
|
|
60
64
|
:type="state.type === 'create' ? 'success' : 'primary'"
|
|
61
65
|
:loading="state.loading"
|
|
62
|
-
:disabled="!state.dataUpdated"
|
|
63
66
|
@click="handleSave"
|
|
64
67
|
>
|
|
65
68
|
保存
|
|
@@ -84,6 +87,8 @@ import { BatchEditDIKey } from './di'
|
|
|
84
87
|
|
|
85
88
|
defineOptions({ name: 'BatchEditForm' })
|
|
86
89
|
|
|
90
|
+
const batchEditCtx = inject(BatchEditDIKey)!
|
|
91
|
+
|
|
87
92
|
const {
|
|
88
93
|
cls,
|
|
89
94
|
props,
|
|
@@ -93,7 +98,9 @@ const {
|
|
|
93
98
|
handleClose,
|
|
94
99
|
staticFeatures,
|
|
95
100
|
dynamicFeatures
|
|
96
|
-
} =
|
|
101
|
+
} = batchEditCtx
|
|
102
|
+
|
|
103
|
+
const focused = toRef(batchEditCtx, 'focused')
|
|
97
104
|
|
|
98
105
|
const formComponentRef = shallowRef<FormExposed>()
|
|
99
106
|
|
|
@@ -118,6 +125,17 @@ const updatable = computed(() => {
|
|
|
118
125
|
)
|
|
119
126
|
})
|
|
120
127
|
|
|
128
|
+
const isQuick = computed(() => props.mode === 'quick')
|
|
129
|
+
const isNormal = computed(() => props.mode !== 'quick')
|
|
130
|
+
const isQuickUpdate = computed(() => isQuick.value && state.type === 'update')
|
|
131
|
+
|
|
132
|
+
const formModel = computed(() => {
|
|
133
|
+
if (isQuick.value && state.type === 'update' && state.row) {
|
|
134
|
+
return state.row.data
|
|
135
|
+
}
|
|
136
|
+
return props.model
|
|
137
|
+
})
|
|
138
|
+
|
|
121
139
|
interface HeaderInfo {
|
|
122
140
|
icon: Component
|
|
123
141
|
title: string
|
|
@@ -157,11 +175,4 @@ const headerInfo = computed<HeaderInfo>(() => {
|
|
|
157
175
|
const bodyKey = computed(() => {
|
|
158
176
|
return `${state.type}-${state.row?.uid ?? 'create'}-${state.parentRow?.uid ?? 'root'}`
|
|
159
177
|
})
|
|
160
|
-
|
|
161
|
-
function handleFormKeydown(e: KeyboardEvent) {
|
|
162
|
-
if ((e.metaKey || e.ctrlKey) && e.key === 'Enter') {
|
|
163
|
-
e.preventDefault()
|
|
164
|
-
handleSave()
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
178
|
</script>
|
|
@@ -115,7 +115,9 @@ const tableProps = computed(() => {
|
|
|
115
115
|
'readonly',
|
|
116
116
|
'deleteMethod',
|
|
117
117
|
'saveMethod',
|
|
118
|
-
'features'
|
|
118
|
+
'features',
|
|
119
|
+
'mode',
|
|
120
|
+
'beforeCreate'
|
|
119
121
|
])
|
|
120
122
|
})
|
|
121
123
|
|
|
@@ -141,6 +143,9 @@ const columns = computed(() => {
|
|
|
141
143
|
|
|
142
144
|
function handleUpdateCurrentRow(row?: TableRow) {
|
|
143
145
|
if (allowed('update', row)) {
|
|
146
|
+
if (row) {
|
|
147
|
+
state.type = 'update'
|
|
148
|
+
}
|
|
144
149
|
state.row = row
|
|
145
150
|
state.depth = row?.depth
|
|
146
151
|
}
|
|
@@ -5,15 +5,16 @@
|
|
|
5
5
|
rows="minmax(0, 1fr)"
|
|
6
6
|
gap="8px"
|
|
7
7
|
resizable
|
|
8
|
-
@keydown="handleKeydown"
|
|
9
8
|
tabindex="-1"
|
|
9
|
+
@focusin="handleFocusIn"
|
|
10
|
+
@focusout="handleFocusOut"
|
|
11
|
+
@keydown.capture="handleKeydown"
|
|
10
12
|
>
|
|
11
13
|
<!-- 编辑列表 -->
|
|
12
|
-
<BatchEditList :slots="slots" />
|
|
14
|
+
<BatchEditList :slots="slots" ref="tableRef" />
|
|
13
15
|
|
|
14
16
|
<!-- 编辑表单 -->
|
|
15
17
|
<BatchEditForm ref="formRef" v-slot="scoped">
|
|
16
|
-
<!-- @vue-ignore -->
|
|
17
18
|
<slot name="form" v-bind="scoped" />
|
|
18
19
|
</BatchEditForm>
|
|
19
20
|
</u-layout>
|
|
@@ -25,7 +26,6 @@ import { computed, inject, provide, shallowRef, watch } from 'vue'
|
|
|
25
26
|
|
|
26
27
|
import type {
|
|
27
28
|
BatchEditEmits,
|
|
28
|
-
BatchEditFeature,
|
|
29
29
|
BatchEditProps,
|
|
30
30
|
TableColumnSlotsScope,
|
|
31
31
|
TableExposed,
|
|
@@ -38,6 +38,7 @@ import BatchEditForm from './batch-edit-form.vue'
|
|
|
38
38
|
import BatchEditList from './batch-edit-list.vue'
|
|
39
39
|
import { BatchEditDIKey } from './di'
|
|
40
40
|
import { useEdit } from './use-edit'
|
|
41
|
+
import { useFeatures } from './use-features'
|
|
41
42
|
|
|
42
43
|
defineOptions({ name: 'BatchEdit' })
|
|
43
44
|
|
|
@@ -48,58 +49,9 @@ const props = withDefaults(defineProps<BatchEditProps>(), {
|
|
|
48
49
|
|
|
49
50
|
const emit = defineEmits<BatchEditEmits>()
|
|
50
51
|
|
|
51
|
-
const staticFeatures = computed(() => {
|
|
52
|
-
const { features } = props
|
|
53
|
-
|
|
54
|
-
if (Array.isArray(features)) {
|
|
55
|
-
return new Set(features)
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const defaultFeatures = new Set<BatchEditFeature>(['create', 'delete', 'update', 'createChild'])
|
|
59
|
-
|
|
60
|
-
if (!features) {
|
|
61
|
-
return defaultFeatures
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// 函数与 false 的特性视为关闭;显式 true 视为开启(即便不在默认集合内)
|
|
65
|
-
Object.entries(features).forEach(([key, value]) => {
|
|
66
|
-
const k = key as BatchEditFeature
|
|
67
|
-
if (typeof value === 'function' || value === false) {
|
|
68
|
-
defaultFeatures.delete(k)
|
|
69
|
-
} else if (value === true) {
|
|
70
|
-
defaultFeatures.add(k)
|
|
71
|
-
}
|
|
72
|
-
})
|
|
73
|
-
return defaultFeatures
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
const dynamicFeatures = computed<
|
|
77
|
-
Record<BatchEditFeature, ((row?: TableRow) => boolean) | undefined>
|
|
78
|
-
>(() => {
|
|
79
|
-
const { features } = props
|
|
80
|
-
if (!Array.isArray(features) && typeof features === 'object') {
|
|
81
|
-
const ret = Object.entries(features)
|
|
82
|
-
.filter(([_, value]) => {
|
|
83
|
-
return typeof value === 'function'
|
|
84
|
-
})
|
|
85
|
-
.reduce(
|
|
86
|
-
(acc, [key, value]) => {
|
|
87
|
-
acc[key] = value
|
|
88
|
-
return acc
|
|
89
|
-
},
|
|
90
|
-
{} as Record<BatchEditFeature, (row?: TableRow) => boolean>
|
|
91
|
-
)
|
|
92
|
-
return ret
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
return {} as Record<BatchEditFeature, ((row?: TableRow) => boolean) | undefined>
|
|
96
|
-
})
|
|
97
|
-
|
|
98
52
|
const slots = defineSlots<
|
|
99
53
|
{
|
|
100
54
|
form?: (props: {
|
|
101
|
-
/** 表单数据 */
|
|
102
|
-
data: Record<string, any> | undefined
|
|
103
55
|
/** 当前编辑的层级 */
|
|
104
56
|
depth?: number
|
|
105
57
|
/** 当前编辑的行 */
|
|
@@ -118,12 +70,24 @@ const cls = bem('batch-edit')
|
|
|
118
70
|
|
|
119
71
|
const tableRef = shallowRef<TableExposed>()
|
|
120
72
|
const formRef = shallowRef<FormExposed>()
|
|
73
|
+
const focused = shallowRef(false)
|
|
121
74
|
|
|
122
|
-
const
|
|
75
|
+
const { staticFeatures, dynamicFeatures } = useFeatures({ props })
|
|
123
76
|
|
|
124
|
-
const
|
|
77
|
+
const editCtx = useEdit({ props, emit, formRef })
|
|
125
78
|
|
|
126
|
-
|
|
79
|
+
const { state, handleClose, handleSave } = editCtx
|
|
80
|
+
|
|
81
|
+
provide(BatchEditDIKey, {
|
|
82
|
+
cls,
|
|
83
|
+
props,
|
|
84
|
+
emit,
|
|
85
|
+
tableRef,
|
|
86
|
+
staticFeatures,
|
|
87
|
+
dynamicFeatures,
|
|
88
|
+
focused,
|
|
89
|
+
...editCtx
|
|
90
|
+
})
|
|
127
91
|
|
|
128
92
|
const dialogCtx = inject(DialogDIKey, undefined)
|
|
129
93
|
|
|
@@ -136,14 +100,24 @@ const cols = computed(() => {
|
|
|
136
100
|
return !!state.row || state.visible ? props.cols : undefined
|
|
137
101
|
})
|
|
138
102
|
|
|
103
|
+
function handleFocusIn() {
|
|
104
|
+
focused.value = true
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function handleFocusOut(e: FocusEvent) {
|
|
108
|
+
const root = e.currentTarget as HTMLElement
|
|
109
|
+
if (!root.contains(e.relatedTarget as Node | null)) {
|
|
110
|
+
focused.value = false
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
139
114
|
/**
|
|
140
|
-
*
|
|
141
|
-
* - Esc
|
|
142
|
-
* - ⌘/Ctrl + S
|
|
143
|
-
* - ⌘/Ctrl + Backspace 删除当前编辑行
|
|
144
|
-
* - ⌘/Ctrl + N 新增(仅在不在表单中时)
|
|
115
|
+
* 键盘快捷键(仅组件获焦时生效):
|
|
116
|
+
* - Esc 关闭表单
|
|
117
|
+
* - ⌘/Ctrl + S 保存(快速编辑模式下编辑行时除外)
|
|
145
118
|
*/
|
|
146
119
|
function handleKeydown(e: KeyboardEvent) {
|
|
120
|
+
if (!focused.value) return
|
|
147
121
|
if (props.readonly && e.key !== 'Escape') return
|
|
148
122
|
|
|
149
123
|
if (e.key === 'Escape') {
|
|
@@ -160,20 +134,9 @@ function handleKeydown(e: KeyboardEvent) {
|
|
|
160
134
|
const key = e.key.toLowerCase()
|
|
161
135
|
|
|
162
136
|
if (key === 's' && state.visible) {
|
|
137
|
+
if (props.mode === 'quick' && state.type === 'update') return
|
|
163
138
|
e.preventDefault()
|
|
164
139
|
handleSave()
|
|
165
|
-
return
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
if (e.key === 'Backspace' && state.row && state.type === 'update') {
|
|
169
|
-
e.preventDefault()
|
|
170
|
-
handleDelete(state.row)
|
|
171
|
-
return
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
if (key === 'n' && !state.visible) {
|
|
175
|
-
e.preventDefault()
|
|
176
|
-
handleCreate()
|
|
177
140
|
}
|
|
178
141
|
}
|
|
179
142
|
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BEM } from '@veltra/utils'
|
|
2
|
-
import type { ComputedRef, InjectionKey, ShallowRef } from 'vue'
|
|
2
|
+
import type { ComputedRef, InjectionKey, ShallowRef, Ref } from 'vue'
|
|
3
3
|
|
|
4
4
|
import type {
|
|
5
5
|
BatchEditEmits,
|
|
@@ -19,5 +19,7 @@ export const BatchEditDIKey: InjectionKey<
|
|
|
19
19
|
dynamicFeatures: ComputedRef<
|
|
20
20
|
Record<BatchEditFeature, ((row?: TableRow) => boolean) | undefined>
|
|
21
21
|
>
|
|
22
|
+
/** 组件或其子节点是否处于聚焦状态 */
|
|
23
|
+
focused: Ref<boolean>
|
|
22
24
|
} & EditReturned
|
|
23
25
|
> = Symbol('BatchEditDIKey')
|