tm-table 1.1.8 → 1.1.9
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 +54 -40
- package/dist/vue2/tm-table.umd.js +1 -1
- package/dist/vue3/tm-table.es.js +188 -182
- package/dist/vue3/tm-table.umd.js +1 -1
- package/package.json +1 -1
package/dist/vue2/tm-table.es.js
CHANGED
|
@@ -2,7 +2,7 @@ var q = Object.defineProperty, G = Object.defineProperties;
|
|
|
2
2
|
var Y = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var S = Object.getOwnPropertySymbols;
|
|
4
4
|
var O = Object.prototype.hasOwnProperty, D = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var L = (t, e, s) => e in t ? q(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s,
|
|
5
|
+
var L = (t, e, s) => e in t ? q(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s, u = (t, e) => {
|
|
6
6
|
for (var s in e || (e = {}))
|
|
7
7
|
O.call(e, s) && L(t, s, e[s]);
|
|
8
8
|
if (S)
|
|
@@ -124,7 +124,7 @@ const te = (t) => {
|
|
|
124
124
|
setLang: k,
|
|
125
125
|
currentLang: v
|
|
126
126
|
});
|
|
127
|
-
function c(t, e, s, i, a, l, n,
|
|
127
|
+
function c(t, e, s, i, a, l, n, o) {
|
|
128
128
|
var r = typeof t == "function" ? t.options : t;
|
|
129
129
|
return e && (r.render = e, r.staticRenderFns = s, r._compiled = !0), l && (r._scopeId = "data-v-" + l), {
|
|
130
130
|
exports: t,
|
|
@@ -268,7 +268,7 @@ var ne = function() {
|
|
|
268
268
|
}, expression: "checkAll" } }, [e._v(e._s(e.t("all")))]) : e._e()];
|
|
269
269
|
}, proxy: !0 }]), model: { value: e.computedValue, callback: function(i) {
|
|
270
270
|
e.computedValue = i;
|
|
271
|
-
}, expression: "computedValue" } }, "el-select", y(
|
|
271
|
+
}, expression: "computedValue" } }, "el-select", y(u({}, e.$attrs), {
|
|
272
272
|
size: e.getDefaultSize(),
|
|
273
273
|
filterable: e.filterable,
|
|
274
274
|
clearable: e.clearable,
|
|
@@ -455,8 +455,8 @@ const ye = p.more, ve = p["fixed-left"], Ce = p["fixed-right"], xe = p.upload, _
|
|
|
455
455
|
});
|
|
456
456
|
return;
|
|
457
457
|
}
|
|
458
|
-
const s = t.scrollHeight, i = t.scrollWidth, a = t.clientHeight, l = t.clientWidth, n = 1,
|
|
459
|
-
if (
|
|
458
|
+
const s = t.scrollHeight, i = t.scrollWidth, a = t.clientHeight, l = t.clientWidth, n = 1, o = s > a + n, r = i > l + n;
|
|
459
|
+
if (o || r) {
|
|
460
460
|
this.isOverflow = !0;
|
|
461
461
|
const m = parseFloat(e.lineHeight) || 16;
|
|
462
462
|
this.currentLines = Math.ceil(s / m);
|
|
@@ -1084,7 +1084,7 @@ const P = Be.exports, Ne = !0, Ue = {
|
|
|
1084
1084
|
};
|
|
1085
1085
|
},
|
|
1086
1086
|
cascaderProps() {
|
|
1087
|
-
return y(
|
|
1087
|
+
return y(u({}, this.props), {
|
|
1088
1088
|
expandTrigger: this.props.expandTrigger || "hover"
|
|
1089
1089
|
});
|
|
1090
1090
|
}
|
|
@@ -1130,7 +1130,7 @@ var je = function() {
|
|
|
1130
1130
|
}, { node: i, data: a })];
|
|
1131
1131
|
} }], null, !0), model: { value: e.selectedValue, callback: function(i) {
|
|
1132
1132
|
e.selectedValue = i;
|
|
1133
|
-
}, expression: "selectedValue" } }, "el-cascader", y(
|
|
1133
|
+
}, expression: "selectedValue" } }, "el-cascader", y(u({}, e.$attrs), {
|
|
1134
1134
|
size: e.getDefaultSize(),
|
|
1135
1135
|
filterable: e.filterable,
|
|
1136
1136
|
clearable: e.clearable,
|
|
@@ -1249,7 +1249,7 @@ var Ye = function() {
|
|
|
1249
1249
|
"tm-radio--v2": e.isVue2
|
|
1250
1250
|
} }, [s("el-radio-group", e._g(e._b({ ref: "radioGroup", model: { value: e.selectedValue, callback: function(i) {
|
|
1251
1251
|
e.selectedValue = i;
|
|
1252
|
-
}, expression: "selectedValue" } }, "el-radio-group", y(
|
|
1252
|
+
}, expression: "selectedValue" } }, "el-radio-group", y(u({}, e.$attrs), {
|
|
1253
1253
|
size: e.getDefaultSize()
|
|
1254
1254
|
}), !1), e.isVue2 ? e.$listeners : {}), [e.$slots.default ? [e._t("default")] : e._l(e.optionsList, function(i) {
|
|
1255
1255
|
return s("el-radio-button", e._b({ key: i[e.propMap.value] }, "el-radio-button", {
|
|
@@ -1370,7 +1370,7 @@ var it = function() {
|
|
|
1370
1370
|
"tm-checkbox--v2": e.isVue2
|
|
1371
1371
|
} }, [s("el-checkbox-group", e._g(e._b({ ref: "checkboxGroup", model: { value: e.selectedValue, callback: function(i) {
|
|
1372
1372
|
e.selectedValue = i;
|
|
1373
|
-
}, expression: "selectedValue" } }, "el-checkbox-group", y(
|
|
1373
|
+
}, expression: "selectedValue" } }, "el-checkbox-group", y(u({}, e.$attrs), {
|
|
1374
1374
|
size: e.getDefaultSize()
|
|
1375
1375
|
}), !1), e.isVue2 ? e.$listeners : {}), [e.$slots.default ? [e._t("default")] : e._l(e.optionsList, function(i) {
|
|
1376
1376
|
return s("el-checkbox-button", e._b({ key: i[e.propMap.value] }, "el-checkbox-button", {
|
|
@@ -1414,8 +1414,8 @@ const B = lt.exports, nt = !0, rt = {
|
|
|
1414
1414
|
const t = (l) => {
|
|
1415
1415
|
if (!l) return 0;
|
|
1416
1416
|
let n = 0;
|
|
1417
|
-
for (let
|
|
1418
|
-
const r = l.charAt(
|
|
1417
|
+
for (let o = 0; o < l.length; o++) {
|
|
1418
|
+
const r = l.charAt(o);
|
|
1419
1419
|
n += /[\u4e00-\u9fa5]/.test(r) ? 2 : 1;
|
|
1420
1420
|
}
|
|
1421
1421
|
return n;
|
|
@@ -1450,7 +1450,6 @@ var ot = function() {
|
|
|
1450
1450
|
);
|
|
1451
1451
|
const N = ct.exports, dt = {
|
|
1452
1452
|
name: "DynamicSlot",
|
|
1453
|
-
functional: !0,
|
|
1454
1453
|
props: {
|
|
1455
1454
|
name: {
|
|
1456
1455
|
type: String,
|
|
@@ -1461,20 +1460,35 @@ const N = ct.exports, dt = {
|
|
|
1461
1460
|
default: () => ({})
|
|
1462
1461
|
}
|
|
1463
1462
|
},
|
|
1464
|
-
render(
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1463
|
+
render() {
|
|
1464
|
+
var i;
|
|
1465
|
+
const t = (a) => {
|
|
1466
|
+
var l, n;
|
|
1467
|
+
if (!a) return null;
|
|
1468
|
+
{
|
|
1469
|
+
let o = (l = a.$scopedSlots) == null ? void 0 : l[this.name];
|
|
1470
|
+
if (!o && ((n = a.$slots) != null && n[this.name])) {
|
|
1471
|
+
const r = a.$slots[this.name];
|
|
1472
|
+
o = () => r;
|
|
1473
|
+
}
|
|
1474
|
+
return o;
|
|
1475
|
+
}
|
|
1476
|
+
}, e = (a) => {
|
|
1477
|
+
var l;
|
|
1478
|
+
return a ? ((l = a.$options) == null ? void 0 : l.name) === "TmTable" : !1;
|
|
1479
|
+
};
|
|
1480
|
+
let s = t(this.$parent);
|
|
1481
|
+
if (!s) {
|
|
1482
|
+
let a = (i = this.$parent) == null ? void 0 : i.$parent;
|
|
1483
|
+
for (; a && !s; ) {
|
|
1484
|
+
if (e(a)) {
|
|
1485
|
+
s = t(a);
|
|
1472
1486
|
break;
|
|
1473
1487
|
}
|
|
1474
|
-
|
|
1488
|
+
a = a.$parent;
|
|
1475
1489
|
}
|
|
1476
1490
|
}
|
|
1477
|
-
return
|
|
1491
|
+
return s ? typeof s == "function" ? s(this.slotProps) : s : null;
|
|
1478
1492
|
}
|
|
1479
1493
|
}, ht = null, pt = null;
|
|
1480
1494
|
var ft = /* @__PURE__ */ c(
|
|
@@ -1559,13 +1573,13 @@ const mt = ft.exports, { t: gt } = b(), bt = !0, yt = !1, vt = [
|
|
|
1559
1573
|
},
|
|
1560
1574
|
handleUpdate(t, e, s) {
|
|
1561
1575
|
const i = this.getFieldValue(t, s);
|
|
1562
|
-
i && this.$emit("update:search-form", y(
|
|
1576
|
+
i && this.$emit("update:search-form", y(u({}, this.computedSearchForm), {
|
|
1563
1577
|
[i]: e
|
|
1564
1578
|
}));
|
|
1565
1579
|
},
|
|
1566
1580
|
handleUpdateDate(t, e) {
|
|
1567
1581
|
const s = e || [], i = this.getFieldValue(t, "start"), a = this.getFieldValue(t, "end"), l = this.getFieldValue(t, "value"), n = {};
|
|
1568
|
-
i && (n[i] = s[0]), a && (n[a] = s[1]), l && (n[l] = s), this.$emit("update:search-form",
|
|
1582
|
+
i && (n[i] = s[0]), a && (n[a] = s[1]), l && (n[l] = s), this.$emit("update:search-form", u(u({}, this.computedSearchForm), n));
|
|
1569
1583
|
},
|
|
1570
1584
|
getFieldValue(t, e) {
|
|
1571
1585
|
if (typeof t == "string")
|
|
@@ -1642,10 +1656,10 @@ const mt = ft.exports, { t: gt } = b(), bt = !0, yt = !1, vt = [
|
|
|
1642
1656
|
}
|
|
1643
1657
|
const a = this.getFieldDefault(e, "value");
|
|
1644
1658
|
if (s && a !== void 0 && !(s in this.computedSearchForm) ? this.isDateType(e.type) && !Array.isArray(a) ? t[s] = [] : e.type === "checkbox" && !Array.isArray(a) ? t[s] = a ? [a] : [] : e.type === "switch" && typeof a != "boolean" ? t[s] = !!a : t[s] = a : s && !(s in this.computedSearchForm) && (e.type === "checkbox" ? t[s] = [] : e.type === "switch" && (t[s] = !1)), this.isDateType(e.type)) {
|
|
1645
|
-
const l = this.getFieldValue(e, "start"), n = this.getFieldValue(e, "end"),
|
|
1646
|
-
l &&
|
|
1659
|
+
const l = this.getFieldValue(e, "start"), n = this.getFieldValue(e, "end"), o = this.getFieldDefault(e, "start"), r = this.getFieldDefault(e, "end");
|
|
1660
|
+
l && o !== void 0 && !(l in this.computedSearchForm) && (t[l] = o), n && r !== void 0 && !(n in this.computedSearchForm) && (t[n] = r);
|
|
1647
1661
|
}
|
|
1648
|
-
}), this.defaultValues = t, this.$emit("update:search-form",
|
|
1662
|
+
}), this.defaultValues = t, this.$emit("update:search-form", u(u({}, t), this.computedSearchForm));
|
|
1649
1663
|
},
|
|
1650
1664
|
// 获取表单数据
|
|
1651
1665
|
getSearchForm() {
|
|
@@ -1659,7 +1673,7 @@ const mt = ft.exports, { t: gt } = b(), bt = !0, yt = !1, vt = [
|
|
|
1659
1673
|
},
|
|
1660
1674
|
// 处理重置
|
|
1661
1675
|
handleReset() {
|
|
1662
|
-
this.$emit("update:search-form",
|
|
1676
|
+
this.$emit("update:search-form", u({}, this.defaultValues)), this.$emit("reset");
|
|
1663
1677
|
}
|
|
1664
1678
|
}
|
|
1665
1679
|
};
|
|
@@ -1937,7 +1951,7 @@ const Mt = Dt.exports, T = (t) => t ? t.data && t.data.attrs || {} : {}, F = (t,
|
|
|
1937
1951
|
const i = T(s);
|
|
1938
1952
|
return !(!i.prop || this.ignoredColumnConfigTypes.includes(i.type));
|
|
1939
1953
|
}).map((s, i) => {
|
|
1940
|
-
const a = T(s), l =
|
|
1954
|
+
const a = T(s), l = u(u({}, Wt), a);
|
|
1941
1955
|
F(s, l), a.prop && (e[a.prop] = s);
|
|
1942
1956
|
const n = a.hasOwnProperty("visible") ? a.visible !== !1 : !0;
|
|
1943
1957
|
return {
|
|
@@ -1958,12 +1972,12 @@ const Mt = Dt.exports, T = (t) => t ? t.data && t.data.attrs || {} : {}, F = (t,
|
|
|
1958
1972
|
var s;
|
|
1959
1973
|
if (t.data.code !== 200) return;
|
|
1960
1974
|
let e = JSON.parse(((s = t.data) == null ? void 0 : s.data) || null) || {};
|
|
1961
|
-
e.columnsConfig && JSON.stringify(this.defaultColumnsConfig) === JSON.stringify(e.defaultColumnsConfig) ? this.tableColumns = e.columnsConfig.map((i) =>
|
|
1975
|
+
e.columnsConfig && JSON.stringify(this.defaultColumnsConfig) === JSON.stringify(e.defaultColumnsConfig) ? this.tableColumns = e.columnsConfig.map((i) => u({}, i)) : this.tableColumns = this.defaultColumnsConfig.map((i) => u({}, i)), this.processedColumns = this.applyColumnConfig(this.tableColumns), this.isConfigLoaded = !0, this.$emit("complete", {
|
|
1962
1976
|
columns: this.processedColumns,
|
|
1963
1977
|
isInitialLoad: !0
|
|
1964
1978
|
});
|
|
1965
1979
|
}).catch(() => {
|
|
1966
|
-
this.tableColumns = this.defaultColumnsConfig.map((t) =>
|
|
1980
|
+
this.tableColumns = this.defaultColumnsConfig.map((t) => u({}, t)), this.processedColumns = this.applyColumnConfig(this.tableColumns), this.isConfigLoaded = !0, this.$emit("complete", {
|
|
1967
1981
|
columns: this.processedColumns,
|
|
1968
1982
|
isInitialLoad: !0
|
|
1969
1983
|
});
|
|
@@ -1975,8 +1989,8 @@ const Mt = Dt.exports, T = (t) => t ? t.data && t.data.attrs || {} : {}, F = (t,
|
|
|
1975
1989
|
return this.ignoredColumnConfigTypes.includes(l.type);
|
|
1976
1990
|
}), i = [];
|
|
1977
1991
|
return [...t].sort((a, l) => {
|
|
1978
|
-
const n = a.sort !== void 0 ? a.sort : 1 / 0,
|
|
1979
|
-
return n -
|
|
1992
|
+
const n = a.sort !== void 0 ? a.sort : 1 / 0, o = l.sort !== void 0 ? l.sort : 1 / 0;
|
|
1993
|
+
return n - o;
|
|
1980
1994
|
}).forEach((a) => {
|
|
1981
1995
|
if (a.prop) {
|
|
1982
1996
|
let l = this.columnMap[a.prop];
|
|
@@ -2019,8 +2033,8 @@ const Mt = Dt.exports, T = (t) => t ? t.data && t.data.attrs || {} : {}, F = (t,
|
|
|
2019
2033
|
const { target: i, related: a } = s;
|
|
2020
2034
|
if (!i || !a)
|
|
2021
2035
|
return !1;
|
|
2022
|
-
const l = a ? a.getAttribute("data-prop") : null, n = l ? this.sortedTableColumns.find((h) => h.prop === l) : null,
|
|
2023
|
-
return this.isDraggingFrozen && !
|
|
2036
|
+
const l = a ? a.getAttribute("data-prop") : null, n = l ? this.sortedTableColumns.find((h) => h.prop === l) : null, o = n && n.fixed === "left", r = n && n.fixed === "right";
|
|
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((h) => {
|
|
2024
2038
|
h.classList.remove("no-drop-zone");
|
|
2025
2039
|
}), !0);
|
|
2026
2040
|
},
|
|
@@ -2030,9 +2044,9 @@ const Mt = Dt.exports, T = (t) => t ? t.data && t.data.attrs || {} : {}, F = (t,
|
|
|
2030
2044
|
document.querySelectorAll(".no-drop-zone").forEach((C) => {
|
|
2031
2045
|
C.classList.remove("no-drop-zone");
|
|
2032
2046
|
}), s.classList.remove("sortable-drag");
|
|
2033
|
-
const l = this.sortedTableColumns[a], n = l.fixed === "left",
|
|
2047
|
+
const l = this.sortedTableColumns[a], n = l.fixed === "left", o = l.fixed === "right", r = i > 0 ? this.sortedTableColumns[i - 1] : null, h = i < this.sortedTableColumns.length - 1 ? this.sortedTableColumns[i + 1] : null;
|
|
2034
2048
|
let m = !1;
|
|
2035
|
-
if (n ? (r && r.fixed !== "left" || h && h.fixed === "right") && (m = !0) :
|
|
2049
|
+
if (n ? (r && r.fixed !== "left" || h && h.fixed === "right") && (m = !0) : o ? (r && r.fixed !== "right" || h && h.fixed !== "right") && (m = !0) : (r && r.fixed === "right" || h && h.fixed === "left") && (m = !0), m) {
|
|
2036
2050
|
this.rollbackSort();
|
|
2037
2051
|
return;
|
|
2038
2052
|
}
|
|
@@ -2181,7 +2195,7 @@ const Mt = Dt.exports, T = (t) => t ? t.data && t.data.attrs || {} : {}, F = (t,
|
|
|
2181
2195
|
this.updateSortValues();
|
|
2182
2196
|
const t = (e = this.tableColumns) == null ? void 0 : e.map((s) => {
|
|
2183
2197
|
const i = this.sortedTableColumns.find(
|
|
2184
|
-
(
|
|
2198
|
+
(o) => o.prop === s.prop
|
|
2185
2199
|
);
|
|
2186
2200
|
i && (s.sort = i.sort, s.fixed = i.fixed, s.visible = i.visible);
|
|
2187
2201
|
const n = s, { label: a } = n;
|
|
@@ -2455,7 +2469,7 @@ const Jt = jt.exports, Kt = !0, Qt = !1, qt = {
|
|
|
2455
2469
|
params: this.searchForm
|
|
2456
2470
|
}), { list: e, total: s, pageSize: i, current: a } = t;
|
|
2457
2471
|
this.tableData = e;
|
|
2458
|
-
let l =
|
|
2472
|
+
let l = u({}, this.paginationInfo);
|
|
2459
2473
|
s !== void 0 && (l.total = s), a !== void 0 && (l.current = a), i !== void 0 && (l.pageSize = i), this.paginationInfo = l;
|
|
2460
2474
|
} catch (t) {
|
|
2461
2475
|
} finally {
|
|
@@ -2510,7 +2524,7 @@ var Gt = function() {
|
|
|
2510
2524
|
return [e._t("menu-left")];
|
|
2511
2525
|
}, proxy: !0 }, { key: "right", fn: function() {
|
|
2512
2526
|
return [e._t("menu-right"), e.refreshButton && typeof e.data == "function" ? s("el-tooltip", e._b({ attrs: { content: e.t("refresh"), placement: "top" } }, "el-tooltip", e.afterOpenDelay, !1), [s("el-button", { attrs: { circle: "", size: e.getDefaultSize() }, on: { click: e.handleRefresh } }, [s("RefreshIcon")], 1)], 1) : e._e(), e.columnSettingButton ? s("ColumnConfig", { attrs: { maxFixedLeftQuantity: e.maxFixedLeftQuantity, maxFixedRightQuantity: e.maxFixedRightQuantity, tableKey: e.computedTableKey, columns: e.originalColumns }, on: { complete: e.handleColumnConfigComplete } }) : e._e()];
|
|
2513
|
-
}, proxy: !0 }], null, !0) }) : e._e(), s("el-table", e._g(e._b({ directives: [{ name: "loading", rawName: "v-loading", value: e.pageLoading, expression: "pageLoading" }], key: e.tableReload, ref: "table", attrs: { data: e.tableData, height: e.tableHeight, size: e.getCompatSize("mini") }, on: { "selection-change": e.handleSelectionChange } }, "el-table", y(
|
|
2527
|
+
}, proxy: !0 }], null, !0) }) : e._e(), s("el-table", e._g(e._b({ directives: [{ name: "loading", rawName: "v-loading", value: e.pageLoading, expression: "pageLoading" }], key: e.tableReload, ref: "table", attrs: { data: e.tableData, height: e.tableHeight, size: e.getCompatSize("mini") }, on: { "selection-change": e.handleSelectionChange } }, "el-table", y(u({}, e.$attrs), { border: e.border }), !1), e.isVue2 ? e.$listeners : {}), e._l(e.displayColumns, function(i) {
|
|
2514
2528
|
return s("columnRenderer", { key: e.isVue3 ? i.id : i.data.attrs.prop, attrs: { vnode: i } });
|
|
2515
2529
|
}), 1), e.computedShowPagination ? s("table-pagination", { ref: "tmPagination", attrs: { "page-size": e.paginationInfo.pageSize, current: e.paginationInfo.current, total: e.paginationInfo.total, disabled: e.tableLoading }, on: { "size-change": e.handleSizeChange, "current-change": e.handleCurrentChange } }) : e._e()], 1);
|
|
2516
2530
|
}, Yt = [], Xt = /* @__PURE__ */ c(
|