easy-ep-ui 0.1.0 → 0.1.1

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 (43) hide show
  1. package/dist/easy-ep-ui.js +1 -1
  2. package/dist/style.css +1 -1
  3. package/es/components/ee-dict-select/src/index.vue.d.ts +2 -0
  4. package/es/components/ee-form-dialog/src/index.vue.d.ts +2 -0
  5. package/es/components/ee-form-table/src/components/FormDrawer.vue.d.ts +38 -0
  6. package/es/components/ee-form-table/src/components/SearchArea.vue.d.ts +39 -0
  7. package/es/components/ee-form-table/src/components/TableToolbar.vue.d.ts +42 -0
  8. package/es/components/ee-form-table/src/constants.d.ts +31 -0
  9. package/es/components/ee-form-table/src/hooks/useAuth.d.ts +14 -0
  10. package/es/components/ee-form-table/src/hooks/useCrud.d.ts +39 -0
  11. package/es/components/ee-form-table/src/hooks/useDict.d.ts +12 -0
  12. package/es/components/ee-form-table/src/hooks/useExport.d.ts +32 -0
  13. package/es/components/ee-form-table/src/hooks/useForm.d.ts +31 -0
  14. package/es/components/ee-form-table/src/hooks/usePagination.d.ts +22 -0
  15. package/es/components/ee-form-table/src/hooks/useSearch.d.ts +39 -0
  16. package/es/components/ee-form-table/src/hooks/useTable.d.ts +49 -0
  17. package/es/components/ee-form-table/src/index.vue.d.ts +1079 -534
  18. package/es/components/ee-form-table/types.d.ts +197 -0
  19. package/es/components/ee-search-bar/src/index.vue.d.ts +2 -0
  20. package/es/index.d.ts +2 -0
  21. package/es/index.mjs +1483 -332
  22. package/es/style.css +1 -1
  23. package/lib/components/ee-dict-select/src/index.vue.d.ts +2 -0
  24. package/lib/components/ee-form-dialog/src/index.vue.d.ts +2 -0
  25. package/lib/components/ee-form-table/src/components/FormDrawer.vue.d.ts +38 -0
  26. package/lib/components/ee-form-table/src/components/SearchArea.vue.d.ts +39 -0
  27. package/lib/components/ee-form-table/src/components/TableToolbar.vue.d.ts +42 -0
  28. package/lib/components/ee-form-table/src/constants.d.ts +31 -0
  29. package/lib/components/ee-form-table/src/hooks/useAuth.d.ts +14 -0
  30. package/lib/components/ee-form-table/src/hooks/useCrud.d.ts +39 -0
  31. package/lib/components/ee-form-table/src/hooks/useDict.d.ts +12 -0
  32. package/lib/components/ee-form-table/src/hooks/useExport.d.ts +32 -0
  33. package/lib/components/ee-form-table/src/hooks/useForm.d.ts +31 -0
  34. package/lib/components/ee-form-table/src/hooks/usePagination.d.ts +22 -0
  35. package/lib/components/ee-form-table/src/hooks/useSearch.d.ts +39 -0
  36. package/lib/components/ee-form-table/src/hooks/useTable.d.ts +49 -0
  37. package/lib/components/ee-form-table/src/index.vue.d.ts +1079 -534
  38. package/lib/components/ee-form-table/types.d.ts +197 -0
  39. package/lib/components/ee-search-bar/src/index.vue.d.ts +2 -0
  40. package/lib/index.cjs +1 -1
  41. package/lib/index.d.ts +2 -0
  42. package/lib/style.css +1 -1
  43. package/package.json +5 -4
@@ -0,0 +1,197 @@
1
+ /**
2
+ * ee-form-table 类型定义
3
+ *
4
+ * 包含组件所需的所有 TypeScript 接口与类型别名。
5
+ * 公共类型(DictOption、TableColumn、Pagination 等)从 packages/utils/types.ts 导入,
6
+ * 私有类型仅在 ee-form-table 内部使用。
7
+ */
8
+ /** 组件尺寸 */
9
+ export type ComponentSize = 'large' | 'default' | 'small';
10
+ /** 权限模式 */
11
+ export type AuthMode = 'hide' | 'disabled';
12
+ /** 对齐方式 */
13
+ export type AlignType = 'left' | 'center' | 'right';
14
+ /** 固定列方向 */
15
+ export type FixedType = 'left' | 'right';
16
+ /** 选择模式 */
17
+ export type SelectionType = 'multiple' | 'single';
18
+ /** 表单展示模式 */
19
+ export type DrawerMode = 'drawer' | 'dialog';
20
+ /** 导出模式 */
21
+ export type ExportMode = 'current' | 'all';
22
+ /** 搜索字段控件类型 */
23
+ export type SearchFieldType = 'input' | 'number' | 'select' | 'radio' | 'checkbox' | 'date' | 'date-range' | 'textarea';
24
+ /** Element Plus 按钮类型 */
25
+ export type ButtonType = 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'default';
26
+ export interface DictOption {
27
+ value: string | number;
28
+ label: string;
29
+ disabled?: boolean;
30
+ [key: string]: unknown;
31
+ }
32
+ export interface ColumnSearchItem {
33
+ enable: boolean;
34
+ type?: SearchFieldType;
35
+ placeholder?: string;
36
+ defaultValue?: unknown;
37
+ props?: Record<string, unknown>;
38
+ field?: string;
39
+ }
40
+ export interface TableColumn {
41
+ prop: string;
42
+ label: string;
43
+ width?: string | number;
44
+ minWidth?: string | number;
45
+ align?: AlignType;
46
+ fixed?: FixedType;
47
+ sortable?: boolean;
48
+ show?: boolean;
49
+ formatter?: (row: Record<string, unknown>, column: TableColumn, cellValue: unknown, index: number) => unknown;
50
+ dictKey?: string;
51
+ slotName?: string;
52
+ search?: ColumnSearchItem;
53
+ auth?: string;
54
+ children?: TableColumn[];
55
+ [key: string]: unknown;
56
+ }
57
+ export interface SearchConfig {
58
+ show?: boolean;
59
+ cols?: number;
60
+ maxRow?: number;
61
+ foldable?: boolean;
62
+ foldDefault?: boolean;
63
+ }
64
+ export interface PaginationConfig {
65
+ show?: boolean;
66
+ pageSize?: number;
67
+ pageSizes?: number[];
68
+ total?: number;
69
+ showTotal?: boolean;
70
+ layout?: string;
71
+ background?: boolean;
72
+ }
73
+ export interface ActionButton {
74
+ text: string;
75
+ icon?: string;
76
+ type?: ButtonType;
77
+ code?: string;
78
+ auth?: string;
79
+ show?: (row: Record<string, unknown>) => boolean;
80
+ handler: (row: Record<string, unknown>) => void;
81
+ }
82
+ export interface ActionConfig {
83
+ show?: boolean;
84
+ label?: string;
85
+ width?: string | number;
86
+ align?: AlignType;
87
+ showView?: boolean;
88
+ showEdit?: boolean;
89
+ showDelete?: boolean;
90
+ viewText?: string;
91
+ editText?: string;
92
+ deleteText?: string;
93
+ viewAuth?: string;
94
+ editAuth?: string;
95
+ deleteAuth?: string;
96
+ fixed?: FixedType;
97
+ confirmDelete?: boolean;
98
+ deleteConfirmTitle?: string;
99
+ deleteConfirmMessage?: string;
100
+ customButtons?: ActionButton[];
101
+ }
102
+ export interface ToolbarButton {
103
+ text: string;
104
+ icon?: string;
105
+ type?: string;
106
+ code?: string;
107
+ auth?: string;
108
+ handler: () => void;
109
+ }
110
+ export interface ToolbarConfig {
111
+ show?: boolean;
112
+ showAdd?: boolean;
113
+ showImport?: boolean;
114
+ showExport?: boolean;
115
+ showBatchDelete?: boolean;
116
+ addText?: string;
117
+ importText?: string;
118
+ exportText?: string;
119
+ batchDeleteText?: string;
120
+ addAuth?: string;
121
+ importAuth?: string;
122
+ exportAuth?: string;
123
+ batchDeleteAuth?: string;
124
+ customButtons?: ToolbarButton[];
125
+ }
126
+ export interface CrudApi {
127
+ list: (params: Record<string, unknown>) => Promise<{
128
+ data: Record<string, unknown>[];
129
+ total: number;
130
+ }>;
131
+ add?: (data: Record<string, unknown>) => Promise<unknown>;
132
+ edit?: (data: Record<string, unknown>) => Promise<unknown>;
133
+ delete?: (id: string | number) => Promise<unknown>;
134
+ batchDelete?: (ids: (string | number)[]) => Promise<unknown>;
135
+ }
136
+ export interface CrudConfig {
137
+ api: CrudApi;
138
+ baseParams?: Record<string, unknown>;
139
+ requestMethod?: 'GET' | 'POST';
140
+ requestInstance?: unknown;
141
+ }
142
+ export interface SelectionConfig {
143
+ show?: boolean;
144
+ type?: SelectionType;
145
+ disabledRow?: (row: Record<string, unknown>) => boolean;
146
+ reserveSelection?: boolean;
147
+ }
148
+ export interface ExportConfig {
149
+ mode?: ExportMode;
150
+ fileName?: string;
151
+ ignoreColumn?: string[];
152
+ }
153
+ export interface DrawerConfig {
154
+ mode?: DrawerMode;
155
+ width?: string | number;
156
+ fullscreen?: boolean;
157
+ draggable?: boolean;
158
+ closeOnReset?: boolean;
159
+ addTitle?: string;
160
+ editTitle?: string;
161
+ }
162
+ export interface ColumnSettingConfig {
163
+ show?: boolean;
164
+ storageKey?: string;
165
+ }
166
+ export interface AutoHeightConfig {
167
+ offset?: number;
168
+ }
169
+ export interface EeFormTableProps {
170
+ columns: TableColumn[];
171
+ data?: Record<string, unknown>[];
172
+ loading?: boolean;
173
+ searchConfig?: SearchConfig | boolean;
174
+ pagination?: PaginationConfig | boolean;
175
+ actionConfig?: ActionConfig | boolean;
176
+ toolbarConfig?: ToolbarConfig | boolean;
177
+ crudConfig?: CrudConfig;
178
+ selectionConfig?: SelectionConfig;
179
+ exportConfig?: ExportConfig;
180
+ drawerConfig?: DrawerConfig;
181
+ columnSetting?: ColumnSettingConfig;
182
+ autoHeight?: AutoHeightConfig | boolean;
183
+ dictMap?: Record<string, DictOption[]>;
184
+ authChecker?: (auth: string) => boolean;
185
+ authMode?: AuthMode;
186
+ emptyText?: string;
187
+ tableHeight?: string | number;
188
+ tableMaxHeight?: string | number;
189
+ size?: ComponentSize;
190
+ stripe?: boolean;
191
+ border?: boolean;
192
+ highlightCurrentRow?: boolean;
193
+ rowKey?: string;
194
+ }
195
+ export interface SearchParams {
196
+ [key: string]: unknown;
197
+ }
@@ -6,6 +6,7 @@ type __VLS_Props = {
6
6
  labelWidth?: string | number;
7
7
  collapsible?: boolean;
8
8
  collapsedCount?: number;
9
+ size?: 'large' | 'default' | 'small';
9
10
  };
10
11
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
11
12
  "update:modelValue": (val: Record<string, any>) => any;
@@ -16,6 +17,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
16
17
  onSearch?: ((val: Record<string, any>) => any) | undefined;
17
18
  onReset?: (() => any) | undefined;
18
19
  }>, {
20
+ size: "large" | "default" | "small";
19
21
  inline: boolean;
20
22
  labelWidth: string | number;
21
23
  collapsible: boolean;
package/es/index.d.ts CHANGED
@@ -5,6 +5,8 @@ import { default as EeSearchBar } from './components/ee-search-bar';
5
5
  import { default as EeFormDialog } from './components/ee-form-dialog';
6
6
  import { default as EeFormTable } from './components/ee-form-table';
7
7
  export type { DictOption, SearchField, TableColumn, FormField, Pagination, StatusMapping } from './utils/types';
8
+ export type { ColumnSearchItem, SearchConfig, PaginationConfig, ActionConfig, ActionButton, ToolbarConfig, ToolbarButton, CrudConfig, CrudApi, SelectionConfig, ExportConfig, DrawerConfig, ColumnSettingConfig, AutoHeightConfig, } from './components/ee-form-table/types';
9
+ export type { EeFormTableProps } from './components/ee-form-table/types';
8
10
  export declare function install(app: App): void;
9
11
  declare const EasyEpUI: {
10
12
  install: typeof install;