@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.
- package/es/index.mjs +37 -33
- package/es/src/ap-action/group/index.vue.mjs +3 -3
- package/es/src/ap-action/item/index.vue2.mjs +5 -5
- package/es/src/ap-action/item-dropdown/index.vue.mjs +7 -7
- package/es/src/ap-action/item-modal/index.vue.mjs +2 -2
- package/es/src/ap-action/item-popconfirm/index.vue.mjs +2 -2
- package/es/src/ap-button/ap-action-button.vue.mjs +2 -2
- package/es/src/ap-button/ap-button.vue.mjs +2 -2
- package/es/src/ap-button/ap-confirm-button.vue.mjs +2 -2
- package/es/src/ap-descriptions/ap-descriptions.vue.mjs +3 -3
- package/es/src/ap-descriptions/help-message/index.vue2.mjs +4 -4
- package/es/src/ap-download/ap-download.vue.mjs +1 -1
- package/es/src/ap-field/checkbox/index.vue.mjs +1 -1
- package/es/src/ap-field/date/index.vue.mjs +4 -4
- package/es/src/ap-field/date-range/index.vue.mjs +8 -8
- package/es/src/ap-field/index.mjs +30 -30
- package/es/src/ap-field/number/index.vue.mjs +8 -8
- package/es/src/ap-field/radio/index.vue.mjs +1 -1
- package/es/src/ap-field/rate/index.vue.mjs +2 -2
- package/es/src/ap-field/segmented/index.vue.mjs +1 -1
- package/es/src/ap-field/select/index.vue.mjs +2 -2
- package/es/src/ap-field/slider/index.vue.mjs +4 -4
- package/es/src/ap-field/switch/index.vue.mjs +3 -3
- package/es/src/ap-field/text/index.vue2.mjs +13 -13
- package/es/src/ap-field/text/password.vue.mjs +2 -2
- package/es/src/ap-field/text-area/index.vue.mjs +3 -3
- package/es/src/ap-form/ap-form.vue2.mjs +2 -2
- package/es/src/ap-form/drawer-form/index.vue.mjs +9 -9
- package/es/src/ap-form/item/index.vue.mjs +7 -7
- package/es/src/ap-form/item-group/index.vue.mjs +3 -3
- package/es/src/ap-form/items/checkbox/index.vue.mjs +2 -2
- package/es/src/ap-form/items/date/index.vue.mjs +2 -2
- package/es/src/ap-form/items/date-range/index.vue.mjs +2 -2
- package/es/src/ap-form/items/number/index.vue.mjs +2 -2
- package/es/src/ap-form/items/radio/index.vue.mjs +2 -2
- package/es/src/ap-form/items/select/index.vue.mjs +2 -2
- package/es/src/ap-form/items/switch/index.vue.mjs +2 -2
- package/es/src/ap-form/items/text/group.vue2.mjs +2 -2
- package/es/src/ap-form/items/text/index.vue2.mjs +2 -2
- package/es/src/ap-form/items/text/password.vue.mjs +2 -2
- package/es/src/ap-form/items/text-area/index.vue.mjs +2 -2
- package/es/src/ap-form/modal-form/index.vue.mjs +7 -7
- package/es/src/ap-form/render/item.vue.mjs +2 -2
- package/es/src/ap-form/search-form/index.vue.mjs +1 -1
- package/es/src/ap-form/set/index.vue.mjs +1 -1
- package/es/src/ap-grid/editable/form-item.vue.d.ts +16 -0
- package/es/src/ap-grid/editable/form-item.vue.mjs +257 -0
- package/es/src/ap-grid/editable/form-item.vue2.mjs +4 -0
- package/es/src/ap-grid/editable/index.vue.d.ts +18 -0
- package/es/src/ap-grid/editable/index.vue.mjs +288 -0
- package/es/src/ap-grid/editable/index.vue2.mjs +4 -0
- package/es/src/ap-grid/editable/interface.d.ts +95 -0
- package/es/src/ap-grid/editable/interface.mjs +1 -0
- package/es/src/ap-grid/editable/style/css.d.ts +0 -0
- package/es/src/ap-grid/editable/style/css.js +1 -0
- package/es/src/ap-grid/editable/style/index.d.ts +0 -0
- package/es/src/ap-grid/editable/style/index.js +1 -0
- package/es/src/ap-grid/hooks/use-editable-columns.d.ts +6 -0
- package/es/src/ap-grid/hooks/use-editable-columns.mjs +68 -0
- package/es/src/ap-grid/hooks/use-inner-params.mjs +3 -3
- package/es/src/ap-grid/index.d.ts +4 -1
- package/es/src/ap-grid/index.mjs +3 -0
- package/es/src/ap-grid/index.vue.mjs +113 -103
- package/es/src/ap-grid/interface.d.ts +15 -0
- package/es/src/ap-grid/utils/col.mjs +39 -39
- package/es/src/ap-grid/utils/editable.d.ts +3 -0
- package/es/src/ap-grid/utils/editable.mjs +27 -0
- package/es/src/ap-grid/utils/table.mjs +24 -17
- package/es/src/ap-info-layout/ApInfoLayout.vue.mjs +2 -2
- package/es/src/ap-info-layout/ap-info-layout-admin/ApInfoLayoutAdmin.vue2.mjs +2 -2
- package/es/src/ap-info-layout/ap-info-layout-aplus/ap-info-layout.vue2.mjs +1 -1
- package/es/src/ap-list/index.vue.mjs +4 -4
- package/es/src/ap-table/ap-table.vue2.mjs +172 -159
- package/es/src/ap-table/components/dynamic-component/index.vue2.mjs +2 -2
- package/es/src/ap-table/components/index/index.vue2.mjs +2 -2
- package/es/src/ap-table/components/paragraph-ellipsis/index.vue2.mjs +3 -3
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +3 -3
- package/es/src/ap-table/components/setting/select-group/index.vue2.mjs +1 -1
- package/es/src/ap-table/components/setting/sortable/index.vue2.mjs +1 -1
- package/es/src/ap-table/components/setting/sortable/item.vue2.mjs +1 -1
- package/es/src/ap-table/components/setting/sorter/index.vue2.mjs +11 -11
- package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +1 -1
- package/es/src/ap-table/components/status/index.vue2.mjs +2 -2
- package/es/src/ap-table/constants.mjs +40 -40
- package/es/src/ap-table/context.d.ts +4 -4
- package/es/src/ap-table/hooks/use-sorted-filtered.d.ts +4 -1
- package/es/src/ap-table/hooks/use-sorted-filtered.mjs +11 -9
- package/es/src/ap-table/hooks/use-table-column-state.mjs +3 -3
- package/es/src/ap-table/hooks/use-table-paging-ng.d.ts +3 -1
- package/es/src/ap-table/hooks/use-table-paging-ng.mjs +53 -49
- package/es/src/ap-table/hooks/use-table-paging.d.ts +1 -1
- package/es/src/ap-tag/ap-tag-group.vue.mjs +8 -8
- package/es/src/ap-tag/ap-tag.vue.mjs +2 -2
- package/es/src/ap-upload/apUpload.vue.mjs +5 -5
- package/es/src/ap-upload/components/MultipleFile.vue2.mjs +3 -3
- package/es/src/ap-upload/components/Picture.vue2.mjs +6 -6
- package/es/src/ap-upload/components/SingleFile.vue2.mjs +7 -7
- package/es/src/business/ap-appendix/ap-appendix.vue2.mjs +1 -1
- package/es/src/business/ap-appendix/icons/file-icon.vue.mjs +2 -2
- package/es/src/business/ap-batch-action/ApBatchAction.vue2.mjs +2 -2
- package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue.d.ts +2 -2
- package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.mjs +10 -10
- package/es/src/business/ap-batch-action-group/MenuItemGroup.vue2.mjs +1 -1
- package/es/src/business/ap-batch-action-group/index.d.ts +4 -4
- package/es/src/business/ap-button-group/ApButtonGroup.vue2.mjs +1 -1
- package/es/src/business/ap-card/ApCard.vue2.mjs +7 -7
- package/es/src/business/ap-expand-alert/ApExpandAlert.vue2.mjs +11 -11
- package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +9 -9
- package/es/src/business/ap-group-search/ap-group-search.vue2.mjs +5 -5
- package/es/src/business/ap-group-search/extension-select/index.vue2.mjs +4 -4
- package/es/src/business/ap-group-search/images/icon-down.vue.mjs +2 -2
- package/es/src/business/ap-group-search/images/icon-line-select.vue.mjs +2 -2
- package/es/src/business/ap-group-search/popover-select/index.vue2.mjs +2 -2
- package/es/src/business/ap-image/ApImage.vue2.mjs +1 -1
- package/es/src/business/ap-input-radio/ApInputRadio.vue2.mjs +2 -2
- package/es/src/business/ap-ladder/ApLadder.vue2.mjs +1 -1
- package/es/src/business/ap-ladder/HelpMessageIcon.vue2.mjs +1 -1
- package/es/src/business/ap-select-layout/select-layout.vue2.mjs +4 -4
- package/es/src/business/ap-status/ApStatus.vue2.mjs +8 -8
- package/es/src/business/ap-status/group/ApStatusGroup.vue2.mjs +4 -4
- package/es/src/business/ap-summary/ap-summary.vue2.mjs +1 -1
- package/es/src/business/ap-table-modal/modal-title.vue2.mjs +2 -2
- package/es/src/business/ap-table-modal/table-layout/index.vue2.mjs +14 -14
- package/es/src/business/ap-table-modal/table-modal.vue2.mjs +3 -3
- package/es/src/business/ap-title/ApTitle.vue2.mjs +7 -7
- package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.mjs +1 -1
- package/es/src/business/ap-upload-file/icon/delete-icon.vue.mjs +2 -2
- package/es/src/business/ap-upload-file/icon/file-icon.vue.mjs +2 -2
- package/es/src/business/batch-input-group/form-item.vue.mjs +2 -2
- package/es/src/business/batch-input-group/index.vue.mjs +7 -6
- package/es/src/business/batch-input-group/popover-input/index.vue2.mjs +2 -2
- package/es/src/check-card/index.vue2.mjs +3 -3
- package/es/src/config-provider/config-provider-props.mjs +1 -1
- package/es/src/editable-table/form-item.vue.mjs +2 -2
- package/es/src/editable-table/index.vue.mjs +2 -2
- package/es/src/editable-table/utils.d.ts +3 -2
- package/es/src/full-screen/index.vue.mjs +3 -3
- package/es/src/hooks/useFullScreen.mjs +5 -5
- package/es/src/index.mjs +24 -20
- package/es/src/path-map.mjs +3 -1
- package/es/src/portal/index.vue.mjs +2 -2
- package/es/src/scroll-bar/index.vue.mjs +3 -3
- package/es/src/scroll-bar/internal.vue.mjs +2 -2
- package/es/src/scroll-view/index.vue.mjs +9 -9
- package/es/src/work-order-modal/help-message.vue2.mjs +2 -2
- package/es/src/work-order-modal/work-order-modal.vue.mjs +2 -2
- package/lib/index.js +1 -1
- package/lib/src/ap-action/item-dropdown/index.vue.js +1 -1
- package/lib/src/ap-field/index.js +1 -1
- package/lib/src/ap-field/text/index.vue2.js +1 -1
- package/lib/src/ap-grid/editable/form-item.vue.d.ts +16 -0
- package/lib/src/ap-grid/editable/form-item.vue.js +1 -0
- package/lib/src/ap-grid/editable/form-item.vue2.js +1 -0
- package/lib/src/ap-grid/editable/index.vue.d.ts +18 -0
- package/lib/src/ap-grid/editable/index.vue.js +1 -0
- package/lib/src/ap-grid/editable/index.vue2.js +1 -0
- package/lib/src/ap-grid/editable/interface.d.ts +95 -0
- package/lib/src/ap-grid/editable/interface.js +1 -0
- package/lib/src/ap-grid/editable/style/css.cjs +1 -0
- package/lib/src/ap-grid/editable/style/css.d.ts +0 -0
- package/lib/src/ap-grid/editable/style/index.cjs +1 -0
- package/lib/src/ap-grid/editable/style/index.d.ts +0 -0
- package/lib/src/ap-grid/hooks/use-editable-columns.d.ts +6 -0
- package/lib/src/ap-grid/hooks/use-editable-columns.js +1 -0
- package/lib/src/ap-grid/index.d.ts +4 -1
- package/lib/src/ap-grid/index.js +1 -1
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-grid/interface.d.ts +15 -0
- package/lib/src/ap-grid/utils/col.js +1 -1
- package/lib/src/ap-grid/utils/editable.d.ts +3 -0
- package/lib/src/ap-grid/utils/editable.js +1 -0
- package/lib/src/ap-grid/utils/table.js +1 -1
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/constants.js +1 -1
- package/lib/src/ap-table/context.d.ts +4 -4
- package/lib/src/ap-table/hooks/use-sorted-filtered.d.ts +4 -1
- package/lib/src/ap-table/hooks/use-sorted-filtered.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging-ng.d.ts +3 -1
- package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging.d.ts +1 -1
- package/lib/src/ap-upload/apUpload.vue.js +1 -1
- package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue.d.ts +2 -2
- package/lib/src/business/ap-batch-action-group/index.d.ts +4 -4
- package/lib/src/business/batch-input-group/index.vue.js +2 -2
- package/lib/src/config-provider/config-provider-props.js +1 -1
- package/lib/src/editable-table/utils.d.ts +3 -2
- package/lib/src/index.js +1 -1
- package/lib/src/path-map.js +1 -1
- package/package.json +1 -1
- package/theme/ap-grid/editable.css +22 -0
- package/theme/ap-grid/editable.less +28 -0
- package/theme/index.css +22 -0
- package/theme/index.less +1 -0
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { defineComponent as A, useSlots as P, toRef as H, ref as y, unref as r, watch as W, nextTick as G, createBlock as K, openBlock as M, mergeProps as g, withCtx as C, createVNode as U, createSlots as $, renderList as q, renderSlot as J, normalizeProps as Q, guardReactiveProps as X } from "vue";
|
|
2
|
+
import { ApForm as w } from "../../ap-form/index.mjs";
|
|
3
|
+
import { isArray as Y, isNumber as f, cloneDeep as d, omit as Z } from "lodash-unified";
|
|
4
|
+
import "../../config-provider/index.mjs";
|
|
5
|
+
import { isDef as m } from "../../utils/index.mjs";
|
|
6
|
+
import { useGetEditableColumns as I } from "../hooks/use-editable-columns.mjs";
|
|
7
|
+
import "../index.vue2.mjs";
|
|
8
|
+
import { useInjectForm as ee } from "../../ap-form/context.mjs";
|
|
9
|
+
import { useNamespace as oe } from "../../config-provider/hooks/use-namespace.mjs";
|
|
10
|
+
import { useGlobalConfig as te } from "../../config-provider/hooks/use-global-config.mjs";
|
|
11
|
+
import ae from "../index.vue.mjs";
|
|
12
|
+
const he = /* @__PURE__ */ A({
|
|
13
|
+
name: "EditableGrid",
|
|
14
|
+
__name: "form-item",
|
|
15
|
+
props: {
|
|
16
|
+
dropdownPrefixCls: {},
|
|
17
|
+
loading: {
|
|
18
|
+
type: [Boolean, Object],
|
|
19
|
+
default: void 0
|
|
20
|
+
},
|
|
21
|
+
bordered: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: !1
|
|
24
|
+
},
|
|
25
|
+
locale: {},
|
|
26
|
+
onResizeColumn: {},
|
|
27
|
+
getPopupContainer: {},
|
|
28
|
+
scroll: {},
|
|
29
|
+
sortDirections: {
|
|
30
|
+
default: () => ["ascend", "descend"]
|
|
31
|
+
},
|
|
32
|
+
showSorterTooltip: {
|
|
33
|
+
type: [Boolean, Object],
|
|
34
|
+
default: !0
|
|
35
|
+
},
|
|
36
|
+
prefixCls: {},
|
|
37
|
+
tableLayout: {
|
|
38
|
+
default: "fixed"
|
|
39
|
+
},
|
|
40
|
+
title: {},
|
|
41
|
+
id: {},
|
|
42
|
+
showHeader: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: !0
|
|
45
|
+
},
|
|
46
|
+
components: {},
|
|
47
|
+
customRow: {},
|
|
48
|
+
customHeaderRow: {},
|
|
49
|
+
direction: {},
|
|
50
|
+
expandFixed: {
|
|
51
|
+
type: [String, Boolean],
|
|
52
|
+
default: !1
|
|
53
|
+
},
|
|
54
|
+
expandColumnWidth: {},
|
|
55
|
+
expandedRowKeys: {},
|
|
56
|
+
defaultExpandedRowKeys: {},
|
|
57
|
+
expandedRowRender: {},
|
|
58
|
+
expandRowByClick: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: !1
|
|
61
|
+
},
|
|
62
|
+
expandIcon: {},
|
|
63
|
+
onExpand: {},
|
|
64
|
+
onExpandedRowsChange: {},
|
|
65
|
+
defaultExpandAllRows: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: !1
|
|
68
|
+
},
|
|
69
|
+
indentSize: {
|
|
70
|
+
default: 15
|
|
71
|
+
},
|
|
72
|
+
expandIconColumnIndex: {},
|
|
73
|
+
showExpandColumn: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: !0
|
|
76
|
+
},
|
|
77
|
+
expandedRowClassName: {},
|
|
78
|
+
childrenColumnName: {
|
|
79
|
+
default: "children"
|
|
80
|
+
},
|
|
81
|
+
rowExpandable: {},
|
|
82
|
+
sticky: {
|
|
83
|
+
type: [Boolean, Object],
|
|
84
|
+
default: !1
|
|
85
|
+
},
|
|
86
|
+
transformCellText: {},
|
|
87
|
+
rowClassName: {},
|
|
88
|
+
stripe: {
|
|
89
|
+
type: Boolean
|
|
90
|
+
},
|
|
91
|
+
headerRowClassName: {},
|
|
92
|
+
footerRowClassName: {},
|
|
93
|
+
cellClassName: {},
|
|
94
|
+
headerCellClassName: {},
|
|
95
|
+
footerCellClassName: {},
|
|
96
|
+
rowStyle: {},
|
|
97
|
+
headerRowStyle: {},
|
|
98
|
+
footerRowStyle: {},
|
|
99
|
+
cellStyle: {},
|
|
100
|
+
headerCellStyle: {},
|
|
101
|
+
footerCellStyle: {},
|
|
102
|
+
height: {},
|
|
103
|
+
minHeight: {},
|
|
104
|
+
maxHeight: {},
|
|
105
|
+
mergeCells: {},
|
|
106
|
+
mergeFooterItems: {},
|
|
107
|
+
cellConfig: {},
|
|
108
|
+
rowSelection: {
|
|
109
|
+
type: Boolean,
|
|
110
|
+
default: void 0
|
|
111
|
+
},
|
|
112
|
+
onLoadingChange: {},
|
|
113
|
+
pagination: {
|
|
114
|
+
type: [Boolean, Object],
|
|
115
|
+
default: !1
|
|
116
|
+
},
|
|
117
|
+
searchFormWrapperStyle: {},
|
|
118
|
+
tableWrapperStyle: {},
|
|
119
|
+
wrapperStyle: {},
|
|
120
|
+
size: {
|
|
121
|
+
default: "medium"
|
|
122
|
+
},
|
|
123
|
+
adaptive: {
|
|
124
|
+
type: Boolean,
|
|
125
|
+
default: !1
|
|
126
|
+
},
|
|
127
|
+
columnResizable: {
|
|
128
|
+
type: [Boolean, Object],
|
|
129
|
+
default: !1
|
|
130
|
+
},
|
|
131
|
+
rowKey: {
|
|
132
|
+
default: "key"
|
|
133
|
+
},
|
|
134
|
+
footer: {},
|
|
135
|
+
virtual: {
|
|
136
|
+
type: [Boolean, Object],
|
|
137
|
+
default: void 0
|
|
138
|
+
},
|
|
139
|
+
expandable: {},
|
|
140
|
+
value: {},
|
|
141
|
+
columns: {},
|
|
142
|
+
defaultValue: {},
|
|
143
|
+
"onUpdate:value": {},
|
|
144
|
+
onChange: {},
|
|
145
|
+
maxLength: {},
|
|
146
|
+
onFieldChange: {},
|
|
147
|
+
label: {},
|
|
148
|
+
name: {},
|
|
149
|
+
formItem: {
|
|
150
|
+
default: () => ({})
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
setup(x, {
|
|
154
|
+
expose: b
|
|
155
|
+
}) {
|
|
156
|
+
const R = P(), a = x, {
|
|
157
|
+
b: B
|
|
158
|
+
} = oe("editable-grid");
|
|
159
|
+
function S(e, o) {
|
|
160
|
+
return Y(o) ? o.reduce((n, l) => n == null ? void 0 : n[l], e) : e == null ? void 0 : e[o];
|
|
161
|
+
}
|
|
162
|
+
const {
|
|
163
|
+
internalInstance: t,
|
|
164
|
+
model: F
|
|
165
|
+
} = ee(), i = H(a.name), u = y(S(r(F), i.value) || []), N = w.useWatch(i);
|
|
166
|
+
W(() => N.value, async (e) => {
|
|
167
|
+
var o;
|
|
168
|
+
await G(), u.value = e, (o = a.onChange) == null || o.call(a, e);
|
|
169
|
+
}, {
|
|
170
|
+
deep: !0
|
|
171
|
+
});
|
|
172
|
+
const p = y(), v = te("valueTypeMap"), D = I(a, v);
|
|
173
|
+
function L(e, o) {
|
|
174
|
+
var s;
|
|
175
|
+
const n = ((s = r(u)) == null ? void 0 : s.length) || 0;
|
|
176
|
+
if (m(a.maxLength) && n >= a.maxLength)
|
|
177
|
+
return;
|
|
178
|
+
const l = [...r(u) || []];
|
|
179
|
+
m(o) ? l.splice(o, 0, {
|
|
180
|
+
...e || {}
|
|
181
|
+
}) : l.push({
|
|
182
|
+
...e || {}
|
|
183
|
+
}), t == null || t.setFieldValue(a.name, l);
|
|
184
|
+
}
|
|
185
|
+
function V(e, o = "suffix") {
|
|
186
|
+
var h;
|
|
187
|
+
const n = ((h = r(u)) == null ? void 0 : h.length) || 0, l = f(e) ? e : e.length;
|
|
188
|
+
if (m(a.maxLength) && n + l > a.maxLength)
|
|
189
|
+
return;
|
|
190
|
+
const s = [...r(u) || []], c = f(e) ? new Array(e).fill(0).map(() => ({})) : d(e);
|
|
191
|
+
o === "suffix" ? s.push(...c) : s.unshift(...c), t == null || t.setFieldValue(a.name, s);
|
|
192
|
+
}
|
|
193
|
+
function _(e) {
|
|
194
|
+
let o = d(r(u) || []);
|
|
195
|
+
const n = f(e) ? [e] : e;
|
|
196
|
+
o = o.filter((l, s) => !n.includes(s)), t == null || t.setFieldValue(a.name, o);
|
|
197
|
+
}
|
|
198
|
+
function E() {
|
|
199
|
+
return r(u);
|
|
200
|
+
}
|
|
201
|
+
function T(e) {
|
|
202
|
+
var o;
|
|
203
|
+
return (o = r(u)) == null ? void 0 : o[e];
|
|
204
|
+
}
|
|
205
|
+
function j(e, o, n = !0) {
|
|
206
|
+
const l = d(r(u));
|
|
207
|
+
l[e] && (l[e] = {
|
|
208
|
+
...n ? l[e] : {},
|
|
209
|
+
...o
|
|
210
|
+
}, t == null || t.setFieldValue(a.name, [...l]));
|
|
211
|
+
}
|
|
212
|
+
function k(e) {
|
|
213
|
+
t == null || t.setFieldValue(a.name, e);
|
|
214
|
+
}
|
|
215
|
+
function O(e) {
|
|
216
|
+
var n;
|
|
217
|
+
const o = e === "end" ? u.value.length - 1 : e;
|
|
218
|
+
(n = p.value) == null || n.scrollToRow(o);
|
|
219
|
+
}
|
|
220
|
+
function z() {
|
|
221
|
+
var e;
|
|
222
|
+
(e = t == null ? void 0 : t.setFieldValue) == null || e.call(t, a.name, []);
|
|
223
|
+
}
|
|
224
|
+
return b({
|
|
225
|
+
add: L,
|
|
226
|
+
remove: _,
|
|
227
|
+
getRowData: T,
|
|
228
|
+
getRowsData: E,
|
|
229
|
+
setRowData: j,
|
|
230
|
+
addMultiple: V,
|
|
231
|
+
scrollTo: O,
|
|
232
|
+
setTableData: k,
|
|
233
|
+
clear: z
|
|
234
|
+
}), (e, o) => (M(), K(r(w).FormItem, g(e.formItem, {
|
|
235
|
+
name: e.name,
|
|
236
|
+
label: e.label
|
|
237
|
+
}), {
|
|
238
|
+
default: C(() => [U(ae, g(r(Z)(a, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue", "formItem"]), {
|
|
239
|
+
ref_key: "tableRef",
|
|
240
|
+
ref: p,
|
|
241
|
+
class: r(B)(),
|
|
242
|
+
columns: r(D),
|
|
243
|
+
"data-source": r(d)(u.value),
|
|
244
|
+
"search-form": !1
|
|
245
|
+
}), $({
|
|
246
|
+
_: 2
|
|
247
|
+
}, [q(R, (n, l) => ({
|
|
248
|
+
name: l,
|
|
249
|
+
fn: C((s) => [J(e.$slots, l, Q(X(s || {})))])
|
|
250
|
+
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
251
|
+
_: 3
|
|
252
|
+
}, 16, ["name", "label"]));
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
export {
|
|
256
|
+
he as default
|
|
257
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { EditableGridExpose, EditableGridProps } from './interface';
|
|
2
|
+
import { Recordable } from '../../type';
|
|
3
|
+
import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } from 'vue';
|
|
4
|
+
declare const _default: <RecordType extends Recordable = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
5
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
6
|
+
readonly "onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
7
|
+
} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, "onUpdate:value"> & EditableGridProps<RecordType> & Partial<{}>> & PublicProps;
|
|
8
|
+
expose(exposed: ShallowUnwrapRef<EditableGridExpose>): void;
|
|
9
|
+
attrs: any;
|
|
10
|
+
slots: Readonly<Record<string, any>> & Record<string, any>;
|
|
11
|
+
emit: (event: "update:value", ...args: any[]) => void;
|
|
12
|
+
}>) => VNode & {
|
|
13
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_PrettifyLocal<T> = {
|
|
17
|
+
[K in keyof T]: T[K];
|
|
18
|
+
} & {};
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import { defineComponent as M, useSlots as U, ref as w, watch as v, unref as n, createBlock as $, openBlock as q, withCtx as p, createVNode as R, mergeProps as J, createSlots as Q, renderList as X, renderSlot as Y, normalizeProps as Z, guardReactiveProps as ee } from "vue";
|
|
2
|
+
import { ApForm as h } from "../../ap-form/index.mjs";
|
|
3
|
+
import { isEqual as ae, isArray as b, isNumber as y, cloneDeep as m, omit as te } from "lodash-unified";
|
|
4
|
+
import "../../config-provider/index.mjs";
|
|
5
|
+
import "../../hooks/index.mjs";
|
|
6
|
+
import { isDef as g } from "../../utils/index.mjs";
|
|
7
|
+
import { useGetEditableColumns as le } from "../hooks/use-editable-columns.mjs";
|
|
8
|
+
import "../index.vue2.mjs";
|
|
9
|
+
import { useNamespace as oe } from "../../config-provider/hooks/use-namespace.mjs";
|
|
10
|
+
import { useControllableValue as ne } from "../../hooks/useControllableValue.mjs";
|
|
11
|
+
import { useGlobalConfig as re } from "../../config-provider/hooks/use-global-config.mjs";
|
|
12
|
+
import se from "../index.vue.mjs";
|
|
13
|
+
const we = /* @__PURE__ */ M({
|
|
14
|
+
name: "EditableGrid",
|
|
15
|
+
__name: "index",
|
|
16
|
+
props: {
|
|
17
|
+
dropdownPrefixCls: {},
|
|
18
|
+
loading: {
|
|
19
|
+
type: [Boolean, Object],
|
|
20
|
+
default: void 0
|
|
21
|
+
},
|
|
22
|
+
bordered: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: !1
|
|
25
|
+
},
|
|
26
|
+
locale: {},
|
|
27
|
+
onResizeColumn: {},
|
|
28
|
+
getPopupContainer: {},
|
|
29
|
+
scroll: {},
|
|
30
|
+
sortDirections: {
|
|
31
|
+
default: () => ["ascend", "descend"]
|
|
32
|
+
},
|
|
33
|
+
showSorterTooltip: {
|
|
34
|
+
type: [Boolean, Object],
|
|
35
|
+
default: !0
|
|
36
|
+
},
|
|
37
|
+
prefixCls: {},
|
|
38
|
+
tableLayout: {
|
|
39
|
+
default: "fixed"
|
|
40
|
+
},
|
|
41
|
+
title: {},
|
|
42
|
+
id: {},
|
|
43
|
+
showHeader: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: !0
|
|
46
|
+
},
|
|
47
|
+
components: {},
|
|
48
|
+
customRow: {},
|
|
49
|
+
customHeaderRow: {},
|
|
50
|
+
direction: {},
|
|
51
|
+
expandFixed: {
|
|
52
|
+
type: [String, Boolean],
|
|
53
|
+
default: !1
|
|
54
|
+
},
|
|
55
|
+
expandColumnWidth: {},
|
|
56
|
+
expandedRowKeys: {},
|
|
57
|
+
defaultExpandedRowKeys: {},
|
|
58
|
+
expandedRowRender: {},
|
|
59
|
+
expandRowByClick: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: !1
|
|
62
|
+
},
|
|
63
|
+
expandIcon: {},
|
|
64
|
+
onExpand: {},
|
|
65
|
+
onExpandedRowsChange: {},
|
|
66
|
+
defaultExpandAllRows: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: !1
|
|
69
|
+
},
|
|
70
|
+
indentSize: {
|
|
71
|
+
default: 15
|
|
72
|
+
},
|
|
73
|
+
expandIconColumnIndex: {},
|
|
74
|
+
showExpandColumn: {
|
|
75
|
+
type: Boolean,
|
|
76
|
+
default: !0
|
|
77
|
+
},
|
|
78
|
+
expandedRowClassName: {},
|
|
79
|
+
childrenColumnName: {
|
|
80
|
+
default: "children"
|
|
81
|
+
},
|
|
82
|
+
rowExpandable: {},
|
|
83
|
+
sticky: {
|
|
84
|
+
type: [Boolean, Object],
|
|
85
|
+
default: !1
|
|
86
|
+
},
|
|
87
|
+
transformCellText: {},
|
|
88
|
+
rowClassName: {},
|
|
89
|
+
stripe: {
|
|
90
|
+
type: Boolean
|
|
91
|
+
},
|
|
92
|
+
headerRowClassName: {},
|
|
93
|
+
footerRowClassName: {},
|
|
94
|
+
cellClassName: {},
|
|
95
|
+
headerCellClassName: {},
|
|
96
|
+
footerCellClassName: {},
|
|
97
|
+
rowStyle: {},
|
|
98
|
+
headerRowStyle: {},
|
|
99
|
+
footerRowStyle: {},
|
|
100
|
+
cellStyle: {},
|
|
101
|
+
headerCellStyle: {},
|
|
102
|
+
footerCellStyle: {},
|
|
103
|
+
height: {},
|
|
104
|
+
minHeight: {},
|
|
105
|
+
maxHeight: {},
|
|
106
|
+
mergeCells: {},
|
|
107
|
+
mergeFooterItems: {},
|
|
108
|
+
cellConfig: {},
|
|
109
|
+
rowSelection: {
|
|
110
|
+
type: Boolean,
|
|
111
|
+
default: void 0
|
|
112
|
+
},
|
|
113
|
+
onLoadingChange: {},
|
|
114
|
+
pagination: {
|
|
115
|
+
type: [Boolean, Object],
|
|
116
|
+
default: !1
|
|
117
|
+
},
|
|
118
|
+
searchFormWrapperStyle: {},
|
|
119
|
+
tableWrapperStyle: {},
|
|
120
|
+
wrapperStyle: {},
|
|
121
|
+
size: {
|
|
122
|
+
default: "medium"
|
|
123
|
+
},
|
|
124
|
+
adaptive: {
|
|
125
|
+
type: Boolean,
|
|
126
|
+
default: !1
|
|
127
|
+
},
|
|
128
|
+
columnResizable: {
|
|
129
|
+
type: [Boolean, Object],
|
|
130
|
+
default: !1
|
|
131
|
+
},
|
|
132
|
+
rowKey: {
|
|
133
|
+
default: "key"
|
|
134
|
+
},
|
|
135
|
+
footer: {},
|
|
136
|
+
virtual: {
|
|
137
|
+
type: [Boolean, Object],
|
|
138
|
+
default: void 0
|
|
139
|
+
},
|
|
140
|
+
expandable: {},
|
|
141
|
+
value: {},
|
|
142
|
+
columns: {},
|
|
143
|
+
defaultValue: {},
|
|
144
|
+
"onUpdate:value": {},
|
|
145
|
+
onChange: {},
|
|
146
|
+
maxLength: {},
|
|
147
|
+
name: {
|
|
148
|
+
default: "ap-editable-table-inner-name"
|
|
149
|
+
},
|
|
150
|
+
onFieldChange: {}
|
|
151
|
+
},
|
|
152
|
+
emits: ["update:value"],
|
|
153
|
+
setup(B, {
|
|
154
|
+
expose: F,
|
|
155
|
+
emit: S
|
|
156
|
+
}) {
|
|
157
|
+
const N = U(), t = B, {
|
|
158
|
+
b: V
|
|
159
|
+
} = oe("editable-grid"), _ = S, C = w(), {
|
|
160
|
+
value: s,
|
|
161
|
+
updateValue: L
|
|
162
|
+
} = ne(t, _), u = w(), D = re("valueTypeMap"), c = h.useWatch(t.name, u);
|
|
163
|
+
v(() => c.value, (e) => {
|
|
164
|
+
var a;
|
|
165
|
+
L(e), (a = t.onChange) == null || a.call(t, e);
|
|
166
|
+
}, {
|
|
167
|
+
deep: !0
|
|
168
|
+
}), v(s, (e) => {
|
|
169
|
+
var a;
|
|
170
|
+
e !== n(c) && (ae(e, n(c)) || (a = u.value) == null || a.setFieldValue(t.name, e));
|
|
171
|
+
}, {
|
|
172
|
+
deep: !0
|
|
173
|
+
});
|
|
174
|
+
const E = le(t, D);
|
|
175
|
+
function k() {
|
|
176
|
+
var e;
|
|
177
|
+
(e = u.value) == null || e.resetFields();
|
|
178
|
+
}
|
|
179
|
+
function A(e) {
|
|
180
|
+
return e ? (b(e) ? e : [e]).map((o) => b(o) ? [t.name, ...o] : [t.name, o]) : void 0;
|
|
181
|
+
}
|
|
182
|
+
async function T(e, a) {
|
|
183
|
+
var l;
|
|
184
|
+
const o = await ((l = u.value) == null ? void 0 : l.validateFields(A(e), a));
|
|
185
|
+
return o == null ? void 0 : o[t.name];
|
|
186
|
+
}
|
|
187
|
+
function j(e, a) {
|
|
188
|
+
var r, d, i;
|
|
189
|
+
const o = ((r = n(s)) == null ? void 0 : r.length) || 0;
|
|
190
|
+
if (g(t.maxLength) && o >= t.maxLength)
|
|
191
|
+
return;
|
|
192
|
+
const l = [...n(s) || []];
|
|
193
|
+
g(a) ? l.splice(a, 0, {
|
|
194
|
+
...e || {}
|
|
195
|
+
}) : l.push({
|
|
196
|
+
...e || {}
|
|
197
|
+
}), (i = (d = u.value) == null ? void 0 : d.setFieldValue) == null || i.call(d, t.name, l);
|
|
198
|
+
}
|
|
199
|
+
function O(e, a = "suffix") {
|
|
200
|
+
var i, f, x;
|
|
201
|
+
const o = ((i = n(s)) == null ? void 0 : i.length) || 0, l = y(e) ? e : e.length;
|
|
202
|
+
if (g(t.maxLength) && o + l > t.maxLength)
|
|
203
|
+
return;
|
|
204
|
+
const r = [...n(s) || []], d = y(e) ? new Array(e).fill(0).map(() => ({})) : m(e);
|
|
205
|
+
a === "suffix" ? r.push(...d) : r.unshift(...d), (x = (f = u.value) == null ? void 0 : f.setFieldValue) == null || x.call(f, t.name, r);
|
|
206
|
+
}
|
|
207
|
+
function z(e) {
|
|
208
|
+
var l, r;
|
|
209
|
+
let a = m(n(s) || []);
|
|
210
|
+
const o = y(e) ? [e] : e;
|
|
211
|
+
a = a.filter((d, i) => !o.includes(i)), (r = (l = u.value) == null ? void 0 : l.setFieldValue) == null || r.call(l, t.name, a);
|
|
212
|
+
}
|
|
213
|
+
function P() {
|
|
214
|
+
return n(s);
|
|
215
|
+
}
|
|
216
|
+
function H(e) {
|
|
217
|
+
var a;
|
|
218
|
+
(a = u.value) == null || a.setFieldValue(t.name, e);
|
|
219
|
+
}
|
|
220
|
+
function I(e) {
|
|
221
|
+
var a;
|
|
222
|
+
return (a = n(s)) == null ? void 0 : a[e];
|
|
223
|
+
}
|
|
224
|
+
function W(e, a, o = !0) {
|
|
225
|
+
var r, d;
|
|
226
|
+
const l = m(n(s));
|
|
227
|
+
l[e] && (l[e] = {
|
|
228
|
+
...o ? l[e] : {},
|
|
229
|
+
...a
|
|
230
|
+
}, (d = (r = u.value) == null ? void 0 : r.setFieldValue) == null || d.call(r, t.name, [...l]));
|
|
231
|
+
}
|
|
232
|
+
function G(e) {
|
|
233
|
+
var o;
|
|
234
|
+
const a = e === "end" ? s.value.length - 1 : e;
|
|
235
|
+
(o = C.value) == null || o.scrollToRow(a);
|
|
236
|
+
}
|
|
237
|
+
function K() {
|
|
238
|
+
var e, a;
|
|
239
|
+
(a = (e = u.value) == null ? void 0 : e.setFieldValue) == null || a.call(e, t.name, []);
|
|
240
|
+
}
|
|
241
|
+
return F({
|
|
242
|
+
resetFields: k,
|
|
243
|
+
validateFields: T,
|
|
244
|
+
add: j,
|
|
245
|
+
remove: z,
|
|
246
|
+
getRowData: I,
|
|
247
|
+
getRowsData: P,
|
|
248
|
+
setRowData: W,
|
|
249
|
+
addMultiple: O,
|
|
250
|
+
scrollTo: G,
|
|
251
|
+
clear: K,
|
|
252
|
+
setTableData: H
|
|
253
|
+
}), (e, a) => (q(), $(n(h), {
|
|
254
|
+
ref_key: "formRef",
|
|
255
|
+
ref: u,
|
|
256
|
+
"initial-values": {
|
|
257
|
+
[t.name]: n(s)
|
|
258
|
+
},
|
|
259
|
+
style: {
|
|
260
|
+
height: "100%"
|
|
261
|
+
}
|
|
262
|
+
}, {
|
|
263
|
+
default: p(() => [R(n(h).FormItem, {
|
|
264
|
+
name: e.name,
|
|
265
|
+
"no-style": ""
|
|
266
|
+
}, {
|
|
267
|
+
default: p(() => [R(se, J(n(te)(t, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue"]), {
|
|
268
|
+
ref_key: "tableRef",
|
|
269
|
+
ref: C,
|
|
270
|
+
class: n(V)(),
|
|
271
|
+
columns: n(E),
|
|
272
|
+
"data-source": n(m)(n(s)),
|
|
273
|
+
"search-form": !1
|
|
274
|
+
}), Q({
|
|
275
|
+
_: 2
|
|
276
|
+
}, [X(N, (o, l) => ({
|
|
277
|
+
name: l,
|
|
278
|
+
fn: p((r) => [Y(e.$slots, l, Z(ee(r || {})))])
|
|
279
|
+
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
280
|
+
_: 3
|
|
281
|
+
}, 8, ["name"])]),
|
|
282
|
+
_: 3
|
|
283
|
+
}, 8, ["initial-values"]));
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
export {
|
|
287
|
+
we as default
|
|
288
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { Recordable } from '../../type';
|
|
2
|
+
import { ApTableValueFields, ApTableValueTypes, CommonFieldReturnType, FieldPropsType } from '../../ap-table/interface';
|
|
3
|
+
import { ApGridColumnType, ApGridProps } from '../interface';
|
|
4
|
+
import { VNode } from 'vue';
|
|
5
|
+
import { DataIndex } from '@aplus-frontend/antdv/es/vc-table/interface';
|
|
6
|
+
import { EditableTableExpose } from '../../editable-table';
|
|
7
|
+
import { NamePath } from '@aplus-frontend/antdv/es/form/interface';
|
|
8
|
+
import { ApFormItemProps } from '../../ap-form';
|
|
9
|
+
export type EditableGridColumnType<RecordType = any, ExtraValueType = 'text', ValueType extends ApTableValueTypes = ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType = ExtraValueType | ValueType> = MergedValueType extends ExtraValueType | ValueType ? Omit<ApGridColumnType<RecordType, ExtraValueType, ValueType, MergedValueType>, 'children' | 'customRender' | 'hideInSearch' | 'hideInTable' | 'tooltip' | 'customRenderFormItem' | 'fieldProps'> & {
|
|
10
|
+
children?: EditableGridColumnType<RecordType, ExtraValueType, ValueType, MergedValueType>[];
|
|
11
|
+
/**
|
|
12
|
+
* 在title之后展示一个icon并触发tooltip
|
|
13
|
+
*/
|
|
14
|
+
tooltip?: any;
|
|
15
|
+
/**
|
|
16
|
+
* 是否可编辑
|
|
17
|
+
*/
|
|
18
|
+
editable?: boolean | ((text: any, record: RecordType, index: number) => boolean);
|
|
19
|
+
/**
|
|
20
|
+
* 自定义表单,适用于内置`valueType`不满足的情况下使用
|
|
21
|
+
*/
|
|
22
|
+
customRenderFormItem?: (config: EditableGridColumnType<RecordType>, fieldProps: Recordable, editable: boolean, record: RecordType) => any;
|
|
23
|
+
/**
|
|
24
|
+
* 指定值类型(将会用于普通列和可编辑表格的渲染)
|
|
25
|
+
*/
|
|
26
|
+
valueType?: MergedValueType;
|
|
27
|
+
/**
|
|
28
|
+
* 值类型额外配置的参数(支持函数)
|
|
29
|
+
*/
|
|
30
|
+
fieldProps?: FieldPropsType<Extract<MergedValueType, ValueType> extends never ? CommonFieldReturnType : ApTableValueFields[Extract<MergedValueType, ValueType>], RecordType, ExtraValueType, ValueType, MergedValueType>;
|
|
31
|
+
/**
|
|
32
|
+
* 自定义渲染,添加了`editable`以及`originalNode`
|
|
33
|
+
* @param opt
|
|
34
|
+
* @returns
|
|
35
|
+
*/
|
|
36
|
+
customRender?: (opt: {
|
|
37
|
+
value: any;
|
|
38
|
+
text: any;
|
|
39
|
+
record: RecordType;
|
|
40
|
+
index: number;
|
|
41
|
+
renderIndex: number;
|
|
42
|
+
column: ApGridColumnType<RecordType>;
|
|
43
|
+
editable?: boolean;
|
|
44
|
+
originalNode?: VNode;
|
|
45
|
+
}) => any;
|
|
46
|
+
} : never;
|
|
47
|
+
export type EditableGridProps<RecordType = any> = Omit<ApGridProps<RecordType>, 'columns' | 'dataSource' | 'onChange' | 'card' | 'request' | 'params' | 'defaultData' | 'searchForm' | 'beforeSearchSubmit' | 'manual'> & {
|
|
48
|
+
/**
|
|
49
|
+
* 列配置
|
|
50
|
+
*/
|
|
51
|
+
columns?: EditableGridColumnType<RecordType, any>[];
|
|
52
|
+
/**
|
|
53
|
+
* 表格数据v-model
|
|
54
|
+
*/
|
|
55
|
+
value?: RecordType[];
|
|
56
|
+
/**
|
|
57
|
+
* 表格数据默认值(只生效一次,如果是异步数据,请使用`v-model`)
|
|
58
|
+
*/
|
|
59
|
+
defaultValue?: RecordType[];
|
|
60
|
+
'onUpdate:value'?: (value: RecordType[]) => void;
|
|
61
|
+
/**
|
|
62
|
+
* 数据修改时触发onChange(也包含数据的删除)
|
|
63
|
+
* @param value
|
|
64
|
+
* @returns
|
|
65
|
+
*/
|
|
66
|
+
onChange?: (value: RecordType[]) => void;
|
|
67
|
+
/**
|
|
68
|
+
* 表格最大行数,超过行后将无法调用相关API新增
|
|
69
|
+
*/
|
|
70
|
+
maxLength?: number;
|
|
71
|
+
/**
|
|
72
|
+
* 设置可编辑表格的名字,如果不传,将会使用默认值
|
|
73
|
+
*/
|
|
74
|
+
name?: any;
|
|
75
|
+
/**
|
|
76
|
+
* 当字段值变更的时候触发(注意,向表单设置值并不会触发)
|
|
77
|
+
* @returns
|
|
78
|
+
*/
|
|
79
|
+
onFieldChange?: (rowIndex: number, fieldName: DataIndex, newValue: any) => void;
|
|
80
|
+
};
|
|
81
|
+
export type EditableGridExpose<RecordType = any, ModelType = RecordType[]> = Omit<EditableTableExpose<ModelType, RecordType>, 'scrollTo'> & {
|
|
82
|
+
scrollTo: (index: number | 'end') => void;
|
|
83
|
+
};
|
|
84
|
+
export type EditableGridFormItemExpose<RecordType = any, ModelType = RecordType[]> = Omit<EditableGridExpose<RecordType, ModelType>, 'resetFields' | 'validateFields'>;
|
|
85
|
+
export type EditableGridFormItemProps<RecordType = any> = Omit<EditableGridProps<RecordType>, 'name'> & {
|
|
86
|
+
label?: string;
|
|
87
|
+
/**
|
|
88
|
+
* FormItem的name
|
|
89
|
+
*/
|
|
90
|
+
name: NamePath;
|
|
91
|
+
/**
|
|
92
|
+
* 额外的表单项配置属性
|
|
93
|
+
*/
|
|
94
|
+
formItem?: Partial<Omit<ApFormItemProps, 'name' | 'label'>>;
|
|
95
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@aplus-frontend/ui/theme/ap-grid/editable.css';
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@aplus-frontend/ui/theme/ap-grid/editable.less';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ComputedRef, Ref } from 'vue';
|
|
2
|
+
import { EditableGridProps } from '../editable/interface';
|
|
3
|
+
import { ValueTypeRenderConfig } from '../../config-provider';
|
|
4
|
+
import { ApGridColumnType } from '../interface';
|
|
5
|
+
export declare const useGetEditableColumns: (props: EditableGridProps, extraValueTypes: Ref<Record<string, ValueTypeRenderConfig> | undefined>) => ComputedRef<ApGridColumnType[]>;
|
|
6
|
+
export default useGetEditableColumns;
|