@aplus-frontend/ui 7.20.0 → 7.20.2
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/src/ag-grid/components/tooltip/index.vue2.mjs +9 -9
- package/es/src/ag-grid/hooks/use-columns-def.mjs +74 -65
- package/es/src/ap-field/select/index.vue.mjs +125 -122
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +33 -33
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/components/tooltip/index.vue2.js +1 -1
- package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -3
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as m, ref as u, onMounted as d, unref as l, withDirectives as f, openBlock as v, createElementBlock as g, normalizeClass as h, toDisplayString as w, vShow as _ } from "vue";
|
|
2
2
|
import "../../../config-provider/index.mjs";
|
|
3
3
|
import { useNamespace as x } from "../../../config-provider/hooks/use-namespace.mjs";
|
|
4
|
-
const k = /* @__PURE__ */
|
|
4
|
+
const k = /* @__PURE__ */ m({
|
|
5
5
|
__name: "index",
|
|
6
6
|
props: {
|
|
7
7
|
params: {}
|
|
8
8
|
},
|
|
9
|
-
setup(
|
|
10
|
-
const
|
|
11
|
-
return
|
|
12
|
-
const { rowIndex: o, column: t, gridWrapperRef:
|
|
9
|
+
setup(n) {
|
|
10
|
+
const i = n, e = u(!1), { e: s } = x("ag-grid");
|
|
11
|
+
return d(() => {
|
|
12
|
+
const { rowIndex: o, column: t, gridWrapperRef: c, lineClamp: p } = i.params, r = l(c)?.querySelector(
|
|
13
13
|
`div.ag-row[row-index="${o}"] .ag-cell[col-id="${t.colId}"] span.ag-cell-value`
|
|
14
14
|
);
|
|
15
15
|
if (!r) {
|
|
16
16
|
e.value = !0;
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
-
const a =
|
|
19
|
+
const a = p === 1 ? "Width" : "Height";
|
|
20
20
|
e.value = r[`scroll${a}`] > r[`client${a}`];
|
|
21
|
-
}), (o, t) =>
|
|
22
|
-
class:
|
|
21
|
+
}), (o, t) => f((v(), g("div", {
|
|
22
|
+
class: h(l(s)("tooltip"))
|
|
23
23
|
}, w(o.params.value), 3)), [
|
|
24
24
|
[_, e.value]
|
|
25
25
|
]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isNumber as u, isFunction as
|
|
2
|
-
import { ref as D, unref as
|
|
1
|
+
import { isNumber as u, isFunction as C } from "lodash-unified";
|
|
2
|
+
import { ref as D, unref as h, computed as c } from "vue";
|
|
3
3
|
import { dataIndexToField as P } from "../../ap-grid/utils/col.mjs";
|
|
4
4
|
import { getTableRenderProps as m, objectToString as G } from "../../ap-table/utils.mjs";
|
|
5
5
|
import "../../config-provider/index.mjs";
|
|
@@ -7,30 +7,36 @@ import "../../utils/index.mjs";
|
|
|
7
7
|
import "../components/body-cell/index.vue.mjs";
|
|
8
8
|
import "../components/header-cell/index.vue.mjs";
|
|
9
9
|
import "../components/tooltip/index.vue.mjs";
|
|
10
|
-
import { rendererMap as
|
|
10
|
+
import { rendererMap as x } from "../renderer/index.mjs";
|
|
11
11
|
import { useGlobalConfig as I } from "../../config-provider/hooks/use-global-config.mjs";
|
|
12
12
|
import { useNamespace as _ } 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 { isDef as F } from "../../utils/is.mjs";
|
|
16
|
-
import
|
|
16
|
+
import b from "../components/header-cell/index.vue2.mjs";
|
|
17
17
|
function M(t) {
|
|
18
18
|
return u(t) && t > 1;
|
|
19
19
|
}
|
|
20
|
-
function V(t,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
function V(t, o) {
|
|
21
|
+
return (a) => ({
|
|
22
|
+
...C(o) ? o(a) : o ?? {},
|
|
23
|
+
...t
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function j(t, o) {
|
|
27
|
+
if (o.bodyCellTooltip)
|
|
28
|
+
return C(o.bodyCellTooltip) ? o.bodyCellTooltip(t.value, t.data) : o.bodyCellTooltip;
|
|
29
|
+
if (o.renderText)
|
|
30
|
+
return o.renderText({
|
|
25
31
|
value: t.value,
|
|
26
32
|
record: t.data,
|
|
27
|
-
column:
|
|
33
|
+
column: o,
|
|
28
34
|
text: t.value
|
|
29
35
|
});
|
|
30
|
-
const
|
|
31
|
-
if (
|
|
36
|
+
const a = o.valueType || "text", s = x[a];
|
|
37
|
+
if (s) {
|
|
32
38
|
const f = m(
|
|
33
|
-
{ ...
|
|
39
|
+
{ ...o, valueType: a },
|
|
34
40
|
{
|
|
35
41
|
value: t.value,
|
|
36
42
|
text: t.value,
|
|
@@ -40,68 +46,71 @@ function V(t, i) {
|
|
|
40
46
|
pinned: t.node?.rowPinned
|
|
41
47
|
}
|
|
42
48
|
);
|
|
43
|
-
return
|
|
49
|
+
return s(f);
|
|
44
50
|
}
|
|
45
51
|
return G(t.value);
|
|
46
52
|
}
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
const
|
|
53
|
+
const ee = (t, o, a, s) => {
|
|
54
|
+
const T = I("valueTypeMap"), f = D(), { em: v } = _("ag-grid"), w = (r) => {
|
|
55
|
+
const i = {
|
|
50
56
|
cellRenderer: W,
|
|
51
57
|
cellRendererParams: {
|
|
52
58
|
column: r,
|
|
53
|
-
extraValueType:
|
|
54
|
-
rowKey:
|
|
59
|
+
extraValueType: h(T),
|
|
60
|
+
rowKey: o.rowKey
|
|
55
61
|
}
|
|
56
62
|
};
|
|
57
63
|
if (r.customRender)
|
|
58
|
-
return
|
|
64
|
+
return i;
|
|
59
65
|
if (r.renderText)
|
|
60
66
|
return {
|
|
61
|
-
valueFormatter: (
|
|
62
|
-
value:
|
|
63
|
-
record:
|
|
67
|
+
valueFormatter: (l) => r.renderText({
|
|
68
|
+
value: l.value,
|
|
69
|
+
record: l.data,
|
|
64
70
|
column: r,
|
|
65
|
-
text:
|
|
71
|
+
text: l.value
|
|
66
72
|
})
|
|
67
73
|
};
|
|
68
|
-
const
|
|
74
|
+
const n = r.valueType || "text", e = x[n];
|
|
69
75
|
return e ? {
|
|
70
|
-
valueFormatter: (
|
|
71
|
-
const
|
|
72
|
-
{ ...r, valueType:
|
|
76
|
+
valueFormatter: (l) => {
|
|
77
|
+
const d = m(
|
|
78
|
+
{ ...r, valueType: n },
|
|
73
79
|
{
|
|
74
|
-
value:
|
|
75
|
-
text:
|
|
76
|
-
record:
|
|
77
|
-
column:
|
|
78
|
-
rowIndex:
|
|
79
|
-
pinned:
|
|
80
|
+
value: l.value,
|
|
81
|
+
text: l.value,
|
|
82
|
+
record: l.data,
|
|
83
|
+
column: l.column,
|
|
84
|
+
rowIndex: l.node?.rowIndex,
|
|
85
|
+
pinned: l.node?.rowPinned
|
|
80
86
|
}
|
|
81
87
|
);
|
|
82
|
-
return e(
|
|
88
|
+
return e(d);
|
|
83
89
|
}
|
|
84
|
-
} :
|
|
85
|
-
},
|
|
86
|
-
const
|
|
87
|
-
return e.tooltipValueGetter =
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
90
|
+
} : i;
|
|
91
|
+
}, S = (r) => {
|
|
92
|
+
const i = r.valueType || "text", n = x[i], e = {}, l = r.bodyCellTooltip || !r.customRender && n && (r.ellipsis === !0 || r.ellipsis === "tooltip" || u(r.ellipsis)), d = u(r.ellipsis) && r.ellipsis > 1, p = u(r.ellipsis) ? r.ellipsis : 1;
|
|
93
|
+
return e.tooltipValueGetter = l ? (y) => j(y, r) : void 0, e.wrapText = !r.ellipsis || d, e.cellStyle = V(
|
|
94
|
+
{
|
|
95
|
+
"--ag-grid-line-clamp": p
|
|
96
|
+
},
|
|
97
|
+
r.cellStyle
|
|
98
|
+
), e.tooltipComponent = z, e.tooltipComponentParams = {
|
|
99
|
+
lineClamp: p,
|
|
91
100
|
gridWrapperRef: f
|
|
92
101
|
}, e;
|
|
93
|
-
},
|
|
94
|
-
const r =
|
|
95
|
-
function
|
|
96
|
-
return
|
|
97
|
-
const
|
|
102
|
+
}, g = c(() => {
|
|
103
|
+
const r = h(t);
|
|
104
|
+
function i(n) {
|
|
105
|
+
return n.map((e) => {
|
|
106
|
+
const l = {
|
|
98
107
|
field: P(e.dataIndex),
|
|
99
108
|
colId: F(e.key) ? String(e.key) : void 0,
|
|
100
109
|
sortable: !!e.sorter,
|
|
101
110
|
comparator: e.sorter === !0 ? () => 0 : e.sorter,
|
|
102
111
|
headerComponentParams: {
|
|
103
112
|
column: e,
|
|
104
|
-
headerCell:
|
|
113
|
+
headerCell: s
|
|
105
114
|
},
|
|
106
115
|
resizable: e.resizable,
|
|
107
116
|
width: e.width,
|
|
@@ -115,12 +124,12 @@ const Z = (t, i, p, d) => {
|
|
|
115
124
|
// undefined to null
|
|
116
125
|
colSpan: e.colSpan,
|
|
117
126
|
spanRows: e.spanRows,
|
|
118
|
-
cellClass:
|
|
119
|
-
const
|
|
127
|
+
cellClass: a((d) => {
|
|
128
|
+
const p = e.cellClass || "", y = C(p) ? p(d.data, d.node) : p;
|
|
120
129
|
return [
|
|
121
|
-
`${
|
|
122
|
-
M(e.ellipsis) ?
|
|
123
|
-
|
|
130
|
+
`${v("cell", e.align || "left")}`,
|
|
131
|
+
M(e.ellipsis) ? v("cell", "multiline") : null,
|
|
132
|
+
y
|
|
124
133
|
].flat().filter(Boolean);
|
|
125
134
|
}),
|
|
126
135
|
cellStyle: e.cellStyle,
|
|
@@ -129,35 +138,35 @@ const Z = (t, i, p, d) => {
|
|
|
129
138
|
columnGroupShow: e.columnGroupShow,
|
|
130
139
|
autoHeight: !0,
|
|
131
140
|
// 设置自动计算高度以自适应多行换行的场景
|
|
132
|
-
...
|
|
141
|
+
...S(e),
|
|
133
142
|
...w(e)
|
|
134
143
|
};
|
|
135
144
|
return e.children?.length ? {
|
|
136
|
-
...
|
|
137
|
-
headerGroupComponent:
|
|
145
|
+
...l,
|
|
146
|
+
headerGroupComponent: b,
|
|
138
147
|
headerGroupComponentParams: {
|
|
139
148
|
column: e,
|
|
140
|
-
headerCell:
|
|
149
|
+
headerCell: s
|
|
141
150
|
},
|
|
142
|
-
children:
|
|
143
|
-
} :
|
|
151
|
+
children: i(e.children)
|
|
152
|
+
} : l;
|
|
144
153
|
});
|
|
145
154
|
}
|
|
146
|
-
return
|
|
147
|
-
}), R =
|
|
155
|
+
return i(r);
|
|
156
|
+
}), R = c(
|
|
148
157
|
() => ({
|
|
149
|
-
headerComponent:
|
|
150
|
-
resizable:
|
|
158
|
+
headerComponent: b,
|
|
159
|
+
resizable: o.columnResizable,
|
|
151
160
|
suppressMovable: !0,
|
|
152
161
|
cellDataType: !1
|
|
153
162
|
})
|
|
154
163
|
);
|
|
155
164
|
return {
|
|
156
|
-
columnDefs:
|
|
165
|
+
columnDefs: g,
|
|
157
166
|
defaultColDef: R,
|
|
158
167
|
gridWrapperRef: f
|
|
159
168
|
};
|
|
160
169
|
};
|
|
161
170
|
export {
|
|
162
|
-
|
|
171
|
+
ee as useColumnsDef
|
|
163
172
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Select as
|
|
3
|
-
import { debounce as
|
|
1
|
+
import { defineComponent as Se, useSlots as xe, ref as N, shallowRef as Ve, computed as s, onMounted as ke, watch as Be, unref as l, createVNode as v, createElementBlock as T, createBlock as F, openBlock as y, toDisplayString as I, mergeProps as Ne, h as Ie, createSlots as Ae, withCtx as g, createElementVNode as A, normalizeClass as C, createCommentVNode as R, resolveDynamicComponent as z, withModifiers as _e, renderList as De, renderSlot as Me, normalizeProps as Le, guardReactiveProps as Pe } from "vue";
|
|
2
|
+
import { Form as qe, Select as Te, Flex as E, Checkbox as U, Spin as Re } from "@aplus-frontend/antdv";
|
|
3
|
+
import { debounce as ze, isFunction as j, isNil as K, isArray as $, omit as H, isNumber as Ee } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import "../../utils/index.mjs";
|
|
6
|
-
import { useDevWarning as
|
|
6
|
+
import { useDevWarning as Ue } from "../../utils/warning.mjs";
|
|
7
7
|
import "../../hooks/index.mjs";
|
|
8
|
-
import { useDefaultPlaceholder as
|
|
9
|
-
import
|
|
10
|
-
import { useSelectOptions as
|
|
8
|
+
import { useDefaultPlaceholder as je } from "../hooks/use-default-placeholder.mjs";
|
|
9
|
+
import Ke from "../style/index.mjs";
|
|
10
|
+
import { useSelectOptions as $e } from "./use-select-options.mjs";
|
|
11
11
|
import { isDef as _ } from "../../utils/is.mjs";
|
|
12
12
|
import { useNamespace as W } from "../../config-provider/hooks/use-namespace.mjs";
|
|
13
|
-
import { useLocale as
|
|
14
|
-
import { useControllableValue as
|
|
15
|
-
const
|
|
13
|
+
import { useLocale as He } from "../../config-provider/hooks/use-locale.mjs";
|
|
14
|
+
import { useControllableValue as We } from "../../hooks/useControllableValue.mjs";
|
|
15
|
+
const Ge = {
|
|
16
16
|
key: 0
|
|
17
|
-
},
|
|
17
|
+
}, Je = ["onClick"], ct = /* @__PURE__ */ Se({
|
|
18
18
|
name: "ApFieldSelect",
|
|
19
19
|
__name: "index",
|
|
20
20
|
props: {
|
|
@@ -186,232 +186,235 @@ const je = {
|
|
|
186
186
|
emit: Q
|
|
187
187
|
}) {
|
|
188
188
|
let i = 0;
|
|
189
|
-
const
|
|
189
|
+
const O = xe(), t = G, {
|
|
190
190
|
deprecated: X
|
|
191
|
-
} =
|
|
191
|
+
} = Ue("ApFieldSelect");
|
|
192
192
|
X(!_(t.refetchOnFocus), "refetchOnFocus", "fetchOnFocus");
|
|
193
193
|
const {
|
|
194
|
-
b:
|
|
194
|
+
b: S
|
|
195
195
|
} = W("field-select"), {
|
|
196
196
|
b: f
|
|
197
|
-
} = W("field-select-popup-option"), Y =
|
|
197
|
+
} = W("field-select-popup-option"), Y = Ke("field"), Z = qe.useInjectFormItemContext(), D = N(!1), M = N(!1), {
|
|
198
198
|
t: L
|
|
199
|
-
} =
|
|
200
|
-
if (!
|
|
199
|
+
} = He(), ee = ze((e) => {
|
|
200
|
+
if (!j(t.request))
|
|
201
201
|
return;
|
|
202
202
|
i += 1;
|
|
203
203
|
const n = i;
|
|
204
|
-
w([]), r.value = !0, t.request(e).then((
|
|
205
|
-
i === n && (w(
|
|
204
|
+
w([]), r.value = !0, t.request(e).then((o) => {
|
|
205
|
+
i === n && (w(o), r.value = !1);
|
|
206
206
|
});
|
|
207
|
-
}, t.searchDelay),
|
|
208
|
-
const
|
|
209
|
-
return typeof n?.[
|
|
207
|
+
}, t.searchDelay), te = (e, n) => {
|
|
208
|
+
const o = t.fieldNames?.label || "label";
|
|
209
|
+
return typeof n?.[o] == "string" && n[o].toLowerCase().indexOf(e.toLowerCase()) > -1;
|
|
210
210
|
}, {
|
|
211
211
|
options: c,
|
|
212
212
|
updateOptions: w
|
|
213
|
-
} =
|
|
213
|
+
} = $e(t), x = Ve(), r = N(t?.loading || !1), ne = Q, oe = s(() => t.fetchOnFocus ?? t.refetchOnFocus), le = s(() => {
|
|
214
214
|
if (t.multiple)
|
|
215
215
|
return t.tokenSeparators ? "tags" : "multiple";
|
|
216
216
|
});
|
|
217
217
|
async function d(e = !0) {
|
|
218
|
-
if (!
|
|
218
|
+
if (!j(t.request))
|
|
219
219
|
return;
|
|
220
220
|
r.value = !0, i += 1;
|
|
221
221
|
const n = i;
|
|
222
222
|
try {
|
|
223
223
|
e && w([]);
|
|
224
|
-
const
|
|
224
|
+
const o = await t.request(void 0, t.params);
|
|
225
225
|
if (n !== i)
|
|
226
226
|
return;
|
|
227
|
-
w(
|
|
227
|
+
w(o);
|
|
228
228
|
} finally {
|
|
229
229
|
r.value = !1;
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
|
-
function oe(e) {
|
|
233
|
-
!D.value && i === 0 && t.lazy === "first-focus" ? d() : ne.value && !r.value && d(!0), t.onFocus?.(e), D.value = !0;
|
|
234
|
-
}
|
|
235
232
|
function ae(e) {
|
|
233
|
+
!D.value && i === 0 && t.lazy === "first-focus" ? d() : oe.value && !r.value && d(!0), t.onFocus?.(e), D.value = !0;
|
|
234
|
+
}
|
|
235
|
+
function ue(e) {
|
|
236
236
|
if (!e) {
|
|
237
237
|
t.onDropdownVisibleChange?.(e);
|
|
238
238
|
return;
|
|
239
239
|
}
|
|
240
240
|
!M.value && i === 0 && t.lazy === "first-open" ? d() : t.fetchOnOpen && !r.value && d(!0), t.onDropdownVisibleChange?.(e), M.value = !0;
|
|
241
241
|
}
|
|
242
|
-
|
|
242
|
+
function V(e) {
|
|
243
|
+
se(e), Z?.onFieldChange();
|
|
244
|
+
}
|
|
245
|
+
ke(() => {
|
|
243
246
|
if (!t.lazy) {
|
|
244
247
|
d();
|
|
245
248
|
return;
|
|
246
249
|
}
|
|
247
|
-
}),
|
|
250
|
+
}), Be(() => t.params, () => {
|
|
248
251
|
d();
|
|
249
252
|
}, {
|
|
250
253
|
deep: !0
|
|
251
254
|
});
|
|
252
255
|
const {
|
|
253
256
|
value: p,
|
|
254
|
-
updateValue:
|
|
255
|
-
} =
|
|
256
|
-
const e =
|
|
257
|
-
if (
|
|
257
|
+
updateValue: se
|
|
258
|
+
} = We(t, ne), re = je("Select", t), ie = s(() => {
|
|
259
|
+
const e = l(p);
|
|
260
|
+
if (K(e))
|
|
258
261
|
return t.emptyText;
|
|
259
|
-
const n = t.fieldNames?.label || "label",
|
|
260
|
-
return
|
|
261
|
-
}),
|
|
262
|
+
const n = t.fieldNames?.label || "label", o = t.fieldNames?.value || "value";
|
|
263
|
+
return $(e) ? e.map((a) => l(c).find((h) => h[o] === a)?.[n]).filter(Boolean).join("、") || t.emptyText : l(c).find((a) => a[o] === e)?.[n] || t.emptyText;
|
|
264
|
+
}), ce = s(() => {
|
|
262
265
|
const e = !!t?.showSearch, n = t.searchMode;
|
|
263
|
-
let
|
|
264
|
-
return e && (
|
|
266
|
+
let o = {};
|
|
267
|
+
return e && (o = n === "request" ? {
|
|
265
268
|
defaultActiveFirstOption: !1,
|
|
266
|
-
onSearch:
|
|
269
|
+
onSearch: ee,
|
|
267
270
|
notFoundContent: r.value ? void 0 : null,
|
|
268
271
|
filterOption: !1,
|
|
269
272
|
suffixIcon: null
|
|
270
273
|
} : {
|
|
271
|
-
filterOption:
|
|
274
|
+
filterOption: K(t?.filterOption) ? te : t?.filterOption
|
|
272
275
|
}), {
|
|
273
276
|
...H(t, ["mode", "value", "onUpdate:value", "onSearch", "request", "searchMode", "onFocus", "onBeforeSelect", "onDropdownVisibleChange"]),
|
|
274
|
-
placeholder:
|
|
275
|
-
...
|
|
277
|
+
placeholder: l(re),
|
|
278
|
+
...o
|
|
276
279
|
};
|
|
277
|
-
}),
|
|
278
|
-
function
|
|
279
|
-
|
|
280
|
+
}), de = s(() => c.value.map((e) => e[t.fieldNames?.value || "value"])), k = s(() => c.value.filter((e) => !e.disabled).map((e) => e[t.fieldNames?.value || "value"])), P = s(() => !t.multiple || _(t.maxCount) ? !1 : Ee(t.addAll) ? de.value.length >= t.addAll : !!t.addAll), fe = s(() => t.multiple && t.allowOnlySelect && (!_(t.maxCount) || t.maxCount >= 1));
|
|
281
|
+
function pe() {
|
|
282
|
+
x.value?.focus();
|
|
280
283
|
}
|
|
281
|
-
function
|
|
282
|
-
|
|
284
|
+
function me() {
|
|
285
|
+
x.value?.blur();
|
|
283
286
|
}
|
|
284
287
|
function m(e, n) {
|
|
285
|
-
const
|
|
286
|
-
return
|
|
288
|
+
const o = t.fieldNames?.[n] ?? n;
|
|
289
|
+
return o === "groupLabel" ? e[o] ?? e.label : e[o];
|
|
287
290
|
}
|
|
288
|
-
function
|
|
291
|
+
function he(e) {
|
|
289
292
|
const n = q(e);
|
|
290
|
-
|
|
293
|
+
V(t.multiple ? [n] : n), t.onChange?.([n], [e]);
|
|
291
294
|
}
|
|
292
|
-
function
|
|
293
|
-
return
|
|
295
|
+
function ve(e) {
|
|
296
|
+
return O.option ? v("div", {
|
|
294
297
|
class: f("custom")
|
|
295
|
-
}, [
|
|
298
|
+
}, [O.option(e)]) : v("span", {
|
|
296
299
|
class: f("label")
|
|
297
300
|
}, [m(e, e.options?.length ? "groupLabel" : "label")]);
|
|
298
301
|
}
|
|
299
|
-
const
|
|
300
|
-
const e =
|
|
301
|
-
return n.length > 0 && n.every((
|
|
302
|
-
}),
|
|
303
|
-
const e =
|
|
304
|
-
return
|
|
302
|
+
const ye = s(() => {
|
|
303
|
+
const e = l(p) || [], n = k.value;
|
|
304
|
+
return n.length > 0 && n.every((o) => b(e, o));
|
|
305
|
+
}), ge = s(() => {
|
|
306
|
+
const e = l(p) || [], n = k.value, o = n.filter((u) => b(e, u)).length;
|
|
307
|
+
return o > 0 && o < n.length;
|
|
305
308
|
});
|
|
306
309
|
function B(e, n) {
|
|
307
310
|
return (e.value ?? e) === n;
|
|
308
311
|
}
|
|
309
|
-
const
|
|
310
|
-
const n =
|
|
311
|
-
return
|
|
312
|
+
const Ce = (e) => {
|
|
313
|
+
const n = l(p), o = m(e, "value");
|
|
314
|
+
return $(n) ? !!n.find((u) => B(u, o)) : !1;
|
|
312
315
|
};
|
|
313
|
-
function
|
|
314
|
-
return e.find((
|
|
316
|
+
function b(e, n) {
|
|
317
|
+
return e.find((o) => B(o, n)) != null;
|
|
315
318
|
}
|
|
316
|
-
function
|
|
317
|
-
return e.findIndex((
|
|
319
|
+
function be(e, n) {
|
|
320
|
+
return e.findIndex((o) => B(o, n));
|
|
318
321
|
}
|
|
319
322
|
function q(e, n) {
|
|
320
|
-
const
|
|
323
|
+
const o = m(e, "label"), u = n ?? m(e, "value");
|
|
321
324
|
return t.labelInValue ? {
|
|
322
|
-
label: typeof
|
|
323
|
-
originLabel:
|
|
325
|
+
label: typeof o == "function" ? o() : o,
|
|
326
|
+
originLabel: o,
|
|
324
327
|
value: u,
|
|
325
328
|
key: e?.key ?? u
|
|
326
329
|
} : u;
|
|
327
330
|
}
|
|
328
|
-
function
|
|
329
|
-
const e = [...
|
|
330
|
-
n.length > 0 && n.every((a) =>
|
|
331
|
-
const h =
|
|
331
|
+
function we() {
|
|
332
|
+
const e = [...l(p) || []], n = k.value;
|
|
333
|
+
n.length > 0 && n.every((a) => b(e, a)) ? n.forEach((a) => {
|
|
334
|
+
const h = be(e, a);
|
|
332
335
|
~h && e.splice(h, 1);
|
|
333
336
|
}) : n.forEach((a) => {
|
|
334
|
-
if (
|
|
337
|
+
if (b(e, a))
|
|
335
338
|
return;
|
|
336
|
-
const h = c.value.find((
|
|
337
|
-
e.push(
|
|
339
|
+
const h = c.value.find((Oe) => m(Oe, "value") === a), Fe = q(h, a);
|
|
340
|
+
e.push(Fe);
|
|
338
341
|
});
|
|
339
|
-
const u = c.value.filter((a) =>
|
|
340
|
-
|
|
342
|
+
const u = c.value.filter((a) => b(e, m(a, "value")));
|
|
343
|
+
V([...e]), t.onChange?.([...e], u);
|
|
341
344
|
}
|
|
342
345
|
return J({
|
|
343
|
-
focus:
|
|
344
|
-
blur:
|
|
346
|
+
focus: pe,
|
|
347
|
+
blur: me,
|
|
345
348
|
request: d
|
|
346
|
-
}), (e, n) => e.mode === "read" ? (y(), T("span",
|
|
349
|
+
}), (e, n) => e.mode === "read" ? (y(), T("span", Ge, I(ie.value), 1)) : (y(), F(l(Te), Ne({
|
|
347
350
|
key: 1,
|
|
348
351
|
ref_key: "selectRef",
|
|
349
|
-
ref:
|
|
352
|
+
ref: x,
|
|
350
353
|
"allow-clear": ""
|
|
351
|
-
},
|
|
354
|
+
}, ce.value, {
|
|
352
355
|
mode: le.value,
|
|
353
|
-
value:
|
|
354
|
-
options:
|
|
356
|
+
value: l(p),
|
|
357
|
+
options: l(c),
|
|
355
358
|
loading: r.value,
|
|
356
|
-
"menu-item-selected-icon":
|
|
357
|
-
"popup-class-name": `${
|
|
358
|
-
"onUpdate:value":
|
|
359
|
-
onFocus:
|
|
360
|
-
onDropdownVisibleChange:
|
|
361
|
-
}),
|
|
362
|
-
option: g((
|
|
363
|
-
class:
|
|
364
|
-
}, [v(
|
|
359
|
+
"menu-item-selected-icon": Ie("span"),
|
|
360
|
+
"popup-class-name": `${l(S)("popup")} ${l(Y)}`,
|
|
361
|
+
"onUpdate:value": V,
|
|
362
|
+
onFocus: ae,
|
|
363
|
+
onDropdownVisibleChange: ue
|
|
364
|
+
}), Ae({
|
|
365
|
+
option: g((o) => [A("div", {
|
|
366
|
+
class: C(l(f)("outter"))
|
|
367
|
+
}, [v(l(E), {
|
|
365
368
|
justify: "space-between",
|
|
366
369
|
align: "center",
|
|
367
|
-
class:
|
|
370
|
+
class: C(l(f)("wrapper")),
|
|
368
371
|
gap: 8
|
|
369
372
|
}, {
|
|
370
|
-
default: g(() => [v(
|
|
373
|
+
default: g(() => [v(l(E), {
|
|
371
374
|
gap: 8,
|
|
372
375
|
align: "center",
|
|
373
|
-
class:
|
|
376
|
+
class: C(l(f)("content-wrapper"))
|
|
374
377
|
}, {
|
|
375
|
-
default: g(() => [P.value ? (y(),
|
|
378
|
+
default: g(() => [P.value ? (y(), F(l(U), {
|
|
376
379
|
key: 0,
|
|
377
|
-
checked:
|
|
378
|
-
}, null, 8, ["checked"])) : R("", !0), (y(),
|
|
380
|
+
checked: Ce(o)
|
|
381
|
+
}, null, 8, ["checked"])) : R("", !0), (y(), F(z(ve(o))))]),
|
|
379
382
|
_: 2
|
|
380
|
-
}, 1032, ["class"]),
|
|
383
|
+
}, 1032, ["class"]), fe.value && !o?.disabled ? (y(), T("span", {
|
|
381
384
|
key: 0,
|
|
382
|
-
class:
|
|
383
|
-
onClick:
|
|
384
|
-
},
|
|
385
|
+
class: C(l(f)("action")),
|
|
386
|
+
onClick: _e(() => he(o), ["stop"])
|
|
387
|
+
}, I(l(L)("ap.field.chooseOnly")), 11, Je)) : R("", !0)]),
|
|
385
388
|
_: 2
|
|
386
389
|
}, 1032, ["class"])], 2)]),
|
|
387
390
|
_: 2
|
|
388
|
-
}, [
|
|
391
|
+
}, [De(l(H)(O, ["option"]), (o, u) => ({
|
|
389
392
|
name: u,
|
|
390
|
-
fn: g((a) => [
|
|
393
|
+
fn: g((a) => [Me(e.$slots, u, Le(Pe(a || {})))])
|
|
391
394
|
})), r.value ? {
|
|
392
395
|
name: "notFoundContent",
|
|
393
|
-
fn: g(() => [v(
|
|
396
|
+
fn: g(() => [v(l(Re), {
|
|
394
397
|
size: "small"
|
|
395
398
|
})]),
|
|
396
399
|
key: "0"
|
|
397
400
|
} : void 0, P.value ? {
|
|
398
401
|
name: "dropdownRender",
|
|
399
402
|
fn: g(({
|
|
400
|
-
menuNode:
|
|
401
|
-
}) => [
|
|
403
|
+
menuNode: o
|
|
404
|
+
}) => [A("div", {
|
|
402
405
|
tabindex: -1,
|
|
403
|
-
class:
|
|
404
|
-
onClick:
|
|
405
|
-
}, [v(
|
|
406
|
-
checked:
|
|
407
|
-
indeterminate:
|
|
408
|
-
}, null, 8, ["checked", "indeterminate"]),
|
|
409
|
-
class:
|
|
410
|
-
},
|
|
406
|
+
class: C(l(S)("popup-all-option")),
|
|
407
|
+
onClick: we
|
|
408
|
+
}, [v(l(U), {
|
|
409
|
+
checked: ye.value,
|
|
410
|
+
indeterminate: ge.value
|
|
411
|
+
}, null, 8, ["checked", "indeterminate"]), A("span", {
|
|
412
|
+
class: C(l(S)("popup-all-option-label"))
|
|
413
|
+
}, I(l(L)("ap.field.selectAll")), 3)], 2), (y(), F(z(o)))]),
|
|
411
414
|
key: "1"
|
|
412
|
-
} : void 0]), 1040, ["mode", "value", "options", "loading", "menu-item-selected-icon", "popup-class-name"
|
|
415
|
+
} : void 0]), 1040, ["mode", "value", "options", "loading", "menu-item-selected-icon", "popup-class-name"]));
|
|
413
416
|
}
|
|
414
417
|
});
|
|
415
418
|
export {
|
|
416
|
-
|
|
419
|
+
ct as default
|
|
417
420
|
};
|
|
@@ -1,58 +1,58 @@
|
|
|
1
1
|
import { cloneDeep as I } from "lodash-unified";
|
|
2
|
-
import { ref as c, watch as
|
|
3
|
-
const
|
|
2
|
+
import { ref as c, watch as u, defineComponent as D, provide as H, toRef as r, inject as x } from "vue";
|
|
3
|
+
const g = /* @__PURE__ */ Symbol("ag-grid-provider-key");
|
|
4
4
|
function _(s) {
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
},
|
|
5
|
+
const t = c(), l = c(), a = c(0), d = c(0), v = (e) => {
|
|
6
|
+
t.value = e;
|
|
7
|
+
}, w = (e) => {
|
|
8
8
|
a.value = e;
|
|
9
|
-
},
|
|
10
|
-
|
|
9
|
+
}, S = () => t.value, f = (e = "reset") => {
|
|
10
|
+
t.value && e in t.value && t.value[e]();
|
|
11
11
|
}, R = (e) => {
|
|
12
|
-
|
|
13
|
-
},
|
|
12
|
+
t.value?.rowSelection.setSelectedRowKeys(e);
|
|
13
|
+
}, h = () => I(t.value?.rowSelection.selectedRows.value), p = () => t.value?.rowSelection.clearAll(), y = (e) => t.value?.rowSelection.unSelectRows([e]), A = (e) => {
|
|
14
14
|
if (!e) return;
|
|
15
|
-
const
|
|
16
|
-
if (
|
|
17
|
-
const
|
|
18
|
-
if (
|
|
19
|
-
const
|
|
20
|
-
|
|
15
|
+
const n = e.getDisplayedRowCount();
|
|
16
|
+
if (n > 0) {
|
|
17
|
+
const o = e.getDisplayedRowAtIndex(n - 1);
|
|
18
|
+
if (o && o.rowTop && o.rowHeight) {
|
|
19
|
+
const G = o.rowTop + o.rowHeight;
|
|
20
|
+
d.value = G;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
|
-
|
|
24
|
+
u(t, (e) => {
|
|
25
25
|
e && s?.onMounted?.();
|
|
26
|
-
}),
|
|
27
|
-
() =>
|
|
26
|
+
}), u(
|
|
27
|
+
() => t.value?.rowSelection.selectedRows.value,
|
|
28
28
|
(e) => {
|
|
29
|
-
|
|
29
|
+
l.value = e, s?.onSelectedRows?.(e);
|
|
30
30
|
}
|
|
31
31
|
);
|
|
32
32
|
const i = {
|
|
33
|
-
setInstance:
|
|
34
|
-
refresh:
|
|
35
|
-
getInstance:
|
|
33
|
+
setInstance: v,
|
|
34
|
+
refresh: f,
|
|
35
|
+
getInstance: S,
|
|
36
36
|
setSelectedRowKeys: R,
|
|
37
|
-
getSelectedRows:
|
|
38
|
-
clearAllSelected:
|
|
37
|
+
getSelectedRows: h,
|
|
38
|
+
clearAllSelected: p,
|
|
39
39
|
removeSelected: y,
|
|
40
|
-
setDataSourceLength:
|
|
41
|
-
onAgGridUpdate:
|
|
40
|
+
setDataSourceLength: w,
|
|
41
|
+
onAgGridUpdate: A
|
|
42
42
|
}, m = D({
|
|
43
|
-
setup(e, { slots:
|
|
44
|
-
return H(
|
|
43
|
+
setup(e, { slots: n }) {
|
|
44
|
+
return H(g, {
|
|
45
45
|
...i,
|
|
46
|
-
selectedRows:
|
|
47
|
-
dataSourceLength:
|
|
48
|
-
agGridBodyHeight:
|
|
49
|
-
}), () =>
|
|
46
|
+
selectedRows: r(() => l.value),
|
|
47
|
+
dataSourceLength: r(() => a.value),
|
|
48
|
+
agGridBodyHeight: r(() => d.value)
|
|
49
|
+
}), () => n.default?.();
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
52
|
return [i, m];
|
|
53
53
|
}
|
|
54
54
|
function j() {
|
|
55
|
-
return x(
|
|
55
|
+
return x(g);
|
|
56
56
|
}
|
|
57
57
|
export {
|
|
58
58
|
_ as useAgGridInstance,
|
package/es/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "7.20.
|
|
1
|
+
declare const _default: "7.20.2";
|
|
2
2
|
export default _default;
|
package/es/src/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../config-provider/index.js");const p=require("../../../config-provider/hooks/use-namespace.js"),d=e.defineComponent({__name:"index",props:{params:{}},setup(n){const s=n,r=e.ref(!1),{e:i}=p.useNamespace("ag-grid");return e.onMounted(()=>{const{rowIndex:t,column:
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../config-provider/index.js");const p=require("../../../config-provider/hooks/use-namespace.js"),d=e.defineComponent({__name:"index",props:{params:{}},setup(n){const s=n,r=e.ref(!1),{e:i}=p.useNamespace("ag-grid");return e.onMounted(()=>{const{rowIndex:t,column:a,gridWrapperRef:c,lineClamp:u}=s.params,o=e.unref(c)?.querySelector(`div.ag-row[row-index="${t}"] .ag-cell[col-id="${a.colId}"] span.ag-cell-value`);if(!o){r.value=!0;return}const l=u===1?"Width":"Height";r.value=o[`scroll${l}`]>o[`client${l}`]}),(t,a)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(i)("tooltip"))},e.toDisplayString(t.params.value),3)),[[e.vShow,r.value]])}});exports.default=d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("lodash-unified"),f=require("vue"),w=require("../../ap-grid/utils/col.js"),y=require("../../ap-table/utils.js");require("../../config-provider/index.js");require("../../utils/index.js");require("../components/body-cell/index.vue.js");require("../components/header-cell/index.vue.js");require("../components/tooltip/index.vue.js");const x=require("../renderer/index.js"),q=require("../../config-provider/hooks/use-global-config.js"),R=require("../../config-provider/hooks/use-namespace.js"),P=require("../components/body-cell/index.vue2.js"),D=require("../components/tooltip/index.vue2.js"),G=require("../../utils/is.js"),b=require("../components/header-cell/index.vue2.js");function I(t){return n.isNumber(t)&&t>1}function M(t,s){return a=>({...n.isFunction(s)?s(a):s??{},...t})}function F(t,s){if(s.bodyCellTooltip)return n.isFunction(s.bodyCellTooltip)?s.bodyCellTooltip(t.value,t.data):s.bodyCellTooltip;if(s.renderText)return s.renderText({value:t.value,record:t.data,column:s,text:t.value});const a=s.valueType||"text",o=x.rendererMap[a];if(o){const c=y.getTableRenderProps({...s,valueType:a},{value:t.value,text:t.value,record:t.data,column:t.column,rowIndex:t.node?.rowIndex,pinned:t.node?.rowPinned});return o(c)}return y.objectToString(t.value)}const N=(t,s,a,o)=>{const C=q.useGlobalConfig("valueTypeMap"),c=f.ref(),{em:T}=R.useNamespace("ag-grid"),h=r=>{const l={cellRenderer:P.default,cellRendererParams:{column:r,extraValueType:f.unref(C),rowKey:s.rowKey}};if(r.customRender)return l;if(r.renderText)return{valueFormatter:i=>r.renderText({value:i.value,record:i.data,column:r,text:i.value})};const d=r.valueType||"text",e=x.rendererMap[d];return e?{valueFormatter:i=>{const u=y.getTableRenderProps({...r,valueType:d},{value:i.value,text:i.value,record:i.data,column:i.column,rowIndex:i.node?.rowIndex,pinned:i.node?.rowPinned});return e(u)}}:l},g=r=>{const l=r.valueType||"text",d=x.rendererMap[l],e={},i=r.bodyCellTooltip||!r.customRender&&d&&(r.ellipsis===!0||r.ellipsis==="tooltip"||n.isNumber(r.ellipsis)),u=n.isNumber(r.ellipsis)&&r.ellipsis>1,p=n.isNumber(r.ellipsis)?r.ellipsis:1;return e.tooltipValueGetter=i?v=>F(v,r):void 0,e.wrapText=!r.ellipsis||u,e.cellStyle=M({"--ag-grid-line-clamp":p},r.cellStyle),e.tooltipComponent=D.default,e.tooltipComponentParams={lineClamp:p,gridWrapperRef:c},e},_=f.computed(()=>{const r=f.unref(t);function l(d){return d.map(e=>{const i={field:w.dataIndexToField(e.dataIndex),colId:G.isDef(e.key)?String(e.key):void 0,sortable:!!e.sorter,comparator:e.sorter===!0?()=>0:e.sorter,headerComponentParams:{column:e,headerCell:o},resizable:e.resizable,width:e.width,minWidth:e.minWidth,maxWidth:e.maxWidth,suppressKeyboardEvent:()=>!0,flex:e.width?void 0:e.flex??1,pinned:e.fixed||null,colSpan:e.colSpan,spanRows:e.spanRows,cellClass:a(u=>{const p=e.cellClass||"",v=n.isFunction(p)?p(u.data,u.node):p;return[`${T("cell",e.align||"left")}`,I(e.ellipsis)?T("cell","multiline"):null,v].flat().filter(Boolean)}),cellStyle:e.cellStyle,headerStyle:e.headerStyle,headerClass:e.headerClass,columnGroupShow:e.columnGroupShow,autoHeight:!0,...g(e),...h(e)};return e.children?.length?{...i,headerGroupComponent:b.default,headerGroupComponentParams:{column:e,headerCell:o},children:l(e.children)}:i})}return l(r)}),S=f.computed(()=>({headerComponent:b.default,resizable:s.columnResizable,suppressMovable:!0,cellDataType:!1}));return{columnDefs:_,defaultColDef:S,gridWrapperRef:c}};exports.useColumnsDef=N;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),f=require("@aplus-frontend/antdv"),r=require("lodash-unified");require("../../config-provider/index.js");require("../../utils/index.js");const se=require("../../utils/warning.js");require("../../hooks/index.js");const ce=require("../hooks/use-default-placeholder.js"),ie=require("../style/index.js"),de=require("./use-select-options.js"),F=require("../../utils/is.js"),I=require("../../config-provider/hooks/use-namespace.js"),fe=require("../../config-provider/hooks/use-locale.js"),pe=require("../../hooks/useControllableValue.js"),me={key:0},he=["onClick"],ve=e.defineComponent({name:"ApFieldSelect",__name:"index",props:{mode:{default:"edit"},class:{},style:{},emptyText:{default:"--"},customReadMode:{},defaultValue:{},notFoundContent:{},suffixIcon:{},itemIcon:{},size:{},bordered:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:void 0},variant:{},maxCount:{},transitionName:{},choiceTransitionName:{},popupClassName:{},dropdownClassName:{},placement:{},status:{},children:{},listHeight:{},onMouseenter:{},onMouseleave:{},tabindex:{},onClick:{},onFocus:{},onBlur:{},onChange:{},onKeydown:{},onKeyup:{},onMousedown:{},onSelect:{},open:{type:Boolean,default:void 0},animation:{},direction:{},disabled:{type:Boolean,default:void 0},prefixCls:{},id:{},autofocus:{type:Boolean,default:void 0},getPopupContainer:{},virtual:{type:Boolean,default:void 0},dropdownMatchSelectWidth:{},placeholder:{},loading:{type:Boolean,default:void 0},prefix:{},clearIcon:{},allowClear:{type:Boolean,default:!0},fieldNames:{},inputValue:{},searchValue:{},autoClearSearchValue:{type:Boolean,default:void 0},onDeselect:{},onActive:{},filterOption:{},filterSort:{},optionFilterProp:{},optionLabelProp:{},options:{},defaultActiveFirstOption:{type:Boolean,default:void 0},listItemHeight:{},onClickOption:{},menuItemSelectedIcon:{},labelInValue:{type:Boolean,default:void 0},showSearch:{type:Boolean,default:void 0},tagRender:{},optionLabelRender:{},onClear:{},defaultOpen:{type:Boolean,default:void 0},onDropdownVisibleChange:{},maxTagTextLength:{},maxTagCount:{},maxTagPlaceholder:{},tokenSeparators:{},removeIcon:{},dropdownStyle:{},dropdownRender:{},dropdownAlign:{},showAction:{},onPopupScroll:{},onInputKeyDown:{},request:{},multiple:{type:Boolean,default:void 0},value:{},"onUpdate:value":{},searchMode:{default:"filter"},refetchOnFocus:{type:Boolean,default:!1},fetchOnFocus:{type:Boolean,default:void 0},fetchOnOpen:{type:Boolean},lazy:{type:[Boolean,String],default:!1},addAll:{type:[Boolean,Number],default:5},params:{},searchDelay:{default:300},allowOnlySelect:{type:Boolean,default:!0}},emits:["update:value"],setup(A,{expose:D,emit:_}){let c=0;const C=e.useSlots(),t=A,{deprecated:M}=se.useDevWarning("ApFieldSelect");M(!F.isDef(t.refetchOnFocus),"refetchOnFocus","fetchOnFocus");const{b}=I.useNamespace("field-select"),{b:p}=I.useNamespace("field-select-popup-option"),z=ie.default("field"),P=f.Form.useInjectFormItemContext(),S=e.ref(!1),B=e.ref(!1),{t:N}=fe.useLocale(),L=r.debounce(n=>{if(!r.isFunction(t.request))return;c+=1;const o=c;g([]),s.value=!0,t.request(n).then(l=>{c===o&&(g(l),s.value=!1)})},t.searchDelay),T=(n,o)=>{const l=t.fieldNames?.label||"label";return typeof o?.[l]=="string"&&o[l].toLowerCase().indexOf(n.toLowerCase())>-1},{options:i,updateOptions:g}=de.useSelectOptions(t),w=e.shallowRef(),s=e.ref(t?.loading||!1),R=_,E=e.computed(()=>t.fetchOnFocus??t.refetchOnFocus),U=e.computed(()=>{if(t.multiple)return t.tokenSeparators?"tags":"multiple"});async function d(n=!0){if(!r.isFunction(t.request))return;s.value=!0,c+=1;const o=c;try{n&&g([]);const l=await t.request(void 0,t.params);if(o!==c)return;g(l)}finally{s.value=!1}}function j(n){!S.value&&c===0&&t.lazy==="first-focus"?d():E.value&&!s.value&&d(!0),t.onFocus?.(n),S.value=!0}function K(n){if(!n){t.onDropdownVisibleChange?.(n);return}!B.value&&c===0&&t.lazy==="first-open"?d():t.fetchOnOpen&&!s.value&&d(!0),t.onDropdownVisibleChange?.(n),B.value=!0}function V(n){$(n),P?.onFieldChange()}e.onMounted(()=>{if(!t.lazy){d();return}}),e.watch(()=>t.params,()=>{d()},{deep:!0});const{value:m,updateValue:$}=pe.useControllableValue(t,R),H=ce.useDefaultPlaceholder("Select",t),W=e.computed(()=>{const n=e.unref(m);if(r.isNil(n))return t.emptyText;const o=t.fieldNames?.label||"label",l=t.fieldNames?.value||"value";return r.isArray(n)?n.map(a=>e.unref(i).find(v=>v[l]===a)?.[o]).filter(Boolean).join("、")||t.emptyText:e.unref(i).find(a=>a[l]===n)?.[o]||t.emptyText}),G=e.computed(()=>{const n=!!t?.showSearch,o=t.searchMode;let l={};return n&&(l=o==="request"?{defaultActiveFirstOption:!1,onSearch:L,notFoundContent:s.value?void 0:null,filterOption:!1,suffixIcon:null}:{filterOption:r.isNil(t?.filterOption)?T:t?.filterOption}),{...r.omit(t,["mode","value","onUpdate:value","onSearch","request","searchMode","onFocus","onBeforeSelect","onDropdownVisibleChange"]),placeholder:e.unref(H),...l}}),J=e.computed(()=>i.value.map(n=>n[t.fieldNames?.value||"value"])),k=e.computed(()=>i.value.filter(n=>!n.disabled).map(n=>n[t.fieldNames?.value||"value"])),O=e.computed(()=>!t.multiple||F.isDef(t.maxCount)?!1:r.isNumber(t.addAll)?J.value.length>=t.addAll:!!t.addAll),Q=e.computed(()=>t.multiple&&t.allowOnlySelect&&(!F.isDef(t.maxCount)||t.maxCount>=1));function X(){w.value?.focus()}function Y(){w.value?.blur()}function h(n,o){const l=t.fieldNames?.[o]??o;return l==="groupLabel"?n[l]??n.label:n[l]}function Z(n){const o=q(n);V(t.multiple?[o]:o),t.onChange?.([o],[n])}function ee(n){return C.option?e.createVNode("div",{class:p("custom")},[C.option(n)]):e.createVNode("span",{class:p("label")},[h(n,n.options?.length?"groupLabel":"label")])}const ne=e.computed(()=>{const n=e.unref(m)||[],o=k.value;return o.length>0&&o.every(l=>y(n,l))}),te=e.computed(()=>{const n=e.unref(m)||[],o=k.value,l=o.filter(u=>y(n,u)).length;return l>0&&l<o.length});function x(n,o){return(n.value??n)===o}const oe=n=>{const o=e.unref(m),l=h(n,"value");return r.isArray(o)?!!o.find(u=>x(u,l)):!1};function y(n,o){return n.find(l=>x(l,o))!=null}function le(n,o){return n.findIndex(l=>x(l,o))}function q(n,o){const l=h(n,"label"),u=o??h(n,"value");return t.labelInValue?{label:typeof l=="function"?l():l,originLabel:l,value:u,key:n?.key??u}:u}function ae(){const n=[...e.unref(m)||[]],o=k.value;o.length>0&&o.every(a=>y(n,a))?o.forEach(a=>{const v=le(n,a);~v&&n.splice(v,1)}):o.forEach(a=>{if(y(n,a))return;const v=i.value.find(re=>h(re,"value")===a),ue=q(v,a);n.push(ue)});const u=i.value.filter(a=>y(n,h(a,"value")));V([...n]),t.onChange?.([...n],u)}return D({focus:X,blur:Y,request:d}),(n,o)=>n.mode==="read"?(e.openBlock(),e.createElementBlock("span",me,e.toDisplayString(W.value),1)):(e.openBlock(),e.createBlock(e.unref(f.Select),e.mergeProps({key:1,ref_key:"selectRef",ref:w,"allow-clear":""},G.value,{mode:U.value,value:e.unref(m),options:e.unref(i),loading:s.value,"menu-item-selected-icon":e.h("span"),"popup-class-name":`${e.unref(b)("popup")} ${e.unref(z)}`,"onUpdate:value":V,onFocus:j,onDropdownVisibleChange:K}),e.createSlots({option:e.withCtx(l=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(p)("outter"))},[e.createVNode(e.unref(f.Flex),{justify:"space-between",align:"center",class:e.normalizeClass(e.unref(p)("wrapper")),gap:8},{default:e.withCtx(()=>[e.createVNode(e.unref(f.Flex),{gap:8,align:"center",class:e.normalizeClass(e.unref(p)("content-wrapper"))},{default:e.withCtx(()=>[O.value?(e.openBlock(),e.createBlock(e.unref(f.Checkbox),{key:0,checked:oe(l)},null,8,["checked"])):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(ee(l))))]),_:2},1032,["class"]),Q.value&&!l?.disabled?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(p)("action")),onClick:e.withModifiers(()=>Z(l),["stop"])},e.toDisplayString(e.unref(N)("ap.field.chooseOnly")),11,he)):e.createCommentVNode("",!0)]),_:2},1032,["class"])],2)]),_:2},[e.renderList(e.unref(r.omit)(C,["option"]),(l,u)=>({name:u,fn:e.withCtx(a=>[e.renderSlot(n.$slots,u,e.normalizeProps(e.guardReactiveProps(a||{})))])})),s.value?{name:"notFoundContent",fn:e.withCtx(()=>[e.createVNode(e.unref(f.Spin),{size:"small"})]),key:"0"}:void 0,O.value?{name:"dropdownRender",fn:e.withCtx(({menuNode:l})=>[e.createElementVNode("div",{tabindex:-1,class:e.normalizeClass(e.unref(b)("popup-all-option")),onClick:ae},[e.createVNode(e.unref(f.Checkbox),{checked:ne.value,indeterminate:te.value},null,8,["checked","indeterminate"]),e.createElementVNode("span",{class:e.normalizeClass(e.unref(b)("popup-all-option-label"))},e.toDisplayString(e.unref(N)("ap.field.selectAll")),3)],2),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l)))]),key:"1"}:void 0]),1040,["mode","value","options","loading","menu-item-selected-icon","popup-class-name"]))}});exports.default=ve;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("lodash-unified"),t=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("lodash-unified"),t=require("vue"),d=Symbol("ag-grid-provider-key");function I(r){const o=t.ref(),s=t.ref(),l=t.ref(0),a=t.ref(0),i=e=>{o.value=e},g=e=>{l.value=e},v=()=>o.value,w=(e="reset")=>{o.value&&e in o.value&&o.value[e]()},f=e=>{o.value?.rowSelection.setSelectedRowKeys(e)},S=()=>G.cloneDeep(o.value?.rowSelection.selectedRows.value),R=()=>o.value?.rowSelection.clearAll(),h=e=>o.value?.rowSelection.unSelectRows([e]),y=e=>{if(!e)return;const c=e.getDisplayedRowCount();if(c>0){const n=e.getDisplayedRowAtIndex(c-1);if(n&&n.rowTop&&n.rowHeight){const p=n.rowTop+n.rowHeight;a.value=p}}};t.watch(o,e=>{e&&r?.onMounted?.()}),t.watch(()=>o.value?.rowSelection.selectedRows.value,e=>{s.value=e,r?.onSelectedRows?.(e)});const u={setInstance:i,refresh:w,getInstance:v,setSelectedRowKeys:f,getSelectedRows:S,clearAllSelected:R,removeSelected:h,setDataSourceLength:g,onAgGridUpdate:y},A=t.defineComponent({setup(e,{slots:c}){return t.provide(d,{...u,selectedRows:t.toRef(()=>s.value),dataSourceLength:t.toRef(()=>l.value),agGridBodyHeight:t.toRef(()=>a.value)}),()=>c.default?.()}});return[u,A]}function j(){return t.inject(d)}exports.useAgGridInstance=I;exports.useAgGridModalInject=j;
|
package/lib/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "7.20.
|
|
1
|
+
declare const _default: "7.20.2";
|
|
2
2
|
export default _default;
|
package/lib/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="7.20.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="7.20.2";exports.default=e;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aplus-frontend/ui",
|
|
3
|
-
"version": "7.20.
|
|
3
|
+
"version": "7.20.2",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"scroll-into-view-if-needed": "^3.1.0",
|
|
42
42
|
"vue-virtual-scroller": "2.0.0-beta.8",
|
|
43
43
|
"vuedraggable": "^4.1.0",
|
|
44
|
-
"@aplus-frontend/
|
|
45
|
-
"@aplus-frontend/
|
|
44
|
+
"@aplus-frontend/hooks": "1.0.7",
|
|
45
|
+
"@aplus-frontend/utils": "1.0.66"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@aplus-frontend/antdv": "^2.1.4",
|