tm-table 1.1.9 → 1.1.10
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/dist/vue2/tm-table.es.js +55 -56
- package/dist/vue2/tm-table.umd.js +1 -1
- package/dist/vue3/tm-table.es.js +198 -194
- package/dist/vue3/tm-table.umd.js +1 -1
- package/package.json +1 -1
package/dist/vue2/tm-table.es.js
CHANGED
|
@@ -100,7 +100,7 @@ const x = (t) => t, f = () => "mini", X = {
|
|
|
100
100
|
copySuccess: "Copy successfully",
|
|
101
101
|
copyFailed: "Copy failed"
|
|
102
102
|
};
|
|
103
|
-
var
|
|
103
|
+
var A;
|
|
104
104
|
const ee = {
|
|
105
105
|
"zh-CN": X,
|
|
106
106
|
"en-US": Z
|
|
@@ -108,7 +108,7 @@ const ee = {
|
|
|
108
108
|
let v = { value: "zh-CN" };
|
|
109
109
|
{
|
|
110
110
|
const t = require("vue");
|
|
111
|
-
t.observable || (
|
|
111
|
+
t.observable || (A = t.default) != null && A.observable ? v = t.default.observable(v) : v = new t({
|
|
112
112
|
data() {
|
|
113
113
|
return { currentLang: v };
|
|
114
114
|
}
|
|
@@ -291,7 +291,7 @@ var ne = function() {
|
|
|
291
291
|
null,
|
|
292
292
|
"467dcdd3"
|
|
293
293
|
);
|
|
294
|
-
const
|
|
294
|
+
const R = oe.exports, ue = {
|
|
295
295
|
name: "BaseIcon",
|
|
296
296
|
props: {
|
|
297
297
|
path: {
|
|
@@ -445,7 +445,7 @@ const ye = p.more, ve = p["fixed-left"], Ce = p["fixed-right"], xe = p.upload, _
|
|
|
445
445
|
});
|
|
446
446
|
},
|
|
447
447
|
performOverflowCheck() {
|
|
448
|
-
var
|
|
448
|
+
var d;
|
|
449
449
|
const t = this.$refs.textEl;
|
|
450
450
|
if (!t) return;
|
|
451
451
|
const e = getComputedStyle(t);
|
|
@@ -461,7 +461,7 @@ const ye = p.more, ve = p["fixed-left"], Ce = p["fixed-right"], xe = p.upload, _
|
|
|
461
461
|
const m = parseFloat(e.lineHeight) || 16;
|
|
462
462
|
this.currentLines = Math.ceil(s / m);
|
|
463
463
|
} else {
|
|
464
|
-
const m = t.getBoundingClientRect(), C = (
|
|
464
|
+
const m = t.getBoundingClientRect(), C = (d = t.parentElement) == null ? void 0 : d.getBoundingClientRect();
|
|
465
465
|
if (C) {
|
|
466
466
|
const Q = m.height > C.height || m.width > C.width;
|
|
467
467
|
this.isOverflow = Q;
|
|
@@ -674,7 +674,7 @@ var De = function() {
|
|
|
674
674
|
}), [s("div", { staticClass: "popover-content" }, [s("p", { staticClass: "popover-subtitle" }, [e._v(e._s(e.t("accurateSearchTips")))]), s("el-input", { staticStyle: { "font-size": "12px" }, attrs: { size: e.getDefaultSize(), type: "textarea", rows: 8, placeholder: e.t("accurateSearchPlaceholder") }, model: { value: e.exactValue, callback: function(i) {
|
|
675
675
|
e.exactValue = i;
|
|
676
676
|
}, expression: "exactValue" } }), s("div", { staticClass: "popover-footer" }, [s("el-button", { staticStyle: { float: "left" }, attrs: { size: e.getCompatSize("mini") }, on: { click: e.handleClear } }, [e._v(e._s(e.t("clear")))]), s("el-button", { attrs: { size: e.getCompatSize("mini") }, on: { click: e.handlePopoverClose } }, [e._v(e._s(e.t("cancel")))]), s("el-button", { attrs: { type: "primary", size: e.getCompatSize("mini") }, on: { click: e.handleExactSearch } }, [e._v(e._s(e.t("search")))])], 1)], 1)]) : e._e()], 1)], 1);
|
|
677
|
-
}, Me = [],
|
|
677
|
+
}, Me = [], Ae = /* @__PURE__ */ c(
|
|
678
678
|
Oe,
|
|
679
679
|
De,
|
|
680
680
|
Me,
|
|
@@ -682,7 +682,7 @@ var De = function() {
|
|
|
682
682
|
null,
|
|
683
683
|
"6b474dac"
|
|
684
684
|
);
|
|
685
|
-
const E =
|
|
685
|
+
const E = Ae.exports, { t: h } = b(), Re = !0, He = !1, Ee = "value", Pe = {
|
|
686
686
|
name: "TmAdvancedDateFilter",
|
|
687
687
|
components: {
|
|
688
688
|
EllipsisText: _
|
|
@@ -802,12 +802,12 @@ const E = Re.exports, { t: d } = b(), Ae = !0, He = !1, Ee = "value", Pe = {
|
|
|
802
802
|
// 计算开始占位符
|
|
803
803
|
computedStartPlaceholder() {
|
|
804
804
|
if (this.isRangeType)
|
|
805
|
-
return this.startPlaceholder !== void 0 ? this.startPlaceholder :
|
|
805
|
+
return this.startPlaceholder !== void 0 ? this.startPlaceholder : h("startDate");
|
|
806
806
|
},
|
|
807
807
|
// 计算结束占位符
|
|
808
808
|
computedEndPlaceholder() {
|
|
809
809
|
if (this.isRangeType)
|
|
810
|
-
return this.endPlaceholder !== void 0 ? this.endPlaceholder :
|
|
810
|
+
return this.endPlaceholder !== void 0 ? this.endPlaceholder : h("endDate");
|
|
811
811
|
},
|
|
812
812
|
// 计算日期选择器样式
|
|
813
813
|
computedDatePickerStyle() {
|
|
@@ -824,42 +824,42 @@ const E = Re.exports, { t: d } = b(), Ae = !0, He = !1, Ee = "value", Pe = {
|
|
|
824
824
|
const e = this.type === "datetimerange";
|
|
825
825
|
t.shortcuts = this.shortcuts.length > 0 ? this.shortcuts : [
|
|
826
826
|
{
|
|
827
|
-
text:
|
|
827
|
+
text: h("today"),
|
|
828
828
|
onClick(s) {
|
|
829
829
|
const i = /* @__PURE__ */ new Date(), a = /* @__PURE__ */ new Date();
|
|
830
830
|
e && (a.setHours(0, 0, 0, 0), i.setHours(23, 59, 59, 999)), s.$emit("pick", [a, i]);
|
|
831
831
|
}
|
|
832
832
|
},
|
|
833
833
|
{
|
|
834
|
-
text:
|
|
834
|
+
text: h("yesterday"),
|
|
835
835
|
onClick(s) {
|
|
836
836
|
const i = /* @__PURE__ */ new Date(), a = /* @__PURE__ */ new Date();
|
|
837
837
|
a.setTime(a.getTime() - 3600 * 1e3 * 24), i.setTime(i.getTime() - 3600 * 1e3 * 24), e && (a.setHours(0, 0, 0, 0), i.setHours(23, 59, 59, 999)), s.$emit("pick", [a, i]);
|
|
838
838
|
}
|
|
839
839
|
},
|
|
840
840
|
{
|
|
841
|
-
text:
|
|
841
|
+
text: h("last7days"),
|
|
842
842
|
onClick(s) {
|
|
843
843
|
const i = /* @__PURE__ */ new Date(), a = /* @__PURE__ */ new Date();
|
|
844
844
|
a.setTime(a.getTime() - 3600 * 1e3 * 24 * 7), e && (a.setHours(0, 0, 0, 0), i.setHours(23, 59, 59, 999)), s.$emit("pick", [a, i]);
|
|
845
845
|
}
|
|
846
846
|
},
|
|
847
847
|
{
|
|
848
|
-
text:
|
|
848
|
+
text: h("last30days"),
|
|
849
849
|
onClick(s) {
|
|
850
850
|
const i = /* @__PURE__ */ new Date(), a = /* @__PURE__ */ new Date();
|
|
851
851
|
a.setTime(a.getTime() - 3600 * 1e3 * 24 * 30), e && (a.setHours(0, 0, 0, 0), i.setHours(23, 59, 59, 999)), s.$emit("pick", [a, i]);
|
|
852
852
|
}
|
|
853
853
|
},
|
|
854
854
|
{
|
|
855
|
-
text:
|
|
855
|
+
text: h("thisMonth"),
|
|
856
856
|
onClick(s) {
|
|
857
857
|
const i = /* @__PURE__ */ new Date(), a = /* @__PURE__ */ new Date();
|
|
858
858
|
a.setDate(1), e && (a.setHours(0, 0, 0, 0), i.setHours(23, 59, 59, 999)), s.$emit("pick", [a, i]);
|
|
859
859
|
}
|
|
860
860
|
},
|
|
861
861
|
{
|
|
862
|
-
text:
|
|
862
|
+
text: h("lastMonth"),
|
|
863
863
|
onClick(s) {
|
|
864
864
|
const i = /* @__PURE__ */ new Date(), a = /* @__PURE__ */ new Date();
|
|
865
865
|
a.setMonth(a.getMonth() - 1), a.setDate(1), i.setDate(0), e && (a.setHours(0, 0, 0, 0), i.setHours(23, 59, 59, 999)), s.$emit("pick", [a, i]);
|
|
@@ -877,42 +877,42 @@ const E = Re.exports, { t: d } = b(), Ae = !0, He = !1, Ee = "value", Pe = {
|
|
|
877
877
|
const t = this.type === "datetimerange";
|
|
878
878
|
return [
|
|
879
879
|
{
|
|
880
|
-
text:
|
|
880
|
+
text: h("today"),
|
|
881
881
|
value: () => {
|
|
882
882
|
const e = /* @__PURE__ */ new Date(), s = /* @__PURE__ */ new Date();
|
|
883
883
|
return t && (s.setHours(0, 0, 0, 0), e.setHours(23, 59, 59, 999)), [s, e];
|
|
884
884
|
}
|
|
885
885
|
},
|
|
886
886
|
{
|
|
887
|
-
text:
|
|
887
|
+
text: h("yesterday"),
|
|
888
888
|
value: () => {
|
|
889
889
|
const e = /* @__PURE__ */ new Date(), s = /* @__PURE__ */ new Date();
|
|
890
890
|
return s.setTime(s.getTime() - 3600 * 1e3 * 24), e.setTime(e.getTime() - 3600 * 1e3 * 24), t && (s.setHours(0, 0, 0, 0), e.setHours(23, 59, 59, 999)), [s, e];
|
|
891
891
|
}
|
|
892
892
|
},
|
|
893
893
|
{
|
|
894
|
-
text:
|
|
894
|
+
text: h("last7days"),
|
|
895
895
|
value: () => {
|
|
896
896
|
const e = /* @__PURE__ */ new Date(), s = /* @__PURE__ */ new Date();
|
|
897
897
|
return s.setTime(s.getTime() - 3600 * 1e3 * 24 * 7), t && (s.setHours(0, 0, 0, 0), e.setHours(23, 59, 59, 999)), [s, e];
|
|
898
898
|
}
|
|
899
899
|
},
|
|
900
900
|
{
|
|
901
|
-
text:
|
|
901
|
+
text: h("last30days"),
|
|
902
902
|
value: () => {
|
|
903
903
|
const e = /* @__PURE__ */ new Date(), s = /* @__PURE__ */ new Date();
|
|
904
904
|
return s.setTime(s.getTime() - 3600 * 1e3 * 24 * 30), t && (s.setHours(0, 0, 0, 0), e.setHours(23, 59, 59, 999)), [s, e];
|
|
905
905
|
}
|
|
906
906
|
},
|
|
907
907
|
{
|
|
908
|
-
text:
|
|
908
|
+
text: h("thisMonth"),
|
|
909
909
|
value: () => {
|
|
910
910
|
const e = /* @__PURE__ */ new Date(), s = /* @__PURE__ */ new Date();
|
|
911
911
|
return s.setDate(1), t && (s.setHours(0, 0, 0, 0), e.setHours(23, 59, 59, 999)), [s, e];
|
|
912
912
|
}
|
|
913
913
|
},
|
|
914
914
|
{
|
|
915
|
-
text:
|
|
915
|
+
text: h("lastMonth"),
|
|
916
916
|
value: () => {
|
|
917
917
|
const e = /* @__PURE__ */ new Date(), s = /* @__PURE__ */ new Date();
|
|
918
918
|
return s.setMonth(s.getMonth() - 1), s.setDate(1), e.setDate(0), t && (s.setHours(0, 0, 0, 0), e.setHours(23, 59, 59, 999)), [s, e];
|
|
@@ -973,8 +973,8 @@ const E = Re.exports, { t: d } = b(), Ae = !0, He = !1, Ee = "value", Pe = {
|
|
|
973
973
|
},
|
|
974
974
|
data() {
|
|
975
975
|
return {
|
|
976
|
-
t:
|
|
977
|
-
isVue2:
|
|
976
|
+
t: h,
|
|
977
|
+
isVue2: Re,
|
|
978
978
|
isVue3: He,
|
|
979
979
|
getDefaultSize: f,
|
|
980
980
|
valueField: Ee
|
|
@@ -1460,35 +1460,34 @@ const N = ct.exports, dt = {
|
|
|
1460
1460
|
default: () => ({})
|
|
1461
1461
|
}
|
|
1462
1462
|
},
|
|
1463
|
-
render() {
|
|
1464
|
-
var
|
|
1465
|
-
const
|
|
1466
|
-
var
|
|
1467
|
-
if (!
|
|
1463
|
+
render(t) {
|
|
1464
|
+
var a;
|
|
1465
|
+
const e = (l) => {
|
|
1466
|
+
var n, o;
|
|
1467
|
+
if (!l) return null;
|
|
1468
1468
|
{
|
|
1469
|
-
|
|
1470
|
-
if (
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
return o;
|
|
1469
|
+
const r = (n = l.$scopedSlots) == null ? void 0 : n[this.name];
|
|
1470
|
+
if (r)
|
|
1471
|
+
return r(this.slotProps);
|
|
1472
|
+
const d = (o = l.$slots) == null ? void 0 : o[this.name];
|
|
1473
|
+
return d || null;
|
|
1475
1474
|
}
|
|
1476
|
-
},
|
|
1477
|
-
var
|
|
1478
|
-
return
|
|
1475
|
+
}, s = (l) => {
|
|
1476
|
+
var n;
|
|
1477
|
+
return l ? ((n = l.$options) == null ? void 0 : n.name) === "TmTable" : !1;
|
|
1479
1478
|
};
|
|
1480
|
-
let
|
|
1481
|
-
if (!
|
|
1482
|
-
let
|
|
1483
|
-
for (;
|
|
1484
|
-
if (
|
|
1485
|
-
|
|
1479
|
+
let i = e(this.$parent);
|
|
1480
|
+
if (!i) {
|
|
1481
|
+
let l = (a = this.$parent) == null ? void 0 : a.$parent;
|
|
1482
|
+
for (; l && !i; ) {
|
|
1483
|
+
if (s(l)) {
|
|
1484
|
+
i = e(l);
|
|
1486
1485
|
break;
|
|
1487
1486
|
}
|
|
1488
|
-
|
|
1487
|
+
l = l.$parent;
|
|
1489
1488
|
}
|
|
1490
1489
|
}
|
|
1491
|
-
return
|
|
1490
|
+
return i ? Array.isArray(i) ? i.length === 1 ? i[0] : t("div", { style: { display: "contents" } }, i) : i : null;
|
|
1492
1491
|
}
|
|
1493
1492
|
}, ht = null, pt = null;
|
|
1494
1493
|
var ft = /* @__PURE__ */ c(
|
|
@@ -1514,7 +1513,7 @@ const mt = ft.exports, { t: gt } = b(), bt = !0, yt = !1, vt = [
|
|
|
1514
1513
|
], Ct = {
|
|
1515
1514
|
name: "TmTableSearch",
|
|
1516
1515
|
components: {
|
|
1517
|
-
TmSelect:
|
|
1516
|
+
TmSelect: R,
|
|
1518
1517
|
TmAdvancedInput: E,
|
|
1519
1518
|
TmAdvancedDate: P,
|
|
1520
1519
|
TmCascader: I,
|
|
@@ -1800,7 +1799,7 @@ const Mt = Dt.exports, T = (t) => t ? t.data && t.data.attrs || {} : {}, F = (t,
|
|
|
1800
1799
|
return Promise.reject(e);
|
|
1801
1800
|
}
|
|
1802
1801
|
}
|
|
1803
|
-
},
|
|
1802
|
+
}, At = (t) => $.getTableConfig(t.key), Rt = (t) => $.setTableConfig(t), Ht = (t) => {
|
|
1804
1803
|
t && (typeof t.getTableConfig == "function" && ($.getTableConfig = t.getTableConfig), typeof t.setTableConfig == "function" && ($.setTableConfig = t.setTableConfig));
|
|
1805
1804
|
}, { t: Et } = b(), Pt = !0, It = !1, Wt = {
|
|
1806
1805
|
formatter: (t, e, s, i) => [void 0, null, ""].includes(s) ? "-" : s
|
|
@@ -1966,7 +1965,7 @@ const Mt = Dt.exports, T = (t) => t ? t.data && t.data.attrs || {} : {}, F = (t,
|
|
|
1966
1965
|
},
|
|
1967
1966
|
// 加载列配置
|
|
1968
1967
|
loadColumnConfig() {
|
|
1969
|
-
|
|
1968
|
+
At({
|
|
1970
1969
|
key: this.computedTableKey
|
|
1971
1970
|
}).then((t) => {
|
|
1972
1971
|
var s;
|
|
@@ -2033,9 +2032,9 @@ const Mt = Dt.exports, T = (t) => t ? t.data && t.data.attrs || {} : {}, F = (t,
|
|
|
2033
2032
|
const { target: i, related: a } = s;
|
|
2034
2033
|
if (!i || !a)
|
|
2035
2034
|
return !1;
|
|
2036
|
-
const l = a ? a.getAttribute("data-prop") : null, n = l ? this.sortedTableColumns.find((
|
|
2037
|
-
return this.isDraggingFrozen && !o || this.isDraggingFrozenRight && !r || !this.isDraggingFrozen && !this.isDraggingFrozenRight && (o || r) ? (i.classList.add("no-drop-zone"), !1) : (document.querySelectorAll(".no-drop-zone").forEach((
|
|
2038
|
-
|
|
2035
|
+
const l = a ? a.getAttribute("data-prop") : null, n = l ? this.sortedTableColumns.find((d) => d.prop === l) : null, o = n && n.fixed === "left", r = n && n.fixed === "right";
|
|
2036
|
+
return this.isDraggingFrozen && !o || this.isDraggingFrozenRight && !r || !this.isDraggingFrozen && !this.isDraggingFrozenRight && (o || r) ? (i.classList.add("no-drop-zone"), !1) : (document.querySelectorAll(".no-drop-zone").forEach((d) => {
|
|
2037
|
+
d.classList.remove("no-drop-zone");
|
|
2039
2038
|
}), !0);
|
|
2040
2039
|
},
|
|
2041
2040
|
onEnd: ({ item: s, newIndex: i, oldIndex: a }) => {
|
|
@@ -2044,9 +2043,9 @@ const Mt = Dt.exports, T = (t) => t ? t.data && t.data.attrs || {} : {}, F = (t,
|
|
|
2044
2043
|
document.querySelectorAll(".no-drop-zone").forEach((C) => {
|
|
2045
2044
|
C.classList.remove("no-drop-zone");
|
|
2046
2045
|
}), s.classList.remove("sortable-drag");
|
|
2047
|
-
const l = this.sortedTableColumns[a], n = l.fixed === "left", o = l.fixed === "right", r = i > 0 ? this.sortedTableColumns[i - 1] : null,
|
|
2046
|
+
const l = this.sortedTableColumns[a], n = l.fixed === "left", o = l.fixed === "right", r = i > 0 ? this.sortedTableColumns[i - 1] : null, d = i < this.sortedTableColumns.length - 1 ? this.sortedTableColumns[i + 1] : null;
|
|
2048
2047
|
let m = !1;
|
|
2049
|
-
if (n ? (r && r.fixed !== "left" ||
|
|
2048
|
+
if (n ? (r && r.fixed !== "left" || d && d.fixed === "right") && (m = !0) : o ? (r && r.fixed !== "right" || d && d.fixed !== "right") && (m = !0) : (r && r.fixed === "right" || d && d.fixed === "left") && (m = !0), m) {
|
|
2050
2049
|
this.rollbackSort();
|
|
2051
2050
|
return;
|
|
2052
2051
|
}
|
|
@@ -2201,7 +2200,7 @@ const Mt = Dt.exports, T = (t) => t ? t.data && t.data.attrs || {} : {}, F = (t,
|
|
|
2201
2200
|
const n = s, { label: a } = n;
|
|
2202
2201
|
return M(n, ["label"]);
|
|
2203
2202
|
});
|
|
2204
|
-
|
|
2203
|
+
Rt({
|
|
2205
2204
|
key: this.computedTableKey,
|
|
2206
2205
|
info: JSON.stringify({
|
|
2207
2206
|
columnsConfig: t,
|
|
@@ -2882,7 +2881,7 @@ const K = os.exports, us = {
|
|
|
2882
2881
|
Table: j,
|
|
2883
2882
|
Column: J,
|
|
2884
2883
|
Search: U,
|
|
2885
|
-
Select:
|
|
2884
|
+
Select: R,
|
|
2886
2885
|
AdvancedInput: E,
|
|
2887
2886
|
AdvancedDate: P,
|
|
2888
2887
|
Cascader: I,
|
|
@@ -2905,7 +2904,7 @@ export {
|
|
|
2905
2904
|
_ as EllipsisText,
|
|
2906
2905
|
W as Radio,
|
|
2907
2906
|
U as Search,
|
|
2908
|
-
|
|
2907
|
+
R as Select,
|
|
2909
2908
|
N as Switch,
|
|
2910
2909
|
j as Table,
|
|
2911
2910
|
cs as default,
|