@aplus-frontend/ui 6.37.0 → 6.39.0
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 +215 -218
- package/es/src/ag-grid/components/row/index.vue.d.ts +6 -0
- package/es/src/ag-grid/components/row/index.vue.mjs +4 -0
- package/es/src/ag-grid/components/row/index.vue2.mjs +14 -0
- package/es/src/ag-grid/editable/form-item.vue.mjs +10 -9
- package/es/src/ag-grid/editable/index.vue.mjs +17 -16
- package/es/src/ag-grid/hooks/use-columns-def.mjs +73 -71
- package/es/src/ag-grid/hooks/use-row-selection.d.ts +1 -1
- package/es/src/ag-grid/hooks/use-row-selection.mjs +81 -68
- package/es/src/ag-grid/index.vue.d.ts +2 -1
- package/es/src/ag-grid/index.vue.mjs +282 -257
- package/es/src/ag-grid/interface.d.ts +54 -3
- package/es/src/ap-action/group/index.vue.mjs +24 -21
- package/es/src/ap-action/item/index.vue2.mjs +28 -20
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +72 -71
- package/es/src/ap-table/interface.d.ts +6 -0
- package/es/src/business/ag-grid-modal/constants.d.ts +4 -0
- package/es/src/business/ag-grid-modal/constants.mjs +6 -0
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +33 -0
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +50 -0
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +3 -0
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.mjs +58 -0
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -0
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.mjs +122 -0
- package/es/src/business/ag-grid-modal/hooks/use-modal-title.d.ts +24 -0
- package/es/src/business/ag-grid-modal/hooks/use-modal-title.mjs +49 -0
- package/es/src/business/ag-grid-modal/index.d.ts +2 -0
- package/es/src/business/ag-grid-modal/index.mjs +6 -0
- package/es/src/business/ag-grid-modal/interface.d.ts +130 -0
- package/es/src/business/ag-grid-modal/modal-layout/index.vue.d.ts +43 -0
- package/es/src/business/ag-grid-modal/modal-layout/index.vue.mjs +4 -0
- package/es/src/business/ag-grid-modal/modal-layout/index.vue2.mjs +102 -0
- package/es/src/business/ag-grid-modal/style/css.js +1 -0
- package/es/src/business/ag-grid-modal/style/index.js +1 -0
- package/es/src/business/ag-grid-modal/utils.d.ts +52 -0
- package/es/src/business/ag-grid-modal/utils.mjs +72 -0
- package/es/src/business/ag-grid-modal/wrapper/index.vue.d.ts +23 -0
- package/es/src/business/ag-grid-modal/wrapper/index.vue.mjs +4 -0
- package/es/src/business/ag-grid-modal/wrapper/index.vue2.mjs +25 -0
- package/es/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +1 -0
- package/es/src/business/ap-table-modal/hooks/use-table-modal.d.ts +1 -0
- package/es/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +1 -0
- package/es/src/business/ap-table-modal/index.d.ts +3 -0
- package/es/src/business/ap-table-modal/table-modal.vue.d.ts +1 -0
- package/es/src/business/hooks/usePageListApTable.d.ts +1 -0
- package/es/src/business/index.d.ts +1 -0
- package/es/src/business/index.mjs +55 -54
- package/es/src/index.d.ts +0 -1
- package/es/src/index.mjs +280 -284
- package/es/src/path-map.mjs +3 -2
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/index.js +1 -1
- package/lib/src/ag-grid/components/row/index.vue.d.ts +6 -0
- package/lib/src/ag-grid/components/row/index.vue.js +1 -0
- package/lib/src/ag-grid/components/row/index.vue2.js +1 -0
- package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ag-grid/editable/index.vue.js +1 -1
- package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
- package/lib/src/ag-grid/hooks/use-row-selection.d.ts +1 -1
- package/lib/src/ag-grid/hooks/use-row-selection.js +1 -1
- package/lib/src/ag-grid/index.vue.d.ts +2 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +54 -3
- package/lib/src/ap-action/group/index.vue.js +1 -1
- package/lib/src/ap-action/item/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
- package/lib/src/ap-table/interface.d.ts +6 -0
- package/lib/src/business/ag-grid-modal/constants.d.ts +4 -0
- package/lib/src/business/ag-grid-modal/constants.js +1 -0
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +33 -0
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.js +1 -0
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +3 -0
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.js +1 -0
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -0
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.js +1 -0
- package/lib/src/business/ag-grid-modal/hooks/use-modal-title.d.ts +24 -0
- package/lib/src/business/ag-grid-modal/hooks/use-modal-title.js +1 -0
- package/lib/src/business/ag-grid-modal/index.d.ts +2 -0
- package/lib/src/business/ag-grid-modal/index.js +1 -0
- package/lib/src/business/ag-grid-modal/interface.d.ts +130 -0
- package/lib/src/business/ag-grid-modal/modal-layout/index.vue.d.ts +43 -0
- package/lib/src/business/ag-grid-modal/modal-layout/index.vue.js +1 -0
- package/lib/src/business/ag-grid-modal/modal-layout/index.vue2.js +1 -0
- package/lib/src/business/ag-grid-modal/style/css.cjs +1 -0
- package/lib/src/business/ag-grid-modal/style/index.cjs +1 -0
- package/lib/src/business/ag-grid-modal/utils.d.ts +52 -0
- package/lib/src/business/ag-grid-modal/utils.js +1 -0
- package/lib/src/business/ag-grid-modal/wrapper/index.vue.d.ts +23 -0
- package/lib/src/business/ag-grid-modal/wrapper/index.vue.js +1 -0
- package/lib/src/business/ag-grid-modal/wrapper/index.vue2.js +1 -0
- package/lib/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +1 -0
- package/lib/src/business/ap-table-modal/hooks/use-table-modal.d.ts +1 -0
- package/lib/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +1 -0
- package/lib/src/business/ap-table-modal/index.d.ts +3 -0
- package/lib/src/business/ap-table-modal/table-modal.vue.d.ts +1 -0
- package/lib/src/business/hooks/usePageListApTable.d.ts +1 -0
- package/lib/src/business/index.d.ts +1 -0
- package/lib/src/business/index.js +1 -1
- package/lib/src/index.d.ts +0 -1
- package/lib/src/index.js +1 -1
- package/lib/src/path-map.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
- package/theme/ag-grid/index.css +3 -0
- package/theme/ag-grid-modal/index.css +773 -0
- package/theme/ag-grid-modal/index.less +58 -0
- package/theme/ap-form/ap-form-item.css +3 -0
- package/theme/ap-form/ap-form-item.less +3 -0
- package/theme/ap-form/index.css +3 -0
- package/theme/ap-form/search-form.css +3 -0
- package/theme/ap-grid/index.css +3 -0
- package/theme/ap-table/ap-table.css +3 -0
- package/theme/ap-table-modal/index.css +3 -0
- package/theme/ap-upload/index.css +5 -0
- package/theme/ap-upload/multiple-file.css +5 -0
- package/theme/ap-upload/multiple-file.less +6 -0
- package/theme/editable-table/index.css +3 -0
- package/theme/index.css +54 -3
- package/theme/index.less +1 -1
- package/es/src/work-order-modal/createWorkOrder.d.ts +0 -3
- package/es/src/work-order-modal/createWorkOrder.mjs +0 -32
- package/es/src/work-order-modal/help-message.vue.d.ts +0 -3
- package/es/src/work-order-modal/help-message.vue.mjs +0 -4
- package/es/src/work-order-modal/help-message.vue2.mjs +0 -36
- package/es/src/work-order-modal/index.d.ts +0 -4
- package/es/src/work-order-modal/index.mjs +0 -8
- package/es/src/work-order-modal/interfaces.d.ts +0 -31
- package/es/src/work-order-modal/interfaces.mjs +0 -9
- package/es/src/work-order-modal/style/css.js +0 -4
- package/es/src/work-order-modal/style/index.js +0 -4
- package/es/src/work-order-modal/work-order-modal.vue.d.ts +0 -846
- package/es/src/work-order-modal/work-order-modal.vue.mjs +0 -192
- package/es/src/work-order-modal/work-order-modal.vue2.mjs +0 -4
- package/lib/src/work-order-modal/createWorkOrder.d.ts +0 -3
- package/lib/src/work-order-modal/createWorkOrder.js +0 -1
- package/lib/src/work-order-modal/help-message.vue.d.ts +0 -3
- package/lib/src/work-order-modal/help-message.vue.js +0 -1
- package/lib/src/work-order-modal/help-message.vue2.js +0 -1
- package/lib/src/work-order-modal/index.d.ts +0 -4
- package/lib/src/work-order-modal/index.js +0 -1
- package/lib/src/work-order-modal/interfaces.d.ts +0 -31
- package/lib/src/work-order-modal/interfaces.js +0 -1
- package/lib/src/work-order-modal/style/css.cjs +0 -4
- package/lib/src/work-order-modal/style/index.cjs +0 -4
- package/lib/src/work-order-modal/work-order-modal.vue.d.ts +0 -846
- package/lib/src/work-order-modal/work-order-modal.vue.js +0 -1
- package/lib/src/work-order-modal/work-order-modal.vue2.js +0 -1
- /package/es/src/{work-order-modal → business/ag-grid-modal}/style/css.d.ts +0 -0
- /package/es/src/{work-order-modal → business/ag-grid-modal}/style/index.d.ts +0 -0
- /package/lib/src/{work-order-modal → business/ag-grid-modal}/style/css.d.ts +0 -0
- /package/lib/src/{work-order-modal → business/ag-grid-modal}/style/index.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as A, useSlots as
|
|
1
|
+
import { defineComponent as A, useSlots as H, ref as w, onMounted as K, unref as a, watch as P, createElementBlock as G, openBlock as M, Fragment as O, createVNode as d, mergeProps as y, withCtx as g, createSlots as W, renderList as U, renderSlot as $, normalizeProps as q, guardReactiveProps as J } from "vue";
|
|
2
2
|
import { ApForm as h } from "../../ap-form/index.mjs";
|
|
3
3
|
import { cloneDeep as Q, isEqual as X, omit as C } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
@@ -41,7 +41,6 @@ const xe = /* @__PURE__ */ A({
|
|
|
41
41
|
type: Boolean
|
|
42
42
|
},
|
|
43
43
|
components: {},
|
|
44
|
-
customRow: {},
|
|
45
44
|
customHeaderRow: {},
|
|
46
45
|
direction: {},
|
|
47
46
|
expandFixed: {
|
|
@@ -97,6 +96,7 @@ const xe = /* @__PURE__ */ A({
|
|
|
97
96
|
rowHeight: {
|
|
98
97
|
default: 66
|
|
99
98
|
},
|
|
99
|
+
getRowHeight: {},
|
|
100
100
|
advanceRenderer: {
|
|
101
101
|
type: Boolean
|
|
102
102
|
},
|
|
@@ -115,6 +115,7 @@ const xe = /* @__PURE__ */ A({
|
|
|
115
115
|
type: Boolean
|
|
116
116
|
},
|
|
117
117
|
onUpdate: {},
|
|
118
|
+
customRow: {},
|
|
118
119
|
columns: {},
|
|
119
120
|
defaultValue: {},
|
|
120
121
|
onChange: {},
|
|
@@ -124,22 +125,22 @@ const xe = /* @__PURE__ */ A({
|
|
|
124
125
|
name: {},
|
|
125
126
|
formItem: {}
|
|
126
127
|
},
|
|
127
|
-
setup(
|
|
128
|
-
expose:
|
|
128
|
+
setup(R, {
|
|
129
|
+
expose: b
|
|
129
130
|
}) {
|
|
130
|
-
const B =
|
|
131
|
+
const B = H(), o = R, {
|
|
131
132
|
b: x
|
|
132
133
|
} = le("editable-aggrid"), r = w(), {
|
|
133
134
|
internalInstance: s,
|
|
134
135
|
model: v
|
|
135
136
|
} = ee(), i = ae(o.name);
|
|
136
137
|
let p;
|
|
137
|
-
|
|
138
|
+
K(() => {
|
|
138
139
|
const e = o.formItem?.initialValue ?? oe(a(v), o.name);
|
|
139
140
|
p = Q(e), u(e, "suffix");
|
|
140
141
|
});
|
|
141
142
|
const n = w([]), S = te(o.name);
|
|
142
|
-
|
|
143
|
+
P(() => S.value, (e) => {
|
|
143
144
|
X(e, n.value) || c(e ?? p);
|
|
144
145
|
}, {
|
|
145
146
|
deep: !0
|
|
@@ -174,7 +175,7 @@ const xe = /* @__PURE__ */ A({
|
|
|
174
175
|
const t = e === "end" ? n.value.length - 1 : e;
|
|
175
176
|
r.value?.scrollToRow(t);
|
|
176
177
|
}
|
|
177
|
-
return
|
|
178
|
+
return b({
|
|
178
179
|
add: F,
|
|
179
180
|
addMultiple: u,
|
|
180
181
|
remove: N,
|
|
@@ -185,7 +186,7 @@ const xe = /* @__PURE__ */ A({
|
|
|
185
186
|
clear: j,
|
|
186
187
|
setTableData: c,
|
|
187
188
|
scrollTo: L
|
|
188
|
-
}), (e, t) => (M(),
|
|
189
|
+
}), (e, t) => (M(), G(O, null, [d(a(h).FormItem, {
|
|
189
190
|
hidden: "",
|
|
190
191
|
name: e.name
|
|
191
192
|
}, null, 8, ["name"]), d(a(h).FormItem, y(a(C)(e.formItem, "initialValue"), {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as P, useSlots as G, ref as f, watch as O, unref as n, createBlock as U, openBlock as W, withCtx as d, createVNode as y, mergeProps as M, createSlots as $, renderList as q, renderSlot as J, normalizeProps as Q, guardReactiveProps as X } from "vue";
|
|
2
2
|
import { ApForm as u } from "../../ap-form/index.mjs";
|
|
3
3
|
import { isEqual as Y, isArray as w, omit as Z } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
@@ -11,7 +11,7 @@ import { useNamespace as ae } from "../../config-provider/hooks/use-namespace.mj
|
|
|
11
11
|
import { useControllableValue as te } from "../../hooks/useControllableValue.mjs";
|
|
12
12
|
import { useGlobalConfig as ne } from "../../config-provider/hooks/use-global-config.mjs";
|
|
13
13
|
import le from "../index.vue.mjs";
|
|
14
|
-
const
|
|
14
|
+
const Re = /* @__PURE__ */ P({
|
|
15
15
|
name: "EditableGrid",
|
|
16
16
|
__name: "index",
|
|
17
17
|
props: {
|
|
@@ -39,7 +39,6 @@ const be = /* @__PURE__ */ G({
|
|
|
39
39
|
type: Boolean
|
|
40
40
|
},
|
|
41
41
|
components: {},
|
|
42
|
-
customRow: {},
|
|
43
42
|
customHeaderRow: {},
|
|
44
43
|
direction: {},
|
|
45
44
|
expandFixed: {
|
|
@@ -95,6 +94,7 @@ const be = /* @__PURE__ */ G({
|
|
|
95
94
|
rowHeight: {
|
|
96
95
|
default: 66
|
|
97
96
|
},
|
|
97
|
+
getRowHeight: {},
|
|
98
98
|
advanceRenderer: {
|
|
99
99
|
type: Boolean
|
|
100
100
|
},
|
|
@@ -113,6 +113,7 @@ const be = /* @__PURE__ */ G({
|
|
|
113
113
|
type: Boolean
|
|
114
114
|
},
|
|
115
115
|
onUpdate: {},
|
|
116
|
+
customRow: {},
|
|
116
117
|
columns: {},
|
|
117
118
|
value: {},
|
|
118
119
|
defaultValue: {},
|
|
@@ -127,14 +128,14 @@ const be = /* @__PURE__ */ G({
|
|
|
127
128
|
emits: ["update:value"],
|
|
128
129
|
setup(g, {
|
|
129
130
|
expose: h,
|
|
130
|
-
emit:
|
|
131
|
+
emit: R
|
|
131
132
|
}) {
|
|
132
|
-
const
|
|
133
|
-
b:
|
|
134
|
-
} = ae("editable-aggrid"),
|
|
133
|
+
const b = G(), o = g, {
|
|
134
|
+
b: v
|
|
135
|
+
} = ae("editable-aggrid"), C = R, s = f(), {
|
|
135
136
|
value: r,
|
|
136
137
|
updateValue: m
|
|
137
|
-
} = te(o,
|
|
138
|
+
} = te(o, C), l = f(), x = u.useWatch(o.name, l);
|
|
138
139
|
O(r, (e) => {
|
|
139
140
|
const a = p(e, o.rowKey);
|
|
140
141
|
Y(a, n(x)) || l.value?.setFieldValue(o.name, a);
|
|
@@ -171,12 +172,12 @@ const be = /* @__PURE__ */ G({
|
|
|
171
172
|
async function z(e, a) {
|
|
172
173
|
return (await l.value?.validateFields(j(e), a))?.[o.name];
|
|
173
174
|
}
|
|
174
|
-
function
|
|
175
|
+
function H(e) {
|
|
175
176
|
m(e);
|
|
176
177
|
const a = p(e, o.rowKey);
|
|
177
178
|
l.value?.setFieldValue(o.name, a);
|
|
178
179
|
}
|
|
179
|
-
function
|
|
180
|
+
function I(e) {
|
|
180
181
|
const a = e === "end" ? r.value.length - 1 : e;
|
|
181
182
|
s.value?.scrollToRow(a);
|
|
182
183
|
}
|
|
@@ -191,8 +192,8 @@ const be = /* @__PURE__ */ G({
|
|
|
191
192
|
getRowsData: A,
|
|
192
193
|
setRowData: V,
|
|
193
194
|
clear: k,
|
|
194
|
-
setTableData:
|
|
195
|
-
scrollTo:
|
|
195
|
+
setTableData: H,
|
|
196
|
+
scrollTo: I
|
|
196
197
|
}), (e, a) => (W(), U(n(u), {
|
|
197
198
|
ref_key: "formRef",
|
|
198
199
|
ref: l,
|
|
@@ -210,7 +211,7 @@ const be = /* @__PURE__ */ G({
|
|
|
210
211
|
default: d(() => [y(le, M(n(Z)(o, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue"]), {
|
|
211
212
|
ref_key: "tableRef",
|
|
212
213
|
ref: s,
|
|
213
|
-
class: n(
|
|
214
|
+
class: n(v)(),
|
|
214
215
|
size: "mini",
|
|
215
216
|
columns: n(S),
|
|
216
217
|
"data-source": n(r),
|
|
@@ -218,9 +219,9 @@ const be = /* @__PURE__ */ G({
|
|
|
218
219
|
onUpdate: D
|
|
219
220
|
}), $({
|
|
220
221
|
_: 2
|
|
221
|
-
}, [q(
|
|
222
|
+
}, [q(b, (t, c) => ({
|
|
222
223
|
name: c,
|
|
223
|
-
fn: d((
|
|
224
|
+
fn: d((L) => [J(e.$slots, c, Q(X(L || {})))])
|
|
224
225
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
225
226
|
_: 3
|
|
226
227
|
}, 8, ["name"])]),
|
|
@@ -229,5 +230,5 @@ const be = /* @__PURE__ */ G({
|
|
|
229
230
|
}
|
|
230
231
|
});
|
|
231
232
|
export {
|
|
232
|
-
|
|
233
|
+
Re as default
|
|
233
234
|
};
|
|
@@ -1,100 +1,100 @@
|
|
|
1
|
-
import { getTableRenderProps as
|
|
2
|
-
import { rendererMap as
|
|
3
|
-
import { isNumber as f, isFunction as
|
|
4
|
-
import { ref as R, unref as
|
|
1
|
+
import { getTableRenderProps as h, objectToString as P } from "../../ap-table/utils.mjs";
|
|
2
|
+
import { rendererMap as y } from "../renderer/index.mjs";
|
|
3
|
+
import { isNumber as f, isFunction as m } from "lodash-unified";
|
|
4
|
+
import { ref as R, unref as x, computed as T } from "vue";
|
|
5
5
|
import "../components/body-cell/index.vue.mjs";
|
|
6
6
|
import "../components/header-cell/index.vue.mjs";
|
|
7
7
|
import "../components/tooltip/index.vue.mjs";
|
|
8
8
|
import "../../config-provider/index.mjs";
|
|
9
|
-
import { dataIndexToField as
|
|
10
|
-
import { isDef as
|
|
9
|
+
import { dataIndexToField as S } from "../../ap-grid/utils/col.mjs";
|
|
10
|
+
import { isDef as I } from "../../utils/index.mjs";
|
|
11
11
|
import { useGlobalConfig as _ } from "../../config-provider/hooks/use-global-config.mjs";
|
|
12
12
|
import { useNamespace as G } from "../../config-provider/hooks/use-namespace.mjs";
|
|
13
13
|
import W from "../components/body-cell/index.vue2.mjs";
|
|
14
14
|
import z from "../components/tooltip/index.vue2.mjs";
|
|
15
15
|
import v from "../components/header-cell/index.vue2.mjs";
|
|
16
|
-
function F(
|
|
17
|
-
return f(
|
|
16
|
+
function F(t) {
|
|
17
|
+
return f(t) && t > 1;
|
|
18
18
|
}
|
|
19
|
-
function M(
|
|
20
|
-
if (
|
|
21
|
-
return
|
|
22
|
-
if (
|
|
23
|
-
return
|
|
24
|
-
value:
|
|
25
|
-
record:
|
|
26
|
-
column:
|
|
27
|
-
text:
|
|
19
|
+
function M(t, a) {
|
|
20
|
+
if (a.bodyCellTooltip)
|
|
21
|
+
return m(a.bodyCellTooltip) ? a.bodyCellTooltip(t.value, t.data) : a.bodyCellTooltip;
|
|
22
|
+
if (a.renderText)
|
|
23
|
+
return a.renderText({
|
|
24
|
+
value: t.value,
|
|
25
|
+
record: t.data,
|
|
26
|
+
column: a,
|
|
27
|
+
text: t.value
|
|
28
28
|
});
|
|
29
|
-
const n =
|
|
29
|
+
const n = a.valueType || "text", d = y[n];
|
|
30
30
|
if (d) {
|
|
31
|
-
const p =
|
|
32
|
-
{ ...
|
|
31
|
+
const p = h(
|
|
32
|
+
{ ...a, valueType: n },
|
|
33
33
|
{
|
|
34
|
-
value:
|
|
35
|
-
text:
|
|
36
|
-
record:
|
|
37
|
-
column:
|
|
38
|
-
rowIndex:
|
|
39
|
-
pinned:
|
|
34
|
+
value: t.value,
|
|
35
|
+
text: t.value,
|
|
36
|
+
record: t.data,
|
|
37
|
+
column: t.column,
|
|
38
|
+
rowIndex: t.node?.rowIndex,
|
|
39
|
+
pinned: t.node?.rowPinned
|
|
40
40
|
}
|
|
41
41
|
);
|
|
42
42
|
return d(p);
|
|
43
43
|
}
|
|
44
|
-
return P(
|
|
44
|
+
return P(t.value);
|
|
45
45
|
}
|
|
46
|
-
const X = (
|
|
47
|
-
const d = _("valueTypeMap"), u = R(), { em: p } = G("ag-grid"),
|
|
48
|
-
const
|
|
46
|
+
const X = (t, a, n) => {
|
|
47
|
+
const d = _("valueTypeMap"), u = R(), { em: p } = G("ag-grid"), c = (r) => {
|
|
48
|
+
const o = {
|
|
49
49
|
cellRenderer: W,
|
|
50
50
|
cellRendererParams: {
|
|
51
|
-
column:
|
|
52
|
-
extraValueType:
|
|
51
|
+
column: r,
|
|
52
|
+
extraValueType: x(d)
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
-
if (
|
|
56
|
-
return
|
|
57
|
-
if (
|
|
55
|
+
if (r.customRender)
|
|
56
|
+
return o;
|
|
57
|
+
if (r.renderText)
|
|
58
58
|
return {
|
|
59
|
-
valueFormatter: (
|
|
60
|
-
value:
|
|
61
|
-
record:
|
|
62
|
-
column:
|
|
63
|
-
text:
|
|
59
|
+
valueFormatter: (i) => r.renderText({
|
|
60
|
+
value: i.value,
|
|
61
|
+
record: i.data,
|
|
62
|
+
column: r,
|
|
63
|
+
text: i.value
|
|
64
64
|
})
|
|
65
65
|
};
|
|
66
|
-
const
|
|
66
|
+
const l = r.valueType || "text", e = y[l];
|
|
67
67
|
return e ? {
|
|
68
|
-
valueFormatter: (
|
|
69
|
-
const s =
|
|
70
|
-
{ ...
|
|
68
|
+
valueFormatter: (i) => {
|
|
69
|
+
const s = h(
|
|
70
|
+
{ ...r, valueType: l },
|
|
71
71
|
{
|
|
72
|
-
value:
|
|
73
|
-
text:
|
|
74
|
-
record:
|
|
75
|
-
column:
|
|
76
|
-
rowIndex:
|
|
77
|
-
pinned:
|
|
72
|
+
value: i.value,
|
|
73
|
+
text: i.value,
|
|
74
|
+
record: i.data,
|
|
75
|
+
column: i.column,
|
|
76
|
+
rowIndex: i.node?.rowIndex,
|
|
77
|
+
pinned: i.node?.rowPinned
|
|
78
78
|
}
|
|
79
79
|
);
|
|
80
80
|
return e(s);
|
|
81
81
|
}
|
|
82
|
-
} :
|
|
83
|
-
}, b = (
|
|
84
|
-
const
|
|
85
|
-
return
|
|
86
|
-
"--ag-grid-line-clamp":
|
|
87
|
-
},
|
|
88
|
-
lineClamp:
|
|
82
|
+
} : o;
|
|
83
|
+
}, b = (r) => {
|
|
84
|
+
const o = {}, l = r.bodyCellTooltip || !r.customRender && (r.ellipsis === !0 || r.ellipsis === "tooltip" || f(r.ellipsis)), e = f(r.ellipsis) && r.ellipsis > 1, i = f(r.ellipsis) ? r.ellipsis : 1;
|
|
85
|
+
return o.tooltipValueGetter = l ? (s) => M(s, r) : void 0, o.wrapText = !r.ellipsis || e, o.cellStyle = {
|
|
86
|
+
"--ag-grid-line-clamp": i
|
|
87
|
+
}, o.tooltipComponent = z, o.tooltipComponentParams = {
|
|
88
|
+
lineClamp: i,
|
|
89
89
|
gridWrapperRef: u
|
|
90
|
-
},
|
|
90
|
+
}, o;
|
|
91
91
|
}, g = T(() => {
|
|
92
|
-
const
|
|
93
|
-
function
|
|
94
|
-
return
|
|
95
|
-
const
|
|
96
|
-
field:
|
|
97
|
-
colId:
|
|
92
|
+
const r = x(t);
|
|
93
|
+
function o(l) {
|
|
94
|
+
return l.map((e) => {
|
|
95
|
+
const i = {
|
|
96
|
+
field: S(e.dataIndex),
|
|
97
|
+
colId: I(e.key) ? String(e.key) : void 0,
|
|
98
98
|
sortable: !!e.sorter,
|
|
99
99
|
comparator: e.sorter === !0 ? () => 0 : e.sorter,
|
|
100
100
|
headerComponentParams: {
|
|
@@ -110,33 +110,35 @@ const X = (r, l, n) => {
|
|
|
110
110
|
// undefined to null
|
|
111
111
|
colSpan: e.colSpan,
|
|
112
112
|
cellClass: n((s) => {
|
|
113
|
-
const
|
|
113
|
+
const C = e.cellClass || "", D = m(C) ? C(s.data, s.node) : C;
|
|
114
114
|
return [
|
|
115
115
|
`${p("cell", e.align || "left")}`,
|
|
116
116
|
F(e.ellipsis) ? p("cell", "multiline") : null,
|
|
117
117
|
D
|
|
118
118
|
].flat().filter(Boolean);
|
|
119
119
|
}),
|
|
120
|
+
headerStyle: e.headerStyle,
|
|
121
|
+
headerClass: e.headerClass,
|
|
120
122
|
autoHeight: !0,
|
|
121
123
|
// 设置自动计算高度以自适应多行换行的场景
|
|
122
124
|
...b(e),
|
|
123
|
-
...
|
|
125
|
+
...c(e)
|
|
124
126
|
};
|
|
125
127
|
return e.children?.length ? {
|
|
126
|
-
...
|
|
128
|
+
...i,
|
|
127
129
|
headerGroupComponent: v,
|
|
128
130
|
headerGroupComponentParams: {
|
|
129
131
|
column: e
|
|
130
132
|
},
|
|
131
|
-
children:
|
|
132
|
-
} :
|
|
133
|
+
children: o(e.children)
|
|
134
|
+
} : i;
|
|
133
135
|
});
|
|
134
136
|
}
|
|
135
|
-
return
|
|
137
|
+
return o(r);
|
|
136
138
|
}), w = T(
|
|
137
139
|
() => ({
|
|
138
140
|
headerComponent: v,
|
|
139
|
-
resizable:
|
|
141
|
+
resizable: a.columnResizable,
|
|
140
142
|
suppressMovable: !0,
|
|
141
143
|
cellDataType: !1
|
|
142
144
|
})
|
|
@@ -74,5 +74,5 @@ type RowSelectionParams<T> = AgGridRowSelection<T> & {
|
|
|
74
74
|
*/
|
|
75
75
|
rowKey: ApTableProps['rowKey'];
|
|
76
76
|
};
|
|
77
|
-
declare const useGridRowSelection: <RecordType = Recordable>(props: RowSelectionParams<RecordType>) => RowSelectionReturnType<RecordType>;
|
|
77
|
+
declare const useGridRowSelection: <RecordType extends Recordable = Recordable>(props: RowSelectionParams<RecordType>) => RowSelectionReturnType<RecordType>;
|
|
78
78
|
export default useGridRowSelection;
|
|
@@ -1,98 +1,111 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { isFunction as
|
|
3
|
-
function
|
|
4
|
-
|
|
1
|
+
import { ref as E, computed as M, unref as o } from "vue";
|
|
2
|
+
import { isFunction as d } from "lodash-unified";
|
|
3
|
+
function I(n) {
|
|
4
|
+
const { rowKey: a, defaultSelectedRowKeys: c, defaultSelectedRows: u } = n;
|
|
5
|
+
return a ? c?.length ? d(a) ? [] : i(c, n.type).map(
|
|
6
|
+
(l) => ({ [a]: l })
|
|
7
|
+
) : u?.length ? i(u, n.type).filter(
|
|
8
|
+
(l) => {
|
|
9
|
+
const s = d(a) ? a(l) : a;
|
|
10
|
+
return s && (l[s] === 0 || l[s]);
|
|
11
|
+
}
|
|
12
|
+
) : [] : [];
|
|
13
|
+
}
|
|
14
|
+
function i(n, a) {
|
|
15
|
+
return n.length && a === "radio" ? [n[0]] : n;
|
|
5
16
|
}
|
|
6
|
-
const
|
|
7
|
-
const n =
|
|
8
|
-
D(c.rowKey, c.defaultSelectedRowKeys)
|
|
9
|
-
), u = (e) => r(c.rowKey) ? c.rowKey(e) : e[c.rowKey], a = i(() => {
|
|
17
|
+
const F = (n) => {
|
|
18
|
+
const a = n.type === "radio", c = E(I(n)), u = (e) => d(n.rowKey) ? n.rowKey(e) : e[n.rowKey], l = M(() => {
|
|
10
19
|
const e = /* @__PURE__ */ new Map();
|
|
11
|
-
return o(
|
|
20
|
+
return o(c).forEach((t) => {
|
|
12
21
|
e.set(u(t), t);
|
|
13
22
|
}), e;
|
|
14
23
|
});
|
|
15
|
-
function
|
|
16
|
-
return o(
|
|
24
|
+
function s(e) {
|
|
25
|
+
return o(l).has(u(e));
|
|
17
26
|
}
|
|
18
|
-
function
|
|
19
|
-
if (!
|
|
27
|
+
function S(e) {
|
|
28
|
+
if (!f(e))
|
|
20
29
|
return;
|
|
21
|
-
const t = o(
|
|
22
|
-
t.set(u(e), e),
|
|
30
|
+
const t = o(l);
|
|
31
|
+
a && t.clear(), t.set(u(e), e), c.value = [...t.values()];
|
|
23
32
|
}
|
|
24
|
-
function
|
|
25
|
-
const t = o(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
33
|
+
function g(e) {
|
|
34
|
+
const t = o(l);
|
|
35
|
+
a && t.clear();
|
|
36
|
+
for (const r of i(e, n.type))
|
|
37
|
+
f(r) && t.set(u(r), r);
|
|
38
|
+
c.value = [...t.values()];
|
|
29
39
|
}
|
|
30
|
-
function
|
|
31
|
-
if (
|
|
40
|
+
function K(e) {
|
|
41
|
+
if (d(n.rowKey))
|
|
32
42
|
return;
|
|
33
|
-
const t = o(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
43
|
+
const t = o(l);
|
|
44
|
+
a && t.clear();
|
|
45
|
+
for (const r of i(e, n.type)) {
|
|
46
|
+
const v = o(n.dataSource).find(
|
|
47
|
+
(D) => u(D) === r
|
|
48
|
+
), w = { [n.rowKey]: r };
|
|
49
|
+
f(v || w) && t.set(r, v || w);
|
|
39
50
|
}
|
|
40
|
-
|
|
51
|
+
c.value = [...t.values()];
|
|
41
52
|
}
|
|
42
53
|
function y(e) {
|
|
43
|
-
if (!
|
|
54
|
+
if (!f(e))
|
|
44
55
|
return;
|
|
45
|
-
const t = o(
|
|
46
|
-
t.delete(u(e)),
|
|
56
|
+
const t = o(l);
|
|
57
|
+
t.delete(u(e)), c.value = [...t.values()];
|
|
47
58
|
}
|
|
48
|
-
function
|
|
49
|
-
const t = o(
|
|
50
|
-
for (const
|
|
51
|
-
|
|
52
|
-
|
|
59
|
+
function R(e) {
|
|
60
|
+
const t = o(l);
|
|
61
|
+
for (const r of i(e, n.type))
|
|
62
|
+
f(r) && t.delete(u(r));
|
|
63
|
+
c.value = [...t.values()];
|
|
53
64
|
}
|
|
54
|
-
function
|
|
55
|
-
const t =
|
|
65
|
+
function f(e) {
|
|
66
|
+
const t = n.disabled;
|
|
56
67
|
return !(t ? t(e) : !1);
|
|
57
68
|
}
|
|
58
|
-
function
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
69
|
+
function x() {
|
|
70
|
+
if (a)
|
|
71
|
+
return;
|
|
72
|
+
const e = o(l);
|
|
73
|
+
o(n.dataSource).forEach((t) => {
|
|
74
|
+
f(t) && e.set(u(t), t);
|
|
75
|
+
}), c.value = [...e.values()];
|
|
63
76
|
}
|
|
64
|
-
function
|
|
65
|
-
if (!
|
|
77
|
+
function h(e) {
|
|
78
|
+
if (!f(e))
|
|
66
79
|
return;
|
|
67
|
-
const t = o(
|
|
68
|
-
t.has(
|
|
80
|
+
const t = o(l), r = u(e);
|
|
81
|
+
t.has(r) ? y(e) : S(e);
|
|
69
82
|
}
|
|
70
|
-
function
|
|
71
|
-
const e = o(
|
|
72
|
-
o(
|
|
73
|
-
|
|
74
|
-
}),
|
|
83
|
+
function b() {
|
|
84
|
+
const e = o(l);
|
|
85
|
+
o(n.dataSource).forEach((t) => {
|
|
86
|
+
f(t) && e.delete(u(t));
|
|
87
|
+
}), c.value = [...e.values()];
|
|
75
88
|
}
|
|
76
|
-
function
|
|
77
|
-
|
|
89
|
+
function A() {
|
|
90
|
+
c.value = [];
|
|
78
91
|
}
|
|
79
92
|
return {
|
|
80
|
-
select:
|
|
93
|
+
select: S,
|
|
81
94
|
unSelect: y,
|
|
82
|
-
isSelected:
|
|
83
|
-
selectAll:
|
|
84
|
-
unSelectAll:
|
|
85
|
-
clearAll:
|
|
86
|
-
toggleSelect:
|
|
87
|
-
selectedRows:
|
|
88
|
-
selectedRowKeys:
|
|
89
|
-
() => o(
|
|
95
|
+
isSelected: s,
|
|
96
|
+
selectAll: x,
|
|
97
|
+
unSelectAll: b,
|
|
98
|
+
clearAll: A,
|
|
99
|
+
toggleSelect: h,
|
|
100
|
+
selectedRows: c,
|
|
101
|
+
selectedRowKeys: M(
|
|
102
|
+
() => o(c).map((e) => u(e))
|
|
90
103
|
),
|
|
91
|
-
selectMulti:
|
|
92
|
-
unSelectMulti:
|
|
93
|
-
selectMultiByKeys:
|
|
104
|
+
selectMulti: g,
|
|
105
|
+
unSelectMulti: R,
|
|
106
|
+
selectMultiByKeys: K
|
|
94
107
|
};
|
|
95
108
|
};
|
|
96
109
|
export {
|
|
97
|
-
|
|
110
|
+
F as default
|
|
98
111
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AgGridExpose, AgGridProps, AgGridSlots } from './interface';
|
|
2
|
+
import { Recordable } from '../type';
|
|
2
3
|
import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } from 'vue';
|
|
3
|
-
declare const _default: <RecordType>(__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<{
|
|
4
|
+
declare const _default: <RecordType extends Recordable>(__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<{
|
|
4
5
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, never> & AgGridProps<RecordType> & Partial<{}>> & PublicProps;
|
|
5
6
|
expose(exposed: ShallowUnwrapRef<AgGridExpose>): void;
|
|
6
7
|
attrs: any;
|