vft 0.0.496 → 0.0.498

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.
Files changed (146) hide show
  1. package/dist/index.css +1 -1
  2. package/es/component.js +18 -16
  3. package/es/components/autocomplete/autocomplete.vue.d.ts +2 -2
  4. package/es/components/autocomplete/index.d.ts +6 -6
  5. package/es/components/button/index.d.ts +9 -9
  6. package/es/components/index.d.ts +1 -0
  7. package/es/components/index.js +257 -255
  8. package/es/components/modal/index.d.ts +6 -0
  9. package/es/components/modal/modal.vue.d.ts +3 -0
  10. package/es/components/modal/modal.vue2.js +12 -12
  11. package/es/components/popconfirm/index.d.ts +15 -15
  12. package/es/components/popconfirm/popconfirm.vue.d.ts +1 -1
  13. package/es/components/select/defaults.d.ts +4 -0
  14. package/es/components/select/defaults.js +7 -3
  15. package/es/components/select/index.d.ts +13 -4
  16. package/es/components/select/select.vue.d.ts +13 -4
  17. package/es/components/select/select.vue.js +9 -8
  18. package/es/components/select/select.vue2.js +40 -29
  19. package/es/components/select/token.d.ts +4 -1
  20. package/es/components/select/useSelect.d.ts +4 -4
  21. package/es/components/super-form/index.d.ts +9 -0
  22. package/es/components/super-form/style/css.d.ts +1 -0
  23. package/es/components/super-form/style/css.js +2 -0
  24. package/es/components/super-form/style/index.d.ts +1 -0
  25. package/es/components/super-form/style/index.js +2 -0
  26. package/es/components/super-form/super-form-item.vue2.js +355 -255
  27. package/es/components/super-form/super-form.vue2.js +1 -1
  28. package/es/components/super-form/types.d.ts +26 -1
  29. package/es/components/super-form/use/helper.js +37 -36
  30. package/es/components/super-form/use/use-form-events.js +126 -125
  31. package/es/components/table/index.d.ts +9 -6
  32. package/es/components/table/style/css.js +2 -0
  33. package/es/components/table/style/index.js +2 -0
  34. package/es/components/table/table.vue.d.ts +2 -1
  35. package/es/components/table/table.vue2.js +99 -94
  36. package/es/components/table/types.d.ts +5 -3
  37. package/es/components/table/use/use-data-source.d.ts +6 -4
  38. package/es/components/table/use/use-data-source.js +150 -148
  39. package/es/components/table/use/use-table.js +8 -8
  40. package/es/components/tree/index.d.ts +71 -71
  41. package/es/components/tree/tree-node.vue.d.ts +1 -1
  42. package/es/components/tree/tree.type.d.ts +2 -0
  43. package/es/components/tree/tree.vue.d.ts +14 -14
  44. package/es/components/tree-select/cache-options.d.ts +20 -0
  45. package/es/components/tree-select/cache-options.js +30 -0
  46. package/es/components/tree-select/index.d.ts +8 -0
  47. package/es/components/tree-select/index.js +10 -0
  48. package/es/components/tree-select/instance.d.ts +5 -0
  49. package/es/components/tree-select/instance.js +1 -0
  50. package/es/components/tree-select/select.d.ts +10 -0
  51. package/es/components/tree-select/select.js +129 -0
  52. package/es/components/tree-select/style/css.d.ts +4 -0
  53. package/es/components/tree-select/style/css.js +11 -0
  54. package/es/components/tree-select/style/index.d.ts +4 -0
  55. package/es/components/tree-select/style/index.js +11 -0
  56. package/es/components/tree-select/tree-select-option.d.ts +42 -0
  57. package/es/components/tree-select/tree-select-option.js +35 -0
  58. package/es/components/tree-select/tree-select.vue.d.ts +4 -0
  59. package/es/components/tree-select/tree-select.vue.js +5 -0
  60. package/es/components/tree-select/tree-select.vue2.js +155 -0
  61. package/es/components/tree-select/tree.d.ts +11 -0
  62. package/es/components/tree-select/tree.js +201 -0
  63. package/es/components/tree-select/utils.d.ts +10 -0
  64. package/es/components/tree-select/utils.js +45 -0
  65. package/es/index.js +1 -0
  66. package/es/package.json.d.ts +1 -1
  67. package/es/package.json.js +1 -1
  68. package/es/script.css +1 -1
  69. package/es/utils/form-register.d.ts +1 -0
  70. package/es/utils/form-register.js +11 -10
  71. package/lib/component.cjs +1 -1
  72. package/lib/components/autocomplete/autocomplete.vue.d.ts +2 -2
  73. package/lib/components/autocomplete/index.d.ts +6 -6
  74. package/lib/components/button/index.d.ts +9 -9
  75. package/lib/components/index.cjs +1 -1
  76. package/lib/components/index.d.ts +1 -0
  77. package/lib/components/modal/index.d.ts +6 -0
  78. package/lib/components/modal/modal.vue.d.ts +3 -0
  79. package/lib/components/modal/modal.vue2.cjs +1 -1
  80. package/lib/components/popconfirm/index.d.ts +15 -15
  81. package/lib/components/popconfirm/popconfirm.vue.d.ts +1 -1
  82. package/lib/components/select/defaults.cjs +1 -1
  83. package/lib/components/select/defaults.d.ts +4 -0
  84. package/lib/components/select/index.d.ts +13 -4
  85. package/lib/components/select/select.vue.cjs +1 -1
  86. package/lib/components/select/select.vue.d.ts +13 -4
  87. package/lib/components/select/select.vue2.cjs +1 -1
  88. package/lib/components/select/token.d.ts +4 -1
  89. package/lib/components/select/useSelect.d.ts +4 -4
  90. package/lib/components/super-form/index.d.ts +9 -0
  91. package/lib/components/super-form/style/css.cjs +1 -1
  92. package/lib/components/super-form/style/css.d.ts +1 -0
  93. package/lib/components/super-form/style/index.cjs +1 -1
  94. package/lib/components/super-form/style/index.d.ts +1 -0
  95. package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
  96. package/lib/components/super-form/super-form.vue2.cjs +1 -1
  97. package/lib/components/super-form/types.d.ts +26 -1
  98. package/lib/components/super-form/use/helper.cjs +1 -1
  99. package/lib/components/super-form/use/use-form-events.cjs +1 -1
  100. package/lib/components/table/index.d.ts +9 -6
  101. package/lib/components/table/style/css.cjs +1 -1
  102. package/lib/components/table/style/index.cjs +1 -1
  103. package/lib/components/table/table.vue.d.ts +2 -1
  104. package/lib/components/table/table.vue2.cjs +1 -1
  105. package/lib/components/table/types.d.ts +5 -3
  106. package/lib/components/table/use/use-data-source.cjs +1 -1
  107. package/lib/components/table/use/use-data-source.d.ts +6 -4
  108. package/lib/components/table/use/use-table.cjs +1 -1
  109. package/lib/components/tree/index.d.ts +71 -71
  110. package/lib/components/tree/tree-node.vue.d.ts +1 -1
  111. package/lib/components/tree/tree.type.d.ts +2 -0
  112. package/lib/components/tree/tree.vue.d.ts +14 -14
  113. package/lib/components/tree-select/cache-options.cjs +1 -0
  114. package/lib/components/tree-select/cache-options.d.ts +20 -0
  115. package/lib/components/tree-select/index.cjs +1 -0
  116. package/lib/components/tree-select/index.d.ts +8 -0
  117. package/lib/components/tree-select/instance.cjs +1 -0
  118. package/lib/components/tree-select/instance.d.ts +5 -0
  119. package/lib/components/tree-select/select.cjs +1 -0
  120. package/lib/components/tree-select/select.d.ts +10 -0
  121. package/lib/components/tree-select/style/css.cjs +1 -0
  122. package/lib/components/tree-select/style/css.d.ts +4 -0
  123. package/lib/components/tree-select/style/index.cjs +1 -0
  124. package/lib/components/tree-select/style/index.d.ts +4 -0
  125. package/lib/components/tree-select/tree-select-option.cjs +1 -0
  126. package/lib/components/tree-select/tree-select-option.d.ts +42 -0
  127. package/lib/components/tree-select/tree-select.vue.cjs +1 -0
  128. package/lib/components/tree-select/tree-select.vue.d.ts +4 -0
  129. package/lib/components/tree-select/tree-select.vue2.cjs +1 -0
  130. package/lib/components/tree-select/tree.cjs +1 -0
  131. package/lib/components/tree-select/tree.d.ts +11 -0
  132. package/lib/components/tree-select/utils.cjs +1 -0
  133. package/lib/components/tree-select/utils.d.ts +10 -0
  134. package/lib/index.cjs +1 -1
  135. package/lib/package.json.cjs +1 -1
  136. package/lib/package.json.d.ts +1 -1
  137. package/lib/script.css +1 -1
  138. package/lib/utils/form-register.cjs +1 -1
  139. package/lib/utils/form-register.d.ts +1 -0
  140. package/package.json +5 -5
  141. package/theme-style/index.css +1 -1
  142. package/theme-style/src/cascader.scss +1 -12
  143. package/theme-style/src/tree-select.scss +10 -1
  144. package/theme-style/vft-cascader.css +1 -1
  145. package/theme-style/vft-tree-select.css +1 -1
  146. package/web-types.json +1 -1
@@ -31,7 +31,7 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
31
31
  type: import("vue").PropType<boolean | "strict">;
32
32
  };
33
33
  afterFetch: {
34
- type: import("vue").PropType<(params: any) => import("../types").Recordable[]>;
34
+ type: import("vue").PropType<(data: import("../types").Recordable[]) => import("../types").Recordable[] | Promise<import("../types").Recordable[]>>;
35
35
  };
36
36
  transformParams: {
37
37
  type: import("vue").PropType<boolean>;
@@ -504,7 +504,7 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
504
504
  setProps: (props: Partial<import("./types").TableProps>) => void;
505
505
  reload: (opt?: any) => Promise<import("../types").Recordable[] | undefined>;
506
506
  deleteTableDataRecord: (row: import("../types").Recordable | import("../types").Recordable[], rowKey?: string | number | string[] | number[]) => void;
507
- insertTableDataRecord: (record: import("../types").Recordable | import("../types").Recordable[], index?: number) => import("../types").Recordable[] | undefined;
507
+ insertTableDataRecord: (record: import("../types").Recordable | import("../types").Recordable[], index?: number, parentRowId?: string | number) => Promise<import("../types").Recordable[] | undefined>;
508
508
  updateTableDataRecord: (rowKey: string | number, record: import("../types").Recordable) => import("../types").Recordable | undefined;
509
509
  updateTableData: (index: number, key: string, value: any) => Promise<import("../types").Recordable>;
510
510
  setTableData: <T = import("../types").Recordable>(values: T[]) => void;
@@ -513,6 +513,7 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
513
513
  setColumns: (columnList: any) => void;
514
514
  getRawDataSource: () => import("../types").Recordable[];
515
515
  tableSearch: (value: any) => void;
516
+ expandTreeLevel: (level?: number) => void;
516
517
  table: import("vue").Ref<import("./types").TableInstance | undefined, import("./types").TableInstance | undefined>;
517
518
  formRef: import("vue").Ref<any, any>;
518
519
  pageRef: import("vue").Ref<import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
@@ -952,7 +953,7 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
952
953
  type: import("vue").PropType<boolean | "strict">;
953
954
  };
954
955
  afterFetch: {
955
- type: import("vue").PropType<(params: any) => import("../types").Recordable[]>;
956
+ type: import("vue").PropType<(data: import("../types").Recordable[]) => import("../types").Recordable[] | Promise<import("../types").Recordable[]>>;
956
957
  };
957
958
  transformParams: {
958
959
  type: import("vue").PropType<boolean>;
@@ -1425,7 +1426,7 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
1425
1426
  setProps: (props: Partial<import("./types").TableProps>) => void;
1426
1427
  reload: (opt?: any) => Promise<import("../types").Recordable[] | undefined>;
1427
1428
  deleteTableDataRecord: (row: import("../types").Recordable | import("../types").Recordable[], rowKey?: string | number | string[] | number[]) => void;
1428
- insertTableDataRecord: (record: import("../types").Recordable | import("../types").Recordable[], index?: number) => import("../types").Recordable[] | undefined;
1429
+ insertTableDataRecord: (record: import("../types").Recordable | import("../types").Recordable[], index?: number, parentRowId?: string | number) => Promise<import("../types").Recordable[] | undefined>;
1429
1430
  updateTableDataRecord: (rowKey: string | number, record: import("../types").Recordable) => import("../types").Recordable | undefined;
1430
1431
  updateTableData: (index: number, key: string, value: any) => Promise<import("../types").Recordable>;
1431
1432
  setTableData: <T = import("../types").Recordable>(values: T[]) => void;
@@ -1434,6 +1435,7 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
1434
1435
  setColumns: (columnList: any) => void;
1435
1436
  getRawDataSource: () => import("../types").Recordable[];
1436
1437
  tableSearch: (value: any) => void;
1438
+ expandTreeLevel: (level?: number) => void;
1437
1439
  table: import("vue").Ref<import("./types").TableInstance | undefined, import("./types").TableInstance | undefined>;
1438
1440
  formRef: import("vue").Ref<any, any>;
1439
1441
  pageRef: import("vue").Ref<import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
@@ -1757,7 +1759,7 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
1757
1759
  type: import("vue").PropType<boolean | "strict">;
1758
1760
  };
1759
1761
  afterFetch: {
1760
- type: import("vue").PropType<(params: any) => import("../types").Recordable[]>;
1762
+ type: import("vue").PropType<(data: import("../types").Recordable[]) => import("../types").Recordable[] | Promise<import("../types").Recordable[]>>;
1761
1763
  };
1762
1764
  transformParams: {
1763
1765
  type: import("vue").PropType<boolean>;
@@ -2230,7 +2232,7 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
2230
2232
  setProps: (props: Partial<import("./types").TableProps>) => void;
2231
2233
  reload: (opt?: any) => Promise<import("../types").Recordable[] | undefined>;
2232
2234
  deleteTableDataRecord: (row: import("../types").Recordable | import("../types").Recordable[], rowKey?: string | number | string[] | number[]) => void;
2233
- insertTableDataRecord: (record: import("../types").Recordable | import("../types").Recordable[], index?: number) => import("../types").Recordable[] | undefined;
2235
+ insertTableDataRecord: (record: import("../types").Recordable | import("../types").Recordable[], index?: number, parentRowId?: string | number) => Promise<import("../types").Recordable[] | undefined>;
2234
2236
  updateTableDataRecord: (rowKey: string | number, record: import("../types").Recordable) => import("../types").Recordable | undefined;
2235
2237
  updateTableData: (index: number, key: string, value: any) => Promise<import("../types").Recordable>;
2236
2238
  setTableData: <T = import("../types").Recordable>(values: T[]) => void;
@@ -2239,6 +2241,7 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
2239
2241
  setColumns: (columnList: any) => void;
2240
2242
  getRawDataSource: () => import("../types").Recordable[];
2241
2243
  tableSearch: (value: any) => void;
2244
+ expandTreeLevel: (level?: number) => void;
2242
2245
  table: import("vue").Ref<import("./types").TableInstance | undefined, import("./types").TableInstance | undefined>;
2243
2246
  formRef: import("vue").Ref<any, any>;
2244
2247
  pageRef: import("vue").Ref<import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
@@ -36,6 +36,8 @@ import "vft/theme-style/vft-col.css";
36
36
  import "vft/theme-style/vft-form.css";
37
37
  import "vft/theme-style/vft-form-item.css";
38
38
  import "vft/theme-style/vft-time-select.css";
39
+ import "vft/theme-style/vft-tree.css";
40
+ import "vft/theme-style/vft-tree-select.css";
39
41
  import "vft/theme-style/vft-super-form.css";
40
42
  import "vft/theme-style/vft-skeleton-item.css";
41
43
  import "vft/theme-style/vft-skeleton.css";
@@ -40,5 +40,7 @@ import "vft/theme-style/src/col.scss";
40
40
  import "vft/theme-style/src/form.scss";
41
41
  import "vft/theme-style/src/form-item.scss";
42
42
  import "vft/theme-style/src/time-select.scss";
43
+ import "vft/theme-style/src/tree.scss";
44
+ import "vft/theme-style/src/tree-select.scss";
43
45
  import "vft/theme-style/src/super-form.scss";
44
46
  import "vft/theme-style/src/table.scss";
@@ -15,7 +15,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
15
15
  setProps: typeof setProps;
16
16
  reload: (opt?: any) => Promise<import("../types").Recordable[] | undefined>;
17
17
  deleteTableDataRecord: (row: import("../types").Recordable | import("../types").Recordable[], rowKey?: string | number | string[] | number[]) => void;
18
- insertTableDataRecord: (record: import("../types").Recordable | import("../types").Recordable[], index?: number) => import("../types").Recordable[] | undefined;
18
+ insertTableDataRecord: (record: import("../types").Recordable | import("../types").Recordable[], index?: number, parentRowId?: string | number) => Promise<import("../types").Recordable[] | undefined>;
19
19
  updateTableDataRecord: (rowKey: string | number, record: import("../types").Recordable) => import("../types").Recordable | undefined;
20
20
  updateTableData: (index: number, key: string, value: any) => Promise<import("../types").Recordable>;
21
21
  setTableData: <T = import("../types").Recordable>(values: T[]) => void;
@@ -24,6 +24,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
24
24
  setColumns: (columnList: any) => void;
25
25
  getRawDataSource: () => import("../types").Recordable[];
26
26
  tableSearch: (value: any) => void;
27
+ expandTreeLevel: (level?: number) => void;
27
28
  table: import("vue").Ref<TableInstance | undefined, TableInstance | undefined>;
28
29
  formRef: import("vue").Ref<any, any>;
29
30
  pageRef: import("vue").Ref<import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
@@ -1,32 +1,32 @@
1
- import { defineComponent as K, createVNode as i, useAttrs as fe, ref as d, getCurrentInstance as ue, computed as $, unref as o, watch as me, nextTick as _, toRaw as pe, createElementBlock as he, openBlock as k, normalizeClass as Ce, withCtx as n, createBlock as M, createCommentVNode as q, mergeProps as I, withDirectives as be, createElementVNode as ye, vShow as we, renderSlot as s, normalizeProps as m, guardReactiveProps as p, createSlots as ve, createTextVNode as ke } from "vue";
2
- import { VftClientOnly as xe } from "../client-only/index.js";
3
- import { VftEmpty as Se } from "../empty/index.js";
4
- import { vLoading as Be } from "../loading/directive.js";
5
- import { deepMerge as L, isClient as Re, omit as ze, isFunction as x } from "@vft/utils";
6
- import { FormCompEnum as h } from "../../utils/form-register.js";
1
+ import { defineComponent as K, createVNode as i, useAttrs as ue, ref as d, getCurrentInstance as me, computed as $, unref as o, watch as pe, nextTick as _, toRaw as he, createElementBlock as Ce, openBlock as k, normalizeClass as be, withCtx as n, createBlock as G, createCommentVNode as M, mergeProps as q, withDirectives as ye, createElementVNode as we, vShow as ve, renderSlot as s, normalizeProps as p, guardReactiveProps as h, createSlots as xe, createTextVNode as ke } from "vue";
2
+ import { VftClientOnly as Se } from "../client-only/index.js";
3
+ import { VftEmpty as Be } from "../empty/index.js";
4
+ import { vLoading as Re } from "../loading/directive.js";
5
+ import { deepMerge as L, isClient as ze, omit as Pe, isFunction as S } from "@vft/utils";
6
+ import { FormCompEnum as C } from "../../utils/form-register.js";
7
7
  import "@vueuse/core";
8
8
  import "../config-provider/hooks/use-global-config.js";
9
9
  import "lodash-es";
10
- import { useForm as Pe } from "../super-form/use/use-form.js";
11
- import { useNamespace as De } from "../../hooks/use-namespace/index.js";
10
+ import { useForm as De } from "../super-form/use/use-form.js";
11
+ import { useNamespace as He } from "../../hooks/use-namespace/index.js";
12
12
  import "../../hooks/use-model-toggle/index.js";
13
13
  import "@popperjs/core";
14
14
  import "../../hooks/use-z-index/index.js";
15
15
  import "../icon/index.js";
16
- import { VftPagination as He } from "../pagination/index.js";
17
- import { VftSkeleton as Oe } from "../skeleton/index.js";
16
+ import { VftPagination as Oe } from "../pagination/index.js";
17
+ import { VftSkeleton as Te } from "../skeleton/index.js";
18
18
  import { VftSuperForm as Fe } from "../super-form/index.js";
19
- import { VxeGrid as Te } from "vxe-table";
20
- import Ae from "xe-utils";
21
- import { PageSize as G } from "./constants.js";
22
- import { useColumns as Ee } from "./use/use-columns.js";
23
- import { useDataSource as Ne } from "./use/use-data-source.js";
24
- import { useLoading as Ve } from "./use/use-loading.js";
25
- import { usePagination as $e } from "./use/use-pagination.js";
26
- import { EmptyEnum as _e } from "../empty/constants.js";
19
+ import { VxeGrid as Ae } from "vxe-table";
20
+ import Ee from "xe-utils";
21
+ import { PageSize as I } from "./constants.js";
22
+ import { useColumns as Ne } from "./use/use-columns.js";
23
+ import { useDataSource as Ve } from "./use/use-data-source.js";
24
+ import { useLoading as $e } from "./use/use-loading.js";
25
+ import { usePagination as _e } from "./use/use-pagination.js";
26
+ import { EmptyEnum as Ge } from "../empty/constants.js";
27
27
  const Me = K({
28
28
  name: "vft-table"
29
- }), po = /* @__PURE__ */ K({
29
+ }), ho = /* @__PURE__ */ K({
30
30
  ...Me,
31
31
  props: {
32
32
  sticky: {
@@ -34,7 +34,7 @@ const Me = K({
34
34
  },
35
35
  api: {},
36
36
  pageSize: {
37
- default: G
37
+ default: I
38
38
  },
39
39
  total: {},
40
40
  rowkey: {
@@ -79,7 +79,7 @@ const Me = K({
79
79
  onChange: {},
80
80
  emptyCfg: {
81
81
  default: () => ({
82
- type: _e.NoData
82
+ type: Ge.NoData
83
83
  })
84
84
  },
85
85
  loadingCfg: {
@@ -403,22 +403,22 @@ const Me = K({
403
403
  expose: X,
404
404
  emit: j
405
405
  }) {
406
- const c = j, g = De("table"), Y = fe(), S = d(), B = d(), W = d([]), C = d(), b = d(), U = ue(), a = $(() => L(U.props, o(C))), {
406
+ const c = j, g = He("table"), Y = ue(), f = d(), B = d(), W = d([]), b = d(), y = d(), U = me(), a = $(() => L(U.props, o(b))), {
407
407
  getLoading: J,
408
408
  setLoading: Q
409
- } = Ve(a), {
410
- getPaginationInfo: f,
411
- setPagination: y,
412
- getCurrentPage: Z
413
409
  } = $e(a), {
410
+ getPaginationInfo: u,
411
+ setPagination: w,
412
+ getCurrentPage: Z
413
+ } = _e(a), {
414
414
  getViewColumns: ee,
415
415
  setColumns: oe
416
- } = Ee(a);
417
- me(() => Z(), (e) => {
416
+ } = Ne(a);
417
+ pe(() => Z(), (e) => {
418
418
  _(() => {
419
419
  R({
420
420
  seqConfig: {
421
- startIndex: (e - 1) * (f.value?.pageSize || o(a).pageSize || G)
421
+ startIndex: (e - 1) * (u.value?.pageSize || o(a).pageSize || I)
422
422
  }
423
423
  });
424
424
  });
@@ -426,15 +426,15 @@ const Me = K({
426
426
  immediate: !0
427
427
  });
428
428
  function R(e) {
429
- C.value = {
430
- ...o(C),
429
+ b.value = {
430
+ ...o(b),
431
431
  ...e
432
432
  };
433
433
  }
434
434
  const {
435
435
  getDataSourceRef: z,
436
436
  handleTableChange: ae,
437
- reload: w,
437
+ reload: v,
438
438
  deleteTableDataRecord: te,
439
439
  insertTableDataRecord: le,
440
440
  updateTableData: re,
@@ -442,23 +442,25 @@ const Me = K({
442
442
  setTableData: P,
443
443
  getDataSource: ce,
444
444
  getRawDataSource: D,
445
- tableSearch: H
446
- } = Ne(a, {
445
+ tableSearch: H,
446
+ expandTreeLevel: ie
447
+ } = Ve(a, {
447
448
  tableData: W,
448
449
  setLoading: Q,
449
- getPaginationInfo: f,
450
- setPagination: y
450
+ getPaginationInfo: u,
451
+ setPagination: w,
452
+ getGridRef: () => f.value
451
453
  }, c);
452
454
  function O(e) {
453
- e?.pageSize && y({
455
+ e?.pageSize && w({
454
456
  currentPage: 1
455
457
  }), ae(e), c("change", e);
456
458
  const {
457
459
  onChange: t
458
460
  } = o(a);
459
- t && x(t) && t(e);
461
+ t && S(t) && t(e);
460
462
  }
461
- const F = {};
463
+ const T = {};
462
464
  [
463
465
  "update:data",
464
466
  "keydown-start",
@@ -580,19 +582,19 @@ const Me = K({
580
582
  "toolbar-tool-click",
581
583
  "zoom"
582
584
  ].forEach((e) => {
583
- const t = Ae.camelCase(`on-${e}`);
584
- F[t] = (...l) => c(e, ...l);
585
+ const t = Ee.camelCase(`on-${e}`);
586
+ T[t] = (...l) => c(e, ...l);
585
587
  });
586
588
  const r = $(() => {
587
589
  const e = o(z), t = {
588
590
  ...Y,
589
591
  ...o(a),
590
- columns: pe(o(ee)),
592
+ columns: he(o(ee)),
591
593
  loading: o(J),
592
594
  data: e,
593
- ...F
595
+ ...T
594
596
  };
595
- if (Re) {
597
+ if (ze) {
596
598
  (o(a)?.addMaxHeight || o(a)?.maxHeight) && (t.maxHeight = o(a)?.maxHeight ? o(a)?.maxHeight : `${window.innerHeight - o(a)?.extraSysHeight - (a.value?.showPager ? a.value?.pageHeight || 40 : 0)}px`);
597
599
  const l = o(a)?.minHeight;
598
600
  t.minHeight = l || (l !== 0 && o(a)?.toolbarConfig?.custom ? 300 : void 0);
@@ -604,14 +606,14 @@ const Me = K({
604
606
  },
605
607
  autoLoad: !1,
606
608
  ajax: {
607
- query: async () => await w()
609
+ query: async () => await v()
608
610
  }
609
611
  }), t;
610
- }), T = {
611
- setPagination: y,
612
+ }), F = {
613
+ setPagination: w,
612
614
  emit: c,
613
615
  setProps: R,
614
- reload: w,
616
+ reload: v,
615
617
  deleteTableDataRecord: te,
616
618
  insertTableDataRecord: le,
617
619
  updateTableDataRecord: ne,
@@ -621,13 +623,14 @@ const Me = K({
621
623
  getDataSourceRef: z,
622
624
  setColumns: oe,
623
625
  getRawDataSource: D,
624
- tableSearch: H
626
+ tableSearch: H,
627
+ expandTreeLevel: ie
625
628
  };
626
- c("register", T);
627
- const ie = {
629
+ c("register", F);
630
+ const se = {
628
631
  field: "_filterTableData",
629
632
  label: "",
630
- type: h.Search,
633
+ type: C.Search,
631
634
  itemProps: {
632
635
  class: "search-all-form-item"
633
636
  },
@@ -639,7 +642,7 @@ const Me = K({
639
642
  }
640
643
  })
641
644
  }, A = L({
642
- schemas: [r.value?.formOptions?.addSearchAllSchema ? ie : {}],
645
+ schemas: [r.value?.formOptions?.addSearchAllSchema ? se : {}],
643
646
  rowProps: {
644
647
  justify: "start"
645
648
  },
@@ -653,37 +656,37 @@ const Me = K({
653
656
  btnText: "搜索"
654
657
  },
655
658
  actionInline: !0
656
- }, ze(r.value?.formOptions, ["showActionForm", "addSearchAllSchema"]), "replace"), E = (e) => (...t) => {
657
- e && x(e) && e(...t), _(() => {
658
- w();
659
+ }, Pe(r.value?.formOptions, ["showActionForm", "addSearchAllSchema"]), "replace"), E = (e) => (...t) => {
660
+ e && S(e) && e(...t), _(() => {
661
+ v();
659
662
  });
660
- }, [se] = Pe({
663
+ }, [de] = De({
661
664
  ...A,
662
665
  schemas: (o(A)?.schemas || []).map((e) => {
663
666
  if (!o(r)?.formOptions?.autoReloadOnClear)
664
667
  return e;
665
- if (!e.type || e.type === h.Input || e.type === h.Search || e.type === h.Textarea) {
668
+ if (!e.type || e.type === C.Input || e.type === C.Search || e.type === C.Textarea) {
666
669
  const {
667
- componentProps: u
670
+ componentProps: m
668
671
  } = e;
669
- if (x(u))
672
+ if (S(m))
670
673
  return {
671
674
  ...e,
672
- componentProps: async (v) => {
673
- const V = await u(v), ge = V?.onClear;
675
+ componentProps: async (x) => {
676
+ const V = await m(x), fe = V?.onClear;
674
677
  return {
675
678
  ...V,
676
- onClear: E(ge)
679
+ onClear: E(fe)
677
680
  };
678
681
  }
679
682
  };
680
683
  {
681
- const v = u?.onClear;
684
+ const x = m?.onClear;
682
685
  return {
683
686
  ...e,
684
687
  componentProps: {
685
- ...u,
686
- onClear: E(v)
688
+ ...m,
689
+ onClear: E(x)
687
690
  }
688
691
  };
689
692
  }
@@ -692,66 +695,68 @@ const Me = K({
692
695
  })
693
696
  }), N = (e) => {
694
697
  Reflect.has(e, "_filterTableData") && H(e._filterTableData), c("form-submit", e);
695
- }, de = () => {
698
+ }, ge = () => {
696
699
  P(D()), c("form-reset");
697
700
  };
698
- return X({
699
- table: S,
700
- formRef: b,
701
+ return setTimeout(() => {
702
+ console.log(f.value, "xGridxGrid");
703
+ }, 1500), X({
704
+ table: f,
705
+ formRef: y,
701
706
  pageRef: B,
702
- ...T
703
- }), (e, t) => (k(), he("div", {
704
- class: Ce([o(g).b(), {
705
- [o(g).is("form-exceed-one-rows")]: b.value?.willExceedOneRow
707
+ ...F
708
+ }), (e, t) => (k(), Ce("div", {
709
+ class: be([o(g).b(), {
710
+ [o(g).is("form-exceed-one-rows")]: y.value?.willExceedOneRow
706
711
  }])
707
- }, [i(o(xe), null, {
708
- fallback: n(() => [i(o(Oe))]),
709
- default: n(() => [i(o(Te), I({
712
+ }, [i(o(Se), null, {
713
+ fallback: n(() => [i(o(Te))]),
714
+ default: n(() => [i(o(Ae), q({
710
715
  ref_key: "xGrid",
711
- ref: S
716
+ ref: f
712
717
  }, r.value), {
713
- toolbarButtons: n(() => [s(e.$slots, "toolbar-left"), r.value?.formOptions?.showActionForm ? (k(), M(o(Fe), {
718
+ toolbarButtons: n(() => [s(e.$slots, "toolbar-left"), r.value?.formOptions?.showActionForm ? (k(), G(o(Fe), {
714
719
  key: 0,
715
720
  ref_key: "formRef",
716
- ref: b,
717
- onRegister: o(se),
721
+ ref: y,
722
+ onRegister: o(de),
718
723
  onSubmit: N,
719
- onReset: de
720
- }, ve({
724
+ onReset: ge
725
+ }, xe({
721
726
  _: 2
722
727
  }, [e.$slots.resetBefore ? {
723
728
  name: "resetBefore",
724
- fn: n((l) => [s(e.$slots, "resetBefore", m(p(l)))]),
729
+ fn: n((l) => [s(e.$slots, "resetBefore", p(h(l)))]),
725
730
  key: "0"
726
731
  } : void 0, e.$slots.submitBefore ? {
727
732
  name: "submitBefore",
728
- fn: n((l) => [s(e.$slots, "submitBefore", m(p(l)))]),
733
+ fn: n((l) => [s(e.$slots, "submitBefore", p(h(l)))]),
729
734
  key: "1"
730
735
  } : void 0, e.$slots.submitAfter ? {
731
736
  name: "submitAfter",
732
- fn: n((l) => [s(e.$slots, "submitAfter", m(p(l)))]),
737
+ fn: n((l) => [s(e.$slots, "submitAfter", p(h(l)))]),
733
738
  key: "2"
734
- } : void 0]), 1032, ["onRegister"])) : q("", !0), s(e.$slots, "toolbar-right")]),
735
- empty: n(() => [s(e.$slots, "empty", {}, () => [i(o(Se), m(p(r.value.emptyCfg)), null, 16)])]),
736
- loading: n(() => [be(ye("div", null, null, 512), [[we, r.value.loading], [o(Be), r.value.loadingCfg]])]),
739
+ } : void 0]), 1032, ["onRegister"])) : M("", !0), s(e.$slots, "toolbar-right")]),
740
+ empty: n(() => [s(e.$slots, "empty", {}, () => [i(o(Be), p(h(r.value.emptyCfg)), null, 16)])]),
741
+ loading: n(() => [ye(we("div", null, null, 512), [[ve, r.value.loading], [o(Re), r.value.loadingCfg]])]),
737
742
  _: 3
738
- }, 16), r.value.showPager ? (k(), M(o(He), I({
743
+ }, 16), r.value.showPager ? (k(), G(o(Oe), q({
739
744
  key: 0,
740
745
  ref_key: "pageRef",
741
746
  ref: B
742
- }, o(f), {
743
- class: [o(g).e("pager"), o(g).m(`pager-${o(f)?.pagePlacement}`)],
747
+ }, o(u), {
748
+ class: [o(g).e("pager"), o(g).m(`pager-${o(u)?.pagePlacement}`)],
744
749
  onCurrentChange: t[0] || (t[0] = (l) => O({
745
750
  currentPage: l
746
751
  })),
747
752
  onSizeChange: t[1] || (t[1] = (l) => O({
748
753
  pageSize: l
749
754
  }))
750
- }), null, 16, ["class"])) : q("", !0)]),
755
+ }), null, 16, ["class"])) : M("", !0)]),
751
756
  _: 3
752
757
  })], 2));
753
758
  }
754
759
  });
755
760
  export {
756
- po as default
761
+ ho as default
757
762
  };
@@ -47,7 +47,7 @@ export interface TableProps extends VxeGridProps {
47
47
  /** 是否删除空参数,true 表示删除空字符串和 null,'strict' 表示删除空字符串、null 和 undefined */
48
48
  delEmptyParams?: boolean | 'strict';
49
49
  /** 数据获取后的处理函数,可以对响应数据进行转换 */
50
- afterFetch?: (params: any) => Recordable[];
50
+ afterFetch?: (data: Recordable[]) => Recordable[] | Promise<Recordable[]>;
51
51
  /** 是否转换参数,将分页参数转换为标准格式,默认为 true */
52
52
  transformParams?: boolean;
53
53
  /** 额外的请求参数,会合并到请求参数中 */
@@ -109,8 +109,10 @@ export interface TableActionType {
109
109
  updateTableDataRecord: (rowKey: string | number, record: Recordable) => Recordable | void;
110
110
  /** 删除指定的数据记录,支持单个或多个记录 */
111
111
  deleteTableDataRecord: (row: Recordable | Recordable[], rowKey?: string | number | string[] | number[]) => void;
112
- /** 插入新的数据记录,可指定插入位置 */
113
- insertTableDataRecord: (record: Recordable | Recordable[], index?: number) => Recordable[] | void;
112
+ /** 插入新的数据记录,可指定插入位置和父节点 */
113
+ insertTableDataRecord: (record: Recordable | Recordable[], index?: number, parentRowId?: string | number) => Promise<Recordable[] | void>;
114
114
  /** 根据 rowKey 查找指定的数据记录 */
115
115
  findTableDataRecord: (rowKey: string | number) => Recordable | void;
116
+ /** 展开树形表格指定层级 */
117
+ expandTreeLevel: (level?: number) => void;
116
118
  }
@@ -2,16 +2,17 @@ import { type PaginationProps } from 'vft/es/components/pagination';
2
2
  import { type ComputedRef } from 'vue';
3
3
  import { type Recordable } from '../../types';
4
4
  import type { TableProps } from '../types';
5
- export declare function useDataSource(propsRef: ComputedRef<TableProps>, { tableData, setLoading, getPaginationInfo, setPagination }: {
5
+ export declare function useDataSource(propsRef: ComputedRef<TableProps>, { tableData, setLoading, getPaginationInfo, setPagination, getGridRef, }: {
6
6
  tableData: any;
7
- setLoading: any;
7
+ setLoading: (loading: boolean) => void;
8
8
  getPaginationInfo: any;
9
- setPagination: any;
9
+ setPagination: (info: any) => void;
10
+ getGridRef: () => any;
10
11
  }, emit: any): {
11
12
  setTableData: <T = Recordable>(values: T[]) => void;
12
13
  updateTableData: (index: number, key: string, value: any) => Promise<Recordable>;
13
14
  updateTableDataRecord: (rowKey: string | number, record: Recordable) => Recordable | undefined;
14
- insertTableDataRecord: (record: Recordable | Recordable[], index?: number) => Recordable[] | undefined;
15
+ insertTableDataRecord: (record: Recordable | Recordable[], index?: number, parentRowId?: string | number) => Promise<Recordable[] | undefined>;
15
16
  deleteTableDataRecord: (row: Recordable | Recordable[], rowKey?: string | number | string[] | number[]) => void;
16
17
  reload: (opt?: any) => Promise<Recordable[] | undefined>;
17
18
  handleTableChange: (pagination: PaginationProps) => void;
@@ -19,4 +20,5 @@ export declare function useDataSource(propsRef: ComputedRef<TableProps>, { table
19
20
  getDataSource: <T = Recordable>() => T[];
20
21
  getRawDataSource: () => Recordable[];
21
22
  tableSearch: (value: any) => void;
23
+ expandTreeLevel: (level?: number) => void;
22
24
  };