@gx-design-vue/pro-table 0.2.0-beta.119 → 0.2.0-beta.120

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/pro-table.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * Gx Design Pro
3
- * Version: 0.2.0-beta.118
3
+ * Version: 0.2.0-beta.119
4
4
  * Author: gx12358
5
5
  * Copyright (C) 2024 gx12358
6
6
  * License: MIT License
@@ -15,7 +15,7 @@ import { useProAppContext as Rt } from "@gx-design-vue/pro-app";
15
15
  import { useContext as Tl, getProSolidColor as Ft, useProStyle as He, unit as yt, useProConfigContext as $l } from "@gx-design-vue/pro-provider";
16
16
  import { isArray as V, isBoolean as le, classNames as re, isNumber as De, filterEmpty as Bt, getPrefixCls as lt, getRandomNumber as tt, genColumnKey as Pt, isDeepEqualReact as Ye, cloneDeep as Z, compareArray as Rl, isObject as q, runFunction as Fl, convertValueBoolean as we, getSortIndex as Bl, isFunction as Ie, handleCurrentPage as Pl, deepMerge as It, arrayRepeat as Il, isString as kt, handleShowIndex as kl, getSlot as bt, handleEmptyField as Al, getSlotsProps as Ol, getTextWidth as Dl, getSlotVNode as jl } from "@gx-design-vue/pro-utils";
17
17
  import { useDebounceFn as Nl, useFullscreen as At, useWindowSize as El, toReactive as Ml } from "@vueuse/core";
18
- import { Grid as at, DatePicker as Ot, Space as ge, Input as ze, TimePicker as zl, TreeSelect as Kl, Select as Yl, InputNumber as Qe, Button as Ct, Spin as Dt, Popover as Ll, Checkbox as Wl, Tooltip as de, Tree as Vl, Dropdown as Hl, Menu as Ke, theme as ql, Pagination as Gl, Table as _l, message as Ql, Empty as Xl } from "ant-design-vue";
18
+ import { Grid as at, DatePicker as Ot, Space as ge, Input as Ke, TimePicker as Kl, TreeSelect as zl, Select as Yl, InputNumber as Qe, Button as Ct, Spin as Dt, Popover as Ll, Checkbox as Wl, Tooltip as de, Tree as Vl, Dropdown as Hl, Menu as ze, theme as ql, Pagination as Gl, Table as _l, message as Ql, Empty as Xl } from "ant-design-vue";
19
19
  import { omit as je, cloneDeep as jt, pick as xt } from "lodash-es";
20
20
  import { tableProps as Ul } from "ant-design-vue/es/table/Table";
21
21
  import "ant-design-vue/es/_util/props-util";
@@ -672,7 +672,7 @@ const fa = {
672
672
  }
673
673
  const pe = (t) => {
674
674
  let f;
675
- const R = h.value ? ze : ze.Search, $ = je(t.field || {}, "rules");
675
+ const R = h.value ? Ke : Ke.Search, $ = je(t.field || {}, "rules");
676
676
  let T = null;
677
677
  switch (t.valueType) {
678
678
  case "text":
@@ -698,7 +698,7 @@ const fa = {
698
698
  }, $), null);
699
699
  break;
700
700
  case "numberRange":
701
- f = i(ze.Group, {
701
+ f = i(Ke.Group, {
702
702
  compact: !0,
703
703
  class: re(u.value, `${e.prefixCls}-search-input-compact`)
704
704
  }, {
@@ -708,7 +708,7 @@ const fa = {
708
708
  key: 0
709
709
  }),
710
710
  placeholder: V(t.placeholder) && t.placeholder?.[0] || "请输入"
711
- }, null), i(ze, {
711
+ }, null), i(Ke, {
712
712
  disabled: !0,
713
713
  placeholder: "~"
714
714
  }, null), i(Qe, {
@@ -737,7 +737,7 @@ const fa = {
737
737
  }, $), null);
738
738
  break;
739
739
  case "treeSelect":
740
- T = i(Kl, M({
740
+ T = i(zl, M({
741
741
  style: {
742
742
  width: "100%"
743
743
  },
@@ -827,7 +827,7 @@ const fa = {
827
827
  }, $), null);
828
828
  break;
829
829
  case "time":
830
- f = i(zl, M({
830
+ f = i(Kl, M({
831
831
  style: {
832
832
  width: "100%"
833
833
  },
@@ -1494,7 +1494,7 @@ const Ca = () => {
1494
1494
  tableSize: a
1495
1495
  } = fe();
1496
1496
  return i(Hl, {
1497
- overlay: i(Ke, {
1497
+ overlay: i(ze, {
1498
1498
  selectedKeys: [a.value],
1499
1499
  onClick: ({
1500
1500
  key: l
@@ -1505,15 +1505,15 @@ const Ca = () => {
1505
1505
  width: 80
1506
1506
  }
1507
1507
  }, {
1508
- default: () => [i(Ke.Item, {
1508
+ default: () => [i(ze.Item, {
1509
1509
  key: "large"
1510
1510
  }, {
1511
1511
  default: () => [Ae("默认")]
1512
- }), i(Ke.Item, {
1512
+ }), i(ze.Item, {
1513
1513
  key: "middle"
1514
1514
  }, {
1515
1515
  default: () => [Ae("中等")]
1516
- }), i(Ke.Item, {
1516
+ }), i(ze.Item, {
1517
1517
  key: "small"
1518
1518
  }, {
1519
1519
  default: () => [Ae("紧凑")]
@@ -1527,7 +1527,7 @@ const Ca = () => {
1527
1527
  default: () => [i(bl, null, null)]
1528
1528
  })]
1529
1529
  });
1530
- }, zt = /* @__PURE__ */ ne({
1530
+ }, Kt = /* @__PURE__ */ ne({
1531
1531
  setup() {
1532
1532
  const {
1533
1533
  isFullscreen: e
@@ -1559,7 +1559,7 @@ function xa() {
1559
1559
  },
1560
1560
  fullScreen: {
1561
1561
  text: "全屏",
1562
- icon: i(zt, null, null)
1562
+ icon: i(Kt, null, null)
1563
1563
  }
1564
1564
  };
1565
1565
  }
@@ -1578,7 +1578,7 @@ function Sa(e, a) {
1578
1578
  return i("span", {
1579
1579
  key: l,
1580
1580
  onClick: u
1581
- }, [i(zt, null, null)]);
1581
+ }, [i(Kt, null, null)]);
1582
1582
  const o = xa()[l];
1583
1583
  return o ? i("span", {
1584
1584
  key: l,
@@ -1783,7 +1783,7 @@ function ka(e) {
1783
1783
  }
1784
1784
  function Aa({ rowKey: e, polling: a, request: l, postData: n, dataSource: u, waitRequest: o, debounceTime: c }, { search: h, columns: x, loading: y, setLoading: r, setColumns: C, removeRowKeys: d, syncSelectedRows: m, formParamsRef: b, setPagination: v, paginationInfo: F, onBeforeSearchSubmit: I, hasCustomRender: k }, E) {
1785
1785
  const L = P(), W = P(!0), O = P(!1), j = P(!1), D = P([]), ee = P(), oe = S(() => q(h.value) ? h.value?.manualRequest : !1), ie = async (T = {}) => {
1786
- const { pagination: s, filters: z = {}, sorter: G = {}, removeKeys: te = [], isPolling: Ce = !1 } = T;
1786
+ const { pagination: s, filters: K = {}, sorter: G = {}, removeKeys: te = [], isPolling: Ce = !1 } = T;
1787
1787
  if (!l || !Ie(l) || p(o) && y.value || O.value)
1788
1788
  return u.value || [];
1789
1789
  if (O.value = !0, !Ce || p(o) || W.value ? r(!0) : t(!0), p(o)) {
@@ -1809,9 +1809,9 @@ function Aa({ rowKey: e, polling: a, request: l, postData: n, dataSource: u, wai
1809
1809
  ...T.params,
1810
1810
  ...b
1811
1811
  };
1812
- I && Ie(I) && ($e = await I($e, G, z));
1812
+ I && Ie(I) && ($e = await I($e, G, K));
1813
1813
  let ue = [];
1814
- const xe = await l?.(Z(ve($e)), Ee, z);
1814
+ const xe = await l?.(Z(ve($e)), Ee, K);
1815
1815
  if (O.value = !1, xe && xe?.success) {
1816
1816
  ue = xe.data || [], n && Ie(n) && (ue = await n?.(ue)), m(ue);
1817
1817
  const _ = xe.total || ue?.length || 0;
@@ -1828,10 +1828,10 @@ function Aa({ rowKey: e, polling: a, request: l, postData: n, dataSource: u, wai
1828
1828
  return [];
1829
1829
  }, ae = Ia(async (T) => {
1830
1830
  ee.value && clearTimeout(ee.value);
1831
- const s = await ie(T), z = Fl(a.value, s);
1832
- return z && !L.value && (ee.value = setTimeout(() => {
1833
- ae.run({ ...T, isPolling: z });
1834
- }, Math.max(z, 2e3))), s;
1831
+ const s = await ie(T), K = Fl(a.value, s);
1832
+ return K && !L.value && (ee.value = setTimeout(() => {
1833
+ ae.run({ ...T, isPolling: K });
1834
+ }, Math.max(K, 2e3))), s;
1835
1835
  }, c.value || 10);
1836
1836
  rl(() => {
1837
1837
  L.value = !0, clearTimeout(ee.value);
@@ -1859,15 +1859,15 @@ function Aa({ rowKey: e, polling: a, request: l, postData: n, dataSource: u, wai
1859
1859
  function t(T) {
1860
1860
  j.value = T;
1861
1861
  }
1862
- function f(T, s, z, G) {
1863
- ae.run({ pagination: T, filters: s, sorter: z, extra: G, isPolling: !1 }), E("change", T, s, z, G);
1862
+ function f(T, s, K, G) {
1863
+ ae.run({ pagination: T, filters: s, sorter: K, extra: G, isPolling: !1 }), E("change", T, s, K, G);
1864
1864
  }
1865
1865
  function R(T) {
1866
1866
  const s = Bl(Z(T), p(F.value));
1867
1867
  if (!Ye(s, D.value) && (D.value = s, !l || !Ie(l))) {
1868
- const z = s.length || 0;
1869
- z !== p(F)?.total && v({
1870
- total: z
1868
+ const K = s.length || 0;
1869
+ K !== p(F)?.total && v({
1870
+ total: K
1871
1871
  });
1872
1872
  }
1873
1873
  }
@@ -1875,8 +1875,8 @@ function Aa({ rowKey: e, polling: a, request: l, postData: n, dataSource: u, wai
1875
1875
  dataSource: he,
1876
1876
  isTreeDataRef: Te,
1877
1877
  reSetDataList: R,
1878
- changeDataValue: ({ key: T, params: s, value: z, type: G = "update" }) => {
1879
- const te = T ?? e.value, Ce = s?.[te] ?? z;
1878
+ changeDataValue: ({ key: T, params: s, value: K, type: G = "update" }) => {
1879
+ const te = T ?? e.value, Ce = s?.[te] ?? K;
1880
1880
  switch (G) {
1881
1881
  case "update":
1882
1882
  te && Ce && s && (D.value = D.value.map((Y) => Ce === Y[te] ? It(Y, s, {
@@ -1891,7 +1891,7 @@ function Aa({ rowKey: e, polling: a, request: l, postData: n, dataSource: u, wai
1891
1891
  s && D.value.unshift(s), Le(!!s, "params is required");
1892
1892
  break;
1893
1893
  case "delete":
1894
- te && (D.value = D.value.filter((Y) => z !== Y[te]));
1894
+ te && (D.value = D.value.filter((Y) => K !== Y[te]));
1895
1895
  break;
1896
1896
  }
1897
1897
  },
@@ -2058,7 +2058,7 @@ function Ma({ searchMap: e, params: a, columns: l, setPagination: n }) {
2058
2058
  }
2059
2059
  return { formDataRef: c, formParamsRef: u, defaultParamsRef: o, setFormParams: y };
2060
2060
  }
2061
- function za(e) {
2061
+ function Ka(e) {
2062
2062
  const a = S(() => e.scroll), l = S(() => e.autoScroll), n = S(() => e.modalScroll), u = S(() => e.neverScroll), o = S(() => e.rowSelection), c = S(() => e.scrollBreakpoint);
2063
2063
  return {
2064
2064
  scroll: a,
@@ -2069,7 +2069,7 @@ function za(e) {
2069
2069
  scrollBreakpoint: c
2070
2070
  };
2071
2071
  }
2072
- function Ka({ scroll: e, columns: a, autoScroll: l, modalScroll: n, neverScroll: u, rowSelection: o, screens: c, innerWidth: h, scrollBreakpoint: x }) {
2072
+ function za({ scroll: e, columns: a, autoScroll: l, modalScroll: n, neverScroll: u, rowSelection: o, screens: c, innerWidth: h, scrollBreakpoint: x }) {
2073
2073
  const y = S(() => p(x) ? De(p(x)) ? h.value > p(x) : kt(p(x)) ? c.value?.[p(x)] : c.value?.xl : c.value?.xl), r = S(() => {
2074
2074
  let d = 0;
2075
2075
  const m = p(o) ? 60 : 0, b = 150, v = Z(p(a));
@@ -2430,22 +2430,22 @@ const {
2430
2430
  props: e,
2431
2431
  key: "pageItemRender"
2432
2432
  })
2433
- }), $ = za(e), {
2433
+ }), $ = Ka(e), {
2434
2434
  proScroll: T,
2435
2435
  breakpoint: s
2436
- } = Ka({
2436
+ } = za({
2437
2437
  ...$,
2438
2438
  innerWidth: C,
2439
2439
  columns: oe,
2440
2440
  screens: r
2441
- }), z = Fa(e), {
2441
+ }), K = Fa(e), {
2442
2442
  proColumns: G,
2443
2443
  cacheProColumns: te,
2444
2444
  setColumns: Ce,
2445
2445
  changeColumns: Y,
2446
2446
  resizeColumnWidth: Ee
2447
2447
  } = Ba({
2448
- ...z,
2448
+ ...K,
2449
2449
  breakpoint: s,
2450
2450
  scroll: T,
2451
2451
  columns: oe
@@ -2463,7 +2463,7 @@ const {
2463
2463
  }), {
2464
2464
  formDataRef: nt,
2465
2465
  formParamsRef: ot,
2466
- defaultParamsRef: Kt,
2466
+ defaultParamsRef: zt,
2467
2467
  setFormParams: qe
2468
2468
  } = Ma({
2469
2469
  searchMap: se(e, "searchMap"),
@@ -2522,8 +2522,8 @@ const {
2522
2522
  let g;
2523
2523
  const w = p(E).direction === "rtl" ? "bottomLeft" : "right", B = p(t)?.position;
2524
2524
  if (B !== null && Array.isArray(B)) {
2525
- const K = B.find((X) => X.includes("top")), Q = B.find((X) => X.includes("bottom")), A = B.every((X) => `${X}` == "none");
2526
- !K && !Q && !A && (g = w), K && (g = K.toLowerCase().replace("top", "")), Q && (g = Q.toLowerCase().replace("bottom", ""));
2525
+ const z = B.find((X) => X.includes("top")), Q = B.find((X) => X.includes("bottom")), A = B.every((X) => `${X}` == "none");
2526
+ !z && !Q && !A && (g = w), z && (g = z.toLowerCase().replace("top", "")), Q && (g = Q.toLowerCase().replace("bottom", ""));
2527
2527
  } else
2528
2528
  g = w;
2529
2529
  return g;
@@ -2538,8 +2538,8 @@ const {
2538
2538
  }), await Re());
2539
2539
  }, Qt = async (g, w) => {
2540
2540
  w === "reset" ? (a("reset", g), e.request && await mt(g, w)) : e.request ? (a("submit", g), await mt(g, w)) : a("submit", g);
2541
- }, vt = (g, w, B, K) => {
2542
- R(xt(g, ["current", "pageSize"])), dt(g, w, B, K);
2541
+ }, vt = (g, w, B, z) => {
2542
+ R(xt(g, ["current", "pageSize"])), dt(g, w, B, z);
2543
2543
  }, Xt = (g, w) => {
2544
2544
  R({
2545
2545
  current: g,
@@ -2554,7 +2554,7 @@ const {
2554
2554
  }, Jt = (g, w) => {
2555
2555
  a("expand", g, w);
2556
2556
  }, Zt = (g, w) => Ee(g, w), el = (g, w, B) => {
2557
- let K = g;
2557
+ let z = g;
2558
2558
  if (w) {
2559
2559
  const Q = V(g) ? typeof g?.[0]?.children == "string" ? g?.[0]?.children : "" : g ? g.toString() : "", A = B.tooltip === !1 ? {} : B.tooltip, X = B.tooltip === !1 ? 1 : De(A?.hiddenLine) && A?.hiddenLine > 0 ? A?.hiddenLine : 1, Se = B.tooltip === !1 ? 0 : De(A?.width) ? A?.width : 0, al = B.tooltip !== !1 && kt(Q) && Se > 0 ? Dl(Q, {
2560
2560
  cssObject: {
@@ -2573,14 +2573,14 @@ const {
2573
2573
  }), Ga(Me) ? Me : {
2574
2574
  default: () => [Me]
2575
2575
  });
2576
- if (K = i("div", {
2576
+ if (z = i("div", {
2577
2577
  class: `${o}-ellipsis ${A?.class ?? ""}`,
2578
2578
  style: {
2579
2579
  "-webkit-line-clamp": X
2580
2580
  }
2581
2581
  }, [pt()]), B.copyable) {
2582
2582
  const Ge = typeof B.copyText == "function" ? B.copyText?.(B) : B.copyText || Q;
2583
- K = i("div", {
2583
+ z = i("div", {
2584
2584
  class: `${o}-copyable`
2585
2585
  }, [i("div", {
2586
2586
  class: `${o}-ellipsis ${A?.class ?? ""}`,
@@ -2595,7 +2595,7 @@ const {
2595
2595
  }, null)]);
2596
2596
  }
2597
2597
  }
2598
- return K;
2598
+ return z;
2599
2599
  };
2600
2600
  function gt() {
2601
2601
  const g = jl({
@@ -2604,7 +2604,7 @@ const {
2604
2604
  key: "emptyText"
2605
2605
  });
2606
2606
  if (g !== !1 && m?.emptyText?.value !== !1) {
2607
- const B = e.emptyTextProps?.extraProps || {}, K = g || m?.emptyText?.value, Q = U(K), A = Q ? Tt(K, B) : Bt(V(K) ? K : [K]);
2607
+ const B = e.emptyTextProps?.extraProps || {}, z = g || m?.emptyText?.value, Q = U(z), A = Q ? Tt(z, B) : Bt(V(z) ? z : [z]);
2608
2608
  return i("div", {
2609
2609
  class: re(`${o}-empty-text`, h.value, e.emptyTextProps?.class),
2610
2610
  style: e.emptyTextProps?.style
@@ -2735,7 +2735,7 @@ const {
2735
2735
  prefixCls: o,
2736
2736
  loading: !!p(ie),
2737
2737
  onSearch: Qt,
2738
- defaultParams: Kt
2738
+ defaultParams: zt
2739
2739
  }, {
2740
2740
  default: l.search ? () => l.search?.() : null
2741
2741
  }), i("div", {
@@ -2765,13 +2765,13 @@ const {
2765
2765
  column: B
2766
2766
  } = w;
2767
2767
  if (!B) return w.text;
2768
- const K = B?.key || B?.dataIndex;
2768
+ const z = B?.key || B?.dataIndex;
2769
2769
  let Q = !0, A = w.text;
2770
2770
  if (V(A))
2771
2771
  if (A.length === 0 || A.length === 1 && !U(A[0])) {
2772
2772
  A = A?.[0];
2773
2773
  const X = Al(A, B?.columnEmptyText || e?.columnEmptyText || "");
2774
- Q = X.success, A = Va(X.value, B?.valueType || e.columns?.find((Se) => (Se.key || Se.dataIndex) === K)?.valueType, o, h.value);
2774
+ Q = X.success, A = Va(X.value, B?.valueType || e.columns?.find((Se) => (Se.key || Se.dataIndex) === z)?.valueType, o, h.value);
2775
2775
  } else A[0]?.type === "template" && (A = A[0]?.children);
2776
2776
  return B?.ellipsis ? el(A, Q, B) : A;
2777
2777
  },
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * Gx Design Pro
3
- * Version: 0.2.0-beta.118
3
+ * Version: 0.2.0-beta.119
4
4
  * Author: gx12358
5
5
  * Copyright (C) 2024 gx12358
6
6
  * License: MIT License
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gx-design-vue/pro-table",
3
3
  "type": "module",
4
- "version": "0.2.0-beta.119",
4
+ "version": "0.2.0-beta.120",
5
5
  "description": "Gx Design Pro Table",
6
6
  "publishConfig": {
7
7
  "access": "public",
@@ -35,10 +35,10 @@
35
35
  "vue": ">=3.0.0"
36
36
  },
37
37
  "dependencies": {
38
- "@gx-design-vue/pro-app": "^0.1.0-beta.32",
39
- "@gx-design-vue/pro-hooks": "^0.2.0-beta.53",
40
- "@gx-design-vue/pro-provider": "^0.1.0-beta.118",
41
- "@gx-design-vue/pro-utils": "^0.2.0-beta.79",
38
+ "@gx-design-vue/pro-app": "^0.1.0-beta.33",
39
+ "@gx-design-vue/pro-hooks": "^0.2.0-beta.54",
40
+ "@gx-design-vue/pro-provider": "^0.1.0-beta.119",
41
+ "@gx-design-vue/pro-utils": "^0.2.0-beta.80",
42
42
  "@vueuse/core": "^9.10.0",
43
43
  "dayjs": "^1.11.0",
44
44
  "lodash-es": "^4.17.21"