@aplus-frontend/ui 0.5.3 → 0.5.5

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 (193) hide show
  1. package/es/index.mjs +37 -33
  2. package/es/src/ap-action/group/index.vue.mjs +3 -3
  3. package/es/src/ap-action/item/index.vue2.mjs +5 -5
  4. package/es/src/ap-action/item-dropdown/index.vue.mjs +7 -7
  5. package/es/src/ap-action/item-modal/index.vue.mjs +2 -2
  6. package/es/src/ap-action/item-popconfirm/index.vue.mjs +2 -2
  7. package/es/src/ap-button/ap-action-button.vue.mjs +2 -2
  8. package/es/src/ap-button/ap-button.vue.mjs +2 -2
  9. package/es/src/ap-button/ap-confirm-button.vue.mjs +2 -2
  10. package/es/src/ap-descriptions/ap-descriptions.vue.mjs +3 -3
  11. package/es/src/ap-descriptions/help-message/index.vue2.mjs +4 -4
  12. package/es/src/ap-download/ap-download.vue.mjs +1 -1
  13. package/es/src/ap-field/checkbox/index.vue.mjs +1 -1
  14. package/es/src/ap-field/date/index.vue.mjs +4 -4
  15. package/es/src/ap-field/date-range/index.vue.mjs +8 -8
  16. package/es/src/ap-field/index.mjs +30 -30
  17. package/es/src/ap-field/number/index.vue.mjs +8 -8
  18. package/es/src/ap-field/radio/index.vue.mjs +1 -1
  19. package/es/src/ap-field/rate/index.vue.mjs +2 -2
  20. package/es/src/ap-field/segmented/index.vue.mjs +1 -1
  21. package/es/src/ap-field/select/index.vue.mjs +2 -2
  22. package/es/src/ap-field/slider/index.vue.mjs +4 -4
  23. package/es/src/ap-field/switch/index.vue.mjs +3 -3
  24. package/es/src/ap-field/text/index.vue2.mjs +13 -13
  25. package/es/src/ap-field/text/password.vue.mjs +2 -2
  26. package/es/src/ap-field/text-area/index.vue.mjs +3 -3
  27. package/es/src/ap-form/ap-form.vue2.mjs +2 -2
  28. package/es/src/ap-form/drawer-form/index.vue.mjs +9 -9
  29. package/es/src/ap-form/item/index.vue.mjs +7 -7
  30. package/es/src/ap-form/item-group/index.vue.mjs +3 -3
  31. package/es/src/ap-form/items/checkbox/index.vue.mjs +2 -2
  32. package/es/src/ap-form/items/date/index.vue.mjs +2 -2
  33. package/es/src/ap-form/items/date-range/index.vue.mjs +2 -2
  34. package/es/src/ap-form/items/number/index.vue.mjs +2 -2
  35. package/es/src/ap-form/items/radio/index.vue.mjs +2 -2
  36. package/es/src/ap-form/items/select/index.vue.mjs +2 -2
  37. package/es/src/ap-form/items/switch/index.vue.mjs +2 -2
  38. package/es/src/ap-form/items/text/group.vue2.mjs +2 -2
  39. package/es/src/ap-form/items/text/index.vue2.mjs +2 -2
  40. package/es/src/ap-form/items/text/password.vue.mjs +2 -2
  41. package/es/src/ap-form/items/text-area/index.vue.mjs +2 -2
  42. package/es/src/ap-form/modal-form/index.vue.mjs +7 -7
  43. package/es/src/ap-form/render/item.vue.mjs +2 -2
  44. package/es/src/ap-form/search-form/index.vue.mjs +1 -1
  45. package/es/src/ap-form/set/index.vue.mjs +1 -1
  46. package/es/src/ap-grid/editable/form-item.vue.d.ts +16 -0
  47. package/es/src/ap-grid/editable/form-item.vue.mjs +257 -0
  48. package/es/src/ap-grid/editable/form-item.vue2.mjs +4 -0
  49. package/es/src/ap-grid/editable/index.vue.d.ts +18 -0
  50. package/es/src/ap-grid/editable/index.vue.mjs +288 -0
  51. package/es/src/ap-grid/editable/index.vue2.mjs +4 -0
  52. package/es/src/ap-grid/editable/interface.d.ts +95 -0
  53. package/es/src/ap-grid/editable/interface.mjs +1 -0
  54. package/es/src/ap-grid/editable/style/css.d.ts +0 -0
  55. package/es/src/ap-grid/editable/style/css.js +1 -0
  56. package/es/src/ap-grid/editable/style/index.d.ts +0 -0
  57. package/es/src/ap-grid/editable/style/index.js +1 -0
  58. package/es/src/ap-grid/hooks/use-editable-columns.d.ts +6 -0
  59. package/es/src/ap-grid/hooks/use-editable-columns.mjs +68 -0
  60. package/es/src/ap-grid/hooks/use-inner-params.mjs +3 -3
  61. package/es/src/ap-grid/index.d.ts +4 -1
  62. package/es/src/ap-grid/index.mjs +3 -0
  63. package/es/src/ap-grid/index.vue.mjs +113 -103
  64. package/es/src/ap-grid/interface.d.ts +15 -0
  65. package/es/src/ap-grid/utils/col.mjs +39 -39
  66. package/es/src/ap-grid/utils/editable.d.ts +3 -0
  67. package/es/src/ap-grid/utils/editable.mjs +27 -0
  68. package/es/src/ap-grid/utils/table.mjs +24 -17
  69. package/es/src/ap-info-layout/ApInfoLayout.vue.mjs +2 -2
  70. package/es/src/ap-info-layout/ap-info-layout-admin/ApInfoLayoutAdmin.vue2.mjs +2 -2
  71. package/es/src/ap-info-layout/ap-info-layout-aplus/ap-info-layout.vue2.mjs +1 -1
  72. package/es/src/ap-list/index.vue.mjs +4 -4
  73. package/es/src/ap-table/ap-table.vue2.mjs +172 -159
  74. package/es/src/ap-table/components/dynamic-component/index.vue2.mjs +2 -2
  75. package/es/src/ap-table/components/index/index.vue2.mjs +2 -2
  76. package/es/src/ap-table/components/paragraph-ellipsis/index.vue2.mjs +3 -3
  77. package/es/src/ap-table/components/setting/modal/index.vue2.mjs +3 -3
  78. package/es/src/ap-table/components/setting/select-group/index.vue2.mjs +1 -1
  79. package/es/src/ap-table/components/setting/sortable/index.vue2.mjs +1 -1
  80. package/es/src/ap-table/components/setting/sortable/item.vue2.mjs +1 -1
  81. package/es/src/ap-table/components/setting/sorter/index.vue2.mjs +11 -11
  82. package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +1 -1
  83. package/es/src/ap-table/components/status/index.vue2.mjs +2 -2
  84. package/es/src/ap-table/constants.mjs +40 -40
  85. package/es/src/ap-table/context.d.ts +4 -4
  86. package/es/src/ap-table/hooks/use-sorted-filtered.d.ts +4 -1
  87. package/es/src/ap-table/hooks/use-sorted-filtered.mjs +11 -9
  88. package/es/src/ap-table/hooks/use-table-column-state.mjs +3 -3
  89. package/es/src/ap-table/hooks/use-table-paging-ng.d.ts +3 -1
  90. package/es/src/ap-table/hooks/use-table-paging-ng.mjs +53 -49
  91. package/es/src/ap-table/hooks/use-table-paging.d.ts +1 -1
  92. package/es/src/ap-tag/ap-tag-group.vue.mjs +8 -8
  93. package/es/src/ap-tag/ap-tag.vue.mjs +2 -2
  94. package/es/src/ap-upload/apUpload.vue.mjs +5 -5
  95. package/es/src/ap-upload/components/MultipleFile.vue2.mjs +3 -3
  96. package/es/src/ap-upload/components/Picture.vue2.mjs +6 -6
  97. package/es/src/ap-upload/components/SingleFile.vue2.mjs +7 -7
  98. package/es/src/business/ap-appendix/ap-appendix.vue2.mjs +1 -1
  99. package/es/src/business/ap-appendix/icons/file-icon.vue.mjs +2 -2
  100. package/es/src/business/ap-batch-action/ApBatchAction.vue2.mjs +2 -2
  101. package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue.d.ts +2 -2
  102. package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.mjs +10 -10
  103. package/es/src/business/ap-batch-action-group/MenuItemGroup.vue2.mjs +1 -1
  104. package/es/src/business/ap-batch-action-group/index.d.ts +4 -4
  105. package/es/src/business/ap-button-group/ApButtonGroup.vue2.mjs +1 -1
  106. package/es/src/business/ap-card/ApCard.vue2.mjs +7 -7
  107. package/es/src/business/ap-expand-alert/ApExpandAlert.vue2.mjs +11 -11
  108. package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +9 -9
  109. package/es/src/business/ap-group-search/ap-group-search.vue2.mjs +5 -5
  110. package/es/src/business/ap-group-search/extension-select/index.vue2.mjs +4 -4
  111. package/es/src/business/ap-group-search/images/icon-down.vue.mjs +2 -2
  112. package/es/src/business/ap-group-search/images/icon-line-select.vue.mjs +2 -2
  113. package/es/src/business/ap-group-search/popover-select/index.vue2.mjs +2 -2
  114. package/es/src/business/ap-image/ApImage.vue2.mjs +1 -1
  115. package/es/src/business/ap-input-radio/ApInputRadio.vue2.mjs +2 -2
  116. package/es/src/business/ap-ladder/ApLadder.vue2.mjs +1 -1
  117. package/es/src/business/ap-ladder/HelpMessageIcon.vue2.mjs +1 -1
  118. package/es/src/business/ap-select-layout/select-layout.vue2.mjs +4 -4
  119. package/es/src/business/ap-status/ApStatus.vue2.mjs +8 -8
  120. package/es/src/business/ap-status/group/ApStatusGroup.vue2.mjs +4 -4
  121. package/es/src/business/ap-summary/ap-summary.vue2.mjs +1 -1
  122. package/es/src/business/ap-table-modal/modal-title.vue2.mjs +2 -2
  123. package/es/src/business/ap-table-modal/table-layout/index.vue2.mjs +14 -14
  124. package/es/src/business/ap-table-modal/table-modal.vue2.mjs +3 -3
  125. package/es/src/business/ap-title/ApTitle.vue2.mjs +7 -7
  126. package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.mjs +1 -1
  127. package/es/src/business/ap-upload-file/icon/delete-icon.vue.mjs +2 -2
  128. package/es/src/business/ap-upload-file/icon/file-icon.vue.mjs +2 -2
  129. package/es/src/business/batch-input-group/form-item.vue.mjs +2 -2
  130. package/es/src/business/batch-input-group/index.vue.mjs +7 -6
  131. package/es/src/business/batch-input-group/popover-input/index.vue2.mjs +2 -2
  132. package/es/src/check-card/index.vue2.mjs +3 -3
  133. package/es/src/config-provider/config-provider-props.mjs +1 -1
  134. package/es/src/editable-table/form-item.vue.mjs +2 -2
  135. package/es/src/editable-table/index.vue.mjs +2 -2
  136. package/es/src/editable-table/utils.d.ts +3 -2
  137. package/es/src/full-screen/index.vue.mjs +3 -3
  138. package/es/src/hooks/useFullScreen.mjs +5 -5
  139. package/es/src/index.mjs +24 -20
  140. package/es/src/path-map.mjs +3 -1
  141. package/es/src/portal/index.vue.mjs +2 -2
  142. package/es/src/scroll-bar/index.vue.mjs +3 -3
  143. package/es/src/scroll-bar/internal.vue.mjs +2 -2
  144. package/es/src/scroll-view/index.vue.mjs +9 -9
  145. package/es/src/work-order-modal/help-message.vue2.mjs +2 -2
  146. package/es/src/work-order-modal/work-order-modal.vue.mjs +2 -2
  147. package/lib/index.js +1 -1
  148. package/lib/src/ap-action/item-dropdown/index.vue.js +1 -1
  149. package/lib/src/ap-field/index.js +1 -1
  150. package/lib/src/ap-field/text/index.vue2.js +1 -1
  151. package/lib/src/ap-grid/editable/form-item.vue.d.ts +16 -0
  152. package/lib/src/ap-grid/editable/form-item.vue.js +1 -0
  153. package/lib/src/ap-grid/editable/form-item.vue2.js +1 -0
  154. package/lib/src/ap-grid/editable/index.vue.d.ts +18 -0
  155. package/lib/src/ap-grid/editable/index.vue.js +1 -0
  156. package/lib/src/ap-grid/editable/index.vue2.js +1 -0
  157. package/lib/src/ap-grid/editable/interface.d.ts +95 -0
  158. package/lib/src/ap-grid/editable/interface.js +1 -0
  159. package/lib/src/ap-grid/editable/style/css.cjs +1 -0
  160. package/lib/src/ap-grid/editable/style/css.d.ts +0 -0
  161. package/lib/src/ap-grid/editable/style/index.cjs +1 -0
  162. package/lib/src/ap-grid/editable/style/index.d.ts +0 -0
  163. package/lib/src/ap-grid/hooks/use-editable-columns.d.ts +6 -0
  164. package/lib/src/ap-grid/hooks/use-editable-columns.js +1 -0
  165. package/lib/src/ap-grid/index.d.ts +4 -1
  166. package/lib/src/ap-grid/index.js +1 -1
  167. package/lib/src/ap-grid/index.vue.js +1 -1
  168. package/lib/src/ap-grid/interface.d.ts +15 -0
  169. package/lib/src/ap-grid/utils/col.js +1 -1
  170. package/lib/src/ap-grid/utils/editable.d.ts +3 -0
  171. package/lib/src/ap-grid/utils/editable.js +1 -0
  172. package/lib/src/ap-grid/utils/table.js +1 -1
  173. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  174. package/lib/src/ap-table/constants.js +1 -1
  175. package/lib/src/ap-table/context.d.ts +4 -4
  176. package/lib/src/ap-table/hooks/use-sorted-filtered.d.ts +4 -1
  177. package/lib/src/ap-table/hooks/use-sorted-filtered.js +1 -1
  178. package/lib/src/ap-table/hooks/use-table-paging-ng.d.ts +3 -1
  179. package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
  180. package/lib/src/ap-table/hooks/use-table-paging.d.ts +1 -1
  181. package/lib/src/ap-upload/apUpload.vue.js +1 -1
  182. package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue.d.ts +2 -2
  183. package/lib/src/business/ap-batch-action-group/index.d.ts +4 -4
  184. package/lib/src/business/batch-input-group/index.vue.js +2 -2
  185. package/lib/src/config-provider/config-provider-props.js +1 -1
  186. package/lib/src/editable-table/utils.d.ts +3 -2
  187. package/lib/src/index.js +1 -1
  188. package/lib/src/path-map.js +1 -1
  189. package/package.json +1 -1
  190. package/theme/ap-grid/editable.css +22 -0
  191. package/theme/ap-grid/editable.less +28 -0
  192. package/theme/index.css +22 -0
  193. package/theme/index.less +1 -0
@@ -0,0 +1,68 @@
1
+ import { useSlots as E, computed as R, unref as m } from "vue";
2
+ import { isFunction as T, isArray as s } from "lodash-unified";
3
+ import { getEditableTableTitle as k, mergeClass as A } from "../../editable-table/utils.mjs";
4
+ import { updateFormProps as q, getFieldProps as v } from "../../ap-table/utils.mjs";
5
+ import "../../config-provider/index.mjs";
6
+ import { useToken as w } from "@aplus-frontend/antdv/es/theme/internal";
7
+ import { getFinalEditableNode as G } from "../utils/editable.mjs";
8
+ import { useNamespace as S } from "../../config-provider/hooks/use-namespace.mjs";
9
+ const M = (n, f) => {
10
+ const {
11
+ em: b,
12
+ be: x
13
+ } = S("editable-grid"), g = E(), [, h] = w();
14
+ return R(() => {
15
+ const l = n.columns;
16
+ if (!l)
17
+ return [];
18
+ function o(C) {
19
+ return C.map((e) => ({
20
+ ...e,
21
+ children: o(e.children || []),
22
+ title: k(e, x("table-header", "title"), b("header-cell", "required"), g.headerCell, m(h).colorPrimary),
23
+ // tips: 已经处理了title,传递tooltip为undefined不会再内部处理
24
+ tooltip: void 0,
25
+ customRender({
26
+ value: r,
27
+ originalNode: F,
28
+ ...a
29
+ }) {
30
+ const i = T(e.editable) ? e.editable(a.text, a.record, a.index) : !!e.editable;
31
+ let d = F;
32
+ if (i) {
33
+ const t = q(e, v(e.fieldProps, {
34
+ value: r,
35
+ ...a
36
+ })), c = {};
37
+ n.onFieldChange && (c[`onUpdate:${t.valuePropName || "value"}`] = (y) => {
38
+ var u;
39
+ return (u = n.onFieldChange) == null ? void 0 : u.call(n, a.index, e.dataIndex, y);
40
+ });
41
+ const N = s(e.dataIndex) ? e.dataIndex : [e.dataIndex], I = {
42
+ name: [...s(n.name) ? n.name : [n.name], a.index, ...N],
43
+ ...t || {},
44
+ field: {
45
+ style: "width: 100%",
46
+ ...(t == null ? void 0 : t.field) || {},
47
+ ...c,
48
+ class: A("is-editable", t.class)
49
+ }
50
+ };
51
+ d = G(e, I, a.record, m(f));
52
+ }
53
+ return e.customRender ? e.customRender({
54
+ value: r,
55
+ ...a,
56
+ editable: i,
57
+ originalNode: d
58
+ }) : d;
59
+ }
60
+ }));
61
+ }
62
+ return o(l);
63
+ });
64
+ };
65
+ export {
66
+ M as default,
67
+ M as useGetEditableColumns
68
+ };
@@ -1,4 +1,4 @@
1
- import { DEFAULT_CURRENT as g, DEFAULT_PAGE_SIZE as E } from "../../ap-table/hooks/use-table-paging-ng.mjs";
1
+ import { DEFAULT_PAGE_SIZE as g, DEFAULT_CURRENT as E } from "../../ap-table/hooks/use-table-paging-ng.mjs";
2
2
  const a = {
3
3
  asc: "ascend",
4
4
  desc: "descend"
@@ -6,8 +6,8 @@ const a = {
6
6
  const t = {};
7
7
  let c = {};
8
8
  const s = {
9
- current: g,
10
- pageSize: E
9
+ current: E,
10
+ pageSize: g
11
11
  };
12
12
  function i(n) {
13
13
  o == null || o(s, c, t, {
@@ -1,3 +1,6 @@
1
1
  import { default as ApGrid } from './index.vue';
2
- export { ApGrid };
2
+ import { default as EditableGrid } from './editable/index.vue';
3
+ import { default as EditableGridFormItem } from './editable/form-item.vue';
4
+ export { ApGrid, EditableGrid, EditableGridFormItem };
3
5
  export * from './interface';
6
+ export * from './editable/interface';
@@ -1,2 +1,5 @@
1
1
  import "./index.vue2.mjs";
2
+ import "./editable/index.vue2.mjs";
3
+ import "./editable/form-item.vue2.mjs";
2
4
  import "./interface.mjs";
5
+ import "./editable/interface.mjs";
@@ -1,25 +1,25 @@
1
- import { defineComponent as Ce, useSlots as be, ref as x, computed as n, unref as o, watch as E, openBlock as s, createElementBlock as R, normalizeClass as f, normalizeStyle as M, createVNode as _, mergeProps as g, createSlots as q, withCtx as h, Fragment as G, renderList as N, createBlock as u, resolveDynamicComponent as z, renderSlot as A, createCommentVNode as y, createElementVNode as k, normalizeProps as we, guardReactiveProps as Se } from "vue";
2
- import { VxeTable as xe, VxeColumn as U } from "vxe-table";
3
- import { isUndefined as F, omit as Re } from "lodash-unified";
4
- import { ApForm as ke } from "../ap-form/index.mjs";
1
+ import { defineComponent as Ce, useSlots as be, ref as x, computed as n, unref as o, watch as E, createElementBlock as R, openBlock as s, normalizeStyle as N, normalizeClass as f, createCommentVNode as w, createElementVNode as k, createVNode as q, mergeProps as g, createSlots as _, withCtx as v, Fragment as G, renderList as z, createBlock as u, resolveDynamicComponent as T, renderSlot as A, normalizeProps as Se, guardReactiveProps as xe } from "vue";
2
+ import { VxeTable as Re, VxeColumn as U } from "vxe-table";
3
+ import { isUndefined as F, omit as ke } from "lodash-unified";
4
+ import { ApForm as Fe } from "../ap-form/index.mjs";
5
5
  import "../config-provider/index.mjs";
6
- import { noRenderAsFormItemValueList as Fe } from "../ap-table/constants.mjs";
7
- import { getColumnOrder as J, updateFormProps as Be, getFieldProps as Pe, getSearchFormItemRenderNode as Ie, recursionApColumns as Q } from "../ap-table/utils.mjs";
8
- import { useTablePaging as Ee } from "../ap-table/hooks/use-table-paging-ng.mjs";
9
- import { Empty as X, Pagination as Ne } from "@aplus-frontend/antdv";
10
- import { useInnerParams as ze } from "./hooks/use-inner-params.mjs";
11
- import { toVxeProps as Ae, getRowExpandProps as Te, getRowSelectionProps as Ve } from "./utils/table.mjs";
12
- import Oe from "../ap-table/hooks/use-table-row-selection.mjs";
13
- import { useProvideApTable as Ke } from "../ap-table/context.mjs";
14
- import { sizeMap as De, sizeReverseMap as Le } from "./constants.mjs";
15
- import { useRenderColumns as $e } from "./hooks/use-render-columns.mjs";
16
- import { useToken as je } from "@aplus-frontend/antdv/es/theme/internal";
6
+ import { noRenderAsFormItemValueList as Be } from "../ap-table/constants.mjs";
7
+ import { getColumnOrder as J, updateFormProps as Pe, getFieldProps as Ie, getSearchFormItemRenderNode as Ee, recursionApColumns as Q } from "../ap-table/utils.mjs";
8
+ import { useTablePaging as Ne } from "../ap-table/hooks/use-table-paging-ng.mjs";
9
+ import { Empty as X, Pagination as ze } from "@aplus-frontend/antdv";
10
+ import { useInnerParams as Te } from "./hooks/use-inner-params.mjs";
11
+ import { toVxeProps as Ae, getRowExpandProps as Ve, getRowSelectionProps as Oe } from "./utils/table.mjs";
12
+ import Ke from "../ap-table/hooks/use-table-row-selection.mjs";
13
+ import { useProvideApTable as De } from "../ap-table/context.mjs";
14
+ import { sizeReverseMap as Le, sizeMap as $e } from "./constants.mjs";
15
+ import { useRenderColumns as je } from "./hooks/use-render-columns.mjs";
16
+ import { useToken as He } from "@aplus-frontend/antdv/es/theme/internal";
17
17
  import "../scroll-bar/index.mjs";
18
- import { useLoadVxe as He } from "./hooks/use-load-vxe.mjs";
19
- import { useNamespace as We } from "../config-provider/hooks/use-namespace.mjs";
20
- import { useGlobalConfig as Me } from "../config-provider/hooks/use-global-config.mjs";
18
+ import { useLoadVxe as We } from "./hooks/use-load-vxe.mjs";
19
+ import { useNamespace as Me } from "../config-provider/hooks/use-namespace.mjs";
20
+ import { useGlobalConfig as qe } from "../config-provider/hooks/use-global-config.mjs";
21
21
  import _e from "../scroll-bar/index.vue.mjs";
22
- const go = /* @__PURE__ */ Ce({
22
+ const vo = /* @__PURE__ */ Ce({
23
23
  name: "ApGrid",
24
24
  __name: "index",
25
25
  props: {
@@ -92,6 +92,7 @@ const go = /* @__PURE__ */ Ce({
92
92
  pagination: { type: [Boolean, Object], default: void 0 },
93
93
  searchFormWrapperStyle: {},
94
94
  tableWrapperStyle: {},
95
+ wrapperStyle: {},
95
96
  manual: { type: Boolean, default: !1 },
96
97
  size: { default: void 0 },
97
98
  adaptive: { type: Boolean, default: !1 },
@@ -99,65 +100,66 @@ const go = /* @__PURE__ */ Ce({
99
100
  rowKey: { default: "key" },
100
101
  footer: {},
101
102
  virtual: { type: [Boolean, Object], default: void 0 },
102
- expandable: {}
103
+ expandable: {},
104
+ value: {}
103
105
  },
104
106
  setup(Y, { expose: Z }) {
105
- const T = be(), a = Y, { e: B, b: i, be: ee } = We("ap-grid"), oe = Me("valueTypeMap");
106
- He();
107
- const d = x([]), V = x([]), p = x(), C = x(a.size), [, m] = je(), { renderConfig: ae, updateSignal: re } = $e(d);
108
- let O = 0;
107
+ const V = be(), a = Y, { e: B, b: i, be: ee } = Me("ap-grid"), oe = qe("valueTypeMap");
108
+ We();
109
+ const d = x([]), O = x([]), p = x(), C = x(a.size), [, m] = He(), { renderConfig: ae, updateSignal: re } = je(d);
110
+ let K = 0;
109
111
  const te = n(() => {
110
112
  if (p.value)
111
113
  return p.value.$el.querySelector(
112
114
  ".vxe-table--header-inner-wrapper"
113
115
  );
114
- }), K = n(() => {
116
+ }), D = n(() => {
115
117
  var e, l, t;
116
- return O++, ((t = (l = (e = a.columns) == null ? void 0 : e.filter(
117
- (r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !Fe.includes(r.valueType)
118
+ return K++, ((t = (l = (e = a.columns) == null ? void 0 : e.filter(
119
+ (r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !Be.includes(r.valueType)
118
120
  )) == null ? void 0 : l.sort((r, c) => {
119
- let v = J(r.order);
120
- return J(c.order) - v;
121
+ let y = J(r.order);
122
+ return J(c.order) - y;
121
123
  })) == null ? void 0 : t.map((r) => {
122
- const c = Be(
124
+ const c = Pe(
123
125
  r,
124
- Pe(r.fieldProps, {})
125
- ), v = {
126
+ Ie(r.fieldProps, {})
127
+ ), y = {
126
128
  ...r,
127
129
  fieldProps: {
128
130
  label: r.title,
129
131
  name: r.dataIndex,
130
132
  ...c || {},
131
- _signal: O
133
+ _signal: K
132
134
  },
133
135
  renderNode: void 0
134
136
  };
135
- return v.renderNode = Ie(
136
- v,
137
+ return y.renderNode = Ee(
138
+ y,
137
139
  o(oe)
138
- ), v;
140
+ ), y;
139
141
  })) || [];
140
142
  }), le = n(() => [
141
143
  i(),
142
144
  a.card ? null : i("wrapper"),
143
145
  a.adaptive ? i("adaptive") : null,
144
146
  a.sticky ? i("sticky") : null
145
- ].filter(Boolean)), D = n(() => Q(o(d), (e) => {
147
+ ].filter(Boolean)), L = n(() => Q(o(d), (e) => {
146
148
  if (e.sorter === !0)
147
149
  return e.key || e.dataIndex;
148
- }).filter(Boolean)), L = n(() => Q(o(d), (e) => {
150
+ }).filter(Boolean)), $ = n(() => Q(o(d), (e) => {
149
151
  if (e.filters && !e.onFilter)
150
152
  return e.key || e.dataIndex;
151
153
  }).filter(Boolean)), {
152
154
  formRef: P,
153
- submit: $,
154
- reset: j,
155
+ submit: j,
156
+ reset: H,
155
157
  refresh: ne,
156
- data: b,
158
+ data: h,
157
159
  tableProps: se,
158
160
  setDataSource: de,
159
161
  handleTableChange: ie
160
- } = Ee({
162
+ } = Ne({
161
163
  async request(e) {
162
164
  var t;
163
165
  if (!S.value.preserveSelectedRowKeys && F(a.dataSource) && I(), !F(a.dataSource)) {
@@ -174,18 +176,18 @@ const go = /* @__PURE__ */ Ce({
174
176
  };
175
177
  },
176
178
  namespace: "ap-grid",
177
- filterFields: L,
178
- sortFields: D,
179
+ filterFields: $,
180
+ sortFields: L,
179
181
  defaultParams: a.params,
180
182
  defaultData: a.defaultData,
181
183
  manual: a.manual,
182
184
  formatParams: a.beforeSearchSubmit,
183
185
  pagination: a.pagination
184
- }), { sortChangeEvent: ce, filterChangeEvent: ue, paginationChangeEvent: pe } = ze(ie);
185
- Ke({
186
+ }), { sortChangeEvent: ce, filterChangeEvent: ue, paginationChangeEvent: pe } = Te(ie);
187
+ De({
186
188
  columns: n(() => d.value),
187
- columnsBackup: n(() => V.value),
188
- size: n(() => C.value ? De[C.value] : "middle"),
189
+ columnsBackup: n(() => O.value),
190
+ size: n(() => C.value ? $e[C.value] : "middle"),
189
191
  updateColumns(e) {
190
192
  d.value = e;
191
193
  },
@@ -197,31 +199,31 @@ const go = /* @__PURE__ */ Ce({
197
199
  color: m.value.colorPrimary
198
200
  }))
199
201
  });
200
- const H = n(
202
+ const W = n(
201
203
  () => d.value.some(
202
204
  (e) => e.fixed === "left" || e.fixed === !0
203
205
  ) ? "left" : void 0
204
206
  ), me = n(
205
- () => F(a.dataSource) ? b.records : a.dataSource
206
- ), { selectedRows: w, rowSelection: S, ...fe } = Oe({
207
+ () => F(a.dataSource) ? h.records : a.dataSource
208
+ ), { selectedRows: b, rowSelection: S, ...fe } = Ke({
207
209
  ...a.rowSelection === !0 ? {} : a.rowSelection,
208
210
  dataSource: me,
209
211
  rowKey: a.rowKey
210
- }), W = () => {
212
+ }), M = () => {
211
213
  const e = p.value;
212
- e && (w.value = [
214
+ e && (b.value = [
213
215
  ...e.getCheckboxReserveRecords(),
214
216
  ...e.getCheckboxRecords()
215
217
  ]);
216
218
  }, ge = () => {
217
219
  const e = p.value;
218
- e && (w.value = [e.getRadioRecord()]);
220
+ e && (b.value = [e.getRadioRecord()]);
219
221
  };
220
- function he() {
222
+ function ve() {
221
223
  var e;
222
224
  return ((e = a.columns) == null ? void 0 : e.filter((l) => !l.hideInTable)) || [];
223
225
  }
224
- function ve(e) {
226
+ function he(e) {
225
227
  var l, t, r;
226
228
  (r = (t = (l = P.value) == null ? void 0 : l.apForm) == null ? void 0 : t.setFieldsValue) == null || r.call(t, e);
227
229
  }
@@ -235,11 +237,17 @@ const go = /* @__PURE__ */ Ce({
235
237
  const e = p.value;
236
238
  e && (S.value.type === "radio" ? (e.clearRadioRow(), e.clearRadioReserve()) : (e.clearCheckboxRow(), e.clearCheckboxReserve()));
237
239
  }
240
+ async function we(e, l) {
241
+ var r;
242
+ const t = h.records[e];
243
+ if (t)
244
+ return (r = p.value) == null ? void 0 : r.scrollToRow(t, l);
245
+ }
238
246
  return E(
239
247
  () => [a.columnResizable, a.columns],
240
248
  () => {
241
- const e = he();
242
- d.value = e, V.value = e;
249
+ const e = ve();
250
+ d.value = e, O.value = e;
243
251
  },
244
252
  {
245
253
  deep: !0,
@@ -252,40 +260,42 @@ const go = /* @__PURE__ */ Ce({
252
260
  },
253
261
  { immediate: !0 }
254
262
  ), E(
255
- () => o(b).loading,
263
+ () => o(h).loading,
256
264
  (e) => {
257
265
  var l;
258
266
  (l = a.onLoadingChange) == null || l.call(a, e);
259
267
  }
260
268
  ), Z({
261
- submit: $,
262
- reset: j,
269
+ submit: j,
270
+ reset: H,
263
271
  refresh: ne,
264
- setSearchFormValues: ve,
272
+ setSearchFormValues: he,
265
273
  getSearchFormValues: ye,
266
274
  getShowColumns: () => o(d),
267
275
  rowSelection: {
268
- selectedRows: n(() => w.value),
276
+ selectedRows: n(() => b.value),
269
277
  clearAll: I
270
- }
278
+ },
279
+ scrollToRow: we
271
280
  }), (e, l) => (s(), R("div", {
272
- class: f(le.value)
281
+ class: f(le.value),
282
+ style: N(e.wrapperStyle)
273
283
  }, [
274
- o(F)(e.dataSource) && e.searchForm !== !1 && K.value.length > 0 ? (s(), R("div", {
284
+ o(F)(e.dataSource) && e.searchForm !== !1 && D.value.length > 0 ? (s(), R("div", {
275
285
  key: 0,
276
286
  class: f(e.card ? o(B)("search-wrapper") : null),
277
- style: M(e.searchFormWrapperStyle)
287
+ style: N(e.searchFormWrapperStyle)
278
288
  }, [
279
- _(o(ke).SearchForm, g(e.searchForm || {}, {
289
+ q(o(Fe).SearchForm, g(e.searchForm || {}, {
280
290
  ref_key: "formRef",
281
291
  ref: P,
282
292
  "custom-reset": "",
283
293
  "submit-loading": !1,
284
- onSubmit: o($),
285
- onReset: o(j)
286
- }), q({
287
- default: h(() => [
288
- (s(!0), R(G, null, N(K.value, (t) => (s(), u(z(t.renderNode.Comp), g({
294
+ onSubmit: o(j),
295
+ onReset: o(H)
296
+ }), _({
297
+ default: v(() => [
298
+ (s(!0), R(G, null, z(D.value, (t) => (s(), u(T(t.renderNode.Comp), g({
289
299
  key: t.dataIndex,
290
300
  item: t,
291
301
  ref_for: !0
@@ -296,24 +306,24 @@ const go = /* @__PURE__ */ Ce({
296
306
  ]),
297
307
  _: 2
298
308
  }, [
299
- T.searchFormExtra ? {
309
+ V.searchFormExtra ? {
300
310
  name: "extra",
301
- fn: h(() => [
311
+ fn: v(() => [
302
312
  A(e.$slots, "searchFormExtra")
303
313
  ]),
304
314
  key: "0"
305
315
  } : void 0
306
316
  ]), 1040, ["onSubmit", "onReset"])
307
- ], 6)) : y("", !0),
317
+ ], 6)) : w("", !0),
308
318
  k("div", {
309
319
  class: f([o(B)("table-wrapper"), e.card ? o(B)("table-wrapper-card") : null]),
310
- style: M(e.tableWrapperStyle)
320
+ style: N(e.tableWrapperStyle)
311
321
  }, [
312
322
  k("div", {
313
323
  class: f(o(i)("header-wrapper"))
314
324
  }, [
315
325
  A(e.$slots, "title", {
316
- selectedRows: o(w),
326
+ selectedRows: o(b),
317
327
  selectedRowKeys: o(S).selectedRowKeys,
318
328
  shownColumns: d.value,
319
329
  clearAll: I
@@ -322,14 +332,14 @@ const go = /* @__PURE__ */ Ce({
322
332
  k("div", {
323
333
  class: f(o(i)("vxe-wrapper"))
324
334
  }, [
325
- (s(), u(o(xe), g(o(Ae)(a), {
335
+ (s(), u(o(Re), g(o(Ae)(a), {
326
336
  ref_key: "tableRef",
327
337
  ref: p,
328
338
  key: o(re),
329
- data: o(b).records,
330
- "sort-config": { remote: D.value.length > 0 },
331
- "filter-config": { remote: L.value.length > 0 },
332
- loading: o(b).loading,
339
+ data: o(h).records,
340
+ "sort-config": { remote: L.value.length > 0 },
341
+ "filter-config": { remote: $.value.length > 0 },
342
+ loading: o(h).loading,
333
343
  "row-config": {
334
344
  isHover: !0,
335
345
  keyField: a.rowKey
@@ -347,33 +357,33 @@ const go = /* @__PURE__ */ Ce({
347
357
  size: C.value,
348
358
  onSortChange: o(ce),
349
359
  onFilterChange: o(ue),
350
- onCheckboxChange: W,
351
- onCheckboxAll: W,
360
+ onCheckboxChange: M,
361
+ onCheckboxAll: M,
352
362
  onRadioChange: ge
353
- }), q({
354
- empty: h(() => [
355
- _(o(X), {
363
+ }), _({
364
+ empty: v(() => [
365
+ q(o(X), {
356
366
  image: o(X).PRESENTED_IMAGE_SIMPLE
357
367
  }, null, 8, ["image"])
358
368
  ]),
359
- default: h(() => [
360
- a.expandable ? (s(), u(o(U), g({ key: 0 }, o(Te)(e.expandable), { fixed: H.value }), {
361
- content: h((t) => [
362
- (s(), u(z(a.expandable.renderContent(t))))
369
+ default: v(() => [
370
+ a.expandable ? (s(), u(o(U), g({ key: 0 }, o(Ve)(e.expandable), { fixed: W.value }), {
371
+ content: v((t) => [
372
+ (s(), u(T(a.expandable.renderContent(t))))
363
373
  ]),
364
374
  _: 1
365
- }, 16, ["fixed"])) : y("", !0),
366
- a.rowSelection ? (s(), u(o(U), g({ key: 1 }, o(Ve)(o(S)), { fixed: H.value }), null, 16, ["fixed"])) : y("", !0),
367
- (s(!0), R(G, null, N(o(ae), (t) => (s(), u(z(t), {
375
+ }, 16, ["fixed"])) : w("", !0),
376
+ a.rowSelection ? (s(), u(o(U), g({ key: 1 }, o(Oe)(o(S)), { fixed: W.value }), null, 16, ["fixed"])) : w("", !0),
377
+ (s(!0), R(G, null, z(o(ae), (t) => (s(), u(T(t), {
368
378
  key: t.props.colId
369
379
  }))), 128))
370
380
  ]),
371
381
  _: 2
372
382
  }, [
373
- N(o(Re)(T, ["searchFormExtra"]), (t, r) => ({
383
+ z(o(ke)(V, ["searchFormExtra"]), (t, r) => ({
374
384
  name: r,
375
- fn: h((c) => [
376
- A(e.$slots, r, we(Se(c || {})))
385
+ fn: v((c) => [
386
+ A(e.$slots, r, Se(xe(c || {})))
377
387
  ])
378
388
  }))
379
389
  ]), 1040, ["data", "sort-config", "filter-config", "loading", "row-config", "style", "size", "onSortChange", "onFilterChange"]))
@@ -385,16 +395,16 @@ const go = /* @__PURE__ */ Ce({
385
395
  key: 0,
386
396
  direction: "horizontal",
387
397
  "scroll-container": te.value
388
- }, null, 8, ["scroll-container"])) : y("", !0),
389
- e.pagination !== !1 ? (s(), u(o(Ne), g({
398
+ }, null, 8, ["scroll-container"])) : w("", !0),
399
+ e.pagination !== !1 ? (s(), u(o(ze), g({
390
400
  key: 1,
391
401
  class: o(i)("pagination")
392
- }, o(se).pagination, { onChange: o(pe) }), null, 16, ["class", "onChange"])) : y("", !0)
402
+ }, o(se).pagination, { onChange: o(pe) }), null, 16, ["class", "onChange"])) : w("", !0)
393
403
  ], 2)
394
404
  ], 6)
395
- ], 2));
405
+ ], 6));
396
406
  }
397
407
  });
398
408
  export {
399
- go as default
409
+ vo as default
400
410
  };
@@ -170,6 +170,10 @@ export type ApGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
170
170
  * 自定义表格样式
171
171
  */
172
172
  tableWrapperStyle?: CSSProperties;
173
+ /**
174
+ * 表格最外层容器自定义样式
175
+ */
176
+ wrapperStyle?: CSSProperties;
173
177
  /**
174
178
  * 是否手动发起第一次网络请求
175
179
  */
@@ -212,6 +216,10 @@ export type ApGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
212
216
  */
213
217
  title?: string;
214
218
  };
219
+ /**
220
+ * 作为表单项时内部传递,请勿使用
221
+ */
222
+ value?: any;
215
223
  };
216
224
  export type ApGridVirtualConfig = {
217
225
  x?: false | number;
@@ -260,4 +268,11 @@ export type ApGridExpose<SearchParamsType = Recordable, RecordType = any> = {
260
268
  selectedRows: ComputedRef<RecordType[]>;
261
269
  clearAll: () => void;
262
270
  };
271
+ /**
272
+ * 滚动到某一行
273
+ * @param index 行索引
274
+ * @param fieldOrColumn
275
+ * @returns
276
+ */
277
+ scrollToRow: (index: number, fieldOrColumn?: any) => Promise<any>;
263
278
  };