@qin-ui/element-plus-pro 1.0.8 → 1.1.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.
- package/AI-CONTEXT.md +49 -37
- package/LICENSE +9 -0
- package/api.json +44 -27
- package/bin/init-ai.mjs +0 -0
- package/es/component-provider/{index-Bmx9Q9Q-.js → index-BGGIWSkO.js} +2 -1
- package/es/component-provider/index-BGGIWSkO.js.map +1 -0
- package/es/component-provider/index.js +2 -1
- package/es/component-provider/index.js.map +1 -0
- package/es/components/component-provider/components/index.vue.d.ts +27 -0
- package/es/components/component-provider/components/index.vue.d.ts.map +1 -0
- package/es/components/component-provider/constants/index.d.ts +16 -0
- package/es/components/component-provider/constants/index.d.ts.map +1 -0
- package/es/components/component-provider/index.d.ts +4 -0
- package/es/components/component-provider/index.d.ts.map +1 -0
- package/es/components/component-provider/types/index.d.ts +35 -0
- package/es/components/component-provider/types/index.d.ts.map +1 -0
- package/es/components/form/components/BaseField/index.vue.d.ts +13 -0
- package/es/components/form/components/BaseField/index.vue.d.ts.map +1 -0
- package/es/components/form/components/BaseField/utils/index.d.ts +3 -0
- package/es/components/form/components/BaseField/utils/index.d.ts.map +1 -0
- package/es/components/form/components/BaseFormItem/index.vue.d.ts +9 -0
- package/es/components/form/components/BaseFormItem/index.vue.d.ts.map +1 -0
- package/es/components/form/components/ContainerFragment/index.vue.d.ts +23 -0
- package/es/components/form/components/ContainerFragment/index.vue.d.ts.map +1 -0
- package/es/components/form/components/GroupedFieldAttrs/index.vue.d.ts +31 -0
- package/es/components/form/components/GroupedFieldAttrs/index.vue.d.ts.map +1 -0
- package/es/components/form/components/PathProvider/index.vue.d.ts +24 -0
- package/es/components/form/components/PathProvider/index.vue.d.ts.map +1 -0
- package/es/components/form/components/ProForm/index.vue.d.ts +36 -0
- package/es/components/form/components/ProForm/index.vue.d.ts.map +1 -0
- package/es/components/form/components/SlotComponent/index.vue.d.ts +7 -0
- package/es/components/form/components/SlotComponent/index.vue.d.ts.map +1 -0
- package/es/components/form/components/index.d.ts +12 -0
- package/es/components/form/components/index.d.ts.map +1 -0
- package/es/components/form/constants/index.d.ts +67 -0
- package/es/components/form/constants/index.d.ts.map +1 -0
- package/es/components/form/hooks/index.d.ts +5 -0
- package/es/components/form/hooks/index.d.ts.map +1 -0
- package/es/components/form/hooks/useFields.d.ts +57 -0
- package/es/components/form/hooks/useFields.d.ts.map +1 -0
- package/es/components/form/hooks/useForm.d.ts +93 -0
- package/es/components/form/hooks/useForm.d.ts.map +1 -0
- package/es/components/form/hooks/useFormRef.d.ts +30 -0
- package/es/components/form/hooks/useFormRef.d.ts.map +1 -0
- package/es/components/form/index.d.ts +7 -0
- package/es/components/form/index.d.ts.map +1 -0
- package/es/components/form/types/index.d.ts +234 -0
- package/es/components/form/types/index.d.ts.map +1 -0
- package/es/components/table/components/ColumnControl.vue.d.ts +9 -0
- package/es/components/table/components/ColumnControl.vue.d.ts.map +1 -0
- package/es/components/table/components/DefaultSearchFormContainer.vue.d.ts +18 -0
- package/es/components/table/components/DefaultSearchFormContainer.vue.d.ts.map +1 -0
- package/es/components/table/components/DefaultTableContainer.vue.d.ts +18 -0
- package/es/components/table/components/DefaultTableContainer.vue.d.ts.map +1 -0
- package/es/components/table/components/ProTable.vue.d.ts +47 -0
- package/es/components/table/components/ProTable.vue.d.ts.map +1 -0
- package/es/components/table/components/SearchForm.vue.d.ts +48 -0
- package/es/components/table/components/SearchForm.vue.d.ts.map +1 -0
- package/es/components/table/components/SizeControl.vue.d.ts +12 -0
- package/es/components/table/components/SizeControl.vue.d.ts.map +1 -0
- package/es/components/table/components/TableColumnRenderer.vue.d.ts +17 -0
- package/es/components/table/components/TableColumnRenderer.vue.d.ts.map +1 -0
- package/es/components/table/components/icons/ColumnHeightOutlined.vue.d.ts +3 -0
- package/es/components/table/components/icons/ColumnHeightOutlined.vue.d.ts.map +1 -0
- package/es/components/table/components/icons/DownOutlined.vue.d.ts +3 -0
- package/es/components/table/components/icons/DownOutlined.vue.d.ts.map +1 -0
- package/es/components/table/components/icons/FilterOutlined.vue.d.ts +3 -0
- package/es/components/table/components/icons/FilterOutlined.vue.d.ts.map +1 -0
- package/es/components/table/components/index.d.ts +5 -0
- package/es/components/table/components/index.d.ts.map +1 -0
- package/es/components/table/index.d.ts +33 -0
- package/es/components/table/index.d.ts.map +1 -0
- package/es/components/table/types/index.d.ts +67 -0
- package/es/components/table/types/index.d.ts.map +1 -0
- package/es/components/table/useTable.d.ts +111 -0
- package/es/components/table/useTable.d.ts.map +1 -0
- package/es/element-plus-pro.css +10 -10
- package/es/form/{index-D8btGgqa.js → index-oI6LGSpA.js} +13 -7
- package/es/form/index-oI6LGSpA.js.map +1 -0
- package/es/form/index.js +4 -3
- package/es/form/index.js.map +1 -0
- package/es/index.d.ts +76 -1472
- package/es/index.d.ts.map +1 -0
- package/es/index.js +14 -23
- package/es/index.js.map +1 -0
- package/es/shared/core/index.d.ts +6 -0
- package/es/shared/core/index.d.ts.map +1 -0
- package/es/shared/ui/index.d.ts +12 -0
- package/es/shared/ui/index.d.ts.map +1 -0
- package/es/table/index.js +10 -10
- package/es/table/index.js.map +1 -0
- package/package.json +10 -11
- package/src/components/component-provider/components/index.vue +67 -0
- package/src/components/component-provider/constants/index.ts +209 -0
- package/src/components/component-provider/index.ts +6 -0
- package/src/components/component-provider/types/index.ts +64 -0
- package/src/components/form/components/BaseField/index.vue +181 -0
- package/src/components/form/components/BaseField/utils/index.ts +15 -0
- package/src/components/form/components/BaseFormItem/index.vue +170 -0
- package/src/components/form/components/ContainerFragment/index.vue +24 -0
- package/src/components/form/components/GroupedFieldAttrs/index.vue +115 -0
- package/src/components/form/components/PathProvider/index.vue +19 -0
- package/src/components/form/components/ProForm/index.vue +106 -0
- package/src/components/form/components/SlotComponent/index.vue +26 -0
- package/src/components/form/components/index.ts +15 -0
- package/src/components/form/constants/index.ts +116 -0
- package/src/components/form/hooks/index.ts +5 -0
- package/src/components/form/hooks/useFields.ts +67 -0
- package/src/components/form/hooks/useForm.ts +110 -0
- package/src/components/form/hooks/useFormRef.ts +35 -0
- package/src/components/form/index.ts +29 -0
- package/src/components/form/types/index.ts +300 -0
- package/src/components/table/components/ColumnControl.vue +136 -0
- package/src/components/table/components/DefaultSearchFormContainer.vue +14 -0
- package/src/components/table/components/DefaultTableContainer.vue +14 -0
- package/src/components/table/components/ProTable.vue +420 -0
- package/src/components/table/components/SearchForm.vue +302 -0
- package/src/components/table/components/SizeControl.vue +55 -0
- package/src/components/table/components/TableColumnRenderer.vue +71 -0
- package/src/components/table/components/icons/ColumnHeightOutlined.vue +4 -0
- package/src/components/table/components/icons/DownOutlined.vue +4 -0
- package/src/components/table/components/icons/FilterOutlined.vue +4 -0
- package/src/components/table/components/index.ts +4 -0
- package/src/components/table/index.ts +38 -0
- package/src/components/table/types/index.ts +77 -0
- package/src/components/table/useTable.ts +144 -0
- package/src/index.ts +81 -0
- package/src/shared/core/index.ts +38 -0
- package/src/shared/ui/index.ts +106 -0
- package/es/core/index-C0Pbv44C.js +0 -360
- package/es/vendor/utils/lodash-es-p6jau26B.js +0 -1120
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColumnControl.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/table/components/ColumnControl.vue"],"names":[],"mappings":"AAkJA,OAAO,KAAK,EAAU,OAAO,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAGzC,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CAAC;;AA2PF,wBAOG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: {
|
|
4
|
+
default?(_: {}): any;
|
|
5
|
+
};
|
|
6
|
+
refs: {};
|
|
7
|
+
rootEl: HTMLDivElement;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
10
|
+
declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
11
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=DefaultSearchFormContainer.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultSearchFormContainer.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/table/components/DefaultSearchFormContainer.vue"],"names":[],"mappings":"AAkBA,iBAAS,cAAc;WA2BT,OAAO,IAA6B;;yBAVrB,GAAG;;;;EAe/B;AAOD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,0RAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAEpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: {
|
|
4
|
+
default?(_: {}): any;
|
|
5
|
+
};
|
|
6
|
+
refs: {};
|
|
7
|
+
rootEl: HTMLDivElement;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
10
|
+
declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
11
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=DefaultTableContainer.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultTableContainer.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/table/components/DefaultTableContainer.vue"],"names":[],"mappings":"AAkBA,iBAAS,cAAc;WA2BT,OAAO,IAA6B;;yBAVrB,GAAG;;;;EAe/B;AAOD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,0RAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAEpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { PaginationProps, TableProps } from '../../../shared/ui';
|
|
2
|
+
import { ContainerComponent } from '../../form/types';
|
|
3
|
+
import { SearchFormProps } from './SearchForm.vue';
|
|
4
|
+
import { Table } from '../useTable';
|
|
5
|
+
import { Columns } from '../types';
|
|
6
|
+
declare const _default: <T extends Table<any> = Table>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
7
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
8
|
+
readonly "onUpdate:size"?: ((value: "" | "default" | "large" | "small" | undefined) => any) | undefined;
|
|
9
|
+
readonly "onUpdate:loading"?: ((value: boolean) => any) | undefined;
|
|
10
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:size" | "onUpdate:loading"> & ({
|
|
11
|
+
size?: TableProps["size"];
|
|
12
|
+
loading?: boolean;
|
|
13
|
+
} & {
|
|
14
|
+
table?: T;
|
|
15
|
+
search?: () => Promise<unknown>;
|
|
16
|
+
addIndexColumn?: boolean;
|
|
17
|
+
immediateSearch?: boolean;
|
|
18
|
+
control?: boolean | Partial<{
|
|
19
|
+
sizeControl: boolean;
|
|
20
|
+
columnControl: boolean;
|
|
21
|
+
}>;
|
|
22
|
+
searchFormConfig?: Omit<SearchFormProps, "form"> & {
|
|
23
|
+
hidden?: boolean;
|
|
24
|
+
container?: ContainerComponent | false;
|
|
25
|
+
};
|
|
26
|
+
tableContainer?: ContainerComponent | false;
|
|
27
|
+
columns?: Columns<T extends Table<any, infer R extends import('@qin-ui/pro-components-core').Data> ? R : any>;
|
|
28
|
+
data?: (T extends Table<any, infer R extends import('@qin-ui/pro-components-core').Data> ? R : any)[];
|
|
29
|
+
pagination?: false | Partial<PaginationProps>;
|
|
30
|
+
} & Omit<TableProps, "data">) & Partial<{}>> & import('vue').PublicProps;
|
|
31
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
32
|
+
attrs: any;
|
|
33
|
+
slots: Partial<Record<string, (_: any) => any>> & {
|
|
34
|
+
'search-form'?(_: {}): any;
|
|
35
|
+
'button-bar'?(_: {}): any;
|
|
36
|
+
toolbar?(_: {}): any;
|
|
37
|
+
table?(_: {}): any;
|
|
38
|
+
};
|
|
39
|
+
emit: ((evt: "update:size", value: "" | "default" | "large" | "small" | undefined) => void) & ((evt: "update:loading", value: boolean) => void);
|
|
40
|
+
}>) => import('vue').VNode & {
|
|
41
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
42
|
+
};
|
|
43
|
+
export default _default;
|
|
44
|
+
type __VLS_PrettifyLocal<T> = {
|
|
45
|
+
[K in keyof T]: T[K];
|
|
46
|
+
} & {};
|
|
47
|
+
//# sourceMappingURL=ProTable.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProTable.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/table/components/ProTable.vue"],"names":[],"mappings":"AAsaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAEL,KAAK,eAAe,EAEpB,KAAK,UAAU,EAGhB,MAAM,oBAAoB,CAAC;AAY5B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAQzC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;yBAGvB,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,EAC5C,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WAqgBO,mBAAmB,CAAC;;;;eA7PnB,UAAU,CAAC,MAAM,CAAC;kBACf,OAAO;;gBAxPT,CAAC;iBAEA,MAAM,OAAO,CAAC,OAAO,CAAC;yBAEd,OAAO;0BAEN,OAAO;kBAEf,OAAO,GAAG,OAAO;yBAtBC,OAAO;2BAAiB,OAAO;UAsBvB;;qBAlB3B,OAAO;wBAEJ,kBAAkB,GAAG,KAAK;;yBAoBrB,kBAAkB,GAAG,KAAK;kBACjC,OAAO,4BAlBoC,CAAC,+DAkBzB;eACtB,4BAnB8C,CAAC,iEAmBnC;qBACN,KAAK,GAAG,OAAO,CAAC,eAAe,CAAC;+CAqe+C,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;8CA7D4E,GAAG;+BAEvD,GAAG;8BACH,GAAG;yBACR,GAAG;uBACL,GAAG;;;EA4D3B,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAhhBzE,wBAghB4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { FormProps } from '../../../shared/ui';
|
|
2
|
+
import { AllowedComponentProps, Component, DefineComponent } from 'vue';
|
|
3
|
+
import { Form } from '../../form';
|
|
4
|
+
type Expand = {
|
|
5
|
+
minExpandRows?: number;
|
|
6
|
+
expandStatus?: boolean;
|
|
7
|
+
};
|
|
8
|
+
type _FormProps = Pick<Partial<FormProps>, 'disabled' | 'labelPosition' | 'labelWidth' | 'inline' | 'inlineMessage' | 'statusIcon' | 'showMessage' | 'size'>;
|
|
9
|
+
type ButtonProps = {
|
|
10
|
+
onClick: () => void;
|
|
11
|
+
};
|
|
12
|
+
type ExpandButtonProps = ButtonProps & {
|
|
13
|
+
expandStatus: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type SearchFormProps = {
|
|
16
|
+
form: Form;
|
|
17
|
+
layout?: 'grid' | 'inline';
|
|
18
|
+
expand?: boolean | Expand;
|
|
19
|
+
searchButton?: Component<ButtonProps> | DefineComponent<ButtonProps> | false;
|
|
20
|
+
resetButton?: Component<ButtonProps> | DefineComponent<ButtonProps> | false;
|
|
21
|
+
expandButton?: Component<ExpandButtonProps> | DefineComponent<ExpandButtonProps> | false;
|
|
22
|
+
rowGap?: number;
|
|
23
|
+
columnGap?: number;
|
|
24
|
+
} & /* @vue-ignore */ _FormProps & AllowedComponentProps;
|
|
25
|
+
declare const _default: __VLS_WithTemplateSlots<DefineComponent<SearchFormProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
26
|
+
search: () => any;
|
|
27
|
+
reset: () => any;
|
|
28
|
+
}, string, import('vue').PublicProps, Readonly<SearchFormProps> & Readonly<{
|
|
29
|
+
onSearch?: (() => any) | undefined;
|
|
30
|
+
onReset?: (() => any) | undefined;
|
|
31
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, {
|
|
32
|
+
'reset-button'?(_: {
|
|
33
|
+
onClick: () => void;
|
|
34
|
+
}): any;
|
|
35
|
+
'search-button'?(_: {
|
|
36
|
+
onClick: () => void;
|
|
37
|
+
}): any;
|
|
38
|
+
'expand-button'?(_: {
|
|
39
|
+
onClick: () => void;
|
|
40
|
+
}): any;
|
|
41
|
+
}>;
|
|
42
|
+
export default _default;
|
|
43
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
44
|
+
new (): {
|
|
45
|
+
$slots: S;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=SearchForm.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
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,CAAC;CACpB,GAAG,iBAAiB,CAAC,UAAU,GAC9B,qBAAqB,CAAC;;;;;;;;;;QAmWa,GAAG;;;QACF,GAAG;;;QACH,GAAG;;AAnWzC,wBAgZK;AAQL,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TableProps } from '../../../shared/ui';
|
|
2
|
+
type Size = TableProps['size'];
|
|
3
|
+
type __VLS_PublicProps = {
|
|
4
|
+
'size'?: Size;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
"update:size": (value: "" | "default" | "large" | "small" | undefined) => any;
|
|
8
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
9
|
+
"onUpdate:size"?: ((value: "" | "default" | "large" | "small" | undefined) => any) | undefined;
|
|
10
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
export default _default;
|
|
12
|
+
//# sourceMappingURL=SizeControl.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SizeControl.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/table/components/SizeControl.vue"],"names":[],"mappings":"AAyDA,OAAO,EAKL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAC;AAG5B,KAAK,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;AAe/B,KAAK,iBAAiB,GAAG;IACzB,MAAM,CAAC,EAAE,IAAI,CAAC;CACb,CAAC;;;;;;AAsHF,wBAQG"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Columns } from '../types';
|
|
2
|
+
declare const _default: <D extends Record<string, any> = Record<string, any>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, never> & {
|
|
4
|
+
columns: Columns<D>;
|
|
5
|
+
} & Partial<{}>> & import('vue').PublicProps;
|
|
6
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
7
|
+
attrs: any;
|
|
8
|
+
slots: {};
|
|
9
|
+
emit: {};
|
|
10
|
+
}>) => import('vue').VNode & {
|
|
11
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_PrettifyLocal<T> = {
|
|
15
|
+
[K in keyof T]: T[K];
|
|
16
|
+
} & {};
|
|
17
|
+
//# sourceMappingURL=TableColumnRenderer.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableColumnRenderer.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/table/components/TableColumnRenderer.vue"],"names":[],"mappings":"AA2EA,OAAO,KAAK,EAAU,OAAO,EAAE,MAAM,UAAU,CAAC;yBAG/B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACnE,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WAmHO,mBAAmB,CAAC;iBA/GjB,OAAO,CAAC,CAAC,CAAC;mBA+GyE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;UAEJ,EAAE;EAEL,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AA9HzE,wBA8H4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
3
|
+
//# sourceMappingURL=ColumnHeightOutlined.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColumnHeightOutlined.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/table/components/icons/ColumnHeightOutlined.vue"],"names":[],"mappings":";AAkDA,wBAKG"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
3
|
+
//# sourceMappingURL=DownOutlined.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DownOutlined.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/table/components/icons/DownOutlined.vue"],"names":[],"mappings":";AAkDA,wBAKG"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
3
|
+
//# sourceMappingURL=FilterOutlined.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterOutlined.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/table/components/icons/FilterOutlined.vue"],"names":[],"mappings":";AAkDA,wBAKG"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as DefaultSearchFormContainer } from './DefaultSearchFormContainer.vue';
|
|
2
|
+
export { default as DefaultTableContainer } from './DefaultTableContainer.vue';
|
|
3
|
+
export { default as SizeControl } from './SizeControl.vue';
|
|
4
|
+
export { default as ColumnControl } from './ColumnControl.vue';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/table/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AACzF,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ComponentPublicInstance } from 'vue';
|
|
2
|
+
import { PaginationProps, TableProps } from '../../shared/ui';
|
|
3
|
+
import { ContainerComponent } from '../form/types';
|
|
4
|
+
import { Columns } from './types';
|
|
5
|
+
import { SearchFormProps } from './components/SearchForm.vue';
|
|
6
|
+
import { Table } from './useTable';
|
|
7
|
+
import { default as ProTable } from './components/ProTable.vue';
|
|
8
|
+
type Control = {
|
|
9
|
+
sizeControl: boolean;
|
|
10
|
+
columnControl: boolean;
|
|
11
|
+
};
|
|
12
|
+
type SearchFormConfig = Omit<SearchFormProps, 'form'> & {
|
|
13
|
+
hidden?: boolean;
|
|
14
|
+
container?: ContainerComponent | false;
|
|
15
|
+
};
|
|
16
|
+
type ReturnTableRecord<V> = V extends Table<any, infer R> ? R : any;
|
|
17
|
+
export type ProTableProps<T extends Table<any> = Table> = {
|
|
18
|
+
table?: T;
|
|
19
|
+
search?: () => Promise<unknown>;
|
|
20
|
+
addIndexColumn?: boolean;
|
|
21
|
+
immediateSearch?: boolean;
|
|
22
|
+
control?: boolean | Partial<Control>;
|
|
23
|
+
searchFormConfig?: SearchFormConfig;
|
|
24
|
+
tableContainer?: ContainerComponent | false;
|
|
25
|
+
columns?: Columns<ReturnTableRecord<T>>;
|
|
26
|
+
data?: ReturnTableRecord<T>[];
|
|
27
|
+
pagination?: false | Partial<PaginationProps>;
|
|
28
|
+
} & Omit<TableProps, 'data'>;
|
|
29
|
+
export type ProTableInstance = ComponentPublicInstance;
|
|
30
|
+
export { type Column, type Columns } from './types';
|
|
31
|
+
export { useTable, type Table } from './useTable';
|
|
32
|
+
export default ProTable;
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/table/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,KAAK,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,KAA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eAAe,CAAC,CAAC;CAC/C,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;AAC7B,MAAM,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;AAGvD,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAE,MAAM,SAAS,CAAC;AAGpD,OAAO,EAAE,QAAQ,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAElD,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ColumnType } from '../../../shared/ui';
|
|
2
|
+
import { Data, ExtendWithAny, KeyExpandString, Paths, Path } from '../../../shared/core';
|
|
3
|
+
type BivariantRender<D extends Data = Data> = {
|
|
4
|
+
bivarianceHack(scope: ColumnScope<D>): any;
|
|
5
|
+
}['bivarianceHack'];
|
|
6
|
+
/**
|
|
7
|
+
* Element Plus 表格列作用域
|
|
8
|
+
* @template D - 表格行数据类型
|
|
9
|
+
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export type ColumnScope<D extends Data = Data> = {
|
|
13
|
+
/** 当前行数据 */
|
|
14
|
+
row: ExtendWithAny<D>;
|
|
15
|
+
/** 当前列配置 */
|
|
16
|
+
column: Column<D>;
|
|
17
|
+
/** 行索引 */
|
|
18
|
+
$index: number;
|
|
19
|
+
/** 单元格值 */
|
|
20
|
+
cellValue: any;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* @qin-ui/element-plus-pro 表格列配置类型
|
|
24
|
+
*
|
|
25
|
+
* @description 基于 Element Plus 的 ColumnType 列类型,并添加:
|
|
26
|
+
* - prop 作为主要字段(Element Plus 使用 prop 而非 dataIndex)
|
|
27
|
+
* - key 作为辅助标识
|
|
28
|
+
* - hidden 属性
|
|
29
|
+
* - render 自定义渲染函数
|
|
30
|
+
*
|
|
31
|
+
* @template D - 表格行数据类型
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* interface User { name: string; age: number }
|
|
36
|
+
*
|
|
37
|
+
* const columns: Columns<User> = [
|
|
38
|
+
* { prop: 'name', label: '姓名', width: 120 },
|
|
39
|
+
* { prop: 'age', label: '年龄', width: 80 },
|
|
40
|
+
* ]
|
|
41
|
+
* ```
|
|
42
|
+
|
|
43
|
+
* @public
|
|
44
|
+
*/
|
|
45
|
+
export type Column<D extends Data = Data> = Partial<Omit<ColumnType<any>, 'prop' | 'property' | 'children' | 'render'>> & {
|
|
46
|
+
/** 列字段标识(辅助字段) */
|
|
47
|
+
key?: Path<D>;
|
|
48
|
+
/**
|
|
49
|
+
* @description 列数据路径(主要字段)
|
|
50
|
+
* Element Plus 使用 prop 而非 dataIndex
|
|
51
|
+
* @example 'name' | 'address.city'
|
|
52
|
+
*/
|
|
53
|
+
prop?: KeyExpandString<Extract<keyof D, string>> | Paths<D>;
|
|
54
|
+
/** 是否隐藏该列 */
|
|
55
|
+
hidden?: boolean;
|
|
56
|
+
/** 自定义渲染函数 */
|
|
57
|
+
render?: BivariantRender<D>;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* @qin-ui/element-plus-pro 表格列配置数组类型
|
|
61
|
+
* @template D - 表格行数据类型
|
|
62
|
+
|
|
63
|
+
* @public
|
|
64
|
+
*/
|
|
65
|
+
export type Columns<D extends Data = Data> = Array<Column<D>>;
|
|
66
|
+
export {};
|
|
67
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/table/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACL,IAAI,EACJ,aAAa,EACb,eAAe,EACf,KAAK,EACL,IAAI,EACL,MAAM,sBAAsB,CAAC;AAE9B,KAAK,eAAe,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI,IAAI;IAC5C,cAAc,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;CAC5C,CAAC,gBAAgB,CAAC,CAAC;AAEpB;;;;;GAKG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI,IAAI;IAC/C,YAAY;IACZ,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IACtB,YAAY;IACZ,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IAClB,UAAU;IACV,MAAM,EAAE,MAAM,CAAC;IACf,WAAW;IACX,SAAS,EAAE,GAAG,CAAC;CAChB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI,IAAI,OAAO,CACjD,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,CAAC,CACnE,GAAG;IACF,kBAAkB;IAClB,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IACd;;;;OAIG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC5D,aAAa;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,cAAc;IACd,MAAM,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;CAC7B,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { Table as _Table, Data, ExtendWithAny, DeepPartial, PageParam } from '../../shared/core';
|
|
2
|
+
import { Fields } from '../form/types';
|
|
3
|
+
import { Column, Columns } from './types';
|
|
4
|
+
import { Ref } from 'vue';
|
|
5
|
+
/**
|
|
6
|
+
* 表格实例类型
|
|
7
|
+
*
|
|
8
|
+
* @description 在 core Table 类型的基础上,将列类型 C 绑定为本地 Column<T>,
|
|
9
|
+
* 并将 dataSource 重命名为 data(Element Plus 使用 data 而非 dataSource),
|
|
10
|
+
* 使 columns 操作获得 Element Plus 表格列的完整属性类型提示。
|
|
11
|
+
*
|
|
12
|
+
* @template D - 搜索表单数据类型
|
|
13
|
+
* @template T - 表格行数据类型(一行数据的类型)
|
|
14
|
+
*
|
|
15
|
+
* @property columns - 列配置数组(响应式 Ref),用于渲染表格列
|
|
16
|
+
* @property data - 表格数据源(响应式 Ref),对应 Element Plus Table 的 data 属性
|
|
17
|
+
* @property pageParam - 分页参数(响应式 reactive),包含 current、pageSize、total
|
|
18
|
+
* @property searchForm - 搜索表单实例(Form 类型),用于管理搜索区域的字段和数据
|
|
19
|
+
* @property setColumn - 更新列配置,支持合并/覆盖两种模式,用法同 setField
|
|
20
|
+
* @property deleteColumn - 删除列,支持路径或查找函数
|
|
21
|
+
* @property appendColumn - 在指定列后追加新列,传 undefined 在末尾追加
|
|
22
|
+
* @property prependColumn - 在指定列前插入新列,传 undefined 在开头插入
|
|
23
|
+
* @property setPageParam - 设置分页参数,支持部分更新和函数式更新
|
|
24
|
+
* @property resetQueryParams - 重置分页到第一页并恢复搜索条件到初始值
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* interface SearchParams { keyword: string }
|
|
29
|
+
* interface User { name: string; age: number }
|
|
30
|
+
*
|
|
31
|
+
* const table: Table<SearchParams, User> = useTable({
|
|
32
|
+
* columns: [{ prop: 'name', title: '姓名' }],
|
|
33
|
+
* })
|
|
34
|
+
*
|
|
35
|
+
* table.columns.value // 访问列配置
|
|
36
|
+
* table.setColumn('name', { width: 150 }) // 更新列
|
|
37
|
+
* table.setPageParam({ current: 2 }) // 切换页码
|
|
38
|
+
* table.searchForm.setFormData('keyword', '搜索词') // 操作搜索表单
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @public
|
|
42
|
+
*/
|
|
43
|
+
export type Table<D extends Data = Data, T extends Data = ExtendWithAny<D>> = Omit<_Table<D, T, Column<T>>, 'dataSource'> & {
|
|
44
|
+
/**
|
|
45
|
+
* Element Plus 数据源(与 core 的 dataSource 对应)
|
|
46
|
+
*/
|
|
47
|
+
data: Ref<T[]>;
|
|
48
|
+
};
|
|
49
|
+
type UseTableParams<D extends Data = Data, T extends Data = ExtendWithAny<D>> = {
|
|
50
|
+
/** 列配置数组 */
|
|
51
|
+
columns?: Columns<T>;
|
|
52
|
+
/** 数据源数组(Element Plus 使用 data 而非 dataSource) */
|
|
53
|
+
data?: T[];
|
|
54
|
+
/** 初始分页参数 */
|
|
55
|
+
pageParam?: PageParam;
|
|
56
|
+
/** 初始搜索参数 */
|
|
57
|
+
searchParam?: ExtendWithAny<DeepPartial<D>>;
|
|
58
|
+
/** 搜索表单字段配置 */
|
|
59
|
+
searchFields?: Fields<D>;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* 创建表格实例的 Hook
|
|
63
|
+
*
|
|
64
|
+
* @description 基于 `@qin-ui/pro-components-core` 的 `useTable` 封装,适配 Element Plus 的 API 风格:
|
|
65
|
+
* - 数据源使用 `data` 而非 `dataSource`
|
|
66
|
+
*
|
|
67
|
+
* 是 ProTable 组件的核心 Hook,提供了:
|
|
68
|
+
* - 列配置管理(增删改查)
|
|
69
|
+
* - 数据源管理
|
|
70
|
+
* - 分页管理
|
|
71
|
+
* - 搜索表单集成(内部使用 useForm)
|
|
72
|
+
* - 查询参数重置
|
|
73
|
+
*
|
|
74
|
+
* @template D - 搜索表单数据类型
|
|
75
|
+
* @template T - 表格行数据类型
|
|
76
|
+
*
|
|
77
|
+
* @param {object} params - 表格配置参数
|
|
78
|
+
* @param {Columns<T>} [params.columns] - 初始列配置数组
|
|
79
|
+
* @param {T[]} [params.data] - 初始数据源(Element Plus 风格)
|
|
80
|
+
* @param {PageParam} [params.pageParam] - 初始分页参数,默认 `{ current: 1, pageSize: 10, total: 0 }`
|
|
81
|
+
* @param {ExtendWithAny<DeepPartial<D>>} [params.searchParam] - 初始搜索参数
|
|
82
|
+
* @param {Fields<D>} [params.searchFields] - 搜索表单字段配置
|
|
83
|
+
*
|
|
84
|
+
* @returns {Table<D, T>} 表格实例
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* interface SearchParams { keyword: string }
|
|
89
|
+
* interface User { name: string; age: number; email: string }
|
|
90
|
+
*
|
|
91
|
+
* const table = useTable<SearchParams, User>({
|
|
92
|
+
* columns: [
|
|
93
|
+
* { prop: 'name', title: '姓名', width: 120 },
|
|
94
|
+
* { prop: 'age', title: '年龄', width: 80 },
|
|
95
|
+
* ],
|
|
96
|
+
* data: [],
|
|
97
|
+
* pageParam: { current: 1, pageSize: 20, total: 0 },
|
|
98
|
+
* searchParam: { keyword: '' },
|
|
99
|
+
* searchFields: [
|
|
100
|
+
* { path: 'keyword', label: '关键词', component: 'input' },
|
|
101
|
+
* ],
|
|
102
|
+
* })
|
|
103
|
+
* ```
|
|
104
|
+
*
|
|
105
|
+
* @see {@link coreUseTable} 底层核心实现(来自 @qin-ui/pro-components-core)
|
|
106
|
+
*
|
|
107
|
+
* @public
|
|
108
|
+
*/
|
|
109
|
+
export declare function useTable<D extends Data = Data, T extends Data = ExtendWithAny<D>>(params?: UseTableParams<D, T>): Table<D, T>;
|
|
110
|
+
export {};
|
|
111
|
+
//# sourceMappingURL=useTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTable.d.ts","sourceRoot":"","sources":["../../../src/components/table/useTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,KAAK,IAAI,MAAM,EACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,IAAI,EACJ,aAAa,EACb,WAAW,EACX,SAAS,EACV,MAAM,m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CAAC,CAAC,EAAE,CAAC,CAAC,CAchD"}
|
package/es/element-plus-pro.css
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
[class*='-form-item'] [class*='-form-item'][data-v-
|
|
1
|
+
[class*='-form-item'] [class*='-form-item'][data-v-d52742ce] {
|
|
2
2
|
margin-bottom: 18px;
|
|
3
3
|
}
|
|
4
|
-
.pro-table_search-form[data-v-
|
|
4
|
+
.pro-table_search-form[data-v-512bc2e5] [class*='-form-item'] {
|
|
5
5
|
margin: 0;
|
|
6
6
|
}
|
|
7
|
-
.pro-table_search-form_expand-toggle-button[data-v-
|
|
7
|
+
.pro-table_search-form_expand-toggle-button[data-v-512bc2e5] {
|
|
8
8
|
display: flex;
|
|
9
9
|
align-items: center;
|
|
10
10
|
padding: 0;
|
|
11
11
|
padding-left: 4px;
|
|
12
12
|
}
|
|
13
|
-
.pro-table_search-form .transition[data-v-
|
|
13
|
+
.pro-table_search-form .transition[data-v-512bc2e5] {
|
|
14
14
|
transition: all 0.25s;
|
|
15
15
|
}
|
|
16
16
|
.pro-table_search-form-container[data-v-45e627f4] {
|
|
@@ -43,24 +43,24 @@
|
|
|
43
43
|
.pro-table_column-control_button[data-v-ce445821] svg {
|
|
44
44
|
transform: scale(1.2, 1.4);
|
|
45
45
|
}
|
|
46
|
-
.pro-table_header[data-v-
|
|
46
|
+
.pro-table_header[data-v-8617780a] {
|
|
47
47
|
display: flex;
|
|
48
48
|
align-items: center;
|
|
49
49
|
justify-content: flex-end;
|
|
50
50
|
}
|
|
51
|
-
.pro-table_header[data-v-
|
|
51
|
+
.pro-table_header[data-v-8617780a]:empty {
|
|
52
52
|
display: none;
|
|
53
53
|
}
|
|
54
|
-
.pro-table_header + .pro-table_header_content[data-v-
|
|
54
|
+
.pro-table_header + .pro-table_header_content[data-v-8617780a] {
|
|
55
55
|
margin-top: 16px;
|
|
56
56
|
}
|
|
57
|
-
.pro-table_header_button-bar[data-v-
|
|
57
|
+
.pro-table_header_button-bar[data-v-8617780a] {
|
|
58
58
|
flex: 1;
|
|
59
59
|
}
|
|
60
|
-
.pro-table_header_toolbar[data-v-
|
|
60
|
+
.pro-table_header_toolbar[data-v-8617780a] {
|
|
61
61
|
margin-left: 12px;
|
|
62
62
|
}
|
|
63
|
-
.pro-table_pagination[data-v-
|
|
63
|
+
.pro-table_pagination[data-v-8617780a] {
|
|
64
64
|
justify-content: flex-end;
|
|
65
65
|
padding: 16px 0;
|
|
66
66
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { inject, computed, provide, toValue, defineComponent, renderSlot, mergeProps, normalizeProps, guardReactiveProps, resolveComponent, createBlock, openBlock, unref, withCtx, createElementBlock, Fragment, renderList, createVNode, createSlots, ref, useAttrs, createCommentVNode, resolveDynamicComponent, isVNode, createTextVNode, toDisplayString, useSlots, watchEffect, withModifiers } from "vue";
|
|
2
2
|
import { ElFormItem, ElCol, ElTable, ElPagination, useFormDisabled, ElTransfer, ElTreeSelect, ElSlider, ElSwitch, ElRadioGroup, ElCheckboxGroup, ElTimeSelect, ElTimePicker, ElDatePicker, ElCascader, ElSelect, ElAutocomplete, ElInputNumber, ElInput, ElRow, ElForm } from "element-plus";
|
|
3
|
-
import {
|
|
4
|
-
import { I as
|
|
5
|
-
import { i as isPlainObject, t as toPath, o as omit, c as cloneDeep } from "../vendor/utils/lodash-es-p6jau26B.js";
|
|
3
|
+
import { InjectionPathKey, isPlainObject, getObject, toPath, useForm as useForm$1, omit, cloneDeep, InjectionFormKey, camelizeProperties, useFields as useFields$1, useFormRef as useFormRef$1 } from "@qin-ui/pro-components-core";
|
|
4
|
+
import { I as INJECT_CONFIG, g as getInjectConfig, a as INJECT_COMPONENTS } from "../component-provider/index-BGGIWSkO.js";
|
|
6
5
|
const tableProps = () => ElTable.props || {};
|
|
7
6
|
const paginationProps = () => ElPagination.props || {};
|
|
8
7
|
const gridItemProps = () => ElCol.props || {};
|
|
@@ -253,8 +252,10 @@ const _export_sfc = (sfc, props) => {
|
|
|
253
252
|
}
|
|
254
253
|
return target;
|
|
255
254
|
};
|
|
256
|
-
const BaseFormItem = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
257
|
-
|
|
255
|
+
const BaseFormItem = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-d52742ce"]]);
|
|
256
|
+
function useForm(...args) {
|
|
257
|
+
return useForm$1(...args);
|
|
258
|
+
}
|
|
258
259
|
const getInitProps = (field) => {
|
|
259
260
|
const { component, type } = field;
|
|
260
261
|
if (typeof component === "string") {
|
|
@@ -455,8 +456,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
455
456
|
};
|
|
456
457
|
}
|
|
457
458
|
});
|
|
458
|
-
|
|
459
|
-
|
|
459
|
+
function useFields(initFields) {
|
|
460
|
+
return useFields$1(initFields);
|
|
461
|
+
}
|
|
462
|
+
function useFormRef() {
|
|
463
|
+
return useFormRef$1();
|
|
464
|
+
}
|
|
460
465
|
export {
|
|
461
466
|
_export_sfc as _,
|
|
462
467
|
_sfc_main as a,
|
|
@@ -468,3 +473,4 @@ export {
|
|
|
468
473
|
tableProps as t,
|
|
469
474
|
useForm as u
|
|
470
475
|
};
|
|
476
|
+
//# sourceMappingURL=index-oI6LGSpA.js.map
|