@qin-ui/antd-vue-pro 2.3.2 → 2.3.4
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/api.json +1 -1
- package/es/antd-vue-pro.css +11 -11
- package/es/components/form/components/BaseFormItem/index.vue.d.ts.map +1 -1
- package/es/components/form/components/ProForm/index.vue.d.ts.map +1 -1
- package/es/components/form/constants/index.d.ts +1 -6
- package/es/components/form/constants/index.d.ts.map +1 -1
- package/es/components/form/hooks/useGroupFieldAttrs.d.ts +18 -0
- package/es/components/form/hooks/useGroupFieldAttrs.d.ts.map +1 -0
- package/es/components/table/components/ColumnControl.vue.d.ts.map +1 -1
- package/es/components/table/components/ProTable.vue.d.ts.map +1 -1
- package/es/components/table/components/SearchForm.vue.d.ts.map +1 -1
- package/es/index.js +162 -148
- package/es/index.js.map +1 -1
- package/es/shared/core/index.d.ts +1 -1
- package/es/shared/core/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/components/form/components/BaseField/index.vue +8 -8
- package/src/components/form/components/BaseFormItem/index.vue +50 -66
- package/src/components/form/components/ProForm/index.vue +5 -11
- package/src/components/form/constants/index.ts +1 -7
- package/src/components/form/hooks/useGroupFieldAttrs.ts +120 -0
- package/src/components/table/components/ColumnControl.vue +7 -2
- package/src/components/table/components/ProTable.vue +2 -13
- package/src/components/table/components/SearchForm.vue +81 -15
- package/src/shared/core/index.ts +1 -1
- package/es/components/form/components/GroupedFieldAttrs/index.vue.d.ts +0 -29
- package/es/components/form/components/GroupedFieldAttrs/index.vue.d.ts.map +0 -1
- package/es/components/form/components/PathProvider/index.vue.d.ts +0 -24
- package/es/components/form/components/PathProvider/index.vue.d.ts.map +0 -1
- package/src/components/form/components/GroupedFieldAttrs/index.vue +0 -118
- package/src/components/form/components/PathProvider/index.vue +0 -19
package/api.json
CHANGED
package/es/antd-vue-pro.css
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
.pro-table_search-form[data-v-
|
|
1
|
+
.pro-table_search-form[data-v-7bd701e4] [class*='-form-item'] {
|
|
2
2
|
margin: 0;
|
|
3
3
|
}
|
|
4
|
-
.pro-table_search-form_expand-toggle-button[data-v-
|
|
4
|
+
.pro-table_search-form_expand-toggle-button[data-v-7bd701e4] {
|
|
5
5
|
display: flex;
|
|
6
6
|
align-items: center;
|
|
7
7
|
padding: 0;
|
|
8
8
|
padding-left: 4px;
|
|
9
9
|
}
|
|
10
|
-
.pro-table_search-form .transition[data-v-
|
|
10
|
+
.pro-table_search-form .transition[data-v-7bd701e4] {
|
|
11
11
|
transition: all 0.25s;
|
|
12
12
|
}
|
|
13
13
|
.pro-table_search-form-container[data-v-c385cd54] {
|
|
@@ -27,32 +27,32 @@
|
|
|
27
27
|
.pro-table_size-control_button[data-v-a718ce24] svg {
|
|
28
28
|
transform: scale(1.3);
|
|
29
29
|
}
|
|
30
|
-
.pro-table_column-control_button[data-v-
|
|
30
|
+
.pro-table_column-control_button[data-v-9899456e] {
|
|
31
31
|
display: flex;
|
|
32
32
|
align-items: center;
|
|
33
33
|
padding-right: 12px;
|
|
34
34
|
padding-left: 12px;
|
|
35
35
|
}
|
|
36
|
-
.pro-table_column-control_button[data-v-
|
|
36
|
+
.pro-table_column-control_button[data-v-9899456e] svg {
|
|
37
37
|
transform: scale(1.2, 1.4);
|
|
38
38
|
}
|
|
39
|
-
.pro-table_header[data-v-
|
|
39
|
+
.pro-table_header[data-v-ff6f01f4] {
|
|
40
40
|
display: flex;
|
|
41
41
|
align-items: center;
|
|
42
42
|
justify-content: flex-end;
|
|
43
43
|
}
|
|
44
|
-
.pro-table_header[data-v-
|
|
44
|
+
.pro-table_header[data-v-ff6f01f4]:empty {
|
|
45
45
|
display: none;
|
|
46
46
|
}
|
|
47
|
-
.pro-table_header + .pro-table_header_content[data-v-
|
|
47
|
+
.pro-table_header + .pro-table_header_content[data-v-ff6f01f4] {
|
|
48
48
|
margin-top: 16px;
|
|
49
49
|
}
|
|
50
|
-
.pro-table_header_button-bar[data-v-
|
|
50
|
+
.pro-table_header_button-bar[data-v-ff6f01f4] {
|
|
51
51
|
flex: 1;
|
|
52
52
|
}
|
|
53
|
-
.pro-table_header_toolbar[data-v-
|
|
53
|
+
.pro-table_header_toolbar[data-v-ff6f01f4] {
|
|
54
54
|
margin-left: 12px;
|
|
55
55
|
}
|
|
56
|
-
.pro-table[data-v-
|
|
56
|
+
.pro-table[data-v-ff6f01f4] [class*='-pagination'] [class*='-pagination-total-text'] {
|
|
57
57
|
flex: 1;
|
|
58
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/BaseFormItem/index.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/BaseFormItem/index.vue"],"names":[],"mappings":"AAsLA,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAOhD,KAAK,KAAK,GAAG;IACX,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;;AAmOF,wBAMG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/ProForm/index.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/ProForm/index.vue"],"names":[],"mappings":"AAyGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,OAAO,EAAiB,SAAS,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAyC,KAAK,IAAI,EAAE,MAAM,KAAK,CAAC;AAIvE,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAa,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,IAAI,EAAsB,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;yBAE/B,CAAC,SAAS,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,EAC1C,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;WAoHO,mBAAmB,CAAC;eA/GN,IAAI;eAAS,CAAC;yDA+G0D,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;wDA1FgC,CAAC;;;;mBAEjB,OAAO;;iBAGwB,IAAI;8CALnB,CAAC;;;;mBAEjB,OAAO;;iBAGwB,IAAI;;UAuFvD,EAAE;EAEL,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AA/HzE,wBA+H4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
|
@@ -69,10 +69,5 @@ export type GetComponentType<K extends ComponentName> = K extends keyof Componen
|
|
|
69
69
|
* 组件名称到 Ant Design Vue 组件的映射
|
|
70
70
|
*/
|
|
71
71
|
export declare const componentMap: BaseComponentMap;
|
|
72
|
-
|
|
73
|
-
* Teleport 组件名称前缀
|
|
74
|
-
* @description 用于通过插槽动态替换指定 path 的组件
|
|
75
|
-
*/
|
|
76
|
-
export declare const TeleportComponentNamePrefix = "TeleportComponent_";
|
|
77
|
-
export { InjectionFormKey, InjectionPathKey } from '../../../shared/core';
|
|
72
|
+
export { InjectionFormKey, InjectionFormSlotsKey } from '../../../shared/core';
|
|
78
73
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/form/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,aAAa,EACb,UAAU,EACV,KAAK,EACL,WAAW,EACX,aAAa,EACb,WAAW,EACX,UAAU,EACV,MAAM,EACN,MAAM,EACN,MAAM,EACN,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,UAAU,EACV,WAAW,EACZ,MAAM,oBAAoB,CAAC;AAE5B;;;GAGG;AACH,eAAO,MAAM,mBAAmB,gDAKtB,CAAC;AAEX;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,WAAW,YAAY;CAAG;AAEhC;;;GAGG;AAEH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,OAAO,KAAK,CAAC;IACtB,UAAU,EAAE,OAAO,QAAQ,CAAC;IAC5B,cAAc,EAAE,OAAO,WAAW,CAAC;IACnC,gBAAgB,EAAE,OAAO,aAAa,CAAC;IACvC,cAAc,EAAE,OAAO,WAAW,CAAC;IACnC,QAAQ,EAAE,OAAO,MAAM,CAAC;IACxB,UAAU,EAAE,OAAO,QAAQ,CAAC;IAC5B,aAAa,EAAE,OAAO,UAAU,CAAC;IACjC,cAAc,EAAE,OAAO,WAAW,CAAC;IACnC,aAAa,EAAE,OAAO,UAAU,CAAC;IACjC,gBAAgB,EAAE,OAAO,aAAa,CAAC;IACvC,aAAa,EAAE,OAAO,UAAU,CAAC;IACjC,QAAQ,EAAE,OAAO,MAAM,CAAC;IACxB,QAAQ,EAAE,OAAO,MAAM,CAAC;IACxB,aAAa,EAAE,OAAO,UAAU,CAAC;IACjC,UAAU,EAAE,OAAO,QAAQ,CAAC;CAC7B,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,aAAa,GACrB,MAAM,gBAAgB,GACtB,MAAM,YAAY,GAClB,QAAQ,CAAC;AAEb;;;GAGG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,aAAa,IAClD,CAAC,SAAS,MAAM,YAAY,GACxB,YAAY,CAAC,CAAC,CAAC,GACf,CAAC,SAAS,MAAM,gBAAgB,GAC9B,gBAAgB,CAAC,CAAC,CAAC,GACnB,KAAK,CAAC;AAEd;;GAEG;AAEH,eAAO,MAAM,YAAY,EAAE,gBAiB1B,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/form/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,aAAa,EACb,UAAU,EACV,KAAK,EACL,WAAW,EACX,aAAa,EACb,WAAW,EACX,UAAU,EACV,MAAM,EACN,MAAM,EACN,MAAM,EACN,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,UAAU,EACV,WAAW,EACZ,MAAM,oBAAoB,CAAC;AAE5B;;;GAGG;AACH,eAAO,MAAM,mBAAmB,gDAKtB,CAAC;AAEX;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,WAAW,YAAY;CAAG;AAEhC;;;GAGG;AAEH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,OAAO,KAAK,CAAC;IACtB,UAAU,EAAE,OAAO,QAAQ,CAAC;IAC5B,cAAc,EAAE,OAAO,WAAW,CAAC;IACnC,gBAAgB,EAAE,OAAO,aAAa,CAAC;IACvC,cAAc,EAAE,OAAO,WAAW,CAAC;IACnC,QAAQ,EAAE,OAAO,MAAM,CAAC;IACxB,UAAU,EAAE,OAAO,QAAQ,CAAC;IAC5B,aAAa,EAAE,OAAO,UAAU,CAAC;IACjC,cAAc,EAAE,OAAO,WAAW,CAAC;IACnC,aAAa,EAAE,OAAO,UAAU,CAAC;IACjC,gBAAgB,EAAE,OAAO,aAAa,CAAC;IACvC,aAAa,EAAE,OAAO,UAAU,CAAC;IACjC,QAAQ,EAAE,OAAO,MAAM,CAAC;IACxB,QAAQ,EAAE,OAAO,MAAM,CAAC;IACxB,aAAa,EAAE,OAAO,UAAU,CAAC;IACjC,UAAU,EAAE,OAAO,QAAQ,CAAC;CAC7B,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,aAAa,GACrB,MAAM,gBAAgB,GACtB,MAAM,YAAY,GAClB,QAAQ,CAAC;AAEb;;;GAGG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,aAAa,IAClD,CAAC,SAAS,MAAM,YAAY,GACxB,YAAY,CAAC,CAAC,CAAC,GACf,CAAC,SAAS,MAAM,gBAAgB,GAC9B,gBAAgB,CAAC,CAAC,CAAC,GACnB,KAAK,CAAC;AAEd;;GAEG;AAEH,eAAO,MAAM,YAAY,EAAE,gBAiB1B,CAAA;AAGD,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
import { FormItemProps, GridItemProps } from '../../../shared/ui';
|
|
3
|
+
import { FORM_ITEM_SLOT_KEYS } from '../constants';
|
|
4
|
+
import { Base, Field } from '../types';
|
|
5
|
+
export interface GroupedField {
|
|
6
|
+
path: string;
|
|
7
|
+
gridItemProps: GridItemProps;
|
|
8
|
+
formItemProps: FormItemProps;
|
|
9
|
+
formItemSlots: Record<(typeof FORM_ITEM_SLOT_KEYS)[number], any>;
|
|
10
|
+
componentProps: Record<string, any>;
|
|
11
|
+
formItemContainer?: Base['formItemContainer'];
|
|
12
|
+
rawField: Field;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 将 fields 配置数组逐个拆分为 grid / formItem / component / slots 分组。
|
|
16
|
+
*/
|
|
17
|
+
export declare function useGroupFieldAttrs(validFields: ComputedRef<Field[]>): ComputedRef<GroupedField[]>;
|
|
18
|
+
//# sourceMappingURL=useGroupFieldAttrs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGroupFieldAttrs.d.ts","sourceRoot":"","sources":["../../../../src/components/form/hooks/useGroupFieldAttrs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyC,KAAK,WAAW,EAAE,MAAM,KAAK,CAAC;AAC9E,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAO5C,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,aAAa,CAAC;IAC7B,aAAa,EAAE,aAAa,CAAC;IAC7B,aAAa,EAAE,MAAM,CAAC,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC;IACjE,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC,iBAAiB,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAC9C,QAAQ,EAAE,KAAK,CAAC;CACjB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,WAAW,CAAC,KAAK,EAAE,CAAC,+BAyFnE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColumnControl.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/table/components/ColumnControl.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ColumnControl.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/table/components/ColumnControl.vue"],"names":[],"mappings":"AA6MA,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAI/C,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,aAAa,CAAC,EAAE,mBAAmB,CAAC;CACrC,CAAC;;AAqTF,wBAOG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProTable.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/table/components/ProTable.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProTable.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/table/components/ProTable.vue"],"names":[],"mappings":"AAuYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAGL,UAAU,EACV,UAAU,EAEX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAML,KAAK,IAAI,EACV,MAAM,KAAK,CAAC;AAGb,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAIL,IAAI,EACL,MAAM,sBAAsB,CAAC;AAQ9B,OAAO,EAAE,MAAM,EAAW,mBAAmB,EAAE,MAAM,UAAU,CAAC;yBAE/C,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;WAicO,mBAAmB,CAAC;;;;eA1NnB,UAAU,CAAC,MAAM,CAAC;kBACf,OAAO;;gBAvNT,CAAC;iBAEA,MAAM,OAAO,CAAC,OAAO,CAAC;yBAEd,OAAO;0BAEN,OAAO;kBAEf,OAAO,GAAG,OAAO;yBArBd,OAAO;2BACL,OAAO,GAAG,mBAAmB,CAAC,IAAI,4BAsIc,CAAC,iEAtIH,CAAC;UAoB1B;;qBAf3B,OAAO;wBAEJ,kBAAkB,GAAG,KAAK;;yBAiBrB,kBAAkB,GAAG,KAAK;sCAoaiD,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;;;;;;;;;;;;;;;;;;;;;;;mBAhWI,CAAC,KAAK,EAAE;YACjB,IAAI,EAAE,GAAG,CAAC;YACV,KAAK,EAAE,GAAG,CAAC;YACX,MAAM,6BAqCqD,CAAC,iEArCzC;YACnB,KAAK,EAAE,MAAM,CAAC;YACd,MAAM,EAAE,MAAM,4BAmC6C,CAAC,iEAnClC,CAAC;SAC5B,KAAK,IAAI;;;;;;;;;;;;;;;;;;;;;;;;mBANC,CAAC,KAAK,EAAE;YACjB,IAAI,EAAE,GAAG,CAAC;YACV,KAAK,EAAE,GAAG,CAAC;YACX,MAAM,6BAqCqD,CAAC,iEArCzC;YACnB,KAAK,EAAE,MAAM,CAAC;YACd,MAAM,EAAE,MAAM,4BAmC6C,CAAC,iEAnClC,CAAC;SAC5B,KAAK,IAAI;;;EA8VV,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AA5czE,wBA4c4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchForm.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/table/components/SearchForm.vue"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"SearchForm.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/table/components/SearchForm.vue"],"names":[],"mappings":"AAAA,OAgYO,EAAiB,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EACL,qBAAqB,EAOrB,KAAK,SAAS,EACd,KAAK,eAAe,EACrB,MAAM,KAAK,CAAC;AAEb,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAKvC,KAAK,MAAM,GAAG;IAEZ,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,KAAK,UAAU,GAAG,IAAI,CACpB,OAAO,CAAC,SAAS,CAAC,EAChB,OAAO,GACP,UAAU,GACV,kBAAkB,GAClB,YAAY,GACZ,UAAU,GACV,WAAW,GACX,MAAM,GACN,YAAY,CACf,CAAC;AAEF,KAAK,WAAW,GAAG;IAAE,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AAC3C,KAAK,iBAAiB,GAAG,WAAW,GAAG;IAAE,YAAY,EAAE,OAAO,CAAA;CAAE,CAAC;AAEjE,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC3B,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,GAAG,eAAe,CAAC,WAAW,CAAC,GAAG,KAAK,CAAC;IAC7E,WAAW,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,GAAG,eAAe,CAAC,WAAW,CAAC,GAAG,KAAK,CAAC;IAC5E,YAAY,CAAC,EACT,SAAS,CAAC,iBAAiB,CAAC,GAC5B,eAAe,CAAC,iBAAiB,CAAC,GAClC,KAAK,CAAC;IACV,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,iBAAiB,CAAC,UAAU,GAC9B,qBAAqB,CAAC;;;;;;;;;;QA2Za,GAAG;;;QACF,GAAG;;;QACH,GAAG;;AA3ZzC,wBAycK;AAQL,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
package/es/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "./antd-vue-pro.css";
|
|
2
|
-
import {
|
|
3
|
-
import { InjectionPathKey, isPlainObject, getObject, toPath, useForm as useForm$1, resolveLocaleName, zhTW, enUS, zhCN, format, omit, cloneDeep, InjectionFormKey, camelizeProperties, useFields as useFields$1, useFormRef as useFormRef$1, pick, useTable as useTable$1 } from "@qin-ui/pro-components-core";
|
|
4
|
-
import { enUS as enUS2, useFormData, zhCN as zhCN2, zhTW as zhTW2 } from "@qin-ui/pro-components-core";
|
|
2
|
+
import { inject, computed, mergeProps, toValue, defineComponent, resolveComponent, createBlock, openBlock, unref, withCtx, createElementBlock, Fragment, renderList, createVNode, createSlots, ref, useAttrs, createCommentVNode, resolveDynamicComponent, renderSlot, normalizeProps, isVNode, createTextVNode, toDisplayString, provide, useSlots, reactive, createElementVNode, onBeforeUnmount, watch, watchEffect, normalizeStyle, nextTick, useModel, onMounted, mergeModels, normalizeClass, guardReactiveProps } from "vue";
|
|
5
3
|
import { Transfer, TreeSelect, Slider, Switch, RadioGroup, CheckboxGroup, TimePicker, RangePicker, DatePicker, Cascader, Select, InputNumber, InputPassword, InputSearch, Textarea, Input, Row, Col, FormItem, Form, Space, Button, theme, Dropdown, Menu, MenuItem, Checkbox, MenuDivider, Table } from "ant-design-vue";
|
|
6
|
-
import {
|
|
4
|
+
import { isPlainObject, getObject, toPath, useForm as useForm$1, resolveLocaleName, zhTW, enUS, zhCN, format, omit, InjectionFormSlotsKey, cloneDeep, InjectionFormKey, camelizeProperties, useFields as useFields$1, useFormRef as useFormRef$1, pick, useTable as useTable$1 } from "@qin-ui/pro-components-core";
|
|
5
|
+
import { enUS as enUS2, useFormData, zhCN as zhCN2, zhTW as zhTW2 } from "@qin-ui/pro-components-core";
|
|
7
6
|
import { colProps } from "ant-design-vue/es/grid/Col";
|
|
7
|
+
import { formItemProps, useInjectFormItemContext } from "ant-design-vue/es/form";
|
|
8
8
|
import { useConfigContextInject } from "ant-design-vue/es/config-provider/context";
|
|
9
9
|
import { useProviderDisabled, useInjectDisabled } from "ant-design-vue/es/config-provider/DisabledContext";
|
|
10
10
|
import { tableProps } from "ant-design-vue/es/table";
|
|
@@ -169,43 +169,21 @@ const componentMap = {
|
|
|
169
169
|
"tree-select": TreeSelect,
|
|
170
170
|
"transfer": Transfer
|
|
171
171
|
};
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
return Array.isArray(props.path) ? props.path.join(".") : props.path;
|
|
182
|
-
});
|
|
183
|
-
provide(InjectionPathKey, namePath);
|
|
184
|
-
return (_ctx, _cache) => {
|
|
185
|
-
return renderSlot(_ctx.$slots, "default", { path: namePath.value });
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
|
-
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
190
|
-
__name: "index",
|
|
191
|
-
props: {
|
|
192
|
-
field: {}
|
|
193
|
-
},
|
|
194
|
-
setup(__props) {
|
|
195
|
-
const formItemPropKeys = Object.keys(formItemProps()).concat([
|
|
196
|
-
"formItemContainer"
|
|
197
|
-
]);
|
|
198
|
-
const gridItemPropKeys = Object.keys(colProps());
|
|
199
|
-
const props = __props;
|
|
200
|
-
const config = INJECT_CONFIG["pro-form-item"];
|
|
201
|
-
const injectFormItemProps = inject(config.injectionKey, config.default);
|
|
202
|
-
const groupedAttributes = computed(() => {
|
|
172
|
+
const formItemPropKeys = Object.keys(formItemProps()).concat([
|
|
173
|
+
"formItemContainer"
|
|
174
|
+
]);
|
|
175
|
+
const gridItemPropKeys = Object.keys(colProps());
|
|
176
|
+
function useGroupFieldAttrs(validFields) {
|
|
177
|
+
const config = INJECT_CONFIG["pro-form-item"];
|
|
178
|
+
const injectFormItemProps = inject(config.injectionKey, config.default);
|
|
179
|
+
return computed(() => {
|
|
180
|
+
return validFields.value.map((field) => {
|
|
203
181
|
let gridItemProps2 = {};
|
|
204
182
|
let formItemProps2 = {};
|
|
205
183
|
const componentProps = { slots: {} };
|
|
206
184
|
const formItemSlots = {};
|
|
207
|
-
if (isPlainObject(
|
|
208
|
-
const { path, name, fields, formItemClass, formItemStyle, hidden, span, getFormItemRef, getComponentRef, getFormItemComputedProps, getComponentComputedProps, slots = {}, formItemDataAttrs = {}, componentDataAttrs = {}, extraProps, ...rest } =
|
|
185
|
+
if (isPlainObject(field)) {
|
|
186
|
+
const { path, name, fields, formItemClass, formItemStyle, hidden, span, getFormItemRef, getComponentRef, getFormItemComputedProps, getComponentComputedProps, slots = {}, formItemDataAttrs = {}, componentDataAttrs = {}, extraProps, formItemContainer, ...rest } = field;
|
|
209
187
|
const {
|
|
210
188
|
class: injectClassName,
|
|
211
189
|
style: injectStyle,
|
|
@@ -240,17 +218,32 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
240
218
|
if (FORM_ITEM_SLOT_KEYS.includes(k)) {
|
|
241
219
|
formItemSlots[k] = slots[k];
|
|
242
220
|
} else {
|
|
243
|
-
componentProps
|
|
221
|
+
componentProps.slots[k] = slots[k];
|
|
244
222
|
}
|
|
245
223
|
});
|
|
224
|
+
const raw2 = toValue(name) ?? toValue(path);
|
|
225
|
+
return {
|
|
226
|
+
path: Array.isArray(raw2) ? raw2.join(".") : raw2 || "",
|
|
227
|
+
gridItemProps: gridItemProps2,
|
|
228
|
+
formItemProps: formItemProps2,
|
|
229
|
+
formItemSlots,
|
|
230
|
+
componentProps,
|
|
231
|
+
formItemContainer,
|
|
232
|
+
rawField: field
|
|
233
|
+
};
|
|
246
234
|
}
|
|
247
|
-
|
|
235
|
+
const raw = toValue(field == null ? void 0 : field.name) ?? toValue(field == null ? void 0 : field.path);
|
|
236
|
+
return {
|
|
237
|
+
path: Array.isArray(raw) ? raw.join(".") : raw || "",
|
|
238
|
+
gridItemProps: gridItemProps2,
|
|
239
|
+
formItemProps: formItemProps2,
|
|
240
|
+
formItemSlots,
|
|
241
|
+
componentProps,
|
|
242
|
+
rawField: field
|
|
243
|
+
};
|
|
248
244
|
});
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
};
|
|
252
|
-
}
|
|
253
|
-
});
|
|
245
|
+
});
|
|
246
|
+
}
|
|
254
247
|
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
255
248
|
...{ name: "BaseFormItem", inheritAttrs: false },
|
|
256
249
|
__name: "index",
|
|
@@ -296,81 +289,66 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
296
289
|
}
|
|
297
290
|
});
|
|
298
291
|
};
|
|
292
|
+
const groupedFields = useGroupFieldAttrs(validFields);
|
|
299
293
|
return (_ctx, _cache) => {
|
|
300
294
|
const _component_BaseFormItem = resolveComponent("BaseFormItem");
|
|
301
295
|
return openBlock(), createBlock(unref(_sfc_main$c), mergeProps({
|
|
302
296
|
component: enableGrid.value ? unref(Row) : void 0
|
|
303
297
|
}, computedGridProps.value), {
|
|
304
298
|
default: withCtx(() => [
|
|
305
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
306
|
-
return openBlock(), createBlock(_sfc_main$
|
|
307
|
-
key:
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
299
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(groupedFields), (item, index2) => {
|
|
300
|
+
return openBlock(), createBlock(unref(_sfc_main$c), mergeProps({
|
|
301
|
+
key: item.path || index2,
|
|
302
|
+
component: enableGrid.value ? unref(Col) : void 0
|
|
303
|
+
}, { ref_for: true }, item.gridItemProps), {
|
|
304
|
+
default: withCtx(() => [
|
|
305
|
+
createVNode(unref(_sfc_main$c), {
|
|
306
|
+
component: item.formItemContainer,
|
|
307
|
+
path: item.path
|
|
308
|
+
}, {
|
|
309
|
+
default: withCtx(() => [
|
|
310
|
+
createVNode(unref(FormItem), mergeProps({ ref_for: true }, item.formItemProps, {
|
|
311
|
+
ref_for: true,
|
|
312
|
+
ref: (el) => formItemRefs[index2] = el,
|
|
313
|
+
name: unref(toPath)(item.path),
|
|
314
|
+
path: item.path,
|
|
315
|
+
onVnodeMounted: ($event) => onFormItemMounted(index2, item.formItemProps)
|
|
316
|
+
}), createSlots({
|
|
320
317
|
default: withCtx(() => [
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
field.fields ? (openBlock(), createBlock(_component_BaseFormItem, {
|
|
335
|
-
key: 0,
|
|
336
|
-
grid: field.grid ?? __props.grid,
|
|
337
|
-
fields: field.fields,
|
|
338
|
-
disabled: toValue(field.disabled)
|
|
339
|
-
}, null, 8, ["grid", "fields", "disabled"])) : (openBlock(), createBlock(unref(_sfc_main$d), mergeProps({
|
|
340
|
-
key: 1,
|
|
341
|
-
ref_for: true,
|
|
342
|
-
ref: (el) => componentRefs[index2] = el
|
|
343
|
-
}, { ref_for: true }, componentProps, {
|
|
344
|
-
path,
|
|
345
|
-
onVnodeMounted: ($event) => onComponentMounted(index2)
|
|
346
|
-
}), null, 16, ["path", "onVnodeMounted"]))
|
|
347
|
-
]),
|
|
348
|
-
_: 2
|
|
349
|
-
}, [
|
|
350
|
-
renderList(formItemSlots, (slot, name) => {
|
|
351
|
-
return {
|
|
352
|
-
name,
|
|
353
|
-
fn: withCtx((scoped) => [
|
|
354
|
-
createVNode(unref(_sfc_main$b), mergeProps({
|
|
355
|
-
path,
|
|
356
|
-
component: slot
|
|
357
|
-
}, { ref_for: true }, scoped), null, 16, ["path", "component"])
|
|
358
|
-
])
|
|
359
|
-
};
|
|
360
|
-
})
|
|
361
|
-
]), 1040, ["name", "path", "onVnodeMounted"])
|
|
362
|
-
]),
|
|
363
|
-
_: 2
|
|
364
|
-
}, 1032, ["component", "path"])
|
|
318
|
+
item.rawField.fields ? (openBlock(), createBlock(_component_BaseFormItem, {
|
|
319
|
+
key: 0,
|
|
320
|
+
grid: item.rawField.grid ?? __props.grid,
|
|
321
|
+
fields: item.rawField.fields,
|
|
322
|
+
disabled: toValue(item.rawField.disabled)
|
|
323
|
+
}, null, 8, ["grid", "fields", "disabled"])) : (openBlock(), createBlock(unref(_sfc_main$d), mergeProps({
|
|
324
|
+
key: 1,
|
|
325
|
+
ref_for: true,
|
|
326
|
+
ref: (el) => componentRefs[index2] = el
|
|
327
|
+
}, { ref_for: true }, item.componentProps, {
|
|
328
|
+
path: item.path,
|
|
329
|
+
onVnodeMounted: ($event) => onComponentMounted(index2)
|
|
330
|
+
}), null, 16, ["path", "onVnodeMounted"]))
|
|
365
331
|
]),
|
|
366
332
|
_: 2
|
|
367
|
-
},
|
|
333
|
+
}, [
|
|
334
|
+
renderList(item.formItemSlots, (slot, name) => {
|
|
335
|
+
return {
|
|
336
|
+
name,
|
|
337
|
+
fn: withCtx((scoped) => [
|
|
338
|
+
createVNode(unref(_sfc_main$b), mergeProps({
|
|
339
|
+
path: item.path,
|
|
340
|
+
component: slot
|
|
341
|
+
}, { ref_for: true }, scoped), null, 16, ["path", "component"])
|
|
342
|
+
])
|
|
343
|
+
};
|
|
344
|
+
})
|
|
345
|
+
]), 1040, ["name", "path", "onVnodeMounted"])
|
|
368
346
|
]),
|
|
369
347
|
_: 2
|
|
370
|
-
}, 1032, ["
|
|
348
|
+
}, 1032, ["component", "path"])
|
|
371
349
|
]),
|
|
372
350
|
_: 2
|
|
373
|
-
}, 1040);
|
|
351
|
+
}, 1040, ["component"]);
|
|
374
352
|
}), 128))
|
|
375
353
|
]),
|
|
376
354
|
_: 1
|
|
@@ -496,13 +474,11 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
496
474
|
valueFormatter
|
|
497
475
|
};
|
|
498
476
|
});
|
|
499
|
-
const
|
|
500
|
-
`${TeleportComponentNamePrefix}${__props.path}`,
|
|
501
|
-
void 0
|
|
502
|
-
);
|
|
477
|
+
const formSlots = inject(InjectionFormSlotsKey, void 0);
|
|
503
478
|
const customComponents = inject(INJECT_COMPONENTS, {});
|
|
504
479
|
const is = computed(() => {
|
|
505
|
-
|
|
480
|
+
const teleportSlot = __props.path && (formSlots == null ? void 0 : formSlots[__props.path]);
|
|
481
|
+
if (teleportSlot) return teleportSlot;
|
|
506
482
|
if (typeof __props.component === "string") {
|
|
507
483
|
return customComponents[__props.component] || componentMap[__props.component] || __props.component;
|
|
508
484
|
}
|
|
@@ -587,12 +563,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
587
563
|
config.default
|
|
588
564
|
);
|
|
589
565
|
const slots = useSlots();
|
|
590
|
-
|
|
591
|
-
Object.keys(slots).forEach((name) => {
|
|
592
|
-
if (name === "default") return;
|
|
593
|
-
provide(`${TeleportComponentNamePrefix}${name}`, slots[name]);
|
|
594
|
-
});
|
|
595
|
-
});
|
|
566
|
+
provide(InjectionFormSlotsKey, reactive(slots));
|
|
596
567
|
return (_ctx, _cache) => {
|
|
597
568
|
return openBlock(), createBlock(unref(Form), mergeProps({
|
|
598
569
|
ref: (el) => {
|
|
@@ -663,7 +634,22 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
663
634
|
const emit = __emit;
|
|
664
635
|
const proFormHeight = ref("unset");
|
|
665
636
|
const collapseHeight = ref(0);
|
|
666
|
-
|
|
637
|
+
const rowHeight = ref(32);
|
|
638
|
+
let resizeObserver = null;
|
|
639
|
+
let intersectionObserver = null;
|
|
640
|
+
const cleanupObservers = () => {
|
|
641
|
+
if (resizeObserver) {
|
|
642
|
+
resizeObserver.disconnect();
|
|
643
|
+
resizeObserver = null;
|
|
644
|
+
}
|
|
645
|
+
if (intersectionObserver) {
|
|
646
|
+
intersectionObserver.disconnect();
|
|
647
|
+
intersectionObserver = null;
|
|
648
|
+
}
|
|
649
|
+
};
|
|
650
|
+
onBeforeUnmount(() => {
|
|
651
|
+
cleanupObservers();
|
|
652
|
+
});
|
|
667
653
|
const computedExpand = computed(() => {
|
|
668
654
|
if (!__props.expand) return false;
|
|
669
655
|
if (__props.expand === true) return { minExpandRows: 2, expandStatus: false };
|
|
@@ -674,33 +660,57 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
674
660
|
});
|
|
675
661
|
const showExpandToggle = ref(false);
|
|
676
662
|
const expandStatus = ref(true);
|
|
663
|
+
const { formRef, getFormData } = __props.form;
|
|
664
|
+
const updateHeights = () => {
|
|
665
|
+
var _a, _b, _c, _d, _e, _f;
|
|
666
|
+
if (!__props.expand || !formRef.value) return;
|
|
667
|
+
const proFormEl = (_a = formRef.value) == null ? void 0 : _a.$el;
|
|
668
|
+
if (!proFormEl) return;
|
|
669
|
+
const itemHeight = (_d = (_c = (_b = proFormEl == null ? void 0 : proFormEl.querySelector("[class*='-form-item']")) == null ? void 0 : _b.getBoundingClientRect) == null ? void 0 : _c.call(_b)) == null ? void 0 : _d.height;
|
|
670
|
+
if (itemHeight && itemHeight > 0) {
|
|
671
|
+
rowHeight.value = itemHeight;
|
|
672
|
+
}
|
|
673
|
+
const naturalHeight = proFormEl.scrollHeight || ((_f = (_e = proFormEl.getBoundingClientRect) == null ? void 0 : _e.call(proFormEl)) == null ? void 0 : _f.height) || 0;
|
|
674
|
+
if (naturalHeight > 0) {
|
|
675
|
+
proFormHeight.value = naturalHeight;
|
|
676
|
+
}
|
|
677
|
+
};
|
|
677
678
|
const changeExpandStatus = () => {
|
|
678
679
|
expandStatus.value = !expandStatus.value;
|
|
680
|
+
nextTick(() => {
|
|
681
|
+
updateHeights();
|
|
682
|
+
});
|
|
679
683
|
};
|
|
680
|
-
const
|
|
684
|
+
const hasFieldValue = (val) => val !== null && val !== void 0 && val !== "" && !(Array.isArray(val) && val.length === 0) && !(typeof val === "object" && Object.keys(val).length === 0);
|
|
681
685
|
const setInitExpandStatus = () => {
|
|
686
|
+
var _a;
|
|
682
687
|
expandStatus.value = false;
|
|
683
688
|
if (formRef.value && __props.expand) {
|
|
684
689
|
const formEl = formRef.value.$el;
|
|
685
|
-
const formItemsEl = formEl.querySelectorAll(
|
|
690
|
+
const formItemsEl = (_a = formEl == null ? void 0 : formEl.querySelectorAll) == null ? void 0 : _a.call(
|
|
691
|
+
formEl,
|
|
686
692
|
"[class*='-form-item'] > [path]"
|
|
687
693
|
);
|
|
688
|
-
|
|
694
|
+
if (!formItemsEl || formItemsEl.length === 0) return;
|
|
695
|
+
if (intersectionObserver) {
|
|
696
|
+
intersectionObserver.disconnect();
|
|
697
|
+
}
|
|
698
|
+
intersectionObserver = new IntersectionObserver(
|
|
689
699
|
(entries) => {
|
|
690
700
|
expandStatus.value = entries.some((e) => {
|
|
691
701
|
if (e.intersectionRatio === 0) {
|
|
692
702
|
const path = e.target.getAttribute("path");
|
|
693
703
|
const searchFieldValue = path ? getFormData == null ? void 0 : getFormData(path) : void 0;
|
|
694
|
-
return
|
|
704
|
+
return hasFieldValue(searchFieldValue);
|
|
695
705
|
}
|
|
696
706
|
return __props.expand.expandStatus;
|
|
697
707
|
});
|
|
698
|
-
|
|
708
|
+
intersectionObserver == null ? void 0 : intersectionObserver.disconnect();
|
|
699
709
|
},
|
|
700
710
|
{ root: formEl }
|
|
701
711
|
);
|
|
702
712
|
formItemsEl.forEach((element) => {
|
|
703
|
-
|
|
713
|
+
intersectionObserver == null ? void 0 : intersectionObserver.observe(element);
|
|
704
714
|
});
|
|
705
715
|
}
|
|
706
716
|
};
|
|
@@ -714,22 +724,34 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
714
724
|
() => __props.expand
|
|
715
725
|
],
|
|
716
726
|
() => {
|
|
717
|
-
|
|
718
|
-
if (!__props.expand || !expandStatus.value || !formRef.value) return;
|
|
719
|
-
const proFormEl = (_a = formRef.value) == null ? void 0 : _a.$el;
|
|
720
|
-
const { height = 0 } = ((_b = proFormEl == null ? void 0 : proFormEl.getBoundingClientRect) == null ? void 0 : _b.call(proFormEl)) || {};
|
|
721
|
-
proFormHeight.value = height;
|
|
722
|
-
rowHeight = (_e = (_d = (_c = proFormEl == null ? void 0 : proFormEl.querySelector("[class*='-form-item']")) == null ? void 0 : _c.getBoundingClientRect) == null ? void 0 : _d.call(_c)) == null ? void 0 : _e.height;
|
|
727
|
+
updateHeights();
|
|
723
728
|
},
|
|
724
729
|
{ flush: "post", immediate: true }
|
|
725
730
|
);
|
|
731
|
+
watch(
|
|
732
|
+
() => formRef.value,
|
|
733
|
+
(val) => {
|
|
734
|
+
if (resizeObserver) {
|
|
735
|
+
resizeObserver.disconnect();
|
|
736
|
+
resizeObserver = null;
|
|
737
|
+
}
|
|
738
|
+
const formEl = val == null ? void 0 : val.$el;
|
|
739
|
+
if (formEl && typeof ResizeObserver !== "undefined") {
|
|
740
|
+
resizeObserver = new ResizeObserver(() => {
|
|
741
|
+
updateHeights();
|
|
742
|
+
});
|
|
743
|
+
resizeObserver.observe(formEl);
|
|
744
|
+
}
|
|
745
|
+
},
|
|
746
|
+
{ immediate: true }
|
|
747
|
+
);
|
|
726
748
|
watchEffect(
|
|
727
749
|
() => {
|
|
728
750
|
if (typeof proFormHeight.value !== "number") return;
|
|
729
751
|
if (__props.layout === "grid" && computedExpand.value) {
|
|
730
752
|
const { minExpandRows } = computedExpand.value;
|
|
731
753
|
collapseHeight.value = Math.min(
|
|
732
|
-
minExpandRows * rowHeight + (minExpandRows - 1) * __props.rowGap,
|
|
754
|
+
minExpandRows * rowHeight.value + (minExpandRows - 1) * __props.rowGap,
|
|
733
755
|
+proFormHeight.value
|
|
734
756
|
);
|
|
735
757
|
showExpandToggle.value = +proFormHeight.value - collapseHeight.value > 1;
|
|
@@ -844,7 +866,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
844
866
|
};
|
|
845
867
|
}
|
|
846
868
|
});
|
|
847
|
-
const SearchForm = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-
|
|
869
|
+
const SearchForm = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-7bd701e4"]]);
|
|
848
870
|
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
849
871
|
__name: "DefaultSearchFormContainer",
|
|
850
872
|
setup(__props) {
|
|
@@ -973,8 +995,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
973
995
|
const checkedColumnsOptions = computed(
|
|
974
996
|
() => __props.columns.flatMap((item) => {
|
|
975
997
|
var _a, _b, _c, _d, _e, _f;
|
|
976
|
-
|
|
977
|
-
|
|
998
|
+
const rawKey = item.key ?? (Array.isArray(item.dataIndex) ? item.dataIndex.join(".") : item.dataIndex);
|
|
999
|
+
if (!rawKey || !item.title) return [];
|
|
1000
|
+
const key = String(rawKey);
|
|
978
1001
|
if ((_b = (_a = __props.columnControl) == null ? void 0 : _a.excludedKeys) == null ? void 0 : _b.some((ek) => String(ek) === key)) return [];
|
|
979
1002
|
const disabled = ((_d = (_c = __props.columnControl) == null ? void 0 : _c.disabledKeys) == null ? void 0 : _d.some((dk) => String(dk) === key)) ?? false;
|
|
980
1003
|
const label = ((_f = (_e = __props.columnControl) == null ? void 0 : _e.labels) == null ? void 0 : _f[key]) ?? (typeof item.title === "string" ? item.title : key);
|
|
@@ -1126,7 +1149,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1126
1149
|
};
|
|
1127
1150
|
}
|
|
1128
1151
|
});
|
|
1129
|
-
const ColumnControl = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-
|
|
1152
|
+
const ColumnControl = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-9899456e"]]);
|
|
1130
1153
|
const _hoisted_1 = { class: "pro-table_header" };
|
|
1131
1154
|
const _hoisted_2 = {
|
|
1132
1155
|
key: 0,
|
|
@@ -1234,16 +1257,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1234
1257
|
const computedColumns = computed(
|
|
1235
1258
|
() => [
|
|
1236
1259
|
...__props.addIndexColumn ?? injectProps.addIndexColumn ? [indexColumn()] : [],
|
|
1237
|
-
...
|
|
1238
|
-
(item, index2) => {
|
|
1239
|
-
if (item.key) return [{ ...item, key: item.key }];
|
|
1240
|
-
if (item.dataIndex) {
|
|
1241
|
-
const dataIndexKey = Array.isArray(item.dataIndex) ? item.dataIndex.join(".") : item.dataIndex;
|
|
1242
|
-
return [{ ...item, key: dataIndexKey }];
|
|
1243
|
-
}
|
|
1244
|
-
return [{ ...item, key: index2 }];
|
|
1245
|
-
}
|
|
1246
|
-
)
|
|
1260
|
+
...tableAttrs.value.columns ?? (columns == null ? void 0 : columns.value) ?? []
|
|
1247
1261
|
]
|
|
1248
1262
|
);
|
|
1249
1263
|
const visibleComputedColumns = computed(() => {
|
|
@@ -1293,8 +1307,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1293
1307
|
});
|
|
1294
1308
|
return (_ctx, _cache) => {
|
|
1295
1309
|
return openBlock(), createElementBlock("div", {
|
|
1296
|
-
class: normalizeClass(["pro-table",
|
|
1297
|
-
style: normalizeStyle(
|
|
1310
|
+
class: normalizeClass(["pro-table", unref(attrs).class]),
|
|
1311
|
+
style: normalizeStyle(unref(attrs).style)
|
|
1298
1312
|
}, [
|
|
1299
1313
|
showSearch.value ? (openBlock(), createBlock(unref(_sfc_main$c), {
|
|
1300
1314
|
key: 0,
|
|
@@ -1362,7 +1376,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1362
1376
|
};
|
|
1363
1377
|
}
|
|
1364
1378
|
});
|
|
1365
|
-
const ProTable = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
1379
|
+
const ProTable = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-ff6f01f4"]]);
|
|
1366
1380
|
function useTable(params) {
|
|
1367
1381
|
return useTable$1(params);
|
|
1368
1382
|
}
|