dse-edit-table 0.0.3 → 1.1.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/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
- import { ref as K, h as Ee, defineComponent as he, getCurrentInstance as Me, computed as j, watch as Te, onMounted as Re, nextTick as ae, resolveComponent as _e, openBlock as q, createElementBlock as G, createVNode as xe, mergeProps as Oe, createSlots as ye, renderList as Ae, withCtx as ve, renderSlot as Le, normalizeProps as we, guardReactiveProps as Se, Fragment as re, createElementVNode as ie, toDisplayString as Z, createCommentVNode as Pe } from "vue";
2
- import $ from "vxe-pc-ui";
3
- import me from "vxe-table";
1
+ import { ref as j, h as Ee, defineComponent as Me, getCurrentInstance as Te, computed as X, watch as Re, onMounted as ye, nextTick as _e, resolveComponent as Oe, openBlock as q, createElementBlock as G, createVNode as se, Transition as xe, withCtx as ae, mergeProps as Ae, createSlots as we, renderList as Le, renderSlot as ve, normalizeProps as Se, guardReactiveProps as Pe, Fragment as re, createElementVNode as ie, toDisplayString as Q, createCommentVNode as Ie } from "vue";
2
+ import F from "vxe-pc-ui";
3
+ import fe from "vxe-table";
4
4
  import p from "xe-utils";
5
- import { useResizeObserver as Ie } from "@vueuse/core";
6
- var le = {};
7
- Object.defineProperty(le, "__esModule", {
5
+ import { useResizeObserver as De } from "@vueuse/core";
6
+ var oe = {};
7
+ Object.defineProperty(oe, "__esModule", {
8
8
  value: !0
9
9
  });
10
- var fe = le.default = void 0;
11
- fe = le.default = {
10
+ var ge = oe.default = void 0;
11
+ ge = oe.default = {
12
12
  vxe: {
13
13
  base: {
14
14
  pleaseInput: "请输入",
@@ -841,8 +841,8 @@ fe = le.default = {
841
841
  }
842
842
  };
843
843
  let M, z;
844
- const te = (n, r) => p.findIndexOf(n, (o) => o.id === r.id), oe = (n, r, o) => n.findRowIndexOf(r, o);
845
- function ee(n) {
844
+ const ee = (n, r) => p.findIndexOf(n, (o) => o.id === r.id), te = (n, r, o) => n.findRowIndexOf(r, o);
845
+ function Z(n) {
846
846
  return {
847
847
  tableMenuMethod(r) {
848
848
  const { $table: o, column: e } = r;
@@ -852,30 +852,30 @@ function ee(n) {
852
852
  }
853
853
  };
854
854
  }
855
- function ne() {
855
+ function le() {
856
856
  const n = M.globalStore;
857
857
  if (n)
858
858
  return n.clipboard || "";
859
859
  const r = M.config;
860
860
  return r && r.clipboard ? r.clipboard : null;
861
861
  }
862
- function De(n) {
862
+ function Fe(n) {
863
863
  const r = M.globalStore;
864
864
  r ? r.clipboard = n : M.config && (M.config.clipboard = n);
865
865
  }
866
- let v;
867
- function Fe(n) {
868
- if (!v) {
869
- v = document.createElement("textarea"), v.id = "$XECopy";
870
- const r = v.style;
871
- r.width = "48px", r.height = "24px", r.position = "fixed", r.zIndex = "0", r.left = "-500px", r.top = "-500px", document.body.appendChild(v);
866
+ let A;
867
+ function $e(n) {
868
+ if (!A) {
869
+ A = document.createElement("textarea"), A.id = "$XECopy";
870
+ const r = A.style;
871
+ r.width = "48px", r.height = "24px", r.position = "fixed", r.zIndex = "0", r.left = "-500px", r.top = "-500px", document.body.appendChild(A);
872
872
  }
873
- v.value = n == null ? "" : "" + n;
873
+ A.value = n == null ? "" : "" + n;
874
874
  }
875
- function ge(n) {
875
+ function Ce(n) {
876
876
  let r = !1;
877
877
  try {
878
- Fe(n), v.select(), v.setSelectionRange(0, v.value.length), r = document.execCommand("copy"), v.blur();
878
+ $e(n), A.select(), A.setSelectionRange(0, A.value.length), r = document.execCommand("copy"), A.blur();
879
879
  } catch {
880
880
  }
881
881
  return r;
@@ -887,44 +887,44 @@ function ce(n, r) {
887
887
  let u = "";
888
888
  if (a && i.area) {
889
889
  r ? e.triggerCutCellAreaEvent(o) : e.triggerCopyCellAreaEvent(o);
890
- const d = ne();
890
+ const d = le();
891
891
  u = d ? d.text : "";
892
892
  } else
893
- u = p.toValueString(p.get(t, l.field)), De({ text: u, html: "" });
894
- p.isFunction(z) ? z(u) : ge(u);
893
+ u = p.toValueString(p.get(t, l.field)), Fe({ text: u, html: "" });
894
+ p.isFunction(z) ? z(u) : Ce(u);
895
895
  }
896
896
  }
897
- function H(n) {
897
+ function V(n) {
898
898
  return function(r) {
899
899
  const { $grid: o } = r;
900
900
  o && o.commitProxy(n);
901
901
  };
902
902
  }
903
- function $e(n, r) {
903
+ function ke(n, r) {
904
904
  const { $table: o } = n, { visibleData: e } = o.getTableData(), { visibleColumn: t } = o.getTableColumn(), l = {};
905
905
  for (let s = 0, a = r.length; s < a; s++) {
906
906
  const c = r[s], { rows: i, cols: u } = c;
907
907
  for (let d = 0, m = i.length; d < m; d++) {
908
- const T = i[d], R = oe(o, e, T);
909
- for (let _ = 0, P = u.length; _ < P; _++) {
910
- const I = u[_], g = te(t, I), f = R + ":" + g;
911
- if (l[f])
908
+ const T = i[d], R = te(o, e, T);
909
+ for (let y = 0, S = u.length; y < S; y++) {
910
+ const P = u[y], f = ee(t, P), g = R + ":" + f;
911
+ if (l[g])
912
912
  return !1;
913
- l[f] = !0;
913
+ l[g] = !0;
914
914
  }
915
915
  }
916
916
  }
917
917
  return !0;
918
918
  }
919
- function se(n) {
919
+ function ne(n) {
920
920
  const { $table: r } = n, o = r.props, { mouseConfig: e } = o, { computeMouseOpts: t } = r.getComputeMaps(), l = t.value, { visibleData: s } = r.getTableData(), { visibleColumn: a } = r.getTableColumn(), c = e && l.area ? r.getCellAreas() : [];
921
921
  return r.getMergeCells().filter(({ row: u, col: d, rowspan: m, colspan: T }) => c.some((R) => {
922
- const { rows: _, cols: P } = R, I = oe(r, s, _[0]), g = oe(r, s, _[_.length - 1]), f = te(a, P[0]), h = te(a, P[P.length - 1]);
923
- return u >= I && u + m - 1 <= g && d >= f && d + T - 1 <= h;
922
+ const { rows: y, cols: S } = R, P = te(r, s, y[0]), f = te(r, s, y[y.length - 1]), g = ee(a, S[0]), E = ee(a, S[S.length - 1]);
923
+ return u >= P && u + m - 1 <= f && d >= g && d + T - 1 <= E;
924
924
  }));
925
925
  }
926
926
  function ue(n) {
927
- const { $table: r } = n, o = se(n);
927
+ const { $table: r } = n, o = ne(n);
928
928
  return o.length && r.removeMergeCells(o), o;
929
929
  }
930
930
  function de(n, r) {
@@ -946,7 +946,7 @@ function de(n, r) {
946
946
  break;
947
947
  }
948
948
  case "CLEAR_MERGE_CELL": {
949
- const d = se(r);
949
+ const d = ne(r);
950
950
  n.disabled = !d.length;
951
951
  break;
952
952
  }
@@ -1039,8 +1039,8 @@ function de(n, r) {
1039
1039
  if (n.disabled = R.length > 1, !n.disabled)
1040
1040
  switch (o) {
1041
1041
  case "PASTE_CELL": {
1042
- const _ = ne();
1043
- n.disabled = !_ || !_.text;
1042
+ const y = le();
1043
+ n.disabled = !y || !y.text;
1044
1044
  break;
1045
1045
  }
1046
1046
  }
@@ -1049,7 +1049,7 @@ function de(n, r) {
1049
1049
  case "MERGE_OR_CLEAR":
1050
1050
  case "MERGE_CELL": {
1051
1051
  const R = u && m.area ? e.getCellAreas() : [];
1052
- n.disabled = !R.length || R.length === 1 && R[0].rows.length === 1 && R[0].cols.length === 1 || !$e(r, R);
1052
+ n.disabled = !R.length || R.length === 1 && R[0].rows.length === 1 && R[0].cols.length === 1 || !ke(r, R);
1053
1053
  break;
1054
1054
  }
1055
1055
  case "FIXED_LEFT_COLUMN":
@@ -1075,7 +1075,7 @@ function de(n, r) {
1075
1075
  }
1076
1076
  }
1077
1077
  }
1078
- function ke(n) {
1078
+ function Ne(n) {
1079
1079
  return n.options.forEach((r) => {
1080
1080
  r.forEach((o) => {
1081
1081
  de(o, n), o.children && o.children.forEach((e) => {
@@ -1089,7 +1089,7 @@ function Y() {
1089
1089
  if (M.modal) {
1090
1090
  const r = M.getComponent("VxeNumberInput");
1091
1091
  if (r) {
1092
- const o = K(1);
1092
+ const o = j(1);
1093
1093
  M.modal.alert({
1094
1094
  title: "请输入行数",
1095
1095
  width: 220,
@@ -1131,19 +1131,19 @@ function Y() {
1131
1131
  });
1132
1132
  });
1133
1133
  }
1134
- function B() {
1134
+ function H() {
1135
1135
  location.reload();
1136
1136
  }
1137
- function W() {
1137
+ function B() {
1138
1138
  history.forward();
1139
1139
  }
1140
- function U() {
1140
+ function W() {
1141
1141
  history.back();
1142
1142
  }
1143
1143
  function pe(n) {
1144
1144
  n && n.copy && (z = n.copy);
1145
1145
  }
1146
- const Ce = {
1146
+ const be = {
1147
1147
  setConfig: pe,
1148
1148
  install(n, r) {
1149
1149
  M = n, M.checkVersion ? M.checkVersion(M.tableVersion, 4, 11) || console.error(`[@vxe-ui/plugin-menu 4.3.1] ${M.getI18n("vxe.error.errorVersion", [`vxe-table@${M.tableVersion || "?"}`, "vxe-table v4.11+"])} https://vxeui.com/other4/#/plugin-menu/install`) : /^(4)\./.test(M.uiVersion || M.tableVersion) || console.error("[@vxe-ui/plugin-menu 4.3.1] Requires vxe-table 4.7.0+ version. https://vxeui.com/other4/#/plugin-menu/install"), pe(r), M.menus.mixin({
@@ -1151,6 +1151,16 @@ const Ce = {
1151
1151
  * 浏览器-刷新页面(对应按键F5)
1152
1152
  */
1153
1153
  SYSTEM_PAGE_REFRESH: {
1154
+ tableMenuMethod: H,
1155
+ treeMenuMethod: H,
1156
+ calendarMenuMethod: H,
1157
+ menuMenuMethod: H,
1158
+ formDesignMenuMethod: H
1159
+ },
1160
+ /**
1161
+ * 浏览器-前进
1162
+ */
1163
+ SYSTEM_PAGE_FORWARD: {
1154
1164
  tableMenuMethod: B,
1155
1165
  treeMenuMethod: B,
1156
1166
  calendarMenuMethod: B,
@@ -1158,25 +1168,15 @@ const Ce = {
1158
1168
  formDesignMenuMethod: B
1159
1169
  },
1160
1170
  /**
1161
- * 浏览器-前进
1171
+ * 浏览器-后退
1162
1172
  */
1163
- SYSTEM_PAGE_FORWARD: {
1173
+ SYSTEM_PAGE_BACK: {
1164
1174
  tableMenuMethod: W,
1165
1175
  treeMenuMethod: W,
1166
1176
  calendarMenuMethod: W,
1167
1177
  menuMenuMethod: W,
1168
1178
  formDesignMenuMethod: W
1169
1179
  },
1170
- /**
1171
- * 浏览器-后退
1172
- */
1173
- SYSTEM_PAGE_BACK: {
1174
- tableMenuMethod: U,
1175
- treeMenuMethod: U,
1176
- calendarMenuMethod: U,
1177
- menuMenuMethod: U,
1178
- formDesignMenuMethod: U
1179
- },
1180
1180
  /**
1181
1181
  * 清除单元格数据的值;如果启用 mouse-config.area 功能,则清除区域范围内的单元格数据
1182
1182
  */
@@ -1190,8 +1190,8 @@ const Ce = {
1190
1190
  u && u.length && u.forEach((d) => {
1191
1191
  const { rows: m, cols: T } = d;
1192
1192
  T.forEach((R) => {
1193
- m.forEach((_) => {
1194
- e.clearData(_, R.field);
1193
+ m.forEach((y) => {
1194
+ e.clearData(y, R.field);
1195
1195
  });
1196
1196
  });
1197
1197
  });
@@ -1373,8 +1373,8 @@ const Ce = {
1373
1373
  u && u.length && u.forEach((d) => {
1374
1374
  const { rows: m, cols: T } = d;
1375
1375
  T.forEach((R) => {
1376
- m.forEach((_) => {
1377
- e.revertData(_, R.field);
1376
+ m.forEach((y) => {
1377
+ e.revertData(y, R.field);
1378
1378
  });
1379
1379
  });
1380
1380
  });
@@ -1416,7 +1416,7 @@ const Ce = {
1416
1416
  COPY_TITLE: {
1417
1417
  tableMenuMethod(o) {
1418
1418
  const { column: e } = o, t = e.getTitle();
1419
- t && (p.isFunction(z) ? z(t) : ge(t));
1419
+ t && (p.isFunction(z) ? z(t) : Ce(t));
1420
1420
  }
1421
1421
  },
1422
1422
  /**
@@ -1444,7 +1444,7 @@ const Ce = {
1444
1444
  if (c && u.area)
1445
1445
  t.triggerPasteCellAreaEvent(e);
1446
1446
  else {
1447
- const d = ne();
1447
+ const d = le();
1448
1448
  d && d.text && p.set(l, s.field, d.text);
1449
1449
  }
1450
1450
  }
@@ -1454,7 +1454,7 @@ const Ce = {
1454
1454
  */
1455
1455
  MERGE_OR_CLEAR: {
1456
1456
  tableMenuMethod(o) {
1457
- const { $event: e, $table: t } = o, l = t.getCellAreas(), s = se(o);
1457
+ const { $event: e, $table: t } = o, l = t.getCellAreas(), s = ne(o);
1458
1458
  let a = !1;
1459
1459
  s.length ? t.removeMergeCells(s) : (a = !0, t.setMergeCells(l.map(({ rows: i, cols: u }) => ({
1460
1460
  row: i[0],
@@ -1872,15 +1872,15 @@ const Ce = {
1872
1872
  /**
1873
1873
  * 将列固定到左侧
1874
1874
  */
1875
- FIXED_LEFT_COLUMN: ee("left"),
1875
+ FIXED_LEFT_COLUMN: Z("left"),
1876
1876
  /**
1877
1877
  * 将列固定到右侧
1878
1878
  */
1879
- FIXED_RIGHT_COLUMN: ee("right"),
1879
+ FIXED_RIGHT_COLUMN: Z("right"),
1880
1880
  /**
1881
1881
  * 清除固定列
1882
1882
  */
1883
- CLEAR_FIXED_COLUMN: ee(null),
1883
+ CLEAR_FIXED_COLUMN: Z(null),
1884
1884
  /**
1885
1885
  * 重置列的可视状态
1886
1886
  */
@@ -1912,50 +1912,50 @@ const Ce = {
1912
1912
  * 用于 proxy-config,重新初始化,恢复到初始状态,触发对应的 ajax.query
1913
1913
  */
1914
1914
  COMMIT_PROXY_INITIAL: {
1915
- tableMenuMethod: H("initial")
1915
+ tableMenuMethod: V("initial")
1916
1916
  },
1917
1917
  /**
1918
1918
  * 用于 proxy-config,重新加载,如果有分页,返回第一页,触发对应的 ajax.query
1919
1919
  */
1920
1920
  COMMIT_PROXY_QUERY: {
1921
- tableMenuMethod: H("query")
1921
+ tableMenuMethod: V("query")
1922
1922
  },
1923
1923
  /**
1924
1924
  * 用于 proxy-config,刷新当前页,触发对应的 ajax.quer
1925
1925
  */
1926
1926
  COMMIT_PROXY_RELOAD: {
1927
- tableMenuMethod: H("reload")
1927
+ tableMenuMethod: V("reload")
1928
1928
  },
1929
1929
  /**
1930
1930
  * 用于 proxy-config,直接删除,触发对应的 ajax.delete
1931
1931
  */
1932
1932
  COMMIT_PROXY_DELETE: {
1933
- tableMenuMethod: H("delete")
1933
+ tableMenuMethod: V("delete")
1934
1934
  },
1935
1935
  /**
1936
1936
  * 用于 proxy-config,保存数据,触发对应的 ajax.save
1937
1937
  */
1938
1938
  COMMIT_PROXY_SAVE: {
1939
- tableMenuMethod: H("save")
1939
+ tableMenuMethod: V("save")
1940
1940
  }
1941
- }), M.interceptor.add("event.showMenu", ke);
1941
+ }), M.interceptor.add("event.showMenu", Ne);
1942
1942
  }
1943
1943
  };
1944
- typeof window < "u" && window.VxeUI && window.VxeUI.use && window.VxeUI.use(Ce);
1945
- $.setI18n("zh-CN", fe);
1946
- $.use(Ce);
1947
- $.setIcon({
1944
+ typeof window < "u" && window.VxeUI && window.VxeUI.use && window.VxeUI.use(be);
1945
+ F.setI18n("zh-CN", ge);
1946
+ F.use(be);
1947
+ F.setIcon({
1948
1948
  TABLE_EDIT: ""
1949
1949
  });
1950
- $.setConfig({
1950
+ F.setConfig({
1951
1951
  authId: "wmtxlrzz9kdguq7j"
1952
1952
  });
1953
- $.setLanguage("zh-CN");
1954
- const Ze = $, et = me;
1955
- function be(n) {
1956
- n.use($), n.use(me);
1953
+ F.setLanguage("zh-CN");
1954
+ const et = F, tt = fe;
1955
+ function he(n) {
1956
+ n.use(F), n.use(fe);
1957
1957
  }
1958
- function Ne(n) {
1958
+ function Ve(n) {
1959
1959
  for (let r = 1, o = arguments.length; r < o; r++) {
1960
1960
  let e = arguments[r] || {};
1961
1961
  for (let t in e)
@@ -1966,7 +1966,7 @@ function Ne(n) {
1966
1966
  }
1967
1967
  return n;
1968
1968
  }
1969
- function J(n) {
1969
+ function K(n) {
1970
1970
  const r = (t) => t && Object.prototype.toString.call(t) === "[object Object]", o = (t) => Array.isArray(t), e = (t, l) => {
1971
1971
  if (!o(t) || !o(l))
1972
1972
  return l || t;
@@ -1983,14 +1983,14 @@ function J(n) {
1983
1983
  const i = s.findIndex(
1984
1984
  (u) => (u == null ? void 0 : u.code) === a.code
1985
1985
  );
1986
- i > -1 ? s[i] = J(
1986
+ i > -1 ? s[i] = K(
1987
1987
  {},
1988
1988
  s[i],
1989
1989
  a
1990
1990
  ) : s.push(a);
1991
1991
  } else if (r(a)) {
1992
1992
  const i = s[c];
1993
- s[c] = i ? J({}, i, a) : a;
1993
+ s[c] = i ? K({}, i, a) : a;
1994
1994
  } else
1995
1995
  s[c] = a;
1996
1996
  }), s;
@@ -2002,12 +2002,12 @@ function J(n) {
2002
2002
  const c = n[a], i = s[a];
2003
2003
  if (i === void 0)
2004
2004
  continue;
2005
- r(i) && r(c) ? n[a] = J({}, c, i) : o(i) && o(c) ? n[a] = e(c, i) : (r(i) || o(i), n[a] = i);
2005
+ r(i) && r(c) ? n[a] = K({}, c, i) : o(i) && o(c) ? n[a] = e(c, i) : (r(i) || o(i), n[a] = i);
2006
2006
  }
2007
2007
  }
2008
2008
  return n;
2009
2009
  }
2010
- const Ve = () => ({
2010
+ const He = () => ({
2011
2011
  menuConfig: {
2012
2012
  // header: {
2013
2013
  // options: [
@@ -2111,12 +2111,12 @@ const Ve = () => ({
2111
2111
  },
2112
2112
  export: !1
2113
2113
  }
2114
- }), He = (n, r) => {
2114
+ }), Be = (n, r) => {
2115
2115
  const o = n.__vccOpts || n;
2116
2116
  for (const [e, t] of r)
2117
2117
  o[e] = t;
2118
2118
  return o;
2119
- }, Be = (n = "children", r = []) => {
2119
+ }, We = (n = "children", r = []) => {
2120
2120
  const o = [], e = (t, l = []) => {
2121
2121
  l.forEach((s) => {
2122
2122
  var a;
@@ -2124,7 +2124,7 @@ const Ve = () => ({
2124
2124
  });
2125
2125
  };
2126
2126
  return e(o, r), o;
2127
- }, x = Ve(), We = he({
2127
+ }, me = He(), ze = Me({
2128
2128
  name: "DseTable",
2129
2129
  emits: [
2130
2130
  "menu-click",
@@ -2135,52 +2135,107 @@ const Ve = () => ({
2135
2135
  ],
2136
2136
  props: {
2137
2137
  menuConfig: {
2138
- type: Object,
2139
- default: () => x.menuConfig
2138
+ // header: {
2139
+ // options: [
2140
+ // [
2141
+ // {
2142
+ // code: 'ADD_COLUMN',
2143
+ // name: '添加列',
2144
+ // prefixIcon: 'vxe-icon-add'
2145
+ // },
2146
+ // {
2147
+ // code: 'DELETE_COLUMN',
2148
+ // name: '删除列',
2149
+ // prefixIcon: 'vxe-icon-delete'
2150
+ // },
2151
+ // {
2152
+ // code: 'EDIT_COLUMN',
2153
+ // name: '编辑列',
2154
+ // prefixIcon: 'vxe-icon-edit'
2155
+ // }
2156
+ // ]
2157
+ // ]
2158
+ // },
2159
+ // body: {
2160
+ // options: [
2161
+ // [
2162
+ // { code: 'CLEAR_ROW', name: '清空选中行', prefixIcon: 'vxe-icon-delete' },
2163
+ // {
2164
+ // name: '新增行',
2165
+ // prefixIcon: 'vxe-icon-add',
2166
+ // children: [
2167
+ // { code: 'INSERT_AT_ROW', name: '新增1行', prefixIcon: 'vxe-icon-add' },
2168
+ // { code: 'INSERT_AT_ROW10', name: '新增10行', prefixIcon: 'vxe-icon-add' }
2169
+ // ]
2170
+ // },
2171
+ // { code: 'COPY_CELL', name: '复制', prefixIcon: 'vxe-icon-copy' },
2172
+ // { code: 'PASTE_CELL', name: '粘贴', prefixIcon: 'vxe-icon-paste' },
2173
+ // { code: 'CUT_CELL', name: '剪切', prefixIcon: 'vxe-icon-cut' },
2174
+ // { code: 'DELETE', name: '删除行', prefixIcon: 'vxe-icon-delete' }
2175
+ // ]
2176
+ // ]
2177
+ // },
2178
+ // focusIndex: 0
2140
2179
  },
2141
2180
  editConfig: {
2142
- type: Object,
2143
- default: () => x.editConfig
2181
+ enabled: !0,
2182
+ trigger: "dblclick",
2183
+ mode: "cell",
2184
+ showStatus: !0
2144
2185
  },
2145
2186
  exportConfig: {
2146
- type: Object,
2147
- default: () => x.exportConfig
2187
+ type: "xlsx"
2148
2188
  },
2149
2189
  columnConfig: {
2150
- type: Object,
2151
- default: () => x.columnConfig
2190
+ resizable: !0
2152
2191
  },
2153
2192
  sortConfig: {
2154
- type: Object,
2155
- default: () => x.sortConfig
2193
+ trigger: "cell",
2194
+ remote: !0
2156
2195
  },
2157
2196
  virtualYConfig: {
2158
- type: Object,
2159
- default: () => x.virtualYConfig
2197
+ enabled: !0,
2198
+ gt: 1e4
2160
2199
  },
2161
2200
  clipConfig: {
2162
- type: Object,
2163
- default: () => x.clipConfig
2201
+ isCopy: !0,
2202
+ isCut: !0,
2203
+ isPaste: !0,
2204
+ isFillPaste: !0,
2205
+ isRowIncrement: !0,
2206
+ isColumnIncrement: !1
2164
2207
  },
2165
2208
  areaConfig: {
2166
- type: Object,
2167
- default: () => x.areaConfig
2209
+ extendByCopy: !0,
2210
+ multiple: !0,
2211
+ selectCellByHeader: !1,
2212
+ excludeFields: ["tm"]
2168
2213
  },
2169
2214
  mouseConfig: {
2170
- type: Object,
2171
- default: () => x.mouseConfig
2215
+ area: !0,
2216
+ extension: !0
2172
2217
  },
2173
2218
  keyboardConfig: {
2174
- type: Object,
2175
- default: () => x.keyboardConfig
2219
+ isClip: !0,
2220
+ isEdit: !0,
2221
+ isTab: !0,
2222
+ isArrow: !0,
2223
+ isDel: !0,
2224
+ isEnter: !0,
2225
+ isMerge: !0,
2226
+ isFNR: !0,
2227
+ isChecked: !0,
2228
+ isLastEnterAppendRow: !0,
2229
+ enterToTab: !1
2176
2230
  },
2177
2231
  rowConfig: {
2178
- type: Object,
2179
- default: () => x.rowConfig
2232
+ resizable: !0
2180
2233
  },
2181
2234
  toolbarConfig: {
2182
- type: Object,
2183
- default: () => x.toolbarConfig
2235
+ slots: {
2236
+ buttons: "toolbarButtons"
2237
+ },
2238
+ export: !1
2184
2239
  },
2185
2240
  autoResize: {
2186
2241
  type: Boolean,
@@ -2262,17 +2317,17 @@ const Ve = () => ({
2262
2317
  }
2263
2318
  },
2264
2319
  setup(n, { emit: r, expose: o }) {
2265
- const e = Me();
2266
- e && e.proxy && e.proxy.appContext && e.proxy.appContext.app && be(e.proxy.appContext.app);
2267
- const t = j(
2320
+ const e = Te();
2321
+ e && e.proxy && e.proxy.appContext && e.proxy.appContext.app && he(e.proxy.appContext.app);
2322
+ const t = X(
2268
2323
  () => typeof n.width == "number" ? `${n.width}px` : n.width
2269
- ), l = K(), s = K(0), a = K("dse-table-grid"), c = j(() => Be("children", n.columns)), i = j(() => {
2270
- const g = [];
2271
- return c.value.forEach((f) => {
2272
- f.slots && (f.slots.default && g.push({ name: f.slots.default, type: "default", item: f }), f.slots.edit && g.push({ name: f.slots.edit, type: "edit", item: f }), f.slots.header && g.push({ name: f.slots.header, type: "header", item: f }));
2273
- }), g;
2274
- }), u = j(() => {
2275
- const g = ["menuConfig"], f = [
2324
+ ), l = j(), s = j(0), a = j("dse-table-grid"), c = X(() => We("children", n.columns)), i = X(() => {
2325
+ const f = [];
2326
+ return c.value.forEach((g) => {
2327
+ g.slots && (g.slots.default && f.push({ name: g.slots.default, type: "default", item: g }), g.slots.edit && f.push({ name: g.slots.edit, type: "edit", item: g }), g.slots.header && f.push({ name: g.slots.header, type: "header", item: g }));
2328
+ }), f;
2329
+ }), u = X(() => {
2330
+ const f = ["menuConfig"], g = [
2276
2331
  "editConfig",
2277
2332
  "exportConfig",
2278
2333
  "columnConfig",
@@ -2284,214 +2339,228 @@ const Ve = () => ({
2284
2339
  "keyboardConfig",
2285
2340
  "rowConfig",
2286
2341
  "toolbarConfig"
2287
- ], h = {};
2288
- return g.forEach((C) => {
2289
- h[C] = J({}, x[C], n[C] || {});
2290
- }), f.forEach((C) => {
2291
- h[C] = Ne({}, x[C], n[C] || {});
2292
- }), {
2293
- ...e.proxy.$attrs,
2294
- ...h,
2295
- class: "hydGrid",
2296
- size: "small",
2297
- align: n.align,
2298
- autoResize: n.autoResize,
2299
- border: n.border,
2300
- cellStyle: n.cellStyle,
2301
- columns: n.columns,
2302
- data: n.data,
2303
- height: s.value,
2304
- maxHeight: s.value,
2305
- headerRowStyle: n.headerRowStyle,
2306
- keepSource: n.keepSource,
2307
- mergeCells: n.mergeCells,
2308
- rowStyle: n.rowStyle,
2309
- showFooter: n.showFooter,
2310
- showHeader: n.showHeader,
2311
- showHeaderOverflow: n.showHeaderOverflow,
2312
- showOverflow: n.showOverflow,
2313
- style: { width: t.value }
2314
- };
2342
+ ], E = {};
2343
+ return f.forEach((C) => {
2344
+ E[C] = K({}, me[C], n[C] || {});
2345
+ }), g.forEach((C) => {
2346
+ E[C] = Ve({}, me[C], n[C] || {});
2347
+ }), E;
2315
2348
  }), d = ({
2316
- menu: g,
2317
- type: f,
2318
- row: h,
2349
+ menu: f,
2350
+ type: g,
2351
+ row: E,
2319
2352
  rowIndex: C,
2320
- column: y,
2321
- columnIndex: L,
2322
- $event: k
2353
+ column: O,
2354
+ columnIndex: w,
2355
+ $event: $
2323
2356
  }) => {
2324
- var O;
2325
- g.code === "DELETE_COLUMN" && (n.columns.splice(L, 1), (O = l.value) == null || O.refreshColumn());
2326
- const b = n.data, A = {
2357
+ var _;
2358
+ f.code === "DELETE_COLUMN" && (n.columns.splice(w, 1), (_ = l.value) == null || _.refreshColumn());
2359
+ const b = n.data, x = {
2327
2360
  CLEAR_ROW: () => {
2328
- var w, S, N, V;
2329
- const E = (N = (S = (w = l.value) == null ? void 0 : w.getCellAreas()) == null ? void 0 : S[0]) == null ? void 0 : N.rows;
2330
- if (E != null && E.length) {
2331
- for (let D = 0; D < b.length; D++)
2332
- E.includes(b[D]) && (b[D] = {});
2333
- r("update:data", b), (V = l.value) == null || V.reloadData(b), r("menu-clear-delete", b);
2361
+ var L, v, k, N;
2362
+ const h = (k = (v = (L = l.value) == null ? void 0 : L.getCellAreas()) == null ? void 0 : v[0]) == null ? void 0 : k.rows;
2363
+ if (h != null && h.length) {
2364
+ for (let I = 0; I < b.length; I++)
2365
+ h.includes(b[I]) && (b[I] = {});
2366
+ r("update:data", b), (N = l.value) == null || N.reloadData(b), r("menu-clear-delete", b);
2334
2367
  }
2335
2368
  },
2336
2369
  DELETE: () => {
2337
- var S, N, V, D;
2338
- const E = (V = (N = (S = l.value) == null ? void 0 : S.getCellAreas()) == null ? void 0 : N[0]) == null ? void 0 : V.rows;
2339
- if (!(E != null && E.length)) return;
2340
- E.map((F) => {
2341
- var X;
2342
- return (X = l.value) == null ? void 0 : X.getRowIndex(F);
2343
- }).sort((F, X) => X - F).forEach((F) => {
2344
- (F || F === 0) && b.splice(F, 1);
2345
- }), r("update:data", b), (D = l.value) == null || D.reloadData(b), r("menu-clear-delete", b);
2370
+ var v, k, N, I;
2371
+ const h = (N = (k = (v = l.value) == null ? void 0 : v.getCellAreas()) == null ? void 0 : k[0]) == null ? void 0 : N.rows;
2372
+ if (!(h != null && h.length)) return;
2373
+ h.map((D) => {
2374
+ var U;
2375
+ return (U = l.value) == null ? void 0 : U.getRowIndex(D);
2376
+ }).sort((D, U) => U - D).forEach((D) => {
2377
+ (D || D === 0) && b.splice(D, 1);
2378
+ }), r("update:data", b), (I = l.value) == null || I.reloadData(b), r("menu-clear-delete", b);
2346
2379
  },
2347
2380
  INSERT_AT_ROW: () => {
2348
- var E, w;
2381
+ var h, L;
2349
2382
  if (!C && C !== 0) {
2350
- r("update:data", b.push({})), (E = l.value) == null || E.reloadData(b);
2383
+ r("update:data", b.push({})), (h = l.value) == null || h.reloadData(b);
2351
2384
  return;
2352
2385
  }
2353
- r("update:data", b.splice(C + 1, 0, {})), (w = l.value) == null || w.reloadData(b);
2386
+ r("update:data", b.splice(C + 1, 0, {})), (L = l.value) == null || L.reloadData(b);
2354
2387
  },
2355
2388
  INSERT_AT_ROW10: () => {
2356
- var w, S;
2357
- const E = Array.from({ length: 10 }, () => ({}));
2389
+ var L, v;
2390
+ const h = Array.from({ length: 10 }, () => ({}));
2358
2391
  if (!C && C !== 0) {
2359
- r("update:data", b.push(...E)), (w = l.value) == null || w.reloadData(b);
2392
+ r("update:data", b.push(...h)), (L = l.value) == null || L.reloadData(b);
2360
2393
  return;
2361
2394
  }
2362
- r("update:data", b.splice(C + 1, 0, ...E)), (S = l.value) == null || S.reloadData(b);
2395
+ r("update:data", b.splice(C + 1, 0, ...h)), (v = l.value) == null || v.reloadData(b);
2363
2396
  }
2364
2397
  };
2365
- A[g.code] ? A[g.code]() : r(
2398
+ x[f.code] ? x[f.code]() : r(
2366
2399
  "menu-click",
2367
- g,
2368
2400
  f,
2369
- h,
2401
+ g,
2402
+ E,
2370
2403
  C,
2371
- y,
2372
- L,
2373
- k
2404
+ O,
2405
+ w,
2406
+ $
2374
2407
  );
2375
- }, m = ({ targetAreas: g }) => {
2376
- var C, y;
2377
- const f = ((C = g == null ? void 0 : g[0]) == null ? void 0 : C.rows) || [], h = ((y = l.value) == null ? void 0 : y.getInsertRecords()) || [];
2378
- r("update:data", [...h, ...f]);
2408
+ }, m = ({ targetAreas: f }) => {
2409
+ var C, O;
2410
+ const g = ((C = f == null ? void 0 : f[0]) == null ? void 0 : C.rows) || [], E = ((O = l.value) == null ? void 0 : O.getInsertRecords()) || [];
2411
+ r("update:data", [...E, ...g]);
2379
2412
  }, T = () => {
2380
- var h, C;
2381
- const g = n.data, f = ((h = g.at(-1)) == null ? void 0 : h._X_ROW_KEY) ?? 0;
2382
- g.push({ _X_ROW_KEY: f + 1 }), r("update:data", g), (C = l.value) == null || C.reloadData(g);
2413
+ var E, C;
2414
+ const f = n.data, g = ((E = f.at(-1)) == null ? void 0 : E._X_ROW_KEY) ?? 0;
2415
+ f.push({ _X_ROW_KEY: g + 1 }), r("update:data", f), (C = l.value) == null || C.reloadData(f);
2383
2416
  };
2384
- function R(g) {
2385
- const f = [];
2386
- function h(C) {
2387
- var y;
2388
- for (const L of C)
2389
- L.field && f.push(L.field), (y = L.children) != null && y.length && h(L.children);
2417
+ function R(f) {
2418
+ const g = [];
2419
+ function E(C) {
2420
+ var O;
2421
+ for (const w of C)
2422
+ w.field && g.push(w.field), (O = w.children) != null && O.length && E(w.children);
2390
2423
  }
2391
- return h(g), f;
2424
+ return E(f), g;
2392
2425
  }
2393
- const _ = ["tm", "updateTime", "startTime", "endTime"], P = () => {
2394
- const g = [], f = R(n.columns), h = n.data, C = Object.keys(h);
2395
- for (let y = 0; y < C.length; y++) {
2396
- const L = C[y], k = h[L], b = [];
2397
- for (let A = 0; A < f.length; A++) {
2398
- const O = f[A];
2399
- l.value.isUpdateByRow(k, O) && b.push(O);
2426
+ const y = ["tm", "updateTime", "startTime", "endTime"], S = () => {
2427
+ const f = [], g = R(n.columns), E = n.data, C = Object.keys(E);
2428
+ for (let O = 0; O < C.length; O++) {
2429
+ const w = C[O], $ = E[w], b = [];
2430
+ for (let x = 0; x < g.length; x++) {
2431
+ const _ = g[x];
2432
+ l.value.isUpdateByRow($, _) && b.push(_);
2400
2433
  }
2401
2434
  if (b.length > 0) {
2402
- const A = {};
2403
- for (let O = 0; O < b.length; O++) {
2404
- const E = b[O];
2405
- A[E] = k[E];
2435
+ const x = {};
2436
+ for (let _ = 0; _ < b.length; _++) {
2437
+ const h = b[_];
2438
+ x[h] = $[h];
2406
2439
  }
2407
- for (let O = 0; O < _.length; O++) {
2408
- const E = _[O];
2409
- k[E] !== void 0 && (A[E] = k[E]);
2440
+ for (let _ = 0; _ < y.length; _++) {
2441
+ const h = y[_];
2442
+ $[h] !== void 0 && (x[h] = $[h]);
2410
2443
  }
2411
- g.push(A);
2444
+ f.push(x);
2412
2445
  }
2413
2446
  }
2414
- return g;
2415
- }, I = () => {
2416
- n.height ? s.value = n.height : ae(() => {
2417
- var f, h;
2418
- const g = window.innerHeight - 100 - ((h = (f = document.querySelector(`#${a.value}`)) == null ? void 0 : f.getBoundingClientRect()) == null ? void 0 : h.top);
2419
- s.value = g;
2447
+ return f;
2448
+ }, P = () => {
2449
+ n.height ? s.value = n.height : _e(() => {
2450
+ var g, E;
2451
+ const f = window.innerHeight - 100 - ((E = (g = document.querySelector(`#${a.value}`)) == null ? void 0 : g.getBoundingClientRect()) == null ? void 0 : E.top);
2452
+ s.value = f;
2420
2453
  });
2421
2454
  };
2422
- return Te(
2455
+ return Re(
2423
2456
  () => n.height,
2424
2457
  () => {
2425
- I();
2458
+ P();
2426
2459
  }
2427
- ), Re(() => {
2428
- a.value = "_gridRef" + Math.round(Math.random() * 2e4) + 0, [".app-main"].map(
2460
+ ), ye(() => {
2461
+ console.log(n.data, "props.data");
2462
+ const f = 0, g = 2e4;
2463
+ a.value = "_gridRef" + Math.round(Math.random() * (g - f)) + f, [".app-main"].map(
2429
2464
  (C) => document.querySelector(C)
2430
2465
  ).forEach((C) => {
2431
- C && Ie(C, () => {
2432
- I();
2466
+ C && De(C, () => {
2467
+ P();
2433
2468
  });
2434
- }), I(), ae(() => {
2435
- l.value && l.value.recalculate();
2436
- });
2437
- }), o({ xGrid: l, getUpdateCellData: P }), {
2469
+ }), P();
2470
+ }), o({ xGrid: l, getUpdateCellData: S }), {
2438
2471
  gridWidth: t,
2439
2472
  xGrid: l,
2440
2473
  gridId: a,
2441
2474
  tableHeight: s,
2442
2475
  transColumns: c,
2443
2476
  allSlots: i,
2444
- gridOptions: u,
2477
+ mergedConfigs: u,
2445
2478
  handleMenu: d,
2446
2479
  cellAreaPaste: m,
2447
2480
  enterAppendRow: T
2448
2481
  };
2449
2482
  }
2450
- }), Ue = ["id"], ze = { key: 1 };
2451
- function Xe(n, r, o, e, t, l) {
2452
- const s = _e("vxe-grid");
2483
+ }), Ue = ["id"], Xe = { key: 1 };
2484
+ function qe(n, r, o, e, t, l) {
2485
+ const s = Oe("vxe-grid");
2453
2486
  return q(), G("div", {
2454
2487
  id: n.gridId,
2455
2488
  ref: n.gridId
2456
2489
  }, [
2457
- xe(s, Oe({ ref: "xGrid" }, n.gridOptions, {
2458
- onMenuClick: n.handleMenu,
2459
- onCellAreaPaste: n.cellAreaPaste,
2460
- onEnterAppendRow: n.enterAppendRow
2461
- }), ye({ _: 2 }, [
2462
- Ae(n.allSlots, (a) => ({
2463
- name: a.name,
2464
- fn: ve((c) => [
2465
- Le(n.$slots, a.name, we(Se(c)), () => [
2466
- a.type === "header" ? (q(), G(re, { key: 0 }, [
2467
- a.item.unit ? (q(), G(re, { key: 0 }, [
2468
- ie("span", null, Z(a.item.title), 1),
2469
- ie("div", null, "(" + Z(a.item.unit) + ")", 1)
2470
- ], 64)) : (q(), G("span", ze, Z(a.item.title), 1))
2471
- ], 64)) : Pe("", !0)
2472
- ])
2473
- ])
2474
- }))
2475
- ]), 1040, ["onMenuClick", "onCellAreaPaste", "onEnterAppendRow"])
2490
+ se(xe, null, {
2491
+ default: ae(() => [
2492
+ se(s, Ae(n.$attrs, {
2493
+ class: "hydGrid",
2494
+ ref: "xGrid",
2495
+ size: "small",
2496
+ align: n.align,
2497
+ "area-config": n.mergedConfigs.areaConfig,
2498
+ "auto-resize": n.autoResize,
2499
+ border: n.border,
2500
+ "cell-style": n.cellStyle,
2501
+ "clip-config": n.mergedConfigs.clipConfig,
2502
+ "column-config": n.mergedConfigs.columnConfig,
2503
+ columns: n.columns,
2504
+ data: n.data,
2505
+ height: n.tableHeight,
2506
+ "max-height": n.tableHeight,
2507
+ "edit-config": n.mergedConfigs.editConfig,
2508
+ "export-config": n.mergedConfigs.exportConfig,
2509
+ "header-row-style": n.headerRowStyle,
2510
+ "keep-source": n.keepSource,
2511
+ "keyboard-config": n.mergedConfigs.keyboardConfig,
2512
+ "menu-config": n.mergedConfigs.menuConfig,
2513
+ "merge-cells": n.mergeCells,
2514
+ "mouse-config": n.mergedConfigs.mouseConfig,
2515
+ "row-config": n.mergedConfigs.rowConfig,
2516
+ "row-style": n.rowStyle,
2517
+ "show-footer": n.showFooter,
2518
+ "show-header": n.showHeader,
2519
+ "show-header-overflow": n.showHeaderOverflow,
2520
+ "show-overflow": n.showOverflow,
2521
+ "sort-config": n.mergedConfigs.sortConfig,
2522
+ style: { width: n.gridWidth },
2523
+ "virtual-y-config": n.mergedConfigs.virtualYConfig,
2524
+ onMenuClick: n.handleMenu,
2525
+ onCellAreaPaste: n.cellAreaPaste,
2526
+ onEnterAppendRow: n.enterAppendRow
2527
+ }), we({ _: 2 }, [
2528
+ Le(n.allSlots, (a) => ({
2529
+ name: a.name,
2530
+ fn: ae((c) => [
2531
+ ve(n.$slots, a.name, Se(Pe(c)), () => [
2532
+ a.type === "header" ? (q(), G(re, { key: 0 }, [
2533
+ a.item.unit ? (q(), G(re, { key: 0 }, [
2534
+ ie("span", null, Q(a.item.title), 1),
2535
+ ie("div", null, "(" + Q(a.item.unit) + ")", 1)
2536
+ ], 64)) : (q(), G("span", Xe, Q(a.item.title), 1))
2537
+ ], 64)) : Ie("", !0)
2538
+ ])
2539
+ ])
2540
+ }))
2541
+ ]), 1040, ["align", "area-config", "auto-resize", "border", "cell-style", "clip-config", "column-config", "columns", "data", "height", "max-height", "edit-config", "export-config", "header-row-style", "keep-source", "keyboard-config", "menu-config", "merge-cells", "mouse-config", "row-config", "row-style", "show-footer", "show-header", "show-header-overflow", "show-overflow", "sort-config", "style", "virtual-y-config", "onMenuClick", "onCellAreaPaste", "onEnterAppendRow"])
2542
+ ]),
2543
+ _: 3
2544
+ })
2476
2545
  ], 8, Ue);
2477
2546
  }
2478
- const Q = /* @__PURE__ */ He(We, [["render", Xe]]);
2479
- Q.install = (n) => {
2480
- n.component(Q.name || "DseTable", Q);
2547
+ const J = /* @__PURE__ */ Be(ze, [["render", qe]]);
2548
+ J.install = (n) => {
2549
+ n.component(J.name || "DseTable", J);
2481
2550
  };
2482
- const je = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2551
+ const Ge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2483
2552
  __proto__: null,
2484
- DseTable: Q
2485
- }, Symbol.toStringTag, { value: "Module" })), qe = (n) => {
2486
- be(n), Object.values(je).forEach((r) => {
2553
+ DseTable: J
2554
+ }, Symbol.toStringTag, { value: "Module" })), Ye = (n) => {
2555
+ he(n), Object.values(Ge).forEach((r) => {
2487
2556
  r.install ? r.install(n) : r.name && n.component(r.name, r);
2488
2557
  });
2489
- }, tt = { install: qe };
2558
+ }, ot = { install: Ye };
2490
2559
  export {
2491
- Q as DseTable,
2492
- et as VxeTable,
2493
- Ze as VxeUI,
2494
- tt as default,
2495
- be as setupVxeTable
2560
+ J as DseTable,
2561
+ tt as VxeTable,
2562
+ et as VxeUI,
2563
+ ot as default,
2564
+ he as setupVxeTable
2496
2565
  };
2497
2566
  //# sourceMappingURL=index.js.map