@silver-formily/element-plus 2.2.0 → 2.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.
- package/LICENSE +21 -21
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/esm/__builtins__/configs/index.mjs.map +1 -1
- package/esm/__builtins__/index.mjs +18 -21
- package/esm/__builtins__/index.mjs.map +1 -1
- package/esm/__builtins__/shared/index.d.ts +0 -1
- package/esm/__builtins__/shared/index.mjs +18 -21
- package/esm/__builtins__/shared/index.mjs.map +1 -1
- package/esm/__builtins__/shared/loading.mjs +5 -5
- package/esm/__builtins__/shared/loading.mjs.map +1 -1
- package/esm/__builtins__/shared/simple-version-compare.mjs.map +1 -1
- package/esm/__builtins__/shared/transform-component.mjs.map +1 -1
- package/esm/__builtins__/shared/use-enter-submit.d.ts +9 -0
- package/esm/__builtins__/shared/use-enter-submit.mjs +25 -0
- package/esm/__builtins__/shared/use-enter-submit.mjs.map +1 -0
- package/esm/__builtins__/shared/utils.d.ts +1 -0
- package/esm/__builtins__/shared/utils.mjs +23 -17
- package/esm/__builtins__/shared/utils.mjs.map +1 -1
- package/esm/array-base/index.mjs +56 -52
- package/esm/array-base/index.mjs.map +1 -1
- package/esm/array-base/symbols.mjs.map +1 -1
- package/esm/array-base/utils.d.ts +0 -1
- package/esm/array-base/utils.mjs +45 -46
- package/esm/array-base/utils.mjs.map +1 -1
- package/esm/array-cards/index.mjs +36 -33
- package/esm/array-cards/index.mjs.map +1 -1
- package/esm/array-collapse/index.mjs +39 -37
- package/esm/array-collapse/index.mjs.map +1 -1
- package/esm/array-collapse/utils.mjs +9 -2
- package/esm/array-collapse/utils.mjs.map +1 -1
- package/esm/array-items/index.mjs +38 -34
- package/esm/array-items/index.mjs.map +1 -1
- package/esm/array-list-tabs/index.mjs +38 -36
- package/esm/array-list-tabs/index.mjs.map +1 -1
- package/esm/array-list-tabs/utils.mjs +12 -5
- package/esm/array-list-tabs/utils.mjs.map +1 -1
- package/esm/array-table/index.mjs +63 -60
- package/esm/array-table/index.mjs.map +1 -1
- package/esm/array-table/utils.mjs +18 -11
- package/esm/array-table/utils.mjs.map +1 -1
- package/esm/array-tabs/index.mjs +28 -25
- package/esm/array-tabs/index.mjs.map +1 -1
- package/esm/autocomplete/autocomplete.d.ts +1222 -0
- package/esm/autocomplete/index.d.ts +639 -0
- package/esm/autocomplete/index.mjs +116 -0
- package/esm/autocomplete/index.mjs.map +1 -0
- package/esm/cascader/index.mjs +22 -18
- package/esm/cascader/index.mjs.map +1 -1
- package/esm/checkbox/index.d.ts +42 -42
- package/esm/checkbox/index.mjs +20 -16
- package/esm/checkbox/index.mjs.map +1 -1
- package/esm/color-picker/index.d.ts +210 -0
- package/esm/color-picker/index.mjs +17 -0
- package/esm/color-picker/index.mjs.map +1 -0
- package/esm/color-picker-panel/index.d.ts +129 -0
- package/esm/color-picker-panel/index.mjs +25 -0
- package/esm/color-picker-panel/index.mjs.map +1 -0
- package/esm/date-picker/index.mjs +18 -37
- package/esm/date-picker/index.mjs.map +1 -1
- package/esm/date-picker/utils.d.ts +4 -0
- package/esm/date-picker/utils.mjs +27 -0
- package/esm/date-picker/utils.mjs.map +1 -0
- package/esm/date-picker-panel/index.d.ts +143 -0
- package/esm/date-picker-panel/index.mjs +30 -0
- package/esm/date-picker-panel/index.mjs.map +1 -0
- package/esm/editable/editable.d.ts +2 -0
- package/esm/editable/index.d.ts +1 -0
- package/esm/editable/index.mjs +71 -66
- package/esm/editable/index.mjs.map +1 -1
- package/esm/env.d.mjs +2 -0
- package/esm/env.d.mjs.map +1 -0
- package/esm/form/form.mjs +6 -6
- package/esm/form/form.mjs.map +1 -1
- package/esm/form-button-group/form-button-group.d.ts +10 -1
- package/esm/form-button-group/index.d.ts +18 -3
- package/esm/form-button-group/index.mjs +47 -28
- package/esm/form-button-group/index.mjs.map +1 -1
- package/esm/form-button-group/utils.mjs +9 -2
- package/esm/form-button-group/utils.mjs.map +1 -1
- package/esm/form-collapse/index.mjs +21 -18
- package/esm/form-collapse/index.mjs.map +1 -1
- package/esm/form-collapse/utils.mjs.map +1 -1
- package/esm/form-dialog/dialog-content.d.ts +789 -3
- package/esm/form-dialog/index.mjs +97 -86
- package/esm/form-dialog/index.mjs.map +1 -1
- package/esm/form-dialog/types.d.ts +1 -0
- package/esm/form-drawer/drawer-content.d.ts +919 -3
- package/esm/form-drawer/index.mjs +92 -82
- package/esm/form-drawer/index.mjs.map +1 -1
- package/esm/form-drawer/types.d.ts +1 -0
- package/esm/form-grid/hooks.mjs.map +1 -1
- package/esm/form-grid/index.mjs +26 -22
- package/esm/form-grid/index.mjs.map +1 -1
- package/esm/form-item/index.d.ts +1 -0
- package/esm/form-item/index.mjs +102 -99
- package/esm/form-item/index.mjs.map +1 -1
- package/esm/form-item/types.d.ts +4 -0
- package/esm/form-item/utils.mjs.map +1 -1
- package/esm/form-layout/form-layout.mjs +18 -14
- package/esm/form-layout/form-layout.mjs.map +1 -1
- package/esm/form-layout/utils.mjs +23 -23
- package/esm/form-layout/utils.mjs.map +1 -1
- package/esm/form-step/index.mjs +30 -27
- package/esm/form-step/index.mjs.map +1 -1
- package/esm/form-step/utils.mjs.map +1 -1
- package/esm/form-tab/hooks.mjs.map +1 -1
- package/esm/form-tab/index.mjs +24 -22
- package/esm/form-tab/index.mjs.map +1 -1
- package/esm/form-tab/utils.mjs.map +1 -1
- package/esm/index.d.ts +8 -0
- package/esm/index.mjs +90 -74
- package/esm/index.mjs.map +1 -1
- package/esm/input/index.mjs +30 -26
- package/esm/input/index.mjs.map +1 -1
- package/esm/input-number/index.d.ts +21 -21
- package/esm/input-number/index.mjs +11 -8
- package/esm/input-number/index.mjs.map +1 -1
- package/esm/input-tag/index.d.ts +32 -0
- package/esm/input-tag/index.mjs +50 -0
- package/esm/input-tag/index.mjs.map +1 -0
- package/esm/input-tag/input-tag.d.ts +32 -0
- package/esm/mention/index.d.ts +50 -0
- package/esm/mention/index.mjs +97 -0
- package/esm/mention/index.mjs.map +1 -0
- package/esm/mention/mention.d.ts +51 -0
- package/esm/pagination/components/jumper.mjs.map +1 -1
- package/esm/pagination/components/next.mjs.map +1 -1
- package/esm/pagination/components/pager.mjs.map +1 -1
- package/esm/pagination/components/prev.mjs.map +1 -1
- package/esm/pagination/components/total.mjs.map +1 -1
- package/esm/pagination/pagination.mjs.map +1 -1
- package/esm/password/index.mjs.map +1 -1
- package/esm/preview-text/color-picker.d.ts +5 -0
- package/esm/preview-text/index.d.ts +5 -0
- package/esm/preview-text/index.mjs +184 -145
- package/esm/preview-text/index.mjs.map +1 -1
- package/esm/preview-text/utils.mjs.map +1 -1
- package/esm/query-form/default-components.d.ts +5 -0
- package/esm/query-form/default-components.mjs +47 -0
- package/esm/query-form/default-components.mjs.map +1 -0
- package/esm/query-form/hooks.d.ts +25 -0
- package/esm/query-form/hooks.mjs +29 -0
- package/esm/query-form/hooks.mjs.map +1 -0
- package/esm/query-form/index.d.ts +117 -0
- package/esm/query-form/index.mjs +337 -0
- package/esm/query-form/index.mjs.map +1 -0
- package/esm/query-form/query-form-light.d.ts +27 -0
- package/esm/query-form/query-form.d.ts +52 -0
- package/esm/query-form/types.d.ts +44 -0
- package/esm/query-form/types.mjs +2 -0
- package/esm/query-form/types.mjs.map +1 -0
- package/esm/query-form-item/index.d.ts +151 -0
- package/esm/query-form-item/index.mjs +188 -0
- package/esm/query-form-item/index.mjs.map +1 -0
- package/esm/query-form-item/query-form-item.d.ts +96 -0
- package/esm/query-form-item/types.d.ts +46 -0
- package/esm/query-form-item/types.mjs +2 -0
- package/esm/query-form-item/types.mjs.map +1 -0
- package/esm/radio/index.d.ts +36 -36
- package/esm/radio/index.mjs +29 -25
- package/esm/radio/index.mjs.map +1 -1
- package/esm/rate/index.mjs +13 -10
- package/esm/rate/index.mjs.map +1 -1
- package/esm/reset/index.mjs.map +1 -1
- package/esm/segmented/index.mjs +16 -12
- package/esm/segmented/index.mjs.map +1 -1
- package/esm/select/index.mjs +26 -22
- package/esm/select/index.mjs.map +1 -1
- package/esm/select-table/index.mjs +36 -33
- package/esm/select-table/index.mjs.map +1 -1
- package/esm/shared/overlay-elements.d.ts +6 -0
- package/esm/shared/overlay-elements.mjs +19 -0
- package/esm/shared/overlay-elements.mjs.map +1 -0
- package/esm/slider/index.mjs +13 -10
- package/esm/slider/index.mjs.map +1 -1
- package/esm/styles/form-button-group/index.css +1 -1
- package/esm/styles/form-item/index.css +1 -1
- package/esm/styles/preview-text/index.css +1 -1
- package/esm/styles/query-form/index.css +1 -0
- package/esm/styles/query-form-item/index.css +1 -0
- package/esm/submit/index.mjs.map +1 -1
- package/esm/switch/index.d.ts +12 -12
- package/esm/switch/index.mjs.map +1 -1
- package/esm/time-picker/index.mjs +9 -6
- package/esm/time-picker/index.mjs.map +1 -1
- package/esm/time-select/index.mjs +9 -6
- package/esm/time-select/index.mjs.map +1 -1
- package/esm/transfer/index.mjs.map +1 -1
- package/esm/tree/index.mjs +33 -29
- package/esm/tree/index.mjs.map +1 -1
- package/esm/tree/utils.mjs.map +1 -1
- package/esm/tree-select/index.mjs +18 -14
- package/esm/tree-select/index.mjs.map +1 -1
- package/esm/upload/index.d.ts +1 -1
- package/esm/upload/index.mjs +10 -7
- package/esm/upload/index.mjs.map +1 -1
- package/esm/upload/upload.d.ts +2 -2
- package/esm/vendor/lodash.mjs +751 -663
- package/esm/vendor/lodash.mjs.map +1 -1
- package/esm/vendor/sizes.mjs.map +1 -1
- package/package.json +115 -113
- package/esm/__builtins__/shared/hooks.d.ts +0 -7
- package/esm/__builtins__/shared/hooks.mjs +0 -59
- package/esm/__builtins__/shared/hooks.mjs.map +0 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IQueryFormLightProps } from './types';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
default?(_: {}): any;
|
|
6
|
+
};
|
|
7
|
+
refs: {};
|
|
8
|
+
rootEl: any;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
11
|
+
declare const __VLS_component: import('vue').DefineComponent<IQueryFormLightProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
12
|
+
autoSubmit: (values: any) => any;
|
|
13
|
+
autoSubmitFailed: (error: any) => any;
|
|
14
|
+
}, string, import('vue').PublicProps, Readonly<IQueryFormLightProps> & Readonly<{
|
|
15
|
+
onAutoSubmit?: (values: any) => any;
|
|
16
|
+
onAutoSubmitFailed?: (error: any) => any;
|
|
17
|
+
}>, {
|
|
18
|
+
components: Record<string, import('vue').Component>;
|
|
19
|
+
throttleWait: number;
|
|
20
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
21
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { IGridOptions } from '@formily/grid';
|
|
2
|
+
import { IQueryFormProps } from './types';
|
|
3
|
+
declare function toggle(): void;
|
|
4
|
+
declare function __VLS_template(): {
|
|
5
|
+
attrs: Partial<{}>;
|
|
6
|
+
slots: {
|
|
7
|
+
default?(_: {}): any;
|
|
8
|
+
actions?(_: {
|
|
9
|
+
expanded: boolean;
|
|
10
|
+
toggle: typeof toggle;
|
|
11
|
+
type: "incomplete-wrap";
|
|
12
|
+
}): any;
|
|
13
|
+
actions?(_: {
|
|
14
|
+
expanded: boolean;
|
|
15
|
+
toggle: typeof toggle;
|
|
16
|
+
type: "collapsible";
|
|
17
|
+
}): any;
|
|
18
|
+
actions?(_: {
|
|
19
|
+
expanded: boolean;
|
|
20
|
+
toggle: typeof toggle;
|
|
21
|
+
type: "collapsible" | "complete-wrap";
|
|
22
|
+
}): any;
|
|
23
|
+
collapse?(_: {
|
|
24
|
+
expanded: boolean;
|
|
25
|
+
toggle: typeof toggle;
|
|
26
|
+
type: "collapsible";
|
|
27
|
+
}): any;
|
|
28
|
+
};
|
|
29
|
+
refs: {};
|
|
30
|
+
rootEl: any;
|
|
31
|
+
};
|
|
32
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
33
|
+
declare const __VLS_component: import('vue').DefineComponent<IQueryFormProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<IQueryFormProps> & Readonly<{}>, {
|
|
34
|
+
components: Record<string, import('vue').Component>;
|
|
35
|
+
gridProps: Omit<IGridOptions, "shouldVisible" | "maxRows">;
|
|
36
|
+
defaultExpanded: boolean;
|
|
37
|
+
showToggle: boolean;
|
|
38
|
+
actionsAtRowEnd: boolean;
|
|
39
|
+
submitText: string;
|
|
40
|
+
resetText: string;
|
|
41
|
+
expandText: string;
|
|
42
|
+
collapseText: string;
|
|
43
|
+
showSubmit: boolean;
|
|
44
|
+
showReset: boolean;
|
|
45
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
46
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
47
|
+
export default _default;
|
|
48
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
49
|
+
new (): {
|
|
50
|
+
$slots: S;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { GeneralField } from '@formily/core';
|
|
2
|
+
import { Grid, GridNode, IGridOptions } from '@formily/grid';
|
|
3
|
+
import { ISchema } from '@formily/json-schema';
|
|
4
|
+
import { Component } from 'vue';
|
|
5
|
+
export interface QueryFormVisibleContext {
|
|
6
|
+
field?: GeneralField;
|
|
7
|
+
schema?: ISchema;
|
|
8
|
+
index: number;
|
|
9
|
+
node: GridNode;
|
|
10
|
+
grid: Grid<HTMLElement>;
|
|
11
|
+
collapsed: boolean;
|
|
12
|
+
breakpoint: number;
|
|
13
|
+
}
|
|
14
|
+
export type QueryFormVisible = (context: QueryFormVisibleContext) => boolean;
|
|
15
|
+
export interface IQueryFormProps {
|
|
16
|
+
schema?: ISchema;
|
|
17
|
+
schemaField?: Component;
|
|
18
|
+
components?: Record<string, Component>;
|
|
19
|
+
scope?: Record<string, any>;
|
|
20
|
+
gridProps?: Omit<IGridOptions, 'shouldVisible' | 'maxRows'>;
|
|
21
|
+
defaultExpanded?: boolean;
|
|
22
|
+
showToggle?: boolean;
|
|
23
|
+
actionsAtRowEnd?: boolean;
|
|
24
|
+
visibleWhen?: QueryFormVisible;
|
|
25
|
+
submitText?: string;
|
|
26
|
+
resetText?: string;
|
|
27
|
+
expandText?: string;
|
|
28
|
+
collapseText?: string;
|
|
29
|
+
showSubmit?: boolean;
|
|
30
|
+
showReset?: boolean;
|
|
31
|
+
submitProps?: Record<string, any>;
|
|
32
|
+
resetProps?: Record<string, any>;
|
|
33
|
+
}
|
|
34
|
+
export interface IQueryFormLightProps {
|
|
35
|
+
schema?: ISchema;
|
|
36
|
+
schemaField?: Component;
|
|
37
|
+
components?: Record<string, Component>;
|
|
38
|
+
scope?: Record<string, any>;
|
|
39
|
+
throttleWait?: number;
|
|
40
|
+
}
|
|
41
|
+
export interface SchemaEntry {
|
|
42
|
+
name?: string | number;
|
|
43
|
+
schema: ISchema;
|
|
44
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
export type { IQueryFormItemProps, QueryFormItemMode, QueryFormItemPagination, QueryFormItemPaginationMap, QueryFormItemPaginationProps, QueryFormItemQueryProps, QueryFormItemRequest, QueryFormItemRequestResultObject, QueryFormItemRequestSuccessPayload, } from './types';
|
|
2
|
+
export declare const QueryFormItem: {
|
|
3
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
4
|
+
mode: {
|
|
5
|
+
type: import('vue').PropType<import('./types').QueryFormItemMode>;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
request: import('vue').PropType<import('./types').QueryFormItemRequest>;
|
|
9
|
+
clearOnDataChange: {
|
|
10
|
+
type: BooleanConstructor;
|
|
11
|
+
default: boolean;
|
|
12
|
+
};
|
|
13
|
+
querySchema: import('vue').PropType<import('@formily/json-schema').ISchema>;
|
|
14
|
+
queryFormProps: {
|
|
15
|
+
type: import('vue').PropType<import('./types').QueryFormItemQueryProps>;
|
|
16
|
+
default: () => {};
|
|
17
|
+
};
|
|
18
|
+
pagination: {
|
|
19
|
+
type: BooleanConstructor;
|
|
20
|
+
default: boolean;
|
|
21
|
+
};
|
|
22
|
+
paginationProps: {
|
|
23
|
+
type: import('vue').PropType<import('./types').QueryFormItemPaginationProps>;
|
|
24
|
+
default: () => {};
|
|
25
|
+
};
|
|
26
|
+
paginationMap: {
|
|
27
|
+
type: import('vue').PropType<import('./types').QueryFormItemPaginationMap>;
|
|
28
|
+
default: () => {};
|
|
29
|
+
};
|
|
30
|
+
immediate: {
|
|
31
|
+
type: BooleanConstructor;
|
|
32
|
+
default: boolean;
|
|
33
|
+
};
|
|
34
|
+
}>> & Readonly<{
|
|
35
|
+
onRequestSuccess?: (payload: import('./types').QueryFormItemRequestSuccessPayload) => any;
|
|
36
|
+
onRequestFailed?: (error: any) => any;
|
|
37
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
38
|
+
requestSuccess: (payload: import('./types').QueryFormItemRequestSuccessPayload) => any;
|
|
39
|
+
requestFailed: (error: any) => any;
|
|
40
|
+
}, import('vue').PublicProps, {
|
|
41
|
+
mode: import('./types').QueryFormItemMode;
|
|
42
|
+
immediate: boolean;
|
|
43
|
+
pagination: boolean;
|
|
44
|
+
paginationProps: Partial<import('element-plus').PaginationProps>;
|
|
45
|
+
clearOnDataChange: boolean;
|
|
46
|
+
queryFormProps: import('./types').QueryFormItemQueryProps;
|
|
47
|
+
paginationMap: import('./types').QueryFormItemPaginationMap;
|
|
48
|
+
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
49
|
+
P: {};
|
|
50
|
+
B: {};
|
|
51
|
+
D: {};
|
|
52
|
+
C: {};
|
|
53
|
+
M: {};
|
|
54
|
+
Defaults: {};
|
|
55
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
|
56
|
+
mode: {
|
|
57
|
+
type: import('vue').PropType<import('./types').QueryFormItemMode>;
|
|
58
|
+
default: string;
|
|
59
|
+
};
|
|
60
|
+
request: import('vue').PropType<import('./types').QueryFormItemRequest>;
|
|
61
|
+
clearOnDataChange: {
|
|
62
|
+
type: BooleanConstructor;
|
|
63
|
+
default: boolean;
|
|
64
|
+
};
|
|
65
|
+
querySchema: import('vue').PropType<import('@formily/json-schema').ISchema>;
|
|
66
|
+
queryFormProps: {
|
|
67
|
+
type: import('vue').PropType<import('./types').QueryFormItemQueryProps>;
|
|
68
|
+
default: () => {};
|
|
69
|
+
};
|
|
70
|
+
pagination: {
|
|
71
|
+
type: BooleanConstructor;
|
|
72
|
+
default: boolean;
|
|
73
|
+
};
|
|
74
|
+
paginationProps: {
|
|
75
|
+
type: import('vue').PropType<import('./types').QueryFormItemPaginationProps>;
|
|
76
|
+
default: () => {};
|
|
77
|
+
};
|
|
78
|
+
paginationMap: {
|
|
79
|
+
type: import('vue').PropType<import('./types').QueryFormItemPaginationMap>;
|
|
80
|
+
default: () => {};
|
|
81
|
+
};
|
|
82
|
+
immediate: {
|
|
83
|
+
type: BooleanConstructor;
|
|
84
|
+
default: boolean;
|
|
85
|
+
};
|
|
86
|
+
}>> & Readonly<{
|
|
87
|
+
onRequestSuccess?: (payload: import('./types').QueryFormItemRequestSuccessPayload) => any;
|
|
88
|
+
onRequestFailed?: (error: any) => any;
|
|
89
|
+
}>, {}, {}, {}, {}, {
|
|
90
|
+
mode: import('./types').QueryFormItemMode;
|
|
91
|
+
immediate: boolean;
|
|
92
|
+
pagination: boolean;
|
|
93
|
+
paginationProps: Partial<import('element-plus').PaginationProps>;
|
|
94
|
+
clearOnDataChange: boolean;
|
|
95
|
+
queryFormProps: import('./types').QueryFormItemQueryProps;
|
|
96
|
+
paginationMap: import('./types').QueryFormItemPaginationMap;
|
|
97
|
+
}>;
|
|
98
|
+
__isFragment?: never;
|
|
99
|
+
__isTeleport?: never;
|
|
100
|
+
__isSuspense?: never;
|
|
101
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
102
|
+
mode: {
|
|
103
|
+
type: import('vue').PropType<import('./types').QueryFormItemMode>;
|
|
104
|
+
default: string;
|
|
105
|
+
};
|
|
106
|
+
request: import('vue').PropType<import('./types').QueryFormItemRequest>;
|
|
107
|
+
clearOnDataChange: {
|
|
108
|
+
type: BooleanConstructor;
|
|
109
|
+
default: boolean;
|
|
110
|
+
};
|
|
111
|
+
querySchema: import('vue').PropType<import('@formily/json-schema').ISchema>;
|
|
112
|
+
queryFormProps: {
|
|
113
|
+
type: import('vue').PropType<import('./types').QueryFormItemQueryProps>;
|
|
114
|
+
default: () => {};
|
|
115
|
+
};
|
|
116
|
+
pagination: {
|
|
117
|
+
type: BooleanConstructor;
|
|
118
|
+
default: boolean;
|
|
119
|
+
};
|
|
120
|
+
paginationProps: {
|
|
121
|
+
type: import('vue').PropType<import('./types').QueryFormItemPaginationProps>;
|
|
122
|
+
default: () => {};
|
|
123
|
+
};
|
|
124
|
+
paginationMap: {
|
|
125
|
+
type: import('vue').PropType<import('./types').QueryFormItemPaginationMap>;
|
|
126
|
+
default: () => {};
|
|
127
|
+
};
|
|
128
|
+
immediate: {
|
|
129
|
+
type: BooleanConstructor;
|
|
130
|
+
default: boolean;
|
|
131
|
+
};
|
|
132
|
+
}>> & Readonly<{
|
|
133
|
+
onRequestSuccess?: (payload: import('./types').QueryFormItemRequestSuccessPayload) => any;
|
|
134
|
+
onRequestFailed?: (error: any) => any;
|
|
135
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
136
|
+
requestSuccess: (payload: import('./types').QueryFormItemRequestSuccessPayload) => any;
|
|
137
|
+
requestFailed: (error: any) => any;
|
|
138
|
+
}, string, {
|
|
139
|
+
mode: import('./types').QueryFormItemMode;
|
|
140
|
+
immediate: boolean;
|
|
141
|
+
pagination: boolean;
|
|
142
|
+
paginationProps: Partial<import('element-plus').PaginationProps>;
|
|
143
|
+
clearOnDataChange: boolean;
|
|
144
|
+
queryFormProps: import('./types').QueryFormItemQueryProps;
|
|
145
|
+
paginationMap: import('./types').QueryFormItemPaginationMap;
|
|
146
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
147
|
+
$slots: {
|
|
148
|
+
default?(_: {}): any;
|
|
149
|
+
};
|
|
150
|
+
});
|
|
151
|
+
export default QueryFormItem;
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { useField as j, connect as w, mapProps as D } from "@silver-formily/vue";
|
|
2
|
+
import { FormBaseItem as V, fieldFeedbackMapper as N } from "../form-item/index.mjs";
|
|
3
|
+
import { defineComponent as E, computed as y, ref as p, onMounted as U, watch as L, createBlock as P, openBlock as S, unref as u, mergeProps as C, withCtx as G, createElementVNode as h, normalizeClass as b, createCommentVNode as H, resolveDynamicComponent as J, normalizeProps as K, guardReactiveProps as T, renderSlot as W } from "vue";
|
|
4
|
+
import { createForm as X } from "@formily/core";
|
|
5
|
+
import { isNum as Y } from "@formily/shared";
|
|
6
|
+
import { ElPagination as Z } from "element-plus";
|
|
7
|
+
import { stylePrefix as R } from "../__builtins__/configs/index.mjs";
|
|
8
|
+
import "@formily/reactive";
|
|
9
|
+
import "@vueuse/core";
|
|
10
|
+
import "@silver-formily/reactive-vue";
|
|
11
|
+
import { useCleanAttrs as ee } from "../__builtins__/shared/utils.mjs";
|
|
12
|
+
import { QueryForm as k } from "../query-form/index.mjs";
|
|
13
|
+
import { useQueryFormForm as te } from "../query-form/hooks.mjs";
|
|
14
|
+
import '../styles/query-form-item/index.css';const re = /* @__PURE__ */ E({
|
|
15
|
+
name: "FQueryFormItem",
|
|
16
|
+
inheritAttrs: !1,
|
|
17
|
+
__name: "query-form-item",
|
|
18
|
+
props: {
|
|
19
|
+
mode: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: "default"
|
|
22
|
+
},
|
|
23
|
+
request: Function,
|
|
24
|
+
clearOnDataChange: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: !1
|
|
27
|
+
},
|
|
28
|
+
querySchema: Object,
|
|
29
|
+
queryFormProps: {
|
|
30
|
+
type: Object,
|
|
31
|
+
default: () => ({})
|
|
32
|
+
},
|
|
33
|
+
pagination: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: !0
|
|
36
|
+
},
|
|
37
|
+
paginationProps: {
|
|
38
|
+
type: Object,
|
|
39
|
+
default: () => ({})
|
|
40
|
+
},
|
|
41
|
+
paginationMap: {
|
|
42
|
+
type: Object,
|
|
43
|
+
default: () => ({})
|
|
44
|
+
},
|
|
45
|
+
immediate: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: !0
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
emits: ["requestSuccess", "requestFailed"],
|
|
51
|
+
setup(B, { emit: I }) {
|
|
52
|
+
const e = B, c = I, m = {
|
|
53
|
+
currentPage: 1,
|
|
54
|
+
pageSize: 10,
|
|
55
|
+
pageSizes: [10, 20, 50, 100],
|
|
56
|
+
layout: "total, prev, pager, next",
|
|
57
|
+
size: "small"
|
|
58
|
+
}, q = {
|
|
59
|
+
current: "current",
|
|
60
|
+
pageSize: "pageSize"
|
|
61
|
+
}, Q = j(), _ = X(), f = `${R}-query-form-item`, x = `${R}-form-item--isolated`, { props: O } = ee(), M = y(() => {
|
|
62
|
+
const {
|
|
63
|
+
currentPage: t,
|
|
64
|
+
pageSize: a,
|
|
65
|
+
...r
|
|
66
|
+
} = {
|
|
67
|
+
...m,
|
|
68
|
+
...e.paginationProps
|
|
69
|
+
};
|
|
70
|
+
return r;
|
|
71
|
+
}), n = p(e.paginationProps?.currentPage ?? m.currentPage), s = p(e.paginationProps?.pageSize ?? m.pageSize), d = p(0), l = p(0), { activeForm: F } = te({
|
|
72
|
+
formProps: y(() => e.queryFormProps),
|
|
73
|
+
fallbackForm: _
|
|
74
|
+
}), $ = y(() => ({
|
|
75
|
+
...e.queryFormProps,
|
|
76
|
+
schema: e.querySchema ?? e.queryFormProps.schema,
|
|
77
|
+
form: F.value,
|
|
78
|
+
onAutoSubmit: z,
|
|
79
|
+
resetProps: {
|
|
80
|
+
onClick: A
|
|
81
|
+
}
|
|
82
|
+
}));
|
|
83
|
+
async function g() {
|
|
84
|
+
if (!e.request)
|
|
85
|
+
return;
|
|
86
|
+
const t = Q.value;
|
|
87
|
+
Array.isArray(t.dataSource) || (t.dataSource = []);
|
|
88
|
+
const a = ++l.value;
|
|
89
|
+
/* istanbul ignore next -- @preserve defensive: active query form can be temporarily undefined before form injection settles */
|
|
90
|
+
const r = F.value?.values ?? {}, i = e.pagination ? {
|
|
91
|
+
current: n.value,
|
|
92
|
+
pageSize: s.value
|
|
93
|
+
} : void 0, v = i ? {
|
|
94
|
+
...r,
|
|
95
|
+
[e.paginationMap.current ?? q.current]: i.current,
|
|
96
|
+
[e.paginationMap.pageSize ?? q.pageSize]: i.pageSize
|
|
97
|
+
} : r;
|
|
98
|
+
t.loading = !0;
|
|
99
|
+
try {
|
|
100
|
+
const o = await e.request(v);
|
|
101
|
+
if (a !== l.value)
|
|
102
|
+
return;
|
|
103
|
+
if (o.success !== !0) {
|
|
104
|
+
c("requestFailed", o);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
t.dataSource = o.data, e.clearOnDataChange && t.setValue?.(void 0), d.value = Y(o.total) ? o.total : o.data.length, c("requestSuccess", {
|
|
108
|
+
values: r,
|
|
109
|
+
pagination: i,
|
|
110
|
+
dataSource: o.data,
|
|
111
|
+
total: d.value,
|
|
112
|
+
result: o
|
|
113
|
+
});
|
|
114
|
+
} catch (o) {
|
|
115
|
+
if (a !== l.value)
|
|
116
|
+
return;
|
|
117
|
+
c("requestFailed", o);
|
|
118
|
+
} finally {
|
|
119
|
+
a === l.value && (t.loading = !1);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
async function z() {
|
|
123
|
+
if (e.pagination && n.value !== 1) {
|
|
124
|
+
n.value = 1;
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
await g();
|
|
128
|
+
}
|
|
129
|
+
function A(t) {
|
|
130
|
+
const a = e.queryFormProps.resetProps?.onClick, r = a?.(t);
|
|
131
|
+
return r === !1 ? !1 : (z(), r);
|
|
132
|
+
}
|
|
133
|
+
return U(() => {
|
|
134
|
+
e.immediate && g();
|
|
135
|
+
}), L([n, s], ([t, a], [r, i]) => {
|
|
136
|
+
/* istanbul ignore if -- @preserve defensive: watcher is retained when pagination is dynamically toggled off */
|
|
137
|
+
if (!e.pagination)
|
|
138
|
+
return;
|
|
139
|
+
const v = t !== r, o = a !== i;
|
|
140
|
+
/* istanbul ignore if -- @preserve defensive: keep guard for unexpected duplicated watcher payload */
|
|
141
|
+
if (!(!v && !o)) {
|
|
142
|
+
if (o && t !== 1) {
|
|
143
|
+
n.value = 1;
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
g();
|
|
147
|
+
}
|
|
148
|
+
}), (t, a) => (S(), P(u(V), C(u(O), { "internal-form-item-class": x }), {
|
|
149
|
+
default: G(() => [
|
|
150
|
+
h("div", {
|
|
151
|
+
class: b(f)
|
|
152
|
+
}, [
|
|
153
|
+
(S(), P(J(e.mode === "light" ? u(k).Light : u(k)), K(T($.value)), null, 16)),
|
|
154
|
+
h("div", {
|
|
155
|
+
class: b(`${f}__content`)
|
|
156
|
+
}, [
|
|
157
|
+
W(t.$slots, "default")
|
|
158
|
+
], 2),
|
|
159
|
+
e.pagination ? (S(), P(u(Z), C({
|
|
160
|
+
key: 0,
|
|
161
|
+
"current-page": n.value,
|
|
162
|
+
"onUpdate:currentPage": a[0] || (a[0] = (r) => n.value = r),
|
|
163
|
+
"page-size": s.value,
|
|
164
|
+
"onUpdate:pageSize": a[1] || (a[1] = (r) => s.value = r),
|
|
165
|
+
class: `${f}__pagination`
|
|
166
|
+
}, M.value, { total: d.value }), null, 16, ["current-page", "page-size", "class", "total"])) : H("", !0)
|
|
167
|
+
])
|
|
168
|
+
]),
|
|
169
|
+
_: 3
|
|
170
|
+
}, 16));
|
|
171
|
+
}
|
|
172
|
+
}), ve = w(
|
|
173
|
+
re,
|
|
174
|
+
D(
|
|
175
|
+
{
|
|
176
|
+
validateStatus: !0,
|
|
177
|
+
title: "label",
|
|
178
|
+
required: !0,
|
|
179
|
+
description: "extra"
|
|
180
|
+
},
|
|
181
|
+
N
|
|
182
|
+
)
|
|
183
|
+
);
|
|
184
|
+
export {
|
|
185
|
+
ve as QueryFormItem,
|
|
186
|
+
ve as default
|
|
187
|
+
};
|
|
188
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/query-form-item/query-form-item.vue","../../src/query-form-item/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Field } from '@formily/core'\nimport type { ISchema } from '@formily/json-schema'\nimport type { PropType } from 'vue'\nimport type {\n QueryFormItemMode,\n QueryFormItemPaginationMap,\n QueryFormItemPaginationProps,\n QueryFormItemQueryProps,\n QueryFormItemRequest,\n QueryFormItemRequestSuccessPayload,\n} from './types'\nimport { createForm } from '@formily/core'\nimport { isNum } from '@formily/shared'\nimport { useField } from '@silver-formily/vue'\nimport { ElPagination } from 'element-plus'\nimport { computed, onMounted, ref, watch } from 'vue'\nimport { stylePrefix, useCleanAttrs } from '../__builtins__'\nimport { FormBaseItem } from '../form-item'\nimport { QueryForm } from '../query-form'\nimport { useQueryFormForm } from '../query-form/hooks'\n\ndefineOptions({\n name: 'FQueryFormItem',\n inheritAttrs: false,\n})\n\nconst props = defineProps({\n mode: {\n type: String as PropType<QueryFormItemMode>,\n default: 'default',\n },\n request: Function as PropType<QueryFormItemRequest>,\n clearOnDataChange: {\n type: Boolean,\n default: false,\n },\n querySchema: Object as PropType<ISchema>,\n queryFormProps: {\n type: Object as PropType<QueryFormItemQueryProps>,\n default: () => ({}),\n },\n pagination: {\n type: Boolean,\n default: true,\n },\n paginationProps: {\n type: Object as PropType<QueryFormItemPaginationProps>,\n default: () => ({}),\n },\n paginationMap: {\n type: Object as PropType<QueryFormItemPaginationMap>,\n default: () => ({}),\n },\n immediate: {\n type: Boolean,\n default: true,\n },\n})\n\nconst emit = defineEmits<{\n (e: 'requestSuccess', payload: QueryFormItemRequestSuccessPayload): void\n (e: 'requestFailed', error: any): void\n}>()\n\nconst defaultPaginationProps: QueryFormItemPaginationProps = {\n currentPage: 1,\n pageSize: 10,\n pageSizes: [10, 20, 50, 100],\n layout: 'total, prev, pager, next',\n size: 'small',\n}\nconst defaultPaginationRequestMapping: Required<QueryFormItemPaginationMap> = {\n current: 'current',\n pageSize: 'pageSize',\n}\n\nconst fieldRef = useField<Field>()\nconst internalQueryForm = createForm()\nconst prefixCls = `${stylePrefix}-query-form-item`\nconst formItemInternalClass = `${stylePrefix}-form-item--isolated`\nconst { props: formItemProps } = useCleanAttrs()\n\nconst paginationBindings = computed(() => {\n const {\n currentPage,\n pageSize,\n ...bindings\n } = {\n ...defaultPaginationProps,\n ...props.paginationProps,\n }\n return bindings\n})\n\nconst currentPageRef = ref(props.paginationProps?.currentPage ?? defaultPaginationProps.currentPage)\nconst pageSizeRef = ref(props.paginationProps?.pageSize ?? defaultPaginationProps.pageSize)\nconst totalRef = ref(0)\nconst currentRequestId = ref(0)\n\nconst { activeForm: activeQueryForm } = useQueryFormForm({\n formProps: computed(() => props.queryFormProps),\n fallbackForm: internalQueryForm,\n})\n\nconst queryFormBindings = computed(() => {\n return ({\n ...props.queryFormProps,\n schema: props.querySchema ?? props.queryFormProps.schema,\n form: activeQueryForm.value,\n onAutoSubmit: handleQuerySubmit,\n resetProps: {\n onClick: handleQueryReset,\n },\n })\n})\n\nasync function executeRequest() {\n if (!props.request)\n return\n\n const field = fieldRef.value\n if (!Array.isArray(field.dataSource))\n field.dataSource = []\n\n const requestId = ++currentRequestId.value\n /* istanbul ignore next -- @preserve defensive: active query form can be temporarily undefined before form injection settles */\n const queryValues = activeQueryForm.value?.values ?? {}\n const paginationData = props.pagination\n ? {\n current: currentPageRef.value,\n pageSize: pageSizeRef.value,\n }\n : undefined\n const requestParams = paginationData\n ? {\n ...queryValues,\n [(props.paginationMap.current ?? defaultPaginationRequestMapping.current)]: paginationData.current,\n [(props.paginationMap.pageSize ?? defaultPaginationRequestMapping.pageSize)]: paginationData.pageSize,\n }\n : queryValues\n\n field.loading = true\n try {\n const result = await props.request(requestParams)\n\n if (requestId !== currentRequestId.value)\n return\n\n if (result.success !== true) {\n emit('requestFailed', result)\n return\n }\n\n field.dataSource = result.data\n if (props.clearOnDataChange) {\n field.setValue?.(undefined)\n }\n totalRef.value = isNum(result.total) ? result.total : result.data.length\n\n emit('requestSuccess', {\n values: queryValues,\n pagination: paginationData,\n dataSource: result.data,\n total: totalRef.value,\n result,\n })\n }\n catch (error) {\n if (requestId !== currentRequestId.value)\n return\n emit('requestFailed', error)\n }\n finally {\n if (requestId === currentRequestId.value)\n field.loading = false\n }\n}\n\nasync function handleQuerySubmit() {\n if (props.pagination && currentPageRef.value !== 1) {\n currentPageRef.value = 1\n return\n }\n\n await executeRequest()\n}\n\nfunction handleQueryReset(event: MouseEvent) {\n const userOnClick = props.queryFormProps.resetProps?.onClick as ((event: MouseEvent) => void | boolean) | undefined\n const result = userOnClick?.(event)\n if (result === false)\n return false\n\n void handleQuerySubmit()\n\n return result\n}\n\nonMounted(() => {\n if (props.immediate)\n void executeRequest()\n})\n\nwatch([currentPageRef, pageSizeRef], ([currentPage, pageSize], [previousPage, previousPageSize]) => {\n /* istanbul ignore if -- @preserve defensive: watcher is retained when pagination is dynamically toggled off */\n if (!props.pagination)\n return\n\n const currentChanged = currentPage !== previousPage\n const pageSizeChanged = pageSize !== previousPageSize\n\n /* istanbul ignore if -- @preserve defensive: keep guard for unexpected duplicated watcher payload */\n if (!currentChanged && !pageSizeChanged)\n return\n\n if (pageSizeChanged && currentPage !== 1) {\n currentPageRef.value = 1\n return\n }\n\n void executeRequest()\n})\n</script>\n\n<template>\n <FormBaseItem\n v-bind=\"formItemProps\"\n :internal-form-item-class=\"formItemInternalClass\"\n >\n <div :class=\"prefixCls\">\n <component\n :is=\"props.mode === 'light' ? QueryForm.Light : QueryForm\"\n v-bind=\"queryFormBindings\"\n />\n <div :class=\"`${prefixCls}__content`\">\n <slot />\n </div>\n <ElPagination\n v-if=\"props.pagination\"\n v-model:current-page=\"currentPageRef\"\n v-model:page-size=\"pageSizeRef\"\n :class=\"`${prefixCls}__pagination`\"\n v-bind=\"paginationBindings\"\n :total=\"totalRef\"\n />\n </div>\n </FormBaseItem>\n</template>\n","import { connect, mapProps } from '@silver-formily/vue'\nimport { fieldFeedbackMapper } from '../form-item'\nimport QueryFormItemInner from './query-form-item.vue'\nimport './style.scss'\n\nexport type {\n IQueryFormItemProps,\n QueryFormItemMode,\n QueryFormItemPagination,\n QueryFormItemPaginationMap,\n QueryFormItemPaginationProps,\n QueryFormItemQueryProps,\n QueryFormItemRequest,\n QueryFormItemRequestResultObject,\n QueryFormItemRequestSuccessPayload,\n} from './types'\n\nexport const QueryFormItem = connect<typeof QueryFormItemInner>(\n QueryFormItemInner,\n mapProps(\n {\n validateStatus: true,\n title: 'label',\n required: true,\n description: 'extra',\n },\n fieldFeedbackMapper,\n ),\n)\n\nexport default QueryFormItem\n"],"names":["props","__props","emit","__emit","defaultPaginationProps","defaultPaginationRequestMapping","fieldRef","useField","internalQueryForm","createForm","prefixCls","stylePrefix","formItemInternalClass","formItemProps","useCleanAttrs","paginationBindings","computed","currentPage","pageSize","bindings","currentPageRef","ref","pageSizeRef","totalRef","currentRequestId","activeQueryForm","useQueryFormForm","queryFormBindings","handleQuerySubmit","handleQueryReset","executeRequest","field","requestId","queryValues","paginationData","requestParams","result","isNum","error","event","userOnClick","onMounted","watch","previousPage","previousPageSize","currentChanged","pageSizeChanged","_openBlock","_createBlock","_unref","_mergeProps","_createElementVNode","_resolveDynamicComponent","QueryForm","_normalizeProps","_guardReactiveProps","_renderSlot","_ctx","$event","QueryFormItem","connect","QueryFormItemInner","mapProps","fieldFeedbackMapper"],"mappings":"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"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { ISchema } from '@formily/json-schema';
|
|
2
|
+
import { PropType } from 'vue';
|
|
3
|
+
import { QueryFormItemMode, QueryFormItemPaginationMap, QueryFormItemPaginationProps, QueryFormItemQueryProps, QueryFormItemRequest, QueryFormItemRequestSuccessPayload } from './types';
|
|
4
|
+
declare function __VLS_template(): {
|
|
5
|
+
attrs: Partial<{}>;
|
|
6
|
+
slots: {
|
|
7
|
+
default?(_: {}): any;
|
|
8
|
+
};
|
|
9
|
+
refs: {};
|
|
10
|
+
rootEl: any;
|
|
11
|
+
};
|
|
12
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
13
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
14
|
+
mode: {
|
|
15
|
+
type: PropType<QueryFormItemMode>;
|
|
16
|
+
default: string;
|
|
17
|
+
};
|
|
18
|
+
request: PropType<QueryFormItemRequest>;
|
|
19
|
+
clearOnDataChange: {
|
|
20
|
+
type: BooleanConstructor;
|
|
21
|
+
default: boolean;
|
|
22
|
+
};
|
|
23
|
+
querySchema: PropType<ISchema>;
|
|
24
|
+
queryFormProps: {
|
|
25
|
+
type: PropType<QueryFormItemQueryProps>;
|
|
26
|
+
default: () => {};
|
|
27
|
+
};
|
|
28
|
+
pagination: {
|
|
29
|
+
type: BooleanConstructor;
|
|
30
|
+
default: boolean;
|
|
31
|
+
};
|
|
32
|
+
paginationProps: {
|
|
33
|
+
type: PropType<QueryFormItemPaginationProps>;
|
|
34
|
+
default: () => {};
|
|
35
|
+
};
|
|
36
|
+
paginationMap: {
|
|
37
|
+
type: PropType<QueryFormItemPaginationMap>;
|
|
38
|
+
default: () => {};
|
|
39
|
+
};
|
|
40
|
+
immediate: {
|
|
41
|
+
type: BooleanConstructor;
|
|
42
|
+
default: boolean;
|
|
43
|
+
};
|
|
44
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
45
|
+
requestSuccess: (payload: QueryFormItemRequestSuccessPayload) => any;
|
|
46
|
+
requestFailed: (error: any) => any;
|
|
47
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
48
|
+
mode: {
|
|
49
|
+
type: PropType<QueryFormItemMode>;
|
|
50
|
+
default: string;
|
|
51
|
+
};
|
|
52
|
+
request: PropType<QueryFormItemRequest>;
|
|
53
|
+
clearOnDataChange: {
|
|
54
|
+
type: BooleanConstructor;
|
|
55
|
+
default: boolean;
|
|
56
|
+
};
|
|
57
|
+
querySchema: PropType<ISchema>;
|
|
58
|
+
queryFormProps: {
|
|
59
|
+
type: PropType<QueryFormItemQueryProps>;
|
|
60
|
+
default: () => {};
|
|
61
|
+
};
|
|
62
|
+
pagination: {
|
|
63
|
+
type: BooleanConstructor;
|
|
64
|
+
default: boolean;
|
|
65
|
+
};
|
|
66
|
+
paginationProps: {
|
|
67
|
+
type: PropType<QueryFormItemPaginationProps>;
|
|
68
|
+
default: () => {};
|
|
69
|
+
};
|
|
70
|
+
paginationMap: {
|
|
71
|
+
type: PropType<QueryFormItemPaginationMap>;
|
|
72
|
+
default: () => {};
|
|
73
|
+
};
|
|
74
|
+
immediate: {
|
|
75
|
+
type: BooleanConstructor;
|
|
76
|
+
default: boolean;
|
|
77
|
+
};
|
|
78
|
+
}>> & Readonly<{
|
|
79
|
+
onRequestSuccess?: (payload: QueryFormItemRequestSuccessPayload) => any;
|
|
80
|
+
onRequestFailed?: (error: any) => any;
|
|
81
|
+
}>, {
|
|
82
|
+
mode: QueryFormItemMode;
|
|
83
|
+
immediate: boolean;
|
|
84
|
+
pagination: boolean;
|
|
85
|
+
paginationProps: Partial<import('element-plus').PaginationProps>;
|
|
86
|
+
clearOnDataChange: boolean;
|
|
87
|
+
queryFormProps: QueryFormItemQueryProps;
|
|
88
|
+
paginationMap: QueryFormItemPaginationMap;
|
|
89
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
90
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
91
|
+
export default _default;
|
|
92
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
93
|
+
new (): {
|
|
94
|
+
$slots: S;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Form } from '@formily/core';
|
|
2
|
+
import { ISchema } from '@formily/json-schema';
|
|
3
|
+
import { PaginationProps } from 'element-plus';
|
|
4
|
+
import { IFormItemProps } from '../form-item';
|
|
5
|
+
import { IQueryFormLightProps, IQueryFormProps } from '../query-form';
|
|
6
|
+
export type QueryFormItemMode = 'default' | 'light';
|
|
7
|
+
export interface QueryFormItemPagination {
|
|
8
|
+
current: number;
|
|
9
|
+
pageSize: number;
|
|
10
|
+
}
|
|
11
|
+
export interface QueryFormItemPaginationMap {
|
|
12
|
+
current?: string;
|
|
13
|
+
pageSize?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface QueryFormItemRequestResultObject {
|
|
16
|
+
data: any[];
|
|
17
|
+
success: boolean;
|
|
18
|
+
total?: number;
|
|
19
|
+
}
|
|
20
|
+
export type QueryFormItemRequest = (params: Record<string, any> & Partial<QueryFormItemPagination>) => Promise<QueryFormItemRequestResultObject>;
|
|
21
|
+
export type QueryFormItemPaginationProps = Partial<PaginationProps>;
|
|
22
|
+
type QueryFormDefaultProps = Omit<IQueryFormProps, 'schema'>;
|
|
23
|
+
type QueryFormLightProps = Omit<IQueryFormLightProps, 'schema'>;
|
|
24
|
+
export type QueryFormItemQueryProps = Partial<QueryFormDefaultProps & QueryFormLightProps> & {
|
|
25
|
+
form?: Form | (() => Form | undefined);
|
|
26
|
+
schema?: ISchema;
|
|
27
|
+
};
|
|
28
|
+
export interface IQueryFormItemProps extends IFormItemProps {
|
|
29
|
+
mode?: QueryFormItemMode;
|
|
30
|
+
request?: QueryFormItemRequest;
|
|
31
|
+
clearOnDataChange?: boolean;
|
|
32
|
+
querySchema?: ISchema;
|
|
33
|
+
queryFormProps?: QueryFormItemQueryProps;
|
|
34
|
+
pagination?: boolean;
|
|
35
|
+
paginationProps?: QueryFormItemPaginationProps;
|
|
36
|
+
paginationMap?: QueryFormItemPaginationMap;
|
|
37
|
+
immediate?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface QueryFormItemRequestSuccessPayload {
|
|
40
|
+
values: Record<string, any>;
|
|
41
|
+
pagination?: QueryFormItemPagination;
|
|
42
|
+
dataSource: any[];
|
|
43
|
+
total?: number;
|
|
44
|
+
result: QueryFormItemRequestResultObject;
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|