@es-plus/vue3 1.4.0

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 (49) hide show
  1. package/README.md +1279 -0
  2. package/dist/es-plus.js +2922 -0
  3. package/dist/es-plus.js.map +1 -0
  4. package/dist/es-plus.umd.cjs +2 -0
  5. package/dist/es-plus.umd.cjs.map +1 -0
  6. package/dist/index.d.ts +3 -0
  7. package/dist/resolver.cjs +101 -0
  8. package/dist/resolver.d.ts +25 -0
  9. package/dist/resolver.mjs +78 -0
  10. package/dist/src/components/es-crud-page/index.d.ts +4 -0
  11. package/dist/src/components/es-crud-page/src/es-crud-page.vue.d.ts +78 -0
  12. package/dist/src/components/es-crud-page/src/types.d.ts +180 -0
  13. package/dist/src/components/es-dialog/index.d.ts +3 -0
  14. package/dist/src/components/es-dialog/src/component.vue.d.ts +60 -0
  15. package/dist/src/components/es-dialog/src/use-dialog.d.ts +16 -0
  16. package/dist/src/components/es-form/index.d.ts +3 -0
  17. package/dist/src/components/es-form/src/es-form.vue.d.ts +83 -0
  18. package/dist/src/components/es-table/index.d.ts +3 -0
  19. package/dist/src/components/es-table/src/column-item.vue.d.ts +82 -0
  20. package/dist/src/components/es-table/src/component.vue.d.ts +154 -0
  21. package/dist/src/components/es-table/src/engines/types.d.ts +25 -0
  22. package/dist/src/components/es-table/src/engines/use-column-adapter.d.ts +44 -0
  23. package/dist/src/components/es-table/src/engines/use-virtual-selection.d.ts +13 -0
  24. package/dist/src/components/es-table/src/engines/use-virtual-sort.d.ts +24 -0
  25. package/dist/src/components/es-table/src/engines/virtual-engine.vue.d.ts +63 -0
  26. package/dist/src/components/es-table/src/table-btns.vue.d.ts +19 -0
  27. package/dist/src/components/svg-icon/index.d.ts +3 -0
  28. package/dist/src/components/svg-icon/src/svg-icon.vue.d.ts +17 -0
  29. package/dist/src/composables/use-form-inputs.d.ts +12 -0
  30. package/dist/src/composables/use-form-layout.d.ts +51 -0
  31. package/dist/src/composables/use-form-request.d.ts +18 -0
  32. package/dist/src/composables/use-table-resize.d.ts +19 -0
  33. package/dist/src/composables/use-table-selection.d.ts +16 -0
  34. package/dist/src/config.d.ts +10 -0
  35. package/dist/src/index.d.ts +17 -0
  36. package/dist/src/resolver.d.ts +44 -0
  37. package/dist/src/style.d.ts +0 -0
  38. package/dist/src/types/index.d.ts +174 -0
  39. package/dist/src/utils/shared.d.ts +17 -0
  40. package/dist/style.css +1 -0
  41. package/package.json +90 -0
  42. package/schemas/README.md +83 -0
  43. package/schemas/api-params.schema.json +36 -0
  44. package/schemas/btn-config.schema.json +77 -0
  45. package/schemas/dialog-options.schema.json +149 -0
  46. package/schemas/form-item.schema.json +146 -0
  47. package/schemas/index.schema.json +71 -0
  48. package/schemas/table-column.schema.json +118 -0
  49. package/schemas/table-options.schema.json +141 -0
@@ -0,0 +1,82 @@
1
+ import { TableColumn } from '../../../types';
2
+
3
+ declare function __VLS_template(): Partial<Record<string, (_: {
4
+ row: any;
5
+ column: any;
6
+ scope: any;
7
+ prop?: string;
8
+ key?: string;
9
+ label?: string;
10
+ labelKey?: string;
11
+ width?: number | string;
12
+ minWidth?: number | string;
13
+ align?: string;
14
+ fixed?: boolean | string;
15
+ formatter?: (row: Record<string, unknown>) => string;
16
+ render?: (h: import('vue').RenderFunction, ctx: {
17
+ row: Record<string, unknown>;
18
+ value: unknown;
19
+ index: number;
20
+ }) => import('vue').VNode | string;
21
+ scopedSlots?: {
22
+ customRender?: string;
23
+ };
24
+ groups?: TableColumn[];
25
+ ellipsis?: boolean;
26
+ hidCol?: boolean;
27
+ btns?: Array<{
28
+ name: string;
29
+ type?: string;
30
+ clickEvent?: (row: Record<string, unknown>) => void;
31
+ }>;
32
+ }) => any>> & Partial<Record<string, (_: {
33
+ row: any;
34
+ column: any;
35
+ scope: any;
36
+ prop?: string;
37
+ key?: string;
38
+ label?: string;
39
+ labelKey?: string;
40
+ width?: number | string;
41
+ minWidth?: number | string;
42
+ align?: string;
43
+ fixed?: boolean | string;
44
+ formatter?: (row: Record<string, unknown>) => string;
45
+ render?: (h: import('vue').RenderFunction, ctx: {
46
+ row: Record<string, unknown>;
47
+ value: unknown;
48
+ index: number;
49
+ }) => import('vue').VNode | string;
50
+ scopedSlots?: {
51
+ customRender?: string;
52
+ };
53
+ groups?: TableColumn[];
54
+ ellipsis?: boolean;
55
+ hidCol?: boolean;
56
+ btns?: Array<{
57
+ name: string;
58
+ type?: string;
59
+ clickEvent?: (row: Record<string, unknown>) => void;
60
+ }>;
61
+ }) => any>>;
62
+ declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
63
+ cols: TableColumn;
64
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
65
+ cols: TableColumn;
66
+ }>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
67
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
68
+ export default _default;
69
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
70
+ type __VLS_TypePropsToRuntimeProps<T> = {
71
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
72
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
73
+ } : {
74
+ type: import('vue').PropType<T[K]>;
75
+ required: true;
76
+ };
77
+ };
78
+ type __VLS_WithTemplateSlots<T, S> = T & {
79
+ new (): {
80
+ $slots: S;
81
+ };
82
+ };
@@ -0,0 +1,154 @@
1
+ import { TableColumn, PaginationConfig, TableOptions } from '../../../types';
2
+
3
+ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
4
+ initTabHeight?: number;
5
+ headBarClass?: string | Record<string, unknown>;
6
+ showHeaderBar?: boolean;
7
+ dataSource: Record<string, unknown>[];
8
+ columns: TableColumn[];
9
+ options?: TableOptions;
10
+ pagination?: PaginationConfig;
11
+ }>, {
12
+ initTabHeight: number;
13
+ showHeaderBar: boolean;
14
+ dataSource: () => any[];
15
+ columns: () => any[];
16
+ options: () => {
17
+ [key: string]: unknown;
18
+ multiSelect?: boolean;
19
+ expand?: boolean;
20
+ snIndex?: boolean;
21
+ loading?: boolean;
22
+ border?: boolean;
23
+ stripe?: boolean;
24
+ size?: "large" | "default" | "small";
25
+ headerCellStyle?: Record<string, unknown>;
26
+ highlightCurrentRow?: boolean;
27
+ cachePageSelection?: boolean;
28
+ heightType?: "auto" | "height" | "maxHeight";
29
+ tabHeight?: number | string;
30
+ isInitRun?: boolean;
31
+ actionUrl?: string;
32
+ apiParams?: import('../../..').ApiParams;
33
+ httpRequest?: (params: Record<string, unknown>) => Promise<unknown>;
34
+ listenToCallBack?: Record<string, (params: unknown) => unknown>;
35
+ configTableOut?: Record<string, string>;
36
+ entryQuery?: Record<string, unknown>;
37
+ configBtn?: import('../../..').BtnConfig[];
38
+ leftText?: string;
39
+ rowkey?: string;
40
+ height?: number | string;
41
+ virtual?: boolean;
42
+ engine?: "default" | "virtual";
43
+ rowHeight?: number;
44
+ estimatedRowHeight?: number;
45
+ overscanCount?: number;
46
+ rowClassName?: string | ((params: {
47
+ row: Record<string, unknown>;
48
+ rowIndex: number;
49
+ }) => string);
50
+ };
51
+ pagination: () => {};
52
+ }>>, {
53
+ httpRequestInstance: (model?: Record<string, unknown>) => Promise<unknown>;
54
+ getSelectionRows: () => Record<string, unknown>[];
55
+ clearSelection: () => any;
56
+ clearAllSelection: () => void;
57
+ refresh: () => any;
58
+ scrollToRow: (row: number) => void;
59
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
60
+ "update:dataSource": (data: Record<string, unknown>[]) => void;
61
+ "update:pagination": (pagination: PaginationConfig) => void;
62
+ "pagination-current-change": (pagination: PaginationConfig) => void;
63
+ "size-change": (pagination: PaginationConfig, size: number) => void;
64
+ "change-table-sort": (column: Record<string, unknown>) => void;
65
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
66
+ initTabHeight?: number;
67
+ headBarClass?: string | Record<string, unknown>;
68
+ showHeaderBar?: boolean;
69
+ dataSource: Record<string, unknown>[];
70
+ columns: TableColumn[];
71
+ options?: TableOptions;
72
+ pagination?: PaginationConfig;
73
+ }>, {
74
+ initTabHeight: number;
75
+ showHeaderBar: boolean;
76
+ dataSource: () => any[];
77
+ columns: () => any[];
78
+ options: () => {
79
+ [key: string]: unknown;
80
+ multiSelect?: boolean;
81
+ expand?: boolean;
82
+ snIndex?: boolean;
83
+ loading?: boolean;
84
+ border?: boolean;
85
+ stripe?: boolean;
86
+ size?: "large" | "default" | "small";
87
+ headerCellStyle?: Record<string, unknown>;
88
+ highlightCurrentRow?: boolean;
89
+ cachePageSelection?: boolean;
90
+ heightType?: "auto" | "height" | "maxHeight";
91
+ tabHeight?: number | string;
92
+ isInitRun?: boolean;
93
+ actionUrl?: string;
94
+ apiParams?: import('../../..').ApiParams;
95
+ httpRequest?: (params: Record<string, unknown>) => Promise<unknown>;
96
+ listenToCallBack?: Record<string, (params: unknown) => unknown>;
97
+ configTableOut?: Record<string, string>;
98
+ entryQuery?: Record<string, unknown>;
99
+ configBtn?: import('../../..').BtnConfig[];
100
+ leftText?: string;
101
+ rowkey?: string;
102
+ height?: number | string;
103
+ virtual?: boolean;
104
+ engine?: "default" | "virtual";
105
+ rowHeight?: number;
106
+ estimatedRowHeight?: number;
107
+ overscanCount?: number;
108
+ rowClassName?: string | ((params: {
109
+ row: Record<string, unknown>;
110
+ rowIndex: number;
111
+ }) => string);
112
+ };
113
+ pagination: () => {};
114
+ }>>> & Readonly<{
115
+ "onUpdate:dataSource"?: (data: Record<string, unknown>[]) => any;
116
+ "onUpdate:pagination"?: (pagination: PaginationConfig) => any;
117
+ "onPagination-current-change"?: (pagination: PaginationConfig) => any;
118
+ "onSize-change"?: (pagination: PaginationConfig, size: number) => any;
119
+ "onChange-table-sort"?: (column: Record<string, unknown>) => any;
120
+ }>, {
121
+ options: TableOptions;
122
+ columns: TableColumn[];
123
+ dataSource: Record<string, unknown>[];
124
+ initTabHeight: number;
125
+ showHeaderBar: boolean;
126
+ pagination: PaginationConfig;
127
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, Readonly<{
128
+ default?: () => any;
129
+ }> & {
130
+ default?: () => any;
131
+ }>;
132
+ export default _default;
133
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
134
+ type __VLS_TypePropsToRuntimeProps<T> = {
135
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
136
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
137
+ } : {
138
+ type: import('vue').PropType<T[K]>;
139
+ required: true;
140
+ };
141
+ };
142
+ type __VLS_WithDefaults<P, D> = {
143
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
144
+ default: D[K];
145
+ }> : P[K];
146
+ };
147
+ type __VLS_Prettify<T> = {
148
+ [K in keyof T]: T[K];
149
+ } & {};
150
+ type __VLS_WithTemplateSlots<T, S> = T & {
151
+ new (): {
152
+ $slots: S;
153
+ };
154
+ };
@@ -0,0 +1,25 @@
1
+ import { TableColumn, TableOptions } from '../../../../types';
2
+
3
+ export interface TableEngineProps {
4
+ columns: TableColumn[];
5
+ dataSource: Record<string, unknown>[];
6
+ tableHeight: number;
7
+ options: TableOptions;
8
+ parentSlots: Record<string, (...args: any[]) => any>;
9
+ }
10
+ export interface TableEngineEmits {
11
+ (e: 'sort-change', payload: {
12
+ column: any;
13
+ prop: string;
14
+ order: string;
15
+ }): void;
16
+ (e: 'selection-change', rows: Record<string, unknown>[]): void;
17
+ }
18
+ export interface TableEngineExposed {
19
+ getTableRef: () => unknown;
20
+ doLayout: () => void;
21
+ toggleRowSelection: (row: Record<string, unknown>, selected?: boolean) => void;
22
+ clearSelection: () => void;
23
+ getSelectedRows: () => Record<string, unknown>[];
24
+ scrollToRow: (row: number) => void;
25
+ }
@@ -0,0 +1,44 @@
1
+ import { Ref, Slots } from 'vue';
2
+ import { TableColumn } from '../../../../types';
3
+
4
+ export interface VirtualColumn {
5
+ key: string;
6
+ dataKey: string;
7
+ title: string;
8
+ width: number;
9
+ fixed?: true | 'left' | 'right';
10
+ sortable?: boolean;
11
+ align?: 'left' | 'center' | 'right';
12
+ cellRenderer?: (params: CellRendererParams) => any;
13
+ headerCellRenderer?: (params: HeaderCellRendererParams) => any;
14
+ }
15
+ interface CellRendererParams {
16
+ cellData: unknown;
17
+ column: VirtualColumn;
18
+ columnIndex: number;
19
+ rowData: Record<string, unknown>;
20
+ rowIndex: number;
21
+ }
22
+ interface HeaderCellRendererParams {
23
+ column: VirtualColumn;
24
+ columns: VirtualColumn[];
25
+ columnIndex: number;
26
+ headerIndex: number;
27
+ }
28
+ export interface ColumnAdapterOptions {
29
+ multiSelect?: boolean;
30
+ snIndex?: boolean;
31
+ expand?: boolean;
32
+ selectedKeys: Ref<Set<string>>;
33
+ allSelected: Ref<boolean>;
34
+ indeterminate: Ref<boolean>;
35
+ onSelectAll: (val: boolean) => void;
36
+ onSelectRow: (rowKey: string, val: boolean) => void;
37
+ rowkey: string;
38
+ parentSlots?: Slots;
39
+ t?: (key: string) => string;
40
+ expandedKeys?: Ref<Set<string>>;
41
+ onToggleExpand?: (rowKey: string) => void;
42
+ }
43
+ export declare function useColumnAdapter(columns: Ref<TableColumn[]>, options: ColumnAdapterOptions): Ref<VirtualColumn[]>;
44
+ export {};
@@ -0,0 +1,13 @@
1
+ import { Ref } from 'vue';
2
+
3
+ export declare function useVirtualSelection(dataSource: Ref<Record<string, unknown>[]>, rowkey: string): {
4
+ selectedKeys: Ref<Set<string> & Omit<Set<string>, keyof Set<any>>, Set<string> | (Set<string> & Omit<Set<string>, keyof Set<any>>)>;
5
+ allSelected: import('vue').ComputedRef<boolean>;
6
+ indeterminate: import('vue').ComputedRef<boolean>;
7
+ onSelectRow: (key: string, val: boolean) => void;
8
+ onSelectAll: (val: boolean) => void;
9
+ getSelectedRows: () => Record<string, unknown>[];
10
+ clearSelection: () => void;
11
+ toggleRowSelection: (row: Record<string, unknown>, selected?: boolean) => void;
12
+ restoreSelections: (keys: Set<string>) => void;
13
+ };
@@ -0,0 +1,24 @@
1
+ import { TableColumn } from '../../../../types';
2
+
3
+ export interface SortState {
4
+ key: string;
5
+ order: 'asc' | 'desc';
6
+ }
7
+ export declare function useVirtualSort(): {
8
+ sortState: import('vue').Ref<{
9
+ key: string;
10
+ order: "asc" | "desc";
11
+ }, SortState | {
12
+ key: string;
13
+ order: "asc" | "desc";
14
+ }>;
15
+ onColumnSort: ({ key, order }: {
16
+ key: string | number;
17
+ order: "asc" | "desc";
18
+ }) => void;
19
+ toSortChangePayload: (columns: TableColumn[]) => {
20
+ column: TableColumn;
21
+ prop: string;
22
+ order: string;
23
+ };
24
+ };
@@ -0,0 +1,63 @@
1
+ import { TableColumn, TableOptions } from '../../../../types';
2
+
3
+ declare function __VLS_template(): {
4
+ empty?(_: {}): any;
5
+ };
6
+ declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
7
+ columns: TableColumn[];
8
+ dataSource: Record<string, unknown>[];
9
+ tableHeight: number;
10
+ options: TableOptions;
11
+ parentSlots?: Record<string, (...args: any[]) => any>;
12
+ }>>, {
13
+ getTableRef: () => unknown;
14
+ doLayout: () => void;
15
+ toggleRowSelection: (row: Record<string, unknown>, selected?: boolean) => void;
16
+ clearSelection: () => void;
17
+ getSelectedRows: () => Record<string, unknown>[];
18
+ scrollToRow: (row: number) => void;
19
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
20
+ "sort-change": (payload: {
21
+ column: any;
22
+ prop: string;
23
+ order: string | null;
24
+ }) => void;
25
+ "selection-change": (rows: Record<string, unknown>[]) => void;
26
+ "row-click": (row: Record<string, unknown>, event: Event) => void;
27
+ "row-dblclick": (row: Record<string, unknown>, event: Event) => void;
28
+ "row-contextmenu": (row: Record<string, unknown>, event: Event) => void;
29
+ "expand-change": (row: Record<string, unknown>, expanded: boolean) => void;
30
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
31
+ columns: TableColumn[];
32
+ dataSource: Record<string, unknown>[];
33
+ tableHeight: number;
34
+ options: TableOptions;
35
+ parentSlots?: Record<string, (...args: any[]) => any>;
36
+ }>>> & Readonly<{
37
+ "onSort-change"?: (payload: {
38
+ column: any;
39
+ prop: string;
40
+ order: string | null;
41
+ }) => any;
42
+ "onSelection-change"?: (rows: Record<string, unknown>[]) => any;
43
+ "onRow-click"?: (row: Record<string, unknown>, event: Event) => any;
44
+ "onRow-dblclick"?: (row: Record<string, unknown>, event: Event) => any;
45
+ "onRow-contextmenu"?: (row: Record<string, unknown>, event: Event) => any;
46
+ "onExpand-change"?: (row: Record<string, unknown>, expanded: boolean) => any;
47
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
48
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
49
+ export default _default;
50
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
51
+ type __VLS_TypePropsToRuntimeProps<T> = {
52
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
53
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
54
+ } : {
55
+ type: import('vue').PropType<T[K]>;
56
+ required: true;
57
+ };
58
+ };
59
+ type __VLS_WithTemplateSlots<T, S> = T & {
60
+ new (): {
61
+ $slots: S;
62
+ };
63
+ };
@@ -0,0 +1,19 @@
1
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
2
+ leftText?: string;
3
+ btnConfig?: Array<Record<string, unknown>>;
4
+ instance?: Record<string, unknown>;
5
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
6
+ leftText?: string;
7
+ btnConfig?: Array<Record<string, unknown>>;
8
+ instance?: Record<string, unknown>;
9
+ }>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
10
+ export default _default;
11
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
12
+ type __VLS_TypePropsToRuntimeProps<T> = {
13
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
14
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
15
+ } : {
16
+ type: import('vue').PropType<T[K]>;
17
+ required: true;
18
+ };
19
+ };
@@ -0,0 +1,3 @@
1
+ import { default as SvgIcon } from './src/svg-icon.vue';
2
+
3
+ export default SvgIcon;
@@ -0,0 +1,17 @@
1
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
2
+ iconClass: string;
3
+ className?: string;
4
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
5
+ iconClass: string;
6
+ className?: string;
7
+ }>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
8
+ export default _default;
9
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
10
+ type __VLS_TypePropsToRuntimeProps<T> = {
11
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
12
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
13
+ } : {
14
+ type: import('vue').PropType<T[K]>;
15
+ required: true;
16
+ };
17
+ };
@@ -0,0 +1,12 @@
1
+ import { h } from 'vue';
2
+ import { FormItemOption } from '../types';
3
+
4
+ export declare const getNestedValue: (obj: Record<string, unknown>, path: string) => unknown;
5
+ export declare const setNestedValue: (obj: Record<string, unknown>, path: string, value: unknown) => void;
6
+ export declare function useFormInputs(): {
7
+ formInputComponents: (item: FormItemOption) => ((hFn: typeof h, model: Record<string, unknown>, { row }: {
8
+ row: FormItemOption;
9
+ }) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
10
+ [key: string]: any;
11
+ }>) | (() => any);
12
+ };
@@ -0,0 +1,51 @@
1
+ import { FormItemOption, LayoutFormProps } from '../types';
2
+
3
+ export declare function useFormLayout(props: {
4
+ layoutFormProps?: LayoutFormProps;
5
+ formItemList: FormItemOption[];
6
+ }): {
7
+ folded: import('vue').Ref<boolean, boolean>;
8
+ isBtnHidden: import('vue').ComputedRef<boolean>;
9
+ rowLayout: import('vue').ComputedRef<Record<string, unknown>>;
10
+ formLayout: import('vue').ComputedRef<{
11
+ isBtnHidden?: boolean;
12
+ minFoldRows?: number;
13
+ btnColSpan?: number;
14
+ labelBtnWidth?: string | number;
15
+ }>;
16
+ getSetOptionsStatus: import('vue').ComputedRef<boolean>;
17
+ getRowColsAlgorithm: import('vue').ComputedRef<{
18
+ columnRow: number[][];
19
+ rowNum: number;
20
+ columnNodeIndex: number[];
21
+ }>;
22
+ isFold: import('vue').ComputedRef<boolean>;
23
+ getBtnColSpan: import('vue').ComputedRef<number>;
24
+ formItem: import('vue').ComputedRef<{
25
+ isFold: boolean;
26
+ prop: string;
27
+ label: string;
28
+ labelKey?: string;
29
+ formtype?: "Input" | "Select" | "datePicker" | "timePicker" | "Slider" | "ColorPicker" | "Transfer" | "Cascader" | "Radio" | "Checkbox" | "Switch" | "Rate" | "Upload";
30
+ span?: number;
31
+ attrs?: Record<string, unknown>;
32
+ on?: Record<string, unknown>;
33
+ dataOptions?: Array<{
34
+ label: string;
35
+ value: unknown;
36
+ }>;
37
+ isHidden?: (model: Record<string, unknown>, item: FormItemOption, formProps: import('element-plus').FormProps) => boolean;
38
+ render?: (h: import('vue').RenderFunction, model: Record<string, unknown>, ctx: {
39
+ row: FormItemOption;
40
+ index: number;
41
+ }) => import('vue').VNode | string;
42
+ apiParams?: import('..').ApiParams;
43
+ isInitRun?: boolean;
44
+ callOptionListFormat?: (data: unknown[]) => unknown[];
45
+ httpRequest?: (params: Record<string, unknown>) => Promise<unknown>;
46
+ listenToCallBack?: Record<string, (params: unknown) => unknown>;
47
+ components?: Record<string, unknown>;
48
+ width?: number | string;
49
+ }[]>;
50
+ changeFolded: () => void;
51
+ };
@@ -0,0 +1,18 @@
1
+ import { FormItemOption, ApiParams } from '../types';
2
+
3
+ export interface RequestConfig {
4
+ httpRequest?: (params: Record<string, unknown>) => Promise<unknown>;
5
+ apiParams?: ApiParams;
6
+ success?: (res: Record<string, unknown>) => void;
7
+ fail?: (err: unknown) => void;
8
+ [key: string]: unknown;
9
+ }
10
+ export declare function useFormRequest(httpRequestGlobal?: (params: Record<string, unknown>) => Promise<unknown>): {
11
+ queryTableListMethod: (params: Record<string, unknown>, options?: RequestConfig, option?: FormItemOption) => void;
12
+ getEveryFormQueryField: (rowsList: FormItemOption[], fieldFieldOutput?: (defaults: Record<string, string>) => Record<string, string>) => Promise<{
13
+ prop: string;
14
+ listData: unknown[];
15
+ }[]>;
16
+ formatConfigOut: (row: Record<string, unknown>, keyList: string[], options?: Record<string, unknown>, fieldFieldOutput?: (defaults: Record<string, string>) => Record<string, string>) => Record<string, unknown>;
17
+ configFormField: (options?: Record<string, unknown>, fieldFieldOutput?: (defaults: Record<string, string>) => Record<string, string>) => Record<string, string>;
18
+ };
@@ -0,0 +1,19 @@
1
+ export declare function useTableResize(tableContainerRef: {
2
+ value: HTMLElement | null;
3
+ }, headBarRef: {
4
+ value: HTMLElement | null;
5
+ }, tbBtnRef: {
6
+ value: {
7
+ $el?: HTMLElement;
8
+ } | null;
9
+ }, paginationRef: {
10
+ value: HTMLElement | null;
11
+ }, options: {
12
+ heightType?: 'auto' | 'height';
13
+ tabHeight?: number | string;
14
+ }): {
15
+ tableHeight: import('vue').Ref<number, number>;
16
+ resizeObservers: () => void;
17
+ startObserver: () => void;
18
+ stopObserver: () => void;
19
+ };
@@ -0,0 +1,16 @@
1
+ export declare function useTableSelection(rowkey?: string): {
2
+ multipleSelection: import('vue').Ref<Record<string, unknown>[], Record<string, unknown>[]>;
3
+ selectionsByPage: import('vue').Ref<Record<number, Record<string, unknown>[]>, Record<number, Record<string, unknown>[]>>;
4
+ isInitChange: import('vue').Ref<boolean, boolean>;
5
+ handleSelectionChange: (val: Record<string, unknown>[], currentPage: number) => void;
6
+ handleSelectData: (dataList: Record<string, unknown>[], tableRef: {
7
+ toggleRowSelection?: (row: Record<string, unknown>, selected: boolean) => void;
8
+ }) => void;
9
+ clearAllSelection: (tableRef: {
10
+ clearSelection?: () => void;
11
+ }) => void;
12
+ initSelection: (dataList: Record<string, unknown>[], tableRef: {
13
+ toggleRowSelection?: (row: Record<string, unknown>, selected: boolean) => void;
14
+ clearSelection?: () => void;
15
+ } | null) => void;
16
+ };
@@ -0,0 +1,10 @@
1
+ export interface EsPlusGlobalConfig {
2
+ EsTable?: Record<string, unknown>;
3
+ EsForm?: Record<string, unknown>;
4
+ EsDialog?: Record<string, unknown>;
5
+ permission?: (value: string) => boolean;
6
+ t?: (key: string) => string;
7
+ [key: string]: unknown;
8
+ }
9
+ export declare function configureEsPlus(options: EsPlusGlobalConfig): void;
10
+ export declare function getGlobalConfig(): EsPlusGlobalConfig;
@@ -0,0 +1,17 @@
1
+ import { default as EsDialog } from './components/es-dialog';
2
+ import { default as useDialog } from './components/es-dialog/src/use-dialog';
3
+ import { default as EsForm } from './components/es-form';
4
+ import { default as EsTable } from './components/es-table';
5
+ import { default as EsCrudPage } from './components/es-crud-page';
6
+ import { default as SvgIcon } from './components/svg-icon';
7
+ import { configureEsPlus } from './config';
8
+
9
+ declare const install: (app: any, options?: Record<string, unknown>) => void;
10
+ export { EsDialog, EsForm, EsTable, EsCrudPage, SvgIcon, useDialog, configureEsPlus, install };
11
+ export type { CrudPageSchema, CrudAction, CrudBtnConfig, OperationColumnConfig, RowBtnConfig, RowBtnContext, CrudDialogConfig, DialogRenderContext, DialogBtnConfig, DialogActionContext } from './components/es-crud-page';
12
+ export type { FormItemOption, ApiParams, BtnConfig, LayoutFormProps, TableColumn, TableOptions, PaginationConfig, DialogOptions, EsFormInstance, EsTableInstance, EsPlusOptions } from './types';
13
+ declare const _default: {
14
+ version: string;
15
+ install: (app: any, options?: Record<string, unknown>) => void;
16
+ };
17
+ export default _default;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * EsPlusResolver for unplugin-vue-components
3
+ *
4
+ * 解决 es-plus 内部使用 Element Plus 组件但 ElementPlusResolver
5
+ * 无法扫描到第三方预编译包的样式注入问题。
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * import Components from 'unplugin-vue-components/vite'
10
+ * import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
11
+ * import { EsPlusResolver } from '@es-plus/vue3/resolver'
12
+ *
13
+ * export default defineConfig({
14
+ * plugins: [
15
+ * Components({
16
+ * resolvers: [ElementPlusResolver(), EsPlusResolver()]
17
+ * })
18
+ * ]
19
+ * })
20
+ * ```
21
+ */
22
+ export interface EsPlusResolverOptions {
23
+ /**
24
+ * 是否自动注入 es-plus 内部依赖的 Element Plus 组件样式
25
+ * @default true
26
+ */
27
+ importElementStyles?: boolean;
28
+ /**
29
+ * Element Plus 样式导入方式
30
+ * - 'css': 导入编译后的 CSS (element-plus/es/components/xxx/style/css)
31
+ * - 'sass': 导入 SASS 源文件 (element-plus/es/components/xxx/style/index)
32
+ * @default 'css'
33
+ */
34
+ importStyle?: 'css' | 'sass';
35
+ }
36
+ export declare function EsPlusResolver(options?: EsPlusResolverOptions): {
37
+ type: "component";
38
+ resolve(name: string): {
39
+ name: string;
40
+ from: string;
41
+ sideEffects: string[];
42
+ };
43
+ };
44
+ export default EsPlusResolver;
File without changes