@dazhicheng/ui 1.1.1 → 1.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/dist/components/tt-form/src/form-render/form.vue.d.ts +1 -1
- package/dist/components/tt-form/src/index.vue.d.ts +4 -4
- package/dist/components/tt-loading/index.d.ts +17 -0
- package/dist/components/tt-loading/index.d.ts.map +1 -0
- package/dist/components/tt-loading/src/directive.d.ts +10 -0
- package/dist/components/tt-loading/src/directive.d.ts.map +1 -0
- package/dist/components/tt-loading/src/loading.vue.d.ts +13 -0
- package/dist/components/tt-loading/src/loading.vue.d.ts.map +1 -0
- package/dist/components/tt-loading/src/service.d.ts +26 -0
- package/dist/components/tt-loading/src/service.d.ts.map +1 -0
- package/dist/components/tt-loading/src/type.d.ts +21 -0
- package/dist/components/tt-loading/src/type.d.ts.map +1 -0
- package/dist/components/tt-part/index.d.ts +3 -3
- package/dist/components/tt-part/index.vue.d.ts +1 -1
- package/dist/components/tt-table/index.d.ts +128 -0
- package/dist/components/tt-table/index.d.ts.map +1 -0
- package/dist/components/tt-table/src/Table.vue.d.ts +1746 -0
- package/dist/components/tt-table/src/Table.vue.d.ts.map +1 -0
- package/dist/components/tt-table/src/TableForm.vue.d.ts +163 -0
- package/dist/components/tt-table/src/TableForm.vue.d.ts.map +1 -0
- package/dist/components/tt-table/src/componentMap.d.ts +9 -0
- package/dist/components/tt-table/src/componentMap.d.ts.map +1 -0
- package/dist/components/tt-table/src/components/RowContext.d.ts +25 -0
- package/dist/components/tt-table/src/components/RowContext.d.ts.map +1 -0
- package/dist/components/tt-table/src/components/TableAction.vue.d.ts +80 -0
- package/dist/components/tt-table/src/components/TableAction.vue.d.ts.map +1 -0
- package/dist/components/tt-table/src/components/TableButtons.d.ts +31 -0
- package/dist/components/tt-table/src/components/TableButtons.d.ts.map +1 -0
- package/dist/components/tt-table/src/components/TableToobalTools.vue.d.ts +1685 -0
- package/dist/components/tt-table/src/components/TableToobalTools.vue.d.ts.map +1 -0
- package/dist/components/tt-table/src/emits.d.ts +2 -0
- package/dist/components/tt-table/src/emits.d.ts.map +1 -0
- package/dist/components/tt-table/src/enum.d.ts +3 -0
- package/dist/components/tt-table/src/enum.d.ts.map +1 -0
- package/dist/components/tt-table/src/hooks/useCache.d.ts +21 -0
- package/dist/components/tt-table/src/hooks/useCache.d.ts.map +1 -0
- package/dist/components/tt-table/src/hooks/useCellArea.d.ts +16 -0
- package/dist/components/tt-table/src/hooks/useCellArea.d.ts.map +1 -0
- package/dist/components/tt-table/src/hooks/useColumns.d.ts +32 -0
- package/dist/components/tt-table/src/hooks/useColumns.d.ts.map +1 -0
- package/dist/components/tt-table/src/hooks/useDataSource.d.ts +30 -0
- package/dist/components/tt-table/src/hooks/useDataSource.d.ts.map +1 -0
- package/dist/components/tt-table/src/hooks/useFullscreen.d.ts +12 -0
- package/dist/components/tt-table/src/hooks/useFullscreen.d.ts.map +1 -0
- package/dist/components/tt-table/src/hooks/useLeftRightSlot.d.ts +1083 -0
- package/dist/components/tt-table/src/hooks/useLeftRightSlot.d.ts.map +1 -0
- package/dist/components/tt-table/src/hooks/usePagination.d.ts +103 -0
- package/dist/components/tt-table/src/hooks/usePagination.d.ts.map +1 -0
- package/dist/components/tt-table/src/hooks/useRowSelection.d.ts +31 -0
- package/dist/components/tt-table/src/hooks/useRowSelection.d.ts.map +1 -0
- package/dist/components/tt-table/src/hooks/useTable.d.ts +8 -0
- package/dist/components/tt-table/src/hooks/useTable.d.ts.map +1 -0
- package/dist/components/tt-table/src/hooks/useTableContext.d.ts +44 -0
- package/dist/components/tt-table/src/hooks/useTableContext.d.ts.map +1 -0
- package/dist/components/tt-table/src/hooks/useTableEvent.d.ts +102 -0
- package/dist/components/tt-table/src/hooks/useTableEvent.d.ts.map +1 -0
- package/dist/components/tt-table/src/hooks/useTableForm.d.ts +15 -0
- package/dist/components/tt-table/src/hooks/useTableForm.d.ts.map +1 -0
- package/dist/components/tt-table/src/hooks/useTableFormEvent.d.ts +12 -0
- package/dist/components/tt-table/src/hooks/useTableFormEvent.d.ts.map +1 -0
- package/dist/components/tt-table/src/hooks/useTableHeight.d.ts +16 -0
- package/dist/components/tt-table/src/hooks/useTableHeight.d.ts.map +1 -0
- package/dist/components/tt-table/src/hooks/useTableRender.d.ts +82 -0
- package/dist/components/tt-table/src/hooks/useTableRender.d.ts.map +1 -0
- package/dist/components/tt-table/src/hooks/useTableSlot.d.ts +12 -0
- package/dist/components/tt-table/src/hooks/useTableSlot.d.ts.map +1 -0
- package/dist/components/tt-table/src/props.d.ts +485 -0
- package/dist/components/tt-table/src/props.d.ts.map +1 -0
- package/dist/components/tt-table/src/toolProps.d.ts +102 -0
- package/dist/components/tt-table/src/toolProps.d.ts.map +1 -0
- package/dist/components/tt-table/src/types/table.d.ts +493 -0
- package/dist/components/tt-table/src/types/table.d.ts.map +1 -0
- package/dist/components/tt-table/src/types/tableAction.d.ts +27 -0
- package/dist/components/tt-table/src/types/tableAction.d.ts.map +1 -0
- package/dist/components/tt-table/src/types/tableForm.d.ts +66 -0
- package/dist/components/tt-table/src/types/tableForm.d.ts.map +1 -0
- package/dist/components/tt-table/src/types/tableTools.d.ts +66 -0
- package/dist/components/tt-table/src/types/tableTools.d.ts.map +1 -0
- package/dist/components/tt-table/src/utils/context.d.ts +19 -0
- package/dist/components/tt-table/src/utils/context.d.ts.map +1 -0
- package/dist/components/tt-table/src/utils/filters.d.ts +110 -0
- package/dist/components/tt-table/src/utils/filters.d.ts.map +1 -0
- package/dist/components/tt-table/src/utils/table-api.d.ts +269 -0
- package/dist/components/tt-table/src/utils/table-api.d.ts.map +1 -0
- package/dist/components/tt-table/src/utils/table-form-api.d.ts +89 -0
- package/dist/components/tt-table/src/utils/table-form-api.d.ts.map +1 -0
- package/dist/components/tt-table/src/utils/vxeTable.d.ts +29 -0
- package/dist/components/tt-table/src/utils/vxeTable.d.ts.map +1 -0
- package/dist/components/tt-validate/src/Field.d.ts +1 -1
- package/dist/components/tt-validate/src/Form.d.ts +1 -1
- package/dist/{event-uB4aPtFy.js → event-BgJv9iWk.js} +1 -1
- package/dist/hooks/useSetup.d.ts +6 -0
- package/dist/hooks/useSetup.d.ts.map +1 -0
- package/dist/hooks/useTemplateSlot.d.ts +10 -0
- package/dist/hooks/useTemplateSlot.d.ts.map +1 -0
- package/dist/{icon-vcRgBOnR.js → icon-C9BsRQqM.js} +2 -2
- package/dist/{index-DE2yohHu.js → index-64J4mWP7.js} +2 -2
- package/dist/{index-CMMUpVFZ.js → index-B3w7HVvP.js} +6 -6
- package/dist/{index-Czf6JBRl.js → index-BQgaGlJA.js} +8 -8
- package/dist/{index-DT5rBqSy.js → index-Bq5RXWp8.js} +5 -5
- package/dist/{index-vljoqWNo.js → index-CB2v0taz.js} +1 -1
- package/dist/{index-D_IdZK7s.js → index-C_u1XOy0.js} +7 -7
- package/dist/{index-CRljSNoY.js → index-CdyRKSi4.js} +3 -3
- package/dist/{index-D8ISpbRW.js → index-CjcGE9Xi.js} +10 -10
- package/dist/{index-DqLyz5eN.js → index-CzDjdhem.js} +5 -5
- package/dist/{index-3UkObRxv.js → index-D6x6ZHVk.js} +5 -5
- package/dist/{index-DM7o1Y9_.js → index-DHXyFJLO.js} +1 -1
- package/dist/{index-BtqEcZqo.js → index-DXGnUvsQ.js} +9 -9
- package/dist/{index-BTf1_B_5.js → index-DY3FsmvZ.js} +2 -2
- package/dist/{index-Dn38FMIM.js → index-Dp1l-3ez.js} +2 -2
- package/dist/{index-Dz2-tV0Q.js → index-LRY3g1Bz.js} +6 -6
- package/dist/{index-Mg3lmVPp.js → index-hI7UMWGr.js} +1 -1
- package/dist/index-iFd1yQ1C.js +55785 -0
- package/dist/index.d.ts +3 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -17
- package/dist/{panel-time-pick.vue2-ChVAZVCn.js → panel-time-pick.vue2-C7R5HGb8.js} +10 -10
- package/dist/style.css +1 -1
- package/dist/{use-form-common-props-CiRVSa0R.js → use-form-common-props-CDmM4Wn1.js} +1 -1
- package/dist/{use-form-item-DuAhca9z.js → use-form-item-Bv38v7TO.js} +2 -2
- package/dist/{util-B7hHTw8E.js → util-CWdgKsYq.js} +6 -6
- package/package.json +5 -3
- package/dist/index-DxTPuBYV.js +0 -47918
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tableTools.d.ts","sourceRoot":"","sources":["../../../../../src/components/tt-table/src/types/tableTools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAErE,MAAM,MAAM,0BAA0B,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AACnE,MAAM,MAAM,wBAAwB,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE3D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,aAAa;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gBAAgB;IAChB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe;IACf,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW;IACX,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB;IACjB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,gBAAgB;IAChB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,eAAe;IACf,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc;IACd,IAAI,CAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAC7B,WAAW;IACX,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,wBAAwB,KAAK,SAAS,EAAE,GAAG,SAAS,GAAG,SAAS,CAAC;IACtF,cAAc;IACd,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,wBAAwB,KAAK,OAAO,GAAG,SAAS,CAAC;CACtE,CAAC;AAEF,iBAAiB;AACjB,MAAM,MAAM,+BAA+B,GAAG;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AACF,MAAM,MAAM,yBAAyB,GAAG;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,qCAAqC,EAAE,CAAC;IACxD,WAAW,EAAE,gBAAgB,CAAC,OAAO,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;CAC9D,CAAC;AAEF,qBAAqB;AACrB,MAAM,MAAM,qCAAqC,GAAG;IAClD,UAAU,EAAE,+BAA+B,EAAE,CAAC;IAC9C,WAAW;IACX,cAAc,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;IACjE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* @param providerComponentName - The name(s) of the component(s) providing the context.
|
|
4
|
+
*
|
|
5
|
+
* There are situations where context can come from multiple components. In such cases, you might need to give an array of component names to provide your context, instead of just a single string.
|
|
6
|
+
*
|
|
7
|
+
* @param contextName The description for injection key symbol.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createContext<ContextValue>(providerComponentName: string | string[], contextName?: string): readonly [<T extends ContextValue | null | undefined = ContextValue>(fallback?: T) => T extends null ? ContextValue | null : ContextValue, (contextValue: ContextValue) => ContextValue];
|
|
10
|
+
/**
|
|
11
|
+
* 表单操作按钮 testid 上下文
|
|
12
|
+
* 用于传递查询/重置等按钮的 testid
|
|
13
|
+
*/
|
|
14
|
+
export type FormActionTestIds = {
|
|
15
|
+
submit?: string;
|
|
16
|
+
reset?: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const injectFormActionTestIds: <T extends ComputedRef<FormActionTestIds> | null | undefined = ComputedRef<FormActionTestIds>>(fallback?: T | undefined) => T extends null ? ComputedRef<FormActionTestIds> | null : ComputedRef<FormActionTestIds>, provideFormActionTestIds: (contextValue: ComputedRef<FormActionTestIds>) => ComputedRef<FormActionTestIds>;
|
|
19
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../../src/components/tt-table/src/utils/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,WAAW,EAAE,MAAM,KAAK,CAAC;AAE3E;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,YAAY,EAAE,qBAAqB,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,WAAW,CAAC,EAAE,MAAM,cAYjF,CAAC,SAAS,YAAY,GAAG,IAAI,GAAG,SAAS,4BACnD,CAAC,KACX,CAAC,SAAS,IAAI,GAAG,YAAY,GAAG,IAAI,GAAG,YAAY,iBAehB,YAAY,mBAMnD;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAO,uBAAuB,GAlCZ,CAAC,mNAkCa,wBAAwB,kFACK,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { TableFilterPrivateMethods, VxeGlobalRendererHandles, VxeTableConstructor, VxeTableDataRow, VxeTableDefines } from 'vxe-table';
|
|
2
|
+
/**
|
|
3
|
+
* 将通配符模式转换为正则表达式
|
|
4
|
+
* @param {string} pattern - 包含通配符的模式
|
|
5
|
+
* @param {boolean} caseSensitive - 是否区分大小写
|
|
6
|
+
* @returns {RegExp} - 转换后的正则表达式
|
|
7
|
+
*/
|
|
8
|
+
export declare function convertPatternToRegex(pattern: string, caseSensitive?: boolean): RegExp;
|
|
9
|
+
/**
|
|
10
|
+
* 检查字符串是否完全匹配模式
|
|
11
|
+
* @param {string} pattern - 包含通配符的模式
|
|
12
|
+
* @param {string} str - 要匹配的字符串
|
|
13
|
+
* @param {boolean} caseSensitive - 是否区分大小写
|
|
14
|
+
* @returns {boolean} - 是否匹配
|
|
15
|
+
*/
|
|
16
|
+
export declare function isEqual(pattern: string, str: string, caseSensitive?: boolean): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* 检查字符串是否不匹配模式
|
|
19
|
+
* @param {string} pattern - 包含通配符的模式
|
|
20
|
+
* @param {string} str - 要匹配的字符串
|
|
21
|
+
* @param {boolean} caseSensitive - 是否区分大小写
|
|
22
|
+
* @returns {boolean} - 是否不匹配
|
|
23
|
+
*/
|
|
24
|
+
export declare function isNotEqual(pattern: string, str: string, caseSensitive?: boolean): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* 检查字符串是否以模式开头
|
|
27
|
+
* @param {string} pattern - 包含通配符的模式
|
|
28
|
+
* @param {string} str - 要匹配的字符串
|
|
29
|
+
* @param {boolean} caseSensitive - 是否区分大小写
|
|
30
|
+
* @returns {boolean} - 是否以模式开头
|
|
31
|
+
*/
|
|
32
|
+
export declare function startsWith(pattern: string, str: string, caseSensitive?: boolean): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* 检查字符串是否以模式结尾
|
|
35
|
+
* @param {string} pattern - 包含通配符的模式
|
|
36
|
+
* @param {string} str - 要匹配的字符串
|
|
37
|
+
* @param {boolean} caseSensitive - 是否区分大小写
|
|
38
|
+
* @returns {boolean} - 是否以模式结尾
|
|
39
|
+
*/
|
|
40
|
+
export declare function endsWith(pattern: string, str: string, caseSensitive?: boolean): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* 检查字符串是否包含模式
|
|
43
|
+
* @param {string} pattern - 包含通配符的模式
|
|
44
|
+
* @param {string} str - 要匹配的字符串
|
|
45
|
+
* @param {boolean} caseSensitive - 是否区分大小写
|
|
46
|
+
* @returns {boolean} - 是否包含模式
|
|
47
|
+
*/
|
|
48
|
+
export declare function contains(pattern: string, str: string, caseSensitive?: boolean): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* 检查字符串是否不包含模式
|
|
51
|
+
* @param {string} pattern - 包含通配符的模式
|
|
52
|
+
* @param {string} str - 要匹配的字符串
|
|
53
|
+
* @param {boolean} caseSensitive - 是否区分大小写
|
|
54
|
+
* @returns {boolean} - 是否不包含模式
|
|
55
|
+
*/
|
|
56
|
+
export declare function doesNotContain(pattern: string, str: string, caseSensitive?: boolean): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* 判断是否存在通配符
|
|
59
|
+
* @param value 值
|
|
60
|
+
*/
|
|
61
|
+
export declare function isHasWildcard(value: string): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* 通配符筛选
|
|
64
|
+
* @param rowVal 行值
|
|
65
|
+
* @param value 筛选值
|
|
66
|
+
*/
|
|
67
|
+
export declare function handleWildcardFilter(rowVal: any, value: any): boolean;
|
|
68
|
+
export type FilterMatchParams = {
|
|
69
|
+
item: Indexable;
|
|
70
|
+
filterType: "text" | "number" | "date";
|
|
71
|
+
row: VxeTableDataRow;
|
|
72
|
+
column: VxeTableDefines.ColumnInfo;
|
|
73
|
+
$table?: VxeGlobalRendererHandles.FilterMethodParams["$table"] | (VxeTableConstructor & TableFilterPrivateMethods);
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* 筛选出对象数组中相同的元素
|
|
77
|
+
* @param dataGroups 原数据
|
|
78
|
+
* @param properties 需要比较的keys
|
|
79
|
+
* @returns 去重之后的对象数据
|
|
80
|
+
*/
|
|
81
|
+
export declare function filterSameData(dataGroups: any[], properties: string[]): any;
|
|
82
|
+
/**
|
|
83
|
+
* 处理条件筛选
|
|
84
|
+
* @param object
|
|
85
|
+
* @param object.item 数据
|
|
86
|
+
* @param object.filterType 筛选类型
|
|
87
|
+
* @param object.row 行
|
|
88
|
+
* @param object.column 列
|
|
89
|
+
* @param object.$table 表格实例
|
|
90
|
+
*/
|
|
91
|
+
export declare function handleFilterMatch({ item, filterType, row, column, $table }: FilterMatchParams): boolean | undefined;
|
|
92
|
+
export type TtCustomFilterParams = {
|
|
93
|
+
field: VxeTableDefines.ColumnInfo["field"];
|
|
94
|
+
datas: any[];
|
|
95
|
+
conditionMode?: "and" | "or";
|
|
96
|
+
columnType: "text" | "number" | "date";
|
|
97
|
+
conditionDatas?: {
|
|
98
|
+
filterMode: number;
|
|
99
|
+
value: any;
|
|
100
|
+
}[];
|
|
101
|
+
columnSelectAll?: boolean;
|
|
102
|
+
columnSearchValues?: any[];
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* 设置表格筛选
|
|
106
|
+
* @param $table 表格实例
|
|
107
|
+
* @param filtersList 筛选配置
|
|
108
|
+
*/
|
|
109
|
+
export declare function setTableFilters($table: VxeTableConstructor, filtersList: TtCustomFilterParams[]): Promise<void>;
|
|
110
|
+
//# sourceMappingURL=filters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filters.d.ts","sourceRoot":"","sources":["../../../../../src/components/tt-table/src/utils/filters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAA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AAe,CAAC,UAAU,CAAC;IACnC,MAAM,CAAC,EAAE,wBAAwB,CAAC,kBAAkB,CAAC,QAAQ,CAAC,GAAG,CAAC,mBAAmB,GAAG,yBAAyB,CAAC,CAAC;CACpH,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,OAiCrE;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,iBAAiB,uBAoF7F;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,eAAe,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAC3C,KAAK,EAAE,GAAG,EAAE,CAAC;IACb,aAAa,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;IACvC,cAAc,CAAC,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,GAAG,CAAA;KAAE,EAAE,CAAC;IACtD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,GAAG,EAAE,CAAC;CAC5B,CAAC;AAEF;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,MAAM,EAAE,mBAAmB,EAAE,WAAW,EAAE,oBAAoB,EAAE,iBAgBrG"}
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { VxeGridInstance, VxeGridPropTypes, VxeTableDefines, VxeTablePropTypes } from 'vxe-table';
|
|
2
|
+
import { FetchParams, TtSelectRowKeysType, TtSelectRowsType, TtTableMethods, TtTableProps } from '../types/table';
|
|
3
|
+
import { Store } from '@tanstack/vue-store';
|
|
4
|
+
type ProxyStateType = {
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
selectedKeys?: TtSelectRowKeysType;
|
|
7
|
+
isTableEvent?: boolean;
|
|
8
|
+
selectedRows?: TtSelectRowsType;
|
|
9
|
+
};
|
|
10
|
+
export declare function getDefaultState(): TtTableProps;
|
|
11
|
+
/**
|
|
12
|
+
* TableApi 表格组件的 API 封装类
|
|
13
|
+
*
|
|
14
|
+
* 用于统一管理表格的实例、状态、方法,便于外部操作。
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* const api = new TableApi({ ...配置 })
|
|
18
|
+
* api.reload()
|
|
19
|
+
* api.setProps({ ... })
|
|
20
|
+
*/
|
|
21
|
+
declare class TableApi {
|
|
22
|
+
/** vxe-grid 表格实例 */
|
|
23
|
+
grid: VxeGridInstance;
|
|
24
|
+
/** 表格操作方法集合(TtTableMethods) */
|
|
25
|
+
methods: TtTableMethods;
|
|
26
|
+
/** 当前表格的 props 状态 */
|
|
27
|
+
state: null | TtTableProps;
|
|
28
|
+
/** 响应式 store,存储表格的状态 */
|
|
29
|
+
store: Store<TtTableProps>;
|
|
30
|
+
/** 响应式代理状态(loading、selectedKeys) */
|
|
31
|
+
private proxyState;
|
|
32
|
+
private isMounted;
|
|
33
|
+
private stateHandler;
|
|
34
|
+
/**
|
|
35
|
+
* 构造函数,初始化 store、状态等
|
|
36
|
+
* @param options 表格配置项
|
|
37
|
+
*/
|
|
38
|
+
constructor(options?: TtTableProps);
|
|
39
|
+
/**
|
|
40
|
+
* 组件挂载时调用,注入表格实例和方法
|
|
41
|
+
* @param instance vxe-grid 实例
|
|
42
|
+
* @param methods 表格操作方法
|
|
43
|
+
*/
|
|
44
|
+
mount(instance: undefined | VxeGridInstance, methods: TtTableMethods): void;
|
|
45
|
+
/**
|
|
46
|
+
* 更新表格的状态
|
|
47
|
+
* @param stateOrFn 新状态或返回新状态的函数
|
|
48
|
+
*/
|
|
49
|
+
setState(stateOrFn: ((prev: TtTableProps) => Partial<TtTableProps>) | Partial<TtTableProps>): void;
|
|
50
|
+
/**
|
|
51
|
+
* 组件卸载时调用,重置挂载状态
|
|
52
|
+
*/
|
|
53
|
+
unmount(): void;
|
|
54
|
+
/**
|
|
55
|
+
* @description: 表格重载数据
|
|
56
|
+
* @param {FetchParams | undefined} data 加载的params
|
|
57
|
+
* @return {*}
|
|
58
|
+
*/
|
|
59
|
+
reload(data?: FetchParams): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* @description: 设置表格props
|
|
62
|
+
* @param {Partial<TtTableProps>} props 表格props
|
|
63
|
+
*/
|
|
64
|
+
setProps(props: Partial<TtTableProps>): void;
|
|
65
|
+
/**
|
|
66
|
+
* @description: 重新计算高度
|
|
67
|
+
* @return {*}
|
|
68
|
+
*/
|
|
69
|
+
redoHeight(): void;
|
|
70
|
+
/**
|
|
71
|
+
* @description: 设置表格columns
|
|
72
|
+
* @param {VxeGridPropTypes.Columns<DT>} columns columns
|
|
73
|
+
* @return {*}
|
|
74
|
+
*/
|
|
75
|
+
setTableColumns(columns: VxeGridPropTypes.Columns<VxeTablePropTypes.Row>): void;
|
|
76
|
+
/**
|
|
77
|
+
* @description: 获取表格columns
|
|
78
|
+
* @return {VxeGridPropTypes.Columns<DT> | undefined}
|
|
79
|
+
*/
|
|
80
|
+
getTableColumns(): VxeGridPropTypes.Columns<VxeTablePropTypes.Row> | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* @description: 获取表格数据
|
|
83
|
+
* @return {DT[]}
|
|
84
|
+
*/
|
|
85
|
+
getDataSource(): VxeTablePropTypes.Row[];
|
|
86
|
+
/**
|
|
87
|
+
* @description: 设置表格loading
|
|
88
|
+
* @param {boolean} loading
|
|
89
|
+
*/
|
|
90
|
+
setLoading(loading: boolean): void;
|
|
91
|
+
/**
|
|
92
|
+
* @description: 获取表格columns
|
|
93
|
+
* @return {VxeGridPropTypes.Columns<DT> | undefined}
|
|
94
|
+
*/
|
|
95
|
+
getCacheColumns(): VxeGridPropTypes.Columns<VxeTablePropTypes.Row> | undefined;
|
|
96
|
+
/**
|
|
97
|
+
* @description: 设置表格columns
|
|
98
|
+
* @param {VxeGridPropTypes.Columns<DT>} columns columns
|
|
99
|
+
* @return {*}
|
|
100
|
+
*/
|
|
101
|
+
setCacheColumns(columns: VxeGridPropTypes.Columns<VxeTablePropTypes.Row>): void;
|
|
102
|
+
/**
|
|
103
|
+
* @description: 获取表格pagination
|
|
104
|
+
* @return {VxeGridPropTypes.PagerConfig | undefined}
|
|
105
|
+
*/
|
|
106
|
+
getPagination(): VxeGridPropTypes.PagerConfig | undefined;
|
|
107
|
+
/**
|
|
108
|
+
* @description: 设置表格pagination
|
|
109
|
+
* @param {Partial<VxeGridPropTypes.PagerConfig>} props 表格pagination
|
|
110
|
+
*/
|
|
111
|
+
setPagination(props: VxeGridPropTypes.PagerConfig): void;
|
|
112
|
+
/**
|
|
113
|
+
* @description: 获取选中数据的keys集合
|
|
114
|
+
* @return {Array<string>}
|
|
115
|
+
*/
|
|
116
|
+
getSelectRowKeys(): any;
|
|
117
|
+
/**
|
|
118
|
+
* @description: 获取选中数据
|
|
119
|
+
* @return {Array<string>}
|
|
120
|
+
*/
|
|
121
|
+
getSelectRows(): any;
|
|
122
|
+
/**
|
|
123
|
+
* @description: 设置表格选中数据
|
|
124
|
+
* @param {TtSelectRowsType[]} rows 选中的数据
|
|
125
|
+
* @param {TtSelectRowKeysType[]} keys 选中的数据keys
|
|
126
|
+
*/
|
|
127
|
+
setSelectedRowKeys(rows: TtSelectRowsType, keys?: TtSelectRowKeysType): void;
|
|
128
|
+
/**
|
|
129
|
+
* @description: 清除全部行选择
|
|
130
|
+
*/
|
|
131
|
+
clearSelectedRowKeys(): void;
|
|
132
|
+
/**
|
|
133
|
+
* 往表格插入临时数据,从第一行新增一行或多行新数据
|
|
134
|
+
* @param records 新数据
|
|
135
|
+
*/
|
|
136
|
+
insert(records: VxeTablePropTypes.Row): Promise<{
|
|
137
|
+
row: VxeTablePropTypes.Row;
|
|
138
|
+
rows: VxeTablePropTypes.Row[];
|
|
139
|
+
}>;
|
|
140
|
+
/**
|
|
141
|
+
* 往表格指定行中插入临时数据
|
|
142
|
+
* 如果 row 为空则从插入到顶部,如果为树结构,则插入到目标节点顶部
|
|
143
|
+
* 如果 row 为 -1 则从插入到底部,如果为树结构,则插入到目标节点底部
|
|
144
|
+
* 如果 row 为有效行则插入到该行的位置,如果为树结构,则有插入到效的目标节点该行的位置
|
|
145
|
+
* @param {Object/Array} records 新的数据
|
|
146
|
+
* @param {Row} row 指定行
|
|
147
|
+
*/
|
|
148
|
+
insertAt(records: VxeTablePropTypes.Row, row: VxeTablePropTypes.Row | -1 | null): Promise<{
|
|
149
|
+
row: VxeTablePropTypes.Row;
|
|
150
|
+
rows: VxeTablePropTypes.Row[];
|
|
151
|
+
}>;
|
|
152
|
+
/**
|
|
153
|
+
* 删除指定行数据,指定 row 或 [row, ...] 删除多条数据,如果为空则删除所有数据
|
|
154
|
+
* @param rows 指定行
|
|
155
|
+
*/
|
|
156
|
+
remove(rows: VxeTablePropTypes.Row | VxeTablePropTypes.Row[]): Promise<{
|
|
157
|
+
row: VxeTablePropTypes.Row;
|
|
158
|
+
rows: VxeTablePropTypes.Row[];
|
|
159
|
+
}>;
|
|
160
|
+
/**
|
|
161
|
+
* 删除复选框选中的行数据
|
|
162
|
+
*/
|
|
163
|
+
removeCheckboxRow(): Promise<{
|
|
164
|
+
row: VxeTablePropTypes.Row;
|
|
165
|
+
rows: VxeTablePropTypes.Row[];
|
|
166
|
+
}>;
|
|
167
|
+
/**
|
|
168
|
+
* 删除单选框选中的行数据
|
|
169
|
+
*/
|
|
170
|
+
removeRadioRow(): Promise<{
|
|
171
|
+
row: VxeTablePropTypes.Row;
|
|
172
|
+
rows: VxeTablePropTypes.Row[];
|
|
173
|
+
}>;
|
|
174
|
+
/**
|
|
175
|
+
* 删除当前行选中的行数据
|
|
176
|
+
*/
|
|
177
|
+
removeCurrentRow(): Promise<{
|
|
178
|
+
row: VxeTablePropTypes.Row;
|
|
179
|
+
rows: VxeTablePropTypes.Row[];
|
|
180
|
+
}>;
|
|
181
|
+
/**
|
|
182
|
+
* 清除编辑状态并重置数据
|
|
183
|
+
*/
|
|
184
|
+
clearEditRevertData(records: VxeTablePropTypes.Row): void;
|
|
185
|
+
/**
|
|
186
|
+
* 指定行激活编辑
|
|
187
|
+
* @param {VxeTablePropTypes.Row} row 行数据
|
|
188
|
+
* @param {string | VxeTableDefines.ColumnInfo} fieldOrColumn 列配置可以时field
|
|
189
|
+
*/
|
|
190
|
+
setEditRow(row: VxeTablePropTypes.Row, fieldOrColumn?: boolean | string | VxeTableDefines.ColumnInfo): void;
|
|
191
|
+
/**
|
|
192
|
+
* 指定单元格激活编辑
|
|
193
|
+
* @param {VxeTablePropTypes.Row} row 当前行数据
|
|
194
|
+
* @param {string | VxeTableDefines.ColumnInfo} fieldOrColumn 列配置可以时field
|
|
195
|
+
*/
|
|
196
|
+
setEditCell(row: VxeTablePropTypes.Row, fieldOrColumn: string | VxeTableDefines.ColumnInfo): void;
|
|
197
|
+
/**
|
|
198
|
+
* 加载数据
|
|
199
|
+
* @param data 数据
|
|
200
|
+
*/
|
|
201
|
+
loadData(data: VxeTablePropTypes.Row[]): Promise<any>;
|
|
202
|
+
/**
|
|
203
|
+
* 加载数据并恢复到初始状态
|
|
204
|
+
* @param data 数据
|
|
205
|
+
*/
|
|
206
|
+
reloadData(data: VxeTablePropTypes.Row[]): Promise<void>;
|
|
207
|
+
/**
|
|
208
|
+
* 重新加载列
|
|
209
|
+
* @param columns 列对象
|
|
210
|
+
*/
|
|
211
|
+
reloadColumn(columns: (VxeTableDefines.ColumnOptions<any> | VxeTableDefines.ColumnInfo<any>)[]): Promise<void>;
|
|
212
|
+
/**
|
|
213
|
+
* 局部加载行数据并恢复到初始状态
|
|
214
|
+
* @param rows 行对象
|
|
215
|
+
* @param record 新数据
|
|
216
|
+
* @param field 指定字段名
|
|
217
|
+
*/
|
|
218
|
+
reloadRow(rows: VxeTablePropTypes.Row | VxeTablePropTypes.Row[], record?: VxeTablePropTypes.Row, field?: string): Promise<void>;
|
|
219
|
+
/**
|
|
220
|
+
* 手动清空单元格内容,如果不传参数,则清空整个表格内容,如果传了行则清空指定行内容,如果传了指定字段,则清空该字段内容
|
|
221
|
+
* @param data 指定行
|
|
222
|
+
* @param field 字段名
|
|
223
|
+
*/
|
|
224
|
+
clearData(data?: VxeTablePropTypes.Row | VxeTablePropTypes.Row[], field?: string): Promise<any>;
|
|
225
|
+
/**
|
|
226
|
+
* 重新懒加载展开行,并展开内容
|
|
227
|
+
* @param row 指定行
|
|
228
|
+
*/
|
|
229
|
+
reloadRowExpand(row: VxeTablePropTypes.Row): void;
|
|
230
|
+
/**
|
|
231
|
+
* 重新懒加载树节点,并展开该节点
|
|
232
|
+
* @param row 指定行
|
|
233
|
+
*/
|
|
234
|
+
reloadTreeExpand(row: VxeTablePropTypes.Row): void;
|
|
235
|
+
/**
|
|
236
|
+
* @description: 获取表格服务端自定义插槽
|
|
237
|
+
*/
|
|
238
|
+
getHttpFieldsSlot(): {
|
|
239
|
+
default: string[];
|
|
240
|
+
edit: string[];
|
|
241
|
+
};
|
|
242
|
+
/** 获取表格实例 */
|
|
243
|
+
getTableInstance(): VxeGridInstance;
|
|
244
|
+
/**
|
|
245
|
+
* 设置代理状态(loading、selectedKeys)
|
|
246
|
+
* @param state 代理状态对象
|
|
247
|
+
*/
|
|
248
|
+
setProxyState(state: ProxyStateType): void;
|
|
249
|
+
/**
|
|
250
|
+
* @description: 获取表格选中数据
|
|
251
|
+
* @return {DT[]}
|
|
252
|
+
*/
|
|
253
|
+
selectedKeys: import('vue').ComputedRef<any>;
|
|
254
|
+
/**
|
|
255
|
+
* @description: 获取表格选中数据
|
|
256
|
+
* @return {DT[]}
|
|
257
|
+
*/
|
|
258
|
+
selectedRows: import('vue').ComputedRef<any>;
|
|
259
|
+
/**
|
|
260
|
+
* 获取表格 loading 状态(响应式)
|
|
261
|
+
*/
|
|
262
|
+
getLoading: import('vue').ComputedRef<boolean | undefined>;
|
|
263
|
+
/**
|
|
264
|
+
* 是否使用表格的event
|
|
265
|
+
*/
|
|
266
|
+
getIsTableEvent: import('vue').ComputedRef<boolean | undefined>;
|
|
267
|
+
}
|
|
268
|
+
export { TableApi };
|
|
269
|
+
//# sourceMappingURL=table-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-api.d.ts","sourceRoot":"","sources":["../../../../../src/components/tt-table/src/utils/table-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACvG,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAIvH,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAG5C,KAAK,cAAc,GAAG;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,mBAAmB,CAAC;IACnC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,gBAAgB,CAAC;CACjC,CAAC;AAGF,wBAAgB,eAAe,IAAI,YAAY,CA8E9C;AAED;;;;;;;;;GASG;AACH,cAAM,QAAQ;IACZ,oBAAoB;IACb,IAAI,EAAmB,eAAe,CAAC;IAE9C,+BAA+B;IACxB,OAAO,EAAmB,cAAc,CAAC;IAEhD,qBAAqB;IACd,KAAK,EAAE,IAAI,GAAG,YAAY,CAAQ;IAEzC,wBAAwB;IACjB,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;IAElC,oCAAoC;IACpC,OAAO,CAAC,UAAU,CAKf;IAEH,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,YAAY,CAAe;IAEnC;;;OAGG;gBACS,OAAO,GAAE,YAAiB;IAetC;;;;OAIG;IACH,KAAK,CAAC,QAAQ,EAAE,SAAS,GAAG,eAAe,EAAE,OAAO,EAAE,cAAc;IAapE;;;O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AAY,iCAAgD;IAC5D;;;OAGG;IACH,YAAY,iCAAgD;IAE5D;;OAEG;IACH,UAAU,iDAA2C;IAErD;;OAEG;IACH,eAAe,iDAAgD;CAChE;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { VxeGridInstance } from 'vxe-table';
|
|
2
|
+
import { ExtendedFormApi } from 'vben-core-form-ui';
|
|
3
|
+
import { FetchParams, TtTableExtendedTableApi, TtTableProps } from '../types/table';
|
|
4
|
+
import { TtTableFormActionType, TtTableFormProps, TtTableFormRenderFormProps } from '../types/tableForm';
|
|
5
|
+
import { Store } from '@tanstack/vue-store';
|
|
6
|
+
/**
|
|
7
|
+
* TableFormApi 表单+表格复合组件的 API 封装类
|
|
8
|
+
*
|
|
9
|
+
* 用于统一管理表单和表格的实例、状态、方法,便于外部操作。
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const api = new TableFormApi({ ...配置 })
|
|
13
|
+
* api.reload()
|
|
14
|
+
* api.setFormProps({ ... })
|
|
15
|
+
*/
|
|
16
|
+
declare class TableFormApi {
|
|
17
|
+
/** form 表单实例(FormApi) */
|
|
18
|
+
formApi: ExtendedFormApi;
|
|
19
|
+
/** 表格 API 实例(TableApi) */
|
|
20
|
+
tableApi: TtTableExtendedTableApi;
|
|
21
|
+
/** vxe-grid 表格实例 */
|
|
22
|
+
grid: VxeGridInstance;
|
|
23
|
+
/** 当前表单+表格的 props 状态 */
|
|
24
|
+
state: null | TtTableFormProps;
|
|
25
|
+
/** 表单操作方法集合(TableFormActionType) */
|
|
26
|
+
tableForm: TtTableFormActionType;
|
|
27
|
+
/** 响应式 store,存储表单+表格的状态 */
|
|
28
|
+
store: Store<TtTableFormProps>;
|
|
29
|
+
private isMounted;
|
|
30
|
+
private stateHandler;
|
|
31
|
+
/**
|
|
32
|
+
* 构造函数,初始化 store、tableApi、状态等
|
|
33
|
+
* @param options 表单+表格配置项
|
|
34
|
+
*/
|
|
35
|
+
constructor(options?: TtTableFormProps);
|
|
36
|
+
/**
|
|
37
|
+
* 组件挂载时调用,注入表单和表格实例
|
|
38
|
+
* @param instance 表单操作方法实例
|
|
39
|
+
* @param formApi 表单实例
|
|
40
|
+
*/
|
|
41
|
+
mount(instance: null | TtTableFormActionType, formApi: ExtendedFormApi): void;
|
|
42
|
+
/**
|
|
43
|
+
* 更新表单+表格的数据
|
|
44
|
+
* @param stateOrFn 新状态或返回新状态的函数
|
|
45
|
+
*/
|
|
46
|
+
setState(stateOrFn: ((prev: TtTableFormProps) => Partial<TtTableFormProps>) | Partial<TtTableFormProps>): void;
|
|
47
|
+
/**
|
|
48
|
+
* 重新加载表格数据
|
|
49
|
+
* @param data 可选的查询参数
|
|
50
|
+
*/
|
|
51
|
+
reload(data?: FetchParams): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* 当前选中的行 key 数组(响应式)
|
|
54
|
+
*/
|
|
55
|
+
selectedKeys: import('vue').ComputedRef<any>;
|
|
56
|
+
/**
|
|
57
|
+
* 获取表单实例
|
|
58
|
+
*/
|
|
59
|
+
formInstance(): ExtendedFormApi;
|
|
60
|
+
/**
|
|
61
|
+
* 获取 vxe-grid 表格实例
|
|
62
|
+
*/
|
|
63
|
+
vxeGridInstance(): VxeGridInstance;
|
|
64
|
+
/**
|
|
65
|
+
* 获取表格 API 实例
|
|
66
|
+
*/
|
|
67
|
+
tableInstance(): TtTableExtendedTableApi;
|
|
68
|
+
/**
|
|
69
|
+
* 设置表格属性
|
|
70
|
+
* @param props 表格属性
|
|
71
|
+
*/
|
|
72
|
+
setTableProps(props: Partial<TtTableProps>): void;
|
|
73
|
+
/**
|
|
74
|
+
* 设置表单属性
|
|
75
|
+
* @param props 表单属性
|
|
76
|
+
*/
|
|
77
|
+
setFormProps(props: Partial<TtTableFormRenderFormProps>): void;
|
|
78
|
+
/**
|
|
79
|
+
* 设置表单+表格属性
|
|
80
|
+
* @param props 属性
|
|
81
|
+
*/
|
|
82
|
+
setProps(props: Partial<TtTableFormProps>): void;
|
|
83
|
+
/**
|
|
84
|
+
* 组件卸载时调用,重置挂载状态
|
|
85
|
+
*/
|
|
86
|
+
unmount(): void;
|
|
87
|
+
}
|
|
88
|
+
export { TableFormApi };
|
|
89
|
+
//# sourceMappingURL=table-form-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-form-api.d.ts","sourceRoot":"","sources":["../../../../../src/components/tt-table/src/utils/table-form-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzF,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAE9G,OAAO,EAAE,KAAK,EAAY,MAAM,qBAAqB,CAAC;AAItD;;;;;;;;;GASG;AACH,cAAM,YAAY;IAChB,yBAAyB;IAClB,OAAO,EAAmB,eAAe,CAAC;IACjD,0BAA0B;IACnB,QAAQ,EAAmB,uBAAuB,CAAC;IAC1D,oBAAoB;IACb,IAAI,EAAmB,eAAe,CAAC;IAC9C,wBAAwB;IACjB,KAAK,EAAE,IAAI,GAAG,gBAAgB,CAAQ;IAE7C,oCAAoC;IAC7B,SAAS,EAAmB,qBAAqB,CAAC;IACzD,2BAA2B;IACpB,KAAK,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAEtC,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,YAAY,CAAe;IAEnC;;;OAGG;gBACS,OAAO,GAAE,gBAAqB;IA+B1C;;;;OAIG;IACH,KAAK,CAAC,QAAQ,EAAE,IAAI,GAAG,qBAAqB,EAAE,OAAO,EAAE,eAAe;IAgBtE;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,gBAAgB,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAUvG;;;OAGG;IACG,MAAM,CAAC,IAAI,CAAC,EAAE,WAAW;IAI/B;;OAEG;IACH,YAAY,iCAET;IAEH;;OAEG;IACH,YAAY;IAIZ;;OAEG;IACH,eAAe;IAIf;;OAEG;IACH,aAAa;IAIb;;;OAGG;IACH,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC;IAI1C;;;OAGG;IACH,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,0BAA0B,CAAC;IAIvD;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,gBAAgB,CAAC;IAIzC;;OAEG;IACH,OAAO;CAIR;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { VxeColumnPropTypes } from 'vxe-table';
|
|
3
|
+
export type ColumnOptionType = VxeColumnPropTypes.Filter & {
|
|
4
|
+
isTree: boolean;
|
|
5
|
+
active: string;
|
|
6
|
+
columnType: "text" | "number" | "date";
|
|
7
|
+
conditionDatas: any[];
|
|
8
|
+
conditionMode: "and" | "or";
|
|
9
|
+
columnSelectAll: boolean;
|
|
10
|
+
columnSearchValues: any[];
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* 默认筛选
|
|
14
|
+
* @param values 筛选值数组
|
|
15
|
+
* @param tableRef 表格ref
|
|
16
|
+
*/
|
|
17
|
+
export declare function filterFieldEvent(values: {
|
|
18
|
+
key: string;
|
|
19
|
+
value: string | string[];
|
|
20
|
+
columnTypeEnum?: number;
|
|
21
|
+
}[], tableRef: Ref<any>): void;
|
|
22
|
+
/**
|
|
23
|
+
* 获取筛选数据
|
|
24
|
+
* @param tableDatas 表格数据
|
|
25
|
+
* @param field 字段名
|
|
26
|
+
* @returns 筛选数据
|
|
27
|
+
*/
|
|
28
|
+
export declare function getTableOriginalFilterData(tableDatas: any[], field: string): Recordable<any>[];
|
|
29
|
+
//# sourceMappingURL=vxeTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vxeTable.d.ts","sourceRoot":"","sources":["../../../../../src/components/tt-table/src/utils/vxeTable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAIpD,MAAM,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,MAAM,GAAG;IACzD,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;IACvC,cAAc,EAAE,GAAG,EAAE,CAAC;IACtB,aAAa,EAAE,KAAK,GAAG,IAAI,CAAC;IAC5B,eAAe,EAAE,OAAO,CAAC;IACzB,kBAAkB,EAAE,GAAG,EAAE,CAAC;CAC3B,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,EAC5E,QAAQ,EAAE,GAAG,CAAC,GAAG,CAAC,QAcnB;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,MAAM,qBAkB1E"}
|
|
@@ -397,13 +397,13 @@ declare const FieldImpl: import('vue').DefineComponent<import('vue').ExtractProp
|
|
|
397
397
|
modelValue: any;
|
|
398
398
|
'onUpdate:modelValue': ((e: any) => unknown) | undefined;
|
|
399
399
|
modelModifiers: any;
|
|
400
|
+
as: string | Record<string, any>;
|
|
400
401
|
bails: boolean;
|
|
401
402
|
validateOnInput: boolean;
|
|
402
403
|
validateOnChange: boolean;
|
|
403
404
|
validateOnBlur: boolean;
|
|
404
405
|
validateOnModelUpdate: boolean;
|
|
405
406
|
uncheckedValue: any;
|
|
406
|
-
as: string | Record<string, any>;
|
|
407
407
|
validateOnMount: boolean;
|
|
408
408
|
rulesBlur: RuleExpression<unknown>;
|
|
409
409
|
rules: RuleExpression<unknown>;
|
|
@@ -236,8 +236,8 @@ declare const FormImpl: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
236
236
|
}>> & Readonly<{}>, {
|
|
237
237
|
name: string;
|
|
238
238
|
onSubmit: SubmissionHandler<GenericObject>;
|
|
239
|
-
initialValues: Record<string, any>;
|
|
240
239
|
as: string | null;
|
|
240
|
+
initialValues: Record<string, any>;
|
|
241
241
|
validateOnMount: boolean;
|
|
242
242
|
initialErrors: Record<string, any>;
|
|
243
243
|
validationSchema: Record<string, any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSetup.d.ts","sourceRoot":"","sources":["../../src/hooks/useSetup.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,EAAE,GA4D1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,KAAK,EAAE,GAInB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SlotsType } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* 用于处理Vue模板插槽的自定义Hook
|
|
4
|
+
* @param regexp 用于匹配和替换插槽名的正则表达式字符串
|
|
5
|
+
*/
|
|
6
|
+
export declare function useTemplateSlot(regexp: string): {
|
|
7
|
+
getSlotKeys: (slots: SlotsType) => (string | null)[];
|
|
8
|
+
replaceSlotKey: (key: string | null) => string;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=useTemplateSlot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTemplateSlot.d.ts","sourceRoot":"","sources":["../../src/hooks/useTemplateSlot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAErC;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM;yBAMhB,SAAS;0BAUR,MAAM,GAAG,IAAI;EAM3C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as e, b as a, l as o } from "./index-
|
|
2
|
-
import { a as c } from "./use-form-common-props-
|
|
1
|
+
import { c as e, b as a, l as o } from "./index-iFd1yQ1C.js";
|
|
2
|
+
import { a as c } from "./use-form-common-props-CDmM4Wn1.js";
|
|
3
3
|
const r = c([
|
|
4
4
|
String,
|
|
5
5
|
Object,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { e as a, m as c, d as u, b as l, a as p, w as f } from "./use-form-common-props-
|
|
1
|
+
import { e as a, m as c, d as u, b as l, a as p, w as f } from "./use-form-common-props-CDmM4Wn1.js";
|
|
2
2
|
import { defineComponent as m, computed as d, createElementBlock as g, openBlock as y, mergeProps as b, unref as S, renderSlot as h } from "vue";
|
|
3
|
-
import { g as E, k as w, d as C } from "./index-
|
|
3
|
+
import { g as E, k as w, d as C } from "./index-iFd1yQ1C.js";
|
|
4
4
|
import { isClient as P } from "@vueuse/core";
|
|
5
5
|
const _ = "utils/dom/style", A = (t, s) => {
|
|
6
6
|
if (!t || !s) return !1;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { k as X, l as S, e as C, b as Y, a as Z, h as p, j as _, d as M, t as ee, w as ae } from "./use-form-common-props-
|
|
2
|
-
import { u as te } from "./index-
|
|
3
|
-
import { i as V } from "./icon-
|
|
4
|
-
import { g as N, I as B, C as A, U as $, d as ie, l as ne, h as O } from "./index-
|
|
1
|
+
import { k as X, l as S, e as C, b as Y, a as Z, h as p, j as _, d as M, t as ee, w as ae } from "./use-form-common-props-CDmM4Wn1.js";
|
|
2
|
+
import { u as te } from "./index-CB2v0taz.js";
|
|
3
|
+
import { i as V } from "./icon-C9BsRQqM.js";
|
|
4
|
+
import { g as N, I as B, C as A, U as $, d as ie, l as ne, h as O } from "./index-iFd1yQ1C.js";
|
|
5
5
|
import { defineComponent as le, computed as d, ref as ce, shallowRef as oe, watch as L, onMounted as se, createElementBlock as v, openBlock as a, withModifiers as ue, normalizeClass as r, createElementVNode as P, createCommentVNode as o, withKeys as ve, unref as i, renderSlot as y, createBlock as s, withCtx as f, resolveDynamicComponent as b, toDisplayString as E, normalizeStyle as re, createVNode as de, nextTick as fe } from "vue";
|
|
6
|
-
import { a as me, E as m } from "./index-
|
|
7
|
-
import { u as he, a as ye } from "./use-form-item-
|
|
6
|
+
import { a as me, E as m } from "./index-64J4mWP7.js";
|
|
7
|
+
import { u as he, a as ye } from "./use-form-item-Bv38v7TO.js";
|
|
8
8
|
const be = (e) => ["", ...X].includes(e), ke = Y({
|
|
9
9
|
/**
|
|
10
10
|
* @description binding value, it should be equivalent to either `active-value` or `inactive-value`, by default it's `boolean` type
|