@qin-ui/antd-vue-pro 2.4.0 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api.json +1 -1
- package/es/__tests__/cross-package.spec.d.ts +2 -0
- package/es/__tests__/cross-package.spec.d.ts.map +1 -0
- package/es/antd-vue-pro.css +11 -11
- package/es/index.js +95 -225
- package/es/index.js.map +1 -1
- package/es/src/components/component-provider/components/index.vue.d.ts.map +1 -1
- package/es/src/components/component-provider/constants/index.d.ts +2 -2
- package/es/src/components/component-provider/constants/index.d.ts.map +1 -1
- package/es/src/components/form/components/BaseField/index.vue.d.ts.map +1 -1
- package/es/src/components/form/components/BaseField/utils/index.d.ts +1 -0
- package/es/src/components/form/components/BaseField/utils/index.d.ts.map +1 -1
- package/es/src/components/form/components/BaseFormItem/index.vue.d.ts.map +1 -1
- package/es/src/components/form/components/ProForm/index.vue.d.ts.map +1 -1
- package/es/src/components/form/hooks/useGroupFieldAttrs.d.ts.map +1 -1
- package/es/src/components/table/components/ColumnControl.vue.d.ts.map +1 -1
- package/es/src/components/table/components/ProTable.vue.d.ts +4 -1
- package/es/src/components/table/components/ProTable.vue.d.ts.map +1 -1
- package/es/src/components/table/components/SearchForm.vue.d.ts.map +1 -1
- package/es/src/components/table/types/index.d.ts +1 -1
- package/es/src/components/table/types/index.d.ts.map +1 -1
- package/es/src/locale/index.d.ts +1 -1
- package/es/src/locale/index.d.ts.map +1 -1
- package/es/src/shared/core/index.d.ts +1 -1
- package/es/src/shared/core/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/components/component-provider/components/index.vue +4 -3
- package/src/components/component-provider/constants/index.ts +4 -3
- package/src/components/form/components/BaseField/index.vue +3 -6
- package/src/components/form/components/BaseField/utils/index.ts +11 -0
- package/src/components/form/components/BaseFormItem/index.vue +2 -1
- package/src/components/form/components/ProForm/index.vue +23 -23
- package/src/components/form/hooks/useGroupFieldAttrs.ts +9 -3
- package/src/components/table/components/ColumnControl.vue +3 -9
- package/src/components/table/components/ProTable.vue +47 -28
- package/src/components/table/components/SearchForm.vue +8 -182
- package/src/components/table/types/index.ts +1 -1
- package/src/locale/index.ts +1 -1
- package/src/shared/core/index.ts +11 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/component-provider/components/index.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/component-provider/components/index.vue"],"names":[],"mappings":"AAgIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAQzC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEpE,KAAK,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC,CAAC;AAOxD,KAAK,KAAK,GAAG;IACX;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;;OAIG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;CAC7B,CAAC;AA8DF,iBAAS,cAAc;WAoBT,OAAO,IAA6B;;yBAVrB,GAAG;;;;EAe/B;AASD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;YAlGV,OAAO,CAAC,SAAS,CAAC;mBAbX,aAAa;kBAMd,YAAY;6EAgH3B,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RequiredComponentVars } from '../types';
|
|
2
|
-
import { InjectionKey, Component } from 'vue';
|
|
3
|
-
export declare const INJECT_COMPONENTS: InjectionKey<Partial<Record<string, Component>>>;
|
|
2
|
+
import { InjectionKey, Component, ComputedRef } from 'vue';
|
|
3
|
+
export declare const INJECT_COMPONENTS: InjectionKey<ComputedRef<Partial<Record<string, Component>> | undefined> | Partial<Record<string, Component>>>;
|
|
4
4
|
export type InjectConfigEntry<T = any> = {
|
|
5
5
|
injectionKey: InjectionKey<T>;
|
|
6
6
|
default: T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/component-provider/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/component-provider/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,KAAK,CAAC;AAMhE,eAAO,MAAM,iBAAiB,EAAE,YAAY,CACxC,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,GAAG,SAAS,CAAC,GAC3D,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CACP,CAAC;AAEhC,MAAM,MAAM,iBAAiB,CAAC,CAAC,GAAG,GAAG,IAAI;IACvC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IAC9B,OAAO,EAAE,CAAC,CAAC;CACZ,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE;KACzB,GAAG,IAAI,MAAM,qBAAqB,GAAG;QACpC,YAAY,EAAE,YAAY,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC;QACvD,OAAO,EAAE,qBAAqB,CAAC,GAAG,CAAC,CAAC;KACrC;CAyHF,CAAC;AAKF,eAAO,MAAM,eAAe,GAAI,KAAK,MAAM,KAAG,iBAAiB,GAAG,SAKjE,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,KAAK,MAAM,KAAG,iBAShD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/components/BaseField/index.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/components/BaseField/index.vue"],"names":[],"mappings":"AA4NA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EACL,KAAK,SAAS,EAOf,MAAM,KAAK,CAAC;AAmBb,KAAK,KAAK,GAAG;IACX,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;;;qCAqI6D,GAAG;;UAtIzD,MAAM;eADD,MAAM,GAAG,SAAS;;;;AAkPhC,wBASG"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Field } from '../../../types';
|
|
2
2
|
type LocaleT = (key: string, params?: Record<string, string | number>) => string;
|
|
3
3
|
export declare const getInitProps: (field: Field, injectProps: Record<string, any> | undefined, t: LocaleT) => Record<string, any>;
|
|
4
|
+
export declare function warnUnknownComponent(name: string): void;
|
|
4
5
|
export {};
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/form/components/BaseField/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,KAAK,OAAO,GAAG,CACb,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KACrC,MAAM,CAAC;AAuBZ,eAAO,MAAM,YAAY,GACvB,OAAO,KAAK,EACZ,aAAa,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,YAAK,EACrC,GAAG,OAAO,KACT,MAAM,CAAC,MAAM,EAAE,GAAG,CAQpB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/form/components/BaseField/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,KAAK,OAAO,GAAG,CACb,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KACrC,MAAM,CAAC;AAuBZ,eAAO,MAAM,YAAY,GACvB,OAAO,KAAK,EACZ,aAAa,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,YAAK,EACrC,GAAG,OAAO,KACT,MAAM,CAAC,MAAM,EAAE,GAAG,CAQpB,CAAC;AAKF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,QAMhD"}
|
|
@@ -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":"AAoMA,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;;cADW,OAAO;YADT,MAAM;UADR,IAAI;;AAqOb,wBAOG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/components/ProForm/index.vue"],"names":[],"mappings":"AA6JA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,OAAO,EAAiB,SAAS,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,
|
|
1
|
+
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/components/ProForm/index.vue"],"names":[],"mappings":"AA6JA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,OAAO,EAAiB,SAAS,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAOL,KAAK,IAAI,EACV,MAAM,KAAK,CAAC;AAIb,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAa,MAAM,aAAa,CAAC;AAChE,OAAO,EACL,IAAI,EAGL,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAW,KAAK,IAAI,EAAE,MAAM,qBAAqB,CAAC;yBAExC,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;WAgKO,mBAAmB,CAAC;eA3JN,IAAI;eAAS,CAAC;yDA2J0D,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;wDAhGgC,CAAC;;;;mBAEjB,OAAO;;iBAGwB,IAAI;8CALnB,CAAC;;;;mBAEjB,OAAO;;iBAGwB,IAAI;;UA6FvD,EAAE;EAEL,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AA3KzE,wBA2K4E;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":"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;
|
|
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;AAU5C,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;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,WAAW,CAAC,KAAK,EAAE,CAAC,+BA8FnE"}
|
|
@@ -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":"AAwMA,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;;WAFQ,KAAK;mBACG,mBAAmB;;AAqTrC,wBAQG"}
|
|
@@ -27,7 +27,10 @@ declare const _default: <T extends Table<any> = Table>(__VLS_props: NonNullable<
|
|
|
27
27
|
};
|
|
28
28
|
tableContainer?: ContainerComponent | false;
|
|
29
29
|
} & TableProps<any>) & Partial<{}>> & import('vue').PublicProps;
|
|
30
|
-
expose(exposed: import('vue').ShallowUnwrapRef<{
|
|
30
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{
|
|
31
|
+
/** 手动触发一次查询(与内部搜索共用 loading 竞态守卫),便于外部刷新列表 */
|
|
32
|
+
search: () => Promise<void>;
|
|
33
|
+
}>): void;
|
|
31
34
|
attrs: any;
|
|
32
35
|
slots: Readonly<Omit<Omit<Readonly<{
|
|
33
36
|
emptyText?: any;
|
|
@@ -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":"AAqbA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAGL,UAAU,EACV,UAAU,EAEX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAOL,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,EAML,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;WAufO,mBAAmB,CAAC;;;;eAxNnB,UAAU,CAAC,MAAM,CAAC;kBACf,OAAO;;gBA7QT,CAAC;iBAEA,MAAM,OAAO,CAAC,OAAO,CAAC;yBAEd,OAAO;0BAEN,OAAO;kBAEf,OAAO,GAAG,OAAO;yBArBd,OAAO;2BACL,OAAO,GAAG,mBAAmB,CAAC,IAAI,4BA6Ic,CAAC,iEA7IH,CAAC;UAoB1B;;qBAf3B,OAAO;wBAEJ,kBAAkB,GAAG,KAAK;;yBAiBrB,kBAAkB,GAAG,KAAK;sCAwdiD,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB;QApP7C,8CAA8C;;MAoPqB,GAAG,IAAI;WACpE,GAAG;;;;;;;;;;;;;;;;;;;;;;;;mBA1YI,CAAC,KAAK,EAAE;YACjB,IAAI,EAAE,GAAG,CAAC;YACV,MAAM,6BAmCqD,CAAC,iEAnCzC;YACnB,KAAK,EAAE,MAAM,CAAC;YACd,MAAM,EAAE,MAAM,4BAiC6C,CAAC,iEAjClC,CAAC;SAC5B,KAAK,IAAI;;;;;;;;;;;;;;;;;;;;;;;;mBALC,CAAC,KAAK,EAAE;YACjB,IAAI,EAAE,GAAG,CAAC;YACV,MAAM,6BAmCqD,CAAC,iEAnCzC;YACnB,KAAK,EAAE,MAAM,CAAC;YACd,MAAM,EAAE,MAAM,4BAiC6C,CAAC,iEAjClC,CAAC;SAC5B,KAAK,IAAI;;;EAyYV,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAlgBzE,wBAkgB4E;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,OAuOO,EAAiB,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EACL,qBAAqB,EAErB,KAAK,SAAS,EACd,KAAK,eAAe,EACrB,MAAM,KAAK,CAAC;AAEb,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAMvC,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;;;;;;;;YAXb,MAAM,GAAG,QAAQ;UADpB,IAAI;YAED,OAAO,GAAG,MAAM;kBACV,SAAS,CAAC,WAAW,CAAC,GAAG,eAAe,CAAC,WAAW,CAAC,GAAG,KAAK;iBAC9D,SAAS,CAAC,WAAW,CAAC,GAAG,eAAe,CAAC,WAAW,CAAC,GAAG,KAAK;kBAEvE,SAAS,CAAC,iBAAiB,CAAC,GAC5B,eAAe,CAAC,iBAAiB,CAAC,GAClC,KAAK;YACA,MAAM;eACH,MAAM;;;;QAwQiB,GAAG;;;QACF,GAAG;;;;QACH,GAAG;;AAtQzC,wBAsTK;AAaL,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -83,7 +83,7 @@ export type Columns<D extends Data = Data> = Array<Column<D>>;
|
|
|
83
83
|
* ```
|
|
84
84
|
*/
|
|
85
85
|
export type ColumnControlConfig<K extends string | number = string | number> = {
|
|
86
|
-
/**
|
|
86
|
+
/** 列在下拉中的自定义显示名称映射(key 为列标识),用于定制展示文案或覆盖非字符串标题 */
|
|
87
87
|
labels?: Partial<Record<K, string>>;
|
|
88
88
|
/** 不在下拉中出现的列 keys(始终展示,不参与勾选) */
|
|
89
89
|
excludedKeys?: K[];
|
|
@@ -1 +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,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI,IAAI,IAAI,CAC9C,UAAU,EACV,WAAW,GAAG,KAAK,CACpB,GAAG;IACF;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACjE;;;;OAIG;IACH,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IACd;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9D;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,IAAI;IAC7E,
|
|
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,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI,IAAI,IAAI,CAC9C,UAAU,EACV,WAAW,GAAG,KAAK,CACpB,GAAG;IACF;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACjE;;;;OAIG;IACH,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IACd;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9D;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,IAAI;IAC7E,kDAAkD;IAClD,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACpC,iCAAiC;IACjC,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC;IACnB,sCAAsC;IACtC,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC;IACnB,gBAAgB;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC"}
|
package/es/src/locale/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InjectionKey, MaybeRef } from 'vue';
|
|
2
|
-
import { zhCN, zhTW, enUS, ProLocale, ProLocaleName } from '
|
|
2
|
+
import { zhCN, zhTW, enUS, ProLocale, ProLocaleName } from '../shared/core';
|
|
3
3
|
export { zhCN, zhTW, enUS };
|
|
4
4
|
export type { ProLocale };
|
|
5
5
|
/** ProComponentProvider 通过该 key 注入局部覆盖文案 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/locale/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,QAAQ,EACd,MAAM,KAAK,CAAC;AACb,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,IAAI,EAGJ,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/locale/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,QAAQ,EACd,MAAM,KAAK,CAAC;AACb,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,IAAI,EAGJ,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAE5B,YAAY,EAAE,SAAS,EAAE,CAAC;AAE1B,4CAA4C;AAC5C,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAC1C,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC,CAClB,CAAC;AAEzB;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,SAAS;aAWJ,MAAM,WAAW,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAG,MAAM;;CAQ1E,CAAC"}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* 统一 re-export @qin-ui/pro-components-core,包内所有文件通过此文件引入 core 内容,
|
|
3
3
|
* 避免直接散列依赖 @qin-ui/pro-components-core,便于将来统一维护。
|
|
4
4
|
*/
|
|
5
|
-
export { useForm, useTable, useFields, useFormData, useFormRef, InjectionFormKey, InjectionFormSlotsKey, getObject, get, set, normalizePathKey, toPath, camelizeProperties, cloneDeep, pick, isPlainObject, isPromise, type Data, type Path, type Paths, type KeyExpandString, type ExtendWithAny, type DeepPartial, type PageParam, type Fields, type Form, type Table, type UseFieldsReturn, type UseFormDataReturn, type UseFormRefReturn, } from '@qin-ui/pro-components-core';
|
|
5
|
+
export { useForm, createFormProxy, useTable, useSearchFormExpand, useFields, useFormData, useFormRef, InjectionFormKey, InjectionFormSlotsKey, getObject, get, set, normalizePathKey, toPath, camelizeProperties, cloneDeep, pick, isPlainObject, isPromise, zhCN, zhTW, enUS, format, resolveLocaleName, type ProLocale, type ProLocaleName, type ProLocaleKey, type Data, type Path, type Paths, type KeyExpandString, type ExtendWithAny, type DeepPartial, type PageParam, type Fields, type Form, type Table, type UseFieldsReturn, type UseFormDataReturn, type UseFormRefReturn, } from '@qin-ui/pro-components-core';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/shared/core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAEL,OAAO,EACP,QAAQ,EACR,SAAS,EACT,WAAW,EACX,UAAU,EAEV,gBAAgB,EAChB,qBAAqB,EAErB,SAAS,EACT,GAAG,EACH,GAAG,EACH,gBAAgB,EAChB,MAAM,EACN,kBAAkB,EAClB,SAAS,EACT,IAAI,EACJ,aAAa,EACb,SAAS,EAET,KAAK,IAAI,EACT,KAAK,IAAI,EACT,KAAK,KAAK,EACV,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,IAAI,EACT,KAAK,KAAK,EACV,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,GACtB,MAAM,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/shared/core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAEL,OAAO,EACP,eAAe,EACf,QAAQ,EACR,mBAAmB,EACnB,SAAS,EACT,WAAW,EACX,UAAU,EAEV,gBAAgB,EAChB,qBAAqB,EAErB,SAAS,EACT,GAAG,EACH,GAAG,EACH,gBAAgB,EAChB,MAAM,EACN,kBAAkB,EAClB,SAAS,EACT,IAAI,EACJ,aAAa,EACb,SAAS,EAET,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,iBAAiB,EACjB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,YAAY,EAEjB,KAAK,IAAI,EACT,KAAK,IAAI,EACT,KAAK,KAAK,EACV,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,IAAI,EACT,KAAK,KAAK,EACV,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,GACtB,MAAM,6BAA6B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qin-ui/antd-vue-pro",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"description": "二次封装antd vue组件",
|
|
5
5
|
"bin": {
|
|
6
6
|
"antd-vue-pro": "./bin/init-ai.mjs"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"scroll-into-view-if-needed": "^3.1.0",
|
|
45
45
|
"vue-component-type-helpers": "^3.2.5",
|
|
46
|
-
"@qin-ui/pro-components-core": "^2.0.
|
|
46
|
+
"@qin-ui/pro-components-core": "^2.0.1"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@vue/test-utils": "^2.4.11",
|
|
@@ -109,9 +109,10 @@ if (props.componentVars) {
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
// 注入自定义组件映射,BaseField 在解析组件时会优先使用此映射
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
provide(
|
|
113
|
+
INJECT_COMPONENTS,
|
|
114
|
+
computed(() => props.componentMap)
|
|
115
|
+
);
|
|
115
116
|
|
|
116
117
|
// 注入内置文案覆盖,useLocale 在解析文案时会优先使用
|
|
117
118
|
provide(
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { RequiredComponentVars } from '../types';
|
|
2
|
-
import { InjectionKey, Component } from 'vue';
|
|
2
|
+
import { InjectionKey, Component, type ComputedRef } from 'vue';
|
|
3
3
|
|
|
4
4
|
const getPopupContainer = (triggerNode: any) =>
|
|
5
5
|
triggerNode.closest?.("form[class*='-form']") ||
|
|
6
6
|
(typeof document !== 'undefined' ? document.body : undefined);
|
|
7
7
|
|
|
8
8
|
export const INJECT_COMPONENTS: InjectionKey<
|
|
9
|
-
Partial<Record<string, Component>>
|
|
9
|
+
| ComputedRef<Partial<Record<string, Component>> | undefined>
|
|
10
|
+
| Partial<Record<string, Component>>
|
|
10
11
|
> = Symbol('INJECT_COMPONENTS');
|
|
11
12
|
|
|
12
13
|
export type InjectConfigEntry<T = any> = {
|
|
@@ -70,7 +71,7 @@ export const INJECT_CONFIG: {
|
|
|
70
71
|
injectionKey: Symbol(''),
|
|
71
72
|
default: {
|
|
72
73
|
max: 10 ** 15 - 1,
|
|
73
|
-
min: -(10 ** 15
|
|
74
|
+
min: -(10 ** 15 - 1),
|
|
74
75
|
controls: false,
|
|
75
76
|
style: { width: '100%' },
|
|
76
77
|
},
|
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
getInjectConfig,
|
|
50
50
|
} from '../../../component-provider/constants';
|
|
51
51
|
import { useForm } from '../../hooks/useForm';
|
|
52
|
-
import { getInitProps } from './utils';
|
|
52
|
+
import { getInitProps, warnUnknownComponent } from './utils';
|
|
53
53
|
import { useLocale } from '../../../../locale';
|
|
54
54
|
|
|
55
55
|
defineOptions({ name: 'BaseField', inheritAttrs: false });
|
|
@@ -144,7 +144,6 @@ const groupedAttrs = computed(() => {
|
|
|
144
144
|
initProps,
|
|
145
145
|
attrs,
|
|
146
146
|
{ class: attrs.componentClass, style: attrs.componentStyle },
|
|
147
|
-
{ class: initProps.componentClass, style: initProps.componentStyle },
|
|
148
147
|
{ disabled: attrs.disabled ?? parentDisabled.value ?? initProps.disabled },
|
|
149
148
|
{ modelProp: effectiveModelProp }
|
|
150
149
|
) as Required<Field>;
|
|
@@ -179,12 +178,10 @@ const is = computed(() => {
|
|
|
179
178
|
if (teleportSlot) return teleportSlot;
|
|
180
179
|
if (typeof props.component === 'string') {
|
|
181
180
|
const resolved =
|
|
182
|
-
(customComponents as any)[props.component] ||
|
|
181
|
+
toValue(customComponents as any)?.[props.component] ||
|
|
183
182
|
(componentMap as any)[props.component];
|
|
184
183
|
if (resolved) return resolved;
|
|
185
|
-
|
|
186
|
-
`[pro-components] 未识别的组件类型 "${props.component}",已降级为原生元素渲染。如为自定义组件请在 componentMap 或 ProComponentProvider 中注册。`
|
|
187
|
-
);
|
|
184
|
+
warnUnknownComponent(props.component);
|
|
188
185
|
return props.component;
|
|
189
186
|
}
|
|
190
187
|
return props.component;
|
|
@@ -39,3 +39,14 @@ export const getInitProps = (
|
|
|
39
39
|
}
|
|
40
40
|
return {};
|
|
41
41
|
};
|
|
42
|
+
|
|
43
|
+
/** 已告警过的未知组件名(模块级去重,避免 computed 重算导致刷屏) */
|
|
44
|
+
const warnedUnknownComponents = new Set<string>();
|
|
45
|
+
|
|
46
|
+
export function warnUnknownComponent(name: string) {
|
|
47
|
+
if (warnedUnknownComponents.has(name)) return;
|
|
48
|
+
warnedUnknownComponents.add(name);
|
|
49
|
+
console.warn(
|
|
50
|
+
`[pro-components] 未识别的组件类型 "${name}",已降级为原生元素渲染。如为自定义组件请在 componentMap 或 ProComponentProvider 中注册。`
|
|
51
|
+
);
|
|
52
|
+
}
|
|
@@ -51,7 +51,8 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
51
51
|
});
|
|
52
52
|
|
|
53
53
|
const validFields = computed(() =>
|
|
54
|
-
|
|
54
|
+
// hidden 支持 Ref/ComputedRef/getter 等响应式形态(统一使用 toValue 取值)
|
|
55
|
+
(props.fields ?? []).filter(field => !toValue(field.hidden))
|
|
55
56
|
);
|
|
56
57
|
|
|
57
58
|
useProviderDisabled(computed(() => props.disabled));
|
|
@@ -43,12 +43,24 @@
|
|
|
43
43
|
* ```
|
|
44
44
|
*/
|
|
45
45
|
import { Form as AForm, FormProps as AFormProps } from '../../../../shared/ui';
|
|
46
|
-
import {
|
|
46
|
+
import {
|
|
47
|
+
computed,
|
|
48
|
+
inject,
|
|
49
|
+
mergeProps,
|
|
50
|
+
provide,
|
|
51
|
+
toValue,
|
|
52
|
+
useAttrs,
|
|
53
|
+
type Slot,
|
|
54
|
+
} from 'vue';
|
|
47
55
|
import { INJECT_CONFIG } from '../../../component-provider/constants';
|
|
48
56
|
import { BaseFormItem } from '..';
|
|
49
57
|
import { InjectionFormKey, InjectionFormSlotsKey } from '../../constants';
|
|
50
58
|
import type { Grid, VModelProps, PathProps } from '../../types';
|
|
51
|
-
import {
|
|
59
|
+
import {
|
|
60
|
+
Path,
|
|
61
|
+
camelizeProperties,
|
|
62
|
+
createFormProxy,
|
|
63
|
+
} from '../../../../shared/core';
|
|
52
64
|
import { useForm, type Form } from '../../hooks/useForm';
|
|
53
65
|
|
|
54
66
|
defineOptions({ name: 'ProForm', inheritAttrs: false });
|
|
@@ -73,27 +85,9 @@ const currentForm = computed(
|
|
|
73
85
|
|
|
74
86
|
/**
|
|
75
87
|
* 表单实例代理:操作全部转发至 currentForm 当前实例;
|
|
76
|
-
* 下游持有本代理即可,:form
|
|
88
|
+
* 下游持有本代理即可,:form 运行期替换无需重绑;方法具有引用记忆化。
|
|
77
89
|
*/
|
|
78
|
-
const formProxy =
|
|
79
|
-
get(_, prop) {
|
|
80
|
-
const target = currentForm.value as any;
|
|
81
|
-
const val = target?.[prop];
|
|
82
|
-
if (typeof val === 'function') {
|
|
83
|
-
return (...args: any[]) => (currentForm.value as any)?.[prop]?.(...args);
|
|
84
|
-
}
|
|
85
|
-
return val;
|
|
86
|
-
},
|
|
87
|
-
set(_, prop, value) {
|
|
88
|
-
if (currentForm.value) {
|
|
89
|
-
(currentForm.value as any)[prop] = value;
|
|
90
|
-
}
|
|
91
|
-
return true;
|
|
92
|
-
},
|
|
93
|
-
has(_, prop) {
|
|
94
|
-
return Boolean(currentForm.value && prop in currentForm.value);
|
|
95
|
-
},
|
|
96
|
-
});
|
|
90
|
+
const formProxy = createFormProxy(() => currentForm.value);
|
|
97
91
|
|
|
98
92
|
provide(InjectionFormKey, formProxy);
|
|
99
93
|
|
|
@@ -117,6 +111,8 @@ const formKey = computed(() => getFormKey(currentForm.value as any));
|
|
|
117
111
|
const config = INJECT_CONFIG['pro-form'];
|
|
118
112
|
const injectFormConfig = inject(config.injectionKey, config.default);
|
|
119
113
|
|
|
114
|
+
const attrs = useAttrs();
|
|
115
|
+
|
|
120
116
|
/**
|
|
121
117
|
* 从 ProComponentProvider 获取全局配置,响应式派生以支持动态配置变更
|
|
122
118
|
*/
|
|
@@ -127,6 +123,10 @@ const injectAttrs = computed(() => {
|
|
|
127
123
|
return rest;
|
|
128
124
|
});
|
|
129
125
|
|
|
126
|
+
const formAttrs = computed(() => {
|
|
127
|
+
return mergeProps(injectAttrs.value, camelizeProperties(attrs));
|
|
128
|
+
});
|
|
129
|
+
|
|
130
130
|
type ExtractPath<T> = T extends Form<infer D> ? Path<D> : string;
|
|
131
131
|
type FieldSlotProps = VModelProps &
|
|
132
132
|
PathProps & { disabled?: boolean; [x: string]: any };
|
|
@@ -146,7 +146,7 @@ provide(InjectionFormSlotsKey, slots);
|
|
|
146
146
|
:key="formKey"
|
|
147
147
|
:ref="setFormRef"
|
|
148
148
|
:model="formData"
|
|
149
|
-
v-bind="
|
|
149
|
+
v-bind="formAttrs"
|
|
150
150
|
class="pro-form"
|
|
151
151
|
>
|
|
152
152
|
<BaseFormItem :fields="fields" :grid="props.grid" />
|
|
@@ -14,6 +14,9 @@ const formItemPropKeys = Object.keys(formItemProps()).concat([
|
|
|
14
14
|
'formItemContainer',
|
|
15
15
|
]);
|
|
16
16
|
const gridItemPropKeys = Object.keys(gridItemProps());
|
|
17
|
+
// 模块级 Set:字段循环内 O(1) 命中,替代数组 includes 线性扫描
|
|
18
|
+
const gridItemPropKeySet = new Set<string>(gridItemPropKeys);
|
|
19
|
+
const formItemPropKeySet = new Set<string>(formItemPropKeys);
|
|
17
20
|
|
|
18
21
|
export interface GroupedField {
|
|
19
22
|
path: string;
|
|
@@ -60,6 +63,7 @@ export function useGroupFieldAttrs(validFields: ComputedRef<Field[]>) {
|
|
|
60
63
|
lg,
|
|
61
64
|
xl,
|
|
62
65
|
xxl,
|
|
66
|
+
formItemContainer: injectFormItemContainer,
|
|
63
67
|
...injectRest
|
|
64
68
|
} = rawInject;
|
|
65
69
|
|
|
@@ -70,6 +74,8 @@ export function useGroupFieldAttrs(validFields: ComputedRef<Field[]>) {
|
|
|
70
74
|
: { xs, sm, md, lg, xl, xxl, span: injectSpan };
|
|
71
75
|
|
|
72
76
|
gridItemProps = fields ? { span: span ?? 24 } : initGridItemProps;
|
|
77
|
+
// 字段级容器优先,回退注入级配置
|
|
78
|
+
const container = formItemContainer ?? injectFormItemContainer;
|
|
73
79
|
formItemProps = mergeProps(
|
|
74
80
|
injectRest,
|
|
75
81
|
{ class: injectClassName, style: injectStyle },
|
|
@@ -78,9 +84,9 @@ export function useGroupFieldAttrs(validFields: ComputedRef<Field[]>) {
|
|
|
78
84
|
);
|
|
79
85
|
|
|
80
86
|
Object.keys(rest).forEach(k => {
|
|
81
|
-
if (
|
|
87
|
+
if (gridItemPropKeySet.has(k)) {
|
|
82
88
|
gridItemProps[k] = rest[k];
|
|
83
|
-
} else if (
|
|
89
|
+
} else if (formItemPropKeySet.has(k)) {
|
|
84
90
|
formItemProps[k] = rest[k];
|
|
85
91
|
} else {
|
|
86
92
|
componentProps[k] = rest[k];
|
|
@@ -106,7 +112,7 @@ export function useGroupFieldAttrs(validFields: ComputedRef<Field[]>) {
|
|
|
106
112
|
formItemProps: formItemProps as any,
|
|
107
113
|
formItemSlots,
|
|
108
114
|
componentProps,
|
|
109
|
-
formItemContainer,
|
|
115
|
+
formItemContainer: container,
|
|
110
116
|
rawField: field,
|
|
111
117
|
};
|
|
112
118
|
}
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
MenuItem,
|
|
8
8
|
Checkbox,
|
|
9
9
|
} from '../../../shared/ui';
|
|
10
|
-
import { computed,
|
|
10
|
+
import { computed, ref, watch } from 'vue';
|
|
11
11
|
import type { Columns, ColumnControlConfig } from '../types';
|
|
12
12
|
import { type Table } from '../hooks/useTable';
|
|
13
13
|
import FilterOutlined from './icons/FilterOutlined.vue';
|
|
@@ -121,13 +121,7 @@ watch(
|
|
|
121
121
|
{ immediate: true }
|
|
122
122
|
);
|
|
123
123
|
|
|
124
|
-
//
|
|
125
|
-
onMounted(() => {
|
|
126
|
-
props.columnControl?.disabledKeys?.forEach(key => {
|
|
127
|
-
props.table?.setColumn?.(String(key), { hidden: false });
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
|
|
124
|
+
// disabledKeys 指定的列始终强制展示
|
|
131
125
|
watch(
|
|
132
126
|
() => props.columnControl?.disabledKeys,
|
|
133
127
|
keys => {
|
|
@@ -135,7 +129,7 @@ watch(
|
|
|
135
129
|
props.table?.setColumn?.(String(key), { hidden: false });
|
|
136
130
|
});
|
|
137
131
|
},
|
|
138
|
-
{ deep: true }
|
|
132
|
+
{ immediate: true, deep: true }
|
|
139
133
|
);
|
|
140
134
|
</script>
|
|
141
135
|
|
|
@@ -74,6 +74,8 @@ import { Column, Columns, ColumnControlConfig } from '../types';
|
|
|
74
74
|
|
|
75
75
|
defineOptions({ name: 'ProTable', inheritAttrs: false });
|
|
76
76
|
|
|
77
|
+
const tableProperties = Object.keys(tableProps());
|
|
78
|
+
|
|
77
79
|
type Control = {
|
|
78
80
|
sizeControl: boolean;
|
|
79
81
|
columnControl: boolean | ColumnControlConfig<Path<RecordType>>;
|
|
@@ -119,8 +121,6 @@ const config = INJECT_CONFIG['pro-table'];
|
|
|
119
121
|
const injectPropsRaw = inject(config.injectionKey, config.default);
|
|
120
122
|
const injectProps = computed(() => toValue(injectPropsRaw) || {});
|
|
121
123
|
|
|
122
|
-
const tableProperties = Object.keys(tableProps());
|
|
123
|
-
|
|
124
124
|
const injectAttrs = computed<TableProps>(
|
|
125
125
|
() => pick(injectProps.value, tableProperties) as TableProps
|
|
126
126
|
);
|
|
@@ -145,14 +145,17 @@ const tableAttrs = computed<TableProps>(() => {
|
|
|
145
145
|
const size = defineModel<TableProps['size']>('size');
|
|
146
146
|
const loading = defineModel<boolean>('loading', { default: false });
|
|
147
147
|
|
|
148
|
-
//
|
|
148
|
+
// 递增序号做请求竞态守卫,仅最新一次请求可变更 loading
|
|
149
|
+
let searchSequence = 0;
|
|
149
150
|
const _search = async () => {
|
|
151
|
+
const seq = ++searchSequence;
|
|
150
152
|
const searchPromise = (props.search || attrs.onSearch)?.();
|
|
151
|
-
if (isPromise(searchPromise))
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
153
|
+
if (!isPromise(searchPromise)) return;
|
|
154
|
+
loading.value = true;
|
|
155
|
+
try {
|
|
156
|
+
await searchPromise;
|
|
157
|
+
} finally {
|
|
158
|
+
if (seq === searchSequence) {
|
|
156
159
|
loading.value = false;
|
|
157
160
|
}
|
|
158
161
|
}
|
|
@@ -166,8 +169,15 @@ const reset = () => {
|
|
|
166
169
|
});
|
|
167
170
|
};
|
|
168
171
|
|
|
172
|
+
const customSlotNames = [
|
|
173
|
+
'search-form',
|
|
174
|
+
'button-bar',
|
|
175
|
+
'toolbar',
|
|
176
|
+
'table',
|
|
177
|
+
] as const;
|
|
178
|
+
|
|
169
179
|
type CustomSlots = Readonly<
|
|
170
|
-
Partial<Record<
|
|
180
|
+
Partial<Record<(typeof customSlotNames)[number], Slot>>
|
|
171
181
|
>;
|
|
172
182
|
type TableSlots = Omit<ComponentSlots<typeof ATable>, 'bodyCell'> &
|
|
173
183
|
Readonly<{
|
|
@@ -181,14 +191,10 @@ type TableSlots = Omit<ComponentSlots<typeof ATable>, 'bodyCell'> &
|
|
|
181
191
|
type Slots = Omit<TableSlots & CustomSlots, 'default'>;
|
|
182
192
|
|
|
183
193
|
const slots = defineSlots<Slots>();
|
|
184
|
-
const
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
189
|
-
table: tableSlot,
|
|
190
|
-
...tableSlots
|
|
191
|
-
} = slots;
|
|
194
|
+
const forwardedSlotNames = () =>
|
|
195
|
+
(Object.keys(slots) as Array<Extract<keyof Slots, string>>).filter(
|
|
196
|
+
name => !customSlotNames.includes(name as any)
|
|
197
|
+
);
|
|
192
198
|
|
|
193
199
|
const searchPage1st = () => {
|
|
194
200
|
props.table?.setPageParam?.({ current: 1 });
|
|
@@ -215,14 +221,23 @@ const computedTableContainer = computed(() => {
|
|
|
215
221
|
type ReturnGenericParameterTypes<V> = V extends Table<any, infer R> ? R : never;
|
|
216
222
|
type RecordType = ReturnGenericParameterTypes<T>;
|
|
217
223
|
|
|
218
|
-
|
|
224
|
+
// 序号列随分页偏移:第 n 页首行序号 = (n-1)*pageSize + i + 1(无分页时退化为 index+1)
|
|
225
|
+
const getIndex = (i: number) => {
|
|
226
|
+
const pageParam = props.table?.pageParam;
|
|
227
|
+
if (pageParam && computedPagination.value !== false) {
|
|
228
|
+
const current = pageParam.current ?? 1;
|
|
229
|
+
const pageSize = pageParam.pageSize ?? 10;
|
|
230
|
+
return (current - 1) * pageSize + i + 1;
|
|
231
|
+
}
|
|
232
|
+
return i + 1;
|
|
233
|
+
};
|
|
219
234
|
|
|
220
235
|
const indexColumn = computed<ColumnType>(() => ({
|
|
221
236
|
title: t('table.index'),
|
|
222
237
|
dataIndex: '_index',
|
|
223
238
|
key: '_index',
|
|
224
239
|
width: 80,
|
|
225
|
-
customRender:
|
|
240
|
+
customRender: ({ index }) => getIndex(index),
|
|
226
241
|
}));
|
|
227
242
|
|
|
228
243
|
const computedColumns = computed<Columns<RecordType>>(() => {
|
|
@@ -275,15 +290,14 @@ const onTableChange: TableProps['onChange'] = (...args) => {
|
|
|
275
290
|
_search();
|
|
276
291
|
};
|
|
277
292
|
|
|
278
|
-
const
|
|
293
|
+
const searchFormVisible = computed(() => {
|
|
279
294
|
const searchFields = props.table?.searchForm?.fields;
|
|
280
295
|
const fieldList =
|
|
281
296
|
(Array.isArray(searchFields) ? searchFields : searchFields?.value) ?? [];
|
|
282
297
|
return !!(
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
fieldList.filter(item => !item.hidden).length > 0)
|
|
298
|
+
computedSearchFormConfig.value?.hidden !== true &&
|
|
299
|
+
props.table?.searchForm &&
|
|
300
|
+
fieldList.filter(item => !toValue(item.hidden)).length > 0
|
|
287
301
|
);
|
|
288
302
|
});
|
|
289
303
|
|
|
@@ -314,12 +328,17 @@ onMounted(() => {
|
|
|
314
328
|
_search();
|
|
315
329
|
}
|
|
316
330
|
});
|
|
331
|
+
|
|
332
|
+
defineExpose({
|
|
333
|
+
/** 手动触发一次查询(与内部搜索共用 loading 竞态守卫),便于外部刷新列表 */
|
|
334
|
+
search: _search,
|
|
335
|
+
});
|
|
317
336
|
</script>
|
|
318
337
|
|
|
319
338
|
<template>
|
|
320
339
|
<div class="pro-table" :class="attrs.class" :style="attrs.style">
|
|
321
340
|
<ContainerFragment
|
|
322
|
-
v-if="
|
|
341
|
+
v-if="searchFormVisible || $slots['search-form']"
|
|
323
342
|
:component="computedSearchFormConfig.container"
|
|
324
343
|
>
|
|
325
344
|
<slot name="search-form">
|
|
@@ -335,10 +354,10 @@ onMounted(() => {
|
|
|
335
354
|
|
|
336
355
|
<ContainerFragment :component="computedTableContainer">
|
|
337
356
|
<div class="pro-table_header">
|
|
338
|
-
<div v-if="
|
|
357
|
+
<div v-if="$slots['button-bar']" class="pro-table_header_button-bar">
|
|
339
358
|
<slot name="button-bar" />
|
|
340
359
|
</div>
|
|
341
|
-
<div v-if="
|
|
360
|
+
<div v-if="$slots['toolbar']" class="pro-table_header_toolbar">
|
|
342
361
|
<slot name="toolbar" />
|
|
343
362
|
</div>
|
|
344
363
|
<div
|
|
@@ -371,7 +390,7 @@ onMounted(() => {
|
|
|
371
390
|
@change="onTableChange"
|
|
372
391
|
>
|
|
373
392
|
<template
|
|
374
|
-
v-for="
|
|
393
|
+
v-for="name of forwardedSlotNames()"
|
|
375
394
|
:key="name"
|
|
376
395
|
#[name]="scoped"
|
|
377
396
|
>
|