dse-edit-table 0.0.2 → 0.0.3

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 Me, getCurrentInstance as Te, computed as j, watch as Re, onMounted as ye, nextTick as Oe, resolveComponent as _e, openBlock as q, createElementBlock as G, createVNode as ae, Transition as Ae, withCtx as re, mergeProps as xe, createSlots as we, renderList as ve, renderSlot as Le, normalizeProps as Se, guardReactiveProps as Pe, Fragment as ie, createElementVNode as ce, toDisplayString as Z, createCommentVNode as Ie } from "vue";
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
2
  import $ from "vxe-pc-ui";
3
3
  import me from "vxe-table";
4
4
  import p from "xe-utils";
5
- import { useResizeObserver as De } from "@vueuse/core";
5
+ import { useResizeObserver as Ie } from "@vueuse/core";
6
6
  var le = {};
7
7
  Object.defineProperty(le, "__esModule", {
8
8
  value: !0
9
9
  });
10
- var ge = le.default = void 0;
11
- ge = le.default = {
10
+ var fe = le.default = void 0;
11
+ fe = le.default = {
12
12
  vxe: {
13
13
  base: {
14
14
  pleaseInput: "请输入",
@@ -859,28 +859,28 @@ function ne() {
859
859
  const r = M.config;
860
860
  return r && r.clipboard ? r.clipboard : null;
861
861
  }
862
- function Fe(n) {
862
+ function De(n) {
863
863
  const r = M.globalStore;
864
864
  r ? r.clipboard = n : M.config && (M.config.clipboard = n);
865
865
  }
866
- let w;
867
- function $e(n) {
868
- if (!w) {
869
- w = document.createElement("textarea"), w.id = "$XECopy";
870
- const r = w.style;
871
- r.width = "48px", r.height = "24px", r.position = "fixed", r.zIndex = "0", r.left = "-500px", r.top = "-500px", document.body.appendChild(w);
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);
872
872
  }
873
- w.value = n == null ? "" : "" + n;
873
+ v.value = n == null ? "" : "" + n;
874
874
  }
875
- function Ce(n) {
875
+ function ge(n) {
876
876
  let r = !1;
877
877
  try {
878
- $e(n), w.select(), w.setSelectionRange(0, w.value.length), r = document.execCommand("copy"), w.blur();
878
+ Fe(n), v.select(), v.setSelectionRange(0, v.value.length), r = document.execCommand("copy"), v.blur();
879
879
  } catch {
880
880
  }
881
881
  return r;
882
882
  }
883
- function ue(n, r) {
883
+ function ce(n, r) {
884
884
  const { $event: o, $table: e, row: t, column: l } = n;
885
885
  if (t && l) {
886
886
  const s = e.props, { mouseConfig: a } = s, { computeMouseOpts: c } = e.getComputeMaps(), i = c.value;
@@ -890,8 +890,8 @@ function ue(n, r) {
890
890
  const d = ne();
891
891
  u = d ? d.text : "";
892
892
  } else
893
- u = p.toValueString(p.get(t, l.field)), Fe({ text: u, html: "" });
894
- p.isFunction(z) ? z(u) : Ce(u);
893
+ u = p.toValueString(p.get(t, l.field)), De({ text: u, html: "" });
894
+ p.isFunction(z) ? z(u) : ge(u);
895
895
  }
896
896
  }
897
897
  function H(n) {
@@ -900,17 +900,17 @@ function H(n) {
900
900
  o && o.commitProxy(n);
901
901
  };
902
902
  }
903
- function ke(n, r) {
903
+ function $e(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
- for (let d = 0, f = i.length; d < f; d++) {
907
+ for (let d = 0, m = i.length; d < m; d++) {
908
908
  const T = i[d], R = oe(o, e, T);
909
- for (let y = 0, P = u.length; y < P; y++) {
910
- const I = u[y], m = te(t, I), g = R + ":" + m;
911
- if (l[g])
909
+ for (let _ = 0, P = u.length; _ < P; _++) {
910
+ const I = u[_], g = te(t, I), f = R + ":" + g;
911
+ if (l[f])
912
912
  return !1;
913
- l[g] = !0;
913
+ l[f] = !0;
914
914
  }
915
915
  }
916
916
  }
@@ -918,16 +918,16 @@ function ke(n, r) {
918
918
  }
919
919
  function se(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
- return r.getMergeCells().filter(({ row: u, col: d, rowspan: f, colspan: T }) => c.some((R) => {
922
- const { rows: y, cols: P } = R, I = oe(r, s, y[0]), m = oe(r, s, y[y.length - 1]), g = te(a, P[0]), E = te(a, P[P.length - 1]);
923
- return u >= I && u + f - 1 <= m && d >= g && d + T - 1 <= E;
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;
924
924
  }));
925
925
  }
926
- function de(n) {
926
+ function ue(n) {
927
927
  const { $table: r } = n, o = se(n);
928
928
  return o.length && r.removeMergeCells(o), o;
929
929
  }
930
- function pe(n, r) {
930
+ function de(n, r) {
931
931
  const { code: o } = n, { $table: e, $grid: t, row: l, column: s, type: a } = r, c = e.props, { editConfig: i, mouseConfig: u } = c;
932
932
  switch (o) {
933
933
  case "CLEAR_ALL_SORT": {
@@ -941,8 +941,8 @@ function pe(n, r) {
941
941
  break;
942
942
  }
943
943
  case "CLEAR_ALL_MERGE": {
944
- const d = e.getMergeCells(), f = e.getMergeFooterItems();
945
- n.disabled = !d.length && !f.length;
944
+ const d = e.getMergeCells(), m = e.getMergeFooterItems();
945
+ n.disabled = !d.length && !m.length;
946
946
  break;
947
947
  }
948
948
  case "CLEAR_MERGE_CELL": {
@@ -955,8 +955,8 @@ function pe(n, r) {
955
955
  break;
956
956
  }
957
957
  case "SELECT_ALL_AREA": {
958
- const { visibleData: d } = e.getTableData(), { visibleColumn: f } = e.getTableColumn();
959
- n.disabled = !d.length || !f.length;
958
+ const { visibleData: d } = e.getTableData(), { visibleColumn: m } = e.getTableColumn();
959
+ n.disabled = !d.length || !m.length;
960
960
  break;
961
961
  }
962
962
  case "SELECT_AREA_TO_LEFT":
@@ -996,7 +996,7 @@ function pe(n, r) {
996
996
  case "FIXED_RIGHT_COLUMN":
997
997
  case "CLEAR_FIXED_COLUMN": {
998
998
  if (n.disabled = !s, s) {
999
- const { computeMouseOpts: d } = e.getComputeMaps(), f = d.value, T = !!s.parentId;
999
+ const { computeMouseOpts: d } = e.getComputeMaps(), m = d.value, T = !!s.parentId;
1000
1000
  switch (o) {
1001
1001
  case "CLEAR_SORT": {
1002
1002
  n.disabled = !s.sortable || !s.order;
@@ -1025,7 +1025,7 @@ function pe(n, r) {
1025
1025
  }
1026
1026
  case "OPEN_FIND":
1027
1027
  case "OPEN_REPLACE": {
1028
- n.disabled = !(u && f.area);
1028
+ n.disabled = !(u && m.area);
1029
1029
  break;
1030
1030
  }
1031
1031
  case "EDIT_CELL": {
@@ -1035,12 +1035,12 @@ function pe(n, r) {
1035
1035
  case "COPY_CELL":
1036
1036
  case "CUT_CELL":
1037
1037
  case "PASTE_CELL": {
1038
- const R = u && f.area ? e.getCellAreas() : [];
1038
+ const R = u && m.area ? e.getCellAreas() : [];
1039
1039
  if (n.disabled = R.length > 1, !n.disabled)
1040
1040
  switch (o) {
1041
1041
  case "PASTE_CELL": {
1042
- const y = ne();
1043
- n.disabled = !y || !y.text;
1042
+ const _ = ne();
1043
+ n.disabled = !_ || !_.text;
1044
1044
  break;
1045
1045
  }
1046
1046
  }
@@ -1048,8 +1048,8 @@ function pe(n, r) {
1048
1048
  }
1049
1049
  case "MERGE_OR_CLEAR":
1050
1050
  case "MERGE_CELL": {
1051
- const R = u && f.area ? e.getCellAreas() : [];
1052
- n.disabled = !R.length || R.length === 1 && R[0].rows.length === 1 && R[0].cols.length === 1 || !ke(r, R);
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);
1053
1053
  break;
1054
1054
  }
1055
1055
  case "FIXED_LEFT_COLUMN":
@@ -1075,11 +1075,11 @@ function pe(n, r) {
1075
1075
  }
1076
1076
  }
1077
1077
  }
1078
- function Ne(n) {
1078
+ function ke(n) {
1079
1079
  return n.options.forEach((r) => {
1080
1080
  r.forEach((o) => {
1081
- pe(o, n), o.children && o.children.forEach((e) => {
1082
- pe(e, n);
1081
+ de(o, n), o.children && o.children.forEach((e) => {
1082
+ de(e, n);
1083
1083
  });
1084
1084
  });
1085
1085
  }), !0;
@@ -1140,13 +1140,13 @@ function W() {
1140
1140
  function U() {
1141
1141
  history.back();
1142
1142
  }
1143
- function fe(n) {
1143
+ function pe(n) {
1144
1144
  n && n.copy && (z = n.copy);
1145
1145
  }
1146
- const be = {
1147
- setConfig: fe,
1146
+ const Ce = {
1147
+ setConfig: pe,
1148
1148
  install(n, r) {
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"), fe(r), M.menus.mixin({
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({
1150
1150
  /**
1151
1151
  * 浏览器-刷新页面(对应按键F5)
1152
1152
  */
@@ -1188,10 +1188,10 @@ const be = {
1188
1188
  if (a && i.area) {
1189
1189
  const u = e.getCellAreas();
1190
1190
  u && u.length && u.forEach((d) => {
1191
- const { rows: f, cols: T } = d;
1191
+ const { rows: m, cols: T } = d;
1192
1192
  T.forEach((R) => {
1193
- f.forEach((y) => {
1194
- e.clearData(y, R.field);
1193
+ m.forEach((_) => {
1194
+ e.clearData(_, R.field);
1195
1195
  });
1196
1196
  });
1197
1197
  });
@@ -1225,8 +1225,8 @@ const be = {
1225
1225
  tableMenuMethod(o) {
1226
1226
  const { $table: e, row: t, column: l } = o, s = e.props, { mouseConfig: a } = s, { computeMouseOpts: c } = e.getComputeMaps(), i = c.value;
1227
1227
  a && i.area ? (a && i.area ? e.getCellAreas() : []).forEach((d) => {
1228
- const { rows: f } = d;
1229
- e.clearData(f);
1228
+ const { rows: m } = d;
1229
+ e.clearData(m);
1230
1230
  }) : t && l && e.clearData(t);
1231
1231
  }
1232
1232
  },
@@ -1265,12 +1265,12 @@ const be = {
1265
1265
  if (t && l && a && i.area) {
1266
1266
  const { visibleColumn: u } = e.getTableColumn(), d = e.getCellAreas();
1267
1267
  if (d.length === 1) {
1268
- const f = d[0];
1268
+ const m = d[0];
1269
1269
  e.setCellAreas([{
1270
- startRow: p.first(f.rows),
1271
- endRow: p.last(f.rows),
1270
+ startRow: p.first(m.rows),
1271
+ endRow: p.last(m.rows),
1272
1272
  startColumn: p.first(u),
1273
- endColumn: p.last(f.cols)
1273
+ endColumn: p.last(m.cols)
1274
1274
  }], { column: l, row: t });
1275
1275
  } else
1276
1276
  e.setCellAreas([{
@@ -1291,11 +1291,11 @@ const be = {
1291
1291
  if (t && l && a && i.area) {
1292
1292
  const { visibleColumn: u } = e.getTableColumn(), d = e.getCellAreas();
1293
1293
  if (d.length === 1) {
1294
- const f = d[0];
1294
+ const m = d[0];
1295
1295
  e.setCellAreas([{
1296
- startRow: p.first(f.rows),
1297
- endRow: p.last(f.rows),
1298
- startColumn: p.first(f.cols),
1296
+ startRow: p.first(m.rows),
1297
+ endRow: p.last(m.rows),
1298
+ startColumn: p.first(m.cols),
1299
1299
  endColumn: p.last(u)
1300
1300
  }], { column: l, row: t });
1301
1301
  } else
@@ -1317,12 +1317,12 @@ const be = {
1317
1317
  if (t && l && a && i.area) {
1318
1318
  const { visibleData: u } = e.getTableData(), d = e.getCellAreas();
1319
1319
  if (d.length === 1) {
1320
- const f = d[0];
1320
+ const m = d[0];
1321
1321
  e.setCellAreas([{
1322
1322
  startRow: p.first(u),
1323
- endRow: p.last(f.rows),
1324
- startColumn: p.first(f.cols),
1325
- endColumn: p.last(f.cols)
1323
+ endRow: p.last(m.rows),
1324
+ startColumn: p.first(m.cols),
1325
+ endColumn: p.last(m.cols)
1326
1326
  }], { column: l, row: t });
1327
1327
  } else
1328
1328
  e.setCellAreas([{
@@ -1343,12 +1343,12 @@ const be = {
1343
1343
  if (t && l && a && i.area) {
1344
1344
  const { visibleData: u } = e.getTableData(), d = e.getCellAreas();
1345
1345
  if (d.length === 1) {
1346
- const f = d[0];
1346
+ const m = d[0];
1347
1347
  e.setCellAreas([{
1348
- startRow: p.first(f.rows),
1348
+ startRow: p.first(m.rows),
1349
1349
  endRow: p.last(u),
1350
- startColumn: p.first(f.cols),
1351
- endColumn: p.last(f.cols)
1350
+ startColumn: p.first(m.cols),
1351
+ endColumn: p.last(m.cols)
1352
1352
  }], { column: l, row: t });
1353
1353
  } else
1354
1354
  e.setCellAreas([{
@@ -1371,10 +1371,10 @@ const be = {
1371
1371
  if (a && i.area) {
1372
1372
  const u = e.getCellAreas();
1373
1373
  u && u.length && u.forEach((d) => {
1374
- const { rows: f, cols: T } = d;
1374
+ const { rows: m, cols: T } = d;
1375
1375
  T.forEach((R) => {
1376
- f.forEach((y) => {
1377
- e.revertData(y, R.field);
1376
+ m.forEach((_) => {
1377
+ e.revertData(_, R.field);
1378
1378
  });
1379
1379
  });
1380
1380
  });
@@ -1416,7 +1416,7 @@ const be = {
1416
1416
  COPY_TITLE: {
1417
1417
  tableMenuMethod(o) {
1418
1418
  const { column: e } = o, t = e.getTitle();
1419
- t && (p.isFunction(z) ? z(t) : Ce(t));
1419
+ t && (p.isFunction(z) ? z(t) : ge(t));
1420
1420
  }
1421
1421
  },
1422
1422
  /**
@@ -1424,7 +1424,7 @@ const be = {
1424
1424
  */
1425
1425
  COPY_CELL: {
1426
1426
  tableMenuMethod(o) {
1427
- ue(o);
1427
+ ce(o);
1428
1428
  }
1429
1429
  },
1430
1430
  /**
@@ -1432,7 +1432,7 @@ const be = {
1432
1432
  */
1433
1433
  CUT_CELL: {
1434
1434
  tableMenuMethod(o) {
1435
- ue(o, !0);
1435
+ ce(o, !0);
1436
1436
  }
1437
1437
  },
1438
1438
  /**
@@ -1472,7 +1472,7 @@ const be = {
1472
1472
  MERGE_CELL: {
1473
1473
  tableMenuMethod(o) {
1474
1474
  const { $event: e, $table: t } = o, { visibleData: l } = t.getTableData(), { visibleColumn: s } = t.getTableColumn(), a = t.getCellAreas();
1475
- if (de(o), a.some(({ rows: i, cols: u }) => i.length === l.length || u.length === s.length)) {
1475
+ if (ue(o), a.some(({ rows: i, cols: u }) => i.length === l.length || u.length === s.length)) {
1476
1476
  M.modal && M.modal.message({ content: M.getI18n("vxe.pro.area.mergeErr"), status: "error", id: "operErr" });
1477
1477
  return;
1478
1478
  }
@@ -1491,7 +1491,7 @@ const be = {
1491
1491
  */
1492
1492
  CLEAR_MERGE_CELL: {
1493
1493
  tableMenuMethod(o) {
1494
- const { $event: e, $table: t } = o, l = de(o);
1494
+ const { $event: e, $table: t } = o, l = ue(o);
1495
1495
  l.length && t.dispatchEvent("clear-cell-area-merge", { mergeCells: l }, e);
1496
1496
  }
1497
1497
  },
@@ -1556,8 +1556,8 @@ const be = {
1556
1556
  const { $table: e, menu: t, row: l, column: s } = o, a = e.props, { mouseConfig: c } = a, { computeMouseOpts: i } = e.getComputeMaps(), u = i.value;
1557
1557
  Y().then(({ size: d }) => {
1558
1558
  if (d) {
1559
- const f = p.range(0, d).map(() => Object.assign({}, t.params));
1560
- (l ? e.insertAt(f, l) : e.insert(f)).then(({ rows: T }) => {
1559
+ const m = p.range(0, d).map(() => Object.assign({}, t.params));
1560
+ (l ? e.insertAt(m, l) : e.insert(m)).then(({ rows: T }) => {
1561
1561
  s && c && u.area && e.setCellAreas([
1562
1562
  { startRow: p.first(T), endRow: p.last(T), startColumn: s, endColumn: s }
1563
1563
  ]);
@@ -1587,8 +1587,8 @@ const be = {
1587
1587
  const { $table: e, menu: t, row: l, column: s } = o, a = e.props, { mouseConfig: c } = a, { computeMouseOpts: i } = e.getComputeMaps(), u = i.value;
1588
1588
  Y().then(({ size: d }) => {
1589
1589
  if (d) {
1590
- const f = p.range(0, d).map(() => Object.assign({}, t.params));
1591
- (l ? e.insertNextAt(f, l) : e.insert(f)).then(({ rows: T }) => {
1590
+ const m = p.range(0, d).map(() => Object.assign({}, t.params));
1591
+ (l ? e.insertNextAt(m, l) : e.insert(m)).then(({ rows: T }) => {
1592
1592
  s && c && u.area && e.setCellAreas([
1593
1593
  { startRow: p.first(T), endRow: p.last(T), startColumn: s, endColumn: s }
1594
1594
  ]);
@@ -1938,12 +1938,12 @@ const be = {
1938
1938
  COMMIT_PROXY_SAVE: {
1939
1939
  tableMenuMethod: H("save")
1940
1940
  }
1941
- }), M.interceptor.add("event.showMenu", Ne);
1941
+ }), M.interceptor.add("event.showMenu", ke);
1942
1942
  }
1943
1943
  };
1944
- typeof window < "u" && window.VxeUI && window.VxeUI.use && window.VxeUI.use(be);
1945
- $.setI18n("zh-CN", ge);
1946
- $.use(be);
1944
+ typeof window < "u" && window.VxeUI && window.VxeUI.use && window.VxeUI.use(Ce);
1945
+ $.setI18n("zh-CN", fe);
1946
+ $.use(Ce);
1947
1947
  $.setIcon({
1948
1948
  TABLE_EDIT: ""
1949
1949
  });
@@ -1951,11 +1951,11 @@ $.setConfig({
1951
1951
  authId: "wmtxlrzz9kdguq7j"
1952
1952
  });
1953
1953
  $.setLanguage("zh-CN");
1954
- const et = $, tt = me;
1955
- function he(n) {
1954
+ const Ze = $, et = me;
1955
+ function be(n) {
1956
1956
  n.use($), n.use(me);
1957
1957
  }
1958
- function Ve(n) {
1958
+ function Ne(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)
@@ -2007,7 +2007,7 @@ function J(n) {
2007
2007
  }
2008
2008
  return n;
2009
2009
  }
2010
- const He = () => ({
2010
+ const Ve = () => ({
2011
2011
  menuConfig: {
2012
2012
  // header: {
2013
2013
  // options: [
@@ -2111,12 +2111,12 @@ const He = () => ({
2111
2111
  },
2112
2112
  export: !1
2113
2113
  }
2114
- }), Be = (n, r) => {
2114
+ }), He = (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
- }, We = (n = "children", r = []) => {
2119
+ }, Be = (n = "children", r = []) => {
2120
2120
  const o = [], e = (t, l = []) => {
2121
2121
  l.forEach((s) => {
2122
2122
  var a;
@@ -2124,7 +2124,7 @@ const He = () => ({
2124
2124
  });
2125
2125
  };
2126
2126
  return e(o, r), o;
2127
- }, _ = He(), Ue = Me({
2127
+ }, x = Ve(), We = he({
2128
2128
  name: "DseTable",
2129
2129
  emits: [
2130
2130
  "menu-click",
@@ -2136,7 +2136,51 @@ const He = () => ({
2136
2136
  props: {
2137
2137
  menuConfig: {
2138
2138
  type: Object,
2139
- default: () => _.menuConfig
2139
+ default: () => x.menuConfig
2140
+ },
2141
+ editConfig: {
2142
+ type: Object,
2143
+ default: () => x.editConfig
2144
+ },
2145
+ exportConfig: {
2146
+ type: Object,
2147
+ default: () => x.exportConfig
2148
+ },
2149
+ columnConfig: {
2150
+ type: Object,
2151
+ default: () => x.columnConfig
2152
+ },
2153
+ sortConfig: {
2154
+ type: Object,
2155
+ default: () => x.sortConfig
2156
+ },
2157
+ virtualYConfig: {
2158
+ type: Object,
2159
+ default: () => x.virtualYConfig
2160
+ },
2161
+ clipConfig: {
2162
+ type: Object,
2163
+ default: () => x.clipConfig
2164
+ },
2165
+ areaConfig: {
2166
+ type: Object,
2167
+ default: () => x.areaConfig
2168
+ },
2169
+ mouseConfig: {
2170
+ type: Object,
2171
+ default: () => x.mouseConfig
2172
+ },
2173
+ keyboardConfig: {
2174
+ type: Object,
2175
+ default: () => x.keyboardConfig
2176
+ },
2177
+ rowConfig: {
2178
+ type: Object,
2179
+ default: () => x.rowConfig
2180
+ },
2181
+ toolbarConfig: {
2182
+ type: Object,
2183
+ default: () => x.toolbarConfig
2140
2184
  },
2141
2185
  autoResize: {
2142
2186
  type: Boolean,
@@ -2204,50 +2248,10 @@ const He = () => ({
2204
2248
  type: Number,
2205
2249
  default: 0
2206
2250
  },
2207
- editConfig: {
2208
- type: Object,
2209
- default: () => _.editConfig
2210
- },
2211
- exportConfig: {
2212
- type: Object,
2213
- default: () => _.exportConfig
2214
- },
2215
2251
  align: {
2216
2252
  type: String,
2217
2253
  default: "center"
2218
2254
  },
2219
- columnConfig: {
2220
- type: Object,
2221
- default: () => _.columnConfig
2222
- },
2223
- sortConfig: {
2224
- type: Object,
2225
- default: () => _.sortConfig
2226
- },
2227
- virtualYConfig: {
2228
- type: Object,
2229
- default: () => _.virtualYConfig
2230
- },
2231
- clipConfig: {
2232
- type: Object,
2233
- default: () => _.clipConfig
2234
- },
2235
- areaConfig: {
2236
- type: Object,
2237
- default: () => _.areaConfig
2238
- },
2239
- mouseConfig: {
2240
- type: Object,
2241
- default: () => _.mouseConfig
2242
- },
2243
- keyboardConfig: {
2244
- type: Object,
2245
- default: () => _.keyboardConfig
2246
- },
2247
- rowConfig: {
2248
- type: Object,
2249
- default: () => _.rowConfig
2250
- },
2251
2255
  mergeCells: {
2252
2256
  type: Array,
2253
2257
  default: () => []
@@ -2258,17 +2262,17 @@ const He = () => ({
2258
2262
  }
2259
2263
  },
2260
2264
  setup(n, { emit: r, expose: o }) {
2261
- const e = Te();
2262
- e && e.proxy && e.proxy.appContext && e.proxy.appContext.app && he(e.proxy.appContext.app);
2265
+ const e = Me();
2266
+ e && e.proxy && e.proxy.appContext && e.proxy.appContext.app && be(e.proxy.appContext.app);
2263
2267
  const t = j(
2264
2268
  () => typeof n.width == "number" ? `${n.width}px` : n.width
2265
- ), l = K(), s = K(0), a = K("dse-table-grid"), c = j(() => We("children", n.columns)), i = j(() => {
2266
- const m = [];
2267
- return c.value.forEach((g) => {
2268
- g.slots && (g.slots.default && m.push({ name: g.slots.default, type: "default", item: g }), g.slots.edit && m.push({ name: g.slots.edit, type: "edit", item: g }), g.slots.header && m.push({ name: g.slots.header, type: "header", item: g }));
2269
- }), m;
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;
2270
2274
  }), u = j(() => {
2271
- const m = ["menuConfig"], g = [
2275
+ const g = ["menuConfig"], f = [
2272
2276
  "editConfig",
2273
2277
  "exportConfig",
2274
2278
  "columnConfig",
@@ -2280,38 +2284,60 @@ const He = () => ({
2280
2284
  "keyboardConfig",
2281
2285
  "rowConfig",
2282
2286
  "toolbarConfig"
2283
- ], E = {};
2284
- return m.forEach((C) => {
2285
- E[C] = J({}, _[C], n[C] || {});
2286
- }), g.forEach((C) => {
2287
- E[C] = Ve({}, _[C], n[C] || {});
2288
- }), E;
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
+ };
2289
2315
  }), d = ({
2290
- menu: m,
2291
- type: g,
2292
- row: E,
2316
+ menu: g,
2317
+ type: f,
2318
+ row: h,
2293
2319
  rowIndex: C,
2294
- column: A,
2295
- columnIndex: v,
2320
+ column: y,
2321
+ columnIndex: L,
2296
2322
  $event: k
2297
2323
  }) => {
2298
2324
  var O;
2299
- m.code === "DELETE_COLUMN" && (n.columns.splice(v, 1), (O = l.value) == null || O.refreshColumn());
2300
- const b = n.data, x = {
2325
+ g.code === "DELETE_COLUMN" && (n.columns.splice(L, 1), (O = l.value) == null || O.refreshColumn());
2326
+ const b = n.data, A = {
2301
2327
  CLEAR_ROW: () => {
2302
- var L, S, N, V;
2303
- const h = (N = (S = (L = l.value) == null ? void 0 : L.getCellAreas()) == null ? void 0 : S[0]) == null ? void 0 : N.rows;
2304
- if (h != null && h.length) {
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) {
2305
2331
  for (let D = 0; D < b.length; D++)
2306
- h.includes(b[D]) && (b[D] = {});
2332
+ E.includes(b[D]) && (b[D] = {});
2307
2333
  r("update:data", b), (V = l.value) == null || V.reloadData(b), r("menu-clear-delete", b);
2308
2334
  }
2309
2335
  },
2310
2336
  DELETE: () => {
2311
2337
  var S, N, V, D;
2312
- const h = (V = (N = (S = l.value) == null ? void 0 : S.getCellAreas()) == null ? void 0 : N[0]) == null ? void 0 : V.rows;
2313
- if (!(h != null && h.length)) return;
2314
- h.map((F) => {
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) => {
2315
2341
  var X;
2316
2342
  return (X = l.value) == null ? void 0 : X.getRowIndex(F);
2317
2343
  }).sort((F, X) => X - F).forEach((F) => {
@@ -2319,95 +2345,95 @@ const He = () => ({
2319
2345
  }), r("update:data", b), (D = l.value) == null || D.reloadData(b), r("menu-clear-delete", b);
2320
2346
  },
2321
2347
  INSERT_AT_ROW: () => {
2322
- var h, L;
2348
+ var E, w;
2323
2349
  if (!C && C !== 0) {
2324
- r("update:data", b.push({})), (h = l.value) == null || h.reloadData(b);
2350
+ r("update:data", b.push({})), (E = l.value) == null || E.reloadData(b);
2325
2351
  return;
2326
2352
  }
2327
- r("update:data", b.splice(C + 1, 0, {})), (L = l.value) == null || L.reloadData(b);
2353
+ r("update:data", b.splice(C + 1, 0, {})), (w = l.value) == null || w.reloadData(b);
2328
2354
  },
2329
2355
  INSERT_AT_ROW10: () => {
2330
- var L, S;
2331
- const h = Array.from({ length: 10 }, () => ({}));
2356
+ var w, S;
2357
+ const E = Array.from({ length: 10 }, () => ({}));
2332
2358
  if (!C && C !== 0) {
2333
- r("update:data", b.push(...h)), (L = l.value) == null || L.reloadData(b);
2359
+ r("update:data", b.push(...E)), (w = l.value) == null || w.reloadData(b);
2334
2360
  return;
2335
2361
  }
2336
- r("update:data", b.splice(C + 1, 0, ...h)), (S = l.value) == null || S.reloadData(b);
2362
+ r("update:data", b.splice(C + 1, 0, ...E)), (S = l.value) == null || S.reloadData(b);
2337
2363
  }
2338
2364
  };
2339
- x[m.code] ? x[m.code]() : r(
2365
+ A[g.code] ? A[g.code]() : r(
2340
2366
  "menu-click",
2341
- m,
2342
2367
  g,
2343
- E,
2368
+ f,
2369
+ h,
2344
2370
  C,
2345
- A,
2346
- v,
2371
+ y,
2372
+ L,
2347
2373
  k
2348
2374
  );
2349
- }, f = ({ targetAreas: m }) => {
2350
- var C, A;
2351
- const g = ((C = m == null ? void 0 : m[0]) == null ? void 0 : C.rows) || [], E = ((A = l.value) == null ? void 0 : A.getInsertRecords()) || [];
2352
- r("update:data", [...E, ...g]);
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]);
2353
2379
  }, T = () => {
2354
- var E, C;
2355
- const m = n.data, g = ((E = m.at(-1)) == null ? void 0 : E._X_ROW_KEY) ?? 0;
2356
- m.push({ _X_ROW_KEY: g + 1 }), r("update:data", m), (C = l.value) == null || C.reloadData(m);
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);
2357
2383
  };
2358
- function R(m) {
2359
- const g = [];
2360
- function E(C) {
2361
- var A;
2362
- for (const v of C)
2363
- v.field && g.push(v.field), (A = v.children) != null && A.length && E(v.children);
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);
2364
2390
  }
2365
- return E(m), g;
2391
+ return h(g), f;
2366
2392
  }
2367
- const y = ["tm", "updateTime", "startTime", "endTime"], P = () => {
2368
- const m = [], g = R(n.columns), E = n.data, C = Object.keys(E);
2369
- for (let A = 0; A < C.length; A++) {
2370
- const v = C[A], k = E[v], b = [];
2371
- for (let x = 0; x < g.length; x++) {
2372
- const O = g[x];
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];
2373
2399
  l.value.isUpdateByRow(k, O) && b.push(O);
2374
2400
  }
2375
2401
  if (b.length > 0) {
2376
- const x = {};
2402
+ const A = {};
2377
2403
  for (let O = 0; O < b.length; O++) {
2378
- const h = b[O];
2379
- x[h] = k[h];
2404
+ const E = b[O];
2405
+ A[E] = k[E];
2380
2406
  }
2381
- for (let O = 0; O < y.length; O++) {
2382
- const h = y[O];
2383
- k[h] !== void 0 && (x[h] = k[h]);
2407
+ for (let O = 0; O < _.length; O++) {
2408
+ const E = _[O];
2409
+ k[E] !== void 0 && (A[E] = k[E]);
2384
2410
  }
2385
- m.push(x);
2411
+ g.push(A);
2386
2412
  }
2387
2413
  }
2388
- return m;
2414
+ return g;
2389
2415
  }, I = () => {
2390
- n.height ? s.value = n.height : Oe(() => {
2391
- var g, E;
2392
- const m = window.innerHeight - 100 - ((E = (g = document.querySelector(`#${a.value}`)) == null ? void 0 : g.getBoundingClientRect()) == null ? void 0 : E.top);
2393
- s.value = m;
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;
2394
2420
  });
2395
2421
  };
2396
- return Re(
2422
+ return Te(
2397
2423
  () => n.height,
2398
2424
  () => {
2399
2425
  I();
2400
2426
  }
2401
- ), ye(() => {
2402
- console.log(n.data, "props.data");
2403
- const m = 0, g = 2e4;
2404
- a.value = "_gridRef" + Math.round(Math.random() * (g - m)) + m, [".app-main"].map(
2427
+ ), Re(() => {
2428
+ a.value = "_gridRef" + Math.round(Math.random() * 2e4) + 0, [".app-main"].map(
2405
2429
  (C) => document.querySelector(C)
2406
2430
  ).forEach((C) => {
2407
- C && De(C, () => {
2431
+ C && Ie(C, () => {
2408
2432
  I();
2409
2433
  });
2410
- }), I();
2434
+ }), I(), ae(() => {
2435
+ l.value && l.value.recalculate();
2436
+ });
2411
2437
  }), o({ xGrid: l, getUpdateCellData: P }), {
2412
2438
  gridWidth: t,
2413
2439
  xGrid: l,
@@ -2415,93 +2441,57 @@ const He = () => ({
2415
2441
  tableHeight: s,
2416
2442
  transColumns: c,
2417
2443
  allSlots: i,
2418
- mergedConfigs: u,
2444
+ gridOptions: u,
2419
2445
  handleMenu: d,
2420
- cellAreaPaste: f,
2446
+ cellAreaPaste: m,
2421
2447
  enterAppendRow: T
2422
2448
  };
2423
2449
  }
2424
- }), ze = ["id"], Xe = { key: 1 };
2425
- function je(n, r, o, e, t, l) {
2450
+ }), Ue = ["id"], ze = { key: 1 };
2451
+ function Xe(n, r, o, e, t, l) {
2426
2452
  const s = _e("vxe-grid");
2427
2453
  return q(), G("div", {
2428
2454
  id: n.gridId,
2429
2455
  ref: n.gridId
2430
2456
  }, [
2431
- ae(Ae, null, {
2432
- default: re(() => [
2433
- ae(s, xe(n.$attrs, {
2434
- class: "hydGrid",
2435
- ref: "xGrid",
2436
- size: "small",
2437
- align: n.align,
2438
- "area-config": n.mergedConfigs.areaConfig,
2439
- "auto-resize": n.autoResize,
2440
- border: n.border,
2441
- "cell-style": n.cellStyle,
2442
- "clip-config": n.mergedConfigs.clipConfig,
2443
- "column-config": n.mergedConfigs.columnConfig,
2444
- columns: n.columns,
2445
- data: n.data,
2446
- height: n.tableHeight,
2447
- "max-height": n.tableHeight,
2448
- "edit-config": n.mergedConfigs.editConfig,
2449
- "export-config": n.mergedConfigs.exportConfig,
2450
- "header-row-style": n.headerRowStyle,
2451
- "keep-source": n.keepSource,
2452
- "keyboard-config": n.mergedConfigs.keyboardConfig,
2453
- "menu-config": n.mergedConfigs.menuConfig,
2454
- "merge-cells": n.mergeCells,
2455
- "mouse-config": n.mergedConfigs.mouseConfig,
2456
- "row-config": n.mergedConfigs.rowConfig,
2457
- "row-style": n.rowStyle,
2458
- "show-footer": n.showFooter,
2459
- "show-header": n.showHeader,
2460
- "show-header-overflow": n.showHeaderOverflow,
2461
- "show-overflow": n.showOverflow,
2462
- "sort-config": n.mergedConfigs.sortConfig,
2463
- style: { width: n.gridWidth },
2464
- "virtual-y-config": n.mergedConfigs.virtualYConfig,
2465
- onMenuClick: n.handleMenu,
2466
- onCellAreaPaste: n.cellAreaPaste,
2467
- onEnterAppendRow: n.enterAppendRow
2468
- }), we({ _: 2 }, [
2469
- ve(n.allSlots, (a) => ({
2470
- name: a.name,
2471
- fn: re((c) => [
2472
- Le(n.$slots, a.name, Se(Pe(c)), () => [
2473
- a.type === "header" ? (q(), G(ie, { key: 0 }, [
2474
- a.item.unit ? (q(), G(ie, { key: 0 }, [
2475
- ce("span", null, Z(a.item.title), 1),
2476
- ce("div", null, "(" + Z(a.item.unit) + ")", 1)
2477
- ], 64)) : (q(), G("span", Xe, Z(a.item.title), 1))
2478
- ], 64)) : Ie("", !0)
2479
- ])
2480
- ])
2481
- }))
2482
- ]), 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"])
2483
- ]),
2484
- _: 3
2485
- })
2486
- ], 8, ze);
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"])
2476
+ ], 8, Ue);
2487
2477
  }
2488
- const Q = /* @__PURE__ */ Be(Ue, [["render", je]]);
2478
+ const Q = /* @__PURE__ */ He(We, [["render", Xe]]);
2489
2479
  Q.install = (n) => {
2490
2480
  n.component(Q.name || "DseTable", Q);
2491
2481
  };
2492
- const qe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2482
+ const je = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2493
2483
  __proto__: null,
2494
2484
  DseTable: Q
2495
- }, Symbol.toStringTag, { value: "Module" })), Ge = (n) => {
2496
- he(n), Object.values(qe).forEach((r) => {
2485
+ }, Symbol.toStringTag, { value: "Module" })), qe = (n) => {
2486
+ be(n), Object.values(je).forEach((r) => {
2497
2487
  r.install ? r.install(n) : r.name && n.component(r.name, r);
2498
2488
  });
2499
- }, ot = { install: Ge };
2489
+ }, tt = { install: qe };
2500
2490
  export {
2501
2491
  Q as DseTable,
2502
- tt as VxeTable,
2503
- et as VxeUI,
2504
- ot as default,
2505
- he as setupVxeTable
2492
+ et as VxeTable,
2493
+ Ze as VxeUI,
2494
+ tt as default,
2495
+ be as setupVxeTable
2506
2496
  };
2507
2497
  //# sourceMappingURL=index.js.map