@aplus-frontend/ui 6.34.0 → 6.35.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/src/ag-grid/components/tooltip/index.vue2.mjs +1 -1
- package/es/src/ag-grid/hooks/use-selection-col-def.mjs +28 -22
- package/es/src/ag-grid/index.vue.mjs +77 -72
- package/es/src/ag-grid/interface.d.ts +5 -1
- package/es/src/ap-form/ap-form.vue.d.ts +2 -6
- package/es/src/ap-form/ap-form.vue2.mjs +71 -69
- package/es/src/ap-grid/editable/form-item.vue.mjs +74 -71
- package/es/src/ap-grid/editable/index.vue.mjs +94 -91
- package/es/src/ap-grid/index.vue.mjs +74 -69
- package/es/src/ap-pro-card/components/statistic/index.vue.d.ts +1 -1
- package/es/src/ap-table/ap-table.vue2.mjs +72 -69
- package/es/src/ap-tag/ap-tag-group.vue.mjs +33 -30
- package/es/src/ap-upload/components/SingleFile.vue2.mjs +103 -103
- package/es/src/business/ap-attachment/ApAttachment.mjs +16 -15
- package/es/src/business/ap-copy/ApCopy.mjs +5 -6
- package/es/src/business/ap-draggable-grid/ApDraggableGrid.vue2.mjs +176 -175
- package/es/src/business/ap-keep-alive/keeper/ap-view-keeper.mjs +4 -4
- package/es/src/business/ap-label/ApLabel.d.ts +1 -1
- package/es/src/business/ap-label/index.d.ts +3 -3
- package/es/src/business/hooks/usePageListApTable.mjs +10 -9
- package/es/src/editable-table/form-item.vue.mjs +75 -72
- package/es/src/editable-table/hooks/use-get-columns.mjs +35 -34
- package/es/src/editable-table/index.vue.mjs +68 -65
- package/es/src/utils/warning.d.ts +25 -0
- package/es/src/utils/warning.mjs +74 -0
- 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-selection-col-def.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +5 -1
- package/lib/src/ap-form/ap-form.vue.d.ts +2 -6
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ap-grid/editable/index.vue.js +1 -1
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-pro-card/components/statistic/index.vue.d.ts +1 -1
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-tag/ap-tag-group.vue.js +1 -1
- package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
- package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
- package/lib/src/business/ap-copy/ApCopy.js +1 -1
- package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue2.js +1 -1
- package/lib/src/business/ap-keep-alive/keeper/ap-view-keeper.js +1 -1
- package/lib/src/business/ap-label/ApLabel.d.ts +1 -1
- package/lib/src/business/ap-label/index.d.ts +3 -3
- package/lib/src/business/hooks/usePageListApTable.js +1 -1
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/utils/warning.d.ts +25 -0
- package/lib/src/utils/warning.js +1 -0
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as We, useSlots as
|
|
1
|
+
import { defineComponent as We, useSlots as De, ref as h, computed as n, unref as o, toRef as $e, createVNode as c, Fragment as te, watch as x, createElementBlock as B, openBlock as p, normalizeStyle as A, normalizeClass as f, createCommentVNode as ae, createElementVNode as E, mergeProps as k, createSlots as le, withCtx as w, renderList as ne, createBlock as se, resolveDynamicComponent as je, renderSlot as v, normalizeProps as He, guardReactiveProps as _e } from "vue";
|
|
2
2
|
import { Divider as Ue, Table as qe } from "@aplus-frontend/antdv";
|
|
3
3
|
import { useToken as Me } from "@aplus-frontend/antdv/es/theme/internal";
|
|
4
4
|
import { ApForm as Ge } from "../ap-form/index.mjs";
|
|
@@ -16,12 +16,13 @@ import { useProvideApTable as ir } from "./context.mjs";
|
|
|
16
16
|
import "../scroll-bar/index.mjs";
|
|
17
17
|
import { useStickyScroll as cr } from "./hooks/use-sticky-scroll.mjs";
|
|
18
18
|
import { getValidVNodeList as pr } from "../utils/slot.mjs";
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
|
|
19
|
+
import { useDevWarning as fr } from "../utils/warning.mjs";
|
|
20
|
+
import { useNamespace as mr } from "../config-provider/hooks/use-namespace.mjs";
|
|
21
|
+
import { useGlobalConfig as gr } from "../config-provider/hooks/use-global-config.mjs";
|
|
22
|
+
import br from "./components/paragraph-ellipsis/index.vue2.mjs";
|
|
23
|
+
import yr from "./components/setting/modal/index.vue2.mjs";
|
|
24
|
+
import Sr from "../scroll-bar/index.vue.mjs";
|
|
25
|
+
const _r = /* @__PURE__ */ We({
|
|
25
26
|
name: "ApTable",
|
|
26
27
|
__name: "ap-table",
|
|
27
28
|
props: {
|
|
@@ -150,20 +151,22 @@ const Dr = /* @__PURE__ */ We({
|
|
|
150
151
|
expose: me
|
|
151
152
|
}) {
|
|
152
153
|
const r = fe;
|
|
153
|
-
let
|
|
154
|
-
const
|
|
154
|
+
let K = 0;
|
|
155
|
+
const g = De(), [, ge] = Me();
|
|
156
|
+
fr("ApTable")(!1, "breaking", "ApTable has been EOL, Please use AgGrid(https://aplus.aplnk.com/aplus-ui/components/ag-grid/) instead.");
|
|
157
|
+
const {
|
|
155
158
|
e: I,
|
|
156
159
|
b: u,
|
|
157
|
-
be:
|
|
158
|
-
m:
|
|
159
|
-
cssVar:
|
|
160
|
-
} =
|
|
160
|
+
be: L,
|
|
161
|
+
m: be,
|
|
162
|
+
cssVar: ye
|
|
163
|
+
} = mr("ap-table"), O = gr("valueTypeMap"), {
|
|
161
164
|
height: Se,
|
|
162
165
|
contentRef: he
|
|
163
|
-
} = sr(), W = h(),
|
|
164
|
-
isStickyMode:
|
|
166
|
+
} = sr(), W = h(), D = h(), {
|
|
167
|
+
isStickyMode: $,
|
|
165
168
|
scrollBarRef: R
|
|
166
|
-
} = cr(W), z = h(r.size), s = h([]), j = h([]), H = ur(), _ = n(() => (
|
|
169
|
+
} = cr(W), z = h(r.size), s = h([]), j = h([]), H = ur(), _ = n(() => (K++, r.columns?.filter((e) => !e.hideInSearch && e.dataIndex && (e.valueType || e.customRenderFormItem) && !de.includes(e.valueType))?.sort((e, a) => {
|
|
167
170
|
let t = ie(e.order);
|
|
168
171
|
return ie(a.order) - t;
|
|
169
172
|
})?.map((e) => {
|
|
@@ -175,18 +178,18 @@ const Dr = /* @__PURE__ */ We({
|
|
|
175
178
|
// tips: 在表格中的查询表单项默认是带边框的
|
|
176
179
|
bordered: !0,
|
|
177
180
|
...a || {},
|
|
178
|
-
_signal:
|
|
181
|
+
_signal: K
|
|
179
182
|
},
|
|
180
183
|
renderNode: void 0
|
|
181
184
|
};
|
|
182
|
-
return t.renderNode = Ze(t, o(
|
|
185
|
+
return t.renderNode = Ze(t, o(O)), t;
|
|
183
186
|
}) || [])), we = n(() => ce(o(s), (e) => {
|
|
184
187
|
if (e.sorter === !0)
|
|
185
188
|
return e.key || e?.dataIndex;
|
|
186
189
|
}).filter(Boolean)), ve = n(() => ce(o(s), (e) => {
|
|
187
190
|
if (e.filters && !e.onFilter)
|
|
188
191
|
return e.key || e?.dataIndex;
|
|
189
|
-
}).filter(Boolean)), Re = n(() => m(r.dataSource) ?
|
|
192
|
+
}).filter(Boolean)), Re = n(() => m(r.dataSource) ? b.records : r.dataSource), Ce = n(() => pe(r.manual) ? r.manual : pr(g.searchFormExtra?.() || []).some((a) => a.type?.name === "ApView")), {
|
|
190
193
|
rowSelection: C,
|
|
191
194
|
selectedRows: T,
|
|
192
195
|
...F
|
|
@@ -197,11 +200,11 @@ const Dr = /* @__PURE__ */ We({
|
|
|
197
200
|
dataSource: Re
|
|
198
201
|
}), {
|
|
199
202
|
formRef: i,
|
|
200
|
-
submit:
|
|
201
|
-
reset:
|
|
203
|
+
submit: P,
|
|
204
|
+
reset: N,
|
|
202
205
|
tableProps: U,
|
|
203
206
|
refresh: q,
|
|
204
|
-
data:
|
|
207
|
+
data: b,
|
|
205
208
|
setDataSource: Te,
|
|
206
209
|
getColumnSFConfig: M,
|
|
207
210
|
sortedInfo: Fe,
|
|
@@ -224,7 +227,7 @@ const Dr = /* @__PURE__ */ We({
|
|
|
224
227
|
},
|
|
225
228
|
filterFields: ve,
|
|
226
229
|
sortFields: we,
|
|
227
|
-
params:
|
|
230
|
+
params: $e(r, "params"),
|
|
228
231
|
defaultData: r.defaultData,
|
|
229
232
|
manual: o(Ce),
|
|
230
233
|
formatParams: r.beforeSearchSubmit,
|
|
@@ -240,12 +243,12 @@ const Dr = /* @__PURE__ */ We({
|
|
|
240
243
|
updateSize(e) {
|
|
241
244
|
z.value = e;
|
|
242
245
|
},
|
|
243
|
-
dataSource: n(() => o(
|
|
246
|
+
dataSource: n(() => o(b).records),
|
|
244
247
|
getSearchFormValues: X,
|
|
245
248
|
setSearchFormValues: Q,
|
|
246
|
-
submit:
|
|
249
|
+
submit: P,
|
|
247
250
|
submitWith: G,
|
|
248
|
-
reset:
|
|
251
|
+
reset: N,
|
|
249
252
|
refresh: q,
|
|
250
253
|
getSearchFormSorterItems: Y,
|
|
251
254
|
setSearchFormSorterItems: Z,
|
|
@@ -260,27 +263,27 @@ const Dr = /* @__PURE__ */ We({
|
|
|
260
263
|
// tips: 此函数内部依赖查询&筛选的相应式值
|
|
261
264
|
...M(l),
|
|
262
265
|
fixed: d ? d.fixed : l.fixed,
|
|
263
|
-
title: er(l,
|
|
266
|
+
title: er(l, L("table-header", "title"), g.headerCell, o(ge).colorTextTertiary),
|
|
264
267
|
customRender({
|
|
265
|
-
value:
|
|
268
|
+
value: y,
|
|
266
269
|
...S
|
|
267
270
|
}) {
|
|
268
|
-
const re = rr(l),
|
|
271
|
+
const re = rr(l), Ke = or({
|
|
269
272
|
...l,
|
|
270
273
|
valueType: re
|
|
271
274
|
}, {
|
|
272
|
-
value:
|
|
275
|
+
value: y,
|
|
273
276
|
...S
|
|
274
|
-
}),
|
|
275
|
-
value:
|
|
277
|
+
}), Le = tr(re, Ke, S.record, o(O)), oe = l.renderText?.({
|
|
278
|
+
value: y,
|
|
276
279
|
...S
|
|
277
|
-
}) ||
|
|
278
|
-
value:
|
|
280
|
+
}) || y, Oe = l.renderText ? c(te, null, [l.renderText?.({
|
|
281
|
+
value: y,
|
|
279
282
|
...S
|
|
280
|
-
})]) :
|
|
281
|
-
let V =
|
|
283
|
+
})]) : Le;
|
|
284
|
+
let V = Ae(l, oe, Oe);
|
|
282
285
|
return l.customRender && (V = l.customRender({
|
|
283
|
-
value:
|
|
286
|
+
value: y,
|
|
284
287
|
...S,
|
|
285
288
|
column: l,
|
|
286
289
|
originalNode: V,
|
|
@@ -309,15 +312,15 @@ const Dr = /* @__PURE__ */ We({
|
|
|
309
312
|
}, {
|
|
310
313
|
deep: !0
|
|
311
314
|
});
|
|
312
|
-
const
|
|
313
|
-
if (r.adaptive && (
|
|
315
|
+
const Pe = n(() => {
|
|
316
|
+
if (r.adaptive && (b.total > 0 || r.dataSource?.length))
|
|
314
317
|
return {
|
|
315
318
|
y: o(Se),
|
|
316
319
|
x: r.scroll?.x || "100%"
|
|
317
320
|
};
|
|
318
321
|
if (r.scroll)
|
|
319
322
|
return r.scroll;
|
|
320
|
-
}),
|
|
323
|
+
}), Ne = n(() => {
|
|
321
324
|
if (r.tableLayout)
|
|
322
325
|
return r.tableLayout;
|
|
323
326
|
if (r.columns?.some((e) => e.ellipsis))
|
|
@@ -334,14 +337,14 @@ const Dr = /* @__PURE__ */ We({
|
|
|
334
337
|
} : lr(r.rowSelection),
|
|
335
338
|
loading: m(r.loading) ? e.loading : r.loading,
|
|
336
339
|
pagination: r.pagination === !1 ? !1 : e.pagination,
|
|
337
|
-
scroll: o(
|
|
340
|
+
scroll: o(Pe)
|
|
338
341
|
};
|
|
339
|
-
}), Ve = n(() => [u(), r.card ? null : u("wrapper"), r.adaptive ? u("adaptive") : null,
|
|
340
|
-
function
|
|
342
|
+
}), Ve = n(() => [u(), r.card ? null : u("wrapper"), r.adaptive ? u("adaptive") : null, $.value && R.value?.visible ? be(`sticky-${H === 0 ? "absolute" : "relative"}`) : null].filter(Boolean));
|
|
343
|
+
function Ae(e, a, t) {
|
|
341
344
|
if (de.includes(e.valueType))
|
|
342
345
|
return t;
|
|
343
346
|
const d = nr(a);
|
|
344
|
-
return e.copyable || e.ellipsis ? c(
|
|
347
|
+
return e.copyable || e.ellipsis ? c(br, {
|
|
345
348
|
copyable: e.copyable,
|
|
346
349
|
rawValue: d,
|
|
347
350
|
ellipsis: e.ellipsis ? Qe(e.ellipsis) ? {
|
|
@@ -354,7 +357,7 @@ const Dr = /* @__PURE__ */ We({
|
|
|
354
357
|
content: t
|
|
355
358
|
}, null) : t;
|
|
356
359
|
}
|
|
357
|
-
x(() => o(
|
|
360
|
+
x(() => o(b).loading, (e) => {
|
|
358
361
|
r.onLoadingChange?.(e);
|
|
359
362
|
}), x(() => r.dataSource, (e) => {
|
|
360
363
|
Te(e);
|
|
@@ -377,20 +380,20 @@ const Dr = /* @__PURE__ */ We({
|
|
|
377
380
|
function ee() {
|
|
378
381
|
i.value?.resetSorterItems();
|
|
379
382
|
}
|
|
380
|
-
function
|
|
383
|
+
function Ee() {
|
|
381
384
|
return o(s);
|
|
382
385
|
}
|
|
383
386
|
return me({
|
|
384
|
-
submit: () =>
|
|
385
|
-
reset: () =>
|
|
387
|
+
submit: () => P(),
|
|
388
|
+
reset: () => N(),
|
|
386
389
|
refresh: () => q(),
|
|
387
390
|
submitWith: () => G(),
|
|
388
391
|
setSearchFormValues: Q,
|
|
389
392
|
getSearchFormValues: X,
|
|
390
393
|
setPaging: Be,
|
|
391
394
|
getPaging: ke,
|
|
392
|
-
getShownColumns:
|
|
393
|
-
dataSource: n(() => o(
|
|
395
|
+
getShownColumns: Ee,
|
|
396
|
+
dataSource: n(() => o(b).records),
|
|
394
397
|
rowSelection: {
|
|
395
398
|
selectedRows: n(() => o(T)),
|
|
396
399
|
...F
|
|
@@ -409,49 +412,49 @@ const Dr = /* @__PURE__ */ We({
|
|
|
409
412
|
ref_key: "tableWrapperRef",
|
|
410
413
|
ref: W,
|
|
411
414
|
class: f(Ve.value),
|
|
412
|
-
style:
|
|
415
|
+
style: A(o(ye)({
|
|
413
416
|
"scroll-bar-width": `${o(H)}px`
|
|
414
417
|
}))
|
|
415
418
|
}, [o(m)(e.dataSource) && e.searchForm !== !1 && _.value.length > 0 ? (p(), B("div", {
|
|
416
419
|
key: 0,
|
|
417
420
|
class: f(e.card ? o(I)("search-wrapper") : null),
|
|
418
|
-
style:
|
|
421
|
+
style: A(e.searchFormWrapperStyle)
|
|
419
422
|
}, [c(o(Ge).SearchForm, k(e.searchForm || {}, {
|
|
420
423
|
ref_key: "formRef",
|
|
421
424
|
ref: i,
|
|
422
425
|
"custom-reset": "",
|
|
423
426
|
"submit-loading": o(U).loading,
|
|
424
|
-
onSubmit: o(
|
|
425
|
-
onReset: o(
|
|
427
|
+
onSubmit: o(P),
|
|
428
|
+
onReset: o(N)
|
|
426
429
|
}), le({
|
|
427
430
|
default: w(() => [(p(!0), B(te, null, ne(_.value, (t) => (p(), se(je(t.renderNode), {
|
|
428
431
|
key: t.dataIndex
|
|
429
432
|
}))), 128))]),
|
|
430
433
|
_: 2
|
|
431
|
-
}, [
|
|
434
|
+
}, [g.searchFormExtra ? {
|
|
432
435
|
name: "extra",
|
|
433
436
|
fn: w(() => [v(e.$slots, "searchFormExtra")]),
|
|
434
437
|
key: "0"
|
|
435
|
-
} : void 0]), 1040, ["submit-loading", "onSubmit", "onReset"])], 6)) : ae("", !0),
|
|
438
|
+
} : void 0]), 1040, ["submit-loading", "onSubmit", "onReset"])], 6)) : ae("", !0), E("div", {
|
|
436
439
|
ref_key: "contentRef",
|
|
437
440
|
ref: he,
|
|
438
441
|
class: f([o(I)("table-wrapper"), e.card ? o(I)("table-wrapper-card") : null]),
|
|
439
|
-
style:
|
|
440
|
-
}, [
|
|
442
|
+
style: A(e.tableWrapperStyle)
|
|
443
|
+
}, [E("div", {
|
|
441
444
|
class: f(o(u)("header-wrapper"))
|
|
442
445
|
}, [e.settings ? (p(), B("div", {
|
|
443
446
|
key: 0,
|
|
444
447
|
class: f(o(u)("header"))
|
|
445
|
-
}, [
|
|
446
|
-
class: f(o(
|
|
448
|
+
}, [E("div", {
|
|
449
|
+
class: f(o(L)("header", "title"))
|
|
447
450
|
}, [v(e.$slots, "title", k({
|
|
448
451
|
selectedRows: o(T),
|
|
449
452
|
selectedRowKeys: o(C).selectedRowKeys,
|
|
450
453
|
shownColumns: s.value
|
|
451
|
-
}, F))], 2),
|
|
454
|
+
}, F))], 2), g.title ? (p(), se(o(Ue), {
|
|
452
455
|
key: 0,
|
|
453
456
|
type: "vertical"
|
|
454
|
-
})) : ae("", !0), c(
|
|
457
|
+
})) : ae("", !0), c(yr, {
|
|
455
458
|
config: e.settings === !0 ? {} : e.settings
|
|
456
459
|
}, null, 8, ["config"])], 2)) : v(e.$slots, "title", k({
|
|
457
460
|
key: 1,
|
|
@@ -460,11 +463,11 @@ const Dr = /* @__PURE__ */ We({
|
|
|
460
463
|
shownColumns: s.value
|
|
461
464
|
}, F))], 2), c(o(qe), k({
|
|
462
465
|
ref_key: "antdTableRef",
|
|
463
|
-
ref:
|
|
466
|
+
ref: D,
|
|
464
467
|
class: o(u)("table")
|
|
465
468
|
}, J.value, {
|
|
466
469
|
size: z.value,
|
|
467
|
-
"table-layout":
|
|
470
|
+
"table-layout": Ne.value,
|
|
468
471
|
columns: s.value,
|
|
469
472
|
onResizeColumn: a[0] || (a[0] = (t, d) => d.width = t)
|
|
470
473
|
}), le({
|
|
@@ -474,23 +477,23 @@ const Dr = /* @__PURE__ */ We({
|
|
|
474
477
|
selectedRows: o(T)
|
|
475
478
|
})]),
|
|
476
479
|
_: 2
|
|
477
|
-
}, [o(
|
|
480
|
+
}, [o($) ? {
|
|
478
481
|
name: "bottomPaginationTop",
|
|
479
|
-
fn: w(() => [c(o(
|
|
482
|
+
fn: w(() => [c(o(Sr), {
|
|
480
483
|
ref_key: "scrollBarRef",
|
|
481
484
|
ref: R,
|
|
482
|
-
"scroll-container":
|
|
485
|
+
"scroll-container": D.value?.table?.scrollBodyRef,
|
|
483
486
|
direction: "horizontal",
|
|
484
487
|
"bar-color": "var(--ap-scrollbar-thumb-color-base)",
|
|
485
488
|
"track-color": "var(--ap-table-header-bg, #f2f6f9)"
|
|
486
489
|
}, null, 8, ["scroll-container"])]),
|
|
487
490
|
key: "0"
|
|
488
|
-
} : void 0, ne(o(ue)(
|
|
491
|
+
} : void 0, ne(o(ue)(g, ["title", "searchFormExtra", "headerCell", "summary"]), (t, d) => ({
|
|
489
492
|
name: d,
|
|
490
493
|
fn: w((l) => [v(e.$slots, d, He(_e(l || {})))])
|
|
491
494
|
}))]), 1040, ["class", "size", "table-layout", "columns"])], 6)], 6));
|
|
492
495
|
}
|
|
493
496
|
});
|
|
494
497
|
export {
|
|
495
|
-
|
|
498
|
+
_r as default
|
|
496
499
|
};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Tooltip as
|
|
3
|
-
import
|
|
1
|
+
import { defineComponent as j, ref as C, computed as n, unref as f, watch as G, nextTick as L, onMounted as A, onUnmounted as F, createBlock as g, openBlock as a, mergeProps as w, withCtx as d, createElementVNode as t, normalizeStyle as b, normalizeClass as k, createElementBlock as _, createCommentVNode as I, Fragment as U, renderList as q, toDisplayString as W, renderSlot as H, createTextVNode as J } from "vue";
|
|
2
|
+
import { Tooltip as K } from "@aplus-frontend/antdv";
|
|
3
|
+
import O from "@ant-design/icons-vue";
|
|
4
4
|
import "./ap-tag.vue2.mjs";
|
|
5
5
|
import "../config-provider/index.mjs";
|
|
6
|
-
import { omit as
|
|
6
|
+
import { omit as Q } from "lodash-unified";
|
|
7
7
|
import { getTextWidth as T } from "./utils.mjs";
|
|
8
8
|
import "../hooks/index.mjs";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
|
|
9
|
+
import { useDevWarning as X } from "../utils/warning.mjs";
|
|
10
|
+
import { useLocale as Y } from "../config-provider/hooks/use-locale.mjs";
|
|
11
|
+
import { useGlobalConfig as Z } from "../config-provider/hooks/use-global-config.mjs";
|
|
12
|
+
import { useNamespace as ee } from "../config-provider/hooks/use-namespace.mjs";
|
|
13
|
+
import { useResize as te } from "../hooks/useResize.mjs";
|
|
14
|
+
import le from "./ap-tag.vue.mjs";
|
|
15
|
+
const ye = /* @__PURE__ */ j({
|
|
15
16
|
__name: "ap-tag-group",
|
|
16
17
|
props: {
|
|
17
18
|
list: { default: () => [] },
|
|
@@ -20,14 +21,14 @@ const de = /* @__PURE__ */ S({
|
|
|
20
21
|
ellipsis: { default: () => ({}) }
|
|
21
22
|
},
|
|
22
23
|
setup(z) {
|
|
23
|
-
const { t: V } =
|
|
24
|
+
const { t: V } = Y(), o = z, B = X("ApTagGroup"), v = Z("uiMode"), { b: E, bm: h } = ee("tag-group"), r = C(), { observe: D, unobserve: M } = te(), i = n(() => ({
|
|
24
25
|
...{
|
|
25
26
|
iconColor: v.value === "aplus" ? "#182948" : "#333",
|
|
26
27
|
symbol: "icon",
|
|
27
28
|
text: V("ap.common.more")
|
|
28
29
|
},
|
|
29
30
|
...o.ellipsis
|
|
30
|
-
})),
|
|
31
|
+
})), P = n(() => i.value.tooltip && typeof i.value.tooltip == "object" ? Q(i.value.tooltip, ["trigger", "title"]) : {}), p = n(() => f(c) < o.list.length), c = C(0), N = n(() => o.list.map((e) => e.text).join("、")), R = n(() => [E()].filter(Boolean)), S = n(() => v.value === "aplus" ? [h("ellipsis-text", "aplus")] : [h("ellipsis-text", "admin")]), y = () => {
|
|
31
32
|
let e = 0, l = 0;
|
|
32
33
|
if (!r.value) return;
|
|
33
34
|
const u = r.value.offsetWidth;
|
|
@@ -48,10 +49,10 @@ const de = /* @__PURE__ */ S({
|
|
|
48
49
|
}
|
|
49
50
|
c.value = l;
|
|
50
51
|
};
|
|
51
|
-
|
|
52
|
+
G(
|
|
52
53
|
() => o.list,
|
|
53
54
|
(e, l) => {
|
|
54
|
-
e !== l &&
|
|
55
|
+
e !== l && L(() => {
|
|
55
56
|
y();
|
|
56
57
|
});
|
|
57
58
|
},
|
|
@@ -59,43 +60,45 @@ const de = /* @__PURE__ */ S({
|
|
|
59
60
|
immediate: !0
|
|
60
61
|
}
|
|
61
62
|
);
|
|
62
|
-
const
|
|
63
|
+
const $ = () => {
|
|
63
64
|
y();
|
|
64
65
|
};
|
|
65
|
-
return
|
|
66
|
+
return A(() => {
|
|
66
67
|
[["ellipsisColor", "ellipse.color"]].forEach(
|
|
67
68
|
([e, l]) => {
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
B.deprecated(
|
|
70
|
+
!o[e],
|
|
71
|
+
e,
|
|
72
|
+
l
|
|
70
73
|
);
|
|
71
74
|
}
|
|
72
|
-
), r.value &&
|
|
73
|
-
}),
|
|
74
|
-
r.value &&
|
|
75
|
-
}), (e, l) => (a(), g(f(
|
|
75
|
+
), r.value && D(r.value, $);
|
|
76
|
+
}), F(() => {
|
|
77
|
+
r.value && M(r.value);
|
|
78
|
+
}), (e, l) => (a(), g(f(K), w({ trigger: "hover" }, P.value), {
|
|
76
79
|
title: d(() => [
|
|
77
|
-
|
|
78
|
-
|
|
80
|
+
H(e.$slots, "tooltip", { tags: e.list }, () => [
|
|
81
|
+
J(W(N.value), 1)
|
|
79
82
|
])
|
|
80
83
|
]),
|
|
81
84
|
default: d(() => [
|
|
82
85
|
t("div", {
|
|
83
86
|
ref_key: "container",
|
|
84
87
|
ref: r,
|
|
85
|
-
class: k(
|
|
88
|
+
class: k(R.value),
|
|
86
89
|
style: b({
|
|
87
90
|
pointerEvents: p.value ? "auto" : "none"
|
|
88
91
|
// opacity: isUpdating ? '0' : '1'
|
|
89
92
|
})
|
|
90
93
|
}, [
|
|
91
|
-
(a(!0), _(
|
|
94
|
+
(a(!0), _(U, null, q(e.list, (u, s) => (a(), g(le, w({ ref_for: !0 }, u, {
|
|
92
95
|
key: s,
|
|
93
96
|
style: {
|
|
94
97
|
display: s >= c.value ? "none" : "inline-flex",
|
|
95
98
|
marginRight: `${e.space}px`
|
|
96
99
|
}
|
|
97
100
|
}), null, 16, ["style"]))), 128)),
|
|
98
|
-
p.value && i.value.symbol === "icon" ? (a(), g(f(
|
|
101
|
+
p.value && i.value.symbol === "icon" ? (a(), g(f(O), {
|
|
99
102
|
key: 0,
|
|
100
103
|
style: b({
|
|
101
104
|
color: e.ellipsisColor || i.value.iconColor,
|
|
@@ -160,9 +163,9 @@ const de = /* @__PURE__ */ S({
|
|
|
160
163
|
_: 1
|
|
161
164
|
}, 8, ["style"])) : p.value && i.value.symbol === "text" ? (a(), _("span", {
|
|
162
165
|
key: 1,
|
|
163
|
-
class: k(
|
|
166
|
+
class: k(S.value),
|
|
164
167
|
style: { cursor: "pointer" }
|
|
165
|
-
}, W(i.value.text), 3)) :
|
|
168
|
+
}, W(i.value.text), 3)) : I("", !0)
|
|
166
169
|
], 6)
|
|
167
170
|
]),
|
|
168
171
|
_: 3
|
|
@@ -170,5 +173,5 @@ const de = /* @__PURE__ */ S({
|
|
|
170
173
|
}
|
|
171
174
|
});
|
|
172
175
|
export {
|
|
173
|
-
|
|
176
|
+
ye as default
|
|
174
177
|
};
|