dlzn-ui 1.89.0 → 1.90.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/assets/Index-BfBCL2il.css +1 -0
- package/assets/Index-BvnkRedP.css +2 -0
- package/assets/Index-CgpaCUYu.css +1 -0
- package/assets/Index-Cq5CPPXt.css +1 -0
- package/assets/Index-D8NszkhN.css +1 -0
- package/assets/Index-Y4khRYm7.css +1 -0
- package/assets/table-h04EVpJK.css +1 -0
- package/chunks/Index-BEDBQBqH.mjs +23 -0
- package/chunks/Index-BExLxGm4.mjs +39 -0
- package/chunks/Index-BStfaqzV.mjs +29 -0
- package/chunks/Index-BXWCzgiM.mjs +70 -0
- package/chunks/Index-BZ26MYFd.mjs +32 -0
- package/chunks/Index-BuqrJDKe.mjs +15 -0
- package/chunks/Index-CHCsBymt.mjs +85 -0
- package/chunks/Index-CIfBvBlA.mjs +38 -0
- package/chunks/Index-Cesv9ltS.mjs +14 -0
- package/chunks/Index-CoDY85gh.mjs +42 -0
- package/chunks/Index-D-UsxAx-.mjs +41 -0
- package/chunks/Index-DOX5elbu.mjs +40 -0
- package/chunks/Index-DOnJAYUb.mjs +47 -0
- package/chunks/Index-DU8S7od8.mjs +39 -0
- package/chunks/Index-DujthBDk.mjs +56 -0
- package/chunks/Index-IHnODKpr.mjs +32 -0
- package/chunks/Index-SSYGey9h.mjs +19 -0
- package/chunks/Index-rd9a-AvJ.mjs +22 -0
- package/chunks/Index-tJvyTOBT.mjs +48 -0
- package/chunks/Wrapper-DerfLvaX.mjs +49 -0
- package/chunks/table-G32fdSB1.mjs +393 -0
- package/components/table/index.d.ts +2 -0
- package/components/table/index.mjs +2 -0
- package/components/table/src/table.d.ts +138 -0
- package/components/table/src/table.mjs +2 -0
- package/components/table/src/table.vue.d.ts +58 -0
- package/package.json +1 -1
- package/plugins/tableRenders/Wrapper.mjs +2 -0
- package/plugins/tableRenders/Wrapper.vue.d.ts +16 -0
- package/plugins/tableRenders/cell/Avatar/Index.mjs +2 -0
- package/plugins/tableRenders/cell/Avatar/Index.vue.d.ts +7 -0
- package/plugins/tableRenders/cell/Avatar/index.d.ts +2 -0
- package/plugins/tableRenders/cell/Avatar/index2.mjs +0 -0
- package/plugins/tableRenders/cell/Buttons/Index.mjs +2 -0
- package/plugins/tableRenders/cell/Buttons/Index.vue.d.ts +5 -0
- package/plugins/tableRenders/cell/Buttons/index.d.ts +9 -0
- package/plugins/tableRenders/cell/Buttons/index2.mjs +0 -0
- package/plugins/tableRenders/cell/Default/Index.mjs +2 -0
- package/plugins/tableRenders/cell/Default/Index.vue.d.ts +5 -0
- package/plugins/tableRenders/cell/Default/index.d.ts +3 -0
- package/plugins/tableRenders/cell/Default/index2.mjs +0 -0
- package/plugins/tableRenders/cell/DicLabel/Index.mjs +2 -0
- package/plugins/tableRenders/cell/DicLabel/Index.vue.d.ts +11 -0
- package/plugins/tableRenders/cell/DicLabel/index.d.ts +20 -0
- package/plugins/tableRenders/cell/DicLabel/index2.mjs +0 -0
- package/plugins/tableRenders/cell/FormatDate/Index.mjs +2 -0
- package/plugins/tableRenders/cell/FormatDate/Index.vue.d.ts +5 -0
- package/plugins/tableRenders/cell/FormatDate/index.d.ts +3 -0
- package/plugins/tableRenders/cell/FormatDate/index2.mjs +0 -0
- package/plugins/tableRenders/cell/FormatNumber/Index.mjs +2 -0
- package/plugins/tableRenders/cell/FormatNumber/Index.vue.d.ts +5 -0
- package/plugins/tableRenders/cell/FormatNumber/index.d.ts +4 -0
- package/plugins/tableRenders/cell/FormatNumber/index2.mjs +0 -0
- package/plugins/tableRenders/cell/Icon/Index.mjs +2 -0
- package/plugins/tableRenders/cell/Icon/Index.vue.d.ts +5 -0
- package/plugins/tableRenders/cell/Icon/index.d.ts +4 -0
- package/plugins/tableRenders/cell/Icon/index2.mjs +0 -0
- package/plugins/tableRenders/cell/Image/Index.mjs +2 -0
- package/plugins/tableRenders/cell/Image/Index.vue.d.ts +7 -0
- package/plugins/tableRenders/cell/Image/index.d.ts +2 -0
- package/plugins/tableRenders/cell/Image/index2.mjs +0 -0
- package/plugins/tableRenders/cell/ImageViewer/Index.mjs +2 -0
- package/plugins/tableRenders/cell/ImageViewer/Index.vue.d.ts +14 -0
- package/plugins/tableRenders/cell/ImageViewer/index.d.ts +2 -0
- package/plugins/tableRenders/cell/ImageViewer/index2.mjs +0 -0
- package/plugins/tableRenders/cell/Input/Index.mjs +2 -0
- package/plugins/tableRenders/cell/Input/Index.vue.d.ts +21 -0
- package/plugins/tableRenders/cell/Input/index.d.ts +2 -0
- package/plugins/tableRenders/cell/Input/index2.mjs +0 -0
- package/plugins/tableRenders/cell/InputNumber/Index.mjs +2 -0
- package/plugins/tableRenders/cell/InputNumber/Index.vue.d.ts +23 -0
- package/plugins/tableRenders/cell/InputNumber/index.d.ts +2 -0
- package/plugins/tableRenders/cell/InputNumber/index2.mjs +0 -0
- package/plugins/tableRenders/cell/Link/Index.mjs +2 -0
- package/plugins/tableRenders/cell/Link/Index.vue.d.ts +7 -0
- package/plugins/tableRenders/cell/Link/index.d.ts +2 -0
- package/plugins/tableRenders/cell/Link/index2.mjs +0 -0
- package/plugins/tableRenders/cell/OptionLabel/Index.mjs +2 -0
- package/plugins/tableRenders/cell/OptionLabel/Index.vue.d.ts +13 -0
- package/plugins/tableRenders/cell/OptionLabel/index.d.ts +29 -0
- package/plugins/tableRenders/cell/OptionLabel/index2.mjs +0 -0
- package/plugins/tableRenders/cell/Select/Index.mjs +2 -0
- package/plugins/tableRenders/cell/Select/Index.vue.d.ts +29 -0
- package/plugins/tableRenders/cell/Select/index.d.ts +2 -0
- package/plugins/tableRenders/cell/Select/index2.mjs +0 -0
- package/plugins/tableRenders/cell/Switch/Index.mjs +2 -0
- package/plugins/tableRenders/cell/Switch/Index.vue.d.ts +18 -0
- package/plugins/tableRenders/cell/Switch/index.d.ts +2 -0
- package/plugins/tableRenders/cell/Switch/index2.mjs +0 -0
- package/plugins/tableRenders/cell/Tags/Index.mjs +2 -0
- package/plugins/tableRenders/cell/Tags/Index.vue.d.ts +4 -0
- package/plugins/tableRenders/cell/Tags/index.d.ts +22 -0
- package/plugins/tableRenders/cell/Tags/index2.mjs +0 -0
- package/plugins/tableRenders/cell/TypographyText/Index.mjs +2 -0
- package/plugins/tableRenders/cell/TypographyText/Index.vue.d.ts +7 -0
- package/plugins/tableRenders/cell/TypographyText/index.d.ts +2 -0
- package/plugins/tableRenders/cell/TypographyText/index2.mjs +0 -0
- package/plugins/tableRenders/cell/TypographyTextLink/Index.mjs +2 -0
- package/plugins/tableRenders/cell/TypographyTextLink/Index.vue.d.ts +10 -0
- package/plugins/tableRenders/cell/TypographyTextLink/index.d.ts +6 -0
- package/plugins/tableRenders/cell/TypographyTextLink/index2.mjs +0 -0
- package/plugins/tableRenders/cell/index.d.ts +50 -0
- package/plugins/tableRenders/cell/index.mjs +68 -0
- package/plugins/tableRenders/title/Default/Index.mjs +2 -0
- package/plugins/tableRenders/title/Default/Index.vue.d.ts +5 -0
- package/plugins/tableRenders/title/Default/index.d.ts +3 -0
- package/plugins/tableRenders/title/Default/index2.mjs +0 -0
- package/plugins/tableRenders/title/index.d.ts +16 -0
- package/plugins/tableRenders/title/index.mjs +33 -0
- package/plugins/tableRenders/utils.d.ts +8 -0
- package/plugins/tableRenders/utils.mjs +8 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { n as e, t } from "./link-Byr_BYPx.mjs";
|
|
2
|
+
import { createBlock as n, createTextVNode as r, createVNode as i, defineComponent as a, guardReactiveProps as o, normalizeProps as s, openBlock as c, toDisplayString as l, unref as u, useAttrs as d, withCtx as f } from "vue";
|
|
3
|
+
import { Typography as p } from "tdesign-vue-next";
|
|
4
|
+
import { get as m } from "lodash-es";
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region ../../packages/dlzn-ui/plugins/tableRenders/cell/TypographyTextLink/Index.vue
|
|
7
|
+
var h = /* @__PURE__ */ a({
|
|
8
|
+
inheritAttrs: !1,
|
|
9
|
+
__name: "Index",
|
|
10
|
+
props: {
|
|
11
|
+
link: { default: () => ({}) },
|
|
12
|
+
typographyText: { default: () => ({}) }
|
|
13
|
+
},
|
|
14
|
+
setup(a) {
|
|
15
|
+
let h = d();
|
|
16
|
+
return (d, g) => (c(), n(u(p), s(o({
|
|
17
|
+
...a.typographyText,
|
|
18
|
+
copyable: a.typographyText.copyable === !0 || a.typographyText.copyable === void 0 ? { text: u(m)(u(h).row, u(h).col.colKey) } : a.typographyText.copyable
|
|
19
|
+
})), {
|
|
20
|
+
default: f(() => [i(u(t), s(o({
|
|
21
|
+
...u(e),
|
|
22
|
+
...a.link
|
|
23
|
+
})), {
|
|
24
|
+
default: f(() => [r(l(u(m)(u(h).row, u(h).col.colKey)), 1)]),
|
|
25
|
+
_: 1
|
|
26
|
+
}, 16)]),
|
|
27
|
+
_: 1
|
|
28
|
+
}, 16));
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
//#endregion
|
|
32
|
+
export { h as t };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { formatNumber as e } from "../utils/number.mjs";
|
|
2
|
+
import { computed as t, defineComponent as n, toDisplayString as r, useAttrs as i } from "vue";
|
|
3
|
+
import { get as a } from "lodash-es";
|
|
4
|
+
//#endregion
|
|
5
|
+
//#region ../../packages/dlzn-ui/plugins/tableRenders/cell/FormatNumber/Index.vue
|
|
6
|
+
var o = /* @__PURE__ */ n({
|
|
7
|
+
inheritAttrs: !1,
|
|
8
|
+
__name: "Index",
|
|
9
|
+
props: { config: {} },
|
|
10
|
+
setup(n) {
|
|
11
|
+
let o = n, s = i(), c = t(() => {
|
|
12
|
+
let t = a(s.row, s.col.colKey);
|
|
13
|
+
return e(t, o.config);
|
|
14
|
+
});
|
|
15
|
+
return (e, t) => r(c.value);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
//#endregion
|
|
19
|
+
export { o as t };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { isFalsy as e } from "../utils/boolean.mjs";
|
|
2
|
+
import t from "../plugins/autoImport/dayjs/index.mjs";
|
|
3
|
+
import { computed as n, defineComponent as r, toDisplayString as i, useAttrs as a } from "vue";
|
|
4
|
+
import { get as o } from "lodash-es";
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region ../../packages/dlzn-ui/plugins/tableRenders/cell/FormatDate/Index.vue
|
|
7
|
+
var s = /* @__PURE__ */ r({
|
|
8
|
+
inheritAttrs: !1,
|
|
9
|
+
__name: "Index",
|
|
10
|
+
props: { format: {} },
|
|
11
|
+
setup(r) {
|
|
12
|
+
let s = r, c = a(), l = n(() => {
|
|
13
|
+
let n = o(c.row, c.col.colKey);
|
|
14
|
+
if (e(n)) return "";
|
|
15
|
+
let r = t(n).format(s.format);
|
|
16
|
+
return r === "Invalid Date" ? "" : r;
|
|
17
|
+
});
|
|
18
|
+
return (e, t) => i(l.value);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
//#endregion
|
|
22
|
+
export { s as t };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { isFalsy as e } from "../utils/boolean.mjs";
|
|
2
|
+
import { n as t, t as n } from "./image-viewer-BZux9RvX.mjs";
|
|
3
|
+
import { computed as r, createBlock as i, createCommentVNode as a, defineComponent as o, mergeDefaults as s, mergeProps as c, normalizeProps as l, openBlock as u, unref as d, useAttrs as f } from "vue";
|
|
4
|
+
import { get as p } from "lodash-es";
|
|
5
|
+
import '../assets/Index-BvnkRedP.css';//#endregion
|
|
6
|
+
//#region ../../packages/dlzn-ui/plugins/tableRenders/cell/ImageViewer/Index.vue
|
|
7
|
+
var m = /* @__PURE__ */ o({
|
|
8
|
+
inheritAttrs: !1,
|
|
9
|
+
__name: "Index",
|
|
10
|
+
props: /*@__PURE__*/ s({
|
|
11
|
+
"onUpdate:index": { type: Function },
|
|
12
|
+
"onUpdate:visible": { type: Function },
|
|
13
|
+
attach: { type: [String, Function] },
|
|
14
|
+
closeBtn: { type: Boolean },
|
|
15
|
+
closeOnEscKeydown: { type: Boolean },
|
|
16
|
+
closeOnOverlay: { type: Boolean },
|
|
17
|
+
draggable: { type: Boolean },
|
|
18
|
+
imageReferrerpolicy: {},
|
|
19
|
+
imageScale: {},
|
|
20
|
+
images: {},
|
|
21
|
+
index: {},
|
|
22
|
+
defaultIndex: {},
|
|
23
|
+
mode: {},
|
|
24
|
+
navigationArrow: { type: Boolean },
|
|
25
|
+
showOverlay: { type: Boolean },
|
|
26
|
+
title: {},
|
|
27
|
+
trigger: {},
|
|
28
|
+
viewerScale: {},
|
|
29
|
+
visible: { type: Boolean },
|
|
30
|
+
defaultVisible: { type: Boolean },
|
|
31
|
+
zIndex: {},
|
|
32
|
+
onClose: { type: Function },
|
|
33
|
+
onDownload: { type: Function },
|
|
34
|
+
onIndexChange: { type: Function }
|
|
35
|
+
}, { ...t }),
|
|
36
|
+
setup(t) {
|
|
37
|
+
let o = t, s = f(), m = r(() => {
|
|
38
|
+
let t = p(s.row, s.col.colKey);
|
|
39
|
+
return {
|
|
40
|
+
...o,
|
|
41
|
+
images: e(o.images) ? e(t) ? [] : [t] : o.images
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
return (t, r) => !d(e)(m.value.images) && m.value.images.length > 0 ? (u(), i(d(n), l(c({ key: 0 }, m.value)), null, 16)) : a("v-if", !0);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
//#endregion
|
|
48
|
+
export { m as t };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { createBlock as e, createElementBlock as t, createElementVNode as n, defineComponent as r, inject as i, onMounted as a, onUpdated as o, openBlock as s, ref as c, renderSlot as l, resolveComponent as u, useAttrs as d, useTemplateRef as f, withCtx as p } from "vue";
|
|
2
|
+
import { useMutationObserver as m, useThrottleFn as h } from "@vueuse/core";
|
|
3
|
+
//#region ../../packages/dlzn-ui/plugins/tableRenders/Wrapper.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var g = { class: "inline-flex max-w-full align-middle" }, _ = 25, v = /* @__PURE__ */ r({
|
|
5
|
+
inheritAttrs: !1,
|
|
6
|
+
__name: "Wrapper",
|
|
7
|
+
setup(r) {
|
|
8
|
+
let v = i("_columnWidths"), y = i("columnMinWidths"), b = i("columnMaxWidths"), x = d(), S = f("wrapperRef"), C = c(!1), w = c(""), T = h(() => {
|
|
9
|
+
if (S.value === null) return;
|
|
10
|
+
let e = S.value.closest("td, th"), t = S.value.getBoundingClientRect().width, n = S.value.scrollWidth, r = e.getBoundingClientRect().width, i = x.col.colKey, a = b[i], o = 0, s = e.querySelector(".t-table__tree-op-icon");
|
|
11
|
+
s && (o = s.getBoundingClientRect().width + Number.parseFloat(getComputedStyle(s).marginRight));
|
|
12
|
+
let c = 0, l = e.querySelector(".t-table__tree-col");
|
|
13
|
+
l && (c = Number.parseFloat(getComputedStyle(l).paddingLeft));
|
|
14
|
+
let u = 0, d = e.querySelector(".t-table__filter-icon-wrap");
|
|
15
|
+
d && (u = d.getBoundingClientRect().width + Number.parseFloat(getComputedStyle(d).marginLeft)), C.value = n > S.value.clientWidth, w.value = S.value.textContent.trim() ?? "";
|
|
16
|
+
let f = Math.ceil(Math.max(t, n) + _ + o + c + u), p = Math.max(Math.min(f, a), y[i]);
|
|
17
|
+
p > v.value[i] && (p <= r ? y[i] = p : v.value[i] = p + 2);
|
|
18
|
+
}, 500, !0);
|
|
19
|
+
return a(T), o(T), m(S, (e) => {
|
|
20
|
+
e.forEach(() => {
|
|
21
|
+
T();
|
|
22
|
+
});
|
|
23
|
+
}, {
|
|
24
|
+
characterData: !0,
|
|
25
|
+
childList: !0,
|
|
26
|
+
subtree: !0
|
|
27
|
+
}), (r, i) => {
|
|
28
|
+
let a = u("TTooltip");
|
|
29
|
+
return s(), t("div", g, [C.value ? (s(), e(a, {
|
|
30
|
+
key: 0,
|
|
31
|
+
content: w.value
|
|
32
|
+
}, {
|
|
33
|
+
default: p(() => [n("div", {
|
|
34
|
+
ref_key: "wrapperRef",
|
|
35
|
+
ref: S,
|
|
36
|
+
class: "overflow-hidden text-ellipsis whitespace-nowrap"
|
|
37
|
+
}, [l(r.$slots, "default")], 512)]),
|
|
38
|
+
_: 3
|
|
39
|
+
}, 8, ["content"])) : (s(), t("div", {
|
|
40
|
+
key: 1,
|
|
41
|
+
ref_key: "wrapperRef",
|
|
42
|
+
ref: S,
|
|
43
|
+
class: "overflow-hidden text-ellipsis whitespace-nowrap"
|
|
44
|
+
}, [l(r.$slots, "default")], 512))]);
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
//#endregion
|
|
49
|
+
export { v as t };
|
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
import { n as e } from "./useAppContext-D47amIp5.mjs";
|
|
2
|
+
import { isFalsy as t } from "../utils/boolean.mjs";
|
|
3
|
+
import n from "../plugins/autoImport/$dialog/index.mjs";
|
|
4
|
+
import { t as r } from "./plugin-vue_export-helper-B3ysoDQm.mjs";
|
|
5
|
+
import { t as i } from "./checkbox-group-D7jGdbHp.mjs";
|
|
6
|
+
import a from "../hooks/useMQ/index.mjs";
|
|
7
|
+
import { getCellRender as o } from "../plugins/tableRenders/cell/index.mjs";
|
|
8
|
+
import { getTitleRender as ee } from "../plugins/tableRenders/title/index.mjs";
|
|
9
|
+
import { Teleport as te, computed as s, createBlock as c, createCommentVNode as l, createElementVNode as u, createSlots as ne, createVNode as d, defineComponent as f, getCurrentInstance as re, guardReactiveProps as p, h as m, mergeDefaults as h, mergeProps as g, nextTick as ie, normalizeClass as ae, normalizeProps as _, onMounted as oe, onUnmounted as se, openBlock as v, provide as y, ref as b, renderList as ce, renderSlot as x, resolveComponent as S, resolveDynamicComponent as le, unref as C, useCssVars as ue, useTemplateRef as de, watch as w, withCtx as T } from "vue";
|
|
10
|
+
import { refDebounced as E, useElementSize as D, useLocalStorage as fe } from "@vueuse/core";
|
|
11
|
+
import { EnhancedTable as pe } from "tdesign-vue-next";
|
|
12
|
+
import { difference as me, uniqueId as he } from "lodash-es";
|
|
13
|
+
import { useRoute as ge } from "vue-router";
|
|
14
|
+
import '../assets/table-h04EVpJK.css';//#region ../../packages/dlzn-ui/components/table/src/table.ts
|
|
15
|
+
var O = {
|
|
16
|
+
attach: "body",
|
|
17
|
+
bordered: !0,
|
|
18
|
+
checkSelectedOnDataChange: !0,
|
|
19
|
+
disableDataPage: !0,
|
|
20
|
+
disableSpaceInactiveRow: !0,
|
|
21
|
+
expandOnRowClick: !0,
|
|
22
|
+
flexHeight: !1,
|
|
23
|
+
hideSortTips: !0,
|
|
24
|
+
hover: !0,
|
|
25
|
+
lazyLoad: !0,
|
|
26
|
+
maxHeight: 507,
|
|
27
|
+
resizable: !0,
|
|
28
|
+
rowSelectionAllowUncheck: !1,
|
|
29
|
+
scroll: () => ({
|
|
30
|
+
bufferSize: 10,
|
|
31
|
+
rowHeight: 45,
|
|
32
|
+
threshold: 80,
|
|
33
|
+
type: "virtual"
|
|
34
|
+
}),
|
|
35
|
+
selectOnRowClick: !0,
|
|
36
|
+
showHeader: !0,
|
|
37
|
+
showSerialNumber: !0,
|
|
38
|
+
showSortColumnBgColor: !0,
|
|
39
|
+
showToggleFullscreenBtn: !1,
|
|
40
|
+
stripe: !0,
|
|
41
|
+
tableLayout: "fixed",
|
|
42
|
+
tree: () => ({
|
|
43
|
+
indent: 41,
|
|
44
|
+
treeNodeColumnIndex: 0
|
|
45
|
+
})
|
|
46
|
+
}, _e = { class: "table_operations_wrapper items-end justify-end gap-3" }, ve = { class: "flex flex-1 items-end" }, k = /*#__PURE__*/ r(/* @__PURE__ */ f({
|
|
47
|
+
inheritAttrs: !1,
|
|
48
|
+
__name: "table",
|
|
49
|
+
props: /*@__PURE__*/ h({
|
|
50
|
+
checkSelectedOnDataChange: { type: Boolean },
|
|
51
|
+
columns: {},
|
|
52
|
+
data: {},
|
|
53
|
+
flexHeight: { type: Boolean },
|
|
54
|
+
"onUpdate:selectedRowKeys": { type: Function },
|
|
55
|
+
rowKey: {},
|
|
56
|
+
showColumnConfigBtn: { type: Boolean },
|
|
57
|
+
showRowSelect: {},
|
|
58
|
+
showSerialNumber: { type: Boolean },
|
|
59
|
+
showToggleFullscreenBtn: { type: Boolean },
|
|
60
|
+
beforeDragSort: { type: Function },
|
|
61
|
+
expandedTreeNodes: {},
|
|
62
|
+
defaultExpandedTreeNodes: {},
|
|
63
|
+
tree: {},
|
|
64
|
+
onAbnormalDragSort: { type: Function },
|
|
65
|
+
onExpandedTreeNodesChange: { type: Function },
|
|
66
|
+
asyncLoading: {},
|
|
67
|
+
columnController: {},
|
|
68
|
+
columnControllerVisible: { type: Boolean },
|
|
69
|
+
defaultColumnControllerVisible: { type: Boolean },
|
|
70
|
+
displayColumns: {},
|
|
71
|
+
defaultDisplayColumns: {},
|
|
72
|
+
dragSort: {},
|
|
73
|
+
dragSortOptions: {},
|
|
74
|
+
editableCellState: { type: Function },
|
|
75
|
+
editableRowKeys: {},
|
|
76
|
+
expandIcon: { type: Boolean },
|
|
77
|
+
expandOnRowClick: { type: Boolean },
|
|
78
|
+
expandedRow: {},
|
|
79
|
+
expandedRowKeys: {},
|
|
80
|
+
defaultExpandedRowKeys: {},
|
|
81
|
+
filterIcon: {},
|
|
82
|
+
filterRow: {},
|
|
83
|
+
filterValue: {},
|
|
84
|
+
defaultFilterValue: {},
|
|
85
|
+
hideSortTips: { type: Boolean },
|
|
86
|
+
indeterminateSelectedRowKeys: {},
|
|
87
|
+
multipleSort: { type: Boolean },
|
|
88
|
+
reserveSelectedRowOnPaginate: { type: Boolean },
|
|
89
|
+
rowSelectionAllowUncheck: { type: Boolean },
|
|
90
|
+
rowSelectionType: {},
|
|
91
|
+
selectOnRowClick: { type: Boolean },
|
|
92
|
+
selectedRowKeys: {},
|
|
93
|
+
defaultSelectedRowKeys: {},
|
|
94
|
+
showSortColumnBgColor: { type: Boolean },
|
|
95
|
+
sort: {},
|
|
96
|
+
defaultSort: {},
|
|
97
|
+
sortIcon: {},
|
|
98
|
+
onAsyncLoadingClick: { type: Function },
|
|
99
|
+
onCellClick: { type: Function },
|
|
100
|
+
onChange: { type: Function },
|
|
101
|
+
onColumnChange: { type: Function },
|
|
102
|
+
onColumnControllerVisibleChange: { type: Function },
|
|
103
|
+
onDataChange: { type: Function },
|
|
104
|
+
onDisplayColumnsChange: { type: Function },
|
|
105
|
+
onDragSort: { type: Function },
|
|
106
|
+
onExpandChange: { type: Function },
|
|
107
|
+
onFilterChange: { type: Function },
|
|
108
|
+
onRowEdit: { type: Function },
|
|
109
|
+
onRowValidate: { type: Function },
|
|
110
|
+
onSelectChange: { type: Function },
|
|
111
|
+
onSortChange: { type: Function },
|
|
112
|
+
onValidate: { type: Function },
|
|
113
|
+
activeRowKeys: {},
|
|
114
|
+
defaultActiveRowKeys: {},
|
|
115
|
+
activeRowType: {},
|
|
116
|
+
attach: { type: [String, Function] },
|
|
117
|
+
bordered: { type: Boolean },
|
|
118
|
+
bottomContent: {},
|
|
119
|
+
cellEmptyContent: {},
|
|
120
|
+
disableDataPage: { type: Boolean },
|
|
121
|
+
disableSpaceInactiveRow: { type: Boolean },
|
|
122
|
+
empty: {},
|
|
123
|
+
firstFullRow: {},
|
|
124
|
+
footData: {},
|
|
125
|
+
footerAffixedBottom: { type: [Boolean, Object] },
|
|
126
|
+
footerSummary: {},
|
|
127
|
+
headerAffixedTop: { type: [Boolean, Object] },
|
|
128
|
+
height: {},
|
|
129
|
+
horizontalScrollAffixedBottom: { type: [Boolean, Object] },
|
|
130
|
+
hover: { type: Boolean },
|
|
131
|
+
keyboardRowHover: { type: Boolean },
|
|
132
|
+
lastFullRow: {},
|
|
133
|
+
lazyLoad: { type: Boolean },
|
|
134
|
+
loading: { type: Boolean },
|
|
135
|
+
loadingProps: {},
|
|
136
|
+
locale: {},
|
|
137
|
+
maxHeight: {},
|
|
138
|
+
pagination: {},
|
|
139
|
+
paginationAffixedBottom: { type: [Boolean, Object] },
|
|
140
|
+
resizable: { type: Boolean },
|
|
141
|
+
rowAttributes: { type: [
|
|
142
|
+
Object,
|
|
143
|
+
Function,
|
|
144
|
+
Array
|
|
145
|
+
] },
|
|
146
|
+
rowClassName: { type: [
|
|
147
|
+
Object,
|
|
148
|
+
Array,
|
|
149
|
+
String,
|
|
150
|
+
Function
|
|
151
|
+
] },
|
|
152
|
+
rowspanAndColspan: { type: Function },
|
|
153
|
+
rowspanAndColspanInFooter: { type: Function },
|
|
154
|
+
scroll: {},
|
|
155
|
+
showHeader: { type: Boolean },
|
|
156
|
+
size: {},
|
|
157
|
+
stripe: { type: Boolean },
|
|
158
|
+
tableContentWidth: {},
|
|
159
|
+
tableLayout: {},
|
|
160
|
+
topContent: {},
|
|
161
|
+
verticalAlign: {},
|
|
162
|
+
onActiveChange: { type: Function },
|
|
163
|
+
onActiveRowAction: { type: Function },
|
|
164
|
+
onColumnResizeChange: { type: Function },
|
|
165
|
+
onPageChange: { type: Function },
|
|
166
|
+
onRowClick: { type: Function },
|
|
167
|
+
onRowDblclick: { type: Function },
|
|
168
|
+
onRowMousedown: { type: Function },
|
|
169
|
+
onRowMouseenter: { type: Function },
|
|
170
|
+
onRowMouseleave: { type: Function },
|
|
171
|
+
onRowMouseover: { type: Function },
|
|
172
|
+
onRowMouseup: { type: Function },
|
|
173
|
+
onScroll: { type: Function },
|
|
174
|
+
onScrollX: { type: Function },
|
|
175
|
+
onScrollY: { type: Function }
|
|
176
|
+
}, O),
|
|
177
|
+
setup(r, { expose: f }) {
|
|
178
|
+
ue((e) => ({
|
|
179
|
+
v58791ab8: C(J),
|
|
180
|
+
v9adde29c: C(Y),
|
|
181
|
+
v1187c278: C(X)
|
|
182
|
+
}));
|
|
183
|
+
let h = r, O = ge();
|
|
184
|
+
function k(e) {
|
|
185
|
+
let n = e.find((e) => t(e.colKey));
|
|
186
|
+
if (n !== void 0) return `列的colKey不能为空: ${JSON.stringify(n)}`;
|
|
187
|
+
let r = e.find((t, n) => e.findIndex((e) => e.colKey === t.colKey) !== n);
|
|
188
|
+
return r === void 0 || `列的colKey不能重复: ${JSON.stringify(r)}`;
|
|
189
|
+
}
|
|
190
|
+
let A = s(() => {
|
|
191
|
+
if (k(h.columns) !== !0) return [];
|
|
192
|
+
let e = h.columns.filter((e) => e.visible !== !1).map((e) => {
|
|
193
|
+
let t = { ...e };
|
|
194
|
+
return delete t.visible, t;
|
|
195
|
+
}), t = e.some((e) => e.fixed === "left");
|
|
196
|
+
if (h.showRowSelect && !e.some((e) => e.colKey === "row-select")) {
|
|
197
|
+
let n = e.findIndex((e) => e.colKey === "serial-number");
|
|
198
|
+
e.splice(n === -1 ? 0 : n, 0, {
|
|
199
|
+
colKey: "row-select",
|
|
200
|
+
fixed: t ? "left" : void 0,
|
|
201
|
+
title: "选择",
|
|
202
|
+
type: h.showRowSelect
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
return h.showSerialNumber && !e.some((e) => e.colKey === "serial-number") && e.unshift({
|
|
206
|
+
align: "center",
|
|
207
|
+
colKey: "serial-number",
|
|
208
|
+
fixed: t ? "left" : void 0,
|
|
209
|
+
title: "序号"
|
|
210
|
+
}), e;
|
|
211
|
+
});
|
|
212
|
+
w(() => k(h.columns), (t) => {
|
|
213
|
+
t !== !0 && e.error(t);
|
|
214
|
+
}, { immediate: !0 });
|
|
215
|
+
let j = s(() => h.data.map((e, t) => Object.assign(e, { _ROW_KEY: he(String(t)) }))), M = b({}), N = E(M, 600), P = {}, F = {}, I = b([]), L = s(() => A.value.filter((e) => !t(e.title) && !["row-select", "serial-number"].includes(e.colKey) && !e.colKey.startsWith("_")).map((e) => ({
|
|
216
|
+
label: e.title,
|
|
217
|
+
value: e.colKey
|
|
218
|
+
}))), R = s(() => L.value.map((e) => e.value).join("_")), z = fe(R, []);
|
|
219
|
+
function ye(e) {
|
|
220
|
+
return {
|
|
221
|
+
maxWidth: e.resize?.maxWidth ?? Infinity,
|
|
222
|
+
minWidth: e.resize?.minWidth ?? 60
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
w(A, (e) => {
|
|
226
|
+
e.forEach((e) => {
|
|
227
|
+
let t = ye(e);
|
|
228
|
+
M.value[e.colKey] = t.minWidth, P[e.colKey] = t.minWidth, F[e.colKey] = t.maxWidth;
|
|
229
|
+
});
|
|
230
|
+
}, {
|
|
231
|
+
deep: !0,
|
|
232
|
+
immediate: !0
|
|
233
|
+
});
|
|
234
|
+
let be = a.isMd, B = s(() => A.value.filter((e) => h.showColumnConfigBtn && !z.value.includes(e.colKey) || !h.showColumnConfigBtn).map((e) => {
|
|
235
|
+
let t = ye(e);
|
|
236
|
+
return {
|
|
237
|
+
stopPropagation: !0,
|
|
238
|
+
...e,
|
|
239
|
+
cell: o(e.cell),
|
|
240
|
+
ellipsis: !1,
|
|
241
|
+
ellipsisTitle: !1,
|
|
242
|
+
fixed: be.value ? void 0 : e.fixed ?? (e.colKey === "_operation" ? "right" : void 0),
|
|
243
|
+
resize: t,
|
|
244
|
+
title: ee(e.title),
|
|
245
|
+
width: N.value[e.colKey]
|
|
246
|
+
};
|
|
247
|
+
}));
|
|
248
|
+
function xe() {
|
|
249
|
+
let e = h.data;
|
|
250
|
+
if (e.length === 0) return;
|
|
251
|
+
let t = Object.keys(e[0]);
|
|
252
|
+
if (t.includes("id")) return "id";
|
|
253
|
+
if (t.includes("key")) return "key";
|
|
254
|
+
}
|
|
255
|
+
let V = s(() => {
|
|
256
|
+
let e = { ...h };
|
|
257
|
+
return e.rowKey = h.rowKey ?? xe() ?? "_ROW_KEY", delete e.columns, delete e.data, delete e.showToggleFullscreenBtn, delete e.showColumnConfigBtn, delete e.flexHeight, delete e.showRowSelect, delete e.showSerialNumber, delete e.checkSelectedOnDataChange, Object.keys(e).forEach((t) => {
|
|
258
|
+
e[t] === void 0 && delete e[t];
|
|
259
|
+
}), e;
|
|
260
|
+
}), H = b(!1);
|
|
261
|
+
w(() => O.name, () => {
|
|
262
|
+
H.value = !1;
|
|
263
|
+
}), w([L, z], ([e, t]) => {
|
|
264
|
+
I.value = e.filter((e) => !t.includes(e.value)).map((e) => e.value);
|
|
265
|
+
}, { immediate: !0 });
|
|
266
|
+
function Se() {
|
|
267
|
+
n({
|
|
268
|
+
body: () => m(i, {
|
|
269
|
+
class: "flex-col",
|
|
270
|
+
modelValue: I.value,
|
|
271
|
+
"onUpdate:modelValue": (e) => {
|
|
272
|
+
z.value = L.value.filter((t) => !e.includes(t.value)).map((e) => e.value);
|
|
273
|
+
},
|
|
274
|
+
options: L.value
|
|
275
|
+
}),
|
|
276
|
+
closeOnOverlayClick: !0,
|
|
277
|
+
dialogClassName: "!min-w-[auto]",
|
|
278
|
+
footer: !1,
|
|
279
|
+
header: "请勾选要显示的列"
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
let U = de("tableParentRef"), { height: Ce } = D(U), W = b(null), G = b(null), K = b(null), q = b(null), { height: J } = D(W), { height: we } = D(G), { height: Y } = D(K), { height: Te } = D(q), Ee = s(() => Math.max(0, Te.value - J.value - we.value - Y.value)), X = E(Ee, 100), Z = b(h.defaultSelectedRowKeys ?? []), Q = s({
|
|
283
|
+
get: () => Object.hasOwn(h, "selectedRowKeys") && h.selectedRowKeys !== void 0 ? h.selectedRowKeys : Z.value,
|
|
284
|
+
set: (e) => {
|
|
285
|
+
h["onUpdate:selectedRowKeys"]?.(e), Z.value = e;
|
|
286
|
+
}
|
|
287
|
+
}), De = pe, $ = re();
|
|
288
|
+
function Oe(e) {
|
|
289
|
+
e !== null && (e.selectedRows = s(() => j.value.filter((e) => Q.value.includes(e[V.value.rowKey]))), e.selectedRowKeys = Q, e.rowKey = s(() => V.value.rowKey)), $.exposed = e ?? {};
|
|
290
|
+
}
|
|
291
|
+
w([N, z], () => {
|
|
292
|
+
ie(() => {
|
|
293
|
+
$.exposed.refreshTable();
|
|
294
|
+
});
|
|
295
|
+
}, { deep: !0 }), oe(() => {
|
|
296
|
+
W.value = U.value.querySelector("thead"), G.value = U.value.querySelector("tbody"), K.value = U.value.querySelector("tfoot"), q.value = U.value.querySelector(".t-table__content");
|
|
297
|
+
});
|
|
298
|
+
function ke() {
|
|
299
|
+
W.value = U.value.querySelector("thead"), G.value = U.value.querySelector("tbody"), K.value = U.value.querySelector("tfoot"), q.value = U.value.querySelector(".t-table__content");
|
|
300
|
+
}
|
|
301
|
+
return se(() => {
|
|
302
|
+
z.value.length === 0 && localStorage.removeItem(R.value), W.value = null, G.value = null, K.value = null, q.value = null;
|
|
303
|
+
}), w(() => h.data, () => {
|
|
304
|
+
if (!h.checkSelectedOnDataChange) return;
|
|
305
|
+
let e = V.value.rowKey, t = Q.value.filter((t) => h.data.some((n) => n[e] === t));
|
|
306
|
+
me(Q.value, t).length > 0 && (Q.value = t, h.onSelectChange?.(t, {
|
|
307
|
+
currentRowKey: "DATA_CHANGE",
|
|
308
|
+
selectedRowData: j.value.filter((n) => t.includes(n[e])),
|
|
309
|
+
type: "uncheck"
|
|
310
|
+
}));
|
|
311
|
+
}, { deep: 2 }), y("columnMinWidths", P), y("columnMaxWidths", F), y("_columnWidths", M), f({}), (e, t) => {
|
|
312
|
+
let n = S("TIcon"), i = S("TButton"), a = S("TTooltip"), o = S("TEmpty");
|
|
313
|
+
return v(), c(te, {
|
|
314
|
+
disabled: !H.value,
|
|
315
|
+
to: "#app"
|
|
316
|
+
}, [u("div", g({ class: ["flex w-full flex-col gap-3", {
|
|
317
|
+
"flex-1 overflow-y-auto": r.flexHeight || H.value,
|
|
318
|
+
"full_screen bg-(--td-bg-color-container) p-4": H.value,
|
|
319
|
+
transform_tfoot: C(X) > 0
|
|
320
|
+
}] }, e.$attrs), [
|
|
321
|
+
u("div", _e, [
|
|
322
|
+
u("div", ve, [x(e.$slots, "table-operations", _(p({
|
|
323
|
+
columns: B.value,
|
|
324
|
+
data: j.value
|
|
325
|
+
})), void 0, !0)]),
|
|
326
|
+
r.showColumnConfigBtn ? (v(), c(a, {
|
|
327
|
+
key: 0,
|
|
328
|
+
content: "列显示配置"
|
|
329
|
+
}, {
|
|
330
|
+
default: T(() => [d(i, {
|
|
331
|
+
shape: "square",
|
|
332
|
+
variant: "outline",
|
|
333
|
+
onClick: Se
|
|
334
|
+
}, {
|
|
335
|
+
icon: T(() => [d(n, { icon: "mingcute:column-line" })]),
|
|
336
|
+
_: 1
|
|
337
|
+
})]),
|
|
338
|
+
_: 1
|
|
339
|
+
})) : l("v-if", !0),
|
|
340
|
+
r.showToggleFullscreenBtn ? (v(), c(a, {
|
|
341
|
+
key: 1,
|
|
342
|
+
content: H.value ? "退出全屏" : "全屏显示"
|
|
343
|
+
}, {
|
|
344
|
+
default: T(() => [d(i, {
|
|
345
|
+
class: "ml-0!",
|
|
346
|
+
shape: "square",
|
|
347
|
+
variant: "outline",
|
|
348
|
+
onClick: t[0] ||= (e) => H.value = !H.value
|
|
349
|
+
}, {
|
|
350
|
+
icon: T(() => [d(n, { icon: H.value ? "lsicon:screen-off-filled" : "lsicon:fit-screen-outline" }, null, 8, ["icon"])]),
|
|
351
|
+
_: 1
|
|
352
|
+
})]),
|
|
353
|
+
_: 1
|
|
354
|
+
}, 8, ["content"])) : l("v-if", !0)
|
|
355
|
+
]),
|
|
356
|
+
x(e.$slots, "table-top", _(p({
|
|
357
|
+
columns: B.value,
|
|
358
|
+
data: j.value
|
|
359
|
+
})), void 0, !0),
|
|
360
|
+
u("div", {
|
|
361
|
+
ref_key: "tableParentRef",
|
|
362
|
+
ref: U,
|
|
363
|
+
class: ae(["table_parent", { "flex-1 overflow-y-hidden": r.flexHeight || H.value }])
|
|
364
|
+
}, [(v(), c(le(m(C(De), g({}, {
|
|
365
|
+
...V.value,
|
|
366
|
+
ref: Oe,
|
|
367
|
+
columns: B.value,
|
|
368
|
+
data: j.value,
|
|
369
|
+
height: r.flexHeight || H.value ? C(Ce) : V.value.height,
|
|
370
|
+
maxHeight: r.flexHeight || H.value ? void 0 : V.value.maxHeight,
|
|
371
|
+
resizable: V.value.bordered ? V.value.resizable : !1
|
|
372
|
+
}))), {
|
|
373
|
+
"selected-row-keys": Q.value,
|
|
374
|
+
"onUpdate:selectedRowKeys": t[1] ||= (e) => Q.value = e,
|
|
375
|
+
onVnodeUpdated: ke
|
|
376
|
+
}, ne({ _: 2 }, [ce(Object.keys(e.$slots), (t) => ({
|
|
377
|
+
name: t,
|
|
378
|
+
fn: T((n) => [x(e.$slots, t, _(p(n)), void 0, !0)])
|
|
379
|
+
})), Object.hasOwn(e.$slots, "empty") ? void 0 : {
|
|
380
|
+
name: "empty",
|
|
381
|
+
fn: T(() => [d(o)]),
|
|
382
|
+
key: "0"
|
|
383
|
+
}]), 1064, ["selected-row-keys"]))], 2),
|
|
384
|
+
x(e.$slots, "table-bottom", _(p({
|
|
385
|
+
columns: B.value,
|
|
386
|
+
data: j.value
|
|
387
|
+
})), void 0, !0)
|
|
388
|
+
], 16)], 8, ["disabled"]);
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
}), [["__scopeId", "data-v-3f963c12"]]);
|
|
392
|
+
//#endregion
|
|
393
|
+
export { O as n, k as t };
|